html_url
stringlengths
48
51
title
stringlengths
5
280
comments
stringlengths
63
51.8k
body
stringlengths
0
36.2k
comment_length
int64
16
1.52k
text
stringlengths
159
54.1k
embeddings
listlengths
768
768
https://github.com/huggingface/datasets/issues/3064
Make `interleave_datasets` more robust
Hi ! Sorry for the late response I agree `interleave_datasets` would benefit a lot from having more flexibility. If I understand correctly it would be nice to be able to define stopping strategies like `stop="first_exhausted"` (default) or `stop="all_exhausted"`. If you'd like to contribute this feature I'd be happy to give you some pointers :) Also one can already set the max number of iterations per dataset by doing `dataset.take(n)` on the dataset that should only have `n` samples. Regarding the `iter_cnt` counter, I think this requires a bit more thoughts, since we might have to be able to backpropagate the the counter if `map` or other transforms have been applied after `interleave_datasets`.
**Is your feature request related to a problem? Please describe.** Right now there are few hiccups using `interleave_datasets`. Interleaved dataset iterates until the smallest dataset completes it's iterator. In this way larger datasets may not complete full epoch of iteration. It creates new problems in calculation of epoch since there are no way to track which dataset from `interleave_datasets` completes how many epoch. **Describe the solution you'd like** For `interleave_datasets` module, - [ ] Add a boolean argument `--stop-iter` in `interleave_datasets` that enables dataset to either iterate infinite amount of time or not. That means it should not return `StopIterator` exception in case `--stop-iter=False`. - [ ] Internal list variable `iter_cnt` that explains how many times (in steps/epochs) each dataset iterates at a given point. - [ ] Add an argument `--max-iter` (list type) that explain maximum amount of time each of the dataset can iterate. After complete `--max-iter` of one dataset, other dataset should continue sampling and when all the dataset finish their respective `--max-iter`, only then return `StopIterator` Note: I'm new to `datasets` api. May be these features are already there in the datasets. Since multitask training is the latest trends, I believe this feature would make the `datasets` api more popular. @lhoestq
112
Make `interleave_datasets` more robust **Is your feature request related to a problem? Please describe.** Right now there are few hiccups using `interleave_datasets`. Interleaved dataset iterates until the smallest dataset completes it's iterator. In this way larger datasets may not complete full epoch of iteration. It creates new problems in calculation of epoch since there are no way to track which dataset from `interleave_datasets` completes how many epoch. **Describe the solution you'd like** For `interleave_datasets` module, - [ ] Add a boolean argument `--stop-iter` in `interleave_datasets` that enables dataset to either iterate infinite amount of time or not. That means it should not return `StopIterator` exception in case `--stop-iter=False`. - [ ] Internal list variable `iter_cnt` that explains how many times (in steps/epochs) each dataset iterates at a given point. - [ ] Add an argument `--max-iter` (list type) that explain maximum amount of time each of the dataset can iterate. After complete `--max-iter` of one dataset, other dataset should continue sampling and when all the dataset finish their respective `--max-iter`, only then return `StopIterator` Note: I'm new to `datasets` api. May be these features are already there in the datasets. Since multitask training is the latest trends, I believe this feature would make the `datasets` api more popular. @lhoestq Hi ! Sorry for the late response I agree `interleave_datasets` would benefit a lot from having more flexibility. If I understand correctly it would be nice to be able to define stopping strategies like `stop="first_exhausted"` (default) or `stop="all_exhausted"`. If you'd like to contribute this feature I'd be happy to give you some pointers :) Also one can already set the max number of iterations per dataset by doing `dataset.take(n)` on the dataset that should only have `n` samples. Regarding the `iter_cnt` counter, I think this requires a bit more thoughts, since we might have to be able to backpropagate the the counter if `map` or other transforms have been applied after `interleave_datasets`.
[ -0.2761628031730652, -0.02677612006664276, -0.2281198799610138, 0.08258125931024551, -0.14361630380153656, 0.017641671001911163, 0.23505131900310516, 0.1321873664855957, 0.06680996716022491, 0.12620005011558533, -0.07270078361034393, 0.21606025099754333, -0.293736070394516, 0.21954068541526794, -0.39019742608070374, -0.07878410816192627, -0.10785075277090073, 0.025660984218120575, 0.005500979721546173, 0.10845828056335449, -0.08846898376941681, -0.03923748433589935, -0.23208551108837128, -0.1774742752313614, 0.032400522381067276, -0.16139140725135803, -0.02174999564886093, 0.02012835070490837, -0.1335415542125702, -0.4846919775009155, 0.3222349286079407, 0.49898070096969604, 0.05766863375902176, 0.18445193767547607, -0.00010291017679264769, -0.2331843227148056, 0.30969685316085815, 0.1142617017030716, -0.3606042265892029, -0.03304468095302582, -0.5180080533027649, -0.4774474799633026, -0.11738114058971405, -0.37933388352394104, 0.015806857496500015, 0.1882893145084381, -0.1360418200492859, -0.5695600509643555, 0.23498693108558655, -0.03315427899360657, 0.2335599809885025, 0.3637520372867584, -0.08684228360652924, 0.0042794677428901196, -0.005474910140037537, 0.0639813169836998, -0.07197123765945435, 0.21524101495742798, 0.4655750095844269, -0.23991890251636505, -0.060585521161556244, 0.1811533272266388, -0.1347370743751526, -0.04862217977643013, 0.08046790957450867, -0.24881432950496674, -0.0615493580698967, -0.4173450469970703, -0.2095305621623993, 0.18786481022834778, 0.5767528414726257, -0.10773760825395584, -0.2158644199371338, -0.34052321314811707, -0.013739214278757572, -0.30751678347587585, -0.14751556515693665, -0.08026401698589325, 0.026268579065799713, 0.10854959487915039, 0.0721835345029831, -0.020737094804644585, -0.2463059425354004, 0.13547450304031372, 0.020303204655647278, 0.08232386410236359, 0.05469098687171936, 0.16377654671669006, 0.4462386965751648, 0.039102379232645035, 0.03503125533461571, 0.10611322522163391, 0.09217820316553116, -0.044217970222234726, -0.6266493797302246, -0.5033037662506104, -0.15816861391067505, -0.2036350965499878, 0.29424405097961426, 0.42750632762908936, -0.22969014942646027, 0.048498526215553284, 0.11233118176460266, 0.044713094830513, 0.4000861644744873, -0.32539695501327515, 0.17582756280899048, -0.11441405117511749, 0.06159370392560959, 0.11199776083230972, -0.048309631645679474, -0.0035197772085666656, 0.14582940936088562, -0.3496629297733307, 0.11504590511322021, 0.10694317519664764, 0.07134661823511124, 0.009936336427927017, -0.15097986161708832, 0.2501087188720703, -0.53504878282547, -0.3373631536960602, 0.21838654577732086, -0.14140483736991882, -0.013841694220900536, 0.2098989486694336, -0.200276717543602, -0.1695435345172882, -0.16407504677772522, -0.6169528961181641, -0.07851659506559372, 0.06313145160675049, -0.2880622446537018, 0.25515374541282654, -0.07688611000776291, -0.044896889477968216, -0.06475590914487839, -0.08532202988862991, 0.20498113334178925, 0.15975388884544373, 0.5050390958786011, -0.357048362493515, 0.15112611651420593, -0.20784591138362885, -0.028805043548345566, 0.20930694043636322, -0.0869176983833313, 0.13483917713165283, -0.19665685296058655, -0.1745510995388031, -0.13513079285621643, -0.2883310317993164, -0.13254199922084808, 0.1660279780626297, -0.21402737498283386, 0.027772651985287666, -0.06583777815103531, 0.31071507930755615, 0.3057861626148224, -0.16658993065357208, 0.39259782433509827, 0.09082961082458496, -0.1815749704837799, -0.14617958664894104, 0.0994148701429367, 0.42973577976226807, 0.01195434108376503, 0.196402907371521, 0.1481449007987976, -0.011980012059211731, 0.024034686386585236, 0.2500753700733185, -0.1783519685268402, -0.04442103952169418, -0.04179111495614052, -0.022949714213609695, 0.12762291729450226, -0.1836027354001999, -0.17980602383613586, 0.25695398449897766, -0.05390901863574982, 0.27338987588882446, 0.11449216306209564, 0.1367233246564865, 0.5195673704147339, -0.3457624316215515, 0.022050730884075165, 0.5118296146392822, -0.160142183303833, -0.2958237826824188, -0.41672763228416443, -0.08655792474746704, 0.19592292606830597, 0.13987112045288086, 0.21512696146965027, -0.23316600918769836, -0.030847832560539246, 0.05222281068563461, 0.27597421407699585, 0.15734897553920746, 0.29524675011634827, -0.05530083179473877, 0.4072127640247345, 0.03796400502324104, 0.028807714581489563, -0.4155169725418091, -0.026287004351615906, 0.2050917148590088, 0.2495894730091095, 0.12960991263389587, 0.30356287956237793, 0.04880150407552719, 0.04049970209598541, 0.06149931997060776, -0.10393965244293213, -0.017839618027210236, 0.1349080353975296, -0.0732683390378952, -0.017634518444538116, 0.06788603961467743, -0.13623374700546265, 0.2613450884819031, -0.3604568541049957, -0.10668804496526718, -0.6534062623977661, 0.4651688039302826, 0.24252264201641083, 0.13053111732006073, -0.1394575834274292, 0.31350934505462646, -0.14792713522911072, -0.19943521916866302, -0.0461132749915123, 0.2845728397369385, 0.04862411320209503, 0.23475053906440735, 0.15560057759284973, 0.47616714239120483, 0.18092845380306244, -0.13387832045555115, 0.07032959908246994, -0.2648158371448517, 0.06068452447652817, -0.0007648691534996033, 0.31755346059799194, 0.39982110261917114, -0.022580120712518692, 0.48037654161453247, 0.008762568235397339, 0.1190415695309639, -0.016087643802165985, -0.12849757075309753, -0.5069755911827087, -0.12079782038927078, 0.021018803119659424, -0.23644547164440155, 0.20244616270065308, -0.07130760699510574, -0.22074513137340546, 0.1953626275062561, 0.24897505342960358, -0.024850528687238693, -0.3835268020629883, 0.04155360907316208, 0.016325678676366806, -0.0897904485464096, 0.10424049943685532, -0.116122767329216, 0.2828417122364044, 0.13304264843463898, 0.13016407191753387, -0.3483983278274536, -0.0380270853638649, -0.008603157475590706, 0.2595030665397644, 0.36554551124572754, 0.167419895529747, 0.056405000388622284, 0.12044757604598999, 0.0014805709943175316, 0.05275746434926987, -0.5950493216514587, -0.038545019924640656, 0.17708387970924377, 0.10969388484954834, 0.06408814340829849, -0.2621547281742096, -0.368008017539978, 0.06819260865449905, -0.6488368511199951, 0.03817501291632652, -0.25775277614593506, -0.11574262380599976, 0.3055374324321747, 0.02528967335820198, 0.17272207140922546, -0.1768375039100647, 0.5564212203025818, 0.07009810954332352, 0.22798313200473785, 0.1557440459728241, -0.22285202145576477, 0.039395879954099655, 0.16966906189918518, 0.3473247289657593, 0.03296265751123428, 0.5358966588973999, 0.258357435464859, -0.3434816598892212, -0.2942486107349396, -0.12550705671310425, 0.10397468507289886, 0.021297955885529518, 0.1633990854024887, 0.24611040949821472, -0.043424397706985474, 0.2579256296157837, -0.10643354058265686, 0.09737783670425415, -0.1943286806344986, 0.03528367727994919, -0.2851583659648895, -0.09661929309368134, 0.12932094931602478, 0.1373201161623001, -0.20613950490951538, -0.39077872037887573, -0.5744431018829346, 0.18305417895317078, -0.26302969455718994, -0.022606253623962402, 0.07337544113397598, -0.014527167193591595, -0.055419836193323135, 0.2439119964838028, -0.13797275722026825, -0.42755797505378723, -0.4541753828525543, 0.008382301777601242, -0.3154561221599579, 0.09628106653690338, -0.20897473394870758, -0.2178545892238617, 0.36010831594467163, 0.04043232649564743, -0.21133430302143097, -0.11561380326747894, -0.1259363442659378, 0.12759949266910553, -0.2569725811481476, 0.05643818899989128, 0.004096105694770813, -0.07813624292612076, -0.025157978758215904, 0.14152070879936218, -0.11603938043117523, 0.2345009446144104, 0.33520302176475525, 0.11504346132278442, 0.19144269824028015, 0.4896908104419708, 0.2744141221046448, 0.760933518409729, 0.34324172139167786, -0.09633904695510864, 0.14296722412109375, 0.24946461617946625, -0.0945327877998352, 0.058852419257164, -0.5456916689872742, 0.48958995938301086, 0.001568332314491272, -0.09703071415424347, 0.2695906162261963, -0.28644660115242004, -0.19883370399475098, -0.048696182668209076, -0.306157648563385, 0.36714819073677063, -0.35625067353248596, 0.26135894656181335, -0.331724613904953, 0.2729778289794922, -0.15115490555763245, -0.10532080382108688, -0.27842941880226135, -0.004035845398902893, -0.037399306893348694, 0.2130175232887268, 0.19484387338161469, -0.052523255348205566, -0.32408782839775085, -0.06423117220401764, -0.23321181535720825, 0.1742202639579773, 0.08732041716575623, 0.3459324240684509, 0.28185904026031494, -0.10531620681285858, -0.08174373209476471, 0.15823517739772797, 0.7222213745117188, -0.3114628195762634, -0.5551159381866455, 0.1340237259864807, 0.06486990302801132, 0.01920408569276333, -0.3548583686351776, 0.01804734393954277, 0.2959228754043579, 0.2212909311056137, -0.15639057755470276, -0.20848578214645386, -0.2348104566335678, 0.37371590733528137, 0.305600106716156, -0.08982247114181519, -0.07044673711061478, 0.061919961124658585, 0.0762164294719696, -0.3441215455532074, 0.28738418221473694, 0.03373096138238907, 0.046192754060029984, -0.1047629714012146, -0.2671456038951874, 0.018883738666772842, 0.012785051017999649, 0.19735805690288544, 0.0906035453081131, -0.11573680490255356, 0.016961243003606796, 0.588355302810669, 0.01827736757695675, -0.14895954728126526, 0.5764240622520447, 0.15490198135375977, -0.2434140145778656, -0.15156887471675873, 0.2016177773475647, -0.10404152423143387, 0.40354612469673157, 0.2890856862068176, 0.07427205890417099, 0.5085602402687073, 0.003063976764678955, 0.32955437898635864, -0.24483150243759155, 0.07801593095064163, 0.1664181798696518, 0.11629124730825424, -0.7030430436134338, -0.5904857516288757, 0.06420570611953735, 0.0322851687669754, -0.07618266344070435, 0.43056759238243103, -0.1158006340265274, -0.20851284265518188, 0.05082182213664055, 0.33683493733406067, 0.8604179620742798, 0.3606194853782654, -0.07501564919948578, 0.07446475327014923, 0.25459128618240356, 0.4491744935512543, -0.03620797023177147, 0.13299819827079773, -0.08579731732606888, -0.3474792242050171, -0.0031945332884788513, 0.024182099848985672, 0.16166186332702637, -0.07091526687145233, -0.0723147988319397, 0.25232940912246704, 0.3672226667404175, 0.09385651350021362, -0.1721387356519699, 0.3993474841117859, 0.00044993869960308075, -0.4117496609687805, 0.331193745136261, 0.22213312983512878, 0.004620850086212158, -0.18250182271003723, 0.016825595870614052, -0.3654453158378601, 0.34709781408309937, 0.19277217984199524, -0.33099591732025146, -0.28240063786506653, -0.05031152069568634, 0.2167302370071411, 0.007970873266458511, -0.3740530014038086, 0.3721044063568115, -0.4396040141582489, 0.2947407066822052, -0.06744103133678436, 0.010286720469594002, -0.18626222014427185, 0.013888008892536163, -0.1078079491853714, -0.20237135887145996, -0.2371542900800705, 0.41693928837776184, -0.08318126201629639, -0.11202351003885269, 0.1351839005947113, 0.2699114680290222, -0.36366039514541626, -0.1257142722606659, 0.20617157220840454, 0.2581402063369751, -0.1882093846797943, -0.06631644070148468, 0.30816560983657837, -0.2076968550682068, -0.23488648235797882, 0.10078465938568115, 0.2526906132698059, -0.10564221441745758, 0.4865563213825226, -0.43052107095718384, 0.07840181887149811, -0.2563134729862213, 0.05527728050947189, 0.10492198914289474, -0.2500306963920593, 0.1733136624097824, -0.042151160538196564, -0.1824711412191391, -0.24399062991142273, 0.00963638722896576, -0.08393885940313339, 0.036246903240680695, 0.1757909655570984, -0.00822885800153017, 0.18850921094417572, 0.06170119345188141, 0.012310829013586044, 0.09516499936580658, 0.2268523871898651, 0.07529781758785248, -0.26381123065948486, -0.057430244982242584, 0.21880365908145905, -0.20610035955905914, 0.34638693928718567, -0.3857489824295044, 0.1912781447172165, -0.21783329546451569, 0.15797102451324463, -0.3925350606441498, -0.07415739446878433, -0.14210215210914612, -0.04904986917972565, 0.21839019656181335, -0.23634299635887146, -0.257697194814682, 0.0037257084622979164, -0.020166967064142227, 0.21378110349178314, -0.1747782677412033, -0.19191530346870422, -0.1987367570400238, 0.13374647498130798, -0.0492800697684288, -0.05093412101268768, 0.17703942954540253, -0.21576562523841858, -0.12356479465961456, -0.2638661861419678, -0.22778958082199097, 0.03871803730726242, -0.04405926913022995, 0.0838175043463707, -0.017775867134332657, -0.033623747527599335, -0.22289182245731354, 0.32090431451797485, 0.18101900815963745, -0.1575000137090683, 0.2742423713207245, 0.35546720027923584, 0.07729026675224304, -0.09799908101558685, -0.04638330265879631, 0.1929282397031784, 0.093108631670475, 0.035731662064790726, 0.1579049825668335, 0.20352120697498322, -0.3657193183898926, 0.4008673131465912, 0.12459403276443481, 0.5284939408302307, -0.012258955277502537, -0.04222811013460159, 0.22038528323173523, 0.2677904963493347, -0.0073692090809345245, -0.005888667423278093, 0.20056670904159546, -0.14474955201148987, 0.33134931325912476, 0.3302955627441406, 0.4344480037689209, -0.10804523527622223, 0.24776414036750793, 0.07021632045507431, 0.04771881178021431, -0.25052422285079956, 0.17985782027244568, 0.03604342043399811, 0.20994533598423004, -0.16805481910705566, 0.2113361656665802, -0.005254577845335007, 0.5013083815574646, -0.04867450147867203, -0.2820396423339844, 0.7008602619171143, 0.4868065416812897, -0.11184874176979065, 0.16661003232002258, -0.22925283014774323, -0.12805773317813873, -0.07581543922424316, -0.03895692527294159, 0.2300093173980713, 0.12984709441661835, 0.374178022146225, -0.1725955456495285, -0.27063828706741333, -0.1254594624042511, 0.07424919307231903, 0.10761493444442749, 0.12275974452495575, -0.2761707305908203, -0.244430810213089, -0.2058439403772354, -0.16274651885032654, 0.09221379458904266, -0.2115713506937027, 0.48003655672073364, -0.12358070909976959, 0.021344482898712158, -0.21184922754764557, -0.08695600181818008, 0.17202508449554443, 0.42764943838119507, -0.1635298728942871, -0.23796214163303375, 0.19620978832244873, -0.31037119030952454, -0.22853690385818481, 0.10637972503900528, 0.02698112092912197, 0.20378050208091736, -0.14825765788555145, 0.1129833236336708, 0.23769980669021606, -0.09221738576889038, -0.14955143630504608, 0.20324528217315674, -0.12627361714839935, -0.41523194313049316, 0.28031396865844727, 0.14755883812904358, -0.16998760402202606, 0.14708060026168823, 0.27449285984039307, -0.033675823360681534, -0.6721989512443542, -0.2449239194393158, 0.5375430583953857, -0.048182472586631775, 0.0871029794216156, 0.07818542420864105, -0.37721502780914307, -0.03961969539523125, 0.04268345981836319, -0.12993223965168, 0.04671810567378998, -0.09694430232048035, 0.11000370979309082, -0.3208748698234558, 0.35772109031677246, 0.24216541647911072, 0.04086797684431076, -0.17970536649227142, -0.09149538725614548, -0.3529820144176483, 0.05262550339102745, -0.22866290807724, 0.048063069581985474, 0.018627144396305084, 0.3561460077762604, 0.24890431761741638, 0.09960796684026718, 0.1414404809474945, -0.21411944925785065, -0.05980531871318817, 0.36822548508644104, -0.5179529190063477, -0.23684202134609222, 0.2555782198905945, -0.09390056878328323, 0.19414429366588593, 0.06204976141452789, -0.031550128012895584, 0.023658934980630875, 0.023151904344558716, -0.051014646887779236, -0.2416456937789917, 0.36937886476516724, -0.007732521742582321, 0.4189550280570984, 0.1523561179637909, -0.07765425741672516, -0.17581573128700256, 0.005194248631596565, -0.3048616349697113, 0.06847857683897018, -0.20625922083854675, 0.13304299116134644, 0.21667367219924927, 0.3807477653026581, -0.11315546184778214, 0.1587844341993332, -0.15129679441452026, 0.27882346510887146, 0.13328434526920319, 0.15241286158561707, -0.3281283676624298, 0.07615726441144943, 0.2165743112564087, 0.269549697637558, -0.2904873490333557, 0.4091743528842926, 0.11177551746368408, 0.14996440708637238, -0.2570098042488098, -0.182657852768898, 0.11303627490997314, -0.1717187911272049, -0.2804023325443268, -0.31521403789520264, 0.2659561038017273, 0.23626405000686646, 0.11071830987930298, -0.21558985114097595, -0.24185249209403992, 0.30968141555786133, -0.08795763552188873, -0.22523416578769684, 0.46609702706336975, 0.34102046489715576, 0.17394360899925232, -0.11504045128822327, 0.06514344364404678, 0.008215760812163353, -0.2375079244375229, 0.2921960651874542, -0.26060977578163147 ]
https://github.com/huggingface/datasets/issues/3064
Make `interleave_datasets` more robust
@sbmaruf I just notice that (1)`interleave_datasets` only samples indices once and reuse for all epochs, and (2) it's limited by the smallest dataset. Do you figure out an alternative way to achieve the same purpose?
**Is your feature request related to a problem? Please describe.** Right now there are few hiccups using `interleave_datasets`. Interleaved dataset iterates until the smallest dataset completes it's iterator. In this way larger datasets may not complete full epoch of iteration. It creates new problems in calculation of epoch since there are no way to track which dataset from `interleave_datasets` completes how many epoch. **Describe the solution you'd like** For `interleave_datasets` module, - [ ] Add a boolean argument `--stop-iter` in `interleave_datasets` that enables dataset to either iterate infinite amount of time or not. That means it should not return `StopIterator` exception in case `--stop-iter=False`. - [ ] Internal list variable `iter_cnt` that explains how many times (in steps/epochs) each dataset iterates at a given point. - [ ] Add an argument `--max-iter` (list type) that explain maximum amount of time each of the dataset can iterate. After complete `--max-iter` of one dataset, other dataset should continue sampling and when all the dataset finish their respective `--max-iter`, only then return `StopIterator` Note: I'm new to `datasets` api. May be these features are already there in the datasets. Since multitask training is the latest trends, I believe this feature would make the `datasets` api more popular. @lhoestq
35
Make `interleave_datasets` more robust **Is your feature request related to a problem? Please describe.** Right now there are few hiccups using `interleave_datasets`. Interleaved dataset iterates until the smallest dataset completes it's iterator. In this way larger datasets may not complete full epoch of iteration. It creates new problems in calculation of epoch since there are no way to track which dataset from `interleave_datasets` completes how many epoch. **Describe the solution you'd like** For `interleave_datasets` module, - [ ] Add a boolean argument `--stop-iter` in `interleave_datasets` that enables dataset to either iterate infinite amount of time or not. That means it should not return `StopIterator` exception in case `--stop-iter=False`. - [ ] Internal list variable `iter_cnt` that explains how many times (in steps/epochs) each dataset iterates at a given point. - [ ] Add an argument `--max-iter` (list type) that explain maximum amount of time each of the dataset can iterate. After complete `--max-iter` of one dataset, other dataset should continue sampling and when all the dataset finish their respective `--max-iter`, only then return `StopIterator` Note: I'm new to `datasets` api. May be these features are already there in the datasets. Since multitask training is the latest trends, I believe this feature would make the `datasets` api more popular. @lhoestq @sbmaruf I just notice that (1)`interleave_datasets` only samples indices once and reuse for all epochs, and (2) it's limited by the smallest dataset. Do you figure out an alternative way to achieve the same purpose?
[ -0.3180108964443207, 0.020007207989692688, -0.21414341032505035, 0.07380684465169907, -0.15120552480220795, 0.09728493541479111, 0.28418564796447754, 0.1712978035211563, 0.11678558588027954, 0.22174303233623505, -0.04090529680252075, 0.17800270020961761, -0.2643423080444336, 0.16457167267799377, -0.36016541719436646, -0.08995281159877777, -0.15065020322799683, 0.08043396472930908, 0.03635367006063461, 0.09214961528778076, -0.09856218099594116, -0.08655309677124023, -0.2503177225589752, -0.20045118033885956, -0.018652524799108505, -0.15087300539016724, -0.05609002709388733, -0.06692304462194443, -0.13423897325992584, -0.45507290959358215, 0.40158674120903015, 0.45923689007759094, 0.08094558119773865, 0.1857026368379593, -0.00010423277853988111, -0.21631638705730438, 0.31000709533691406, 0.09759648889303207, -0.340554416179657, -0.09253561496734619, -0.5479873418807983, -0.5046607851982117, -0.12646061182022095, -0.4241686463356018, -0.0336068756878376, 0.1824619024991989, -0.09805542230606079, -0.592487633228302, 0.2108544111251831, -0.06380792707204819, 0.22023901343345642, 0.31796228885650635, -0.17181015014648438, -0.09026015549898148, 0.0019899383187294006, 0.033412687480449677, -0.039524488151073456, 0.19819262623786926, 0.39842239022254944, -0.11000662297010422, -0.03584269434213638, 0.22183290123939514, -0.15856534242630005, 0.014710313640534878, 0.07744385302066803, -0.22820954024791718, -0.010329939424991608, -0.35662275552749634, -0.18171390891075134, 0.20701509714126587, 0.628218948841095, -0.08270282298326492, -0.2502928674221039, -0.3109866678714752, -0.011529122479259968, -0.2778710424900055, -0.15575146675109863, -0.08084675669670105, 0.07009266316890717, 0.12606963515281677, 0.11942008137702942, -0.0028111955616623163, -0.2359723001718521, 0.1535620391368866, 0.05489843338727951, 0.09432829916477203, 0.032668665051460266, 0.21283408999443054, 0.445790559053421, 0.03104657307267189, 0.0727832242846489, 0.16355352103710175, 0.07765951007604599, -0.08093751966953278, -0.6083394289016724, -0.46288901567459106, -0.14626795053482056, -0.32383477687835693, 0.2751966416835785, 0.3506413698196411, -0.27195054292678833, 0.04452558606863022, 0.12627652287483215, -0.030132941901683807, 0.3562788963317871, -0.25736889243125916, 0.1870328038930893, -0.05348322540521622, 0.05093405395746231, 0.08901666104793549, -0.07094836980104446, -0.05782976746559143, 0.12639664113521576, -0.2821691632270813, 0.0859765112400055, 0.12652218341827393, 0.0580364465713501, -0.019447464495897293, -0.20456719398498535, 0.24849635362625122, -0.5247171521186829, -0.36193934082984924, 0.19930049777030945, -0.1039729192852974, 0.02080845832824707, 0.1771754026412964, -0.17776650190353394, -0.11180904507637024, -0.18448945879936218, -0.5528860092163086, -0.1130366250872612, 0.06679818034172058, -0.23032987117767334, 0.29192039370536804, -0.0676305815577507, -0.03387276455760002, -0.08794698864221573, -0.1051260381937027, 0.21055322885513306, 0.1278376281261444, 0.45794737339019775, -0.35018396377563477, 0.15683269500732422, -0.21265368163585663, -0.012797586619853973, 0.2848515212535858, -0.04987534508109093, 0.1773093193769455, -0.21496084332466125, -0.181187242269516, -0.16264000535011292, -0.33559098839759827, -0.08930858969688416, 0.13412214815616608, -0.15691499412059784, 0.05208522826433182, -0.03382853418588638, 0.3384440839290619, 0.33058252930641174, -0.18523304164409637, 0.3839438557624817, 0.15063121914863586, -0.25553780794143677, -0.13467071950435638, 0.11082347482442856, 0.41852283477783203, 0.06700675189495087, 0.15245072543621063, 0.1088203713297844, -0.006410468369722366, 0.06385336816310883, 0.24265579879283905, -0.16434015333652496, -0.10587245970964432, -0.029049070551991463, 0.018840394914150238, 0.10133808851242065, -0.20700626075267792, -0.2873878479003906, 0.24271932244300842, -0.10997311770915985, 0.20784929394721985, 0.15792396664619446, 0.19052967429161072, 0.5740698575973511, -0.3033629357814789, 0.03983147069811821, 0.5032445788383484, -0.155797079205513, -0.2820858359336853, -0.3701828718185425, -0.1497054100036621, 0.1810329109430313, 0.16438814997673035, 0.24821500480175018, -0.19690105319023132, -0.05508006364107132, 0.053505703806877136, 0.2944953739643097, 0.1725156456232071, 0.30134648084640503, -0.082574263215065, 0.3786342144012451, -0.004685677587985992, 0.032009903341531754, -0.39742860198020935, 0.07255735993385315, 0.2308826446533203, 0.3403230607509613, 0.10229094326496124, 0.28222885727882385, -0.02433517575263977, 0.07358518242835999, 0.04272894561290741, -0.08072581887245178, 0.04177742451429367, 0.11698433756828308, -0.05947388708591461, -0.03615991771221161, 0.039919476956129074, -0.09947603195905685, 0.16714708507061005, -0.34476613998413086, -0.14407987892627716, -0.645192563533783, 0.42404764890670776, 0.2769066393375397, 0.13268128037452698, -0.17271846532821655, 0.2780897617340088, -0.13440543413162231, -0.21970370411872864, -0.05336561053991318, 0.23265236616134644, 0.04034704342484474, 0.2862798869609833, 0.13039255142211914, 0.4054476022720337, 0.15706709027290344, -0.16124248504638672, 0.10322582721710205, -0.200323224067688, 0.014892487786710262, 0.026333682239055634, 0.2798820734024048, 0.3756696581840515, -0.008723650127649307, 0.43551814556121826, -0.09023712575435638, 0.13087229430675507, -0.051910899579524994, -0.17033319175243378, -0.44809389114379883, -0.22963707149028778, -0.037397999316453934, -0.2829393744468689, 0.19737188518047333, -0.046576932072639465, -0.23822389543056488, 0.2200159728527069, 0.1892601102590561, -0.040634021162986755, -0.30605989694595337, -0.027068719267845154, 0.0009905248880386353, -0.048738449811935425, 0.09804457426071167, -0.05335645005106926, 0.1794954240322113, 0.1633949875831604, 0.18675687909126282, -0.4072737991809845, -0.006888457573950291, 0.0019726529717445374, 0.2699196934700012, 0.3579423427581787, 0.1894131600856781, 0.05802140384912491, 0.1082952469587326, 0.030980417504906654, 0.008016049861907959, -0.5022330284118652, -0.009789436124265194, 0.1666799783706665, 0.09900179505348206, 0.05911747366189957, -0.2911140024662018, -0.3565892279148102, 0.09954528510570526, -0.6641459465026855, 0.14913693070411682, -0.2065761387348175, -0.13190385699272156, 0.31219053268432617, -0.01246967539191246, 0.19628416001796722, -0.2168964445590973, 0.563217282295227, 0.10033378005027771, 0.14020103216171265, 0.15028689801692963, -0.18229545652866364, 0.04985509812831879, 0.1358005404472351, 0.3311428129673004, 0.10087969154119492, 0.49656808376312256, 0.2629406452178955, -0.3219107389450073, -0.3178974390029907, -0.09799113869667053, 0.06788776069879532, 0.05170978233218193, 0.17715254426002502, 0.2142505645751953, -0.039544761180877686, 0.19919396936893463, -0.11945449560880661, 0.07438690960407257, -0.2399493157863617, 0.038086652755737305, -0.21417079865932465, -0.14610937237739563, 0.13326598703861237, 0.1296173483133316, -0.18969401717185974, -0.43223536014556885, -0.5442109704017639, 0.1777523010969162, -0.2805154621601105, 0.028500638902187347, 0.060109373182058334, 0.017051346600055695, -0.08499018102884293, 0.27911314368247986, -0.11176396906375885, -0.45199811458587646, -0.4413679540157318, 0.06818515807390213, -0.26635465025901794, 0.09157946705818176, -0.30782660841941833, -0.2566875219345093, 0.2649989724159241, 0.05579739436507225, -0.26450926065444946, -0.12555386126041412, -0.09533043950796127, 0.09887862205505371, -0.23242244124412537, 0.028567258268594742, 0.02441040426492691, -0.11226466298103333, -0.03168913349509239, 0.139505535364151, -0.13204100728034973, 0.21409684419631958, 0.3594558835029602, 0.11005526036024094, 0.1696944236755371, 0.5690892934799194, 0.28938618302345276, 0.8013837933540344, 0.3392713665962219, -0.10414566099643707, 0.1860850751399994, 0.20931820571422577, 0.0077740587294101715, 0.08075280487537384, -0.5401023030281067, 0.44750380516052246, 0.019741758704185486, -0.11280771344900131, 0.23901036381721497, -0.32105839252471924, -0.1602967232465744, 0.038076817989349365, -0.3406188189983368, 0.3548069894313812, -0.3890160620212555, 0.24213045835494995, -0.29525724053382874, 0.26181378960609436, -0.07492266595363617, -0.011906273663043976, -0.3045139014720917, -0.020359788089990616, -0.014565397053956985, 0.12322604656219482, 0.20644870400428772, -0.04571201652288437, -0.20620012283325195, -0.05702681466937065, -0.3398851156234741, 0.19031289219856262, 0.08392351120710373, 0.40850403904914856, 0.30846360325813293, -0.11529719829559326, -0.060591280460357666, 0.16113464534282684, 0.7158340215682983, -0.31027987599372864, -0.47631651163101196, 0.14456281065940857, 0.10094602406024933, -0.07470661401748657, -0.352222204208374, 0.01455850899219513, 0.3645312190055847, 0.16367609798908234, -0.09540288150310516, -0.18647703528404236, -0.17809659242630005, 0.3923541009426117, 0.2993568480014801, -0.09744667261838913, -0.10193933546543121, 0.031989920884370804, 0.08617386966943741, -0.29160836338996887, 0.3545559346675873, -0.03205542266368866, 0.07563240081071854, -0.04255278408527374, -0.2330758273601532, -0.03791215270757675, 0.031606145203113556, 0.24142400920391083, 0.06619718670845032, -0.07828439772129059, 0.04261462017893791, 0.6056453585624695, 0.12406404316425323, -0.26459524035453796, 0.583603024482727, 0.2061079740524292, -0.2794921398162842, -0.16577193140983582, 0.19149160385131836, -0.06146010383963585, 0.3902985751628876, 0.2858261168003082, 0.06853990256786346, 0.5230422616004944, 0.0327698215842247, 0.2790380120277405, -0.28607016801834106, 0.05752978101372719, 0.14277677237987518, 0.09356462210416794, -0.7009717226028442, -0.5665106773376465, 0.17571933567523956, 0.061617378145456314, -0.09133118391036987, 0.4517367482185364, -0.13923311233520508, -0.22687767446041107, 0.12392520904541016, 0.3613136410713196, 0.8065090179443359, 0.2981121838092804, -0.050888460129499435, 0.07350130379199982, 0.3685370087623596, 0.4699265658855438, -0.013971187174320221, 0.1483289897441864, -0.11107790470123291, -0.47910836338996887, -0.030079321935772896, 0.018787484616041183, 0.047928109765052795, -0.09970340132713318, -0.0696035623550415, 0.1917766034603119, 0.3379543423652649, 0.10866193473339081, -0.24013380706310272, 0.3872281610965729, -0.03994883596897125, -0.41608649492263794, 0.35242411494255066, 0.20758835971355438, 0.049975257366895676, -0.22462448477745056, 0.0659792348742485, -0.3321889638900757, 0.35372239351272583, 0.08851593732833862, -0.3279767632484436, -0.26896175742149353, -0.025523154065012932, 0.3308676481246948, 0.013986282050609589, -0.3505460023880005, 0.32607004046440125, -0.5414971113204956, 0.2575610280036926, -0.056774090975522995, 0.020194584503769875, -0.18550512194633484, -0.01994951069355011, -0.08163761347532272, -0.23937949538230896, -0.30633601546287537, 0.3902328610420227, -0.006270989775657654, -0.11319491267204285, 0.08341491967439651, 0.3221544325351715, -0.42121171951293945, -0.09037680178880692, 0.22209414839744568, 0.2177659422159195, -0.13858358561992645, -0.11498460173606873, 0.2995631694793701, -0.19119127094745636, -0.2789227366447449, 0.08094742894172668, 0.26285606622695923, -0.08432867377996445, 0.49677541851997375, -0.44510385394096375, 0.03543014079332352, -0.1934421956539154, 0.13420186936855316, 0.14659596979618073, -0.18658293783664703, 0.14466294646263123, -0.05062558501958847, -0.15623685717582703, -0.24639365077018738, 0.08055732399225235, -0.04979453980922699, 0.10558117181062698, 0.20287761092185974, -0.06923519819974899, 0.20499224960803986, 0.11161665618419647, 0.010135967284440994, 0.08602936565876007, 0.25092652440071106, -0.006962791085243225, -0.2621217668056488, -0.057434529066085815, 0.29583215713500977, -0.1855042725801468, 0.38808074593544006, -0.35940021276474, 0.16865593194961548, -0.273612916469574, 0.18168491125106812, -0.3697257936000824, -0.031084751710295677, -0.13058826327323914, -0.05179190635681152, 0.17976464331150055, -0.16262021660804749, -0.22219018638134003, -0.006678551435470581, -0.03547510877251625, 0.22226695716381073, -0.18648990988731384, -0.17522957921028137, -0.21332915127277374, 0.13611991703510284, -0.05558349937200546, -0.0036048758774995804, 0.15449027717113495, -0.21441154181957245, -0.1295115202665329, -0.30404794216156006, -0.19837705790996552, 0.07910411804914474, -0.07228879630565643, -0.030160095542669296, -0.03130273148417473, -0.044083528220653534, -0.2271566540002823, 0.3232859671115875, 0.1466117799282074, -0.1624504178762436, 0.23407362401485443, 0.42066437005996704, 0.0877416655421257, -0.06007111072540283, -0.03493838384747505, 0.14136886596679688, 0.16119518876075745, -0.04593908041715622, 0.07767872512340546, 0.21808992326259613, -0.3681076169013977, 0.46182987093925476, 0.11007851362228394, 0.5243658423423767, -0.02716727741062641, -0.060074493288993835, 0.20025238394737244, 0.2715366780757904, -0.029662922024726868, -0.05866824463009834, 0.14759136736392975, -0.08248940855264664, 0.31629547476768494, 0.3420793116092682, 0.4612864553928375, -0.09811185300350189, 0.21619583666324615, 0.07678066194057465, 0.033585067838430405, -0.2605847716331482, 0.20234952867031097, 0.04930960014462471, 0.1939220279455185, -0.2260051816701889, 0.2478002905845642, -0.03996345028281212, 0.580460250377655, 0.007357984781265259, -0.2920791804790497, 0.7579498291015625, 0.4943791329860687, -0.14407095313072205, 0.09135935455560684, -0.28764817118644714, -0.05504130944609642, -0.013392344117164612, -0.07191063463687897, 0.2436961829662323, 0.12439854443073273, 0.4079877436161041, -0.30993303656578064, -0.19900676608085632, -0.20473632216453552, 0.07341493666172028, 0.10653933882713318, 0.03301536664366722, -0.21263901889324188, -0.2134529948234558, -0.16770949959754944, -0.16735674440860748, 0.11998315155506134, -0.14906790852546692, 0.4488641619682312, -0.16725583374500275, -0.013554468750953674, -0.2266974151134491, -0.14198943972587585, 0.23321443796157837, 0.37182724475860596, -0.21273545920848846, -0.21661539375782013, 0.21340157091617584, -0.2656492292881012, -0.22793322801589966, 0.152849018573761, 0.014578435570001602, 0.14307039976119995, -0.14802102744579315, 0.06015326455235481, 0.2317648082971573, -0.09419891983270645, -0.12657949328422546, 0.1876518428325653, -0.11983293294906616, -0.45847582817077637, 0.2901168167591095, 0.13729211688041687, -0.1694011092185974, 0.17764823138713837, 0.32109275460243225, -0.013987811282277107, -0.6261570453643799, -0.27087661623954773, 0.5110403299331665, -0.0010782666504383087, 0.12738750874996185, 0.06595320999622345, -0.3257454037666321, -0.007864219136536121, 0.09337456524372101, -0.18108028173446655, 0.03033345937728882, -0.05634880065917969, 0.10087889432907104, -0.32386115193367004, 0.35004666447639465, 0.224755197763443, 0.010763205587863922, -0.19260697066783905, -0.04492633044719696, -0.3545109033584595, 0.09662285447120667, -0.21638286113739014, 0.07693316042423248, -0.025003403425216675, 0.41004639863967896, 0.2787644565105438, 0.059305574744939804, 0.16541112959384918, -0.12959741055965424, -0.029509883373975754, 0.34132149815559387, -0.5226247906684875, -0.1363668292760849, 0.2793429493904114, -0.13499286770820618, 0.22513914108276367, 0.01335083693265915, -0.030429501086473465, -0.03224959224462509, -0.004755429923534393, -0.07286813855171204, -0.23151791095733643, 0.3228413462638855, -0.00998413935303688, 0.5726209878921509, 0.09407283365726471, -0.07486872375011444, -0.2110883891582489, 0.05855714529752731, -0.37091681361198425, 0.020647600293159485, -0.2675153911113739, 0.07436566054821014, 0.23996953666210175, 0.39044928550720215, -0.18274232745170593, 0.19481691718101501, -0.10673980414867401, 0.2435859590768814, 0.13023418188095093, 0.1306721419095993, -0.3313083052635193, 0.14976613223552704, 0.06226866692304611, 0.3299558460712433, -0.3485206961631775, 0.3661271631717682, 0.16109976172447205, 0.17007924616336823, -0.20741356909275055, -0.23904459178447723, 0.16924035549163818, -0.18689483404159546, -0.2745167911052704, -0.40041401982307434, 0.3017021119594574, 0.26988399028778076, 0.10761062055826187, -0.23048028349876404, -0.2419271171092987, 0.29719191789627075, -0.026749204844236374, -0.21659332513809204, 0.38971853256225586, 0.4072197377681732, 0.20745711028575897, -0.15426908433437347, 0.09951731562614441, -0.0008201748132705688, -0.3076363503932953, 0.2624876797199249, -0.3064970374107361 ]
https://github.com/huggingface/datasets/issues/3063
Windows CI is unable to test streaming properly because of SSL issues
I think this problem is already fixed: ```python In [4]: import fsspec ...: ...: url = "https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattributes" ...: ...: fsspec.open(url).open() Out[4]: <File-like object HTTPFileSystem, https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattribu ```
In https://github.com/huggingface/datasets/pull/3041 the windows tests were skipped because of SSL issues with moon-staging.huggingface.co:443 The issue appears only on windows with asyncio. On Linux it works. With requests it works as well. And with the production environment huggingface.co it also works. to reproduce on windows: ```python import fsspec # use any URL to a file in a dataset repo url = "https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattributes" fsspec.open(url).open() ``` raises ```python FileNotFoundError: https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattributes ``` because of ```python aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host moon-staging.huggingface.co:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)')] ```
26
Windows CI is unable to test streaming properly because of SSL issues In https://github.com/huggingface/datasets/pull/3041 the windows tests were skipped because of SSL issues with moon-staging.huggingface.co:443 The issue appears only on windows with asyncio. On Linux it works. With requests it works as well. And with the production environment huggingface.co it also works. to reproduce on windows: ```python import fsspec # use any URL to a file in a dataset repo url = "https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattributes" fsspec.open(url).open() ``` raises ```python FileNotFoundError: https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattributes ``` because of ```python aiohttp.client_exceptions.ClientConnectorCertificateError: Cannot connect to host moon-staging.huggingface.co:443 ssl:True [SSLCertVerificationError: (1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: certificate has expired (_ssl.c:1131)')] ``` I think this problem is already fixed: ```python In [4]: import fsspec ...: ...: url = "https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattributes" ...: ...: fsspec.open(url).open() Out[4]: <File-like object HTTPFileSystem, https://moon-staging.huggingface.co/datasets/__DUMMY_TRANSFORMERS_USER__/my-dataset-16242824690709/resolve/main/.gitattribu ```
[ -0.35435229539871216, 0.0034219175577163696, 0.019807178527116776, 0.034293148666620255, 0.05071816220879555, -0.11084075272083282, 0.2119024395942688, 0.13144469261169434, 0.028768621385097504, -0.08339668810367584, 0.0598861500620842, -0.2223207652568817, 0.18263636529445648, 0.21245025098323822, -0.08421080559492111, -0.10261611640453339, 0.0015286728739738464, -0.22213807702064514, 0.07979804277420044, 0.10132741928100586, -0.14837566018104553, 0.2218102514743805, -0.16311156749725342, -0.24837099015712738, 0.028221098706126213, -0.0970841571688652, -0.15240786969661713, 0.22618401050567627, -0.0843154713511467, -0.15190619230270386, 0.316816508769989, -0.024245355278253555, 0.10059981793165207, 0.31020790338516235, -0.0001256051764357835, 0.11596037447452545, 0.42570072412490845, -0.07359321415424347, -0.1649603247642517, -0.08965715765953064, -0.04877978190779686, 0.12625862658023834, -0.0519583523273468, 0.1272168755531311, -0.18989792466163635, 0.2872743308544159, -0.06543948501348495, -0.2645668685436249, 0.30448806285858154, 0.3697357475757599, 0.05026363208889961, 0.6486263275146484, -0.19481751322746277, 0.13327771425247192, -0.04453445225954056, 0.27408844232559204, -0.12105394899845123, 0.18709346652030945, 0.23445264995098114, -0.1632012128829956, 0.011435166001319885, 0.051990609616041183, 0.05758776515722275, -0.024853702634572983, -0.20132076740264893, -0.025243904441595078, -0.06153690069913864, -0.4755304157733917, 0.11125130951404572, -0.019221335649490356, 0.09192594885826111, -0.18209290504455566, -0.3352392315864563, 0.0066399648785591125, -0.035236556082963943, -0.03304632380604744, 0.38899654150009155, 0.41293612122535706, -0.22330941259860992, -0.14759917557239532, -0.2206350862979889, 0.11088616400957108, -0.29882872104644775, 0.2456117421388626, 0.16331486403942108, 0.056529123336076736, -0.15862485766410828, 0.12102912366390228, 0.007556658238172531, -0.12158261239528656, -0.2040591686964035, -0.3106708526611328, -0.31001728773117065, 0.013526210561394691, -0.34623610973358154, -0.11283542215824127, -0.10714524239301682, 0.3016146421432495, -0.02819961868226528, 0.44234418869018555, -0.06704488396644592, 0.052103184163570404, 0.3095792531967163, 0.04701094701886177, 0.027067750692367554, 0.3487999737262726, 0.26698562502861023, -0.04301140829920769, 0.5553985238075256, 0.5416624546051025, 0.14504887163639069, 0.007008593529462814, -0.07961296290159225, -0.41098105907440186, -0.5638801455497742, -0.006512384861707687, 0.6815711855888367, -0.4159497320652008, -0.3877808749675751, 0.08526784926652908, -0.33268511295318604, -0.04873788356781006, 0.22304224967956543, 0.3753296434879303, 0.10789059847593307, 0.15560397505760193, 0.041441939771175385, 0.361926794052124, -0.1772618293762207, 0.10676580667495728, 0.05166799947619438, -0.19169598817825317, -0.04550328105688095, 0.2198716700077057, 0.5214274525642395, -0.07630273699760437, 0.24923208355903625, 0.04172021895647049, 0.2694270610809326, -0.06779959797859192, -0.06622083485126495, 0.06894508004188538, 0.23652279376983643, 0.3781501352787018, 0.1813642680644989, 0.0680553987622261, 0.0001429915428161621, -0.0634002834558487, -0.06952286511659622, -0.05304092913866043, 0.0870257318019867, -0.06605368107557297, 0.2422846406698227, 0.05553344264626503, -0.44795286655426025, -0.06275247782468796, -0.12135385721921921, -0.032501351088285446, -0.15655648708343506, -0.013667043298482895, 0.16292139887809753, -0.0629071444272995, -0.14080017805099487, 0.13885337114334106, 0.3069663941860199, 0.4528586268424988, 0.38262319564819336, -0.27439799904823303, 0.14545603096485138, -0.09628590941429138, 0.16171830892562866, 0.38529103994369507, 0.042822692543268204, -0.3558398485183716, -0.3128454089164734, -0.0219435878098011, 0.015155963599681854, -0.24000602960586548, -0.5203030109405518, 0.5559728145599365, 0.035843536257743835, 0.21314242482185364, 0.17639774084091187, -0.07077290862798691, 0.380698025226593, 0.023563861846923828, -0.08758606016635895, 0.13881096243858337, -0.007286554202437401, 0.0403362512588501, -0.24138975143432617, -0.2984215319156647, -0.17220847308635712, 0.1608167588710785, -0.24955902993679047, 0.10974113643169403, 0.17481352388858795, -0.07633707672357559, 0.22246241569519043, -0.017277877777814865, -0.0035835187882184982, 0.15414556860923767, 0.5449119806289673, -0.10857594013214111, 0.010704999789595604, 0.2868562340736389, -0.5678372979164124, 0.15393248200416565, 0.07070185244083405, 0.16356492042541504, -0.2626008987426758, -0.23453472554683685, 0.12395044416189194, 0.024380991235375404, -0.10815244913101196, -0.5437305569648743, -0.07960963994264603, 0.22592468559741974, 0.3211641311645508, -0.07578810304403305, 0.09466226398944855, 0.08473777025938034, -0.009129157289862633, 0.025785965844988823, -0.10073316097259521, 0.3716411888599396, -0.13102154433727264, -0.13614146411418915, 0.21290835738182068, 0.06357420980930328, 0.2995777428150177, -0.31505611538887024, -0.08588726818561554, 0.15989093482494354, -0.12466305494308472, 0.37340545654296875, 0.2078058123588562, 0.4243704378604889, 0.4627772569656372, -0.49866369366645813, -0.21325263381004333, 0.6479544639587402, -0.04075886681675911, 0.18142291903495789, -0.20191726088523865, 0.4523841142654419, -0.22291530668735504, 0.33833664655685425, 0.1330452710390091, 0.2408158779144287, 0.2969434857368469, -0.09944156557321548, -0.42796385288238525, 0.15421350300312042, 0.6061843037605286, -0.23658789694309235, -0.15632079541683197, -0.12217099964618683, -0.14598505198955536, 0.017381533980369568, 0.11877727508544922, -0.1694777011871338, -0.1393553912639618, 0.12435059249401093, -0.10641496628522873, 0.11999695748090744, 0.25277402997016907, -0.06731931120157242, 0.4469706416130066, -0.07953348010778427, -0.11466777324676514, 0.3267136216163635, -0.02864864468574524, -0.4041205048561096, 0.3785720467567444, 0.17426487803459167, -0.5299691557884216, 0.16512542963027954, 0.0334789901971817, 0.01710629090666771, -0.41122907400131226, -0.061791591346263885, 0.2394534945487976, 0.03682988882064819, -0.4693358838558197, 0.17417806386947632, -0.01341708842664957, -0.39467301964759827, -0.2672729194164276, -0.0977177545428276, -0.2567535638809204, -0.16085083782672882, -0.08469321578741074, 0.45434248447418213, -0.3679555356502533, 0.23055768013000488, -0.1533103883266449, 0.3281271755695343, 0.21980027854442596, -0.3388395607471466, -0.2680550813674927, 0.03485758602619171, -0.0899655893445015, 0.027585357427597046, 0.4766932725906372, -0.3319573700428009, 0.2846597731113434, -0.2303340882062912, -0.038899652659893036, -0.49456357955932617, -0.40300464630126953, -0.005938440561294556, 0.18769842386245728, 0.5563309788703918, -0.29290175437927246, 0.11561442911624908, 0.09009237587451935, -0.25260448455810547, 0.24720267951488495, -0.49061107635498047, -0.08930119127035141, 0.047194525599479675, 0.007355261594057083, -0.2612393796443939, -0.3027016520500183, -0.19549772143363953, 0.1596343070268631, -0.2441183179616928, 0.2415452003479004, -0.21242815256118774, -0.05761506408452988, -0.058683961629867554, -0.06947649270296097, -0.045045774430036545, 0.04130224138498306, -0.2106054425239563, -0.09188756346702576, -0.41157853603363037, 0.20735184848308563, -0.0037107712123543024, -0.5209707617759705, 0.06351450085639954, 0.18128672242164612, 0.028391974046826363, -0.027062993496656418, -0.43448054790496826, -0.2439691126346588, -0.14127086102962494, 0.3977646231651306, 0.17959702014923096, -0.16484977304935455, 0.05086957663297653, -0.2716764807701111, 0.07242701947689056, -0.11700738221406937, -0.1901363730430603, 0.0704551637172699, 0.14107874035835266, 0.27255767583847046, 0.03904791176319122, 0.34030503034591675, -0.03619113564491272, 0.6463866829872131, 0.5762210488319397, -0.19347909092903137, 0.26029345393180847, -0.10947152227163315, 0.06816322356462479, 0.4510734975337982, -0.22220923006534576, 0.3604094982147217, -0.16158795356750488, 0.1354052871465683, 0.35333186388015747, 0.16292551159858704, 0.06660015136003494, -0.2013646364212036, 0.02373460680246353, -0.052751101553440094, -0.4586701989173889, 0.15656299889087677, -0.3804686367511749, 0.41332924365997314, 0.0821455717086792, 0.20054924488067627, 0.3502592444419861, -0.3077581524848938, 0.2544075548648834, 0.6406577825546265, -0.01002606749534607, 0.04824517294764519, 0.013305019587278366, -0.3494967520236969, -0.6786261796951294, 0.31486189365386963, 0.06338346749544144, 0.8817680478096008, -0.2992221415042877, -0.059795357286930084, -0.001553647220134735, -0.18335315585136414, 0.6009374260902405, 0.02521735243499279, 0.18834435939788818, 0.1558780074119568, -0.08503832668066025, -0.193512424826622, -0.06805972754955292, -0.2964983284473419, 0.10624279826879501, 0.14207226037979126, 0.5295225381851196, -0.06177711486816406, -0.08652915060520172, -0.2021665722131729, -0.08488253504037857, 0.021169539541006088, 0.11486551910638809, -0.35210803151130676, -0.36390775442123413, -0.1918911635875702, 0.26843559741973877, -0.17036058008670807, -0.03799237683415413, -0.5817211866378784, 0.23730669915676117, 0.12562552094459534, 0.13238495588302612, 0.10494673997163773, 0.1767217367887497, 0.02874230593442917, 0.031539443880319595, 0.3064980208873749, 0.3915978670120239, 0.4424006938934326, 0.17253559827804565, 0.7667027711868286, 0.20779559016227722, -0.3386172354221344, 0.3461315333843231, 0.24239152669906616, -0.05211641639471054, 0.4009891450405121, -0.07885463535785675, 0.14332599937915802, 0.2831803560256958, 0.20707611739635468, -0.5934996008872986, 0.17479702830314636, 0.3367902934551239, 0.3475394546985626, 0.12911270558834076, 0.03479772061109543, 0.11763191223144531, -0.25640249252319336, -0.043229538947343826, 0.07533642649650574, -0.0747331976890564, -0.062477052211761475, -0.1211593821644783, -0.027697227895259857, 0.61290043592453, 0.17457005381584167, 0.15649625658988953, 0.14563024044036865, -0.4241718649864197, 0.07865540683269501, -0.08194638043642044, 0.1831205189228058, -0.026140157133340836, 0.09646577388048172, -0.01720689982175827, -0.1832129806280136, 0.4889028072357178, -0.27529460191726685, -0.41987839341163635, 0.05024181678891182, 0.4786466956138611, 0.4271412193775177, 0.24973434209823608, 0.16381989419460297, -0.26092544198036194, -0.0812288224697113, -0.354497492313385, 0.0344901904463768, 0.07851459830999374, 0.5296275019645691, -0.06756733357906342, -0.029500871896743774, 0.16596411168575287, -0.4157521724700928, -0.2298305779695511, 0.36516764760017395, -0.4647426903247833, -0.05291176587343216, -0.18807941675186157, -0.06110261380672455, 0.2839847505092621, 0.16607670485973358, 0.020372968167066574, -0.07991328835487366, -0.3984304368495941, 0.38972967863082886, 0.17444787919521332, 0.3111109733581543, 0.11127547174692154, -0.14720463752746582, -0.1113814264535904, -0.09820154309272766, -0.2532019317150116, 0.044841013848781586, 0.02837362140417099, -0.06991269439458847, -0.199056938290596, -0.035162657499313354, -0.07419107854366302, -0.16445292532444, 0.24587537348270416, -0.29514214396476746, -0.21400724351406097, -0.20630940794944763, 0.03293226659297943, -0.05916610360145569, -0.26392656564712524, 0.048081059008836746, -0.01667848601937294, -0.16648942232131958, -0.06634688377380371, 0.4471901059150696, -0.5583493709564209, 0.09831184148788452, 0.27999943494796753, 0.038495276123285294, 0.1584445983171463, -0.20742210745811462, 0.048278115689754486, -0.45910483598709106, -0.31371545791625977, -0.05821320042014122, -0.09903544932603836, 0.043336138129234314, -0.12416602671146393, 0.18991106748580933, 0.135918527841568, -0.017484448850154877, 0.04124840721487999, -0.5547183752059937, -0.043626368045806885, 0.037388965487480164, 0.0983232781291008, -0.053965214639902115, -0.04244150221347809, 0.21052397787570953, 0.05990977585315704, -0.2586091458797455, -0.13258124887943268, -0.02636285312473774, -0.2311364859342575, 0.19682450592517853, 0.16430717706680298, -0.0694066658616066, 0.6016631722450256, -0.0676969364285469, -0.08939117938280106, -0.1280175894498825, -0.05597319453954697, -0.023271525278687477, -0.22791756689548492, 0.1379934847354889, 0.08292512595653534, -0.3923105299472809, -0.04034196585416794, 0.050566673278808594, 0.15414154529571533, 0.025412654504179955, 0.15859802067279816, -0.10447961091995239, -0.20289458334445953, -0.19744795560836792, -0.31392985582351685, -0.019571729004383087, -0.27935969829559326, 0.1479005217552185, -0.11191777884960175, 0.4384680986404419, -0.0022442801855504513, 0.10327214747667313, -0.09980006515979767, 0.05644552409648895, 0.20117825269699097, 0.020028524100780487, 0.027945347130298615, 0.08878424763679504, 0.22490155696868896, -0.013752378523349762, -0.03009527176618576, -0.11541387438774109, 0.2884104251861572, 0.34799084067344666, -0.12960976362228394, 0.15281562507152557, 0.10138695687055588, 0.029349731281399727, 0.004310682415962219, 0.1038127988576889, -0.01358848437666893, -0.06597638875246048, 0.06709390878677368, -0.004711605608463287, 0.18753764033317566, -0.16542121767997742, 0.19695013761520386, -0.106981061398983, 0.2739998400211334, 0.4356755018234253, 0.3215223550796509, 0.349778413772583, -0.053675781935453415, 0.3960694670677185, -0.1465156525373459, -0.29871436953544617, -0.007110215723514557, -0.16779932379722595, -0.21049433946609497, 0.1794317215681076, -0.1314418613910675, 0.32332250475883484, 0.09913188219070435, -0.2032625675201416, -0.1371830552816391, -0.4005586504936218, -0.048662975430488586, 0.38502153754234314, -0.05289822816848755, 0.33066698908805847, -0.500043511390686, -0.30422163009643555, -0.26712721586227417, 0.05237709358334541, -0.031958840787410736, -0.2962515950202942, -0.23307569324970245, -0.03741723671555519, -0.03635234385728836, 0.2499048113822937, 0.16338935494422913, 0.03105146810412407, 0.01319083571434021, 0.06929869949817657, -0.2547492980957031, -0.19425377249717712, -0.18816229701042175, 0.3213929235935211, 0.07499614357948303, -0.06489579379558563, 0.4970129728317261, 0.2665725350379944, -0.12406028807163239, 0.10684394836425781, 0.2521911859512329, 0.5511549711227417, -0.1227308064699173, 0.1353246122598648, 0.21832534670829773, 0.15768714249134064, 0.09811292588710785, -0.02174391970038414, 0.45064204931259155, 0.19550400972366333, -0.22523276507854462, 0.149549663066864, 0.048959605395793915, -0.04022592306137085, 0.06280874460935593, -0.17826172709465027, -0.012528397142887115, 0.0165607538074255, 0.3636970818042755, -0.4123934209346771, 0.11432851105928421, -0.24743980169296265, -0.15515059232711792, -0.09282740950584412, 0.18698997795581818, 0.006988858804106712, -0.23908093571662903, 0.12496865540742874, -0.18583577871322632, 0.017405353486537933, 0.01392288226634264, 0.6570307612419128, 0.29014885425567627, 0.23382416367530823, -0.15250344574451447, -0.37280499935150146, -0.4441264271736145, 0.07203608751296997, 0.3098851144313812, -0.018503665924072266, -0.16267095506191254, -0.04276179522275925, -0.10602175444364548, 0.0345468632876873, -0.049415603280067444, -0.4919588267803192, 0.1873025894165039, 0.054722025990486145, -0.15417151153087616, 0.13639235496520996, -0.07864513993263245, 0.14861960709095, 0.025960206985473633, -0.38068294525146484, 0.38846129179000854, 0.037276849150657654, -0.1440398395061493, 0.13449262082576752, -0.039614737033843994, -0.3102138042449951, -0.3237248361110687, 0.16893118619918823, 0.3744964599609375, 0.45346036553382874, -0.12592235207557678, -0.022309191524982452, -0.2715063691139221, -0.27617621421813965, 0.11598615348339081, -0.0663546696305275, -0.2192665934562683, 0.2399904429912567, 0.021423550322651863, -0.17410483956336975, -0.3365826904773712, 0.0315086655318737, 0.11961042881011963, -0.5234785079956055, -0.037864163517951965, -0.07854674756526947, -0.26991739869117737, 0.12381771951913834, -0.03324553743004799, 0.57199627161026, -0.266324520111084, -0.20313182473182678, -0.15164721012115479, -0.06748318672180176, 0.32306230068206787, -0.6913235783576965, 0.06057146564126015, -0.07187402993440628, 0.3690216839313507, -0.14076665043830872, 0.058771178126335144, -0.08330541849136353, -0.02727597951889038, 0.11117924004793167, -0.09225078672170639, -0.25782299041748047, 0.11312997341156006, 0.025305310264229774, -0.10955067723989487, -0.044085435569286346, 0.25539499521255493, 0.2229788899421692, -0.24711960554122925, 0.47606590390205383, -0.09575670212507248 ]
https://github.com/huggingface/datasets/issues/3061
Feature request : add leave=True to dataset.map to enable tqdm nested bars (and whilst we're at it couldn't we get a way to access directly tqdm underneath?)
@lhoestq, @albertvillanova can we have `**tqdm_kwargs` in `map`? If there are any fields that are important to our tqdm (like iterable or unit), we can pop them before initialising the tqdm object so as to avoid duplicity.
**A clear and concise description of what you want to happen.** It would be so nice to be able to nest HuggingFace `Datasets.map() ` progress bars in the grander scheme of things and whilst we're at it why not other functions. **Describe alternatives you've considered** By the way is there not a way to directly interact with underlying tqdm module ? **kwargs-ish? **Additional context** Furthering tqdm integration #2374 and huggingface/transformers#11797 solutioned by huggingface/transformers#12226 provided with tqdm description as `desc=` @sgugger @bhavitvyamalik
37
Feature request : add leave=True to dataset.map to enable tqdm nested bars (and whilst we're at it couldn't we get a way to access directly tqdm underneath?) **A clear and concise description of what you want to happen.** It would be so nice to be able to nest HuggingFace `Datasets.map() ` progress bars in the grander scheme of things and whilst we're at it why not other functions. **Describe alternatives you've considered** By the way is there not a way to directly interact with underlying tqdm module ? **kwargs-ish? **Additional context** Furthering tqdm integration #2374 and huggingface/transformers#11797 solutioned by huggingface/transformers#12226 provided with tqdm description as `desc=` @sgugger @bhavitvyamalik @lhoestq, @albertvillanova can we have `**tqdm_kwargs` in `map`? If there are any fields that are important to our tqdm (like iterable or unit), we can pop them before initialising the tqdm object so as to avoid duplicity.
[ -0.30796018242836, -0.4473893642425537, -0.06747069954872131, -0.1451709270477295, 0.15585589408874512, -0.040167033672332764, 0.3228396773338318, 0.183680459856987, -0.2261493057012558, 0.16096347570419312, -0.2775021195411682, 0.5143536925315857, -0.058076582849025726, 0.4776199460029602, -0.011616691015660763, -0.009158853441476822, -0.027959786355495453, -0.01646561175584793, -0.5783253908157349, 0.28396356105804443, -0.2386755794286728, 0.117763951420784, -0.20520834624767303, 0.01403159648180008, -0.12830719351768494, -0.21812576055526733, -0.07269991189241409, 0.08917716890573502, 0.23781174421310425, -0.4380874037742615, 0.1363578587770462, 0.49611642956733704, -0.08454689383506775, 0.3012765645980835, -0.00011233422992518172, -0.11860045790672302, 0.23145796358585358, 0.06781226396560669, 0.09052437543869019, 0.23094139993190765, 0.07041722536087036, -0.3954603970050812, 0.21716389060020447, -0.20375746488571167, 0.003922548145055771, 0.07783713936805725, -0.20110063254833221, -0.2251550704240799, 0.6380640268325806, -0.3206152617931366, 0.2035880833864212, 0.5751175880432129, -0.361492395401001, -0.09991104155778885, -0.0673891082406044, -0.1439175307750702, -0.3479079306125641, 0.13042886555194855, 0.6831461191177368, -0.060431092977523804, -0.4105483293533325, 0.34366241097450256, 0.11264635622501373, -0.10973432660102844, 0.46721386909484863, 0.10404326766729355, 0.36320263147354126, -0.35076841711997986, -0.09408307820558548, 0.39844223856925964, 0.2598358392715454, -0.43902599811553955, -0.3076886832714081, -0.5278617739677429, -0.11485637724399567, 0.044318802654743195, 0.185392826795578, -0.441287636756897, -0.2632374167442322, 0.24055039882659912, -0.7522944211959839, -0.21091072261333466, -0.09517964720726013, -0.1344125121831894, -0.005954679101705551, -0.1206197440624237, -0.04297646880149841, -0.06719175726175308, 0.24416980147361755, 0.05784362554550171, -0.1306302845478058, 0.16591818630695343, 0.06554919481277466, 0.06999555230140686, -0.06508015096187592, -0.38774800300598145, 0.34820953011512756, 0.18202100694179535, 0.3610502779483795, 0.44871991872787476, -0.23330165445804596, 0.2086692452430725, -0.20759113132953644, 0.18943724036216736, 0.045850060880184174, 0.035082463175058365, 0.20996344089508057, -0.6823455691337585, 0.3317911624908447, -0.09102243185043335, -0.0064955465495586395, 0.06631569564342499, 0.4740937650203705, -0.3375522494316101, 0.012279223650693893, 0.14853256940841675, 0.02905840426683426, 0.2503143846988678, 0.06555420160293579, 0.06143438071012497, 0.440054327249527, 0.01820034347474575, 0.21618613600730896, 0.25556841492652893, 0.2323509305715561, -0.15770775079727173, -0.18255338072776794, 0.20600372552871704, 0.052552491426467896, -0.2602235674858093, -0.10485116392374039, -0.14845384657382965, -0.011525288224220276, 0.18899168074131012, -0.17586535215377808, -0.05787478759884834, 0.11431774497032166, 0.10351896286010742, 0.24161310493946075, 0.37939348816871643, 0.009913913905620575, 0.24011026322841644, 0.4376009702682495, 0.17147420346736908, -0.19351503252983093, -0.03325631096959114, 0.023152634501457214, -0.027395833283662796, -0.29099151492118835, 0.158966064453125, 0.1512225717306137, -0.39067691564559937, -0.012847060337662697, 0.07567962259054184, -0.2792850732803345, -0.023776382207870483, -0.1771697998046875, 0.4996313750743866, -0.1845148503780365, 0.234112948179245, 0.2909581661224365, 0.22482727468013763, -0.3258739709854126, -0.1309424191713333, 0.28226879239082336, 0.5106946229934692, -0.04582773894071579, -0.3792687952518463, -0.12662924826145172, -0.21458056569099426, -0.17661717534065247, -0.06639572978019714, -0.026123594492673874, 0.2818356156349182, -0.21763335168361664, 0.30670154094696045, 0.13661207258701324, -0.3151673972606659, -0.32740771770477295, 0.36611950397491455, -0.2542598247528076, 0.024900471791625023, -0.008864879608154297, -0.05433518812060356, 0.2999831438064575, -0.08398604393005371, 0.02273527905344963, 0.13659313321113586, -0.25915199518203735, 0.05532868951559067, -0.10019382834434509, -0.1960335224866867, 0.2590194344520569, -0.0960545539855957, -0.030031990259885788, 0.012816272675991058, 0.2516792416572571, -0.5225576758384705, 0.3692958354949951, 0.19735519587993622, 0.16363286972045898, 0.04670977219939232, 0.11351373046636581, -0.3524395823478699, -0.3397783041000366, -0.26551902294158936, -0.5118914246559143, 0.25806716084480286, 0.10386894643306732, 0.01766129955649376, -0.04290749132633209, -0.22470788657665253, -0.24039533734321594, 0.07630826532840729, -0.15655772387981415, -0.10375890135765076, 0.09431259334087372, -0.3427298665046692, -0.14911992847919464, -0.08719278872013092, -0.4087626039981842, -0.07029969245195389, 0.2064337134361267, 0.17765824496746063, 0.11262525618076324, 0.2186545729637146, 0.2959974706172943, -0.032269734889268875, 0.021086588501930237, 0.32662433385849, 0.0145895816385746, 0.0012066538911312819, 0.1127387285232544, 0.39504778385162354, -0.11251131445169449, 0.3109878897666931, 0.2542634606361389, 0.19122052192687988, 0.26304295659065247, -0.052368734031915665, -0.26420530676841736, -0.0862903743982315, -0.3357796370983124, 0.06531103700399399, -0.049222514033317566, 0.35894185304641724, -0.07288019359111786, 0.16591794788837433, -0.1286819875240326, 0.35959726572036743, -0.11102495342493057, -0.1444561630487442, -0.41225844621658325, -0.5489954948425293, -0.1054241806268692, 0.1291072815656662, 0.1533343493938446, -0.35215985774993896, 0.07103368639945984, 0.5648077726364136, 0.3756909966468811, 0.2095334678888321, -0.001223452389240265, -0.15015262365341187, -0.060056187212467194, 0.15902402997016907, 0.2295420616865158, 0.23537005484104156, 0.2767285704612732, 0.21071197092533112, 0.28656983375549316, 0.4345586895942688, 0.07339374721050262, -0.12496867775917053, -0.09611829370260239, 0.1896221786737442, -0.05767633765935898, -0.018389664590358734, -0.1182687059044838, 0.1323443204164505, -0.25992551445961, -0.180259570479393, -0.16078650951385498, -0.11750337481498718, -0.11508654057979584, -0.29088595509529114, -0.1277652233839035, -0.04966598376631737, 0.12946897745132446, -0.19939978420734406, -0.3898546099662781, -0.3082320988178253, 0.28442227840423584, -0.031128522008657455, -0.4053133428096771, 0.588540256023407, 0.23475247621536255, 0.38731440901756287, -0.08026326447725296, 0.20609019696712494, -0.3127576410770416, -0.2263650894165039, 0.33077797293663025, 0.051252055913209915, -0.005393926054239273, -0.21873819828033447, 0.43629664182662964, -0.09707426279783249, 0.26742345094680786, -0.38976603746414185, -0.36129456758499146, 0.15129432082176208, -0.06005597859621048, 0.2392493039369583, 0.15146957337856293, 0.14453843235969543, -0.08093207329511642, 0.34446942806243896, 0.237222358584404, -0.15467728674411774, -0.4039929509162903, -0.3191622793674469, 0.1283711940050125, 0.044572215527296066, -0.30297112464904785, 0.30922484397888184, -0.11156157404184341, -0.5240488648414612, 0.4612879753112793, -0.3300384283065796, -0.015233136713504791, 0.026401489973068237, -0.2810368537902832, 0.06055429205298424, -0.22665122151374817, -0.09130308032035828, -0.031145287677645683, -0.45701178908348083, 0.23870901763439178, -0.44136449694633484, -0.016971323639154434, 0.12727782130241394, -0.1762617826461792, 0.22011207044124603, -0.08428437262773514, -0.26196789741516113, -0.4975879490375519, -0.058039940893650055, 0.615368127822876, -0.0036954954266548157, 0.12842094898223877, 0.2658995985984802, 0.2732684016227722, -0.030714234337210655, -0.02179795689880848, -0.1772911101579666, 0.16028282046318054, -0.05547424405813217, -0.11594598740339279, -0.2003399133682251, 0.13102936744689941, 0.1367262750864029, 0.38606905937194824, 0.2768525183200836, 0.2165241688489914, -0.0172467902302742, -0.14784041047096252, 0.23772205412387848, -0.036154113709926605, -0.2676183879375458, -0.24632291495800018, -0.12539944052696228, 0.18733645975589752, 0.1524004340171814, 0.11033659428358078, 0.5323340892791748, -0.05503171309828758, -0.1106824278831482, 0.03670134395360947, -0.4134680926799774, -0.053371578454971313, -0.327279657125473, 0.31815916299819946, -0.11874334514141083, -0.02377494052052498, -0.021999578922986984, 0.1382642388343811, 0.3057670593261719, 0.23650996387004852, 0.36451882123947144, -0.2059953212738037, -0.2580762803554535, 0.020500188693404198, -0.4284023642539978, 0.28291207551956177, 0.30794963240623474, -0.4551292657852173, -0.043045774102211, -0.1992516815662384, 0.00366026908159256, 0.21220678091049194, 0.48066240549087524, -0.13610292971134186, 0.017788391560316086, 0.08694347739219666, -0.45810356736183167, -0.35816603899002075, 0.2698994278907776, 0.23955592513084412, 0.04149884730577469, 0.2690402865409851, 0.40437525510787964, -0.11986326426267624, -0.14297626912593842, -0.1352108269929886, -0.054174017161130905, -0.18745866417884827, -0.3859994411468506, -0.03781697154045105, -0.11218950152397156, -0.17544043064117432, 0.18363764882087708, 0.28743287920951843, -0.2746189832687378, -0.019751625135540962, -0.29809099435806274, 0.08917772769927979, -0.41773706674575806, -0.04615110158920288, 0.31343981623649597, 0.2796218991279602, 0.051793742924928665, 0.3462356626987457, 0.23979008197784424, -0.10771444439888, -0.16056419909000397, 0.29569220542907715, -0.15985868871212006, -0.07654714584350586, -0.08378860354423523, -0.16101408004760742, 0.3088435232639313, 0.3466411232948303, -0.015780741348862648, 0.517992377281189, 0.06499151885509491, 0.24060262739658356, -0.36171650886535645, -0.0719192698597908, -0.0955394059419632, -0.08965152502059937, 0.1544225811958313, 0.15893109142780304, 0.3013671934604645, -0.26011839509010315, -0.1489308476448059, -0.05121847987174988, 0.05485902354121208, -0.16085350513458252, -0.43236494064331055, 0.12264962494373322, 0.7112035155296326, -0.10582955181598663, 0.09234674274921417, 0.10144489258527756, 0.13115711510181427, 0.003896784270182252, -0.018069513142108917, 0.1693672090768814, -0.3325290083885193, -0.1780243068933487, -0.04580824077129364, -0.13813792169094086, 0.20624253153800964, 0.1729637235403061, -0.24580170214176178, -0.15058110654354095, 0.2265709489583969, 0.32133597135543823, -0.025396456941962242, -0.06573810428380966, -0.06505339592695236, -0.3618825674057007, -0.4196946322917938, 0.036001063883304596, 0.20953471958637238, 0.04303164407610893, -0.17361626029014587, -0.18673235177993774, 0.23231405019760132, 0.15638740360736847, 0.012219883501529694, -0.3663264214992523, -0.4987097978591919, 0.21719267964363098, 0.5369870066642761, -0.17103654146194458, 0.24626407027244568, 0.22448767721652985, 0.5243901014328003, 0.015756523236632347, -0.2553180158138275, 0.13332277536392212, 0.11646834760904312, 0.2228739857673645, -0.03894482180476189, -0.05418771505355835, 0.3368653953075409, -0.2029787003993988, 0.13457068800926208, 0.22914716601371765, 0.07195877283811569, -0.3100886344909668, -0.05287099629640579, 0.224318265914917, -0.0004372410476207733, -0.08110176771879196, 0.46404072642326355, 0.09541989862918854, 0.3319554328918457, -0.28531768918037415, 0.03460954129695892, 0.3920831084251404, -0.1414983719587326, 0.3133296072483063, -0.135086789727211, -0.011612020432949066, 0.0027597788721323013, 0.1139257401227951, -0.35794922709465027, 0.08033712953329086, -0.034252770245075226, 0.19318103790283203, -0.21839016675949097, -0.18430182337760925, 0.31391963362693787, 0.1188901737332344, -0.160527765750885, 0.4184284806251526, -0.05074213072657585, -0.037931978702545166, -0.21518269181251526, 0.40533873438835144, 0.0555085763335228, -0.18836480379104614, -0.1684177964925766, -0.011435747146606445, -0.7185841798782349, 0.17720769345760345, -0.11162027716636658, 0.005686461925506592, -0.03904128447175026, 0.5374659299850464, 0.043808333575725555, 0.0517909899353981, -0.3342720866203308, -0.16739368438720703, -0.021994944661855698, -0.10797800123691559, 0.460701048374176, -0.24438101053237915, 0.24285945296287537, -0.10135336220264435, -0.08807791769504547, 0.21528767049312592, -0.4483237564563751, -0.14632996916770935, -0.2030334323644638, 0.14027139544487, -0.09812650084495544, 0.04248533397912979, 0.13451465964317322, 0.17462484538555145, -0.12282437086105347, -0.19216108322143555, 0.18169444799423218, -0.003463510423898697, 0.24976320564746857, 0.04716389626264572, 0.14107471704483032, -0.025376275181770325, -0.22388333082199097, -0.09655146300792694, 0.3612349033355713, 0.21448269486427307, 0.015300028026103973, -0.01072385162115097, -0.4279976189136505, 0.010185405611991882, 0.4613836407661438, 0.36551618576049805, 0.35803067684173584, 0.05783581733703613, 0.14151659607887268, 0.1903235763311386, -0.12265217304229736, 0.10002774745225906, 0.3340480327606201, -0.06354013085365295, -0.36282461881637573, -0.19694843888282776, 0.14579063653945923, 0.16024862229824066, -0.17042285203933716, 0.10394859313964844, 0.16539470851421356, 0.06004790961742401, 0.5102699995040894, 0.39717039465904236, 0.02574184164404869, 0.28114041686058044, 0.014629028737545013, 0.0934443324804306, 0.07908322662115097, -0.11245392262935638, -0.055602412670850754, -0.031036201864480972, -0.015314750373363495, 0.17154845595359802, 0.5960473418235779, 0.4578208327293396, 0.2751474976539612, -0.09201894700527191, -0.0844607874751091, 0.23294711112976074, -0.1217728778719902, -0.10280974209308624, 0.21245843172073364, -0.2279571145772934, 0.013469140976667404, -0.2865484356880188, 0.11623674631118774, -0.27429214119911194, -0.008311748504638672, 0.3121446669101715, 0.10684514790773392, -0.391299843788147, -0.07410146296024323, 0.3203425407409668, 0.01987135410308838, -0.15236447751522064, 0.5174320340156555, -0.08918313682079315, -0.042817674577236176, 0.021020319312810898, -0.07736049592494965, -0.11626088619232178, 0.44682613015174866, -0.282678484916687, 0.5891208648681641, -0.07640255987644196, -0.2300332486629486, 0.14736860990524292, 0.2812371253967285, -0.13807158172130585, -0.29069769382476807, 0.12910190224647522, 0.019157923758029938, 0.028346184641122818, 0.13221286237239838, 0.14808331429958344, -0.12001296877861023, -0.3032616674900055, 0.03650082275271416, -0.24050842225551605, 0.026005657389760017, -0.24499496817588806, -0.00023969262838363647, -0.011438459157943726, 0.015223441645503044, 0.3244052231311798, 0.0763389840722084, -0.17292802035808563, 0.2720702886581421, -0.05274244025349617, 0.24941234290599823, -0.3500223457813263, 0.35390621423721313, 0.11249756067991257, -0.12607450783252716, 0.09581654518842697, -0.06497184187173843, -0.022673718631267548, -0.4377591609954834, 0.3389488756656647, -0.3664698004722595, -0.010078247636556625, -0.29867109656333923, 0.08264859765768051, 0.07141242176294327, 0.37992963194847107, 0.1442912518978119, 0.13245972990989685, -0.1859617382287979, -0.2818080186843872, -0.6047676205635071, -0.016708649694919586, 0.3409603238105774, -0.17106814682483673, 0.20543353259563446, -0.07922861725091934, -0.025908127427101135, 0.4994184970855713, 0.47227931022644043, -0.27755895256996155, -0.18687863647937775, -0.37270161509513855, -0.21016836166381836, 0.00603865459561348, -0.237767294049263, -0.06552763283252716, 0.1622735857963562, 0.025992944836616516, 0.15332598984241486, 0.25406333804130554, 0.023704998195171356, 0.20631340146064758, 0.08990354835987091, 0.12586453557014465, -0.06671999394893646, 0.18349796533584595, 0.04020007327198982, -0.1641310751438141, -0.040755271911621094, -0.12567706406116486, 0.16311120986938477, -0.0697670578956604, 0.0062086088582873344, 0.14602136611938477, 0.013082211837172508, 0.23141047358512878, -0.28653743863105774, -0.17686687409877777, -0.18345186114311218, -0.0201785396784544, 0.3263641595840454, 0.05289697274565697, -0.11636310815811157, 0.30945441126823425, 0.08816780894994736, 0.09106583148241043, 0.10247857123613358, 0.3452564477920532, -0.013811320066452026, 0.5606895089149475, -0.19664916396141052, -0.2451070100069046, 0.3847886919975281, -0.1729370504617691, -0.2899033725261688, 0.025479059666395187, 0.07915374636650085, 0.12430958449840546, -0.2198643833398819, -0.541144073009491, -0.356515109539032, 0.16699373722076416, -0.06919282674789429, -0.2343694120645523, 0.4092409014701843, -0.25502049922943115, -0.17460286617279053, 0.07021389901638031, 0.15205107629299164, 0.1930813193321228, 0.08451312780380249, -0.15153154730796814, -0.10922916978597641 ]
https://github.com/huggingface/datasets/issues/3061
Feature request : add leave=True to dataset.map to enable tqdm nested bars (and whilst we're at it couldn't we get a way to access directly tqdm underneath?)
Hi ! Sounds like a good idea :) Also I think it would be better to have this as an actual parameters instead of kwargs to make it clearer
**A clear and concise description of what you want to happen.** It would be so nice to be able to nest HuggingFace `Datasets.map() ` progress bars in the grander scheme of things and whilst we're at it why not other functions. **Describe alternatives you've considered** By the way is there not a way to directly interact with underlying tqdm module ? **kwargs-ish? **Additional context** Furthering tqdm integration #2374 and huggingface/transformers#11797 solutioned by huggingface/transformers#12226 provided with tqdm description as `desc=` @sgugger @bhavitvyamalik
29
Feature request : add leave=True to dataset.map to enable tqdm nested bars (and whilst we're at it couldn't we get a way to access directly tqdm underneath?) **A clear and concise description of what you want to happen.** It would be so nice to be able to nest HuggingFace `Datasets.map() ` progress bars in the grander scheme of things and whilst we're at it why not other functions. **Describe alternatives you've considered** By the way is there not a way to directly interact with underlying tqdm module ? **kwargs-ish? **Additional context** Furthering tqdm integration #2374 and huggingface/transformers#11797 solutioned by huggingface/transformers#12226 provided with tqdm description as `desc=` @sgugger @bhavitvyamalik Hi ! Sounds like a good idea :) Also I think it would be better to have this as an actual parameters instead of kwargs to make it clearer
[ -0.3040521740913391, -0.44012486934661865, -0.07335549592971802, -0.16092795133590698, 0.12071307748556137, -0.08384843915700912, 0.36160314083099365, 0.18396468460559845, -0.2422843873500824, 0.14048275351524353, -0.2260066270828247, 0.5033693313598633, -0.020245742052793503, 0.5093123912811279, -0.004580236040055752, -0.08988535404205322, -0.021295927464962006, 0.0006455555558204651, -0.5398645401000977, 0.2524985074996948, -0.2420833855867386, 0.13215117156505585, -0.17773982882499695, 0.036646049469709396, -0.1847929060459137, -0.21858800947666168, -0.07853382080793381, 0.10855382680892944, 0.21258850395679474, -0.4118739366531372, 0.17505699396133423, 0.5118027925491333, -0.09248127043247223, 0.2173539400100708, -0.00011140590504510328, -0.14035135507583618, 0.24720551073551178, 0.025446588173508644, 0.09242871403694153, 0.27443385124206543, 0.02523113787174225, -0.3768673539161682, 0.20746666193008423, -0.22839313745498657, -0.041665684431791306, 0.07493031024932861, -0.23524071276187897, -0.1270354688167572, 0.6391502022743225, -0.302273690700531, 0.2194511890411377, 0.5766597986221313, -0.3688625991344452, -0.11059518903493881, -0.03639306128025055, -0.08761422336101532, -0.36019638180732727, 0.062149714678525925, 0.6224269866943359, -0.055548958480358124, -0.4059794545173645, 0.4138614535331726, 0.05080241709947586, -0.13472065329551697, 0.47560983896255493, 0.09720142930746078, 0.33912014961242676, -0.3385727107524872, -0.06311706453561783, 0.39009734988212585, 0.23850083351135254, -0.4620215594768524, -0.3017435371875763, -0.5928300619125366, -0.10619945824146271, 0.022214459255337715, 0.14176923036575317, -0.41659972071647644, -0.36066558957099915, 0.21184712648391724, -0.7446243166923523, -0.19066031277179718, -0.10463231801986694, -0.11455096304416656, -0.013260897248983383, -0.05985559523105621, -0.03830146789550781, -0.06791304796934128, 0.24906517565250397, 0.07168495655059814, -0.16565993428230286, 0.16341637074947357, 0.04146141558885574, 0.07291317731142044, -0.06158694252371788, -0.3877871632575989, 0.35717546939849854, 0.23807638883590698, 0.3436082899570465, 0.44932252168655396, -0.22927947342395782, 0.1998802125453949, -0.163822203874588, 0.19553059339523315, 0.002640455961227417, 0.06876078248023987, 0.2191925346851349, -0.7096214890480042, 0.3801071047782898, -0.0600181445479393, 0.01882234215736389, 0.07247738540172577, 0.5096793174743652, -0.3414827585220337, -0.0232229083776474, 0.14970046281814575, 0.07641136646270752, 0.18470200896263123, 0.049453556537628174, 0.06599171459674835, 0.4892996549606323, 0.04034425690770149, 0.18120655417442322, 0.22434261441230774, 0.1911829262971878, -0.17569154500961304, -0.13089439272880554, 0.21629264950752258, 0.07098245620727539, -0.1664344072341919, -0.11196866631507874, -0.14335311949253082, -0.03874528035521507, 0.2185351401567459, -0.15897031128406525, -0.03345416113734245, 0.13540281355381012, 0.13091978430747986, 0.21109077334403992, 0.3881792426109314, -0.03233564272522926, 0.3138100206851959, 0.38146477937698364, 0.17783288657665253, -0.22442898154258728, -0.05238895118236542, -0.0012406520545482635, -0.003291752189397812, -0.2528930604457855, 0.18428057432174683, 0.1515645533800125, -0.36155813932418823, -0.019272783771157265, 0.07952720671892166, -0.30507075786590576, -0.06991972029209137, -0.18322709202766418, 0.49675253033638, -0.15702956914901733, 0.2529943287372589, 0.3311839699745178, 0.22054940462112427, -0.32142627239227295, -0.12579889595508575, 0.27786898612976074, 0.5231165289878845, -0.009224861860275269, -0.4374575912952423, -0.11744863539934158, -0.2013554573059082, -0.1516341269016266, -0.04734402522444725, -0.06876648217439651, 0.19467729330062866, -0.22482284903526306, 0.3129490613937378, 0.14848650991916656, -0.24152396619319916, -0.3402498662471771, 0.3427256643772125, -0.24428647756576538, 0.004983959719538689, 0.07011613249778748, -0.02055174671113491, 0.3069835305213928, -0.01922968402504921, -0.01410818099975586, 0.19902920722961426, -0.21215198934078217, 0.07932756096124649, -0.12586835026741028, -0.23039983212947845, 0.24294795095920563, -0.050680309534072876, 0.011728193610906601, 0.006322130560874939, 0.23398816585540771, -0.5024093389511108, 0.4072948694229126, 0.1495751142501831, 0.18279370665550232, 0.044988539069890976, 0.12845860421657562, -0.352428674697876, -0.3019920885562897, -0.2372850477695465, -0.49794626235961914, 0.18620559573173523, 0.04974941164255142, 0.037318482995033264, -0.0976104736328125, -0.27283501625061035, -0.276261568069458, 0.026267187669873238, -0.17096079885959625, -0.1258239895105362, 0.0885968953371048, -0.3336373567581177, -0.15732470154762268, -0.09246869385242462, -0.37044697999954224, -0.01905841939151287, 0.20889347791671753, 0.1469106376171112, 0.12391771376132965, 0.2826061546802521, 0.3062501847743988, -0.059798575937747955, 0.003973431885242462, 0.3212851583957672, 0.04337188974022865, 0.05743267759680748, 0.13341614603996277, 0.3368084728717804, -0.15592007339000702, 0.33416253328323364, 0.2001488208770752, 0.15506502985954285, 0.2686707079410553, -0.009782366454601288, -0.19226950407028198, -0.04858037456870079, -0.3267365097999573, 0.051355041563510895, -0.10228849202394485, 0.41364920139312744, -0.06215272471308708, 0.17701047658920288, -0.1507863998413086, 0.3069583773612976, -0.1460065096616745, -0.18248653411865234, -0.4050614833831787, -0.542148232460022, -0.08355854451656342, 0.10855062305927277, 0.19052860140800476, -0.3169669806957245, 0.0083623006939888, 0.5795345306396484, 0.3920893371105194, 0.23659422993659973, 0.02561061829328537, -0.08794275671243668, -0.07395229488611221, 0.17091700434684753, 0.26262861490249634, 0.25394561886787415, 0.20873256027698517, 0.26543235778808594, 0.22665245831012726, 0.4055883586406708, 0.06791244447231293, -0.16109246015548706, -0.09233612567186356, 0.16648325324058533, -0.08305773138999939, 0.028900831937789917, -0.12759220600128174, 0.08213641494512558, -0.34301409125328064, -0.15164458751678467, -0.15615789592266083, -0.11613321304321289, -0.13149519264698029, -0.29320770502090454, -0.10016974061727524, -0.14345009624958038, 0.062087543308734894, -0.2277710884809494, -0.43322938680648804, -0.3049091398715973, 0.3392319679260254, 0.00688428059220314, -0.4466091990470886, 0.5754474997520447, 0.1684543341398239, 0.41016465425491333, -0.10217814892530441, 0.16996386647224426, -0.34425702691078186, -0.2505163252353668, 0.3481224775314331, 0.07321351766586304, -0.0645265206694603, -0.16958501935005188, 0.43885570764541626, -0.058681853115558624, 0.29618722200393677, -0.3456118702888489, -0.38510793447494507, 0.0845564529299736, -0.09781645238399506, 0.21586617827415466, 0.15576611459255219, 0.20507732033729553, -0.05463149771094322, 0.24707461893558502, 0.26738646626472473, -0.10884422808885574, -0.3712069094181061, -0.3445513844490051, 0.15569579601287842, 0.03450533375144005, -0.3399258852005005, 0.33454790711402893, -0.10212237387895584, -0.5162628293037415, 0.46783894300460815, -0.3595430552959442, -0.025182127952575684, 0.09042098373174667, -0.20807486772537231, 0.0643903836607933, -0.19265222549438477, -0.08943861722946167, -0.002604216104373336, -0.4241374135017395, 0.2659582197666168, -0.42166876792907715, 0.023219170048832893, 0.05456656590104103, -0.1467912197113037, 0.1811043918132782, -0.09951869398355484, -0.23609709739685059, -0.5348477363586426, -0.10992972552776337, 0.6421715021133423, 0.0428268164396286, 0.14605069160461426, 0.2659367024898529, 0.28879314661026, -0.05502507835626602, -0.014485988765954971, -0.20597034692764282, 0.1521560102701187, -0.06021062284708023, -0.09868382662534714, -0.19589748978614807, 0.15863755345344543, 0.0881337821483612, 0.4038797616958618, 0.22013495862483978, 0.18105171620845795, 0.05002222955226898, -0.14717526733875275, 0.25830844044685364, -0.03644111007452011, -0.30425789952278137, -0.24324347078800201, -0.10198205709457397, 0.19213224947452545, 0.1274721622467041, 0.13984966278076172, 0.48576343059539795, -0.07510128617286682, -0.20498277246952057, 0.07853031903505325, -0.39862942695617676, -0.03422872722148895, -0.24199962615966797, 0.29755493998527527, -0.13651908934116364, 0.006434634327888489, -0.014702197164297104, 0.09309908747673035, 0.3133542537689209, 0.268028199672699, 0.38398319482803345, -0.19571740925312042, -0.21942521631717682, 0.055353447794914246, -0.426483154296875, 0.3121028542518616, 0.32906877994537354, -0.501603364944458, -0.041470594704151154, -0.18506404757499695, 0.011740952730178833, 0.2056848257780075, 0.5050303936004639, -0.08731402456760406, 0.010030005127191544, 0.06090809032320976, -0.4131027162075043, -0.3722873330116272, 0.23826955258846283, 0.2806450426578522, 0.042679060250520706, 0.1858512908220291, 0.38581588864326477, -0.09986893087625504, -0.14383459091186523, -0.1091303676366806, -0.08739250153303146, -0.18235580623149872, -0.35618171095848083, -0.1118985116481781, -0.12164580076932907, -0.2173035591840744, 0.29157891869544983, 0.2890271246433258, -0.2932659685611725, -0.06173234432935715, -0.3027813732624054, 0.06602021306753159, -0.4239276647567749, -0.0605752170085907, 0.33563339710235596, 0.31675752997398376, 0.09690918028354645, 0.27031564712524414, 0.14935368299484253, -0.07724061608314514, -0.17513975501060486, 0.2805529832839966, -0.18591530621051788, -0.0507897287607193, -0.1274072229862213, -0.19427956640720367, 0.3486391007900238, 0.3845558762550354, -0.045427292585372925, 0.5756068229675293, 0.11408762633800507, 0.2552880048751831, -0.3540509343147278, -0.10228735208511353, -0.08210518956184387, -0.09876853227615356, 0.18359622359275818, 0.13491462171077728, 0.3692764341831207, -0.28200021386146545, -0.18593084812164307, -0.0942205935716629, 0.08059317618608475, -0.1923602670431137, -0.4546709656715393, 0.11684572696685791, 0.7653388977050781, -0.003714345395565033, 0.15796899795532227, 0.06763653457164764, 0.09774106740951538, 0.01590859517455101, 0.039356693625450134, 0.2007671445608139, -0.35950663685798645, -0.15575571358203888, -0.044976167380809784, -0.1185566633939743, 0.16066032648086548, 0.1628231704235077, -0.27205002307891846, -0.12890109419822693, 0.15025664865970612, 0.26861491799354553, -0.05758088082075119, -0.06496155261993408, -0.09255599230527878, -0.3470132350921631, -0.518724262714386, 0.03659587353467941, 0.18455244600772858, 0.10871461033821106, -0.18672001361846924, -0.21662411093711853, 0.25812119245529175, 0.0950784832239151, 0.01754695177078247, -0.31830188632011414, -0.4547736346721649, 0.18735404312610626, 0.48059308528900146, -0.15037530660629272, 0.19876420497894287, 0.21745571494102478, 0.5176843404769897, 0.037095461040735245, -0.28421103954315186, 0.18828324973583221, 0.05631307512521744, 0.23067142069339752, -0.06677273660898209, -0.02752048522233963, 0.30674734711647034, -0.2084534466266632, 0.08418964594602585, 0.2535693943500519, 0.08337580412626266, -0.3823869228363037, -0.12417836487293243, 0.1690419316291809, -0.039684318006038666, -0.08543145656585693, 0.4847453534603119, 0.07331937551498413, 0.3472258150577545, -0.31789883971214294, 0.046853482723236084, 0.3795197010040283, -0.12979042530059814, 0.3593480587005615, -0.1050628125667572, -0.030151136219501495, -0.0039640627801418304, 0.19819723069667816, -0.3212209939956665, 0.06796988099813461, -0.03173062950372696, 0.20982031524181366, -0.2484879493713379, -0.20781183242797852, 0.2450025975704193, 0.15986202657222748, -0.1893310546875, 0.44941890239715576, 0.010658873245120049, -0.06019663065671921, -0.2026672512292862, 0.43408137559890747, 0.033190011978149414, -0.14607590436935425, -0.13314254581928253, -0.012147482484579086, -0.6820904016494751, 0.15687693655490875, -0.11815866827964783, 0.10875096917152405, -0.011526050046086311, 0.47504180669784546, 0.11923612654209137, 0.004965256899595261, -0.3482021689414978, -0.15985140204429626, -0.020006999373435974, -0.07702133059501648, 0.5010875463485718, -0.25747933983802795, 0.2343612164258957, -0.04529552534222603, -0.08794023841619492, 0.19772358238697052, -0.42479753494262695, -0.14390766620635986, -0.2219492793083191, 0.13324904441833496, -0.1362675428390503, 0.04807578772306442, 0.14286182820796967, 0.1807464212179184, -0.14505229890346527, -0.1453191041946411, 0.32293882966041565, 0.017227254807949066, 0.22673484683036804, 0.05797852948307991, 0.13222548365592957, -0.04452110826969147, -0.1947350651025772, -0.12472566962242126, 0.36224907636642456, 0.16498687863349915, 0.01365647278726101, -0.030195243656635284, -0.3998119831085205, 0.03003975749015808, 0.5248731374740601, 0.4006967842578888, 0.38695067167282104, 0.09130178391933441, 0.05496224761009216, 0.18429481983184814, -0.1543203890323639, 0.08282974362373352, 0.34845882654190063, -0.07885457575321198, -0.30506619811058044, -0.19954851269721985, 0.15103542804718018, 0.1807103306055069, -0.19558840990066528, 0.05869384855031967, 0.1538313776254654, 0.03562768176198006, 0.4901197552680969, 0.38016700744628906, 0.054668936878442764, 0.2485884130001068, 0.06249655410647392, 0.07958868891000748, 0.11815044283866882, -0.11456938087940216, -0.05383974686264992, 0.00003807246685028076, 0.010656464844942093, 0.138322651386261, 0.5835258960723877, 0.4374542236328125, 0.24745690822601318, -0.08633780479431152, -0.1315152645111084, 0.1783091425895691, -0.09325458854436874, -0.089275062084198, 0.18206638097763062, -0.17893430590629578, -0.021393004804849625, -0.30639711022377014, 0.05217598378658295, -0.23660564422607422, -0.022076033055782318, 0.34247100353240967, 0.15623579919338226, -0.42398783564567566, -0.10618651658296585, 0.3574415147304535, -0.01217682659626007, -0.18086554110050201, 0.4242240786552429, -0.17347994446754456, -0.10081174224615097, 0.05119000002741814, -0.059933532029390335, -0.10230374336242676, 0.4667438864707947, -0.3101050853729248, 0.5773924589157104, -0.043858885765075684, -0.19344550371170044, 0.1347532570362091, 0.3207576870918274, -0.1712985634803772, -0.2745135724544525, 0.18045954406261444, 0.0064207762479782104, 0.040303509682416916, 0.11842095851898193, 0.1707594096660614, -0.12777027487754822, -0.22711989283561707, 0.036466557532548904, -0.21351534128189087, 0.025855587795376778, -0.25451719760894775, 0.01012837141752243, 0.015395447611808777, 0.02700698934495449, 0.3086263835430145, 0.10158656537532806, -0.20735594630241394, 0.2653200030326843, -0.07799167931079865, 0.2468758523464203, -0.3303637206554413, 0.3154090642929077, 0.13121885061264038, -0.1494397222995758, 0.056682322174310684, -0.0903211310505867, -0.05094485729932785, -0.43324610590934753, 0.3301748037338257, -0.3417448401451111, -0.023276161402463913, -0.3039068579673767, 0.08677411079406738, 0.04129631444811821, 0.4376166760921478, 0.13151274621486664, 0.17201882600784302, -0.14030472934246063, -0.25120508670806885, -0.5865774750709534, -0.04816476255655289, 0.38881152868270874, -0.2012028843164444, 0.1904444545507431, -0.14260832965373993, -0.02904750406742096, 0.4456567168235779, 0.43276381492614746, -0.26634183526039124, -0.11971966177225113, -0.40576106309890747, -0.23682789504528046, 0.11156488955020905, -0.1671510636806488, -0.07664273679256439, 0.19487930834293365, -0.016260143369436264, 0.12925520539283752, 0.22109977900981903, 0.0527791753411293, 0.18166430294513702, 0.10819151997566223, 0.09546305239200592, -0.07944437861442566, 0.2021181881427765, 0.01386692002415657, -0.11134058237075806, -0.023506656289100647, -0.1390833705663681, 0.13742467761039734, -0.09607773274183273, -0.028375696390867233, 0.0869201272726059, 0.0343845896422863, 0.2981603443622589, -0.22556112706661224, -0.18269653618335724, -0.21794386208057404, 0.052047211676836014, 0.393488347530365, 0.10169161856174469, 0.0017865784466266632, 0.2695510983467102, 0.06769173592329025, 0.06974227726459503, 0.09952788800001144, 0.29655978083610535, -0.005558103322982788, 0.49872034788131714, -0.17238348722457886, -0.3179529905319214, 0.4141160845756531, -0.17761212587356567, -0.3244432806968689, -0.022576484829187393, 0.10402673482894897, 0.11476971209049225, -0.21832561492919922, -0.5494416356086731, -0.32645663619041443, 0.13221700489521027, -0.04749344289302826, -0.21119652688503265, 0.48954182863235474, -0.2248505800962448, -0.19156502187252045, 0.040182407945394516, 0.0696713924407959, 0.22674474120140076, 0.08188238739967346, -0.20154540240764618, -0.16976095736026764 ]
https://github.com/huggingface/datasets/issues/3060
load_dataset('openwebtext') yields "Compressed file ended before the end-of-stream marker was reached"
Hi @RylanSchaeffer, thanks for reporting. I'm sorry, but I was not able to reproduce your problem. Normally, the reason for this type of error is that, during your download of the data files, this was not fully complete. Could you please try to load the dataset again but forcing its redownload? Please use: ```python dataset = load_dataset("openwebtext", download_mode="FORCE_REDOWNLOAD") ``` Let me know if the problem persists.
## Describe the bug When I try `load_dataset('openwebtext')`, I receive a "EOFError: Compressed file ended before the end-of-stream marker was reached" error. ## Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('openwebtext') ``` ## Expected results I expect the `dataset` variable to be properly constructed. ## Actual results ``` File "/home/rschaef/CoCoSci-Language-Distillation/distillation_v2/ratchet_learning/tasks/base.py", line 37, in create_dataset dataset_str, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/load.py", line 1117, in load_dataset use_auth_token=use_auth_token, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 637, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/rschaef/.cache/huggingface/modules/datasets_modules/datasets/openwebtext/85b3ae7051d2d72e7c5fdf6dfb462603aaa26e9ed506202bf3a24d261c6c40a1/openwebtext.py", line 61, in _split_generators dl_dir = dl_manager.download_and_extract(_URL) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 284, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 261, in extract partial(cached_path, download_config=download_config), path_or_paths, num_proc=num_proc, disable_tqdm=False File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 316, in cached_path output_path, force_extract=download_config.force_extract File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 40, in extract self.extractor.extract(input_path, output_path, extractor=extractor) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 179, in extract return extractor.extract(input_path, output_path) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 53, in extract tar_file.extractall(output_path) File "/usr/lib/python3.6/tarfile.py", line 2010, in extractall numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2052, in extract numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2122, in _extract_member self.makefile(tarinfo, targetpath) File "/usr/lib/python3.6/tarfile.py", line 2171, in makefile copyfileobj(source, target, tarinfo.size, ReadError, bufsize) File "/usr/lib/python3.6/tarfile.py", line 249, in copyfileobj buf = src.read(bufsize) File "/usr/lib/python3.6/lzma.py", line 200, in read return self._buffer.read(size) File "/usr/lib/python3.6/_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "/usr/lib/python3.6/_compression.py", line 99, in read raise EOFError("Compressed file ended before the " python-BaseException EOFError: Compressed file ended before the end-of-stream marker was reached ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0
66
load_dataset('openwebtext') yields "Compressed file ended before the end-of-stream marker was reached" ## Describe the bug When I try `load_dataset('openwebtext')`, I receive a "EOFError: Compressed file ended before the end-of-stream marker was reached" error. ## Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('openwebtext') ``` ## Expected results I expect the `dataset` variable to be properly constructed. ## Actual results ``` File "/home/rschaef/CoCoSci-Language-Distillation/distillation_v2/ratchet_learning/tasks/base.py", line 37, in create_dataset dataset_str, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/load.py", line 1117, in load_dataset use_auth_token=use_auth_token, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 637, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/rschaef/.cache/huggingface/modules/datasets_modules/datasets/openwebtext/85b3ae7051d2d72e7c5fdf6dfb462603aaa26e9ed506202bf3a24d261c6c40a1/openwebtext.py", line 61, in _split_generators dl_dir = dl_manager.download_and_extract(_URL) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 284, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 261, in extract partial(cached_path, download_config=download_config), path_or_paths, num_proc=num_proc, disable_tqdm=False File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 316, in cached_path output_path, force_extract=download_config.force_extract File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 40, in extract self.extractor.extract(input_path, output_path, extractor=extractor) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 179, in extract return extractor.extract(input_path, output_path) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 53, in extract tar_file.extractall(output_path) File "/usr/lib/python3.6/tarfile.py", line 2010, in extractall numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2052, in extract numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2122, in _extract_member self.makefile(tarinfo, targetpath) File "/usr/lib/python3.6/tarfile.py", line 2171, in makefile copyfileobj(source, target, tarinfo.size, ReadError, bufsize) File "/usr/lib/python3.6/tarfile.py", line 249, in copyfileobj buf = src.read(bufsize) File "/usr/lib/python3.6/lzma.py", line 200, in read return self._buffer.read(size) File "/usr/lib/python3.6/_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "/usr/lib/python3.6/_compression.py", line 99, in read raise EOFError("Compressed file ended before the " python-BaseException EOFError: Compressed file ended before the end-of-stream marker was reached ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0 Hi @RylanSchaeffer, thanks for reporting. I'm sorry, but I was not able to reproduce your problem. Normally, the reason for this type of error is that, during your download of the data files, this was not fully complete. Could you please try to load the dataset again but forcing its redownload? Please use: ```python dataset = load_dataset("openwebtext", download_mode="FORCE_REDOWNLOAD") ``` Let me know if the problem persists.
[ -0.3312985897064209, -0.09272674471139908, 0.003961075097322464, 0.49961936473846436, 0.21718384325504303, 0.02118682861328125, 0.15197432041168213, 0.3008333742618561, -0.09646771848201752, 0.28805485367774963, 0.045648738741874695, 0.40103527903556824, 0.10050017386674881, 0.1572417914867401, -0.13401533663272858, 0.12293268740177155, -0.053235165774822235, 0.22706449031829834, -0.34427088499069214, -0.16493570804595947, -0.3830603063106537, 0.18088139593601227, -0.277335524559021, 0.06287786364555359, -0.11118374019861221, -0.04698292911052704, -0.04318913072347641, 0.4383736848831177, -0.16301453113555908, -0.2796122431755066, 0.21366241574287415, -0.26955002546310425, 0.05395819991827011, 0.62617427110672, -0.00011615313997026533, -0.0926104411482811, 0.3415846824645996, -0.1594274789094925, -0.5765934586524963, -0.3982529044151306, -0.35959070920944214, -0.17110349237918854, -0.03513554483652115, -0.22343623638153076, 0.11316858977079391, -0.36370640993118286, -0.0003498438745737076, -0.9038020372390747, 0.4014371633529663, 0.38198503851890564, 0.17807404696941376, 0.2864636778831482, 0.10497252643108368, 0.02624686062335968, 0.23131102323532104, -0.1325443983078003, -0.11414604634046555, 0.024451639503240585, 0.1257956475019455, 0.021892042830586433, 0.026675887405872345, 0.1473562866449356, 0.0009366478770971298, 0.20057439804077148, 0.16415968537330627, 0.13659463822841644, 0.004893586039543152, -0.2551262080669403, 0.006879355758428574, 0.20739609003067017, 0.4921976625919342, -0.17440474033355713, -0.42625731229782104, -0.14017465710639954, -0.1636824905872345, -0.2943088114261627, 0.34651651978492737, 0.4004838466644287, -0.09351901710033417, 0.28458645939826965, -0.11828524619340897, 0.03998271003365517, -0.20838859677314758, 0.24476000666618347, -0.1515057235956192, 0.5106199979782104, -0.19010205566883087, 0.12007705122232437, -0.026689108461141586, 0.014350337907671928, 0.2320241779088974, -0.21819910407066345, -0.2323102056980133, 0.10403495281934738, -0.28711700439453125, 0.05721770226955414, 0.05217790603637695, 0.07545384764671326, 0.3376554250717163, 0.39263278245925903, 0.42264696955680847, 0.03615523502230644, -0.05788753181695938, 0.016829796135425568, 0.42939242720603943, 0.4896795451641083, 0.14400841295719147, 0.34169209003448486, 0.12816201150417328, 0.054867759346961975, -0.10552987456321716, -0.0860910415649414, -0.1812635213136673, -0.30853644013404846, 0.1995103359222412, 0.0358864851295948, 0.481858491897583, -0.2016388177871704, -0.4085268974304199, 0.06011943891644478, 0.0011187680065631866, -0.04909222945570946, -0.12704432010650635, 0.38399478793144226, -0.2501532733440399, 0.17462307214736938, 0.23533056676387787, 0.10767896473407745, -0.16709142923355103, -0.30091118812561035, -0.19934125244617462, -0.07741603255271912, -0.15109902620315552, -0.17150016129016876, 0.04378918185830116, -0.44792503118515015, 0.3691602945327759, -0.02339092269539833, 0.03999883309006691, -0.2815093696117401, 0.12894707918167114, -0.11100107431411743, 0.25248464941978455, -0.007383417338132858, 0.021578580141067505, 0.17519189417362213, 0.2928542196750641, -0.03351040929555893, -0.06657903641462326, 0.25399520993232727, -0.32195356488227844, -0.3707030415534973, -0.20562608540058136, 0.20987661182880402, -0.2052975445985794, -0.030798569321632385, -0.13978895545005798, -0.11588093638420105, 0.37115907669067383, 0.02397468313574791, -0.21010449528694153, -0.09130106121301651, -0.35544753074645996, -0.11272440105676651, 0.2910829484462738, 0.4761280417442322, -0.2243701070547104, -0.11167651414871216, -0.058635205030441284, 0.03556279093027115, 0.3517944812774658, 0.007203090935945511, -0.19569140672683716, 0.16788139939308167, -0.33787959814071655, -0.03893040865659714, 0.4461304247379303, -0.37895697355270386, -0.5029717087745667, 0.2231989949941635, -0.17938484251499176, 0.2654222846031189, 0.053142137825489044, -0.40977033972740173, 0.26957622170448303, -0.09524857252836227, 0.10452419519424438, 0.39071255922317505, -0.1543828248977661, 0.203748881816864, -0.2764242887496948, -0.2854367196559906, 0.422817587852478, 0.07964916527271271, -0.18507689237594604, 0.11224955320358276, 0.1673431545495987, 0.11808987706899643, 0.2080077826976776, -0.06960275769233704, 0.12770259380340576, -0.10673701763153076, 0.05224442481994629, -0.12270066142082214, 0.11663294583559036, -0.09565144777297974, -0.10175129026174545, 0.17304664850234985, 0.0438254177570343, 0.09724873304367065, -0.21944622695446014, 0.09408468008041382, -0.4863499104976654, 0.08394166827201843, -0.45058873295783997, -0.23581111431121826, 0.09104225039482117, 0.2770385444164276, 0.09874577820301056, 0.07913719117641449, -0.12255565822124481, 0.35598495602607727, -0.09971945732831955, 0.07039570063352585, -0.21066665649414062, 0.06684685498476028, 0.050584930926561356, 0.04399530217051506, 0.18149736523628235, 0.11817488074302673, 0.06298080831766129, -0.33638665080070496, -0.4088577926158905, 0.4617058038711548, -0.045772142708301544, 0.2274635136127472, -0.13598161935806274, -0.11618711054325104, 0.13529948890209198, -0.282034695148468, 0.13517779111862183, 0.15448112785816193, 0.18608878552913666, 0.05856136977672577, 0.053363192826509476, 0.13909803330898285, 0.36111587285995483, 0.1057872399687767, 0.03572844713926315, -0.08005588501691818, 0.09202977269887924, -0.13466621935367584, 0.06108635663986206, -0.23760986328125, 0.18962985277175903, -0.07956372201442719, 0.3487713932991028, -0.08305177092552185, 0.3082599639892578, 0.12517696619033813, 0.5375605225563049, 0.030142057687044144, 0.04064173623919487, 0.41362103819847107, -0.1843680739402771, -0.15021467208862305, -0.15020182728767395, 0.2045319825410843, 0.49249786138534546, 0.20754124224185944, 0.13586817681789398, 0.005775421857833862, 0.1321403533220291, -0.0433415062725544, 0.46217912435531616, 0.12229505181312561, 0.24427491426467896, 0.3935106098651886, 0.09054595232009888, 0.011095928028225899, -0.12028922140598297, -0.1793653666973114, -0.07236695289611816, 0.16389794647693634, -0.38755378127098083, 0.18132315576076508, -0.33840155601501465, 0.10173068195581436, -0.013655765913426876, 0.042115893214941025, 0.060779012739658356, -0.29982730746269226, -0.11190816760063171, -0.0727643072605133, -0.12968604266643524, 0.2440658062696457, -0.03832294046878815, 0.20574325323104858, 0.2878127992153168, 0.06116300821304321, 0.10410434007644653, -0.19870752096176147, -0.3906431496143341, 0.020922888070344925, 0.20306357741355896, -0.08950216323137283, 0.1980607509613037, -0.2523883879184723, -0.0873996913433075, -0.09602894634008408, -0.06074708700180054, 0.24781960248947144, 0.08348862826824188, 0.39644673466682434, 0.10299303382635117, 0.12372402846813202, 0.15310584008693695, -0.3236400783061981, 0.23782190680503845, -0.06540193408727646, -0.24834461510181427, 0.12707535922527313, 0.030228715389966965, 0.04546227678656578, -0.041141264140605927, -0.5968300700187683, -0.2533138692378998, -0.5044033527374268, -0.021333254873752594, -0.018951330333948135, 0.17215128242969513, 0.27510926127433777, 0.12241438031196594, 0.05661768093705177, 0.13418792188167572, 0.11483513563871384, -0.21505774557590485, -0.5697594881057739, 0.3551079034805298, -0.28968825936317444, -0.31971633434295654, -0.025002680718898773, 0.03501366078853607, 0.027304723858833313, 0.17753976583480835, -0.4853965640068054, 0.20391006767749786, -0.19917425513267517, -0.12162357568740845, -0.38322997093200684, 0.2537443935871124, 0.19030743837356567, 0.07848870009183884, -0.0645282119512558, -0.30620020627975464, -0.040164053440093994, 0.13978222012519836, -0.07696526497602463, 0.33634036779403687, -0.07936416566371918, 0.37246763706207275, 0.028379302471876144, 0.09352473169565201, 0.3273420035839081, 0.005920037627220154, 0.3541778326034546, 0.035877227783203125, 0.2581321597099304, -0.10970912128686905, -0.10721710324287415, 0.1250619888305664, -0.13807374238967896, -0.05324101448059082, 0.4216043949127197, 0.25991788506507874, 0.11538941413164139, -0.27548128366470337, 0.05070221796631813, -0.35618889331817627, -0.16600945591926575, -0.10813447833061218, -0.0020897239446640015, 0.15431630611419678, 0.08093404769897461, 0.08998691290616989, -0.14262570440769196, 0.05276334285736084, 0.01865881122648716, -0.04195091128349304, 0.05683343484997749, -0.17104142904281616, 0.02317230775952339, 0.31245923042297363, -0.5204682350158691, 0.26058343052864075, 0.089466892182827, 0.28424108028411865, 0.00105242058634758, -0.1432713270187378, -0.08809995651245117, 0.027730554342269897, 0.3974626660346985, -0.07891394197940826, 0.37690794467926025, 0.07841995358467102, 0.30225810408592224, -0.22359342873096466, 0.02307702973484993, -0.05800198018550873, 0.1995110809803009, 0.1498226374387741, 0.12626934051513672, -0.27428627014160156, 0.05269060656428337, 0.2208813726902008, 0.3646792769432068, -0.2093191146850586, -0.12187063694000244, -0.16771960258483887, -0.3943437337875366, -0.24031472206115723, -0.2420589029788971, 0.025291314348578453, 0.38837531208992004, -0.17948634922504425, -0.3364023268222809, -0.04008473455905914, -0.28600573539733887, 0.053807757794857025, 0.09790042042732239, 0.2472582459449768, -0.16303923726081848, 0.23125320672988892, -0.03944212943315506, 0.2188841700553894, 0.381259024143219, 0.7686731219291687, 0.07262901961803436, -0.45998919010162354, 0.17606571316719055, -0.08789165318012238, 0.04368417710065842, 0.03273937106132507, -0.2629179358482361, -0.2616368234157562, 0.014843680895864964, 0.32350754737854004, -0.2305271029472351, 0.30055001378059387, 0.1901092231273651, 0.14120690524578094, -0.4759507477283478, -0.4383702874183655, 0.40975332260131836, -0.20084871351718903, 0.09085018932819366, 0.7001904845237732, -0.2823851704597473, -0.3593752086162567, 0.37016797065734863, -0.08821132034063339, 0.9076290130615234, 0.13158318400382996, -0.14301133155822754, 0.327044278383255, -0.116463802754879, 0.2704951763153076, -0.1891549527645111, -0.13534370064735413, -0.1587114930152893, -0.38198867440223694, 0.08616676181554794, -0.13585491478443146, 0.022086251527071, 0.2708480656147003, -0.48691806197166443, 0.1187651976943016, -0.22456905245780945, -0.2238391637802124, 0.19223731756210327, 0.2945992350578308, -0.2236882895231247, -0.2112639844417572, -0.45464152097702026, 0.11135350167751312, -0.15147635340690613, 0.15426671504974365, -0.021053943783044815, 0.007553707808256149, -0.21834082901477814, -0.23716522753238678, -0.21413420140743256, 0.38380786776542664, -0.46361589431762695, 0.06038875877857208, -0.3841511309146881, -0.3328837454319, 0.24817103147506714, 0.10137543082237244, 0.09866563975811005, 0.11677736043930054, -0.07287941128015518, 0.21144217252731323, 0.03806499019265175, 0.038793690502643585, 0.03557802736759186, 0.09737855941057205, 0.23034915328025818, -0.0861828401684761, -0.09512756764888763, 0.14532724022865295, -0.2186679244041443, -0.27224987745285034, 0.5731279253959656, 0.0039059147238731384, 0.29375898838043213, -0.41136592626571655, -0.13267727196216583, -0.09849226474761963, 0.048935163766145706, -0.3025234639644623, 0.10134361684322357, 0.2192646563053131, -0.2334110587835312, 0.15335506200790405, 0.08186288923025131, -0.35897335410118103, -0.1407087743282318, 0.29475390911102295, -0.17212152481079102, 0.023376796394586563, 0.5264534950256348, 0.22048155963420868, 0.002052783966064453, -0.10686072707176208, 0.34729284048080444, -0.03137267008423805, -0.5548990964889526, 0.4126233458518982, -0.0865047350525856, 0.31186550855636597, -0.21006494760513306, 0.6979730725288391, 0.23858267068862915, 0.34825652837753296, -0.010866772383451462, -0.50896817445755, -0.029853366315364838, -0.1315164417028427, -0.30017387866973877, 0.11544670164585114, -0.016278749331831932, 0.28955405950546265, -0.04690111428499222, -0.007480742409825325, -0.2750292420387268, 0.015073471702635288, -0.046825557947158813, 0.03654862195253372, 0.32453653216362, 0.13574489951133728, 0.2842973470687866, 0.004792115651071072, 0.07590699940919876, 0.05919020622968674, -0.07054696977138519, -0.24511533975601196, -0.26552504301071167, 0.2086174637079239, 0.01184576191008091, -0.21695470809936523, -0.03790343180298805, -0.130031555891037, -0.07664643228054047, -0.32037124037742615, 0.20984914898872375, -0.09886634349822998, -0.14856462180614471, -0.08447547256946564, 0.18645280599594116, 0.01345900073647499, -0.20230889320373535, -0.0849791094660759, -0.13901765644550323, 0.34650442004203796, 0.07376599311828613, 0.25233909487724304, 0.011325608007609844, -0.147742360830307, -0.07692953199148178, -0.07841628044843674, -0.010099031031131744, 0.07773813605308533, 0.4048347771167755, -0.3803054690361023, -0.052406247705221176, 0.37250658869743347, 0.229511559009552, 0.3335464894771576, -0.26399821043014526, -0.119475819170475, 0.07234151661396027, 0.23224575817584991, -0.17485061287879944, -0.07428638637065887, -0.17059795558452606, 0.04752656817436218, -0.14892111718654633, 0.09587928652763367, -0.20288480818271637, -0.28033608198165894, -0.29270392656326294, -0.033113859593868256, 0.36475688219070435, 0.03551321476697922, 0.5340806841850281, 0.3414115607738495, -0.16941304504871368, 0.13518352806568146, 0.0058016423135995865, -0.13880528509616852, 0.2735063135623932, 0.25536325573921204, 0.060078784823417664, 0.21077685058116913, 0.24422872066497803, 0.4803510010242462, -0.4113747179508209, -0.5874178409576416, 0.12076213955879211, 0.2657002806663513, -0.09210383892059326, 0.37994855642318726, 0.1737385243177414, 0.26895084977149963, -0.37467288970947266, 0.05312949791550636, -0.35658231377601624, 0.15932922065258026, 0.036686234176158905, -0.021726641803979874, 0.21219457685947418, -0.19864530861377716, -0.049022965133190155, -0.016013631597161293, -0.013867244124412537, -0.085261270403862, -0.21701714396476746, 0.05163255333900452, -0.16640783846378326, -0.1581415981054306, -0.20404484868049622, 0.12446999549865723, 0.2201445996761322, -0.4705685079097748, 0.2944375276565552, 0.40265095233917236, -0.17014040052890778, -0.088304802775383, 0.3750334084033966, 0.5729662775993347, 0.5070335865020752, 0.028217844665050507, 0.07492834329605103, 0.132710263133049, -0.0337618924677372, -0.06686592847108841, 0.2761419415473938, 0.09671584516763687, 0.01637977920472622, 0.40603214502334595, 0.15390844643115997, -0.17686016857624054, -0.14120784401893616, 0.28715598583221436, 0.14936496317386627, -0.3433714210987091, 0.021440662443637848, -0.0026764720678329468, -0.08336752653121948, -0.19894737005233765, 0.06536005437374115, -0.352037638425827, 0.11742693930864334, 0.106142058968544, -0.053612127900123596, 0.096189484000206, 0.03055179864168167, 0.0917767658829689, -0.045187268406152725, 0.3622710704803467, 0.2896977365016937, 0.09503957629203796, -0.26134365797042847, -0.5776647925376892, -0.5151478052139282, 0.401710569858551, -0.13136382400989532, -0.36773309111595154, 0.020953789353370667, 0.2548776865005493, -0.025243915617465973, 0.18574200570583344, 0.09321810305118561, 0.1646304875612259, 0.13978688418865204, 0.037445634603500366, -0.4324447512626648, -0.5413463711738586, -0.02275211364030838, 0.18125146627426147, -0.06818057596683502, -0.5608496069908142, -0.0752052366733551, -0.14455938339233398, -0.025624224916100502, -0.08340291678905487, -0.010169830173254013, 0.06433485448360443, -0.25087788701057434, 0.5731596946716309, 0.19470742344856262, 0.32166287302970886, -0.24876394867897034, 0.003687746822834015, -0.17305316030979156, -0.3250439763069153, -0.04884729161858559, 0.22718337178230286, 0.21046580374240875, 0.36659714579582214, -0.15454760193824768, -0.11769624054431915, -0.3677040934562683, 0.3246561586856842, 0.15416379272937775, -0.18985982239246368, -0.25318896770477295, 0.022564714774489403, 0.05934067815542221, -0.25818148255348206, 0.2213525027036667, 0.05246872454881668, -0.16913390159606934, 0.0093495212495327, 0.1431339532136917, -0.31346285343170166, 0.2942294776439667, -0.24888373911380768, -0.32024335861206055, 0.16811172664165497, 0.27274608612060547, 0.06729279458522797, -0.11466749757528305, -0.3479160666465759, 0.2682458162307739, 0.5611081123352051, 0.12375154346227646, -0.2844814360141754, 0.30991101264953613, -0.24266788363456726, 0.1090402901172638, 0.05418675020337105, 0.4131999611854553, 0.029400920495390892, -0.36325037479400635, 0.10098814964294434, -0.321227490901947 ]
https://github.com/huggingface/datasets/issues/3060
load_dataset('openwebtext') yields "Compressed file ended before the end-of-stream marker was reached"
I close this issue for the moment. Feel free to re-open it again if the problem persists.
## Describe the bug When I try `load_dataset('openwebtext')`, I receive a "EOFError: Compressed file ended before the end-of-stream marker was reached" error. ## Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('openwebtext') ``` ## Expected results I expect the `dataset` variable to be properly constructed. ## Actual results ``` File "/home/rschaef/CoCoSci-Language-Distillation/distillation_v2/ratchet_learning/tasks/base.py", line 37, in create_dataset dataset_str, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/load.py", line 1117, in load_dataset use_auth_token=use_auth_token, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 637, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/rschaef/.cache/huggingface/modules/datasets_modules/datasets/openwebtext/85b3ae7051d2d72e7c5fdf6dfb462603aaa26e9ed506202bf3a24d261c6c40a1/openwebtext.py", line 61, in _split_generators dl_dir = dl_manager.download_and_extract(_URL) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 284, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 261, in extract partial(cached_path, download_config=download_config), path_or_paths, num_proc=num_proc, disable_tqdm=False File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 316, in cached_path output_path, force_extract=download_config.force_extract File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 40, in extract self.extractor.extract(input_path, output_path, extractor=extractor) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 179, in extract return extractor.extract(input_path, output_path) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 53, in extract tar_file.extractall(output_path) File "/usr/lib/python3.6/tarfile.py", line 2010, in extractall numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2052, in extract numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2122, in _extract_member self.makefile(tarinfo, targetpath) File "/usr/lib/python3.6/tarfile.py", line 2171, in makefile copyfileobj(source, target, tarinfo.size, ReadError, bufsize) File "/usr/lib/python3.6/tarfile.py", line 249, in copyfileobj buf = src.read(bufsize) File "/usr/lib/python3.6/lzma.py", line 200, in read return self._buffer.read(size) File "/usr/lib/python3.6/_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "/usr/lib/python3.6/_compression.py", line 99, in read raise EOFError("Compressed file ended before the " python-BaseException EOFError: Compressed file ended before the end-of-stream marker was reached ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0
17
load_dataset('openwebtext') yields "Compressed file ended before the end-of-stream marker was reached" ## Describe the bug When I try `load_dataset('openwebtext')`, I receive a "EOFError: Compressed file ended before the end-of-stream marker was reached" error. ## Steps to reproduce the bug ``` from datasets import load_dataset dataset = load_dataset('openwebtext') ``` ## Expected results I expect the `dataset` variable to be properly constructed. ## Actual results ``` File "/home/rschaef/CoCoSci-Language-Distillation/distillation_v2/ratchet_learning/tasks/base.py", line 37, in create_dataset dataset_str, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/load.py", line 1117, in load_dataset use_auth_token=use_auth_token, File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 637, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/rschaef/.cache/huggingface/modules/datasets_modules/datasets/openwebtext/85b3ae7051d2d72e7c5fdf6dfb462603aaa26e9ed506202bf3a24d261c6c40a1/openwebtext.py", line 61, in _split_generators dl_dir = dl_manager.download_and_extract(_URL) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 284, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/download_manager.py", line 261, in extract partial(cached_path, download_config=download_config), path_or_paths, num_proc=num_proc, disable_tqdm=False File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 316, in cached_path output_path, force_extract=download_config.force_extract File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 40, in extract self.extractor.extract(input_path, output_path, extractor=extractor) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 179, in extract return extractor.extract(input_path, output_path) File "/home/rschaef/CoCoSci-Language-Distillation/cocosci/lib/python3.6/site-packages/datasets/utils/extract.py", line 53, in extract tar_file.extractall(output_path) File "/usr/lib/python3.6/tarfile.py", line 2010, in extractall numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2052, in extract numeric_owner=numeric_owner) File "/usr/lib/python3.6/tarfile.py", line 2122, in _extract_member self.makefile(tarinfo, targetpath) File "/usr/lib/python3.6/tarfile.py", line 2171, in makefile copyfileobj(source, target, tarinfo.size, ReadError, bufsize) File "/usr/lib/python3.6/tarfile.py", line 249, in copyfileobj buf = src.read(bufsize) File "/usr/lib/python3.6/lzma.py", line 200, in read return self._buffer.read(size) File "/usr/lib/python3.6/_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "/usr/lib/python3.6/_compression.py", line 99, in read raise EOFError("Compressed file ended before the " python-BaseException EOFError: Compressed file ended before the end-of-stream marker was reached ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0 I close this issue for the moment. Feel free to re-open it again if the problem persists.
[ -0.3312985897064209, -0.09272674471139908, 0.003961075097322464, 0.49961936473846436, 0.21718384325504303, 0.02118682861328125, 0.15197432041168213, 0.3008333742618561, -0.09646771848201752, 0.28805485367774963, 0.045648738741874695, 0.40103527903556824, 0.10050017386674881, 0.1572417914867401, -0.13401533663272858, 0.12293268740177155, -0.053235165774822235, 0.22706449031829834, -0.34427088499069214, -0.16493570804595947, -0.3830603063106537, 0.18088139593601227, -0.277335524559021, 0.06287786364555359, -0.11118374019861221, -0.04698292911052704, -0.04318913072347641, 0.4383736848831177, -0.16301453113555908, -0.2796122431755066, 0.21366241574287415, -0.26955002546310425, 0.05395819991827011, 0.62617427110672, -0.00011615313997026533, -0.0926104411482811, 0.3415846824645996, -0.1594274789094925, -0.5765934586524963, -0.3982529044151306, -0.35959070920944214, -0.17110349237918854, -0.03513554483652115, -0.22343623638153076, 0.11316858977079391, -0.36370640993118286, -0.0003498438745737076, -0.9038020372390747, 0.4014371633529663, 0.38198503851890564, 0.17807404696941376, 0.2864636778831482, 0.10497252643108368, 0.02624686062335968, 0.23131102323532104, -0.1325443983078003, -0.11414604634046555, 0.024451639503240585, 0.1257956475019455, 0.021892042830586433, 0.026675887405872345, 0.1473562866449356, 0.0009366478770971298, 0.20057439804077148, 0.16415968537330627, 0.13659463822841644, 0.004893586039543152, -0.2551262080669403, 0.006879355758428574, 0.20739609003067017, 0.4921976625919342, -0.17440474033355713, -0.42625731229782104, -0.14017465710639954, -0.1636824905872345, -0.2943088114261627, 0.34651651978492737, 0.4004838466644287, -0.09351901710033417, 0.28458645939826965, -0.11828524619340897, 0.03998271003365517, -0.20838859677314758, 0.24476000666618347, -0.1515057235956192, 0.5106199979782104, -0.19010205566883087, 0.12007705122232437, -0.026689108461141586, 0.014350337907671928, 0.2320241779088974, -0.21819910407066345, -0.2323102056980133, 0.10403495281934738, -0.28711700439453125, 0.05721770226955414, 0.05217790603637695, 0.07545384764671326, 0.3376554250717163, 0.39263278245925903, 0.42264696955680847, 0.03615523502230644, -0.05788753181695938, 0.016829796135425568, 0.42939242720603943, 0.4896795451641083, 0.14400841295719147, 0.34169209003448486, 0.12816201150417328, 0.054867759346961975, -0.10552987456321716, -0.0860910415649414, -0.1812635213136673, -0.30853644013404846, 0.1995103359222412, 0.0358864851295948, 0.481858491897583, -0.2016388177871704, -0.4085268974304199, 0.06011943891644478, 0.0011187680065631866, -0.04909222945570946, -0.12704432010650635, 0.38399478793144226, -0.2501532733440399, 0.17462307214736938, 0.23533056676387787, 0.10767896473407745, -0.16709142923355103, -0.30091118812561035, -0.19934125244617462, -0.07741603255271912, -0.15109902620315552, -0.17150016129016876, 0.04378918185830116, -0.44792503118515015, 0.3691602945327759, -0.02339092269539833, 0.03999883309006691, -0.2815093696117401, 0.12894707918167114, -0.11100107431411743, 0.25248464941978455, -0.007383417338132858, 0.021578580141067505, 0.17519189417362213, 0.2928542196750641, -0.03351040929555893, -0.06657903641462326, 0.25399520993232727, -0.32195356488227844, -0.3707030415534973, -0.20562608540058136, 0.20987661182880402, -0.2052975445985794, -0.030798569321632385, -0.13978895545005798, -0.11588093638420105, 0.37115907669067383, 0.02397468313574791, -0.21010449528694153, -0.09130106121301651, -0.35544753074645996, -0.11272440105676651, 0.2910829484462738, 0.4761280417442322, -0.2243701070547104, -0.11167651414871216, -0.058635205030441284, 0.03556279093027115, 0.3517944812774658, 0.007203090935945511, -0.19569140672683716, 0.16788139939308167, -0.33787959814071655, -0.03893040865659714, 0.4461304247379303, -0.37895697355270386, -0.5029717087745667, 0.2231989949941635, -0.17938484251499176, 0.2654222846031189, 0.053142137825489044, -0.40977033972740173, 0.26957622170448303, -0.09524857252836227, 0.10452419519424438, 0.39071255922317505, -0.1543828248977661, 0.203748881816864, -0.2764242887496948, -0.2854367196559906, 0.422817587852478, 0.07964916527271271, -0.18507689237594604, 0.11224955320358276, 0.1673431545495987, 0.11808987706899643, 0.2080077826976776, -0.06960275769233704, 0.12770259380340576, -0.10673701763153076, 0.05224442481994629, -0.12270066142082214, 0.11663294583559036, -0.09565144777297974, -0.10175129026174545, 0.17304664850234985, 0.0438254177570343, 0.09724873304367065, -0.21944622695446014, 0.09408468008041382, -0.4863499104976654, 0.08394166827201843, -0.45058873295783997, -0.23581111431121826, 0.09104225039482117, 0.2770385444164276, 0.09874577820301056, 0.07913719117641449, -0.12255565822124481, 0.35598495602607727, -0.09971945732831955, 0.07039570063352585, -0.21066665649414062, 0.06684685498476028, 0.050584930926561356, 0.04399530217051506, 0.18149736523628235, 0.11817488074302673, 0.06298080831766129, -0.33638665080070496, -0.4088577926158905, 0.4617058038711548, -0.045772142708301544, 0.2274635136127472, -0.13598161935806274, -0.11618711054325104, 0.13529948890209198, -0.282034695148468, 0.13517779111862183, 0.15448112785816193, 0.18608878552913666, 0.05856136977672577, 0.053363192826509476, 0.13909803330898285, 0.36111587285995483, 0.1057872399687767, 0.03572844713926315, -0.08005588501691818, 0.09202977269887924, -0.13466621935367584, 0.06108635663986206, -0.23760986328125, 0.18962985277175903, -0.07956372201442719, 0.3487713932991028, -0.08305177092552185, 0.3082599639892578, 0.12517696619033813, 0.5375605225563049, 0.030142057687044144, 0.04064173623919487, 0.41362103819847107, -0.1843680739402771, -0.15021467208862305, -0.15020182728767395, 0.2045319825410843, 0.49249786138534546, 0.20754124224185944, 0.13586817681789398, 0.005775421857833862, 0.1321403533220291, -0.0433415062725544, 0.46217912435531616, 0.12229505181312561, 0.24427491426467896, 0.3935106098651886, 0.09054595232009888, 0.011095928028225899, -0.12028922140598297, -0.1793653666973114, -0.07236695289611816, 0.16389794647693634, -0.38755378127098083, 0.18132315576076508, -0.33840155601501465, 0.10173068195581436, -0.013655765913426876, 0.042115893214941025, 0.060779012739658356, -0.29982730746269226, -0.11190816760063171, -0.0727643072605133, -0.12968604266643524, 0.2440658062696457, -0.03832294046878815, 0.20574325323104858, 0.2878127992153168, 0.06116300821304321, 0.10410434007644653, -0.19870752096176147, -0.3906431496143341, 0.020922888070344925, 0.20306357741355896, -0.08950216323137283, 0.1980607509613037, -0.2523883879184723, -0.0873996913433075, -0.09602894634008408, -0.06074708700180054, 0.24781960248947144, 0.08348862826824188, 0.39644673466682434, 0.10299303382635117, 0.12372402846813202, 0.15310584008693695, -0.3236400783061981, 0.23782190680503845, -0.06540193408727646, -0.24834461510181427, 0.12707535922527313, 0.030228715389966965, 0.04546227678656578, -0.041141264140605927, -0.5968300700187683, -0.2533138692378998, -0.5044033527374268, -0.021333254873752594, -0.018951330333948135, 0.17215128242969513, 0.27510926127433777, 0.12241438031196594, 0.05661768093705177, 0.13418792188167572, 0.11483513563871384, -0.21505774557590485, -0.5697594881057739, 0.3551079034805298, -0.28968825936317444, -0.31971633434295654, -0.025002680718898773, 0.03501366078853607, 0.027304723858833313, 0.17753976583480835, -0.4853965640068054, 0.20391006767749786, -0.19917425513267517, -0.12162357568740845, -0.38322997093200684, 0.2537443935871124, 0.19030743837356567, 0.07848870009183884, -0.0645282119512558, -0.30620020627975464, -0.040164053440093994, 0.13978222012519836, -0.07696526497602463, 0.33634036779403687, -0.07936416566371918, 0.37246763706207275, 0.028379302471876144, 0.09352473169565201, 0.3273420035839081, 0.005920037627220154, 0.3541778326034546, 0.035877227783203125, 0.2581321597099304, -0.10970912128686905, -0.10721710324287415, 0.1250619888305664, -0.13807374238967896, -0.05324101448059082, 0.4216043949127197, 0.25991788506507874, 0.11538941413164139, -0.27548128366470337, 0.05070221796631813, -0.35618889331817627, -0.16600945591926575, -0.10813447833061218, -0.0020897239446640015, 0.15431630611419678, 0.08093404769897461, 0.08998691290616989, -0.14262570440769196, 0.05276334285736084, 0.01865881122648716, -0.04195091128349304, 0.05683343484997749, -0.17104142904281616, 0.02317230775952339, 0.31245923042297363, -0.5204682350158691, 0.26058343052864075, 0.089466892182827, 0.28424108028411865, 0.00105242058634758, -0.1432713270187378, -0.08809995651245117, 0.027730554342269897, 0.3974626660346985, -0.07891394197940826, 0.37690794467926025, 0.07841995358467102, 0.30225810408592224, -0.22359342873096466, 0.02307702973484993, -0.05800198018550873, 0.1995110809803009, 0.1498226374387741, 0.12626934051513672, -0.27428627014160156, 0.05269060656428337, 0.2208813726902008, 0.3646792769432068, -0.2093191146850586, -0.12187063694000244, -0.16771960258483887, -0.3943437337875366, -0.24031472206115723, -0.2420589029788971, 0.025291314348578453, 0.38837531208992004, -0.17948634922504425, -0.3364023268222809, -0.04008473455905914, -0.28600573539733887, 0.053807757794857025, 0.09790042042732239, 0.2472582459449768, -0.16303923726081848, 0.23125320672988892, -0.03944212943315506, 0.2188841700553894, 0.381259024143219, 0.7686731219291687, 0.07262901961803436, -0.45998919010162354, 0.17606571316719055, -0.08789165318012238, 0.04368417710065842, 0.03273937106132507, -0.2629179358482361, -0.2616368234157562, 0.014843680895864964, 0.32350754737854004, -0.2305271029472351, 0.30055001378059387, 0.1901092231273651, 0.14120690524578094, -0.4759507477283478, -0.4383702874183655, 0.40975332260131836, -0.20084871351718903, 0.09085018932819366, 0.7001904845237732, -0.2823851704597473, -0.3593752086162567, 0.37016797065734863, -0.08821132034063339, 0.9076290130615234, 0.13158318400382996, -0.14301133155822754, 0.327044278383255, -0.116463802754879, 0.2704951763153076, -0.1891549527645111, -0.13534370064735413, -0.1587114930152893, -0.38198867440223694, 0.08616676181554794, -0.13585491478443146, 0.022086251527071, 0.2708480656147003, -0.48691806197166443, 0.1187651976943016, -0.22456905245780945, -0.2238391637802124, 0.19223731756210327, 0.2945992350578308, -0.2236882895231247, -0.2112639844417572, -0.45464152097702026, 0.11135350167751312, -0.15147635340690613, 0.15426671504974365, -0.021053943783044815, 0.007553707808256149, -0.21834082901477814, -0.23716522753238678, -0.21413420140743256, 0.38380786776542664, -0.46361589431762695, 0.06038875877857208, -0.3841511309146881, -0.3328837454319, 0.24817103147506714, 0.10137543082237244, 0.09866563975811005, 0.11677736043930054, -0.07287941128015518, 0.21144217252731323, 0.03806499019265175, 0.038793690502643585, 0.03557802736759186, 0.09737855941057205, 0.23034915328025818, -0.0861828401684761, -0.09512756764888763, 0.14532724022865295, -0.2186679244041443, -0.27224987745285034, 0.5731279253959656, 0.0039059147238731384, 0.29375898838043213, -0.41136592626571655, -0.13267727196216583, -0.09849226474761963, 0.048935163766145706, -0.3025234639644623, 0.10134361684322357, 0.2192646563053131, -0.2334110587835312, 0.15335506200790405, 0.08186288923025131, -0.35897335410118103, -0.1407087743282318, 0.29475390911102295, -0.17212152481079102, 0.023376796394586563, 0.5264534950256348, 0.22048155963420868, 0.002052783966064453, -0.10686072707176208, 0.34729284048080444, -0.03137267008423805, -0.5548990964889526, 0.4126233458518982, -0.0865047350525856, 0.31186550855636597, -0.21006494760513306, 0.6979730725288391, 0.23858267068862915, 0.34825652837753296, -0.010866772383451462, -0.50896817445755, -0.029853366315364838, -0.1315164417028427, -0.30017387866973877, 0.11544670164585114, -0.016278749331831932, 0.28955405950546265, -0.04690111428499222, -0.007480742409825325, -0.2750292420387268, 0.015073471702635288, -0.046825557947158813, 0.03654862195253372, 0.32453653216362, 0.13574489951133728, 0.2842973470687866, 0.004792115651071072, 0.07590699940919876, 0.05919020622968674, -0.07054696977138519, -0.24511533975601196, -0.26552504301071167, 0.2086174637079239, 0.01184576191008091, -0.21695470809936523, -0.03790343180298805, -0.130031555891037, -0.07664643228054047, -0.32037124037742615, 0.20984914898872375, -0.09886634349822998, -0.14856462180614471, -0.08447547256946564, 0.18645280599594116, 0.01345900073647499, -0.20230889320373535, -0.0849791094660759, -0.13901765644550323, 0.34650442004203796, 0.07376599311828613, 0.25233909487724304, 0.011325608007609844, -0.147742360830307, -0.07692953199148178, -0.07841628044843674, -0.010099031031131744, 0.07773813605308533, 0.4048347771167755, -0.3803054690361023, -0.052406247705221176, 0.37250658869743347, 0.229511559009552, 0.3335464894771576, -0.26399821043014526, -0.119475819170475, 0.07234151661396027, 0.23224575817584991, -0.17485061287879944, -0.07428638637065887, -0.17059795558452606, 0.04752656817436218, -0.14892111718654633, 0.09587928652763367, -0.20288480818271637, -0.28033608198165894, -0.29270392656326294, -0.033113859593868256, 0.36475688219070435, 0.03551321476697922, 0.5340806841850281, 0.3414115607738495, -0.16941304504871368, 0.13518352806568146, 0.0058016423135995865, -0.13880528509616852, 0.2735063135623932, 0.25536325573921204, 0.060078784823417664, 0.21077685058116913, 0.24422872066497803, 0.4803510010242462, -0.4113747179508209, -0.5874178409576416, 0.12076213955879211, 0.2657002806663513, -0.09210383892059326, 0.37994855642318726, 0.1737385243177414, 0.26895084977149963, -0.37467288970947266, 0.05312949791550636, -0.35658231377601624, 0.15932922065258026, 0.036686234176158905, -0.021726641803979874, 0.21219457685947418, -0.19864530861377716, -0.049022965133190155, -0.016013631597161293, -0.013867244124412537, -0.085261270403862, -0.21701714396476746, 0.05163255333900452, -0.16640783846378326, -0.1581415981054306, -0.20404484868049622, 0.12446999549865723, 0.2201445996761322, -0.4705685079097748, 0.2944375276565552, 0.40265095233917236, -0.17014040052890778, -0.088304802775383, 0.3750334084033966, 0.5729662775993347, 0.5070335865020752, 0.028217844665050507, 0.07492834329605103, 0.132710263133049, -0.0337618924677372, -0.06686592847108841, 0.2761419415473938, 0.09671584516763687, 0.01637977920472622, 0.40603214502334595, 0.15390844643115997, -0.17686016857624054, -0.14120784401893616, 0.28715598583221436, 0.14936496317386627, -0.3433714210987091, 0.021440662443637848, -0.0026764720678329468, -0.08336752653121948, -0.19894737005233765, 0.06536005437374115, -0.352037638425827, 0.11742693930864334, 0.106142058968544, -0.053612127900123596, 0.096189484000206, 0.03055179864168167, 0.0917767658829689, -0.045187268406152725, 0.3622710704803467, 0.2896977365016937, 0.09503957629203796, -0.26134365797042847, -0.5776647925376892, -0.5151478052139282, 0.401710569858551, -0.13136382400989532, -0.36773309111595154, 0.020953789353370667, 0.2548776865005493, -0.025243915617465973, 0.18574200570583344, 0.09321810305118561, 0.1646304875612259, 0.13978688418865204, 0.037445634603500366, -0.4324447512626648, -0.5413463711738586, -0.02275211364030838, 0.18125146627426147, -0.06818057596683502, -0.5608496069908142, -0.0752052366733551, -0.14455938339233398, -0.025624224916100502, -0.08340291678905487, -0.010169830173254013, 0.06433485448360443, -0.25087788701057434, 0.5731596946716309, 0.19470742344856262, 0.32166287302970886, -0.24876394867897034, 0.003687746822834015, -0.17305316030979156, -0.3250439763069153, -0.04884729161858559, 0.22718337178230286, 0.21046580374240875, 0.36659714579582214, -0.15454760193824768, -0.11769624054431915, -0.3677040934562683, 0.3246561586856842, 0.15416379272937775, -0.18985982239246368, -0.25318896770477295, 0.022564714774489403, 0.05934067815542221, -0.25818148255348206, 0.2213525027036667, 0.05246872454881668, -0.16913390159606934, 0.0093495212495327, 0.1431339532136917, -0.31346285343170166, 0.2942294776439667, -0.24888373911380768, -0.32024335861206055, 0.16811172664165497, 0.27274608612060547, 0.06729279458522797, -0.11466749757528305, -0.3479160666465759, 0.2682458162307739, 0.5611081123352051, 0.12375154346227646, -0.2844814360141754, 0.30991101264953613, -0.24266788363456726, 0.1090402901172638, 0.05418675020337105, 0.4131999611854553, 0.029400920495390892, -0.36325037479400635, 0.10098814964294434, -0.321227490901947 ]
https://github.com/huggingface/datasets/issues/3058
Dataset wikipedia and Bookcorpusopen cannot be fetched from dataloader.
Hi ! I think this issue is more related to the `transformers` project. Could you open an issue on https://github.com/huggingface/transformers ? Anyway I think the issue could be that both wikipedia and bookcorpusopen have an additional "title" column, contrary to wikitext which only has a "text" column. After calling `load_dataset`, can you try doing `dataset = dataset.remove_columns("title")` ?
## Describe the bug I have used the previous version of `transformers` and `datasets`. The dataset `wikipedia` can be successfully used. Recently, I upgrade them to the newest version and find it raises errors. I also tried other datasets. The `wikitext` works and the `bookcorpusopen` raises the same errors as `wikipedia`. ## Steps to reproduce the bug Run the `run_mlm_no_trainer.py` and the given script on this [link](https://github.com/huggingface/transformers/tree/master/examples/pytorch/language-modeling). Change the dataset from wikitext to wikipedia or bookcorpusopen. BTW, the library transformers is of version 4.11.3. ## Expected results The data batchs are fetched from the data loader and train. ## Actual results The first time to fetch data batch occurs error. `Traceback (most recent call last): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 705, in convert_to_tensors tensor = as_tensor(value) ValueError: too many dimensions 'str' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "src/original_run_mlm_no_trainer.py", line 528, in <module> main() File "src/original_run_mlm_no_trainer.py", line 488, in main for step, batch in enumerate(train_dataloader): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/accelerate/data_loader.py", line 303, in __iter__ for batch in super().__iter__(): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in __next__ data = self._next_data() File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 41, in __call__ return self.torch_call(features) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 671, in torch_call batch = self.tokenizer.pad(examples, return_tensors="pt", pad_to_multiple_of=self.pad_to_multiple_of) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2774, in pad return BatchEncoding(batch_outputs, tensor_type=return_tensors) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 210, in __init__ self.convert_to_tensors(tensor_type=tensor_type, prepend_batch_axis=prepend_batch_axis) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 722, in convert_to_tensors "Unable to create tensor, you should probably activate truncation and/or padding " ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. ` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.8.0-59-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.6 - PyArrow version: 5.0.0
58
Dataset wikipedia and Bookcorpusopen cannot be fetched from dataloader. ## Describe the bug I have used the previous version of `transformers` and `datasets`. The dataset `wikipedia` can be successfully used. Recently, I upgrade them to the newest version and find it raises errors. I also tried other datasets. The `wikitext` works and the `bookcorpusopen` raises the same errors as `wikipedia`. ## Steps to reproduce the bug Run the `run_mlm_no_trainer.py` and the given script on this [link](https://github.com/huggingface/transformers/tree/master/examples/pytorch/language-modeling). Change the dataset from wikitext to wikipedia or bookcorpusopen. BTW, the library transformers is of version 4.11.3. ## Expected results The data batchs are fetched from the data loader and train. ## Actual results The first time to fetch data batch occurs error. `Traceback (most recent call last): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 705, in convert_to_tensors tensor = as_tensor(value) ValueError: too many dimensions 'str' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "src/original_run_mlm_no_trainer.py", line 528, in <module> main() File "src/original_run_mlm_no_trainer.py", line 488, in main for step, batch in enumerate(train_dataloader): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/accelerate/data_loader.py", line 303, in __iter__ for batch in super().__iter__(): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in __next__ data = self._next_data() File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 41, in __call__ return self.torch_call(features) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 671, in torch_call batch = self.tokenizer.pad(examples, return_tensors="pt", pad_to_multiple_of=self.pad_to_multiple_of) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2774, in pad return BatchEncoding(batch_outputs, tensor_type=return_tensors) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 210, in __init__ self.convert_to_tensors(tensor_type=tensor_type, prepend_batch_axis=prepend_batch_axis) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 722, in convert_to_tensors "Unable to create tensor, you should probably activate truncation and/or padding " ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. ` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.8.0-59-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.6 - PyArrow version: 5.0.0 Hi ! I think this issue is more related to the `transformers` project. Could you open an issue on https://github.com/huggingface/transformers ? Anyway I think the issue could be that both wikipedia and bookcorpusopen have an additional "title" column, contrary to wikitext which only has a "text" column. After calling `load_dataset`, can you try doing `dataset = dataset.remove_columns("title")` ?
[ -0.117170050740242, -0.08886604011058807, 0.028719954192638397, 0.590285062789917, 0.19815735518932343, 0.008372411131858826, 0.4193763732910156, 0.24482928216457367, 0.008030779659748077, 0.04939493536949158, -0.26142823696136475, 0.009956486523151398, 0.0961204543709755, -0.14036844670772552, -0.1862075924873352, -0.5285601615905762, 0.08758427202701569, 0.11133251339197159, -0.4384569823741913, -0.05910781770944595, -0.2347157597541809, 0.25101032853126526, -0.24731643497943878, 0.14197111129760742, -0.48077523708343506, -0.1802390217781067, -0.038658883422613144, -0.027619630098342896, -0.010024452582001686, -0.2176780253648758, 0.4571986198425293, -0.04934266582131386, 0.41656991839408875, 0.6459468007087708, -0.00012814594083465636, 0.14556823670864105, 0.3086572289466858, -0.08060991019010544, -0.40644463896751404, -0.3418372869491577, 0.0844816192984581, -0.3148393929004669, 0.317781537771225, -0.29163995385169983, -0.10064307600259781, -0.18091298639774323, -0.12349972128868103, -0.14348331093788147, 0.4752548336982727, 0.4050859808921814, 0.08761317282915115, 0.4899052083492279, 0.2896858751773834, -0.09108307212591171, 0.4336787462234497, 0.24412648379802704, -0.16861043870449066, 0.12063956260681152, 0.2548331022262573, -0.03176746144890785, -0.08946634083986282, 0.24075421690940857, -0.056288398802280426, 0.20462441444396973, 0.21937471628189087, 0.19034774601459503, 0.14545539021492004, -0.4963712990283966, 0.06231360882520676, 0.28248491883277893, 0.6721059083938599, -0.28571751713752747, -0.5109415054321289, -0.24080440402030945, -0.11291607469320297, 0.07829076796770096, 0.36630669236183167, 0.10603155195713043, -0.09712758660316467, -0.09475436806678772, -0.19544139504432678, -0.2011725902557373, -0.2782561779022217, 0.33339500427246094, -0.22932761907577515, 0.6383184194564819, 0.03425031155347824, 0.2232227921485901, 0.19407284259796143, -0.08549567312002182, 0.27222856879234314, -0.14122973382472992, 0.21334218978881836, 0.3040314018726349, -0.24965603649616241, -0.06344044208526611, -0.11904432624578476, -0.45357170701026917, -0.2244599163532257, -0.19837017357349396, -0.08653948456048965, -0.2103542685508728, -0.0466725155711174, 0.07769273221492767, 0.36838865280151367, 0.3098661005496979, -0.09093191474676132, 0.54515141248703, 0.3785291314125061, 0.3910868465900421, -0.0818721204996109, -0.01542210578918457, 0.01792587712407112, -0.015124471858143806, -0.11803534626960754, 0.10550323128700256, 0.31925129890441895, -0.19810348749160767, 0.030770940706133842, -0.03144790232181549, -0.13829836249351501, -0.22376438975334167, 0.14343461394309998, 0.20130468904972076, -0.2833173871040344, 0.4591159522533417, 0.29343414306640625, 0.24244672060012817, -0.13156571984291077, -0.1539352983236313, -0.016154777258634567, 0.2229110151529312, -0.22530904412269592, 0.12992173433303833, 0.4849185049533844, -0.05836179479956627, 0.20799463987350464, 0.11096439510583878, 0.06122337654232979, -0.218041330575943, -0.005037740804255009, -0.4270085096359253, -0.09264654666185379, 0.20913821458816528, -0.07648374140262604, 0.41247066855430603, 0.06676173210144043, 0.005501769483089447, -0.1326863318681717, 0.17765283584594727, -0.5252429842948914, -0.08662288635969162, -0.12895658612251282, 0.06890491396188736, -0.1025051698088646, 0.1387520134449005, -0.2886658310890198, 0.16245995461940765, 0.4378766119480133, -0.2315801978111267, 0.08234228193759918, -0.341763973236084, -0.009868394583463669, -0.05835698917508125, 0.15426717698574066, 0.28354543447494507, -0.22582533955574036, -0.267537921667099, -0.05620505288243294, -0.023382145911455154, 0.20376771688461304, 0.38952064514160156, -0.4370260536670685, 0.26061680912971497, -0.10956550389528275, 0.025937728583812714, 0.3239629864692688, -0.34850582480430603, -0.5067796111106873, 0.08224153518676758, 0.13928274810314178, 0.19308754801750183, -0.002498060464859009, 0.07810606807470322, 0.24802576005458832, -0.056722357869148254, -0.08102315664291382, 0.42356473207473755, 0.1310385912656784, 0.15024524927139282, -0.22067736089229584, -0.34047868847846985, 0.43181174993515015, 0.3021398186683655, 0.5274094343185425, 0.05062592402100563, 0.0029893144965171814, 0.5645061731338501, 0.17528036236763, -0.2198447287082672, 0.13187281787395477, 0.37852442264556885, -0.0768742561340332, -0.02149301767349243, 0.2138979732990265, -0.18958085775375366, -0.5815826654434204, 0.26317930221557617, -0.4444321095943451, 0.3270445764064789, -0.06588006019592285, 0.03465551137924194, -0.08468179404735565, 0.0045282673090696335, -0.11664137244224548, -0.12955302000045776, 0.006839849054813385, 0.029696669429540634, 0.07956986129283905, 0.12758727371692657, 0.10581918060779572, -0.009167265146970749, -0.08683862537145615, 0.1810750812292099, -0.4302278459072113, 0.6699711084365845, -0.08632688969373703, -0.10380328446626663, -0.20377062261104584, 0.09315677732229233, 0.2730453908443451, -0.1878032237291336, -0.1515582799911499, 0.09659504145383835, 0.0587596595287323, 0.008226685225963593, -0.23795613646507263, 0.13891687989234924, 0.4958924353122711, -0.3601183593273163, 0.26887190341949463, 0.3903031647205353, 0.16119146347045898, -0.08407606184482574, -0.09879110008478165, 0.08454924821853638, 0.06385690718889236, 0.3242058753967285, 0.1774785816669464, 0.044501595199108124, 0.17565880715847015, -0.055079638957977295, -0.021793048828840256, -0.11927760392427444, 0.08841677010059357, -0.10620523989200592, 0.08009399473667145, -0.05248011648654938, -0.08733288198709488, -0.10377530008554459, 0.4015248119831085, 0.0314117968082428, 0.20271903276443481, 0.23108559846878052, -0.4405786991119385, -0.0669255256652832, -0.003761991858482361, 0.08023542165756226, 0.195376917719841, -0.014213391579687595, 0.002340078353881836, -0.11385590583086014, -0.05447001755237579, -0.026603475213050842, 0.20376622676849365, 0.40416306257247925, 0.2687700092792511, 0.188078373670578, 0.2951115071773529, 0.0657677948474884, -0.10097096860408783, -0.2959224581718445, 0.05784039944410324, 0.3295823931694031, -0.26371580362319946, 0.19067448377609253, -0.11560648679733276, -0.1797398030757904, -0.34971174597740173, -0.27600374817848206, -0.45158398151397705, -0.21501033008098602, -0.21885745227336884, 0.4294584095478058, -0.01503426767885685, 0.15575528144836426, 0.0451587550342083, -0.012126639485359192, 0.04929209500551224, 0.05408457666635513, -0.10292822122573853, 0.0002993564121425152, -0.2656460702419281, -0.06391113996505737, 0.1351945549249649, -0.20790500938892365, -0.09249753504991531, -0.006472709588706493, -0.09696090221405029, -0.4026876389980316, -0.40372100472450256, 0.26331669092178345, 0.049879807978868484, 0.35350072383880615, -0.034105345606803894, 0.29563671350479126, -0.05223032087087631, -0.4987381398677826, 0.2341708391904831, -0.2217985838651657, 0.03419416397809982, 0.20188754796981812, -0.09284436702728271, 0.1023058220744133, -0.0496036596596241, -0.5121685266494751, -0.4480065703392029, -0.30773431062698364, -0.05852612853050232, 0.1117495447397232, 0.1526692807674408, 0.4017452001571655, 0.055800314992666245, 0.07827417552471161, 0.27527081966400146, 0.1532311588525772, -0.07196903973817825, 0.021849017590284348, 0.47019410133361816, -0.08807480335235596, -0.36489325761795044, -0.16209197044372559, -0.1677836924791336, 0.07996737957000732, 0.2666202783584595, -0.5871058106422424, -0.06078798323869705, -0.24962006509304047, 0.0943390429019928, -0.07964710891246796, 0.10999228060245514, 0.1963578462600708, 0.0037184266839176416, 0.1361057311296463, -0.0127289779484272, -0.027274541556835175, 0.07763513922691345, 0.14890432357788086, 0.30797988176345825, 0.013595044612884521, 0.3438875079154968, -0.1361531764268875, 0.9339311718940735, 0.14487387239933014, -0.11485287547111511, 0.2808002829551697, 0.2016264796257019, 0.12136941403150558, 0.013245366513729095, -0.514904797077179, -0.18740704655647278, -0.24774134159088135, 0.06692349910736084, 0.2418576180934906, -0.14827552437782288, -0.3719802498817444, -0.2271697074174881, -0.057167716324329376, -0.2921561598777771, -0.32938170433044434, 0.1470726877450943, 0.026339704170823097, 0.3216877579689026, 0.016343053430318832, 0.2940441966056824, -0.11346232891082764, -0.3156498074531555, -0.05354011803865433, 0.08004995435476303, -0.07115488499403, 0.18630731105804443, -0.2343781739473343, -0.366021990776062, -0.3364725708961487, 0.17303216457366943, 0.13323545455932617, 0.4602348208427429, 0.02429114654660225, 0.04112708568572998, 0.15700501203536987, 0.07821671664714813, 0.5091131925582886, -0.017528140917420387, -0.09274205565452576, 0.12799669802188873, -0.37245991826057434, -0.46163123846054077, -0.2451300323009491, -0.47396546602249146, 0.19551001489162445, 0.38584426045417786, 0.45226719975471497, -0.3439493477344513, -0.04512711241841316, 0.2529810070991516, 0.2160051316022873, -0.18331663310527802, -0.11070846766233444, -0.06483456492424011, -0.06817381083965302, -0.32619360089302063, 0.01511409878730774, 0.037631675601005554, 0.28779757022857666, -0.30374279618263245, 0.0013246871531009674, 0.04694805294275284, -0.03269238770008087, 0.17904025316238403, 0.24794049561023712, 0.26549234986305237, 0.12908130884170532, 0.1594574749469757, 0.08826787024736404, 0.09035889059305191, 0.09519645571708679, 0.526814341545105, -0.05147991701960564, -0.3881164789199829, 0.21694165468215942, -0.022166823968291283, -0.14724478125572205, 0.24740688502788544, -0.06289680302143097, 0.255164235830307, 0.24997633695602417, 0.021073132753372192, -0.007129875011742115, 0.20714862644672394, 0.2191334217786789, -0.08190568536520004, -0.49568256735801697, -0.28134167194366455, 0.454817533493042, 0.10528133809566498, -0.06400582939386368, 0.18782618641853333, -0.04157686233520508, -0.3987191915512085, 0.15771491825580597, 0.08112246543169022, 0.9161218404769897, -0.006155528128147125, 0.12025439739227295, 0.09274355322122574, 0.1487075686454773, 0.6694622039794922, -0.22658966481685638, 0.2461768537759781, -0.33829203248023987, -0.18453183770179749, -0.07707009464502335, -0.22363917529582977, 0.015270587056875229, 0.07663312554359436, -0.3128281533718109, 0.25371670722961426, -0.049924224615097046, 0.22615118324756622, -0.01127205416560173, 0.2821820378303528, 0.1227392703294754, -0.24953573942184448, -0.27704769372940063, 0.007506038993597031, -0.3736129403114319, 0.33489611744880676, -0.03368723392486572, -0.0636257603764534, -0.28171712160110474, -0.34518158435821533, -0.30584946274757385, 0.26418477296829224, -0.26280686259269714, 0.5294762849807739, 0.26822182536125183, -0.26694273948669434, 0.22136926651000977, 0.19514548778533936, 0.22004617750644684, 0.035826414823532104, -0.3625912368297577, -0.020511850714683533, -0.4450191855430603, -0.1483028084039688, -0.010036701336503029, 0.12125636637210846, 0.44874683022499084, -0.016810618340969086, -0.22347360849380493, 0.10491086542606354, -0.17205150425434113, -0.2014801949262619, -0.06355525553226471, -0.03748174011707306, 0.19559426605701447, -0.22947761416435242, 0.014991717413067818, -0.07272689044475555, -0.10872149467468262, -0.23780302703380585, 0.007948850281536579, 0.046901509165763855, -0.04657302796840668, 0.037933096289634705, 0.2302253395318985, -0.12091218680143356, -0.046477001160383224, 0.6002039313316345, 0.3827867805957794, -0.010278899222612381, 0.5690371990203857, 0.6124486327171326, -0.23578710854053497, -0.07056432962417603, -0.10739259421825409, -0.055966489017009735, -0.8141801357269287, 0.14941294491291046, -0.08789568394422531, -0.12959754467010498, -0.21021373569965363, 0.3848186731338501, 0.2228287309408188, -0.10489041358232498, -0.15437057614326477, -0.45916056632995605, -0.4079844057559967, 0.26572516560554504, 0.04680486023426056, 0.18809320032596588, 0.16602525115013123, -0.086397185921669, 0.13516663014888763, 0.16108688712120056, -0.14215122163295746, 0.07175969332456589, -0.2580931782722473, 0.141294464468956, 0.2510511875152588, -0.22478127479553223, -0.05193401500582695, -0.08197271823883057, -0.0975886732339859, -0.0710691437125206, -0.04328577220439911, -0.03168594837188721, -0.2481025755405426, 0.1943458765745163, 0.10464946925640106, -0.3088172972202301, -0.3422869145870209, -0.3058052659034729, 0.03208218887448311, -0.29039502143859863, 0.09931890666484833, 0.04587004333734512, 0.06949058175086975, 0.36331498622894287, 0.05382091924548149, 0.08203218132257462, -0.27129486203193665, 0.3214929401874542, -0.11679552495479584, -0.06696140766143799, 0.3262191712856293, 0.30504584312438965, 0.34948015213012695, 0.08686943352222443, -0.6275850534439087, 0.09093020856380463, 0.11318300664424896, 0.08825436234474182, 0.35516753792762756, -0.3227013349533081, 0.08837328851222992, 0.22343946993350983, 0.05774170905351639, 0.29097914695739746, -0.06535479426383972, -0.0407194159924984, 0.1145474761724472, 0.07424677908420563, -0.3489324450492859, -0.3547522723674774, 0.3190295696258545, 0.06470296531915665, -0.09966935217380524, 0.265221506357193, 0.22276949882507324, -0.07902782410383224, 0.439195454120636, 0.22263705730438232, 0.425760954618454, 0.020071953535079956, 0.4900476038455963, 0.43908196687698364, -0.0182906873524189, 0.10510975122451782, 0.2384386956691742, 0.021595466881990433, 0.13146954774856567, 0.13366597890853882, -0.12453941255807877, 0.23615150153636932, -0.20211657881736755, -0.03747646138072014, 0.37245506048202515, -0.22502656280994415, 0.03083162195980549, -0.052598968148231506, -0.06415817141532898, 0.06540869921445847, -0.13137716054916382, 0.194875568151474, -0.1366695761680603, 0.004834039136767387, -0.5221878290176392, 0.2069922536611557, -0.2634138762950897, -0.06643840670585632, 0.02736102044582367, -0.30710190534591675, -0.08575743436813354, -0.09802840650081635, -0.1292753666639328, -0.16029594838619232, 0.24910485744476318, 0.012292709201574326, -0.37240666151046753, -0.4032564163208008, 0.1413745880126953, 0.3118053078651428, -0.0537676140666008, -0.20712822675704956, 0.2542579174041748, 0.18938857316970825, -0.061255306005477905, -0.17488150298595428, 0.32616958022117615, 0.2719353437423706, 0.3447187542915344, -0.19562683999538422, -0.022739119827747345, 0.15692690014839172, -0.10646212846040726, 0.06891682744026184, 0.3064603805541992, 0.06847091764211655, 0.10614168643951416, 0.26423379778862, -0.005861588753759861, -0.10902811586856842, -0.04451407119631767, -0.0708426833152771, 0.18231239914894104, -0.21984419226646423, 0.31306424736976624, -0.05862301588058472, -0.1530408412218094, 0.049623679369688034, -0.17925089597702026, -0.37959006428718567, 0.14069180190563202, 0.4293883740901947, -0.11680056154727936, 0.03682208061218262, -0.09001465141773224, -0.03236193582415581, -0.06507888436317444, 0.409181147813797, 0.4153808057308197, 0.12100233137607574, -0.2627842426300049, 0.16822855174541473, -0.46954020857810974, 0.14062872529029846, -0.03278477117419243, 0.03241331875324249, 0.1455586701631546, 0.19326460361480713, 0.00885675847530365, 0.10326792299747467, 0.21642157435417175, -0.08425921946763992, -0.03628954291343689, -0.02593304216861725, -0.529451847076416, -0.17994357645511627, -0.10041096806526184, 0.08485609292984009, -0.029159320518374443, -0.18170499801635742, 0.255878746509552, 0.1350068747997284, -0.15197798609733582, -0.35508906841278076, -0.2189483642578125, 0.15495039522647858, -0.13813516497612, 0.4324791431427002, 0.20430585741996765, 0.5696883201599121, 0.08941604197025299, 0.0474715381860733, -0.3112936019897461, -0.35684069991111755, 0.03486863151192665, 0.06354586035013199, -0.018991880118846893, 0.7160930633544922, -0.21205930411815643, -0.11514918506145477, -0.3567178547382355, 0.1224270835518837, 0.050232186913490295, 0.10208543390035629, -0.22920458018779755, 0.18265976011753082, -0.203292578458786, 0.03993736952543259, 0.15015189349651337, 0.019563749432563782, 0.08691121637821198, 0.06364651769399643, -0.3101145029067993, -0.4161631464958191, 0.3198123872280121, -0.534004271030426, -0.38242390751838684, -0.4362963140010834, 0.16088297963142395, 0.05820976942777634, 0.0785641297698021, -0.7182442545890808, -0.03227543830871582, 0.3463795781135559, -0.1712142527103424, -0.298832505941391, -0.031759537756443024, 0.006604309659451246, 0.08858615159988403, -0.1590425819158554, 0.3739162087440491, 0.04687178134918213, -0.2517429292201996, -0.1608273833990097, -0.15722504258155823 ]
https://github.com/huggingface/datasets/issues/3058
Dataset wikipedia and Bookcorpusopen cannot be fetched from dataloader.
Removing the "title" column works! Thanks for your advice. Maybe I should still create an issue to `transformers' to mark this solution?
## Describe the bug I have used the previous version of `transformers` and `datasets`. The dataset `wikipedia` can be successfully used. Recently, I upgrade them to the newest version and find it raises errors. I also tried other datasets. The `wikitext` works and the `bookcorpusopen` raises the same errors as `wikipedia`. ## Steps to reproduce the bug Run the `run_mlm_no_trainer.py` and the given script on this [link](https://github.com/huggingface/transformers/tree/master/examples/pytorch/language-modeling). Change the dataset from wikitext to wikipedia or bookcorpusopen. BTW, the library transformers is of version 4.11.3. ## Expected results The data batchs are fetched from the data loader and train. ## Actual results The first time to fetch data batch occurs error. `Traceback (most recent call last): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 705, in convert_to_tensors tensor = as_tensor(value) ValueError: too many dimensions 'str' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "src/original_run_mlm_no_trainer.py", line 528, in <module> main() File "src/original_run_mlm_no_trainer.py", line 488, in main for step, batch in enumerate(train_dataloader): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/accelerate/data_loader.py", line 303, in __iter__ for batch in super().__iter__(): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in __next__ data = self._next_data() File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 41, in __call__ return self.torch_call(features) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 671, in torch_call batch = self.tokenizer.pad(examples, return_tensors="pt", pad_to_multiple_of=self.pad_to_multiple_of) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2774, in pad return BatchEncoding(batch_outputs, tensor_type=return_tensors) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 210, in __init__ self.convert_to_tensors(tensor_type=tensor_type, prepend_batch_axis=prepend_batch_axis) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 722, in convert_to_tensors "Unable to create tensor, you should probably activate truncation and/or padding " ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. ` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.8.0-59-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.6 - PyArrow version: 5.0.0
22
Dataset wikipedia and Bookcorpusopen cannot be fetched from dataloader. ## Describe the bug I have used the previous version of `transformers` and `datasets`. The dataset `wikipedia` can be successfully used. Recently, I upgrade them to the newest version and find it raises errors. I also tried other datasets. The `wikitext` works and the `bookcorpusopen` raises the same errors as `wikipedia`. ## Steps to reproduce the bug Run the `run_mlm_no_trainer.py` and the given script on this [link](https://github.com/huggingface/transformers/tree/master/examples/pytorch/language-modeling). Change the dataset from wikitext to wikipedia or bookcorpusopen. BTW, the library transformers is of version 4.11.3. ## Expected results The data batchs are fetched from the data loader and train. ## Actual results The first time to fetch data batch occurs error. `Traceback (most recent call last): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 705, in convert_to_tensors tensor = as_tensor(value) ValueError: too many dimensions 'str' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "src/original_run_mlm_no_trainer.py", line 528, in <module> main() File "src/original_run_mlm_no_trainer.py", line 488, in main for step, batch in enumerate(train_dataloader): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/accelerate/data_loader.py", line 303, in __iter__ for batch in super().__iter__(): File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 517, in __next__ data = self._next_data() File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 557, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 47, in fetch return self.collate_fn(data) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 41, in __call__ return self.torch_call(features) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/data/data_collator.py", line 671, in torch_call batch = self.tokenizer.pad(examples, return_tensors="pt", pad_to_multiple_of=self.pad_to_multiple_of) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 2774, in pad return BatchEncoding(batch_outputs, tensor_type=return_tensors) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 210, in __init__ self.convert_to_tensors(tensor_type=tensor_type, prepend_batch_axis=prepend_batch_axis) File "/home/zyli/anaconda3/envs/LatestStacking/lib/python3.7/site-packages/transformers/tokenization_utils_base.py", line 722, in convert_to_tensors "Unable to create tensor, you should probably activate truncation and/or padding " ValueError: Unable to create tensor, you should probably activate truncation and/or padding with 'padding=True' 'truncation=True' to have batched tensors with the same length. ` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.8.0-59-generic-x86_64-with-debian-bullseye-sid - Python version: 3.7.6 - PyArrow version: 5.0.0 Removing the "title" column works! Thanks for your advice. Maybe I should still create an issue to `transformers' to mark this solution?
[ -0.117170050740242, -0.08886604011058807, 0.028719954192638397, 0.590285062789917, 0.19815735518932343, 0.008372411131858826, 0.4193763732910156, 0.24482928216457367, 0.008030779659748077, 0.04939493536949158, -0.26142823696136475, 0.009956486523151398, 0.0961204543709755, -0.14036844670772552, -0.1862075924873352, -0.5285601615905762, 0.08758427202701569, 0.11133251339197159, -0.4384569823741913, -0.05910781770944595, -0.2347157597541809, 0.25101032853126526, -0.24731643497943878, 0.14197111129760742, -0.48077523708343506, -0.1802390217781067, -0.038658883422613144, -0.027619630098342896, -0.010024452582001686, -0.2176780253648758, 0.4571986198425293, -0.04934266582131386, 0.41656991839408875, 0.6459468007087708, -0.00012814594083465636, 0.14556823670864105, 0.3086572289466858, -0.08060991019010544, -0.40644463896751404, -0.3418372869491577, 0.0844816192984581, -0.3148393929004669, 0.317781537771225, -0.29163995385169983, -0.10064307600259781, -0.18091298639774323, -0.12349972128868103, -0.14348331093788147, 0.4752548336982727, 0.4050859808921814, 0.08761317282915115, 0.4899052083492279, 0.2896858751773834, -0.09108307212591171, 0.4336787462234497, 0.24412648379802704, -0.16861043870449066, 0.12063956260681152, 0.2548331022262573, -0.03176746144890785, -0.08946634083986282, 0.24075421690940857, -0.056288398802280426, 0.20462441444396973, 0.21937471628189087, 0.19034774601459503, 0.14545539021492004, -0.4963712990283966, 0.06231360882520676, 0.28248491883277893, 0.6721059083938599, -0.28571751713752747, -0.5109415054321289, -0.24080440402030945, -0.11291607469320297, 0.07829076796770096, 0.36630669236183167, 0.10603155195713043, -0.09712758660316467, -0.09475436806678772, -0.19544139504432678, -0.2011725902557373, -0.2782561779022217, 0.33339500427246094, -0.22932761907577515, 0.6383184194564819, 0.03425031155347824, 0.2232227921485901, 0.19407284259796143, -0.08549567312002182, 0.27222856879234314, -0.14122973382472992, 0.21334218978881836, 0.3040314018726349, -0.24965603649616241, -0.06344044208526611, -0.11904432624578476, -0.45357170701026917, -0.2244599163532257, -0.19837017357349396, -0.08653948456048965, -0.2103542685508728, -0.0466725155711174, 0.07769273221492767, 0.36838865280151367, 0.3098661005496979, -0.09093191474676132, 0.54515141248703, 0.3785291314125061, 0.3910868465900421, -0.0818721204996109, -0.01542210578918457, 0.01792587712407112, -0.015124471858143806, -0.11803534626960754, 0.10550323128700256, 0.31925129890441895, -0.19810348749160767, 0.030770940706133842, -0.03144790232181549, -0.13829836249351501, -0.22376438975334167, 0.14343461394309998, 0.20130468904972076, -0.2833173871040344, 0.4591159522533417, 0.29343414306640625, 0.24244672060012817, -0.13156571984291077, -0.1539352983236313, -0.016154777258634567, 0.2229110151529312, -0.22530904412269592, 0.12992173433303833, 0.4849185049533844, -0.05836179479956627, 0.20799463987350464, 0.11096439510583878, 0.06122337654232979, -0.218041330575943, -0.005037740804255009, -0.4270085096359253, -0.09264654666185379, 0.20913821458816528, -0.07648374140262604, 0.41247066855430603, 0.06676173210144043, 0.005501769483089447, -0.1326863318681717, 0.17765283584594727, -0.5252429842948914, -0.08662288635969162, -0.12895658612251282, 0.06890491396188736, -0.1025051698088646, 0.1387520134449005, -0.2886658310890198, 0.16245995461940765, 0.4378766119480133, -0.2315801978111267, 0.08234228193759918, -0.341763973236084, -0.009868394583463669, -0.05835698917508125, 0.15426717698574066, 0.28354543447494507, -0.22582533955574036, -0.267537921667099, -0.05620505288243294, -0.023382145911455154, 0.20376771688461304, 0.38952064514160156, -0.4370260536670685, 0.26061680912971497, -0.10956550389528275, 0.025937728583812714, 0.3239629864692688, -0.34850582480430603, -0.5067796111106873, 0.08224153518676758, 0.13928274810314178, 0.19308754801750183, -0.002498060464859009, 0.07810606807470322, 0.24802576005458832, -0.056722357869148254, -0.08102315664291382, 0.42356473207473755, 0.1310385912656784, 0.15024524927139282, -0.22067736089229584, -0.34047868847846985, 0.43181174993515015, 0.3021398186683655, 0.5274094343185425, 0.05062592402100563, 0.0029893144965171814, 0.5645061731338501, 0.17528036236763, -0.2198447287082672, 0.13187281787395477, 0.37852442264556885, -0.0768742561340332, -0.02149301767349243, 0.2138979732990265, -0.18958085775375366, -0.5815826654434204, 0.26317930221557617, -0.4444321095943451, 0.3270445764064789, -0.06588006019592285, 0.03465551137924194, -0.08468179404735565, 0.0045282673090696335, -0.11664137244224548, -0.12955302000045776, 0.006839849054813385, 0.029696669429540634, 0.07956986129283905, 0.12758727371692657, 0.10581918060779572, -0.009167265146970749, -0.08683862537145615, 0.1810750812292099, -0.4302278459072113, 0.6699711084365845, -0.08632688969373703, -0.10380328446626663, -0.20377062261104584, 0.09315677732229233, 0.2730453908443451, -0.1878032237291336, -0.1515582799911499, 0.09659504145383835, 0.0587596595287323, 0.008226685225963593, -0.23795613646507263, 0.13891687989234924, 0.4958924353122711, -0.3601183593273163, 0.26887190341949463, 0.3903031647205353, 0.16119146347045898, -0.08407606184482574, -0.09879110008478165, 0.08454924821853638, 0.06385690718889236, 0.3242058753967285, 0.1774785816669464, 0.044501595199108124, 0.17565880715847015, -0.055079638957977295, -0.021793048828840256, -0.11927760392427444, 0.08841677010059357, -0.10620523989200592, 0.08009399473667145, -0.05248011648654938, -0.08733288198709488, -0.10377530008554459, 0.4015248119831085, 0.0314117968082428, 0.20271903276443481, 0.23108559846878052, -0.4405786991119385, -0.0669255256652832, -0.003761991858482361, 0.08023542165756226, 0.195376917719841, -0.014213391579687595, 0.002340078353881836, -0.11385590583086014, -0.05447001755237579, -0.026603475213050842, 0.20376622676849365, 0.40416306257247925, 0.2687700092792511, 0.188078373670578, 0.2951115071773529, 0.0657677948474884, -0.10097096860408783, -0.2959224581718445, 0.05784039944410324, 0.3295823931694031, -0.26371580362319946, 0.19067448377609253, -0.11560648679733276, -0.1797398030757904, -0.34971174597740173, -0.27600374817848206, -0.45158398151397705, -0.21501033008098602, -0.21885745227336884, 0.4294584095478058, -0.01503426767885685, 0.15575528144836426, 0.0451587550342083, -0.012126639485359192, 0.04929209500551224, 0.05408457666635513, -0.10292822122573853, 0.0002993564121425152, -0.2656460702419281, -0.06391113996505737, 0.1351945549249649, -0.20790500938892365, -0.09249753504991531, -0.006472709588706493, -0.09696090221405029, -0.4026876389980316, -0.40372100472450256, 0.26331669092178345, 0.049879807978868484, 0.35350072383880615, -0.034105345606803894, 0.29563671350479126, -0.05223032087087631, -0.4987381398677826, 0.2341708391904831, -0.2217985838651657, 0.03419416397809982, 0.20188754796981812, -0.09284436702728271, 0.1023058220744133, -0.0496036596596241, -0.5121685266494751, -0.4480065703392029, -0.30773431062698364, -0.05852612853050232, 0.1117495447397232, 0.1526692807674408, 0.4017452001571655, 0.055800314992666245, 0.07827417552471161, 0.27527081966400146, 0.1532311588525772, -0.07196903973817825, 0.021849017590284348, 0.47019410133361816, -0.08807480335235596, -0.36489325761795044, -0.16209197044372559, -0.1677836924791336, 0.07996737957000732, 0.2666202783584595, -0.5871058106422424, -0.06078798323869705, -0.24962006509304047, 0.0943390429019928, -0.07964710891246796, 0.10999228060245514, 0.1963578462600708, 0.0037184266839176416, 0.1361057311296463, -0.0127289779484272, -0.027274541556835175, 0.07763513922691345, 0.14890432357788086, 0.30797988176345825, 0.013595044612884521, 0.3438875079154968, -0.1361531764268875, 0.9339311718940735, 0.14487387239933014, -0.11485287547111511, 0.2808002829551697, 0.2016264796257019, 0.12136941403150558, 0.013245366513729095, -0.514904797077179, -0.18740704655647278, -0.24774134159088135, 0.06692349910736084, 0.2418576180934906, -0.14827552437782288, -0.3719802498817444, -0.2271697074174881, -0.057167716324329376, -0.2921561598777771, -0.32938170433044434, 0.1470726877450943, 0.026339704170823097, 0.3216877579689026, 0.016343053430318832, 0.2940441966056824, -0.11346232891082764, -0.3156498074531555, -0.05354011803865433, 0.08004995435476303, -0.07115488499403, 0.18630731105804443, -0.2343781739473343, -0.366021990776062, -0.3364725708961487, 0.17303216457366943, 0.13323545455932617, 0.4602348208427429, 0.02429114654660225, 0.04112708568572998, 0.15700501203536987, 0.07821671664714813, 0.5091131925582886, -0.017528140917420387, -0.09274205565452576, 0.12799669802188873, -0.37245991826057434, -0.46163123846054077, -0.2451300323009491, -0.47396546602249146, 0.19551001489162445, 0.38584426045417786, 0.45226719975471497, -0.3439493477344513, -0.04512711241841316, 0.2529810070991516, 0.2160051316022873, -0.18331663310527802, -0.11070846766233444, -0.06483456492424011, -0.06817381083965302, -0.32619360089302063, 0.01511409878730774, 0.037631675601005554, 0.28779757022857666, -0.30374279618263245, 0.0013246871531009674, 0.04694805294275284, -0.03269238770008087, 0.17904025316238403, 0.24794049561023712, 0.26549234986305237, 0.12908130884170532, 0.1594574749469757, 0.08826787024736404, 0.09035889059305191, 0.09519645571708679, 0.526814341545105, -0.05147991701960564, -0.3881164789199829, 0.21694165468215942, -0.022166823968291283, -0.14724478125572205, 0.24740688502788544, -0.06289680302143097, 0.255164235830307, 0.24997633695602417, 0.021073132753372192, -0.007129875011742115, 0.20714862644672394, 0.2191334217786789, -0.08190568536520004, -0.49568256735801697, -0.28134167194366455, 0.454817533493042, 0.10528133809566498, -0.06400582939386368, 0.18782618641853333, -0.04157686233520508, -0.3987191915512085, 0.15771491825580597, 0.08112246543169022, 0.9161218404769897, -0.006155528128147125, 0.12025439739227295, 0.09274355322122574, 0.1487075686454773, 0.6694622039794922, -0.22658966481685638, 0.2461768537759781, -0.33829203248023987, -0.18453183770179749, -0.07707009464502335, -0.22363917529582977, 0.015270587056875229, 0.07663312554359436, -0.3128281533718109, 0.25371670722961426, -0.049924224615097046, 0.22615118324756622, -0.01127205416560173, 0.2821820378303528, 0.1227392703294754, -0.24953573942184448, -0.27704769372940063, 0.007506038993597031, -0.3736129403114319, 0.33489611744880676, -0.03368723392486572, -0.0636257603764534, -0.28171712160110474, -0.34518158435821533, -0.30584946274757385, 0.26418477296829224, -0.26280686259269714, 0.5294762849807739, 0.26822182536125183, -0.26694273948669434, 0.22136926651000977, 0.19514548778533936, 0.22004617750644684, 0.035826414823532104, -0.3625912368297577, -0.020511850714683533, -0.4450191855430603, -0.1483028084039688, -0.010036701336503029, 0.12125636637210846, 0.44874683022499084, -0.016810618340969086, -0.22347360849380493, 0.10491086542606354, -0.17205150425434113, -0.2014801949262619, -0.06355525553226471, -0.03748174011707306, 0.19559426605701447, -0.22947761416435242, 0.014991717413067818, -0.07272689044475555, -0.10872149467468262, -0.23780302703380585, 0.007948850281536579, 0.046901509165763855, -0.04657302796840668, 0.037933096289634705, 0.2302253395318985, -0.12091218680143356, -0.046477001160383224, 0.6002039313316345, 0.3827867805957794, -0.010278899222612381, 0.5690371990203857, 0.6124486327171326, -0.23578710854053497, -0.07056432962417603, -0.10739259421825409, -0.055966489017009735, -0.8141801357269287, 0.14941294491291046, -0.08789568394422531, -0.12959754467010498, -0.21021373569965363, 0.3848186731338501, 0.2228287309408188, -0.10489041358232498, -0.15437057614326477, -0.45916056632995605, -0.4079844057559967, 0.26572516560554504, 0.04680486023426056, 0.18809320032596588, 0.16602525115013123, -0.086397185921669, 0.13516663014888763, 0.16108688712120056, -0.14215122163295746, 0.07175969332456589, -0.2580931782722473, 0.141294464468956, 0.2510511875152588, -0.22478127479553223, -0.05193401500582695, -0.08197271823883057, -0.0975886732339859, -0.0710691437125206, -0.04328577220439911, -0.03168594837188721, -0.2481025755405426, 0.1943458765745163, 0.10464946925640106, -0.3088172972202301, -0.3422869145870209, -0.3058052659034729, 0.03208218887448311, -0.29039502143859863, 0.09931890666484833, 0.04587004333734512, 0.06949058175086975, 0.36331498622894287, 0.05382091924548149, 0.08203218132257462, -0.27129486203193665, 0.3214929401874542, -0.11679552495479584, -0.06696140766143799, 0.3262191712856293, 0.30504584312438965, 0.34948015213012695, 0.08686943352222443, -0.6275850534439087, 0.09093020856380463, 0.11318300664424896, 0.08825436234474182, 0.35516753792762756, -0.3227013349533081, 0.08837328851222992, 0.22343946993350983, 0.05774170905351639, 0.29097914695739746, -0.06535479426383972, -0.0407194159924984, 0.1145474761724472, 0.07424677908420563, -0.3489324450492859, -0.3547522723674774, 0.3190295696258545, 0.06470296531915665, -0.09966935217380524, 0.265221506357193, 0.22276949882507324, -0.07902782410383224, 0.439195454120636, 0.22263705730438232, 0.425760954618454, 0.020071953535079956, 0.4900476038455963, 0.43908196687698364, -0.0182906873524189, 0.10510975122451782, 0.2384386956691742, 0.021595466881990433, 0.13146954774856567, 0.13366597890853882, -0.12453941255807877, 0.23615150153636932, -0.20211657881736755, -0.03747646138072014, 0.37245506048202515, -0.22502656280994415, 0.03083162195980549, -0.052598968148231506, -0.06415817141532898, 0.06540869921445847, -0.13137716054916382, 0.194875568151474, -0.1366695761680603, 0.004834039136767387, -0.5221878290176392, 0.2069922536611557, -0.2634138762950897, -0.06643840670585632, 0.02736102044582367, -0.30710190534591675, -0.08575743436813354, -0.09802840650081635, -0.1292753666639328, -0.16029594838619232, 0.24910485744476318, 0.012292709201574326, -0.37240666151046753, -0.4032564163208008, 0.1413745880126953, 0.3118053078651428, -0.0537676140666008, -0.20712822675704956, 0.2542579174041748, 0.18938857316970825, -0.061255306005477905, -0.17488150298595428, 0.32616958022117615, 0.2719353437423706, 0.3447187542915344, -0.19562683999538422, -0.022739119827747345, 0.15692690014839172, -0.10646212846040726, 0.06891682744026184, 0.3064603805541992, 0.06847091764211655, 0.10614168643951416, 0.26423379778862, -0.005861588753759861, -0.10902811586856842, -0.04451407119631767, -0.0708426833152771, 0.18231239914894104, -0.21984419226646423, 0.31306424736976624, -0.05862301588058472, -0.1530408412218094, 0.049623679369688034, -0.17925089597702026, -0.37959006428718567, 0.14069180190563202, 0.4293883740901947, -0.11680056154727936, 0.03682208061218262, -0.09001465141773224, -0.03236193582415581, -0.06507888436317444, 0.409181147813797, 0.4153808057308197, 0.12100233137607574, -0.2627842426300049, 0.16822855174541473, -0.46954020857810974, 0.14062872529029846, -0.03278477117419243, 0.03241331875324249, 0.1455586701631546, 0.19326460361480713, 0.00885675847530365, 0.10326792299747467, 0.21642157435417175, -0.08425921946763992, -0.03628954291343689, -0.02593304216861725, -0.529451847076416, -0.17994357645511627, -0.10041096806526184, 0.08485609292984009, -0.029159320518374443, -0.18170499801635742, 0.255878746509552, 0.1350068747997284, -0.15197798609733582, -0.35508906841278076, -0.2189483642578125, 0.15495039522647858, -0.13813516497612, 0.4324791431427002, 0.20430585741996765, 0.5696883201599121, 0.08941604197025299, 0.0474715381860733, -0.3112936019897461, -0.35684069991111755, 0.03486863151192665, 0.06354586035013199, -0.018991880118846893, 0.7160930633544922, -0.21205930411815643, -0.11514918506145477, -0.3567178547382355, 0.1224270835518837, 0.050232186913490295, 0.10208543390035629, -0.22920458018779755, 0.18265976011753082, -0.203292578458786, 0.03993736952543259, 0.15015189349651337, 0.019563749432563782, 0.08691121637821198, 0.06364651769399643, -0.3101145029067993, -0.4161631464958191, 0.3198123872280121, -0.534004271030426, -0.38242390751838684, -0.4362963140010834, 0.16088297963142395, 0.05820976942777634, 0.0785641297698021, -0.7182442545890808, -0.03227543830871582, 0.3463795781135559, -0.1712142527103424, -0.298832505941391, -0.031759537756443024, 0.006604309659451246, 0.08858615159988403, -0.1590425819158554, 0.3739162087440491, 0.04687178134918213, -0.2517429292201996, -0.1608273833990097, -0.15722504258155823 ]
https://github.com/huggingface/datasets/issues/3057
Error in per class precision computation
Hi @tidhamecha2, thanks for reporting. Indeed, we fixed this issue just one week ago: #3008 The fix will be included in our next version release. In the meantime, you can incorporate the fix by installing `datasets` from the master branch: ``` pip install -U git+ssh://git@github.com/huggingface/datasets.git@master#egg=datasest ``` or ``` pip install -U git+https://github.com/huggingface/datasets.git@master#egg=datasets ```
## Describe the bug When trying to get the per class precision values by providing `average=None`, following error is thrown `ValueError: can only convert an array of size 1 to a Python scalar` ## Steps to reproduce the bug ```python from datasets import load_dataset, load_metric precision_metric = load_metric("precision") predictions = [0, 2, 1, 0, 0, 1] references = [0, 1, 2, 0, 1, 2] results = precision_metric.compute(predictions=predictions, references=references, average=None) ``` ## Expected results ` {'precision': array([0.66666667, 0. , 0. ])}` as per https://github.com/huggingface/datasets/blob/master/metrics/precision/precision.py ## Actual results ``` output = self._compute(predictions=predictions, references=references, **kwargs) File "~/.cache/huggingface/modules/datasets_modules/metrics/precision/94709a71c6fe37171ef49d3466fec24dee9a79846c9f176dff66a649e9811690/precision.py", line 110, in _compute sample_weight=sample_weight, ValueError: can only convert an array of size 1 to a Python scalar ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: linux - Python version: 3.6.9 - PyArrow version: 5.0.0
53
Error in per class precision computation ## Describe the bug When trying to get the per class precision values by providing `average=None`, following error is thrown `ValueError: can only convert an array of size 1 to a Python scalar` ## Steps to reproduce the bug ```python from datasets import load_dataset, load_metric precision_metric = load_metric("precision") predictions = [0, 2, 1, 0, 0, 1] references = [0, 1, 2, 0, 1, 2] results = precision_metric.compute(predictions=predictions, references=references, average=None) ``` ## Expected results ` {'precision': array([0.66666667, 0. , 0. ])}` as per https://github.com/huggingface/datasets/blob/master/metrics/precision/precision.py ## Actual results ``` output = self._compute(predictions=predictions, references=references, **kwargs) File "~/.cache/huggingface/modules/datasets_modules/metrics/precision/94709a71c6fe37171ef49d3466fec24dee9a79846c9f176dff66a649e9811690/precision.py", line 110, in _compute sample_weight=sample_weight, ValueError: can only convert an array of size 1 to a Python scalar ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: linux - Python version: 3.6.9 - PyArrow version: 5.0.0 Hi @tidhamecha2, thanks for reporting. Indeed, we fixed this issue just one week ago: #3008 The fix will be included in our next version release. In the meantime, you can incorporate the fix by installing `datasets` from the master branch: ``` pip install -U git+ssh://git@github.com/huggingface/datasets.git@master#egg=datasest ``` or ``` pip install -U git+https://github.com/huggingface/datasets.git@master#egg=datasets ```
[ -0.1642782986164093, -0.4141963720321655, -0.0621303915977478, 0.35821354389190674, 0.5411623120307922, 0.122135691344738, 0.08095245808362961, 0.1405230015516281, -0.049366749823093414, 0.6348307132720947, -0.0748264268040657, 0.1664379984140396, -0.01713414490222931, 0.15428997576236725, -0.16720880568027496, -0.18891096115112305, -0.07662171870470047, 0.2445579171180725, -0.23140639066696167, -0.08112193644046783, -0.2428576946258545, 0.1677614450454712, -0.2075735181570053, -0.11349518597126007, -0.03423682972788811, -0.04334604740142822, 0.032015360891819, -0.07014676183462143, -0.18112044036388397, -0.24523480236530304, 0.5854546427726746, -0.11991484463214874, -0.024681786075234413, 0.5421233773231506, -0.00010925201786449179, 0.034429535269737244, 0.19958382844924927, -0.06796114146709442, 0.0439428985118866, -0.012562975287437439, 0.17322418093681335, -0.3171205222606659, 0.04961696267127991, -0.3605559170246124, -0.09573519974946976, 0.10445797443389893, -0.14659790694713593, -0.43343937397003174, 0.13321684300899506, 0.14676515758037567, 0.231260746717453, 0.3048010766506195, 0.11358153820037842, -0.18440742790699005, -0.1475374400615692, -0.03826529532670975, -0.05818984657526016, 0.29832494258880615, -0.19155308604240417, 0.25312307476997375, -0.11292845755815506, 0.23726654052734375, -0.011765709146857262, 0.07285675406455994, 0.3472215533256531, 0.08260975778102875, 0.11609041690826416, -0.2710081934928894, -0.07673352211713791, -0.04711384326219559, 0.06371979415416718, -0.27551305294036865, -0.49510642886161804, -0.24246647953987122, 0.10730041563510895, -0.47864413261413574, -0.10842140763998032, 0.2575415372848511, -0.206534743309021, -0.08872541785240173, -0.4264824390411377, 0.16424518823623657, -0.4307793378829956, -0.018330611288547516, 0.01059076189994812, 0.0735078901052475, -0.19678285717964172, 0.13282695412635803, 0.16599133610725403, -0.09232357144355774, -0.3665848672389984, 0.11368514597415924, 0.3257922828197479, 0.25536465644836426, -0.49226605892181396, -0.12025706470012665, -0.006911121308803558, -0.09412480145692825, 0.10796598345041275, -0.11883233487606049, 0.2723201811313629, 0.25195804238319397, 0.1970917135477066, 0.11183963716030121, -0.048619259148836136, 0.5292057394981384, 0.1057308092713356, 0.15728825330734253, 0.23285993933677673, 0.36336639523506165, 0.07905305922031403, 0.1107822060585022, 0.35025477409362793, -0.14789529144763947, 0.018096834421157837, 0.0503951832652092, 0.0839344784617424, -0.14853739738464355, -0.24988260865211487, 0.1619853526353836, -0.11464300006628036, 0.1252569556236267, 0.007404896896332502, 0.1748039424419403, 0.14074842631816864, 0.3416099548339844, 0.22246123850345612, 0.1269018054008484, -0.1341768354177475, -0.3123120367527008, -0.26852327585220337, 0.08236238360404968, -0.1030990406870842, 0.1653858870267868, 0.15712399780750275, -0.09208427369594574, 0.10910128057003021, 0.21444107592105865, 0.29668834805488586, -0.30678820610046387, -0.11064516007900238, -0.05276872590184212, -0.15962105989456177, 0.22753190994262695, -0.16537557542324066, 0.024551453068852425, 0.28181934356689453, -0.11933529376983643, 0.050563178956508636, 0.11327126622200012, -0.22012290358543396, -0.10108891874551773, 0.20457351207733154, 0.22352424263954163, -0.11379759758710861, 0.019223330542445183, -0.335135281085968, 0.3108476996421814, 0.27833107113838196, 0.06775040924549103, -0.12206130474805832, -0.20677712559700012, -0.440134733915329, -0.3280394673347473, 0.3332187533378601, -0.0279465913772583, -0.16498808562755585, -0.1342422366142273, 0.21509350836277008, -0.19167132675647736, 0.1266341656446457, 0.25869300961494446, 0.07842852920293808, 0.14565704762935638, -0.1856609731912613, 0.21897436678409576, 0.06523452699184418, -0.3232421576976776, -0.3575800955295563, -0.0842360332608223, 0.05352664738893509, -0.16283129155635834, 0.13987508416175842, 0.03548697382211685, 0.2864261567592621, 0.10632683336734772, -0.017931833863258362, -0.020265277475118637, 0.051632143557071686, 0.0028289202600717545, -0.46002158522605896, -0.18869857490062714, 0.15658140182495117, 0.19088691473007202, 0.15410305559635162, 0.17378567159175873, -0.016741134226322174, -0.133986234664917, 0.17129284143447876, -0.43826305866241455, 0.014152455143630505, 0.348050057888031, 0.17509989440441132, -0.3897573947906494, 0.1666068732738495, -0.44056037068367004, -0.2117423713207245, 0.3000277876853943, -0.10764683783054352, 0.1818445324897766, 0.10391134768724442, -0.04758948087692261, -0.3701079189777374, -0.12579064071178436, -0.08625741302967072, 0.0743679404258728, 0.2409290373325348, -0.2931126058101654, 0.3394930362701416, -0.04900595545768738, -0.025872351601719856, 0.07419475167989731, -0.34828272461891174, 0.172386035323143, -0.33061471581459045, 0.0988355502486229, 0.0002801027148962021, -0.3719061315059662, 0.002147480845451355, 0.15523183345794678, 0.22128456830978394, -0.04849353805184364, -0.21070483326911926, 0.3628709018230438, 0.09596804529428482, 0.00794781744480133, 0.06617234647274017, 0.22287993133068085, 0.044576335698366165, -0.1284397840499878, 0.0397050566971302, 0.11129599809646606, 0.2196476012468338, -0.04093075543642044, -0.16811144351959229, 0.8096147775650024, 0.16436493396759033, 0.08142130076885223, -0.004315149039030075, 0.10866374522447586, 0.1563538908958435, 0.07179473340511322, 0.007327277213335037, -0.14581651985645294, 0.23948544263839722, -0.32443350553512573, 0.3670499920845032, -0.17672795057296753, -0.2085167020559311, -0.10593799501657486, 0.10069285333156586, -0.140900120139122, 0.048981256783008575, 0.09573139250278473, 0.10830610245466232, 0.11833136528730392, -0.13652348518371582, 0.02325446531176567, 0.48594629764556885, 0.0970367044210434, -0.12792626023292542, 0.2964474856853485, -0.04096008092164993, 0.027960918843746185, 0.06294985115528107, 0.09254218637943268, 0.1806248426437378, 0.13030487298965454, 0.0704173594713211, -0.026560313999652863, -0.4172145128250122, 0.104643315076828, -0.255073606967926, 0.17772763967514038, -0.35769784450531006, 0.03326155245304108, -0.050534769892692566, 0.3547065258026123, -0.2645374536514282, -0.09804877638816833, -0.3411877453327179, -0.3228209912776947, -0.11201490461826324, 0.020006787031888962, -0.06975065171718597, -0.007926102727651596, 0.005272962152957916, 0.33153876662254333, 0.14631012082099915, 0.23277562856674194, -0.2720114588737488, 0.17372822761535645, -0.16495278477668762, -0.007055515423417091, 0.03660662844777107, -0.14101529121398926, 0.21869120001792908, 0.028768913820385933, 0.08958461880683899, -0.0630357414484024, -0.387189656496048, -0.29359734058380127, -0.27919381856918335, 0.33028414845466614, 0.27022024989128113, -0.10427121818065643, -0.21024645864963531, 0.0762791559100151, 0.4136538803577423, -0.3010398745536804, -0.15790145099163055, 0.3228685259819031, -0.09008663147687912, 0.042229004204273224, -0.31777018308639526, -0.16962245106697083, -0.23232419788837433, -0.03922197222709656, 0.0643526241183281, 0.1191188246011734, 0.17432044446468353, -0.22923649847507477, 0.08671270310878754, 0.2089667171239853, -0.006157575640827417, 0.045191407203674316, -0.35852137207984924, -0.18969087302684784, 0.19695445895195007, -0.08363581448793411, -0.4709039628505707, -0.05256635323166847, -0.054627373814582825, 0.44956424832344055, -0.12329591810703278, -0.2685033679008484, -0.26773515343666077, -0.17135363817214966, 0.19074375927448273, -0.4779602289199829, 0.2603839635848999, 0.15949931740760803, -0.17385974526405334, -0.04353503882884979, -0.21632522344589233, -0.22876229882240295, 0.06404323875904083, -0.427938848733902, -0.111689992249012, -0.21806254982948303, 0.322543203830719, 0.25588691234588623, 0.5785428285598755, 0.4294576942920685, -0.12591016292572021, 0.011429104954004288, 0.0859183818101883, 0.26582083106040955, -0.010927893221378326, -0.24184758961200714, 0.14893026649951935, 0.017324939370155334, -0.18374350666999817, 0.03324896842241287, -0.026682142168283463, -0.021125340834259987, -0.1454426646232605, 0.000988006591796875, -0.11230748891830444, -0.27807945013046265, -0.07840156555175781, -0.031594157218933105, 0.15784227848052979, 0.025706857442855835, 0.24272999167442322, -0.2341488003730774, -0.11353608220815659, -0.1281917691230774, -0.06174607574939728, -0.21230918169021606, -0.12382347136735916, -0.3357997238636017, -0.28321096301078796, -0.3398575782775879, 0.5780593156814575, -0.0012259256327524781, 0.5205250382423401, 0.055888693779706955, 0.0628800094127655, 0.09856930375099182, 0.15878760814666748, 0.503059983253479, -0.03328205645084381, 0.03527951240539551, 0.0028991494327783585, -0.05163472890853882, -0.4585817754268646, -0.17288830876350403, -0.43756628036499023, 0.07857614010572433, 0.26931366324424744, 0.2820392847061157, -0.44441747665405273, -0.15202349424362183, 0.11187472939491272, 0.13771213591098785, -0.20513980090618134, -0.227665975689888, -0.27064475417137146, -0.30532974004745483, 0.10594035685062408, 0.16478797793388367, 0.032659441232681274, 0.5073099732398987, -0.07552402466535568, -0.0545932911336422, -0.1585569828748703, -0.11195767670869827, 0.1654966026544571, -0.07670506834983826, 0.2643543779850006, -0.0636545717716217, 0.01347377523779869, -0.03138238936662674, -0.21630612015724182, 0.01581757888197899, 0.34091946482658386, 0.04081503674387932, -0.3991962671279907, 0.14608216285705566, 0.03810644894838333, 0.32405349612236023, 0.1054844856262207, -0.2490452229976654, -0.29232481122016907, 0.04914309084415436, 0.43288654088974, -0.22008897364139557, -0.26631689071655273, 0.18854552507400513, 0.14509335160255432, -0.2272973358631134, 0.2298048734664917, 0.7185587882995605, 0.2139739990234375, 0.10928656160831451, 0.13030332326889038, 0.12345799803733826, -0.23310326039791107, 0.3126358389854431, 0.2248610556125641, 0.6809939742088318, 0.03756095468997955, -0.09402057528495789, 0.37665921449661255, 0.14311152696609497, 0.30161821842193604, 0.2084541767835617, 0.2485911250114441, -0.39076319336891174, -0.3726089894771576, 0.04597613960504532, -0.10631769895553589, 0.19321992993354797, 0.057545311748981476, -0.18050679564476013, 0.3652169406414032, -0.1493537276983261, 0.14943566918373108, 0.1398077756166458, -0.06468161940574646, -0.10858888179063797, -0.19902649521827698, -0.5009469389915466, 0.21837760508060455, -0.2057846635580063, 0.08405262976884842, 0.09835046529769897, 0.01645738258957863, -0.2639563977718353, -0.3125874996185303, -0.2703993022441864, -0.14967024326324463, -0.3187796473503113, 0.11345972120761871, 0.2270328551530838, -0.042154233902692795, -0.011949852108955383, 0.13302160799503326, 0.16408763825893402, 0.3001229465007782, -0.2147272229194641, -0.19069939851760864, -0.3310374617576599, 0.26003849506378174, 0.2297174036502838, 0.14011865854263306, 0.13410119712352753, -0.10022062063217163, -0.15229666233062744, 0.04970148205757141, -0.15268190205097198, -0.07415095716714859, 0.11690941452980042, -0.06971290707588196, -0.18530146777629852, -0.5423142910003662, -0.09835338592529297, -0.35448217391967773, 0.23762264847755432, -0.2958385646343231, 0.16835278272628784, 0.2658821940422058, -0.3300108313560486, 0.512477457523346, 0.08152595162391663, -0.2033647894859314, 0.09808972477912903, 0.5110054612159729, 0.2963283360004425, -0.4478470981121063, 0.2377486675977707, -0.11070798337459564, -0.08715946972370148, -0.1446135938167572, 0.3030203580856323, -0.1293805092573166, -0.15423700213432312, 0.3362120985984802, 0.04522036761045456, 0.20472054183483124, -0.06265266239643097, 0.2726622521877289, 0.28317752480506897, 0.17612114548683167, -0.12237289547920227, -0.4541601836681366, -0.22795738279819489, 0.05557882785797119, 0.1630506068468094, 0.23392218351364136, -0.062306880950927734, 0.06925426423549652, -0.03665684536099434, 0.07946851849555969, -0.3567444682121277, 0.0284884013235569, -0.2722086012363434, -0.16839119791984558, 0.3577238917350769, -0.015908777713775635, 0.10509879887104034, 0.23762734234333038, 0.14596255123615265, 0.34840911626815796, -0.21885918080806732, -0.21175745129585266, 0.0929410457611084, 0.11298498511314392, 0.049766164273023605, 0.13652865588665009, 0.24194523692131042, 0.2411864846944809, -0.23330995440483093, -0.15899556875228882, 0.06861759722232819, 0.25442320108413696, -0.029793396592140198, 0.4409850239753723, 0.20670460164546967, 0.5164744257926941, 0.22114895284175873, -0.0960349440574646, -0.0014876574277877808, 0.01930200308561325, 0.09562424570322037, 0.25657862424850464, -0.046614762395620346, -0.12112946808338165, -0.05757898464798927, -0.1319112479686737, -0.08246663212776184, -0.18396982550621033, 0.1729019433259964, -0.4604448080062866, -0.1534625142812729, 0.27448156476020813, 0.4592892527580261, 0.2708224356174469, -0.3164738416671753, 0.03137245029211044, -0.3876006007194519, 0.24901321530342102, -0.27479881048202515, -0.07807759195566177, 0.3570888638496399, 0.3549429476261139, -0.03277704119682312, 0.2992205321788788, 0.08909258246421814, -0.14151827991008759, 0.08568868786096573, -0.11332780122756958, 0.3778684735298157, -0.29320961236953735, 0.3197648227214813, 0.03691716864705086, 0.04237620159983635, -0.10097597539424896, 0.35262176394462585, -0.17222020030021667, 0.27415239810943604, 0.43648505210876465, -0.35701024532318115, 0.43129000067710876, -0.38584572076797485, 0.03733285516500473, -0.15592259168624878, -0.2061263769865036, 0.04497970640659332, 0.35474884510040283, -0.0392773300409317, -0.06812203675508499, -0.30532634258270264, 0.5874359607696533, -0.48515111207962036, -0.2915433645248413, -0.3080570697784424, 0.09458455443382263, -0.24489757418632507, 0.037652723491191864, -0.2436753660440445, -0.21161851286888123, -0.06257261335849762, -0.17136582732200623, -0.10471171140670776, -0.15627002716064453, 0.5076804161071777, -0.0029938220977783203, -0.11817404627799988, -0.19359980523586273, -0.21179527044296265, 0.31158652901649475, 0.3456219434738159, -0.060505181550979614, 0.16519705951213837, 0.3299373388290405, 0.13042622804641724, -0.0723080039024353, 0.3381168842315674, 0.4496156573295593, 0.37392887473106384, 0.06921970844268799, 0.1301162838935852, 0.0600309781730175, -0.11583483964204788, 0.08950953185558319, 0.2685668468475342, 0.07373687624931335, -0.10883040726184845, 0.3471783995628357, 0.14156530797481537, -0.21630795300006866, 0.010023098438978195, 0.01509040966629982, 0.45883849263191223, -0.39209622144699097, 0.37332576513290405, -0.22580388188362122, -0.003784719854593277, -0.11735308170318604, -0.14588487148284912, -0.2927844226360321, -0.04784217104315758, -0.010679539293050766, 0.11731700599193573, -0.08102814108133316, -0.2386758178472519, 0.11364679038524628, 0.034083377569913864, 0.43225833773612976, 0.14455512166023254, 0.06428949534893036, -0.4238933324813843, -0.0792558416724205, -0.5307919979095459, 0.2905157208442688, 0.2964378297328949, 0.14402815699577332, 0.12007898837327957, 0.3745252788066864, -0.14826557040214539, 0.08048537373542786, 0.4876258373260498, -0.022036563605070114, 0.09643223881721497, 0.08919233828783035, -0.2946881949901581, 0.018250493332743645, -0.3477781414985657, -0.5018592476844788, 0.2702702581882477, -0.2557947337627411, 0.016467034816741943, -0.1700468510389328, 0.06621558219194412, 0.08285640925168991, 0.2639181315898895, -0.09510654211044312, 0.24263134598731995, 0.3294847309589386, 0.2906573414802551, 0.17234252393245697, 0.08686108887195587, -0.18528667092323303, -0.04284970089793205, -0.020743312314152718, -0.31585493683815, 0.3469444811344147, -0.07680808007717133, 0.47102588415145874, -0.036173708736896515, -0.16789735853672028, -0.0876007154583931, 0.2859790027141571, 0.2838340401649475, -0.24054929614067078, -0.1551331877708435, 0.3994322419166565, -0.04571046680212021, -0.05952782183885574, 0.11287423968315125, 0.01496853306889534, 0.10051976144313812, 0.594959020614624, -0.33951127529144287, -0.4136885106563568, 0.4893682897090912, -0.25495147705078125, -0.1707616150379181, -0.07936938107013702, 0.3165197968482971, -0.10114788264036179, -0.392553448677063, -0.8377334475517273, -0.05495345592498779, 0.40245577692985535, 0.05693274736404419, -0.0016012061387300491, 0.3745991885662079, -0.30350837111473083, -0.13147085905075073, 0.09910251200199127, 0.4862997233867645, 0.08818784356117249, -0.19632881879806519, 0.12555216252803802, -0.3345632553100586 ]
https://github.com/huggingface/datasets/issues/3053
load_dataset('the_pile_openwebtext2') produces ArrowInvalid, value too large to fit in C integer type
I was getting a similar error `pyarrow.lib.ArrowInvalid: Integer value 528 not in range: -128 to 127` - AFAICT, this is because the type specified for `reddit_scores` is `datasets.Sequence(datasets.Value("int8"))`, but the actual values can be well outside the max range for 8-bit integers. I worked around this by downloading the `the_pile_openwebtext2.py` and editing it to use local files and drop reddit scores as a column (not needed for my purposes).
## Describe the bug When loading `the_pile_openwebtext2`, we get the error `pyarrow.lib.ArrowInvalid: Value 2111 too large to fit in C integer type` ## Steps to reproduce the bug ```python import datasets ds = datasets.load_dataset('the_pile_openwebtext2') ``` ## Expected results Should download the dataset, convert it to an arrow file, and return a working Dataset object. ## Actual results The download works, but conversion to the arrow file fails as follows: ``` >>> ds = datasets.load_dataset('the_pile_openwebtext2') Downloading and preparing dataset openwebtext2/plain_text (download: 27.33 GiB, generated: 63.86 GiB , post-processed: Unknown size, total: 91.19 GiB) to /home/davidbau/.cache/huggingface/datasets/open webtext2/plain_text/1.0.0/c48ec73ba3483bac673463f48f67e9a4fd8cb49a9d6ec4fb957f0b424b97cf25... Traceback (most recent call last): File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/builder.py", line 1133, in _prepare_split writer.write(example, key) File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 366, in write self.write_examples_on_file() File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 311, in write_examples_on_file pa_array = pa.array(typed_sequence) File "pyarrow/array.pxi", line 222, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 115, in __arrow_array__ out = pa.array(cast_to_python_objects(self.data, only_1d_for_numpy=True), type=type) File "pyarrow/array.pxi", line 305, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Value 2111 too large to fit in C integer type ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: ``` - Platform: Ubuntu 20.04 - Python version: python 3.9 - PyArrow version: 3.0.0
69
load_dataset('the_pile_openwebtext2') produces ArrowInvalid, value too large to fit in C integer type ## Describe the bug When loading `the_pile_openwebtext2`, we get the error `pyarrow.lib.ArrowInvalid: Value 2111 too large to fit in C integer type` ## Steps to reproduce the bug ```python import datasets ds = datasets.load_dataset('the_pile_openwebtext2') ``` ## Expected results Should download the dataset, convert it to an arrow file, and return a working Dataset object. ## Actual results The download works, but conversion to the arrow file fails as follows: ``` >>> ds = datasets.load_dataset('the_pile_openwebtext2') Downloading and preparing dataset openwebtext2/plain_text (download: 27.33 GiB, generated: 63.86 GiB , post-processed: Unknown size, total: 91.19 GiB) to /home/davidbau/.cache/huggingface/datasets/open webtext2/plain_text/1.0.0/c48ec73ba3483bac673463f48f67e9a4fd8cb49a9d6ec4fb957f0b424b97cf25... Traceback (most recent call last): File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/builder.py", line 1133, in _prepare_split writer.write(example, key) File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 366, in write self.write_examples_on_file() File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 311, in write_examples_on_file pa_array = pa.array(typed_sequence) File "pyarrow/array.pxi", line 222, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home/davidbau/.conda/envs/tenv/lib/python3.9/site-packages/datasets/arrow_writer.py", line 115, in __arrow_array__ out = pa.array(cast_to_python_objects(self.data, only_1d_for_numpy=True), type=type) File "pyarrow/array.pxi", line 305, in pyarrow.lib.array File "pyarrow/array.pxi", line 39, in pyarrow.lib._sequence_to_array File "pyarrow/error.pxi", line 122, in pyarrow.lib.pyarrow_internal_check_status File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status pyarrow.lib.ArrowInvalid: Value 2111 too large to fit in C integer type ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: ``` - Platform: Ubuntu 20.04 - Python version: python 3.9 - PyArrow version: 3.0.0 I was getting a similar error `pyarrow.lib.ArrowInvalid: Integer value 528 not in range: -128 to 127` - AFAICT, this is because the type specified for `reddit_scores` is `datasets.Sequence(datasets.Value("int8"))`, but the actual values can be well outside the max range for 8-bit integers. I worked around this by downloading the `the_pile_openwebtext2.py` and editing it to use local files and drop reddit scores as a column (not needed for my purposes).
[ -0.351736456155777, 0.12943103909492493, 0.02369081601500511, 0.5282649397850037, 0.24671901762485504, 0.06812768429517746, 0.11001738905906677, 0.5502154231071472, -0.11050502955913544, -0.018477067351341248, -0.053451523184776306, 0.45882776379585266, 0.06217459961771965, 0.06302332878112793, -0.10657054930925369, 0.022833088412880898, -0.003974094986915588, 0.07346537709236145, -0.07886965572834015, 0.04640773683786392, -0.22885264456272125, 0.1069088727235794, -0.2880137860774994, 0.1158466786146164, -0.19447602331638336, -0.14678500592708588, 0.07479622215032578, 0.35044533014297485, -0.17137297987937927, -0.27272018790245056, 0.24271191656589508, -0.37439706921577454, 0.2790476083755493, 0.4020915627479553, -0.00012517852883320302, -0.003990665078163147, 0.33250826597213745, 0.027703577652573586, -0.40660396218299866, -0.037273019552230835, -0.000043198466300964355, -0.42417967319488525, 0.10165639966726303, -0.18091808259487152, 0.2957206666469574, -0.39135804772377014, -0.030326826497912407, -0.2231278270483017, 0.16308151185512543, 0.2760135531425476, 0.13087260723114014, 0.27533066272735596, 0.514880359172821, 0.17216840386390686, 0.4279592037200928, 0.054157838225364685, -0.21247828006744385, 0.3731328248977661, 0.19344690442085266, 0.32196152210235596, 0.04916324093937874, 0.008378714323043823, -0.023288719356060028, 0.08405478298664093, 0.2948090136051178, 0.11819803714752197, 0.041894737631082535, -0.036594144999980927, 0.11048761010169983, 0.022336211055517197, 0.43922367691993713, -0.5282230973243713, -0.23778779804706573, -0.07690965384244919, -0.06797540187835693, -0.023560546338558197, 0.17987465858459473, 0.43634340167045593, -0.06501265615224838, 0.4313015043735504, 0.0018505051266402006, 0.04311409965157509, -0.2239605337381363, 0.21493534743785858, -0.22328296303749084, 0.05579579994082451, -0.1241767406463623, 0.2533709704875946, 0.0026157572865486145, -0.0920632928609848, 0.2256895899772644, -0.04450050741434097, -0.16259098052978516, -0.08057747036218643, -0.18685579299926758, -0.048305410891771317, -0.22117367386817932, 0.15911005437374115, 0.1753534972667694, -0.07958537340164185, 0.4454820156097412, 0.03183669224381447, -0.005157420877367258, 0.1246006116271019, 0.3221035599708557, 0.14472424983978271, -0.17270395159721375, 0.14747779071331024, 0.1894044727087021, -0.1188695952296257, 0.1290929764509201, -0.03355242311954498, -0.3238465487957001, -0.6064028739929199, 0.6052791476249695, 0.004212334752082825, 0.6739246845245361, -0.1358337253332138, -0.5438898801803589, 0.06919735670089722, -0.3778192102909088, 0.18970167636871338, -0.15761998295783997, 0.28145521879196167, -0.11695078760385513, 0.2615172564983368, 0.32367581129074097, 0.31164616346359253, -0.1293921172618866, -0.41315943002700806, -0.05750979483127594, -0.1799161285161972, -0.05735517665743828, -0.07445342093706131, 0.2515108585357666, -0.16225792467594147, 0.25300487875938416, 0.26809296011924744, 0.1288326531648636, -0.17321158945560455, 0.09027383476495743, -0.10935795307159424, 0.14808343350887299, 0.20077064633369446, -0.13231931626796722, 0.2002573013305664, 0.06733281910419464, 0.036475323140621185, -0.23860663175582886, 0.35535508394241333, -0.2126384973526001, -0.17122845351696014, -0.4415871798992157, 0.0765579417347908, -0.009378255344927311, -0.047099851071834564, -0.2785740792751312, -0.2267954796552658, 0.35478657484054565, -0.03395519405603409, 0.17202657461166382, -0.5312421321868896, 0.19411981105804443, -0.3338215947151184, 0.07527124881744385, 0.07559850811958313, -0.5725158452987671, 0.34816014766693115, 0.07404836267232895, 0.044650133699178696, 0.28926578164100647, 0.17863979935646057, -0.20485994219779968, 0.010709568858146667, -0.18293757736682892, 0.18215440213680267, 0.39224302768707275, -0.247086763381958, -0.6511480212211609, 0.32635143399238586, 0.005787163972854614, -0.19859515130519867, 0.1744653880596161, 0.061652783304452896, -0.07109688222408295, -0.17581205070018768, -0.054604917764663696, 0.3992771506309509, -0.05574426054954529, 0.1665646880865097, -0.29048100113868713, -0.4595946669578552, 0.3024396300315857, 0.17495515942573547, -0.23042820394039154, -0.29712849855422974, 0.3261093199253082, -0.3147173523902893, 0.30139538645744324, -0.05201389268040657, 0.1966165006160736, 0.022033238783478737, 0.08856233954429626, -0.09862995147705078, 0.12737146019935608, -0.11703440546989441, -0.4337482452392578, 0.04989560693502426, -0.0697096586227417, -0.3549656271934509, -0.3674123287200928, -0.21392865478992462, -0.5538052916526794, 0.34848713874816895, -0.02242271974682808, 0.1442607194185257, -0.013050582259893417, 0.04899696260690689, 0.050410185009241104, -0.28397366404533386, 0.03743835166096687, 0.032636575400829315, -0.11238671094179153, 0.14909552037715912, -0.12027573585510254, 0.2217448502779007, 0.0546138659119606, -0.2919502854347229, 0.08328419923782349, -0.00745159387588501, 0.07252464443445206, -0.0007784639019519091, -0.25717878341674805, 0.4648158848285675, -0.21388395130634308, 0.07629527896642685, -0.2151286005973816, -0.08176042139530182, 0.23021824657917023, -0.6050097942352295, 0.3784959316253662, 0.2832358479499817, 0.25567328929901123, -0.0771951675415039, 0.16090601682662964, 0.132496640086174, 0.15898317098617554, 0.09636546671390533, -0.2405136227607727, -0.10381589829921722, -0.05440666154026985, 0.03170054033398628, 0.20330223441123962, -0.0026398897171020508, -0.3160233795642853, 0.144981250166893, 0.2985489070415497, 0.06293979287147522, -0.04315650463104248, 0.2278745472431183, 0.5576254725456238, -0.1821574717760086, 0.13357695937156677, 0.2741850018501282, -0.2530316710472107, -0.06213492527604103, 0.11654101312160492, -0.11837723851203918, 0.43994569778442383, 0.2701001763343811, 0.05323665589094162, 0.13112419843673706, 0.057863179594278336, -0.12889409065246582, 0.3474857807159424, 0.12111052125692368, 0.2929413318634033, 0.2139596939086914, 0.29877811670303345, -0.09705016762018204, -0.11188735067844391, 0.0972261130809784, 0.0833834856748581, 0.2031237781047821, -0.5977553129196167, 0.04507824033498764, -0.1943952739238739, 0.2132594883441925, -0.22287754714488983, -0.05658888444304466, 0.10369786620140076, -0.17036975920200348, -0.34346193075180054, 0.16949915885925293, -0.060347702354192734, -0.02692447043955326, -0.1558738648891449, 0.004934191703796387, 0.3193819224834442, -0.10309154540300369, -0.09765937179327011, -0.06059592589735985, -0.5405908823013306, -0.090407595038414, 0.3905327022075653, 0.01717652566730976, 0.23425059020519257, -0.06304565817117691, 0.09490152448415756, -0.3236560821533203, -0.14524680376052856, -0.00467010959982872, 0.06991109251976013, 0.25764000415802, 0.25807663798332214, 0.18431313335895538, -0.07713812589645386, -0.21707995235919952, 0.09982652962207794, -0.12327882647514343, -0.27924415469169617, 0.2847653031349182, -0.1822231560945511, 0.011632449924945831, -0.12655240297317505, -0.3838792145252228, -0.35722145438194275, -0.3974648714065552, 0.07166094332933426, -0.10946302115917206, 0.12765544652938843, 0.08927499502897263, 0.4138147830963135, 0.16963139176368713, 0.26353856921195984, 0.03464508801698685, -0.10648389905691147, -0.01530422642827034, 0.5487939715385437, -0.06259636580944061, -0.29735514521598816, -0.04032128304243088, -0.03178531676530838, -0.17274419963359833, 0.3946845531463623, -0.3322181701660156, 0.28170567750930786, -0.40968775749206543, 0.33623889088630676, -0.32684651017189026, 0.3040964901447296, 0.19822773337364197, 0.018024379387497902, 0.0020507052540779114, -0.22109010815620422, -0.11646592617034912, 0.08071499317884445, 0.0018500275909900665, 0.23312726616859436, -0.015586905181407928, 0.3704276382923126, -0.06539151072502136, 0.4666033387184143, 0.13082416355609894, -0.219667449593544, 0.2865413427352905, 0.04493899643421173, 0.08111140877008438, -0.02276504784822464, -0.003694618120789528, -0.07206413894891739, -0.20603010058403015, -0.05151579529047012, 0.37615150213241577, 0.11190535873174667, -0.2956114113330841, 0.1520107388496399, -0.11872740089893341, -0.37849289178848267, -0.20276783406734467, 0.11888617277145386, 0.12762102484703064, 0.05321665480732918, -0.012329299002885818, 0.020784705877304077, -0.22001685202121735, -0.11782520264387131, 0.2189720869064331, -0.13254472613334656, -0.12132196873426437, 0.12429331988096237, 0.28705111145973206, 0.09312732517719269, -0.37612807750701904, 0.41541749238967896, 0.17055247724056244, 0.17176397144794464, 0.2909456491470337, -0.2543455958366394, 0.2528926134109497, -0.02039787545800209, 0.5834685564041138, -0.01932079903781414, 0.30000174045562744, 0.040005557239055634, 0.34083399176597595, -0.6956443786621094, -0.03760287165641785, -0.12913855910301208, 0.24278736114501953, 0.5000620484352112, 0.2025790959596634, -0.39498189091682434, 0.03233965113759041, 0.21600380539894104, 0.413709431886673, 0.06837618350982666, -0.24702368676662445, -0.1447366625070572, -0.3727993071079254, -0.2850550413131714, -0.11380314081907272, 0.4191243052482605, 0.375702440738678, -0.05998695641756058, -0.40393269062042236, -0.3415302634239197, -0.24823689460754395, 0.11736712604761124, -0.05503331869840622, 0.43648314476013184, -0.024198519065976143, 0.11798787117004395, -0.09882506728172302, 0.4382993280887604, 0.26998403668403625, 0.563722550868988, 0.15923908352851868, -0.3664461672306061, 0.1652590036392212, -0.10464029014110565, 0.144781693816185, 0.2470538318157196, -0.25661811232566833, -0.2322784662246704, -0.022381119430065155, 0.17162062227725983, -0.07476305216550827, 0.08151483535766602, 0.020304860547184944, -0.13251325488090515, -0.27655139565467834, -0.20082901418209076, 0.7142729759216309, -0.08689476549625397, -0.020029164850711823, 0.6451019644737244, 0.264163076877594, -0.22119970619678497, 0.20159491896629333, 0.17558889091014862, 0.9438361525535583, 0.11123165488243103, 0.00765661895275116, 0.5595152974128723, -0.47500574588775635, -0.10522700101137161, -0.06371252238750458, -0.2186730057001114, -0.4368245303630829, 0.19899825751781464, 0.18413563072681427, -0.25444212555885315, -0.10546449571847916, 0.16977554559707642, -0.3359872102737427, -0.11314264684915543, -0.4020754098892212, -0.02176264300942421, 0.14620737731456757, 0.11176612973213196, -0.5197160243988037, -0.06050318852066994, -0.1826033741235733, 0.011044759303331375, -0.0668589323759079, -0.06886698305606842, -0.16058868169784546, -0.31223368644714355, -0.28015878796577454, -0.014672543853521347, -0.14700479805469513, 0.15776780247688293, -0.5740167498588562, 0.1970030963420868, 0.07034274935722351, -0.18744206428527832, 0.35119783878326416, 0.02162712812423706, 0.3152083456516266, -0.015324626117944717, -0.15814203023910522, 0.0930476188659668, 0.111788310110569, 0.07664600759744644, 0.23737460374832153, -0.03163859620690346, 0.041971784085035324, 0.06432058662176132, -0.19482967257499695, 0.05594716593623161, -0.11134707927703857, -0.20884503424167633, 0.4161200523376465, -0.08258835971355438, 0.17604374885559082, -0.5310365557670593, -0.12963303923606873, -0.35653504729270935, 0.0769677460193634, -0.1491437703371048, 0.03441017121076584, 0.11174269020557404, 0.11065156757831573, 0.03535373881459236, 0.09666067361831665, -0.5420197248458862, -0.07567282021045685, 0.19691891968250275, -0.15922021865844727, 0.1649690866470337, 0.5757849216461182, 0.21888531744480133, -0.11255411058664322, -0.07959391176700592, 0.36136284470558167, 0.18017959594726562, -0.7902935743331909, 0.35955607891082764, -0.1515558958053589, 0.13607464730739594, -0.12295211851596832, 0.37055614590644836, 0.32631099224090576, 0.16734108328819275, -0.04078260436654091, -0.4262571930885315, -0.2082751989364624, 0.03726727142930031, 0.025008361786603928, 0.181111142039299, -0.09680972993373871, -0.049581367522478104, -0.08449560403823853, -0.2799382209777832, -0.17461290955543518, 0.10685767978429794, 0.13967767357826233, -0.05262361466884613, -0.018917016685009003, 0.08955087512731552, -0.09360367804765701, 0.10185542702674866, -0.017763672396540642, 0.15447527170181274, -0.0993138924241066, -0.11861659586429596, -0.24307093024253845, 0.16004328429698944, -0.08531761914491653, -0.1422029733657837, -0.009471324272453785, -0.32676100730895996, -0.15133602917194366, -0.18648234009742737, 0.2623847723007202, -0.06069343537092209, 0.03527013584971428, -0.04676195606589317, 0.23422683775424957, 0.013276323676109314, -0.32940351963043213, 0.02396642602980137, -0.1196637898683548, 0.3361613154411316, -0.08590365201234818, 0.40682193636894226, 0.11499269306659698, -0.016372956335544586, 0.019423145800828934, 0.11753023415803909, 0.11469539999961853, -0.029872409999370575, 0.2680012285709381, -0.32481199502944946, -0.09564103186130524, 0.3296850919723511, 0.04676961153745651, 0.30582118034362793, -0.19256237149238586, -0.13644583523273468, -0.04556499049067497, 0.16881480813026428, -0.1673779934644699, 0.26168978214263916, -0.07336440682411194, -0.06071903556585312, -0.2989680767059326, 0.010777793824672699, -0.030478641390800476, -0.27231287956237793, -0.3673935532569885, 0.08335563540458679, 0.1458180546760559, 0.14704614877700806, -0.17103634774684906, 0.7612320184707642, -0.12207391858100891, -0.05715407803654671, 0.32920601963996887, 0.015086110681295395, 0.35665231943130493, 0.2898402512073517, -0.028909310698509216, 0.2682218849658966, 0.12385299801826477, 0.35240328311920166, -0.1778525710105896, -0.3215813636779785, 0.036611154675483704, 0.4209795594215393, 0.18078318238258362, -0.0854717567563057, 0.3626148998737335, 0.630419135093689, 0.08042901009321213, -0.0681474432349205, -0.2517165541648865, 0.08542819321155548, -0.1357855200767517, -0.0383625328540802, -0.2527160048484802, -0.16638445854187012, -0.2636735439300537, -0.008954644203186035, -0.3740170896053314, -0.10010306537151337, 0.23461267352104187, 0.35791248083114624, -0.17557300627231598, -0.6860474944114685, 0.23253276944160461, 0.09141343832015991, 0.09607112407684326, -0.47108525037765503, 0.14480136334896088, 0.12994839251041412, -0.2619025409221649, 0.009403372183442116, 0.4313320219516754, 0.5298969745635986, 0.4176654517650604, -0.1248590350151062, -0.14921726286411285, 0.08103878796100616, -0.06005895137786865, -0.215232253074646, 0.07329605519771576, 0.1567537784576416, 0.31571608781814575, 0.2302113026380539, 0.015891464427113533, -0.06364689767360687, -0.35527369379997253, 0.10206952691078186, 0.11917257308959961, -0.25710511207580566, 0.3254583477973938, -0.3648177981376648, -0.3587004542350769, 0.0857817754149437, -0.029628075659275055, -0.2558400630950928, 0.01885349303483963, 0.4313734471797943, -0.16055898368358612, 0.03283935412764549, -0.010265999473631382, 0.023278087377548218, -0.17762982845306396, 0.3403295576572418, 0.2735370099544525, 0.1282292902469635, -0.22102287411689758, -0.1507507860660553, -0.6405991911888123, 0.261123925447464, 0.031791575253009796, -0.09610689431428909, 0.2458028793334961, 0.2943161725997925, 0.062363151460886, 0.15609799325466156, 0.27719593048095703, 0.38570308685302734, 0.18001438677310944, 0.2290484607219696, -0.09866207093000412, -0.24678345024585724, 0.035840846598148346, 0.00531934667378664, -0.0285491980612278, -0.6182649731636047, 0.17802901566028595, -0.1724211424589157, -0.02470373548567295, -0.3137021064758301, -0.18194222450256348, 0.17308342456817627, -0.19594305753707886, 0.7945693135261536, 0.05940626561641693, 0.25414979457855225, 0.0904247835278511, 0.0713006779551506, -0.19735771417617798, -0.2340608388185501, -0.037465110421180725, 0.24998217821121216, -0.19706211984157562, 0.21157683432102203, -0.15216197073459625, 0.12511524558067322, -0.048218682408332825, 0.05429073050618172, -0.11038050800561905, 0.045681606978178024, -0.17951002717018127, -0.06934301555156708, -0.42272359132766724, -0.0035310040693730116, 0.07369045913219452, -0.07080455124378204, -0.03044641762971878, 0.07081585377454758, -0.1600816249847412, -0.46189019083976746, 0.3164167106151581, -0.3298892676830292, -0.3947362005710602, 0.18123768270015717, 0.4107391834259033, 0.2796974778175354, -0.042929962277412415, -0.37664154171943665, 0.21543890237808228, 0.3943435847759247, -0.050259485840797424, -0.09699058532714844, 0.20508766174316406, 0.0343584343791008, 0.20006917417049408, -0.03379848599433899, 0.6260967254638672, -0.034894540905952454, -0.2012706995010376, -0.20737597346305847, -0.47388482093811035 ]
https://github.com/huggingface/datasets/issues/3052
load_dataset cannot download the data and hangs on forever if cache dir specified
Issue was environment inconsistency, updating packages did the trick `conda install -c huggingface -c conda-forge datasets` > Collecting package metadata (current_repodata.json): done > Solving environment: | > The environment is inconsistent, please check the package plan carefully > The following packages are causing the inconsistency: > > - conda-forge/noarch::datasets==1.12.1=pyhd8ed1ab_1 > - conda-forge/win-64::multiprocess==0.70.12.2=py38h294d835_0 > done > > Package Plan > > environment location: C:\xxx\anaconda3\envs\UnBias-94-1 > > added / updated specs: > - datasets > > > The following NEW packages will be INSTALLED: > > dill conda-forge/noarch::dill-0.3.4-pyhd8ed1ab_0 > > The following packages will be UPDATED: > > ca-certificates pkgs/main::ca-certificates-2021.9.30-~ --> conda-forge::ca-certificates-2021.10.8-h5b45459_0 > certifi pkgs/main::certifi-2021.5.30-py38haa9~ --> conda-forge::certifi-2021.10.8-py38haa244fe_0 > > The following packages will be SUPERSEDED by a higher-priority channel: >
## Describe the bug After updating datasets, a code that ran just fine for ages began to fail. Specifying _datasets.load_dataset_'s _cache_dir_ optional argument on Windows 10 machine results in data download to hang on forever. Same call without cache_dir works just fine. Surprisingly exact same code just runs perfectly fine on Linux docker instance running in cloud. Unfortunately I updated Windows also at the same time and I can't remember which version of datasets was running in my conda environment prior to the update otherwise I would have tried both to check this out. :( ## Steps to reproduce the bug ```python # Sample code to reproduce the bug ``` cache_dir = 'c:/data/datasets' dataset = load_dataset('wikipedia', '20200501.en', split='train',cache_dir=cache_dir) ``` Note that exact same code without specifying _cache_dir_ argument works perfectly fine. ``` cache_dir = 'c:/data/datasets' dataset = load_dataset('wikipedia', '20200501.en', split='train') ``` ## Expected results Downloads the dataset and cache is handled in the _cache_dir_ directory ## Actual results Data download keeps hanging on forever, **NO TRACEBACK**! ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.8.11 - PyArrow version: 3.0.0
118
load_dataset cannot download the data and hangs on forever if cache dir specified ## Describe the bug After updating datasets, a code that ran just fine for ages began to fail. Specifying _datasets.load_dataset_'s _cache_dir_ optional argument on Windows 10 machine results in data download to hang on forever. Same call without cache_dir works just fine. Surprisingly exact same code just runs perfectly fine on Linux docker instance running in cloud. Unfortunately I updated Windows also at the same time and I can't remember which version of datasets was running in my conda environment prior to the update otherwise I would have tried both to check this out. :( ## Steps to reproduce the bug ```python # Sample code to reproduce the bug ``` cache_dir = 'c:/data/datasets' dataset = load_dataset('wikipedia', '20200501.en', split='train',cache_dir=cache_dir) ``` Note that exact same code without specifying _cache_dir_ argument works perfectly fine. ``` cache_dir = 'c:/data/datasets' dataset = load_dataset('wikipedia', '20200501.en', split='train') ``` ## Expected results Downloads the dataset and cache is handled in the _cache_dir_ directory ## Actual results Data download keeps hanging on forever, **NO TRACEBACK**! ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.8.11 - PyArrow version: 3.0.0 Issue was environment inconsistency, updating packages did the trick `conda install -c huggingface -c conda-forge datasets` > Collecting package metadata (current_repodata.json): done > Solving environment: | > The environment is inconsistent, please check the package plan carefully > The following packages are causing the inconsistency: > > - conda-forge/noarch::datasets==1.12.1=pyhd8ed1ab_1 > - conda-forge/win-64::multiprocess==0.70.12.2=py38h294d835_0 > done > > Package Plan > > environment location: C:\xxx\anaconda3\envs\UnBias-94-1 > > added / updated specs: > - datasets > > > The following NEW packages will be INSTALLED: > > dill conda-forge/noarch::dill-0.3.4-pyhd8ed1ab_0 > > The following packages will be UPDATED: > > ca-certificates pkgs/main::ca-certificates-2021.9.30-~ --> conda-forge::ca-certificates-2021.10.8-h5b45459_0 > certifi pkgs/main::certifi-2021.5.30-py38haa9~ --> conda-forge::certifi-2021.10.8-py38haa244fe_0 > > The following packages will be SUPERSEDED by a higher-priority channel: >
[ -0.3561404347419739, 0.6039690971374512, -0.11219194531440735, 0.06416300684213638, 0.39051371812820435, 0.05530094355344772, 0.4375729560852051, 0.09474267065525055, -0.04050477594137192, 0.1036616712808609, -0.004555271938443184, 0.4003579616546631, 0.17270001769065857, -0.2531108856201172, -0.10217925161123276, 0.029567264020442963, 0.3168691098690033, 0.0264832004904747, -0.26813164353370667, 0.029746219515800476, -0.24954287707805634, 0.26401013135910034, -0.23537668585777283, -0.47149354219436646, -0.20035582780838013, -0.04890625923871994, -0.20702704787254333, 0.10766555368900299, 0.12633472681045532, -0.22915257513523102, 0.6934956312179565, 0.14394640922546387, 0.1560620367527008, 0.5367050766944885, -0.0001202161583933048, 0.09587343037128448, 0.36938613653182983, -0.09599021822214127, -0.4860744774341583, -0.3124607801437378, -0.2863805890083313, -0.030309196561574936, -0.07919333875179291, -0.09468279778957367, 0.008159492164850235, 0.125619038939476, -0.10834962129592896, -0.3397778868675232, 0.021617300808429718, 0.2030917853116989, 0.12207117676734924, 0.21383383870124817, -0.2862982749938965, -0.07258908450603485, -0.12258005887269974, -0.08590841293334961, -0.11839406192302704, 0.4290114641189575, 0.21226322650909424, -0.23873314261436462, -0.0806100144982338, 0.30986055731773376, -0.17573757469654083, 0.0349389873445034, 0.021731141954660416, 0.028304915875196457, -0.018384143710136414, -0.21744242310523987, 0.3219572901725769, 0.18530642986297607, 0.8403258323669434, -0.09487240761518478, -0.44985318183898926, -0.1286434531211853, -0.0980323851108551, -0.22239001095294952, 0.4954180121421814, -0.04322633147239685, -0.18651840090751648, 0.14155353605747223, -0.21301400661468506, 0.14384639263153076, -0.048343509435653687, 0.21915985643863678, -0.15389397740364075, 0.2648841142654419, -0.1285952776670456, 0.1366899609565735, -0.06597433984279633, 0.0993136614561081, 0.3072390556335449, -0.17432522773742676, -0.053987760096788406, -0.06275293976068497, -0.4286939799785614, 0.2477131485939026, -0.05684053152799606, 0.1115807443857193, -0.16722556948661804, 0.4133315682411194, 0.0022224457934498787, -0.01244819164276123, 0.190480038523674, -0.029275111854076385, 0.0703514814376831, 0.26980265974998474, 0.13817737996578217, -0.020179379731416702, 0.3505204916000366, -0.13325081765651703, 0.19462665915489197, -0.0011618547141551971, -0.21486003696918488, -0.4516289234161377, 0.14926882088184357, 0.07073687762022018, 0.3595529794692993, -0.09015895426273346, -0.2743512988090515, -0.03261072188615799, 0.1868337094783783, 0.09800136834383011, 0.2361396998167038, 0.3796730637550354, -0.1548822522163391, 0.2310488224029541, 0.026675470173358917, 0.21288780868053436, -0.03223302587866783, 0.24060040712356567, -0.03463734686374664, -0.3236966133117676, -0.10446949303150177, -0.11018302291631699, 0.5441453456878662, -0.09017476439476013, 0.2831684648990631, 0.03706081956624985, 0.09966111183166504, 0.10888580977916718, -0.2050817906856537, -0.2520248591899872, 0.06694091111421585, 0.40536797046661377, -0.1560278683900833, 0.40568527579307556, -0.03458939865231514, 0.06620833277702332, -0.10953584313392639, 0.27390411496162415, -0.15168994665145874, -0.13782334327697754, -0.05342680215835571, 0.08698993176221848, -0.03159989416599274, -0.05920044332742691, -0.0899844691157341, 0.035723067820072174, 0.28128209710121155, -0.09264379739761353, 0.26511356234550476, -0.10877236723899841, -0.3155536651611328, -0.22319653630256653, 0.2660958170890808, 0.5889154076576233, -0.303297758102417, 0.05472259968519211, 0.2194671630859375, -0.02385823056101799, -0.16064691543579102, -0.0041041262447834015, -0.13458377122879028, -0.11074594408273697, -0.20345187187194824, -0.13445313274860382, 0.012538127601146698, -0.6004807353019714, -0.6698058247566223, 0.06818877905607224, 0.07089507579803467, 0.18772035837173462, 0.10421538352966309, 0.09952433407306671, 0.5421274900436401, -0.1580362468957901, 0.31363755464553833, 0.33004534244537354, 0.06265619397163391, -0.009632108733057976, -0.13378100097179413, -0.16256380081176758, 0.16761822998523712, 0.20509551465511322, -0.1113281399011612, 0.12189234793186188, -0.06373906880617142, 0.13675780594348907, 0.14770369231700897, 0.09490066021680832, 0.05822296440601349, 0.45278459787368774, 0.3112203776836395, 0.1275063455104828, 0.08736132085323334, 0.011604279279708862, -0.6116011142730713, 0.39607369899749756, 0.3855992555618286, -0.0556119829416275, -0.1278115212917328, -0.0118452999740839, -0.045162469148635864, 0.008968232199549675, -0.14596429467201233, -0.28622812032699585, 0.014788422733545303, 0.03617284074425697, 0.44050151109695435, 0.04579213634133339, 0.2262171357870102, 0.6840982437133789, -0.09249597042798996, 0.13637155294418335, 0.19129547476768494, 0.13166512548923492, -0.041820548474788666, -0.2118576020002365, -0.10602562874555588, -0.08613403886556625, 0.2125009000301361, -0.3178165853023529, -0.26296839118003845, 0.35473546385765076, 0.006259021814912558, 0.14139008522033691, -0.1804889440536499, -0.09048037230968475, 0.06282462924718857, 0.2697080969810486, 0.11269891262054443, 0.20420844852924347, 0.056086938828229904, -0.13852649927139282, -0.20300504565238953, 0.015251681208610535, -0.22677461802959442, 0.45148953795433044, -0.22987063229084015, 0.04732881486415863, 0.3283415734767914, -0.04040705785155296, -0.04515301436185837, -0.0092129185795784, 0.3699362576007843, 0.076134592294693, 0.7866380214691162, -0.10313142836093903, -0.020712722092866898, 0.21581795811653137, 0.15508230030536652, -0.08369409292936325, -0.1395696997642517, 0.2248537838459015, -0.07259907573461533, 0.0915466770529747, 0.29453161358833313, 0.14137545228004456, 0.708322286605835, 0.1089647188782692, 0.04472611844539642, -0.08553745597600937, -0.04828869551420212, -0.1427137851715088, 0.31942513585090637, 0.14586538076400757, 0.11381404846906662, 0.24432441592216492, 0.2343640774488449, 0.14759784936904907, -0.09817297011613846, -0.0656544640660286, 0.12219894677400589, 0.0012697074562311172, -0.06988443434238434, 0.423115074634552, -0.20864126086235046, 0.12716349959373474, -0.0015748068690299988, -0.39241236448287964, -0.2408442199230194, -0.13277043402194977, -0.30583804845809937, 0.41899093985557556, 0.13416866958141327, 0.25102242827415466, -0.16698814928531647, 0.006709307432174683, 0.15978042781352997, -0.6780965328216553, -0.28898125886917114, 0.009961026720702648, -0.2868137061595917, -0.09347373247146606, 0.26847386360168457, -0.3612228035926819, 0.29597166180610657, -0.21060314774513245, 0.058174699544906616, -0.17888467013835907, -0.296902596950531, 0.0250533539801836, -0.1173216700553894, 0.6192768812179565, 0.05479619652032852, 0.2199084311723709, 0.2093660682439804, -0.08743322640657425, 0.07211215049028397, -0.07104961574077606, 0.040999896824359894, -0.0398191474378109, 0.05439598113298416, -0.17027254402637482, -0.2764619290828705, -0.2766988277435303, -0.3255559504032135, -0.31596648693084717, 0.04513432830572128, -0.21634386479854584, 0.025778234004974365, 0.16826559603214264, 0.25206223130226135, -0.05452593415975571, 0.2443566769361496, -0.046512722969055176, -0.2048332244157791, -0.2515764832496643, 0.27405837178230286, -0.05648742988705635, -0.20667943358421326, -0.05950295180082321, 0.16812795400619507, 0.15415143966674805, 0.3597888946533203, -0.4254634380340576, -0.06854861974716187, -0.15153434872627258, 0.4692496061325073, -0.03393028676509857, -0.22667665779590607, 0.6091625690460205, -0.06191327050328255, 0.027047062292695045, -0.2075817584991455, -0.33500275015830994, 0.10803130269050598, -0.02585051953792572, 0.17002364993095398, 0.09558065980672836, 0.14031203091144562, 0.021478809416294098, 0.515760600566864, 0.14880597591400146, -0.08838118612766266, 0.17879408597946167, 0.19804315268993378, 0.6143237948417664, -0.005666695535182953, -0.29153749346733093, 0.04821404814720154, -0.24536925554275513, -0.10428435355424881, 0.007027804851531982, 0.147018164396286, -0.204417422413826, -0.1424487978219986, -0.32815948128700256, -0.10169325768947601, -0.25275906920433044, 0.23280489444732666, -0.31231689453125, 0.06299798935651779, 0.21084177494049072, 0.2870442569255829, -0.23681923747062683, -0.1172974556684494, -0.06933397054672241, 0.6562952995300293, -0.22356092929840088, 0.09874740988016129, -0.15407854318618774, 0.08769205957651138, -0.5197451114654541, 0.12694892287254333, -0.04070314019918442, 0.5385594964027405, 0.035413388162851334, 0.055142953991889954, 0.03446168452501297, -0.3676825165748596, 1.0852465629577637, -0.12205513566732407, 0.0688648372888565, 0.12068501114845276, 0.20167525112628937, -0.19891613721847534, -0.21546274423599243, -0.07292670011520386, 0.2947710454463959, 0.16474497318267822, 0.3307080566883087, -0.028632618486881256, -0.39853760600090027, -0.16286879777908325, 0.27895355224609375, -0.11500652134418488, -0.1569463610649109, -0.24212080240249634, -0.23536443710327148, -0.09483637660741806, 0.06425761431455612, -0.03843199461698532, 0.00398225849494338, -0.2460447996854782, 0.015593234449625015, -0.2575436234474182, 0.004183247685432434, -0.06760187447071075, 0.05822690948843956, 0.19712334871292114, -0.1957295835018158, 0.3663656711578369, 0.04609856754541397, 0.06619131565093994, 0.4760605990886688, 0.3568176329135895, -0.41396230459213257, -0.08293923735618591, 0.09055886417627335, -0.14635822176933289, -0.127685546875, 0.4075087010860443, -0.2383767068386078, -0.2483641803264618, -0.1930098831653595, 0.05068473890423775, -0.42578548192977905, 0.0784573033452034, 0.13499629497528076, 0.23759081959724426, -0.261694997549057, -0.25614699721336365, 0.48010683059692383, 0.0982719212770462, -0.27853628993034363, 0.7662410140037537, -0.042761340737342834, -0.3386245369911194, 0.18153363466262817, -0.03534473478794098, 0.6245463490486145, 0.1707591414451599, 0.25679710507392883, 0.18084922432899475, -0.30669254064559937, 0.09414461255073547, -0.03307326138019562, 0.18820156157016754, 0.009315725415945053, -0.1667507290840149, -0.13482965528964996, -0.1269877701997757, 0.10500674694776535, 0.16945523023605347, -0.39652854204177856, 0.2701275050640106, -0.1561567783355713, 0.05512722581624985, 0.10635774582624435, -0.07387527078390121, -0.2138933688402176, -0.3332727253437042, -0.1739072948694229, 0.143934428691864, 0.0881178081035614, 0.4246913492679596, -0.1289369761943817, 0.02456827461719513, -0.2379395216703415, -0.23703940212726593, -0.3720036745071411, 0.2290748953819275, -0.287525475025177, 0.08441236615180969, -0.0016332156956195831, -0.3715948462486267, -0.09842191636562347, 0.14219903945922852, 0.2623521089553833, 0.01223335973918438, -0.20258180797100067, 0.2866654694080353, -0.06051594763994217, 0.16208361089229584, 0.15472987294197083, -0.32123494148254395, 0.06013119965791702, 0.08727500587701797, -0.22322121262550354, -0.24153202772140503, -0.44993001222610474, -0.2746394872665405, 0.05303826928138733, 0.19079256057739258, 0.020038418471813202, 0.057821959257125854, -0.07107363641262054, 0.05662839114665985, 0.10019245743751526, -0.16211611032485962, 0.07940364629030228, -0.1854894906282425, 0.36563608050346375, 0.4359610974788666, -0.3782523274421692, -0.2716470956802368, -0.06093877926468849, 0.577707052230835, -0.33281421661376953, -0.1295221447944641, 0.4854796528816223, -0.11697018146514893, -0.1809445172548294, -0.18693330883979797, -0.16225719451904297, -0.5565851926803589, -0.1605040431022644, -0.02953394502401352, -0.03014599345624447, 0.169142946600914, 0.14143110811710358, -0.20271793007850647, 0.0868268683552742, 0.008808478713035583, -0.0033547766506671906, -0.524338960647583, -0.03930157423019409, -0.04783640801906586, -0.05844410881400108, -0.03273806348443031, -0.008932016789913177, -0.11025436222553253, 0.19946721196174622, -0.19600799679756165, -0.2246531844139099, 0.10120197385549545, -0.1693880558013916, 0.03436639532446861, 0.15112701058387756, -0.132958322763443, 0.3666713535785675, -0.24310939013957977, -0.09353969991207123, -0.06527133285999298, -0.1330794394016266, -0.10701586306095123, -0.3126213550567627, 0.15236729383468628, 0.004723561927676201, -0.0024156663566827774, 0.04393963888287544, -0.36310285329818726, 0.034443970769643784, -0.08482056111097336, 0.3058674931526184, 0.30034083127975464, -0.14085863530635834, -0.10594524443149567, -0.2529614269733429, 0.6175539493560791, -0.08317654579877853, 0.19284935295581818, -0.10886497795581818, 0.07690486311912537, -0.05709763616323471, 0.31222912669181824, 0.04033245891332626, 0.12458519637584686, -0.3024493455886841, 0.1167999655008316, -0.22775976359844208, -0.08308464288711548, 0.1651952564716339, -0.147760272026062, 0.19362740218639374, 0.0564756765961647, 0.02855343371629715, 0.40064188838005066, -0.16702556610107422, -0.14181028306484222, 0.27107295393943787, 0.1708960086107254, -0.12136451154947281, -0.1844535619020462, -0.22801989316940308, 0.06538890302181244, 0.04749658331274986, 0.15835866332054138, 0.2423802614212036, -0.5154857635498047, 0.32778483629226685, 0.1843092143535614, 0.811604380607605, -0.17862822115421295, 0.0683990865945816, 0.5087781548500061, 0.14717650413513184, 0.39691591262817383, 0.33791980147361755, 0.15474121272563934, 0.02554226666688919, 0.5745882391929626, 0.02163192629814148, 0.27389898896217346, 0.14384981989860535, 0.093210369348526, -0.2339087426662445, -0.4939320385456085, -0.026985693722963333, -0.07293088734149933, -0.12237149477005005, 0.16703426837921143, -0.13358518481254578, 0.29400208592414856, -0.5855459570884705, -0.2348700910806656, -0.295979380607605, -0.06881257891654968, -0.13535815477371216, -0.22724469006061554, 0.011158112436532974, -0.024966396391391754, 0.2784901261329651, 0.0478636808693409, 0.02236616425216198, -0.31920790672302246, 0.39533916115760803, -0.05019208788871765, -0.2723889946937561, -0.4287022650241852, -0.20213520526885986, 0.012700337916612625, -0.16979318857192993, -0.00984397903084755, 0.3430938720703125, 0.27495670318603516, -0.10806545615196228, 0.05821318179368973, 0.14259842038154602, 0.5358486771583557, 0.5044576525688171, -0.0036622118204832077, -0.04877214878797531, 0.11315694451332092, -0.0008535832166671753, -0.11996833980083466, 0.3510358929634094, -0.1070636659860611, -0.2019967883825302, 0.03211888670921326, 0.11060722172260284, -0.09710241854190826, 0.3354793190956116, 0.14821675419807434, 0.22668103873729706, -0.09544132649898529, 0.09305533766746521, 0.002366604283452034, 0.1940343976020813, -0.0938568115234375, 0.08803447335958481, -0.2089996337890625, 0.17980298399925232, 0.44310736656188965, -0.16058531403541565, 0.16669461131095886, 0.16450896859169006, 0.055571794509887695, -0.004872305318713188, 0.35634201765060425, 0.12597469985485077, -0.0059576258063316345, -0.17466720938682556, -0.054370369762182236, -0.5395662784576416, -0.06878539174795151, -0.1866806298494339, 0.09849055111408234, -0.2820136845111847, -0.007039396092295647, 0.013060063123703003, 0.032196834683418274, 0.18237821757793427, -0.11847352236509323, 0.1362943947315216, 0.027241548523306847, -0.5123999714851379, 0.10222187638282776, -0.17000016570091248, 0.180306077003479, 0.05727924406528473, -0.6249794960021973, 0.1367785930633545, 0.21967540681362152, -0.00856710597872734, -0.2087751030921936, 0.015055261552333832, 0.2375306785106659, 0.19207260012626648, 0.40780287981033325, -0.07393407821655273, 0.1610146015882492, 0.1292424499988556, -0.2603732645511627, -0.4927840828895569, 0.022132357582449913, -0.05311830714344978, -0.03603246808052063, 0.01067456416785717, 0.0175456739962101, -0.5066932439804077, -0.22321771085262299, -0.06447571516036987, 0.12094554305076599, 0.08807219564914703, 0.11760731041431427, -0.10146711021661758, 0.12448430806398392, -0.03631282597780228, 0.2562621235847473, 0.0812847763299942, 0.3374520242214203, -0.055190153419971466, 0.19841204583644867, -0.452653169631958, -0.21114633977413177, 0.20644257962703705, -0.5447887182235718, -0.38470712304115295, -0.07953552156686783, 0.05438265576958656, -0.2644142806529999, 0.04319651424884796, -0.3573531210422516, 0.12200107425451279, 0.2409060001373291, -0.11285693198442459, -0.39801761507987976, 0.13771866261959076, -0.137991800904274, 0.02933860942721367, -0.08751984685659409, 0.4050814211368561, 0.05297675356268883, -0.2982284426689148, 0.06538909673690796, -0.16786418855190277 ]
https://github.com/huggingface/datasets/issues/3051
Non-Matching Checksum Error with crd3 dataset
I got the same error for another dataset (`multi_woz_v22`): ``` datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/dialog_acts.json', 'https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/test/dialogues_001.json'] ```
## Describe the bug When I try loading the crd3 dataset (https://huggingface.co/datasets/crd3), an error is thrown. ## Steps to reproduce the bug ```python dataset = load_dataset('crd3', split='train') ``` ## Expected results I expect no error to be thrown. ## Actual results A non-matching checksum error is thrown. ``` datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/RevanthRameshkumar/CRD3/archive/master.zip'] ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0
21
Non-Matching Checksum Error with crd3 dataset ## Describe the bug When I try loading the crd3 dataset (https://huggingface.co/datasets/crd3), an error is thrown. ## Steps to reproduce the bug ```python dataset = load_dataset('crd3', split='train') ``` ## Expected results I expect no error to be thrown. ## Actual results A non-matching checksum error is thrown. ``` datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/RevanthRameshkumar/CRD3/archive/master.zip'] ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0 I got the same error for another dataset (`multi_woz_v22`): ``` datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/dialog_acts.json', 'https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/test/dialogues_001.json'] ```
[ 0.03340288624167442, -0.030284970998764038, 0.0008105486631393433, 0.27887439727783203, 0.017549321055412292, -0.010443992912769318, 0.2656277120113373, 0.32951730489730835, -0.03767433762550354, -0.016887187957763672, 0.012735439464449883, 0.14770516753196716, 0.11470737308263779, 0.042760007083415985, -0.11407651007175446, -0.02735740691423416, 0.30246931314468384, 0.05410883575677872, 0.12573885917663574, -0.03285445272922516, -0.10989905893802643, 0.1389317661523819, -0.22769078612327576, 0.01138102263212204, -0.06974749267101288, 0.27818620204925537, 0.003558436408638954, 0.34643444418907166, 0.030311621725559235, -0.09111932665109634, 0.5705820918083191, 0.16126611828804016, 0.1096189022064209, 0.6796618103981018, -0.00011451162572484463, -0.05144120752811432, 0.3022957444190979, -0.1902942657470703, -0.13869594037532806, -0.31958335638046265, -0.4316028356552124, -0.29201042652130127, -0.07188931852579117, -0.22481366991996765, 0.02597818896174431, 0.29919788241386414, -0.2701683044433594, -0.01581568270921707, -0.001476570963859558, -0.14091013371944427, 0.21364766359329224, 0.6153892278671265, 0.11703793704509735, 0.12210392951965332, 0.0792810320854187, 0.12033915519714355, 0.02319357357919216, 0.604029655456543, 0.36903876066207886, -0.05617237091064453, -0.02194930613040924, 0.14424529671669006, -0.3300771415233612, 0.18670780956745148, 0.16528907418251038, -0.022461581975221634, -0.27848002314567566, 0.059347573667764664, -0.023262567818164825, 0.6013777256011963, 0.05445867031812668, -0.29381611943244934, -0.3598981201648712, -0.11702559888362885, -0.09463731944561005, -0.4865976870059967, 0.33690449595451355, 0.18653200566768646, -0.13417315483093262, -0.10148373246192932, -0.5206212997436523, 0.19679199159145355, 0.0010656267404556274, 0.15698279440402985, 0.040520571172237396, 0.07636232674121857, 0.06586714088916779, -0.041171617805957794, 0.11331719160079956, -0.22264264523983002, 0.19441451132297516, -0.2851199805736542, -0.23041552305221558, 0.00468690088018775, -0.6093118786811829, -0.2500113248825073, -0.2335205376148224, 0.5036349296569824, 0.4081352651119232, 0.3797473907470703, -0.024629056453704834, 0.18810591101646423, 0.05002709850668907, 0.025339795276522636, 0.13910581171512604, 0.13560357689857483, -0.0616217777132988, 0.3133069574832916, 0.18283796310424805, 0.3394800126552582, -0.0898902639746666, 0.1667274832725525, -0.026458248496055603, -0.16923224925994873, 0.6086750626564026, 0.056260112673044205, 0.12358666956424713, -0.33848753571510315, -0.062368206679821014, 0.27062591910362244, 0.06378716975450516, -0.035183731466531754, 0.07919918745756149, 0.267813503742218, -0.22246341407299042, 0.14127092063426971, -0.11288555711507797, 0.3238127827644348, -0.2578122615814209, 0.0398007407784462, -0.1379939466714859, -0.14287802577018738, -0.11019307374954224, -0.043378911912441254, 0.17685846984386444, -0.19178879261016846, 0.37683796882629395, -0.1522655040025711, 0.40747153759002686, -0.010665476322174072, 0.0010702461004257202, 0.04620279371738434, -0.004266634583473206, 0.2696414291858673, 0.03731922432780266, 0.1827981024980545, 0.1469237059354782, 0.15441539883613586, 0.0166846364736557, 0.028367724269628525, -0.26795777678489685, -0.26808878779411316, -0.3479527533054352, 0.19909454882144928, -0.7517383694648743, -0.10567803680896759, -0.03989254683256149, -0.4248097240924835, 0.2718977928161621, -0.23943479359149933, 0.01640007644891739, -0.31643950939178467, -0.2812267541885376, -0.25705763697624207, 0.14655160903930664, 0.10599158704280853, 0.017246339470148087, 0.2588038146495819, -0.22201260924339294, -0.14208871126174927, 0.217444509267807, 0.22614017128944397, -0.0803292915225029, -0.29991936683654785, -0.24283768236637115, 0.09699957072734833, 0.07129684090614319, -0.5103926658630371, -0.5260888338088989, 0.08777053654193878, 0.04511556774377823, 0.34694743156433105, -0.07944872230291367, 0.1229037269949913, -0.08315274119377136, -0.2634938061237335, 0.24119330942630768, 0.08551211655139923, 0.012057797983288765, 0.2704756259918213, -0.0931820273399353, -0.19505414366722107, 0.20554274320602417, 0.1910841017961502, -0.05103455111384392, -0.1572391390800476, 0.06128934025764465, -0.18090611696243286, 0.4714624583721161, -0.1275041699409485, -0.13054020702838898, 0.031462691724300385, 0.5298318862915039, -0.023117348551750183, 0.12067905813455582, -0.14741560816764832, -0.4394855499267578, 0.46068963408470154, -0.11430498212575912, -0.1152108758687973, -0.04712291061878204, 0.08502800762653351, -0.2308354377746582, -0.14280937612056732, -0.44975337386131287, 0.20973505079746246, 0.11445829272270203, 0.07793385535478592, 0.02320791408419609, -0.21813373267650604, -0.2973216474056244, -0.055293887853622437, -0.30068275332450867, 0.11302489787340164, -0.26259493827819824, 0.2755218744277954, -0.15370625257492065, -0.15744319558143616, 0.0881766527891159, 0.2783002257347107, 0.06601890176534653, -0.03982231393456459, -0.19735285639762878, 0.4403562545776367, 0.1893942952156067, 0.17836779356002808, -0.22121107578277588, 0.17437270283699036, -0.020557323470711708, -0.5043706893920898, -0.19723190367221832, 0.22227439284324646, 0.14450578391551971, -0.0836564302444458, 0.15426458418369293, 0.32565921545028687, 0.04699406027793884, 0.20123696327209473, -0.11874302476644516, -0.024420712143182755, 0.08098214864730835, -0.3183217942714691, -0.10434870421886444, -0.3143835663795471, 0.3306579291820526, 0.0669424757361412, -0.049843478947877884, 0.36442285776138306, -0.14339639246463776, -0.23643800616264343, 0.2562747895717621, -0.1630934625864029, 0.01664286106824875, -0.026204913854599, 0.05260520800948143, 0.01611461117863655, -0.13653871417045593, 0.5215741395950317, 0.3676491379737854, 0.07599817961454391, -0.055629175156354904, 0.2547420859336853, -0.16848288476467133, 0.005110643804073334, -0.13276228308677673, 0.030812405049800873, 0.44133687019348145, 0.57462477684021, 0.09183510392904282, -0.061450887471437454, -0.13598409295082092, -0.15001127123832703, 0.03185702860355377, 0.09726586937904358, -0.4689371883869171, -0.0825086385011673, -0.34727656841278076, -0.05206563323736191, -0.2333788424730301, -0.4814291000366211, -0.42524752020835876, -0.14128176867961884, -0.20880724489688873, 0.2533639669418335, -0.10315358638763428, 0.12411858141422272, -0.5149744749069214, -0.26651179790496826, -0.004768857732415199, -0.2358534187078476, 0.04122646898031235, -0.11649090051651001, -0.09868840128183365, 0.0302724689245224, 0.35840198397636414, -0.12359104305505753, 0.314186155796051, -0.39316755533218384, -0.12736232578754425, -0.26888370513916016, -0.22751760482788086, 0.07517435401678085, 0.030365806072950363, 0.20229575037956238, 0.38871029019355774, 0.017629578709602356, 0.17748194932937622, -0.33410879969596863, 0.23671050369739532, -0.03420417755842209, -0.43321511149406433, 0.4542858898639679, -0.033808302134275436, -0.04390401020646095, 0.1590164452791214, 0.10341332852840424, 0.025546377524733543, -0.1891104280948639, -0.22712300717830658, -0.16170240938663483, 0.17509573698043823, 0.30502745509147644, -0.05882365629076958, 0.17375674843788147, -0.2385278046131134, 0.2457221895456314, -0.0914771631360054, -0.393035888671875, 0.44733771681785583, 0.1348593533039093, -0.38944119215011597, -0.0014067068696022034, -0.13811095058918, 0.20237794518470764, 0.01792682707309723, -0.20599764585494995, -0.2789627015590668, -0.31913694739341736, -0.20408207178115845, 0.26968759298324585, -0.1908818483352661, 0.10369934141635895, -0.1405058354139328, 0.011664608493447304, -0.30164462327957153, -0.28971871733665466, 0.08661869913339615, 0.1963249146938324, 0.5354511737823486, -0.030656609684228897, 0.18457159399986267, -0.0003153868019580841, 0.4918307065963745, 0.5818004608154297, -0.2668004631996155, 0.15586203336715698, 0.19741037487983704, 0.39840713143348694, 0.04787224903702736, -0.3073433041572571, -0.21979893743991852, -0.0746401697397232, 0.042439743876457214, 0.006963625550270081, -0.07723834365606308, -0.251804918050766, -0.16406357288360596, -0.07613464444875717, -0.2413388192653656, -0.14725416898727417, -0.2817534804344177, -0.09849593043327332, 0.13733717799186707, 0.15617896616458893, -0.12067566812038422, 0.041956741362810135, -0.3562523424625397, 0.11944551765918732, 0.40228015184402466, -0.07361648231744766, -0.11208705604076385, -0.41789326071739197, -0.3026033639907837, -0.02326875925064087, 0.10303408652544022, 0.2641526758670807, 0.5432683229446411, -0.011030182242393494, -0.2413651943206787, -0.13393203914165497, 0.028569649904966354, 0.3009071350097656, -0.39852383732795715, 0.49802082777023315, 0.09191238880157471, -0.07598836719989777, -0.2152976095676422, -0.16842231154441833, -0.037853747606277466, -0.2864679992198944, 0.26015374064445496, 0.4639976918697357, -0.172916442155838, 0.06402003765106201, 0.34431853890419006, 0.28656360507011414, -0.1134779304265976, -0.5530337691307068, -0.3458951711654663, -0.18484696745872498, -0.24670451879501343, -0.10026087611913681, 0.00532233901321888, 0.3299517333507538, 0.08851279318332672, -0.1757301688194275, 0.22675080597400665, -0.0815896987915039, 0.2870306074619293, 0.022899441421031952, 0.23052498698234558, 0.118827223777771, 0.2738531231880188, -0.08755272626876831, 0.04453076049685478, 0.1940036118030548, 0.6567084789276123, 0.00080147385597229, -0.28959834575653076, -0.0030074194073677063, -0.10706562548875809, 0.1876068115234375, 0.09596739709377289, 0.1396375149488449, 0.09237299859523773, 0.30147242546081543, 0.06226664036512375, -0.06090615317225456, -0.22425690293312073, 0.12645331025123596, 0.08032898604869843, -0.41943812370300293, 0.10325489193201065, -0.06976527720689774, -0.14870436489582062, 0.08218640089035034, -0.006251759827136993, 0.07718728482723236, 0.008255199529230595, 0.3140617609024048, 0.17715200781822205, 0.664598822593689, 0.1075541228055954, 0.06186345964670181, 0.11169057339429855, -0.3412669897079468, 0.11078804731369019, 0.33674710988998413, -0.15494073927402496, -0.49844908714294434, -0.4148849844932556, -0.07168411463499069, -0.3204643130302429, -0.046978749334812164, -0.051300518214702606, 0.1438843011856079, 0.30138295888900757, -0.20225556194782257, 0.08061893284320831, 0.10358890891075134, -0.018768366426229477, -0.08920489996671677, 0.05238888040184975, -0.0068013835698366165, 0.08288442343473434, 0.00189223513007164, 0.23219171166419983, -0.08850587904453278, -0.010066801682114601, -0.05726272612810135, -0.13917069137096405, -0.3488491177558899, 0.21831649541854858, 0.12558619678020477, -0.06991720199584961, 0.3373051881790161, -0.13575978577136993, 0.04474492743611336, 0.37050941586494446, 0.39497870206832886, -0.07674705982208252, -0.22938427329063416, 0.022054269909858704, 0.4280363917350769, 0.20025643706321716, 0.21273376047611237, -0.27178722620010376, 0.4802936613559723, -0.11209192872047424, -0.3026740849018097, -0.02186727523803711, 0.0027175815775990486, -0.4494338631629944, 0.2286897599697113, -0.11124633252620697, -0.27765941619873047, -0.2815743088722229, -0.0006896085105836391, -0.28536924719810486, 0.30930739641189575, -0.16288025677204132, 0.11923938989639282, 0.26956552267074585, -0.16607587039470673, 0.1663564145565033, 0.19373270869255066, -0.35611283779144287, 0.036935772746801376, 0.43000003695487976, 0.06215773895382881, -0.06652375310659409, 0.3255423307418823, 0.29940587282180786, -0.025297090411186218, -0.06130211427807808, -0.05402572453022003, 0.04958098754286766, -0.3041824400424957, -0.06433435529470444, -0.07184652984142303, 0.23736809194087982, 0.07978276163339615, 0.5024495124816895, 0.6045321822166443, -0.16286250948905945, 0.10558082163333893, -0.49558594822883606, -0.008707686327397823, 0.09616754949092865, 0.06258383393287659, 0.22943349182605743, -0.2789462208747864, -0.08791488409042358, 0.09874342381954193, -0.0656987726688385, -0.2721959352493286, 0.04268378019332886, -0.23912784457206726, -0.06674666702747345, -0.21559618413448334, -0.045320212841033936, 0.056600719690322876, 0.020540302619338036, 0.1327054500579834, -0.21741941571235657, -0.2873232364654541, -0.1718061864376068, -0.25428375601768494, 0.12094932794570923, 0.21687132120132446, -0.19896259903907776, 0.23745450377464294, -0.13780753314495087, 0.0008281301707029343, -0.0710931271314621, -0.056397516280412674, 0.21815666556358337, 0.035359881818294525, 0.2487182766199112, 0.015818413347005844, -0.058718033134937286, -0.13682115077972412, 0.005548952147364616, -0.3249952793121338, -0.09366728365421295, 0.05832863226532936, -0.16574105620384216, -0.025622418150305748, -0.03545474633574486, 0.5926001667976379, 0.0344325415790081, -0.18727760016918182, -0.13840335607528687, 0.4624241888523102, -0.2961350679397583, -0.04584485664963722, 0.2838658392429352, 0.6900956630706787, -0.015072032809257507, -0.4808615744113922, -0.01038952637463808, 0.19405308365821838, 0.25147342681884766, -0.38913869857788086, -0.04579991474747658, 0.1631801724433899, 0.2474004328250885, -0.06969425082206726, 0.14426876604557037, 0.1797536313533783, -0.44471046328544617, 0.3277699947357178, 0.09148700535297394, 0.3664025068283081, -0.12663589417934418, 0.3067700266838074, 0.2992963194847107, -0.15033793449401855, 0.07946083694696426, 0.3732280433177948, -0.23374289274215698, 0.16214647889137268, -0.17050276696681976, 0.2674781084060669, 0.3092869520187378, -0.4292389750480652, 0.41108402609825134, -0.03628777712583542, -0.4532466232776642, 0.5778861045837402, 0.17885470390319824, 0.11076138913631439, 0.005198981612920761, -0.002631843090057373, 0.33631566166877747, -0.15947599709033966, 0.37956157326698303, -0.6557053327560425, -0.09419111907482147, 0.0033920519053936005, 0.014703299850225449, -0.2553352117538452, -0.20905724167823792, 0.13654384016990662, 0.16484218835830688, -0.010567665100097656, 0.09803526103496552, 0.12832024693489075, 0.16005387902259827, -0.14605717360973358, -0.37083613872528076, -0.036291591823101044, 0.2408042848110199, -0.08288522809743881, -0.23789037764072418, 0.16002339124679565, 0.14404015243053436, -0.25195902585983276, 0.26759135723114014, 0.4292094111442566, 0.3130858838558197, 0.27154117822647095, 0.19283001124858856, -0.022886041551828384, -0.03600709140300751, 0.12056872248649597, 0.027624625712633133, 0.60334312915802, -0.003160417079925537, 0.019276320934295654, 0.3895103633403778, 0.12967543303966522, -0.08184703439474106, -0.13837678730487823, -0.138960599899292, -0.19501467049121857, -0.17633193731307983, 0.3944876194000244, -0.06752067059278488, 0.22052106261253357, -0.10239042341709137, 0.22684216499328613, -0.455697238445282, -0.17759576439857483, 0.35763663053512573, 0.026752149686217308, 0.10401425510644913, 0.026973091065883636, 0.07663439214229584, -0.10101613402366638, 0.3395235538482666, 0.2355971336364746, -0.3532710671424866, -0.15543942153453827, -0.24742932617664337, -0.7105352878570557, 0.43451401591300964, -0.014175280928611755, 0.1309184432029724, 0.2559306025505066, 0.008780071511864662, -0.032540880143642426, 0.04390726238489151, 0.3001854717731476, 0.04054880887269974, -0.3438164293766022, -0.002232789993286133, -0.1407422423362732, -0.29971086978912354, -0.22209884226322174, -0.2371889352798462, -0.13199864327907562, -0.05258253961801529, 0.09883178770542145, -0.061432693153619766, 0.051901161670684814, -0.022968720644712448, -0.08474123477935791, 0.1421307623386383, 0.07004500925540924, 0.04959432780742645, 0.12038933485746384, 0.7381628751754761, 0.23430275917053223, 0.07892186939716339, -0.02742808684706688, 0.004882788751274347, -0.2355143278837204, 0.26054665446281433, -0.27299976348876953, 0.2373894453048706, 0.10968390852212906, 0.24504335224628448, -0.20916910469532013, 0.13446471095085144, 0.10086481273174286, -0.4154052138328552, -0.2196984738111496, 0.23545129597187042, 0.04118432104587555, -0.07259650528430939, 0.11659297347068787, 0.011547908186912537, 0.060813724994659424, 0.2826828360557556, -0.05858864262700081, -0.35087573528289795, 0.43622469902038574, -0.29532453417778015, -0.02483668364584446, -0.14223185181617737, 0.24638678133487701, -0.456437349319458, -0.15465383231639862, -0.6119272112846375, 0.08400725573301315, 0.3477492332458496, 0.1153378039598465, 0.04667289927601814, 0.26497867703437805, -0.3448960483074188, 0.141226127743721, 0.05919039621949196, 0.3437691926956177, -0.05685674399137497, -0.2160535454750061, 0.011286109685897827, -0.02473367378115654 ]
https://github.com/huggingface/datasets/issues/3051
Non-Matching Checksum Error with crd3 dataset
I'm seeing the same issue as @RylanSchaeffer: Python 3.7.11, macOs 11.4 datasets==1.14.0 fails on: ```python dataset = datasets.load_dataset("multi_woz_v22") ```
## Describe the bug When I try loading the crd3 dataset (https://huggingface.co/datasets/crd3), an error is thrown. ## Steps to reproduce the bug ```python dataset = load_dataset('crd3', split='train') ``` ## Expected results I expect no error to be thrown. ## Actual results A non-matching checksum error is thrown. ``` datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/RevanthRameshkumar/CRD3/archive/master.zip'] ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0
19
Non-Matching Checksum Error with crd3 dataset ## Describe the bug When I try loading the crd3 dataset (https://huggingface.co/datasets/crd3), an error is thrown. ## Steps to reproduce the bug ```python dataset = load_dataset('crd3', split='train') ``` ## Expected results I expect no error to be thrown. ## Actual results A non-matching checksum error is thrown. ``` datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/RevanthRameshkumar/CRD3/archive/master.zip'] ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.4.0-173-generic-x86_64-with-Ubuntu-16.04-xenial - Python version: 3.6.10 - PyArrow version: 5.0.0 I'm seeing the same issue as @RylanSchaeffer: Python 3.7.11, macOs 11.4 datasets==1.14.0 fails on: ```python dataset = datasets.load_dataset("multi_woz_v22") ```
[ -0.005089081823825836, -0.07409773766994476, 0.011576797813177109, 0.21421925723552704, 0.04465484991669655, -0.08151564002037048, 0.21991552412509918, 0.2908579707145691, -0.020732548087835312, -0.0038820505142211914, 0.039317719638347626, 0.2184228003025055, -0.0073492927476763725, 0.11655006557703018, -0.19072437286376953, -0.0479838028550148, 0.3433540463447571, 0.05681060999631882, 0.027032241225242615, -0.014672089368104935, -0.12174810469150543, 0.18975567817687988, -0.22624285519123077, -0.01760086417198181, -0.011453458108007908, 0.31414252519607544, -0.12653280794620514, 0.33033832907676697, -0.014303265139460564, -0.060122523456811905, 0.6190880537033081, 0.1798831671476364, 0.13003812730312347, 0.6831795573234558, -0.00011634695692919195, -0.047545917332172394, 0.2488114833831787, -0.17165978252887726, -0.11606545746326447, -0.378293514251709, -0.3892389237880707, -0.3070966601371765, -0.00622108718380332, -0.18760839104652405, -0.01639021560549736, 0.25982898473739624, -0.24556522071361542, 0.06987369060516357, 0.10473345220088959, -0.00019546691328287125, 0.20715701580047607, 0.659168004989624, 0.11599379777908325, 0.05957508459687233, 0.08076955378055573, 0.15340644121170044, 0.0017084311693906784, 0.5446960926055908, 0.340349406003952, -0.21830111742019653, 0.04401478171348572, 0.17297184467315674, -0.2633568346500397, 0.16579768061637878, 0.1468818187713623, -0.054348334670066833, -0.23992574214935303, 0.08052907884120941, -0.02128373458981514, 0.5182216167449951, 0.05914384871721268, -0.23465192317962646, -0.4316554069519043, -0.10214582085609436, -0.06641914695501328, -0.5562384128570557, 0.38218066096305847, 0.20152056217193604, -0.15668587386608124, -0.07767347991466522, -0.48797956109046936, 0.2152165174484253, 0.0006522089242935181, 0.21968084573745728, -0.10585449635982513, 0.08627542108297348, 0.03026396408677101, -0.045701779425144196, 0.20739620923995972, -0.1850510686635971, 0.2528303861618042, -0.2778700888156891, -0.1077200174331665, 0.0007031168788671494, -0.631820797920227, -0.25228017568588257, -0.2542661130428314, 0.5570594668388367, 0.3400399088859558, 0.31215327978134155, -0.19017350673675537, 0.17666375637054443, -0.009892062284052372, 0.009495742619037628, 0.08965647220611572, 0.06758557260036469, -0.20682749152183533, 0.29103773832321167, 0.24826321005821228, 0.32549527287483215, -0.14019928872585297, 0.14371180534362793, -0.03614426776766777, -0.13213375210762024, 0.5210403203964233, 0.002048121765255928, 0.13664136826992035, -0.3246912956237793, -0.12775997817516327, 0.21064069867134094, 0.1474871039390564, -0.04803922772407532, -0.05224543437361717, 0.3029040992259979, -0.25189894437789917, 0.18744713068008423, -0.09021538496017456, 0.3765104413032532, -0.3248195946216583, 0.10314678400754929, -0.13500848412513733, -0.19898638129234314, -0.1647201031446457, -0.051890723407268524, 0.15424717962741852, -0.18947970867156982, 0.3332676887512207, -0.12819765508174896, 0.25184372067451477, 0.016721211373806, -0.02204304188489914, 0.08704626560211182, 0.013177983462810516, 0.3861893117427826, -0.018206659704446793, 0.19350862503051758, 0.15410462021827698, 0.2382921427488327, -0.028640437871217728, 0.10507568717002869, -0.3319671154022217, -0.2624967098236084, -0.3806231617927551, 0.17721125483512878, -0.7136680483818054, -0.1537102907896042, -0.1200045719742775, -0.39858898520469666, 0.2354293167591095, -0.0649566650390625, -0.0567610040307045, -0.4134116768836975, -0.3182624876499176, -0.25999894738197327, 0.11673612147569656, 0.020681098103523254, 0.0420244000852108, 0.29876551032066345, -0.3632180392742157, -0.11637508869171143, 0.24285230040550232, 0.21505816280841827, -0.0810532420873642, -0.34256404638290405, -0.2393650859594345, -0.08932049572467804, 0.2158227562904358, -0.5109856724739075, -0.46609580516815186, 0.011856293305754662, 0.06606762111186981, 0.34864795207977295, -0.04306698590517044, 0.0808350220322609, -0.2013576626777649, -0.14148278534412384, 0.14949731528759003, 0.0776481032371521, -0.026158152148127556, 0.22406160831451416, -0.0761469304561615, -0.22416017949581146, 0.2241111397743225, 0.32589593529701233, 0.04611610993742943, -0.13710549473762512, 0.008466772735118866, -0.28845661878585815, 0.4022698998451233, -0.18504860997200012, -0.21573065221309662, -0.003118865191936493, 0.6294671297073364, -0.025984100997447968, 0.1472247987985611, -0.13302651047706604, -0.3578473627567291, 0.454534113407135, 0.15521728992462158, -0.07839243113994598, -0.04710263013839722, 0.12165369093418121, -0.17413684725761414, -0.09997574985027313, -0.41206082701683044, 0.19045968353748322, 0.04893731325864792, 0.05913343280553818, 0.03702738508582115, -0.15256328880786896, -0.34690040349960327, 0.03505707532167435, -0.32843276858329773, 0.15729276835918427, -0.2522120475769043, 0.28879252076148987, -0.16828680038452148, -0.11934623122215271, 0.09626147150993347, 0.28298383951187134, -0.04799748212099075, -0.02466711401939392, -0.16314512491226196, 0.3613804578781128, 0.2994857728481293, 0.07812261581420898, -0.2115117609500885, 0.2738594114780426, -0.061272069811820984, -0.5040168166160583, -0.18606460094451904, 0.19622802734375, 0.050908882170915604, -0.012096606194972992, 0.10281151533126831, 0.35872066020965576, 0.15289519727230072, 0.16314134001731873, -0.08002755790948868, -0.04558819532394409, 0.09362945705652237, -0.30368587374687195, -0.07613370567560196, -0.2706749737262726, 0.3285456597805023, -0.11248636245727539, -0.04609568044543266, 0.253823459148407, -0.17337995767593384, -0.1929420828819275, 0.26532262563705444, -0.1394602656364441, -0.0033854618668556213, 0.02532336674630642, 0.09859082847833633, 0.07494910806417465, -0.13291068375110626, 0.5222578048706055, 0.46656644344329834, 0.030896726995706558, -0.047724802047014236, 0.3658861517906189, -0.2190232127904892, -0.008234888315200806, -0.14650475978851318, 0.03916691616177559, 0.3142393231391907, 0.4739100933074951, 0.16975532472133636, -0.1059722900390625, -0.16504940390586853, -0.14302709698677063, 0.006073925644159317, 0.1290055513381958, -0.4080837666988373, 0.022175492718815804, -0.3125743269920349, -0.06951624155044556, -0.31030938029289246, -0.3648858368396759, -0.43919214606285095, -0.20650584995746613, -0.16774411499500275, 0.3744708001613617, -0.09961062669754028, 0.0897783413529396, -0.46556955575942993, -0.23006369173526764, 0.018181921914219856, -0.19042952358722687, 0.09388040006160736, -0.14773684740066528, -0.0599839985370636, 0.017727959901094437, 0.31803083419799805, -0.22509409487247467, 0.3155868649482727, -0.41396981477737427, -0.1411271095275879, -0.22584043443202972, -0.29346758127212524, 0.024661218747496605, -0.06408199667930603, 0.11825648695230484, 0.43677324056625366, -0.011650927364826202, 0.1331200897693634, -0.2618659734725952, 0.27566784620285034, -0.09513339400291443, -0.40101197361946106, 0.3309478461742401, -0.0003836670075543225, -0.01885093003511429, 0.1426868885755539, 0.09191175550222397, -0.013398243114352226, -0.16589447855949402, -0.20250503718852997, -0.14061330258846283, 0.1450514942407608, 0.2710610032081604, 0.01667702943086624, 0.06339911371469498, -0.17884142696857452, 0.14159297943115234, -0.1459106057882309, -0.36920037865638733, 0.4389454126358032, 0.13447992503643036, -0.4036252796649933, 0.02267727628350258, -0.10810165107250214, 0.2670496702194214, 0.10230298340320587, -0.3367684483528137, -0.32806524634361267, -0.3281984031200409, -0.14486907422542572, 0.2304752767086029, -0.01845519430935383, 0.03753063455224037, -0.14749200642108917, 0.022609619423747063, -0.3131788969039917, -0.22075557708740234, 0.03490963205695152, 0.2063782513141632, 0.5681164860725403, 0.015653688460588455, 0.1972702145576477, -0.03919639438390732, 0.6299882531166077, 0.48860031366348267, -0.3487399220466614, 0.20947594940662384, 0.14578431844711304, 0.5094376802444458, 0.06094964221119881, -0.2720980644226074, -0.24814453721046448, 0.021858662366867065, 0.0893111526966095, 0.03725074976682663, -0.05577516555786133, -0.22525948286056519, -0.18128016591072083, 0.0004068426787853241, -0.17241284251213074, -0.10063346475362778, -0.19954398274421692, -0.09863892197608948, 0.1369965672492981, 0.18447856605052948, -0.01937486231327057, 0.010975208133459091, -0.4018790125846863, 0.13354353606700897, 0.4339218735694885, -0.07120945304632187, -0.13015136122703552, -0.45673486590385437, -0.37591877579689026, -0.1315048336982727, 0.05288926512002945, 0.19743408262729645, 0.6308585405349731, -0.01215992122888565, -0.2610688805580139, -0.09917466342449188, 0.03695853427052498, 0.3243790864944458, -0.44235700368881226, 0.39213186502456665, 0.117306187748909, -0.14717622101306915, -0.2535173296928406, -0.23808592557907104, -0.03030654415488243, -0.25873759388923645, 0.14872634410858154, 0.5297451019287109, -0.04504138603806496, 0.08821570873260498, 0.2290937453508377, 0.3448108434677124, -0.08944712579250336, -0.5922753810882568, -0.40384429693222046, -0.18909624218940735, -0.2256617695093155, -0.06698555499315262, 0.028841128572821617, 0.2913806438446045, -0.03348302096128464, -0.13729536533355713, 0.16317608952522278, -0.06459058076143265, 0.2749316692352295, 0.09642395377159119, 0.16339972615242004, -0.017402522265911102, 0.2675376832485199, -0.10303610563278198, -0.004329502582550049, 0.21978329122066498, 0.7649175524711609, -0.13578370213508606, -0.389575332403183, 0.027283404022455215, -0.07818889617919922, 0.17986737191677094, 0.10574765503406525, 0.11613255739212036, 0.005638651549816132, 0.27007612586021423, 0.03665068373084068, -0.13235217332839966, -0.1129712462425232, 0.09308162331581116, 0.13095608353614807, -0.45387279987335205, 0.09412070363759995, -0.053940676152706146, -0.033867646008729935, 0.09934957325458527, 0.09940572082996368, 0.15468469262123108, 0.03549819439649582, 0.4003450870513916, 0.10835789144039154, 0.6197338104248047, -0.004230044782161713, 0.1421213448047638, 0.03162583336234093, -0.3229609727859497, 0.18832452595233917, 0.27282339334487915, -0.08911344408988953, -0.576612651348114, -0.5150699019432068, -0.09138664603233337, -0.36653321981430054, -0.0718403235077858, -0.04131544381380081, 0.20595556497573853, 0.3735155165195465, -0.1509818732738495, 0.22890280187129974, 0.05673191696405411, -0.04838479682803154, -0.08718927949666977, 0.08698093891143799, -0.1610415130853653, 0.0924542099237442, 0.088985875248909, 0.2732979953289032, -0.07096768915653229, 0.09024780243635178, -0.10232618451118469, -0.08863064646720886, -0.3531256318092346, 0.17437976598739624, 0.06809666752815247, -0.1038098856806755, 0.42746976017951965, -0.10140710324048996, 0.015012387186288834, 0.3385583460330963, 0.5392104387283325, -0.04638206586241722, -0.2269175946712494, 0.09509170055389404, 0.342487633228302, 0.20696915686130524, 0.23913952708244324, -0.2178245633840561, 0.45151057839393616, -0.07997556775808334, -0.23115476965904236, 0.003142140805721283, 0.009460545144975185, -0.4535365104675293, 0.2614046633243561, -0.16478492319583893, -0.27727484703063965, -0.2220754325389862, -0.03577645123004913, -0.34524863958358765, 0.36674317717552185, -0.126728817820549, 0.0949152410030365, 0.22251494228839874, -0.1006738618016243, 0.2913956642150879, 0.16143418848514557, -0.3517860770225525, 0.032887350767850876, 0.5012181401252747, 0.020474229007959366, -0.06691884994506836, 0.20444519817829132, 0.2938012480735779, 0.013324584811925888, -0.03917401283979416, -0.10223615169525146, 0.1402958184480667, -0.247921884059906, -0.07338722050189972, -0.11160168796777725, 0.22276435792446136, 0.17705151438713074, 0.5714097619056702, 0.5466411709785461, -0.20097675919532776, 0.15101096034049988, -0.4941911995410919, 0.011365985497832298, 0.039111390709877014, 0.01292092353105545, 0.2161870002746582, -0.2087996006011963, -0.1354697197675705, 0.04479600489139557, -0.1803201287984848, -0.24348780512809753, 0.033253274857997894, -0.1735016405582428, -0.09729230403900146, -0.06458763033151627, 0.001981448382139206, 0.08918172121047974, 0.019112467765808105, 0.10928446054458618, -0.20938913524150848, -0.32422390580177307, -0.14209133386611938, -0.18775096535682678, 0.14648811519145966, 0.26406681537628174, -0.1971188336610794, 0.23418483138084412, -0.20967306196689606, -0.09016647934913635, -0.034335896372795105, 0.02952718734741211, 0.171076238155365, -0.0723402351140976, 0.23671235144138336, -0.06357337534427643, -0.018579699099063873, -0.07976724952459335, 0.02579459175467491, -0.31936490535736084, -0.07242712378501892, 0.09411968290805817, -0.14046089351177216, -0.042685333639383316, -0.0092354416847229, 0.5155068039894104, 0.030085589736700058, -0.2727084159851074, -0.08459857106208801, 0.3930179476737976, -0.2791416049003601, -0.08339253067970276, 0.2924351692199707, 0.7446174621582031, 0.08644723147153854, -0.45183253288269043, -0.038076773285865784, 0.33071720600128174, 0.21853265166282654, -0.39380285143852234, -0.06396964937448502, 0.16883115470409393, 0.3476950526237488, -0.1060873419046402, 0.21072299778461456, 0.2704901397228241, -0.5005079507827759, 0.31731539964675903, 0.0877910852432251, 0.41771620512008667, -0.12886029481887817, 0.3273768723011017, 0.3125298023223877, -0.1440645307302475, 0.10187716782093048, 0.36257171630859375, -0.2295803725719452, 0.1254706233739853, -0.030894078314304352, 0.19892549514770508, 0.35727494955062866, -0.2605256140232086, 0.34175994992256165, 0.05431949719786644, -0.44885683059692383, 0.5528397560119629, 0.08861487358808517, 0.20461423695087433, -0.040418222546577454, -0.005834832787513733, 0.21838894486427307, -0.19141900539398193, 0.23999878764152527, -0.6124357581138611, -0.05121089890599251, 0.04907611012458801, -0.00758656021207571, -0.07245980203151703, -0.13928933441638947, 0.12473610043525696, 0.23012900352478027, -0.06701125204563141, 0.07165081053972244, 0.27726030349731445, 0.17517708241939545, -0.07691630721092224, -0.38464298844337463, -0.13653412461280823, 0.15302050113677979, -0.037722714245319366, -0.18594223260879517, 0.2137717455625534, 0.08591016381978989, -0.2355920970439911, 0.264110267162323, 0.24204498529434204, 0.335043728351593, 0.22898106276988983, 0.19194190204143524, -0.04056061804294586, -0.08410419523715973, 0.16456128656864166, 0.055544912815093994, 0.6004428267478943, -0.021710067987442017, 0.12015140056610107, 0.3976924419403076, 0.10606583952903748, -0.02585797943174839, -0.1454778015613556, -0.1532963514328003, -0.21360963582992554, -0.20871438086032867, 0.28291231393814087, 0.010619649663567543, 0.23116755485534668, -0.11349204182624817, 0.27482038736343384, -0.38644862174987793, -0.1719774305820465, 0.342652291059494, 0.059806350618600845, 0.09376000612974167, -0.013613130897283554, 0.06268048286437988, -0.12679217755794525, 0.31266289949417114, 0.3529122769832611, -0.2808777093887329, -0.1258004754781723, -0.31418630480766296, -0.6973443627357483, 0.3980836868286133, -0.12365271151065826, 0.06642808765172958, 0.22721907496452332, -0.055351756513118744, -0.03357016295194626, 0.05023900046944618, 0.30306413769721985, 0.10189084708690643, -0.24911290407180786, 0.028400732204318047, -0.19111113250255585, -0.3219303786754608, -0.26813995838165283, -0.3316432237625122, -0.13232436776161194, -0.025549568235874176, 0.10162358731031418, -0.1635759323835373, 0.017164282500743866, -0.035958223044872284, -0.11428956687450409, 0.07997380197048187, 0.18841713666915894, 0.08717299997806549, 0.041692547500133514, 0.7041476964950562, 0.33525481820106506, 0.0020082611590623856, -0.045660775154829025, 0.004108340013772249, -0.2591291666030884, 0.2525123357772827, -0.2784057855606079, 0.25920769572257996, 0.05873682349920273, 0.30664846301078796, -0.21313399076461792, 0.22946560382843018, 0.1685595065355301, -0.3966718316078186, -0.15213045477867126, 0.25456130504608154, 0.05786667764186859, -0.07846993207931519, 0.22307495772838593, 0.04556743800640106, 0.1049247458577156, 0.33871135115623474, -0.08087623864412308, -0.344440221786499, 0.35015326738357544, -0.31038081645965576, -0.06270870566368103, -0.1365370899438858, 0.12180382758378983, -0.3270263075828552, -0.12623457610607147, -0.7784165740013123, 0.06998606771230698, 0.29744672775268555, 0.024925189092755318, 0.051763866096735, 0.2934885025024414, -0.24981126189231873, 0.22482524812221527, 0.055802103132009506, 0.32336676120758057, -0.10177663713693619, -0.2640029191970825, -0.003981374204158783, -0.014262542128562927 ]
https://github.com/huggingface/datasets/issues/3048
Identify which shard data belongs to
Independently of this I think it raises the need to allow multiprocessing during streaming so that we get samples from multiple shards in one batch.
**Is your feature request related to a problem? Please describe.** I'm training on a large dataset made of multiple sub-datasets. During training I can observe some jumps in loss which may correspond to different shards. ![image](https://user-images.githubusercontent.com/715491/136668758-521263aa-a9b2-4ad2-8d22-060b6bf86a1c.png) My suspicion is that either: * some of the sub-datasets are harder for the model than others * some of the sub-datasets are not formatted properly I'd like to identify which shards correspond to those jumps. **Describe the solution you'd like** It would be nice to have a key associated to each data sample or data batch containing details on where the data comes from (shard idx + item idx within the shard). This should be supported both in local and streaming mode. **Describe alternatives you've considered** A fix would be for me to add myself details (shard id, sample id) as part of each data sample. The inconvenient is that it requires users to process/reupload every dataset when they need this feature.
25
Identify which shard data belongs to **Is your feature request related to a problem? Please describe.** I'm training on a large dataset made of multiple sub-datasets. During training I can observe some jumps in loss which may correspond to different shards. ![image](https://user-images.githubusercontent.com/715491/136668758-521263aa-a9b2-4ad2-8d22-060b6bf86a1c.png) My suspicion is that either: * some of the sub-datasets are harder for the model than others * some of the sub-datasets are not formatted properly I'd like to identify which shards correspond to those jumps. **Describe the solution you'd like** It would be nice to have a key associated to each data sample or data batch containing details on where the data comes from (shard idx + item idx within the shard). This should be supported both in local and streaming mode. **Describe alternatives you've considered** A fix would be for me to add myself details (shard id, sample id) as part of each data sample. The inconvenient is that it requires users to process/reupload every dataset when they need this feature. Independently of this I think it raises the need to allow multiprocessing during streaming so that we get samples from multiple shards in one batch.
[ -0.5709904432296753, -0.26962047815322876, -0.04611186310648918, 0.31553298234939575, -0.2868872880935669, -0.20916759967803955, 0.3178080916404724, 0.16253584623336792, -0.17466582357883453, 0.172588050365448, -0.08456344902515411, -0.056304845958948135, -0.19319991767406464, 0.38165855407714844, 0.2079121172428131, -0.19986003637313843, 0.04932592809200287, -0.07955029606819153, 0.17376504838466644, -0.26779693365097046, 0.10071621835231781, -0.015625597909092903, 0.1929815262556076, -0.11849606037139893, -0.26893967390060425, 0.13269080221652985, -0.1220509484410286, -0.017928145825862885, 0.04690839350223541, -0.22423285245895386, 0.28264063596725464, 0.1475595235824585, 0.29183709621429443, -0.013896353542804718, -0.00010923410445684567, -0.07326274365186691, 0.226379856467247, -0.09002185612916946, -0.3096093535423279, 0.011999182403087616, -0.8691808581352234, 0.0032537877559661865, -0.057584360241889954, -0.30024340748786926, -0.120427206158638, 0.260865718126297, 0.11852681636810303, 0.032947055995464325, 0.06941578537225723, 0.02522972598671913, 0.18848496675491333, 0.18016621470451355, -0.04297177493572235, 0.04388861358165741, 0.4896540939807892, 0.4038180112838745, -0.006605938076972961, -0.03408211097121239, 0.25848251581192017, 0.14886517822742462, -0.14017868041992188, 0.4460338354110718, 0.03707682341337204, -0.046360816806554794, 0.1250324547290802, 0.032745443284511566, -0.1728484332561493, -0.1596885472536087, -0.08296776562929153, 0.4981726109981537, 0.08082777261734009, -0.19081372022628784, -0.25436702370643616, -0.25086918473243713, 0.10186800360679626, -0.23451997339725494, -0.028836771845817566, 0.10488742589950562, -0.14437946677207947, 0.12571430206298828, -0.25404539704322815, -0.006928765214979649, -0.19154103100299835, -0.009354926645755768, -0.08787265419960022, 0.005090191960334778, 0.03954295441508293, 0.049333393573760986, -0.01644398644566536, -0.04698805510997772, -0.2272801697254181, 0.023964568972587585, 0.0019553788006305695, -0.08611170202493668, -0.5485097169876099, -0.38095566630363464, -0.003099396824836731, 0.11737601459026337, -0.05908667668700218, 0.1542111337184906, 0.2136579304933548, 0.19816160202026367, 0.08143683522939682, 0.29982057213783264, 0.06078880652785301, 0.03850002586841583, 0.3691857159137726, -0.12794135510921478, -0.1163833737373352, -0.19693824648857117, -0.24512039124965668, -0.05499638617038727, 0.049750760197639465, 0.16832363605499268, -0.040501296520233154, 0.12459395080804825, 0.07759662717580795, 0.03026866540312767, -0.1466994285583496, 0.13459697365760803, -0.09294870495796204, -0.3084983825683594, 0.42972254753112793, 0.1652703434228897, 0.42709872126579285, -0.22020065784454346, -0.49667996168136597, 0.01934557780623436, -0.013464907184243202, -0.4856944680213928, -0.17822478711605072, 0.0875018835067749, -0.15608808398246765, 0.18911029398441315, -0.04518340900540352, -0.11821651458740234, -0.21670237183570862, -0.05126737058162689, 0.17081408202648163, 0.02372768521308899, -0.21274793148040771, -0.04376671835780144, 0.3513396382331848, 0.18520019948482513, -0.297346293926239, -0.07195299118757248, 0.03957061469554901, -0.11691190302371979, -0.3072591722011566, -0.021283775568008423, -0.1907707154750824, -0.35844606161117554, 0.11548637598752975, 0.13654805719852448, -0.25931721925735474, 0.008618712425231934, -0.3699961304664612, 0.4144395887851715, -0.1433682143688202, -0.058584973216056824, 0.06559079885482788, 0.004898011684417725, -0.21874399483203888, -0.2537171542644501, 0.06880167126655579, 0.03648176044225693, -0.3367956876754761, -0.2591068148612976, -0.34861359000205994, -0.3160948157310486, 0.18992769718170166, 0.00041812285780906677, -0.24063807725906372, -0.1886381208896637, 0.09322047233581543, 0.7706629037857056, 0.34094327688217163, 0.00279318168759346, -0.47158995270729065, 0.23235969245433807, -0.2772669196128845, -0.14231707155704498, 0.4000462293624878, 0.37169650197029114, 0.5799992084503174, -0.16283339262008667, 0.02180587500333786, 0.39212656021118164, -0.1520327478647232, -0.05740361660718918, -0.2810748219490051, -0.25402137637138367, -0.5342462658882141, 0.2569099962711334, 0.035037972033023834, -0.15585952997207642, 0.5246925950050354, -0.11785740405321121, 0.11595813930034637, 0.038156844675540924, 0.04973097890615463, -0.04745384305715561, 0.753731906414032, 0.05483771115541458, -0.19980856776237488, -0.4527468681335449, 0.0020751953125, 0.22154328227043152, 0.14771361649036407, -0.08911749720573425, 0.010648131370544434, -0.17777808010578156, -0.0012478511780500412, 0.1311788260936737, 0.022437140345573425, 0.13100653886795044, 0.1884075254201889, 0.2130468338727951, -0.14536046981811523, -0.3276980221271515, -0.24196183681488037, -0.050845369696617126, -0.40286514163017273, -0.06726715713739395, -0.3094097077846527, 0.3224685788154602, 0.20727376639842987, 0.015180777758359909, -0.09013763070106506, 0.15017244219779968, 0.2638183832168579, -0.06627315282821655, 0.06614744663238525, 0.17603662610054016, 0.07741624116897583, 0.3352481722831726, 0.29510724544525146, 0.4660003185272217, 0.0877358689904213, -0.23593631386756897, 0.06123810261487961, -0.12549975514411926, -0.15985848009586334, -0.01555488258600235, -0.11812854558229446, 0.4157893657684326, 0.004196058958768845, 0.11152289062738419, -0.02539438009262085, 0.15430675446987152, 0.06870893388986588, -0.1903565675020218, 0.06778949499130249, -0.4307663142681122, -0.030556570738554, -0.23747418820858002, -0.37739577889442444, 0.19765374064445496, -0.25001609325408936, 0.4033874571323395, 0.28131988644599915, -0.16782009601593018, 0.1705036759376526, 0.2647623121738434, -0.20818769931793213, -0.0473204180598259, 0.2916651964187622, 1.0890599489212036, 0.3623707890510559, 0.2931347191333771, 0.2414592057466507, -0.27884963154792786, -0.03436611220240593, -0.09970854222774506, 0.13029824197292328, -0.044012799859046936, -0.3383913040161133, -0.042716383934020996, 0.031058624386787415, 0.029177788645029068, -0.1062832623720169, 0.09695175290107727, -0.01338148768991232, -0.08346453309059143, -0.21959400177001953, 0.017699597403407097, -0.27818921208381653, -0.06824095547199249, -0.35824164748191833, -0.14154204726219177, -0.03567596152424812, -0.34071704745292664, 0.2814798355102539, 0.05468672141432762, -0.15401782095432281, 0.011906115338206291, 0.24493762850761414, 0.35098618268966675, -0.35548466444015503, 0.16443663835525513, 0.017570994794368744, -0.4776808023452759, 0.171463280916214, 0.1502484381198883, 0.3307827115058899, 0.49140411615371704, 0.4550993740558624, -0.04022059589624405, 0.22299990057945251, -0.24940815567970276, -0.2849803566932678, -0.13062062859535217, -0.1294596642255783, 0.30395257472991943, -0.04809001088142395, 0.28259074687957764, -0.34120237827301025, -0.44816794991493225, 0.09020335972309113, -0.06877496838569641, -0.40401482582092285, 0.1928904503583908, -0.029249396175146103, 0.013222519308328629, 0.20522810518741608, 0.05487116798758507, -0.34810104966163635, -0.09558483958244324, 0.10177326202392578, -0.18340012431144714, 0.43127959966659546, -0.1468970775604248, -0.2735159695148468, -0.1961430311203003, -0.17163081467151642, -0.007054256275296211, -0.13971762359142303, -0.31026434898376465, -0.07685893774032593, -0.21460634469985962, 0.03270568326115608, 0.06690959632396698, 0.07240833342075348, -0.04462398216128349, 0.6150415539741516, 0.008634790778160095, 0.07846708595752716, -0.06715995818376541, 0.0811796486377716, 0.29252898693084717, -0.2237592488527298, 0.19664926826953888, 0.18185943365097046, -0.08219551295042038, 0.015033058822154999, 0.21598775684833527, -0.0804595872759819, 0.2648128271102905, 0.2655801475048065, -0.11244905740022659, 0.13271746039390564, 0.3001616895198822, 1.192667841911316, -0.052253492176532745, -0.535984456539154, -0.012908592820167542, 0.20039069652557373, -0.3027186393737793, 0.0968872606754303, -0.2958995997905731, 0.3622182011604309, -0.14402547478675842, -0.047620564699172974, 0.28297287225723267, -0.13869476318359375, -0.25106772780418396, 0.08092108368873596, -0.05628534033894539, -0.3182063698768616, -0.26930972933769226, 0.3127209544181824, -0.09788283705711365, 0.2486606240272522, -0.13068898022174835, -0.23317912220954895, -0.006816237233579159, -0.20419782400131226, -0.2800928056240082, 0.32663917541503906, 0.2555096447467804, -0.022588828578591347, -0.3671957552433014, -0.2081373780965805, 0.10791406035423279, 0.2176613211631775, 0.1558045893907547, -0.0793929472565651, -0.39475175738334656, -0.3109491169452667, 0.2562364339828491, 0.32678765058517456, 0.04375220835208893, -0.35642167925834656, -0.06231999397277832, -0.2534070312976837, -0.1642589569091797, 0.12316042929887772, 0.10410547256469727, 0.11311276257038116, 0.10520051419734955, -0.08257876336574554, 0.10128292441368103, -0.2535044848918915, 0.13482259213924408, 0.3906770348548889, 0.06928060203790665, -0.18949486315250397, -0.0727502629160881, 0.17612501978874207, 0.25756093859672546, -0.2078186720609665, 0.061294134706258774, 0.10785932093858719, -0.08513747155666351, -0.2338077276945114, 0.03788771107792854, -0.18539945781230927, 0.28749769926071167, 0.3012477159500122, 0.10995490849018097, 0.2435503602027893, -0.03336980566382408, 0.018154967576265335, 0.09410922229290009, 0.3145994246006012, 0.30588778853416443, 0.1370467245578766, 0.22198063135147095, 0.04921552166342735, -0.25409257411956787, 0.2433622181415558, 0.29626932740211487, 0.4304673373699188, 0.08216528594493866, 0.3441934883594513, -0.06517881900072098, -0.095330148935318, -0.43919825553894043, -0.15682446956634521, -0.2865939438343048, -0.03508751839399338, -0.06708861887454987, -0.2501773238182068, 0.6676240563392639, -0.36827611923217773, -0.34204888343811035, 0.04795713350176811, 0.24849411845207214, -0.28026503324508667, 0.5633924007415771, 0.35662171244621277, 1.2156766653060913, -0.03420878201723099, 0.0064438097178936005, -0.2328122854232788, 0.14314471185207367, 0.10152142494916916, -0.131144717335701, 0.13032907247543335, -0.3080962300300598, -0.4437178075313568, -0.23429737985134125, -0.12713541090488434, -0.05391606688499451, 0.47439146041870117, -0.033254511654376984, -0.17494627833366394, 0.01633131504058838, 0.17106808722019196, -0.026078226044774055, -0.12596091628074646, 0.2732933759689331, -0.025728389620780945, 0.02116047404706478, 0.1282266080379486, -0.20548485219478607, 0.078793466091156, 0.10172801464796066, -0.3399680256843567, -0.15114590525627136, 0.2311621457338333, -0.4925209879875183, -0.23707649111747742, 0.018014922738075256, 0.372824490070343, -0.2081666886806488, -0.5107174515724182, -0.18420447409152985, 0.2754856050014496, 0.16824471950531006, -0.1996486932039261, 0.09408532083034515, 0.48417067527770996, 0.2410672903060913, 0.21378542482852936, 0.18619439005851746, -0.34601449966430664, 0.08494529128074646, -0.015011405572295189, -0.28476086258888245, 0.0628136619925499, 0.24432426691055298, -0.36330270767211914, -0.3963221311569214, 0.16959542036056519, -0.05335025489330292, 0.18033862113952637, -0.18028676509857178, -0.010716579854488373, -0.15715543925762177, -0.07135779410600662, 0.12321917712688446, 0.15713879466056824, -0.23430076241493225, 0.20298272371292114, -0.16223189234733582, 0.035531461238861084, -0.18420757353305817, 0.24427631497383118, 0.059663064777851105, 0.2191435992717743, -0.06781021505594254, -0.35278046131134033, -0.23688378930091858, -0.21633705496788025, 0.13278904557228088, 0.09389131516218185, -0.16542908549308777, -0.45983409881591797, -0.1509588211774826, 0.12596695125102997, 0.045307595282793045, -0.12159901857376099, 0.16109150648117065, 0.1574648916721344, -0.35952791571617126, -0.1862756460905075, -0.022817019373178482, 0.10261509567499161, -0.2779836058616638, 0.36084887385368347, -0.4303348958492279, -0.06580877304077148, -0.16656526923179626, 0.6232998371124268, -0.3766641914844513, -0.10566975176334381, -0.1857670396566391, 0.12323980033397675, 0.3630713224411011, 0.20674940943717957, 0.037105266004800797, -0.2000853717327118, -0.0048037804663181305, -0.07138166576623917, 0.08861938118934631, -0.13694626092910767, 0.031630706042051315, 0.11378421634435654, -0.023212697356939316, 0.3925608992576599, -0.5049391388893127, 0.2339238077402115, 0.1211814284324646, -0.07499174028635025, 0.20170697569847107, 0.194045752286911, 0.08837004750967026, 0.30001506209373474, 0.518062174320221, -0.04501577466726303, -0.318445086479187, 0.04042964428663254, 0.3025372624397278, 0.2575621008872986, -0.08050243556499481, -0.008794289082288742, -0.27712956070899963, 0.03725618124008179, 0.09304851293563843, 0.24654975533485413, 0.04140084981918335, -0.03144240379333496, 0.31787824630737305, 0.3396039605140686, -0.12504613399505615, 0.2114395946264267, 0.18147289752960205, -0.11396704614162445, -0.15280504524707794, -0.06465029716491699, -0.0606008842587471, 0.26039639115333557, -0.06062516197562218, -0.2394614964723587, 0.24770185351371765, 0.05149652063846588, -0.03135063126683235, 0.025718756020069122, 0.26702526211738586, 0.23669394850730896, -0.028310194611549377, 0.043584488332271576, 0.033684711903333664, -0.3919065594673157, 0.2259773313999176, 0.31227776408195496, 0.20442666113376617, 0.12970677018165588, 0.27790936827659607, 0.09802789986133575, 0.3557620346546173, 0.3909909129142761, -0.14459091424942017, 0.6853261590003967, -0.03549184650182724, -0.32090941071510315, 0.303250789642334, -0.08718027174472809, 0.011821459978818893, 0.28048741817474365, -0.044511258602142334, 0.18089677393436432, 0.12725290656089783, 0.27245086431503296, -0.017280474305152893, -0.2350519895553589, -0.26194190979003906, 0.13621357083320618, -0.0338224396109581, -0.07749730348587036, -0.33237403631210327, -0.044355567544698715, -0.1944967806339264, -0.16177596151828766, 0.07665978372097015, 0.06736988574266434, 0.35058823227882385, 0.16399680078029633, 0.20707359910011292, 0.17606022953987122, -0.35136908292770386, 0.35811057686805725, 0.3849555552005768, -0.3346799612045288, -0.17530758678913116, 0.099545918405056, 0.03939318284392357, 0.4883693754673004, -0.24768416583538055, 0.013912476599216461, -0.09240441024303436, 0.10762785375118256, 0.3041842579841614, 0.024313580244779587, -0.15060332417488098, -0.1123417541384697, 0.0990525335073471, -0.19266277551651, 0.012941218912601471, 0.32229092717170715, 0.15069232881069183, -0.05156255513429642, 0.25098323822021484, 0.22680355608463287, 0.3264255225658417, -0.2374684363603592, 0.11880935728549957, -0.19507944583892822, -0.21506363153457642, -0.027318455278873444, -0.034379638731479645, -0.24480944871902466, -0.15351544320583344, 0.4103485941886902, -0.1414179503917694, 0.16152042150497437, -0.13868273794651031, 0.09521161764860153, 0.06255708634853363, 0.3045377731323242, 0.06586699932813644, -0.24086403846740723, -0.400349497795105, -0.20540958642959595, -0.5951738357543945, -0.16138797998428345, 0.013110838830471039, 0.08742231130599976, 0.22439777851104736, 0.18022967875003815, 0.26883143186569214, 0.36821866035461426, -0.12411285936832428, -0.5848945379257202, -0.19232337176799774, 0.44750261306762695, -0.39432796835899353, -0.05876675620675087, -0.043280087411403656, -0.2504642903804779, -0.11081144958734512, 0.02405085414648056, 0.3742257356643677, 0.20008333027362823, 0.10048439353704453, -0.09110217541456223, 0.006781928241252899, 0.41887223720550537, -0.08039003610610962, -0.024098411202430725, -0.1850467324256897, 0.3794965445995331, -0.12374352663755417, 0.2619228959083557, 0.09571082890033722, -0.08994714170694351, -0.2043493390083313, 0.2028915286064148, -0.3063114881515503, 0.6130563020706177, 0.2655438184738159, 0.23289954662322998, -0.07529083639383316, -0.013671373017132282, 0.007772330194711685, -0.2919131815433502, 0.03828774392604828, -0.31265854835510254, -0.14621920883655548, 0.13013343513011932, 0.45138952136039734, 0.3025360107421875, 0.11741254478693008, 0.1525276154279709, 0.11857707798480988, -0.383437842130661, 0.12159271538257599, -0.18580207228660583, 0.06679041683673859, 0.277156263589859, 0.20061266422271729, -0.0743899866938591, 0.4234475791454315, -0.22566980123519897, -0.17293894290924072, 0.30424201488494873, -0.13712501525878906, 0.2769835591316223, 0.04197743535041809, 0.5683106780052185, -0.04225138574838638, -0.14615416526794434, -0.29538315534591675, 0.10351809114217758, 0.1554984450340271, 0.08787299692630768, -0.17525824904441833 ]
https://github.com/huggingface/datasets/issues/3044
Inconsistent caching behaviour when using `Dataset.map()` with a `new_fingerprint` and `num_proc>1`
Following the discussion in #3045 if would be nice to have a way to let users have a nice experience with caching even if the function is not hashable. Currently a workaround is to make the function picklable. This can be done by implementing a callable class instead, that can be pickled using by implementing a custom `__getstate__` method for example. However it sounds pretty complicated for a simple thing. Maybe one idea would be to have something similar to streamlit: they allow users to register the hashing of their own objects. See the documentation about their `hash_funcs` here: https://docs.streamlit.io/library/advanced-features/caching#the-hash_funcs-parameter Here is the example they give: ```python class FileReference: def __init__(self, filename): self.filename = filename def hash_file_reference(file_reference): filename = file_reference.filename return (filename, os.path.getmtime(filename)) @st.cache(hash_funcs={FileReference: hash_file_reference}) def func(file_reference): ... ```
## Describe the bug Caching does not work when using `Dataset.map()` with: 1. a function that cannot be deterministically fingerprinted 2. `num_proc>1` 3. using a custom fingerprint set with the argument `new_fingerprint`. This means that the dataset will be mapped with the function for each and every call, which does not happen if `num_proc==1`. In that case (`num_proc==1`) subsequent calls will load the transformed dataset from the cache, which is the expected behaviour. The example can easily be translated into a unit test. I have a fix and will submit a pull request asap. ## Steps to reproduce the bug ```python import hashlib import json import os from typing import Dict, Any import numpy as np from datasets import load_dataset, Dataset Batch = Dict[str, Any] filename = 'example.json' class Transformation(): """A transformation with a random state that cannot be fingerprinted""" def __init__(self): self.state = np.random.random() def __call__(self, batch: Batch) -> Batch: batch['x'] = [np.random.random() for _ in batch['x']] return batch def generate_dataset(): """generate a simple dataset""" rgn = np.random.RandomState(24) data = { 'data': [{'x': float(y), 'y': -float(y)} for y in rgn.random(size=(1000,))]} if not os.path.exists(filename): with open(filename, 'w') as f: f.write(json.dumps(data)) return filename def process_dataset_with_cache(num_proc=1, remove_cache=False, cache_expected_to_exist=False): # load the generated dataset dset: Dataset = next( iter(load_dataset('json', data_files=filename, field='data').values())) new_fingerprint = hashlib.md5("static-id".encode("utf8")).hexdigest() # get the expected cached path cache_path = dset._get_cache_file_path(new_fingerprint) if remove_cache and os.path.exists(cache_path): os.remove(cache_path) # check that the cache exists, and print a statement # if was actually expected to exist cache_exist = os.path.exists(cache_path) print(f"> cache file exists={cache_exist}") if cache_expected_to_exist and not cache_exist: print("=== Cache does not exist! ====") # apply the transformation with the new fingerprint dset = dset.map( Transformation(), batched=True, num_proc=num_proc, new_fingerprint=new_fingerprint, desc="mapping dataset with transformation") generate_dataset() for num_proc in [1, 2]: print(f"# num_proc={num_proc}, first pass") # first pass to generate the cache (always create a new cache here) process_dataset_with_cache(remove_cache=True, num_proc=num_proc, cache_expected_to_exist=False) print(f"# num_proc={num_proc}, second pass") # second pass, expects the cache to exist process_dataset_with_cache(remove_cache=False, num_proc=num_proc, cache_expected_to_exist=True) os.remove(filename) ``` ## Expected results In the above python example, with `num_proc=2`, the **cache file should exist in the second call** of `process_dataset_with_cache` ("=== Cache does not exist! ====" should not be printed). When the cache is successfully created, `map()` is called only one time. ## Actual results In the above python example, with `num_proc=2`, the **cache does not exist in the second call** of `process_dataset_with_cache` (this results in printing "=== Cache does not exist! ===="). Because the cache doesn't exist, the `map()` method is executed a second time and the dataset is not loaded from the cache. ## Environment info - `datasets` version: 1.12.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 5.0.0
129
Inconsistent caching behaviour when using `Dataset.map()` with a `new_fingerprint` and `num_proc>1` ## Describe the bug Caching does not work when using `Dataset.map()` with: 1. a function that cannot be deterministically fingerprinted 2. `num_proc>1` 3. using a custom fingerprint set with the argument `new_fingerprint`. This means that the dataset will be mapped with the function for each and every call, which does not happen if `num_proc==1`. In that case (`num_proc==1`) subsequent calls will load the transformed dataset from the cache, which is the expected behaviour. The example can easily be translated into a unit test. I have a fix and will submit a pull request asap. ## Steps to reproduce the bug ```python import hashlib import json import os from typing import Dict, Any import numpy as np from datasets import load_dataset, Dataset Batch = Dict[str, Any] filename = 'example.json' class Transformation(): """A transformation with a random state that cannot be fingerprinted""" def __init__(self): self.state = np.random.random() def __call__(self, batch: Batch) -> Batch: batch['x'] = [np.random.random() for _ in batch['x']] return batch def generate_dataset(): """generate a simple dataset""" rgn = np.random.RandomState(24) data = { 'data': [{'x': float(y), 'y': -float(y)} for y in rgn.random(size=(1000,))]} if not os.path.exists(filename): with open(filename, 'w') as f: f.write(json.dumps(data)) return filename def process_dataset_with_cache(num_proc=1, remove_cache=False, cache_expected_to_exist=False): # load the generated dataset dset: Dataset = next( iter(load_dataset('json', data_files=filename, field='data').values())) new_fingerprint = hashlib.md5("static-id".encode("utf8")).hexdigest() # get the expected cached path cache_path = dset._get_cache_file_path(new_fingerprint) if remove_cache and os.path.exists(cache_path): os.remove(cache_path) # check that the cache exists, and print a statement # if was actually expected to exist cache_exist = os.path.exists(cache_path) print(f"> cache file exists={cache_exist}") if cache_expected_to_exist and not cache_exist: print("=== Cache does not exist! ====") # apply the transformation with the new fingerprint dset = dset.map( Transformation(), batched=True, num_proc=num_proc, new_fingerprint=new_fingerprint, desc="mapping dataset with transformation") generate_dataset() for num_proc in [1, 2]: print(f"# num_proc={num_proc}, first pass") # first pass to generate the cache (always create a new cache here) process_dataset_with_cache(remove_cache=True, num_proc=num_proc, cache_expected_to_exist=False) print(f"# num_proc={num_proc}, second pass") # second pass, expects the cache to exist process_dataset_with_cache(remove_cache=False, num_proc=num_proc, cache_expected_to_exist=True) os.remove(filename) ``` ## Expected results In the above python example, with `num_proc=2`, the **cache file should exist in the second call** of `process_dataset_with_cache` ("=== Cache does not exist! ====" should not be printed). When the cache is successfully created, `map()` is called only one time. ## Actual results In the above python example, with `num_proc=2`, the **cache does not exist in the second call** of `process_dataset_with_cache` (this results in printing "=== Cache does not exist! ===="). Because the cache doesn't exist, the `map()` method is executed a second time and the dataset is not loaded from the cache. ## Environment info - `datasets` version: 1.12.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 5.0.0 Following the discussion in #3045 if would be nice to have a way to let users have a nice experience with caching even if the function is not hashable. Currently a workaround is to make the function picklable. This can be done by implementing a callable class instead, that can be pickled using by implementing a custom `__getstate__` method for example. However it sounds pretty complicated for a simple thing. Maybe one idea would be to have something similar to streamlit: they allow users to register the hashing of their own objects. See the documentation about their `hash_funcs` here: https://docs.streamlit.io/library/advanced-features/caching#the-hash_funcs-parameter Here is the example they give: ```python class FileReference: def __init__(self, filename): self.filename = filename def hash_file_reference(file_reference): filename = file_reference.filename return (filename, os.path.getmtime(filename)) @st.cache(hash_funcs={FileReference: hash_file_reference}) def func(file_reference): ... ```
[ -0.11258691549301147, 0.11656124889850616, -0.015767037868499756, 0.06115548312664032, -0.11848461627960205, -0.12406128644943237, 0.38619452714920044, 0.3515928089618683, 0.30126065015792847, -0.09979857504367828, 0.2086915373802185, 0.32950177788734436, 0.039160825312137604, -0.14310753345489502, -0.01975294202566147, 0.3910207450389862, 0.3168308138847351, -0.06824485957622528, -0.03893963247537613, -0.09951721131801605, -0.47937220335006714, 0.027748484164476395, -0.3548877239227295, -0.27843499183654785, -0.3435044586658478, 0.07110357284545898, -0.15922218561172485, 0.13623347878456116, 0.12198923528194427, -0.3866123855113983, 0.2304467111825943, 0.05937404930591583, -0.07521836459636688, 0.43109363317489624, -0.00011417197674745694, -0.05672354996204376, 0.25171276926994324, 0.007910585030913353, 0.05904598906636238, -0.019584879279136658, -0.37392377853393555, -0.26856496930122375, -0.22342315316200256, -0.19984984397888184, -0.1342518925666809, -0.09890630841255188, 0.08215475082397461, -0.4035896360874176, 0.188082754611969, 0.26695477962493896, 0.2029106169939041, 0.014649957418441772, -0.1780855804681778, 0.10818828642368317, 0.07609248161315918, 0.17854681611061096, -0.15030182898044586, -0.02508217841386795, 0.22323837876319885, -0.193635031580925, -0.321895033121109, 0.17305545508861542, -0.0006531327962875366, 0.07362595945596695, 0.46845921874046326, 0.22190244495868683, 0.22863954305648804, -0.2857307493686676, 0.1566767543554306, -0.0031066834926605225, 0.058594461530447006, -0.22119325399398804, -0.4096219539642334, -0.3232637941837311, -0.40607950091362, -0.008202757686376572, 0.3329612910747528, -0.03619701415300369, -0.016845935955643654, 0.06158030778169632, -0.5032267570495605, 0.3311186730861664, 0.2923625409603119, 0.14716054499149323, 0.06379136443138123, 0.05092855915427208, 0.0886196494102478, 0.12078572809696198, -0.06202143803238869, -0.23445163667201996, 0.08438561856746674, -0.2585543692111969, -0.1525861620903015, 0.26922276616096497, -0.025290872901678085, 0.028614215552806854, 0.29561129212379456, 0.17235037684440613, 0.1807039976119995, -0.0028712302446365356, 0.1553746461868286, 0.14630228281021118, -0.0380607470870018, 0.21791818737983704, 0.192038893699646, 0.16099122166633606, 0.03237338736653328, 0.3685815632343292, 0.08265022933483124, -0.23352573812007904, -0.44297972321510315, 0.10691756755113602, 0.3875390887260437, -0.1421607881784439, 0.6534632444381714, 0.04372763633728027, -0.07156383246183395, -0.10085422545671463, 0.09422825276851654, 0.004201000556349754, -0.15444250404834747, -0.14494527876377106, 0.24028539657592773, 0.21145102381706238, -0.01228424720466137, 0.08952465653419495, -0.16450387239456177, 0.10041584074497223, -0.24359524250030518, 0.26168641448020935, -0.23627015948295593, -0.06275686621665955, -0.3793405294418335, 0.29620882868766785, 0.25573527812957764, 0.027915209531784058, 0.20422321557998657, 0.25283098220825195, 0.023664597421884537, -0.18048937618732452, 0.22603917121887207, -0.26985231041908264, 0.538331925868988, -0.024264249950647354, -0.3987639248371124, 0.12208492308855057, -0.0585365854203701, 0.12976044416427612, -0.20448607206344604, 0.27393200993537903, -0.19893571734428406, 0.043698739260435104, 0.34746253490448, 0.10774792730808258, -0.3829646706581116, 0.1285945177078247, -0.0849238708615303, 0.1277652382850647, 0.3259255290031433, -0.3512028157711029, 0.029942765831947327, -0.23412348330020905, -0.5851396918296814, -0.37700194120407104, -0.10538230091333389, 0.47142720222473145, 0.11043606698513031, -0.14692360162734985, 0.19961407780647278, 0.3393436372280121, 0.12697041034698486, 0.15853819251060486, -0.17987877130508423, -0.012261010706424713, -0.35483425855636597, 0.3470659852027893, 0.05270572751760483, -0.46315065026283264, -0.8054304122924805, 0.19406628608703613, 0.01983679085969925, 0.28496235609054565, -0.25240379571914673, 0.2596902847290039, 0.08378545939922333, -0.3804091811180115, -0.14888183772563934, 0.2633270025253296, 0.06692882627248764, 0.23778724670410156, -0.3906364142894745, -0.18160490691661835, 0.20428399741649628, -0.12432384490966797, 0.028670920059084892, 0.3220614492893219, 0.19090968370437622, -0.1716928482055664, 0.15656070411205292, -0.025995898991823196, 0.13940687477588654, 0.23259888589382172, 0.13355430960655212, -0.35401618480682373, 0.09758137911558151, 0.1032649353146553, -0.3816804885864258, 0.45309916138648987, -0.10137662291526794, -0.22597470879554749, -0.09740996360778809, 0.1298208236694336, 0.10111352801322937, -0.15462259948253632, -0.1785898059606552, -0.21628373861312866, 0.06397628784179688, 0.26281285285949707, 0.3670862913131714, -0.2023705691099167, 0.08091042935848236, 0.3404200077056885, 0.21992985904216766, -0.10817454755306244, -0.33243587613105774, -0.02615901455283165, 0.2252342700958252, -0.1553073525428772, -0.298174649477005, -0.024564020335674286, 0.4082881212234497, -0.1921357959508896, -0.20383912324905396, 0.20589563250541687, 0.16270767152309418, 0.10131648927927017, -0.2682017982006073, 0.24454087018966675, 0.07258174568414688, -0.022911500185728073, 0.21895816922187805, 0.15487980842590332, 0.12651173770427704, -0.2247428596019745, -0.12052293866872787, 0.6013139486312866, 0.02042209729552269, 0.12980833649635315, -0.16723757982254028, -0.26048868894577026, 0.016414424404501915, -0.008477289229631424, 0.1057501882314682, -0.19967208802700043, -0.15693305432796478, 0.1319083571434021, 0.5416610240936279, 0.12039852142333984, 0.0175662562251091, 0.33516058325767517, 0.31883955001831055, 0.09515194594860077, 0.022005822509527206, 0.044478412717580795, -0.09425678104162216, -0.3260907232761383, 0.06678619980812073, 0.2325776070356369, 0.5157179832458496, 0.06004908308386803, 0.09772138297557831, -0.007718758657574654, 0.0021700463257730007, -0.0910496786236763, -0.025552429258823395, -0.1961430460214615, -0.052143801003694534, -0.03675816208124161, 0.4138731062412262, -0.11033102124929428, -0.0029258020222187042, -0.014761954545974731, 0.22904600203037262, 0.042155466973781586, -0.1423853635787964, 0.15864816308021545, -0.1542542576789856, 0.42657652497291565, 0.022610533982515335, -0.19683325290679932, 0.02639012783765793, -0.32791996002197266, -0.1847744882106781, 0.3959241807460785, 0.01746264100074768, 0.0593913197517395, -0.2548629343509674, -0.22068367898464203, -0.09355217218399048, -0.3701072335243225, -0.24635745584964752, -0.14627565443515778, -0.14500588178634644, -0.05775298550724983, 0.12838436663150787, 0.03630795329809189, 0.011430811136960983, -0.1244664415717125, -0.11210781335830688, -0.2261989563703537, -0.14516392350196838, -0.009519156068563461, -0.09532403945922852, 0.17508697509765625, -0.15453627705574036, -0.14273665845394135, -0.2333957701921463, 0.08030331134796143, 0.2684290409088135, -0.4073776304721832, -0.1769203543663025, 0.059468381106853485, 0.06619696319103241, -0.0847533717751503, -0.014855543151497841, -0.03395852446556091, -0.12698481976985931, -0.06253920495510101, 0.19354750216007233, 0.11407668888568878, 0.1619165539741516, 0.29947566986083984, 0.18336082994937897, -0.10508206486701965, 0.05538993328809738, -0.02501758746802807, -0.28181302547454834, -0.557395875453949, 0.47930771112442017, -0.12130144983530045, -0.13592848181724548, -0.13774289190769196, -0.10521905869245529, -0.11392644047737122, 0.45545780658721924, -0.4010353684425354, -0.3724502921104431, -0.18388132750988007, 0.7493662238121033, 0.15697702765464783, -0.2589912712574005, 0.3056100606918335, -0.03597255423665047, -0.048665259033441544, -0.3839777410030365, -0.49206894636154175, 0.0787426233291626, 0.09079185873270035, 0.16454504430294037, 0.3155909478664398, 0.14979219436645508, 0.030662845820188522, 0.6485082507133484, 0.36720603704452515, -0.5198047161102295, 0.18493765592575073, 0.11441458761692047, 0.060588520020246506, -0.2385772168636322, -0.2028324007987976, 0.06849908828735352, -0.057087868452072144, 0.05493916571140289, 0.02779363840818405, 0.17051702737808228, -0.19793882966041565, -0.056358788162469864, 0.008200012147426605, -0.4241653084754944, -0.2546488344669342, 0.05491943657398224, -0.1802775263786316, 0.14500856399536133, 0.15764400362968445, 0.5402119755744934, -0.5638545155525208, -0.2608463168144226, -0.08400774002075195, -0.14698466658592224, 0.41314995288848877, -0.0030468341428786516, -0.1599487066268921, 0.10424790531396866, -0.5813407301902771, 0.24414636194705963, 0.25781139731407166, 0.4286161959171295, 0.010308545082807541, -0.25063416361808777, -0.06663131713867188, -0.17641006410121918, 0.6912650465965271, -0.37236717343330383, 0.3657488226890564, 0.15865306556224823, -0.28609830141067505, -0.1351652443408966, 0.09385499358177185, 0.14361831545829773, 0.4348350465297699, 0.27677106857299805, 0.44280141592025757, 0.024864688515663147, 0.034534700214862823, -0.4122464954853058, 0.19089822471141815, 0.146783247590065, -0.3810139000415802, 0.0399048738181591, -0.05701654031872749, 0.03755735605955124, -0.013925112783908844, -0.0007098373025655746, -0.035566624253988266, 0.11641291528940201, -0.0657847672700882, -0.20984600484371185, -0.059321045875549316, -0.03569343686103821, 0.16624321043491364, 0.337384432554245, -0.12432469427585602, 0.45033735036849976, 0.26483333110809326, 0.039371803402900696, 0.17478588223457336, 0.33289507031440735, -0.28012335300445557, -0.07147230207920074, 0.0364915207028389, -0.018332216888666153, -0.42785319685935974, 0.2911998927593231, -0.028384175151586533, -0.12427147477865219, 0.12253044545650482, -0.16203519701957703, -0.2004358470439911, -0.06108762323856354, -0.0016109971329569817, 0.17033901810646057, -0.2793624997138977, -0.398588627576828, 0.33862385153770447, 0.20865756273269653, -0.25867119431495667, 0.44165533781051636, -0.46922892332077026, -0.22237101197242737, 0.25864702463150024, 0.0358685739338398, 0.7318882942199707, -0.005673564970493317, 0.0410480722784996, -0.1770724058151245, 0.11445234715938568, 0.0789121687412262, 0.2711598873138428, 0.1049431562423706, -0.24025623500347137, -0.18767690658569336, -0.009220777079463005, -0.287756085395813, -0.1540108323097229, 0.23297441005706787, -0.11954504251480103, 0.19333963096141815, -0.041733287274837494, 0.28855064511299133, -0.1315218210220337, 0.042681269347667694, 0.31184348464012146, -0.17850615084171295, 0.04950764775276184, 0.25627440214157104, 0.15754806995391846, 0.12411510944366455, 0.17573419213294983, -0.11289513856172562, -0.2318655401468277, -0.029392428696155548, -0.0495292954146862, 0.22385141253471375, -0.25074702501296997, 0.1634991616010666, 0.39920666813850403, -0.10994039475917816, -0.04574759304523468, 0.19729435443878174, 0.19551321864128113, -0.1601489782333374, -0.15942132472991943, 0.07019324600696564, 0.5374317765235901, 0.5143430829048157, 0.16206906735897064, -0.26927047967910767, 0.13417160511016846, 0.11770261079072952, -0.11411700397729874, -0.002968929708003998, -0.21865737438201904, -0.419480562210083, -0.42747193574905396, 0.4585963487625122, -0.17869514226913452, -0.09105667471885681, 0.05617811158299446, 0.03809930011630058, -0.16020089387893677, -0.21282531321048737, 0.146864652633667, 0.45490527153015137, -0.008484316058456898, 0.4117089509963989, -0.3164346516132355, -0.4244231581687927, -0.05585698410868645, 0.6185292601585388, 0.006749948486685753, -0.005922406911849976, 0.27455657720565796, -0.15187297761440277, -0.19352595508098602, -0.15222153067588806, -0.08120758831501007, -0.09813248366117477, -0.18382707238197327, 0.12210102379322052, -0.2068580985069275, 0.033493608236312866, 0.1912766396999359, 0.07648855447769165, -0.10701273381710052, 0.05145266652107239, 0.09407076239585876, -0.3145790994167328, -0.358599990606308, -0.2865385413169861, -0.11928346753120422, 0.07514660060405731, 0.02046295627951622, 0.02012917399406433, -0.17315271496772766, 0.1843705028295517, -0.30759507417678833, 0.19535332918167114, 0.04866623133420944, 0.1511596441268921, -0.06763175874948502, 0.024493340402841568, 0.23420485854148865, -0.10149329900741577, 0.06535322219133377, 0.29662632942199707, -0.48689523339271545, -0.19782903790473938, -0.08594094216823578, 0.09842347353696823, 0.16031956672668457, -0.30842551589012146, -0.22104443609714508, 0.07306776940822601, 0.0260126031935215, -0.39683711528778076, 0.11476242542266846, 0.3971938490867615, -0.09303726255893707, 0.03941230848431587, 0.22107647359371185, 0.03303609415888786, 0.2822134494781494, 0.08110398799180984, -0.14120590686798096, -0.01744966208934784, -0.23948529362678528, 0.4071968197822571, 0.011540895327925682, 0.09368138015270233, 0.11501435190439224, -0.07258111983537674, 0.013064496219158173, 0.1561986804008484, 0.3188040256500244, -0.20880933105945587, 0.14606347680091858, 0.27204039692878723, -0.021002264693379402, 0.09915636479854584, -0.14211207628250122, -0.2073839008808136, 0.09056895971298218, 0.22818931937217712, -0.10842018574476242, -0.30006149411201477, 0.27496129274368286, 0.3501660227775574, 0.19768984615802765, 0.2313382625579834, 0.14830856025218964, -0.32771843671798706, 0.015288546681404114, 0.05050213634967804, 0.29850655794143677, -0.45919257402420044, 0.07647928595542908, 0.3280447721481323, 0.08912965655326843, 0.052409395575523376, 0.40792885422706604, 0.18855337798595428, -0.12310687452554703, 0.5156185626983643, 0.16626670956611633, 0.3609532415866852, 0.12957599759101868, 0.006598219275474548, -0.3069338798522949, -0.3739161491394043, 0.2956991493701935, 0.45035499334335327, -0.19074314832687378, 0.42418283224105835, 0.09419276565313339, 0.45216137170791626, -0.14315199851989746, 0.06891977041959763, -0.15111283957958221, 0.02922653779387474, -0.13205286860466003, -0.31048786640167236, -0.037211667746305466, -0.20180243253707886, -0.047329969704151154, -0.022769009694457054, -0.15734903514385223, -0.14717695116996765, 0.5516809225082397, 0.13969695568084717, -0.049992844462394714, -0.21551929414272308, -0.21109303832054138, -0.13980159163475037, 0.25675737857818604, -0.24339722096920013, 0.2725440263748169, -0.16119913756847382, -0.2117677927017212, 0.3310508131980896, -0.0004948284476995468, 0.49891695380210876, 0.4054945409297943, -0.11002770066261292, 0.24314111471176147, 0.06027770787477493, -0.031145991757512093, -0.1935775727033615, 0.36105969548225403, -0.20139798521995544, -0.3644644021987915, 0.16500112414360046, 0.09267716854810715, -0.12432614713907242, 0.14854995906352997, -0.02910187467932701, 0.4075523316860199, -0.0851995050907135, 0.4404507577419281, -0.21970507502555847, -0.027634844183921814, 0.03278130292892456, 0.10330148041248322, 0.07329379767179489, -0.29118070006370544, 0.2661936581134796, -0.21615947782993317, 0.33636581897735596, 0.006204383447766304, 0.07381641864776611, -0.2708985209465027, 0.2704450488090515, 0.1943826973438263, -0.20124226808547974, -0.2543027400970459, 0.1683092564344406, -0.3071586489677429, 0.22792954742908478, -0.34634295105934143, 0.16183313727378845, -0.20171310007572174, 0.2006840705871582, -0.17220938205718994, -0.10169070959091187, 0.15187475085258484, 0.06669923663139343, 0.03490661457180977, 0.5869483947753906, -0.34668710827827454, 0.09230688959360123, -0.18604059517383575, 0.026012172922492027, 0.24734455347061157, -0.5080570578575134, 0.16585494577884674, -0.002565935254096985, 0.23317140340805054, -0.10049299895763397, -0.16823363304138184, 0.045501697808504105, 0.3093849718570709, 0.7304586172103882, 0.4056198298931122, 0.1935492306947708, -0.0883546769618988, -0.07794259488582611, -0.3839724063873291, 0.025501618161797523, -0.09386074542999268, 0.05073019117116928, -0.10617855191230774, 0.2416701316833496, -0.3015611469745636, -0.06773830950260162, -0.1308734118938446, -0.031105753034353256, -0.02516128681600094, -0.26837244629859924, -0.09270888566970825, 0.0900271087884903, -0.34892985224723816, 0.06662445515394211, -0.08779553323984146, 0.4083452820777893, -0.004365961998701096, 0.23606546223163605, -0.2845376133918762, -0.14347325265407562, 0.345011830329895, -0.6891112327575684, -0.23176580667495728, -0.04966951161623001, 0.07119768857955933, -0.25362372398376465, -0.28917837142944336, -0.31519827246665955, -0.07352914661169052, 0.28796613216400146, 0.05709484964609146, -0.1766723096370697, -0.14817093312740326, -0.2677890658378601, -0.027581684291362762, -0.07508756220340729, 0.06568187475204468, 0.17891746759414673, -0.22087664902210236, 0.26025116443634033, -0.0672304779291153 ]
https://github.com/huggingface/datasets/issues/3044
Inconsistent caching behaviour when using `Dataset.map()` with a `new_fingerprint` and `num_proc>1`
My solution was to generate a custom hash, and use the hash as a `new_fingerprint` argument to the `map()` method to enable caching. This works, but is quite hacky. @lhoestq, this approach is very neat, this would make the whole caching mechanic more explicit. I don't have so much time to look into this right now, but I might give it a try in the future.
## Describe the bug Caching does not work when using `Dataset.map()` with: 1. a function that cannot be deterministically fingerprinted 2. `num_proc>1` 3. using a custom fingerprint set with the argument `new_fingerprint`. This means that the dataset will be mapped with the function for each and every call, which does not happen if `num_proc==1`. In that case (`num_proc==1`) subsequent calls will load the transformed dataset from the cache, which is the expected behaviour. The example can easily be translated into a unit test. I have a fix and will submit a pull request asap. ## Steps to reproduce the bug ```python import hashlib import json import os from typing import Dict, Any import numpy as np from datasets import load_dataset, Dataset Batch = Dict[str, Any] filename = 'example.json' class Transformation(): """A transformation with a random state that cannot be fingerprinted""" def __init__(self): self.state = np.random.random() def __call__(self, batch: Batch) -> Batch: batch['x'] = [np.random.random() for _ in batch['x']] return batch def generate_dataset(): """generate a simple dataset""" rgn = np.random.RandomState(24) data = { 'data': [{'x': float(y), 'y': -float(y)} for y in rgn.random(size=(1000,))]} if not os.path.exists(filename): with open(filename, 'w') as f: f.write(json.dumps(data)) return filename def process_dataset_with_cache(num_proc=1, remove_cache=False, cache_expected_to_exist=False): # load the generated dataset dset: Dataset = next( iter(load_dataset('json', data_files=filename, field='data').values())) new_fingerprint = hashlib.md5("static-id".encode("utf8")).hexdigest() # get the expected cached path cache_path = dset._get_cache_file_path(new_fingerprint) if remove_cache and os.path.exists(cache_path): os.remove(cache_path) # check that the cache exists, and print a statement # if was actually expected to exist cache_exist = os.path.exists(cache_path) print(f"> cache file exists={cache_exist}") if cache_expected_to_exist and not cache_exist: print("=== Cache does not exist! ====") # apply the transformation with the new fingerprint dset = dset.map( Transformation(), batched=True, num_proc=num_proc, new_fingerprint=new_fingerprint, desc="mapping dataset with transformation") generate_dataset() for num_proc in [1, 2]: print(f"# num_proc={num_proc}, first pass") # first pass to generate the cache (always create a new cache here) process_dataset_with_cache(remove_cache=True, num_proc=num_proc, cache_expected_to_exist=False) print(f"# num_proc={num_proc}, second pass") # second pass, expects the cache to exist process_dataset_with_cache(remove_cache=False, num_proc=num_proc, cache_expected_to_exist=True) os.remove(filename) ``` ## Expected results In the above python example, with `num_proc=2`, the **cache file should exist in the second call** of `process_dataset_with_cache` ("=== Cache does not exist! ====" should not be printed). When the cache is successfully created, `map()` is called only one time. ## Actual results In the above python example, with `num_proc=2`, the **cache does not exist in the second call** of `process_dataset_with_cache` (this results in printing "=== Cache does not exist! ===="). Because the cache doesn't exist, the `map()` method is executed a second time and the dataset is not loaded from the cache. ## Environment info - `datasets` version: 1.12.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 5.0.0
66
Inconsistent caching behaviour when using `Dataset.map()` with a `new_fingerprint` and `num_proc>1` ## Describe the bug Caching does not work when using `Dataset.map()` with: 1. a function that cannot be deterministically fingerprinted 2. `num_proc>1` 3. using a custom fingerprint set with the argument `new_fingerprint`. This means that the dataset will be mapped with the function for each and every call, which does not happen if `num_proc==1`. In that case (`num_proc==1`) subsequent calls will load the transformed dataset from the cache, which is the expected behaviour. The example can easily be translated into a unit test. I have a fix and will submit a pull request asap. ## Steps to reproduce the bug ```python import hashlib import json import os from typing import Dict, Any import numpy as np from datasets import load_dataset, Dataset Batch = Dict[str, Any] filename = 'example.json' class Transformation(): """A transformation with a random state that cannot be fingerprinted""" def __init__(self): self.state = np.random.random() def __call__(self, batch: Batch) -> Batch: batch['x'] = [np.random.random() for _ in batch['x']] return batch def generate_dataset(): """generate a simple dataset""" rgn = np.random.RandomState(24) data = { 'data': [{'x': float(y), 'y': -float(y)} for y in rgn.random(size=(1000,))]} if not os.path.exists(filename): with open(filename, 'w') as f: f.write(json.dumps(data)) return filename def process_dataset_with_cache(num_proc=1, remove_cache=False, cache_expected_to_exist=False): # load the generated dataset dset: Dataset = next( iter(load_dataset('json', data_files=filename, field='data').values())) new_fingerprint = hashlib.md5("static-id".encode("utf8")).hexdigest() # get the expected cached path cache_path = dset._get_cache_file_path(new_fingerprint) if remove_cache and os.path.exists(cache_path): os.remove(cache_path) # check that the cache exists, and print a statement # if was actually expected to exist cache_exist = os.path.exists(cache_path) print(f"> cache file exists={cache_exist}") if cache_expected_to_exist and not cache_exist: print("=== Cache does not exist! ====") # apply the transformation with the new fingerprint dset = dset.map( Transformation(), batched=True, num_proc=num_proc, new_fingerprint=new_fingerprint, desc="mapping dataset with transformation") generate_dataset() for num_proc in [1, 2]: print(f"# num_proc={num_proc}, first pass") # first pass to generate the cache (always create a new cache here) process_dataset_with_cache(remove_cache=True, num_proc=num_proc, cache_expected_to_exist=False) print(f"# num_proc={num_proc}, second pass") # second pass, expects the cache to exist process_dataset_with_cache(remove_cache=False, num_proc=num_proc, cache_expected_to_exist=True) os.remove(filename) ``` ## Expected results In the above python example, with `num_proc=2`, the **cache file should exist in the second call** of `process_dataset_with_cache` ("=== Cache does not exist! ====" should not be printed). When the cache is successfully created, `map()` is called only one time. ## Actual results In the above python example, with `num_proc=2`, the **cache does not exist in the second call** of `process_dataset_with_cache` (this results in printing "=== Cache does not exist! ===="). Because the cache doesn't exist, the `map()` method is executed a second time and the dataset is not loaded from the cache. ## Environment info - `datasets` version: 1.12.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 5.0.0 My solution was to generate a custom hash, and use the hash as a `new_fingerprint` argument to the `map()` method to enable caching. This works, but is quite hacky. @lhoestq, this approach is very neat, this would make the whole caching mechanic more explicit. I don't have so much time to look into this right now, but I might give it a try in the future.
[ -0.11258691549301147, 0.11656124889850616, -0.015767037868499756, 0.06115548312664032, -0.11848461627960205, -0.12406128644943237, 0.38619452714920044, 0.3515928089618683, 0.30126065015792847, -0.09979857504367828, 0.2086915373802185, 0.32950177788734436, 0.039160825312137604, -0.14310753345489502, -0.01975294202566147, 0.3910207450389862, 0.3168308138847351, -0.06824485957622528, -0.03893963247537613, -0.09951721131801605, -0.47937220335006714, 0.027748484164476395, -0.3548877239227295, -0.27843499183654785, -0.3435044586658478, 0.07110357284545898, -0.15922218561172485, 0.13623347878456116, 0.12198923528194427, -0.3866123855113983, 0.2304467111825943, 0.05937404930591583, -0.07521836459636688, 0.43109363317489624, -0.00011417197674745694, -0.05672354996204376, 0.25171276926994324, 0.007910585030913353, 0.05904598906636238, -0.019584879279136658, -0.37392377853393555, -0.26856496930122375, -0.22342315316200256, -0.19984984397888184, -0.1342518925666809, -0.09890630841255188, 0.08215475082397461, -0.4035896360874176, 0.188082754611969, 0.26695477962493896, 0.2029106169939041, 0.014649957418441772, -0.1780855804681778, 0.10818828642368317, 0.07609248161315918, 0.17854681611061096, -0.15030182898044586, -0.02508217841386795, 0.22323837876319885, -0.193635031580925, -0.321895033121109, 0.17305545508861542, -0.0006531327962875366, 0.07362595945596695, 0.46845921874046326, 0.22190244495868683, 0.22863954305648804, -0.2857307493686676, 0.1566767543554306, -0.0031066834926605225, 0.058594461530447006, -0.22119325399398804, -0.4096219539642334, -0.3232637941837311, -0.40607950091362, -0.008202757686376572, 0.3329612910747528, -0.03619701415300369, -0.016845935955643654, 0.06158030778169632, -0.5032267570495605, 0.3311186730861664, 0.2923625409603119, 0.14716054499149323, 0.06379136443138123, 0.05092855915427208, 0.0886196494102478, 0.12078572809696198, -0.06202143803238869, -0.23445163667201996, 0.08438561856746674, -0.2585543692111969, -0.1525861620903015, 0.26922276616096497, -0.025290872901678085, 0.028614215552806854, 0.29561129212379456, 0.17235037684440613, 0.1807039976119995, -0.0028712302446365356, 0.1553746461868286, 0.14630228281021118, -0.0380607470870018, 0.21791818737983704, 0.192038893699646, 0.16099122166633606, 0.03237338736653328, 0.3685815632343292, 0.08265022933483124, -0.23352573812007904, -0.44297972321510315, 0.10691756755113602, 0.3875390887260437, -0.1421607881784439, 0.6534632444381714, 0.04372763633728027, -0.07156383246183395, -0.10085422545671463, 0.09422825276851654, 0.004201000556349754, -0.15444250404834747, -0.14494527876377106, 0.24028539657592773, 0.21145102381706238, -0.01228424720466137, 0.08952465653419495, -0.16450387239456177, 0.10041584074497223, -0.24359524250030518, 0.26168641448020935, -0.23627015948295593, -0.06275686621665955, -0.3793405294418335, 0.29620882868766785, 0.25573527812957764, 0.027915209531784058, 0.20422321557998657, 0.25283098220825195, 0.023664597421884537, -0.18048937618732452, 0.22603917121887207, -0.26985231041908264, 0.538331925868988, -0.024264249950647354, -0.3987639248371124, 0.12208492308855057, -0.0585365854203701, 0.12976044416427612, -0.20448607206344604, 0.27393200993537903, -0.19893571734428406, 0.043698739260435104, 0.34746253490448, 0.10774792730808258, -0.3829646706581116, 0.1285945177078247, -0.0849238708615303, 0.1277652382850647, 0.3259255290031433, -0.3512028157711029, 0.029942765831947327, -0.23412348330020905, -0.5851396918296814, -0.37700194120407104, -0.10538230091333389, 0.47142720222473145, 0.11043606698513031, -0.14692360162734985, 0.19961407780647278, 0.3393436372280121, 0.12697041034698486, 0.15853819251060486, -0.17987877130508423, -0.012261010706424713, -0.35483425855636597, 0.3470659852027893, 0.05270572751760483, -0.46315065026283264, -0.8054304122924805, 0.19406628608703613, 0.01983679085969925, 0.28496235609054565, -0.25240379571914673, 0.2596902847290039, 0.08378545939922333, -0.3804091811180115, -0.14888183772563934, 0.2633270025253296, 0.06692882627248764, 0.23778724670410156, -0.3906364142894745, -0.18160490691661835, 0.20428399741649628, -0.12432384490966797, 0.028670920059084892, 0.3220614492893219, 0.19090968370437622, -0.1716928482055664, 0.15656070411205292, -0.025995898991823196, 0.13940687477588654, 0.23259888589382172, 0.13355430960655212, -0.35401618480682373, 0.09758137911558151, 0.1032649353146553, -0.3816804885864258, 0.45309916138648987, -0.10137662291526794, -0.22597470879554749, -0.09740996360778809, 0.1298208236694336, 0.10111352801322937, -0.15462259948253632, -0.1785898059606552, -0.21628373861312866, 0.06397628784179688, 0.26281285285949707, 0.3670862913131714, -0.2023705691099167, 0.08091042935848236, 0.3404200077056885, 0.21992985904216766, -0.10817454755306244, -0.33243587613105774, -0.02615901455283165, 0.2252342700958252, -0.1553073525428772, -0.298174649477005, -0.024564020335674286, 0.4082881212234497, -0.1921357959508896, -0.20383912324905396, 0.20589563250541687, 0.16270767152309418, 0.10131648927927017, -0.2682017982006073, 0.24454087018966675, 0.07258174568414688, -0.022911500185728073, 0.21895816922187805, 0.15487980842590332, 0.12651173770427704, -0.2247428596019745, -0.12052293866872787, 0.6013139486312866, 0.02042209729552269, 0.12980833649635315, -0.16723757982254028, -0.26048868894577026, 0.016414424404501915, -0.008477289229631424, 0.1057501882314682, -0.19967208802700043, -0.15693305432796478, 0.1319083571434021, 0.5416610240936279, 0.12039852142333984, 0.0175662562251091, 0.33516058325767517, 0.31883955001831055, 0.09515194594860077, 0.022005822509527206, 0.044478412717580795, -0.09425678104162216, -0.3260907232761383, 0.06678619980812073, 0.2325776070356369, 0.5157179832458496, 0.06004908308386803, 0.09772138297557831, -0.007718758657574654, 0.0021700463257730007, -0.0910496786236763, -0.025552429258823395, -0.1961430460214615, -0.052143801003694534, -0.03675816208124161, 0.4138731062412262, -0.11033102124929428, -0.0029258020222187042, -0.014761954545974731, 0.22904600203037262, 0.042155466973781586, -0.1423853635787964, 0.15864816308021545, -0.1542542576789856, 0.42657652497291565, 0.022610533982515335, -0.19683325290679932, 0.02639012783765793, -0.32791996002197266, -0.1847744882106781, 0.3959241807460785, 0.01746264100074768, 0.0593913197517395, -0.2548629343509674, -0.22068367898464203, -0.09355217218399048, -0.3701072335243225, -0.24635745584964752, -0.14627565443515778, -0.14500588178634644, -0.05775298550724983, 0.12838436663150787, 0.03630795329809189, 0.011430811136960983, -0.1244664415717125, -0.11210781335830688, -0.2261989563703537, -0.14516392350196838, -0.009519156068563461, -0.09532403945922852, 0.17508697509765625, -0.15453627705574036, -0.14273665845394135, -0.2333957701921463, 0.08030331134796143, 0.2684290409088135, -0.4073776304721832, -0.1769203543663025, 0.059468381106853485, 0.06619696319103241, -0.0847533717751503, -0.014855543151497841, -0.03395852446556091, -0.12698481976985931, -0.06253920495510101, 0.19354750216007233, 0.11407668888568878, 0.1619165539741516, 0.29947566986083984, 0.18336082994937897, -0.10508206486701965, 0.05538993328809738, -0.02501758746802807, -0.28181302547454834, -0.557395875453949, 0.47930771112442017, -0.12130144983530045, -0.13592848181724548, -0.13774289190769196, -0.10521905869245529, -0.11392644047737122, 0.45545780658721924, -0.4010353684425354, -0.3724502921104431, -0.18388132750988007, 0.7493662238121033, 0.15697702765464783, -0.2589912712574005, 0.3056100606918335, -0.03597255423665047, -0.048665259033441544, -0.3839777410030365, -0.49206894636154175, 0.0787426233291626, 0.09079185873270035, 0.16454504430294037, 0.3155909478664398, 0.14979219436645508, 0.030662845820188522, 0.6485082507133484, 0.36720603704452515, -0.5198047161102295, 0.18493765592575073, 0.11441458761692047, 0.060588520020246506, -0.2385772168636322, -0.2028324007987976, 0.06849908828735352, -0.057087868452072144, 0.05493916571140289, 0.02779363840818405, 0.17051702737808228, -0.19793882966041565, -0.056358788162469864, 0.008200012147426605, -0.4241653084754944, -0.2546488344669342, 0.05491943657398224, -0.1802775263786316, 0.14500856399536133, 0.15764400362968445, 0.5402119755744934, -0.5638545155525208, -0.2608463168144226, -0.08400774002075195, -0.14698466658592224, 0.41314995288848877, -0.0030468341428786516, -0.1599487066268921, 0.10424790531396866, -0.5813407301902771, 0.24414636194705963, 0.25781139731407166, 0.4286161959171295, 0.010308545082807541, -0.25063416361808777, -0.06663131713867188, -0.17641006410121918, 0.6912650465965271, -0.37236717343330383, 0.3657488226890564, 0.15865306556224823, -0.28609830141067505, -0.1351652443408966, 0.09385499358177185, 0.14361831545829773, 0.4348350465297699, 0.27677106857299805, 0.44280141592025757, 0.024864688515663147, 0.034534700214862823, -0.4122464954853058, 0.19089822471141815, 0.146783247590065, -0.3810139000415802, 0.0399048738181591, -0.05701654031872749, 0.03755735605955124, -0.013925112783908844, -0.0007098373025655746, -0.035566624253988266, 0.11641291528940201, -0.0657847672700882, -0.20984600484371185, -0.059321045875549316, -0.03569343686103821, 0.16624321043491364, 0.337384432554245, -0.12432469427585602, 0.45033735036849976, 0.26483333110809326, 0.039371803402900696, 0.17478588223457336, 0.33289507031440735, -0.28012335300445557, -0.07147230207920074, 0.0364915207028389, -0.018332216888666153, -0.42785319685935974, 0.2911998927593231, -0.028384175151586533, -0.12427147477865219, 0.12253044545650482, -0.16203519701957703, -0.2004358470439911, -0.06108762323856354, -0.0016109971329569817, 0.17033901810646057, -0.2793624997138977, -0.398588627576828, 0.33862385153770447, 0.20865756273269653, -0.25867119431495667, 0.44165533781051636, -0.46922892332077026, -0.22237101197242737, 0.25864702463150024, 0.0358685739338398, 0.7318882942199707, -0.005673564970493317, 0.0410480722784996, -0.1770724058151245, 0.11445234715938568, 0.0789121687412262, 0.2711598873138428, 0.1049431562423706, -0.24025623500347137, -0.18767690658569336, -0.009220777079463005, -0.287756085395813, -0.1540108323097229, 0.23297441005706787, -0.11954504251480103, 0.19333963096141815, -0.041733287274837494, 0.28855064511299133, -0.1315218210220337, 0.042681269347667694, 0.31184348464012146, -0.17850615084171295, 0.04950764775276184, 0.25627440214157104, 0.15754806995391846, 0.12411510944366455, 0.17573419213294983, -0.11289513856172562, -0.2318655401468277, -0.029392428696155548, -0.0495292954146862, 0.22385141253471375, -0.25074702501296997, 0.1634991616010666, 0.39920666813850403, -0.10994039475917816, -0.04574759304523468, 0.19729435443878174, 0.19551321864128113, -0.1601489782333374, -0.15942132472991943, 0.07019324600696564, 0.5374317765235901, 0.5143430829048157, 0.16206906735897064, -0.26927047967910767, 0.13417160511016846, 0.11770261079072952, -0.11411700397729874, -0.002968929708003998, -0.21865737438201904, -0.419480562210083, -0.42747193574905396, 0.4585963487625122, -0.17869514226913452, -0.09105667471885681, 0.05617811158299446, 0.03809930011630058, -0.16020089387893677, -0.21282531321048737, 0.146864652633667, 0.45490527153015137, -0.008484316058456898, 0.4117089509963989, -0.3164346516132355, -0.4244231581687927, -0.05585698410868645, 0.6185292601585388, 0.006749948486685753, -0.005922406911849976, 0.27455657720565796, -0.15187297761440277, -0.19352595508098602, -0.15222153067588806, -0.08120758831501007, -0.09813248366117477, -0.18382707238197327, 0.12210102379322052, -0.2068580985069275, 0.033493608236312866, 0.1912766396999359, 0.07648855447769165, -0.10701273381710052, 0.05145266652107239, 0.09407076239585876, -0.3145790994167328, -0.358599990606308, -0.2865385413169861, -0.11928346753120422, 0.07514660060405731, 0.02046295627951622, 0.02012917399406433, -0.17315271496772766, 0.1843705028295517, -0.30759507417678833, 0.19535332918167114, 0.04866623133420944, 0.1511596441268921, -0.06763175874948502, 0.024493340402841568, 0.23420485854148865, -0.10149329900741577, 0.06535322219133377, 0.29662632942199707, -0.48689523339271545, -0.19782903790473938, -0.08594094216823578, 0.09842347353696823, 0.16031956672668457, -0.30842551589012146, -0.22104443609714508, 0.07306776940822601, 0.0260126031935215, -0.39683711528778076, 0.11476242542266846, 0.3971938490867615, -0.09303726255893707, 0.03941230848431587, 0.22107647359371185, 0.03303609415888786, 0.2822134494781494, 0.08110398799180984, -0.14120590686798096, -0.01744966208934784, -0.23948529362678528, 0.4071968197822571, 0.011540895327925682, 0.09368138015270233, 0.11501435190439224, -0.07258111983537674, 0.013064496219158173, 0.1561986804008484, 0.3188040256500244, -0.20880933105945587, 0.14606347680091858, 0.27204039692878723, -0.021002264693379402, 0.09915636479854584, -0.14211207628250122, -0.2073839008808136, 0.09056895971298218, 0.22818931937217712, -0.10842018574476242, -0.30006149411201477, 0.27496129274368286, 0.3501660227775574, 0.19768984615802765, 0.2313382625579834, 0.14830856025218964, -0.32771843671798706, 0.015288546681404114, 0.05050213634967804, 0.29850655794143677, -0.45919257402420044, 0.07647928595542908, 0.3280447721481323, 0.08912965655326843, 0.052409395575523376, 0.40792885422706604, 0.18855337798595428, -0.12310687452554703, 0.5156185626983643, 0.16626670956611633, 0.3609532415866852, 0.12957599759101868, 0.006598219275474548, -0.3069338798522949, -0.3739161491394043, 0.2956991493701935, 0.45035499334335327, -0.19074314832687378, 0.42418283224105835, 0.09419276565313339, 0.45216137170791626, -0.14315199851989746, 0.06891977041959763, -0.15111283957958221, 0.02922653779387474, -0.13205286860466003, -0.31048786640167236, -0.037211667746305466, -0.20180243253707886, -0.047329969704151154, -0.022769009694457054, -0.15734903514385223, -0.14717695116996765, 0.5516809225082397, 0.13969695568084717, -0.049992844462394714, -0.21551929414272308, -0.21109303832054138, -0.13980159163475037, 0.25675737857818604, -0.24339722096920013, 0.2725440263748169, -0.16119913756847382, -0.2117677927017212, 0.3310508131980896, -0.0004948284476995468, 0.49891695380210876, 0.4054945409297943, -0.11002770066261292, 0.24314111471176147, 0.06027770787477493, -0.031145991757512093, -0.1935775727033615, 0.36105969548225403, -0.20139798521995544, -0.3644644021987915, 0.16500112414360046, 0.09267716854810715, -0.12432614713907242, 0.14854995906352997, -0.02910187467932701, 0.4075523316860199, -0.0851995050907135, 0.4404507577419281, -0.21970507502555847, -0.027634844183921814, 0.03278130292892456, 0.10330148041248322, 0.07329379767179489, -0.29118070006370544, 0.2661936581134796, -0.21615947782993317, 0.33636581897735596, 0.006204383447766304, 0.07381641864776611, -0.2708985209465027, 0.2704450488090515, 0.1943826973438263, -0.20124226808547974, -0.2543027400970459, 0.1683092564344406, -0.3071586489677429, 0.22792954742908478, -0.34634295105934143, 0.16183313727378845, -0.20171310007572174, 0.2006840705871582, -0.17220938205718994, -0.10169070959091187, 0.15187475085258484, 0.06669923663139343, 0.03490661457180977, 0.5869483947753906, -0.34668710827827454, 0.09230688959360123, -0.18604059517383575, 0.026012172922492027, 0.24734455347061157, -0.5080570578575134, 0.16585494577884674, -0.002565935254096985, 0.23317140340805054, -0.10049299895763397, -0.16823363304138184, 0.045501697808504105, 0.3093849718570709, 0.7304586172103882, 0.4056198298931122, 0.1935492306947708, -0.0883546769618988, -0.07794259488582611, -0.3839724063873291, 0.025501618161797523, -0.09386074542999268, 0.05073019117116928, -0.10617855191230774, 0.2416701316833496, -0.3015611469745636, -0.06773830950260162, -0.1308734118938446, -0.031105753034353256, -0.02516128681600094, -0.26837244629859924, -0.09270888566970825, 0.0900271087884903, -0.34892985224723816, 0.06662445515394211, -0.08779553323984146, 0.4083452820777893, -0.004365961998701096, 0.23606546223163605, -0.2845376133918762, -0.14347325265407562, 0.345011830329895, -0.6891112327575684, -0.23176580667495728, -0.04966951161623001, 0.07119768857955933, -0.25362372398376465, -0.28917837142944336, -0.31519827246665955, -0.07352914661169052, 0.28796613216400146, 0.05709484964609146, -0.1766723096370697, -0.14817093312740326, -0.2677890658378601, -0.027581684291362762, -0.07508756220340729, 0.06568187475204468, 0.17891746759414673, -0.22087664902210236, 0.26025116443634033, -0.0672304779291153 ]
https://github.com/huggingface/datasets/issues/3044
Inconsistent caching behaviour when using `Dataset.map()` with a `new_fingerprint` and `num_proc>1`
Almost a year later and I'm in a similar boat. Using custom fingerprints and when using multiprocessing the cached datasets are saved with a template at the end of the filename (something like "000001_of_000008" for every process of num_proc). So if in the next time you run the script you set num_proc to a different number, the cache cannot be used. Is there any way to get around this? I am processing a huge dataset so I do the processing on one machine and then transfer the processed data to another in its cache dir but currently that's not possible due to num_proc mismatch.
## Describe the bug Caching does not work when using `Dataset.map()` with: 1. a function that cannot be deterministically fingerprinted 2. `num_proc>1` 3. using a custom fingerprint set with the argument `new_fingerprint`. This means that the dataset will be mapped with the function for each and every call, which does not happen if `num_proc==1`. In that case (`num_proc==1`) subsequent calls will load the transformed dataset from the cache, which is the expected behaviour. The example can easily be translated into a unit test. I have a fix and will submit a pull request asap. ## Steps to reproduce the bug ```python import hashlib import json import os from typing import Dict, Any import numpy as np from datasets import load_dataset, Dataset Batch = Dict[str, Any] filename = 'example.json' class Transformation(): """A transformation with a random state that cannot be fingerprinted""" def __init__(self): self.state = np.random.random() def __call__(self, batch: Batch) -> Batch: batch['x'] = [np.random.random() for _ in batch['x']] return batch def generate_dataset(): """generate a simple dataset""" rgn = np.random.RandomState(24) data = { 'data': [{'x': float(y), 'y': -float(y)} for y in rgn.random(size=(1000,))]} if not os.path.exists(filename): with open(filename, 'w') as f: f.write(json.dumps(data)) return filename def process_dataset_with_cache(num_proc=1, remove_cache=False, cache_expected_to_exist=False): # load the generated dataset dset: Dataset = next( iter(load_dataset('json', data_files=filename, field='data').values())) new_fingerprint = hashlib.md5("static-id".encode("utf8")).hexdigest() # get the expected cached path cache_path = dset._get_cache_file_path(new_fingerprint) if remove_cache and os.path.exists(cache_path): os.remove(cache_path) # check that the cache exists, and print a statement # if was actually expected to exist cache_exist = os.path.exists(cache_path) print(f"> cache file exists={cache_exist}") if cache_expected_to_exist and not cache_exist: print("=== Cache does not exist! ====") # apply the transformation with the new fingerprint dset = dset.map( Transformation(), batched=True, num_proc=num_proc, new_fingerprint=new_fingerprint, desc="mapping dataset with transformation") generate_dataset() for num_proc in [1, 2]: print(f"# num_proc={num_proc}, first pass") # first pass to generate the cache (always create a new cache here) process_dataset_with_cache(remove_cache=True, num_proc=num_proc, cache_expected_to_exist=False) print(f"# num_proc={num_proc}, second pass") # second pass, expects the cache to exist process_dataset_with_cache(remove_cache=False, num_proc=num_proc, cache_expected_to_exist=True) os.remove(filename) ``` ## Expected results In the above python example, with `num_proc=2`, the **cache file should exist in the second call** of `process_dataset_with_cache` ("=== Cache does not exist! ====" should not be printed). When the cache is successfully created, `map()` is called only one time. ## Actual results In the above python example, with `num_proc=2`, the **cache does not exist in the second call** of `process_dataset_with_cache` (this results in printing "=== Cache does not exist! ===="). Because the cache doesn't exist, the `map()` method is executed a second time and the dataset is not loaded from the cache. ## Environment info - `datasets` version: 1.12.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 5.0.0
104
Inconsistent caching behaviour when using `Dataset.map()` with a `new_fingerprint` and `num_proc>1` ## Describe the bug Caching does not work when using `Dataset.map()` with: 1. a function that cannot be deterministically fingerprinted 2. `num_proc>1` 3. using a custom fingerprint set with the argument `new_fingerprint`. This means that the dataset will be mapped with the function for each and every call, which does not happen if `num_proc==1`. In that case (`num_proc==1`) subsequent calls will load the transformed dataset from the cache, which is the expected behaviour. The example can easily be translated into a unit test. I have a fix and will submit a pull request asap. ## Steps to reproduce the bug ```python import hashlib import json import os from typing import Dict, Any import numpy as np from datasets import load_dataset, Dataset Batch = Dict[str, Any] filename = 'example.json' class Transformation(): """A transformation with a random state that cannot be fingerprinted""" def __init__(self): self.state = np.random.random() def __call__(self, batch: Batch) -> Batch: batch['x'] = [np.random.random() for _ in batch['x']] return batch def generate_dataset(): """generate a simple dataset""" rgn = np.random.RandomState(24) data = { 'data': [{'x': float(y), 'y': -float(y)} for y in rgn.random(size=(1000,))]} if not os.path.exists(filename): with open(filename, 'w') as f: f.write(json.dumps(data)) return filename def process_dataset_with_cache(num_proc=1, remove_cache=False, cache_expected_to_exist=False): # load the generated dataset dset: Dataset = next( iter(load_dataset('json', data_files=filename, field='data').values())) new_fingerprint = hashlib.md5("static-id".encode("utf8")).hexdigest() # get the expected cached path cache_path = dset._get_cache_file_path(new_fingerprint) if remove_cache and os.path.exists(cache_path): os.remove(cache_path) # check that the cache exists, and print a statement # if was actually expected to exist cache_exist = os.path.exists(cache_path) print(f"> cache file exists={cache_exist}") if cache_expected_to_exist and not cache_exist: print("=== Cache does not exist! ====") # apply the transformation with the new fingerprint dset = dset.map( Transformation(), batched=True, num_proc=num_proc, new_fingerprint=new_fingerprint, desc="mapping dataset with transformation") generate_dataset() for num_proc in [1, 2]: print(f"# num_proc={num_proc}, first pass") # first pass to generate the cache (always create a new cache here) process_dataset_with_cache(remove_cache=True, num_proc=num_proc, cache_expected_to_exist=False) print(f"# num_proc={num_proc}, second pass") # second pass, expects the cache to exist process_dataset_with_cache(remove_cache=False, num_proc=num_proc, cache_expected_to_exist=True) os.remove(filename) ``` ## Expected results In the above python example, with `num_proc=2`, the **cache file should exist in the second call** of `process_dataset_with_cache` ("=== Cache does not exist! ====" should not be printed). When the cache is successfully created, `map()` is called only one time. ## Actual results In the above python example, with `num_proc=2`, the **cache does not exist in the second call** of `process_dataset_with_cache` (this results in printing "=== Cache does not exist! ===="). Because the cache doesn't exist, the `map()` method is executed a second time and the dataset is not loaded from the cache. ## Environment info - `datasets` version: 1.12.1 - Platform: macOS-10.16-x86_64-i386-64bit - Python version: 3.8.8 - PyArrow version: 5.0.0 Almost a year later and I'm in a similar boat. Using custom fingerprints and when using multiprocessing the cached datasets are saved with a template at the end of the filename (something like "000001_of_000008" for every process of num_proc). So if in the next time you run the script you set num_proc to a different number, the cache cannot be used. Is there any way to get around this? I am processing a huge dataset so I do the processing on one machine and then transfer the processed data to another in its cache dir but currently that's not possible due to num_proc mismatch.
[ -0.11258691549301147, 0.11656124889850616, -0.015767037868499756, 0.06115548312664032, -0.11848461627960205, -0.12406128644943237, 0.38619452714920044, 0.3515928089618683, 0.30126065015792847, -0.09979857504367828, 0.2086915373802185, 0.32950177788734436, 0.039160825312137604, -0.14310753345489502, -0.01975294202566147, 0.3910207450389862, 0.3168308138847351, -0.06824485957622528, -0.03893963247537613, -0.09951721131801605, -0.47937220335006714, 0.027748484164476395, -0.3548877239227295, -0.27843499183654785, -0.3435044586658478, 0.07110357284545898, -0.15922218561172485, 0.13623347878456116, 0.12198923528194427, -0.3866123855113983, 0.2304467111825943, 0.05937404930591583, -0.07521836459636688, 0.43109363317489624, -0.00011417197674745694, -0.05672354996204376, 0.25171276926994324, 0.007910585030913353, 0.05904598906636238, -0.019584879279136658, -0.37392377853393555, -0.26856496930122375, -0.22342315316200256, -0.19984984397888184, -0.1342518925666809, -0.09890630841255188, 0.08215475082397461, -0.4035896360874176, 0.188082754611969, 0.26695477962493896, 0.2029106169939041, 0.014649957418441772, -0.1780855804681778, 0.10818828642368317, 0.07609248161315918, 0.17854681611061096, -0.15030182898044586, -0.02508217841386795, 0.22323837876319885, -0.193635031580925, -0.321895033121109, 0.17305545508861542, -0.0006531327962875366, 0.07362595945596695, 0.46845921874046326, 0.22190244495868683, 0.22863954305648804, -0.2857307493686676, 0.1566767543554306, -0.0031066834926605225, 0.058594461530447006, -0.22119325399398804, -0.4096219539642334, -0.3232637941837311, -0.40607950091362, -0.008202757686376572, 0.3329612910747528, -0.03619701415300369, -0.016845935955643654, 0.06158030778169632, -0.5032267570495605, 0.3311186730861664, 0.2923625409603119, 0.14716054499149323, 0.06379136443138123, 0.05092855915427208, 0.0886196494102478, 0.12078572809696198, -0.06202143803238869, -0.23445163667201996, 0.08438561856746674, -0.2585543692111969, -0.1525861620903015, 0.26922276616096497, -0.025290872901678085, 0.028614215552806854, 0.29561129212379456, 0.17235037684440613, 0.1807039976119995, -0.0028712302446365356, 0.1553746461868286, 0.14630228281021118, -0.0380607470870018, 0.21791818737983704, 0.192038893699646, 0.16099122166633606, 0.03237338736653328, 0.3685815632343292, 0.08265022933483124, -0.23352573812007904, -0.44297972321510315, 0.10691756755113602, 0.3875390887260437, -0.1421607881784439, 0.6534632444381714, 0.04372763633728027, -0.07156383246183395, -0.10085422545671463, 0.09422825276851654, 0.004201000556349754, -0.15444250404834747, -0.14494527876377106, 0.24028539657592773, 0.21145102381706238, -0.01228424720466137, 0.08952465653419495, -0.16450387239456177, 0.10041584074497223, -0.24359524250030518, 0.26168641448020935, -0.23627015948295593, -0.06275686621665955, -0.3793405294418335, 0.29620882868766785, 0.25573527812957764, 0.027915209531784058, 0.20422321557998657, 0.25283098220825195, 0.023664597421884537, -0.18048937618732452, 0.22603917121887207, -0.26985231041908264, 0.538331925868988, -0.024264249950647354, -0.3987639248371124, 0.12208492308855057, -0.0585365854203701, 0.12976044416427612, -0.20448607206344604, 0.27393200993537903, -0.19893571734428406, 0.043698739260435104, 0.34746253490448, 0.10774792730808258, -0.3829646706581116, 0.1285945177078247, -0.0849238708615303, 0.1277652382850647, 0.3259255290031433, -0.3512028157711029, 0.029942765831947327, -0.23412348330020905, -0.5851396918296814, -0.37700194120407104, -0.10538230091333389, 0.47142720222473145, 0.11043606698513031, -0.14692360162734985, 0.19961407780647278, 0.3393436372280121, 0.12697041034698486, 0.15853819251060486, -0.17987877130508423, -0.012261010706424713, -0.35483425855636597, 0.3470659852027893, 0.05270572751760483, -0.46315065026283264, -0.8054304122924805, 0.19406628608703613, 0.01983679085969925, 0.28496235609054565, -0.25240379571914673, 0.2596902847290039, 0.08378545939922333, -0.3804091811180115, -0.14888183772563934, 0.2633270025253296, 0.06692882627248764, 0.23778724670410156, -0.3906364142894745, -0.18160490691661835, 0.20428399741649628, -0.12432384490966797, 0.028670920059084892, 0.3220614492893219, 0.19090968370437622, -0.1716928482055664, 0.15656070411205292, -0.025995898991823196, 0.13940687477588654, 0.23259888589382172, 0.13355430960655212, -0.35401618480682373, 0.09758137911558151, 0.1032649353146553, -0.3816804885864258, 0.45309916138648987, -0.10137662291526794, -0.22597470879554749, -0.09740996360778809, 0.1298208236694336, 0.10111352801322937, -0.15462259948253632, -0.1785898059606552, -0.21628373861312866, 0.06397628784179688, 0.26281285285949707, 0.3670862913131714, -0.2023705691099167, 0.08091042935848236, 0.3404200077056885, 0.21992985904216766, -0.10817454755306244, -0.33243587613105774, -0.02615901455283165, 0.2252342700958252, -0.1553073525428772, -0.298174649477005, -0.024564020335674286, 0.4082881212234497, -0.1921357959508896, -0.20383912324905396, 0.20589563250541687, 0.16270767152309418, 0.10131648927927017, -0.2682017982006073, 0.24454087018966675, 0.07258174568414688, -0.022911500185728073, 0.21895816922187805, 0.15487980842590332, 0.12651173770427704, -0.2247428596019745, -0.12052293866872787, 0.6013139486312866, 0.02042209729552269, 0.12980833649635315, -0.16723757982254028, -0.26048868894577026, 0.016414424404501915, -0.008477289229631424, 0.1057501882314682, -0.19967208802700043, -0.15693305432796478, 0.1319083571434021, 0.5416610240936279, 0.12039852142333984, 0.0175662562251091, 0.33516058325767517, 0.31883955001831055, 0.09515194594860077, 0.022005822509527206, 0.044478412717580795, -0.09425678104162216, -0.3260907232761383, 0.06678619980812073, 0.2325776070356369, 0.5157179832458496, 0.06004908308386803, 0.09772138297557831, -0.007718758657574654, 0.0021700463257730007, -0.0910496786236763, -0.025552429258823395, -0.1961430460214615, -0.052143801003694534, -0.03675816208124161, 0.4138731062412262, -0.11033102124929428, -0.0029258020222187042, -0.014761954545974731, 0.22904600203037262, 0.042155466973781586, -0.1423853635787964, 0.15864816308021545, -0.1542542576789856, 0.42657652497291565, 0.022610533982515335, -0.19683325290679932, 0.02639012783765793, -0.32791996002197266, -0.1847744882106781, 0.3959241807460785, 0.01746264100074768, 0.0593913197517395, -0.2548629343509674, -0.22068367898464203, -0.09355217218399048, -0.3701072335243225, -0.24635745584964752, -0.14627565443515778, -0.14500588178634644, -0.05775298550724983, 0.12838436663150787, 0.03630795329809189, 0.011430811136960983, -0.1244664415717125, -0.11210781335830688, -0.2261989563703537, -0.14516392350196838, -0.009519156068563461, -0.09532403945922852, 0.17508697509765625, -0.15453627705574036, -0.14273665845394135, -0.2333957701921463, 0.08030331134796143, 0.2684290409088135, -0.4073776304721832, -0.1769203543663025, 0.059468381106853485, 0.06619696319103241, -0.0847533717751503, -0.014855543151497841, -0.03395852446556091, -0.12698481976985931, -0.06253920495510101, 0.19354750216007233, 0.11407668888568878, 0.1619165539741516, 0.29947566986083984, 0.18336082994937897, -0.10508206486701965, 0.05538993328809738, -0.02501758746802807, -0.28181302547454834, -0.557395875453949, 0.47930771112442017, -0.12130144983530045, -0.13592848181724548, -0.13774289190769196, -0.10521905869245529, -0.11392644047737122, 0.45545780658721924, -0.4010353684425354, -0.3724502921104431, -0.18388132750988007, 0.7493662238121033, 0.15697702765464783, -0.2589912712574005, 0.3056100606918335, -0.03597255423665047, -0.048665259033441544, -0.3839777410030365, -0.49206894636154175, 0.0787426233291626, 0.09079185873270035, 0.16454504430294037, 0.3155909478664398, 0.14979219436645508, 0.030662845820188522, 0.6485082507133484, 0.36720603704452515, -0.5198047161102295, 0.18493765592575073, 0.11441458761692047, 0.060588520020246506, -0.2385772168636322, -0.2028324007987976, 0.06849908828735352, -0.057087868452072144, 0.05493916571140289, 0.02779363840818405, 0.17051702737808228, -0.19793882966041565, -0.056358788162469864, 0.008200012147426605, -0.4241653084754944, -0.2546488344669342, 0.05491943657398224, -0.1802775263786316, 0.14500856399536133, 0.15764400362968445, 0.5402119755744934, -0.5638545155525208, -0.2608463168144226, -0.08400774002075195, -0.14698466658592224, 0.41314995288848877, -0.0030468341428786516, -0.1599487066268921, 0.10424790531396866, -0.5813407301902771, 0.24414636194705963, 0.25781139731407166, 0.4286161959171295, 0.010308545082807541, -0.25063416361808777, -0.06663131713867188, -0.17641006410121918, 0.6912650465965271, -0.37236717343330383, 0.3657488226890564, 0.15865306556224823, -0.28609830141067505, -0.1351652443408966, 0.09385499358177185, 0.14361831545829773, 0.4348350465297699, 0.27677106857299805, 0.44280141592025757, 0.024864688515663147, 0.034534700214862823, -0.4122464954853058, 0.19089822471141815, 0.146783247590065, -0.3810139000415802, 0.0399048738181591, -0.05701654031872749, 0.03755735605955124, -0.013925112783908844, -0.0007098373025655746, -0.035566624253988266, 0.11641291528940201, -0.0657847672700882, -0.20984600484371185, -0.059321045875549316, -0.03569343686103821, 0.16624321043491364, 0.337384432554245, -0.12432469427585602, 0.45033735036849976, 0.26483333110809326, 0.039371803402900696, 0.17478588223457336, 0.33289507031440735, -0.28012335300445557, -0.07147230207920074, 0.0364915207028389, -0.018332216888666153, -0.42785319685935974, 0.2911998927593231, -0.028384175151586533, -0.12427147477865219, 0.12253044545650482, -0.16203519701957703, -0.2004358470439911, -0.06108762323856354, -0.0016109971329569817, 0.17033901810646057, -0.2793624997138977, -0.398588627576828, 0.33862385153770447, 0.20865756273269653, -0.25867119431495667, 0.44165533781051636, -0.46922892332077026, -0.22237101197242737, 0.25864702463150024, 0.0358685739338398, 0.7318882942199707, -0.005673564970493317, 0.0410480722784996, -0.1770724058151245, 0.11445234715938568, 0.0789121687412262, 0.2711598873138428, 0.1049431562423706, -0.24025623500347137, -0.18767690658569336, -0.009220777079463005, -0.287756085395813, -0.1540108323097229, 0.23297441005706787, -0.11954504251480103, 0.19333963096141815, -0.041733287274837494, 0.28855064511299133, -0.1315218210220337, 0.042681269347667694, 0.31184348464012146, -0.17850615084171295, 0.04950764775276184, 0.25627440214157104, 0.15754806995391846, 0.12411510944366455, 0.17573419213294983, -0.11289513856172562, -0.2318655401468277, -0.029392428696155548, -0.0495292954146862, 0.22385141253471375, -0.25074702501296997, 0.1634991616010666, 0.39920666813850403, -0.10994039475917816, -0.04574759304523468, 0.19729435443878174, 0.19551321864128113, -0.1601489782333374, -0.15942132472991943, 0.07019324600696564, 0.5374317765235901, 0.5143430829048157, 0.16206906735897064, -0.26927047967910767, 0.13417160511016846, 0.11770261079072952, -0.11411700397729874, -0.002968929708003998, -0.21865737438201904, -0.419480562210083, -0.42747193574905396, 0.4585963487625122, -0.17869514226913452, -0.09105667471885681, 0.05617811158299446, 0.03809930011630058, -0.16020089387893677, -0.21282531321048737, 0.146864652633667, 0.45490527153015137, -0.008484316058456898, 0.4117089509963989, -0.3164346516132355, -0.4244231581687927, -0.05585698410868645, 0.6185292601585388, 0.006749948486685753, -0.005922406911849976, 0.27455657720565796, -0.15187297761440277, -0.19352595508098602, -0.15222153067588806, -0.08120758831501007, -0.09813248366117477, -0.18382707238197327, 0.12210102379322052, -0.2068580985069275, 0.033493608236312866, 0.1912766396999359, 0.07648855447769165, -0.10701273381710052, 0.05145266652107239, 0.09407076239585876, -0.3145790994167328, -0.358599990606308, -0.2865385413169861, -0.11928346753120422, 0.07514660060405731, 0.02046295627951622, 0.02012917399406433, -0.17315271496772766, 0.1843705028295517, -0.30759507417678833, 0.19535332918167114, 0.04866623133420944, 0.1511596441268921, -0.06763175874948502, 0.024493340402841568, 0.23420485854148865, -0.10149329900741577, 0.06535322219133377, 0.29662632942199707, -0.48689523339271545, -0.19782903790473938, -0.08594094216823578, 0.09842347353696823, 0.16031956672668457, -0.30842551589012146, -0.22104443609714508, 0.07306776940822601, 0.0260126031935215, -0.39683711528778076, 0.11476242542266846, 0.3971938490867615, -0.09303726255893707, 0.03941230848431587, 0.22107647359371185, 0.03303609415888786, 0.2822134494781494, 0.08110398799180984, -0.14120590686798096, -0.01744966208934784, -0.23948529362678528, 0.4071968197822571, 0.011540895327925682, 0.09368138015270233, 0.11501435190439224, -0.07258111983537674, 0.013064496219158173, 0.1561986804008484, 0.3188040256500244, -0.20880933105945587, 0.14606347680091858, 0.27204039692878723, -0.021002264693379402, 0.09915636479854584, -0.14211207628250122, -0.2073839008808136, 0.09056895971298218, 0.22818931937217712, -0.10842018574476242, -0.30006149411201477, 0.27496129274368286, 0.3501660227775574, 0.19768984615802765, 0.2313382625579834, 0.14830856025218964, -0.32771843671798706, 0.015288546681404114, 0.05050213634967804, 0.29850655794143677, -0.45919257402420044, 0.07647928595542908, 0.3280447721481323, 0.08912965655326843, 0.052409395575523376, 0.40792885422706604, 0.18855337798595428, -0.12310687452554703, 0.5156185626983643, 0.16626670956611633, 0.3609532415866852, 0.12957599759101868, 0.006598219275474548, -0.3069338798522949, -0.3739161491394043, 0.2956991493701935, 0.45035499334335327, -0.19074314832687378, 0.42418283224105835, 0.09419276565313339, 0.45216137170791626, -0.14315199851989746, 0.06891977041959763, -0.15111283957958221, 0.02922653779387474, -0.13205286860466003, -0.31048786640167236, -0.037211667746305466, -0.20180243253707886, -0.047329969704151154, -0.022769009694457054, -0.15734903514385223, -0.14717695116996765, 0.5516809225082397, 0.13969695568084717, -0.049992844462394714, -0.21551929414272308, -0.21109303832054138, -0.13980159163475037, 0.25675737857818604, -0.24339722096920013, 0.2725440263748169, -0.16119913756847382, -0.2117677927017212, 0.3310508131980896, -0.0004948284476995468, 0.49891695380210876, 0.4054945409297943, -0.11002770066261292, 0.24314111471176147, 0.06027770787477493, -0.031145991757512093, -0.1935775727033615, 0.36105969548225403, -0.20139798521995544, -0.3644644021987915, 0.16500112414360046, 0.09267716854810715, -0.12432614713907242, 0.14854995906352997, -0.02910187467932701, 0.4075523316860199, -0.0851995050907135, 0.4404507577419281, -0.21970507502555847, -0.027634844183921814, 0.03278130292892456, 0.10330148041248322, 0.07329379767179489, -0.29118070006370544, 0.2661936581134796, -0.21615947782993317, 0.33636581897735596, 0.006204383447766304, 0.07381641864776611, -0.2708985209465027, 0.2704450488090515, 0.1943826973438263, -0.20124226808547974, -0.2543027400970459, 0.1683092564344406, -0.3071586489677429, 0.22792954742908478, -0.34634295105934143, 0.16183313727378845, -0.20171310007572174, 0.2006840705871582, -0.17220938205718994, -0.10169070959091187, 0.15187475085258484, 0.06669923663139343, 0.03490661457180977, 0.5869483947753906, -0.34668710827827454, 0.09230688959360123, -0.18604059517383575, 0.026012172922492027, 0.24734455347061157, -0.5080570578575134, 0.16585494577884674, -0.002565935254096985, 0.23317140340805054, -0.10049299895763397, -0.16823363304138184, 0.045501697808504105, 0.3093849718570709, 0.7304586172103882, 0.4056198298931122, 0.1935492306947708, -0.0883546769618988, -0.07794259488582611, -0.3839724063873291, 0.025501618161797523, -0.09386074542999268, 0.05073019117116928, -0.10617855191230774, 0.2416701316833496, -0.3015611469745636, -0.06773830950260162, -0.1308734118938446, -0.031105753034353256, -0.02516128681600094, -0.26837244629859924, -0.09270888566970825, 0.0900271087884903, -0.34892985224723816, 0.06662445515394211, -0.08779553323984146, 0.4083452820777893, -0.004365961998701096, 0.23606546223163605, -0.2845376133918762, -0.14347325265407562, 0.345011830329895, -0.6891112327575684, -0.23176580667495728, -0.04966951161623001, 0.07119768857955933, -0.25362372398376465, -0.28917837142944336, -0.31519827246665955, -0.07352914661169052, 0.28796613216400146, 0.05709484964609146, -0.1766723096370697, -0.14817093312740326, -0.2677890658378601, -0.027581684291362762, -0.07508756220340729, 0.06568187475204468, 0.17891746759414673, -0.22087664902210236, 0.26025116443634033, -0.0672304779291153 ]
https://github.com/huggingface/datasets/issues/3040
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset
Hi, the `save_to_disk` docstring explains that `flatten_indices` has to be called on a dataset before saving it to save only the shard/slice of the dataset.
## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0
25
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset ## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0 Hi, the `save_to_disk` docstring explains that `flatten_indices` has to be called on a dataset before saving it to save only the shard/slice of the dataset.
[ -0.1809476763010025, -0.15760834515094757, 0.08064687252044678, 0.24569818377494812, 0.10636337846517563, 0.19082742929458618, 0.25356096029281616, 0.41501063108444214, 0.07993754744529724, 0.45576006174087524, 0.15093860030174255, 0.38725343346595764, -0.15417124330997467, 0.004450494423508644, 0.0994572713971138, 0.06933198869228363, 0.18671372532844543, 0.17676720023155212, 0.07185505330562592, -0.24153028428554535, -0.33845949172973633, -0.004971468821167946, -0.20060500502586365, -0.25619083642959595, -0.5940173268318176, -0.12410678714513779, -0.27231332659721375, 0.3448466658592224, -0.24003414809703827, -0.08833916485309601, 0.2154426872730255, -0.20622487366199493, -0.019647106528282166, 0.3707505166530609, -0.00011247167276451364, -0.016819287091493607, 0.3227282166481018, -0.15231497585773468, -0.5344422459602356, -0.03641015291213989, -0.10718324780464172, -0.29710090160369873, -0.00032480567460879683, -0.35623738169670105, 0.11944498866796494, 0.26004043221473694, 0.026944784447550774, -0.09010650217533112, 0.0172029510140419, 0.012855070643126965, 0.21953952312469482, 0.3787955343723297, -0.2591150403022766, -0.23754549026489258, 0.1458403468132019, 0.21240726113319397, -0.2900450825691223, 0.3401021361351013, -0.008297644555568695, 0.05536242574453354, 0.07369748502969742, 0.03743533045053482, -0.10378914326429367, -0.20426808297634125, -0.022133149206638336, 0.22299227118492126, 0.08378547430038452, -0.41171902418136597, 0.19773301482200623, 0.1641884744167328, 0.27041396498680115, -0.3860100507736206, -0.29152411222457886, -0.3839530050754547, 0.05686330050230026, -0.1729193925857544, 0.06732568889856339, 0.34281498193740845, 0.05640629306435585, 0.04144089296460152, -0.016960909590125084, 0.07065320014953613, -0.053133998066186905, 0.07196465879678726, 0.14948610961437225, 0.0740206390619278, 0.028972677886486053, 0.14226296544075012, 0.26483142375946045, 0.062322139739990234, 0.020859139040112495, -0.4156862199306488, -0.06094827130436897, -0.020319823175668716, -0.33618369698524475, -0.27361205220222473, -0.02878863364458084, -0.11647538095712662, 0.22214826941490173, 0.14230221509933472, 0.034167397767305374, -0.04485214501619339, 0.12953507900238037, 0.08948589861392975, 0.1833879053592682, 0.35114753246307373, -0.009114950895309448, 0.24398232996463776, 0.22073966264724731, -0.059082429856061935, 0.251343309879303, 0.11893317103385925, -0.03643780201673508, -0.020800083875656128, 0.23629404604434967, -0.1164131686091423, 0.10028889775276184, -0.08849964290857315, -0.47276461124420166, 0.1567942202091217, -0.01438584178686142, 0.18019559979438782, -0.11080203205347061, 0.20018211007118225, -0.048555899411439896, -0.13134196400642395, -0.1518021821975708, 0.36417412757873535, -0.39456507563591003, 0.10709718614816666, -0.2818075716495514, 0.0034413058310747147, 0.07909275591373444, -0.07079122215509415, 0.1393570750951767, -0.15255197882652283, 0.14562849700450897, 0.1426643580198288, 0.0012428611516952515, 0.2042502760887146, 0.22054971754550934, -0.3194163739681244, 0.14578747749328613, 0.3391512930393219, 0.22451037168502808, 0.16464383900165558, -0.024024736136198044, -0.5527135729789734, -0.19254463911056519, 0.361639142036438, -0.013921506702899933, -0.2650309205055237, -0.2030184417963028, 0.19089525938034058, -0.07744815945625305, 0.09344522655010223, -0.22796961665153503, 0.22423352301120758, 0.10702884942293167, 0.02058856561779976, 0.07712195813655853, -0.049975961446762085, -0.15765760838985443, -0.410412073135376, 0.20296010375022888, 0.2047046720981598, -0.31164079904556274, 0.16899728775024414, -0.009134780615568161, 0.09014572203159332, 0.200903058052063, 0.2160712331533432, -0.02515614591538906, 0.12477041780948639, -0.16357438266277313, 0.4801807403564453, 0.2066604048013687, -0.012037225067615509, -0.6134503483772278, -0.027849506586790085, -0.13562364876270294, 0.07376198470592499, -0.040450163185596466, 0.2520148456096649, 0.100773885846138, 0.06524255126714706, 0.12900111079216003, 0.302190363407135, 0.01691589131951332, -0.07664809376001358, -0.5265498757362366, -0.1743299663066864, 0.05763915926218033, 0.11351476609706879, -0.08119754493236542, 0.053486019372940063, 0.020537905395030975, 0.16815540194511414, 0.3211294710636139, 0.03291759639978409, 0.19022805988788605, 0.2687308192253113, 0.25117260217666626, -0.5698818564414978, -0.004440988879650831, -0.18716123700141907, -0.38163843750953674, 0.212324857711792, -0.09976017475128174, 0.029660575091838837, 0.1844378113746643, -0.3699107766151428, -0.41258347034454346, -0.048557620495557785, -0.09256826341152191, 0.027584420517086983, 0.09510242938995361, -0.044890984892845154, 0.20035666227340698, 0.026349376887083054, -0.06419162452220917, 0.07390262931585312, -0.22411446273326874, -0.10070831328630447, -0.5723361372947693, 0.38454094529151917, -0.10505767911672592, -0.353745698928833, -0.005892738699913025, 0.17541876435279846, 0.1860029697418213, -0.11796294897794724, -0.13335758447647095, 0.3074072301387787, -0.06403397023677826, 0.024482272565364838, -0.03902505338191986, -0.0326380729675293, 0.11872304975986481, 0.07730528712272644, 0.1364893615245819, 0.25665074586868286, 0.2901670038700104, -0.035801056772470474, -0.476217657327652, 0.22564470767974854, -0.2718869149684906, -0.06819527596235275, -0.12768101692199707, -0.05613008886575699, 0.08092432469129562, -0.0691312700510025, -0.03785257041454315, -0.20778900384902954, 0.056236378848552704, 0.26862141489982605, 0.04952595755457878, -0.09540271759033203, -0.23915551602840424, 0.1801368147134781, 0.3591171205043793, -0.20724163949489594, 0.3417232930660248, 0.2792397737503052, -0.19283202290534973, -0.14532256126403809, 0.033828284591436386, -0.026097066700458527, 0.5663651823997498, 0.1432141661643982, 0.12670205533504486, -0.11029601842164993, -0.20608127117156982, -0.18574762344360352, 0.29502978920936584, 0.12481380999088287, -0.17382988333702087, 0.30178144574165344, 0.09417933225631714, -0.07655921578407288, -0.39635488390922546, 0.4122895300388336, 0.06339206546545029, 0.1480901837348938, -0.043510593473911285, -0.07000954449176788, -0.2579233944416046, 0.03691544383764267, 0.08731495589017868, -0.04277878254652023, -0.1553042232990265, -0.29560545086860657, 0.058496229350566864, 0.5243616104125977, -0.18946607410907745, -0.005395771935582161, 0.018422428518533707, 0.44862085580825806, 0.1498338133096695, 0.020998124033212662, -0.024395454674959183, 0.10898222774267197, -0.36499911546707153, 0.08843627572059631, 0.0903603732585907, 0.3224530518054962, 0.33138173818588257, -0.040064260363578796, -0.017203034833073616, -0.1452060043811798, -0.16948622465133667, -0.0037443675100803375, -0.1928984820842743, 0.5611331462860107, 0.0071932971477508545, 0.1484985053539276, -0.2511809170246124, 0.1157362312078476, 0.06950923800468445, 0.12074066698551178, -0.1740407943725586, 0.23994100093841553, 0.06455141305923462, -0.18910463154315948, -0.25742071866989136, -0.3324149549007416, -0.30961424112319946, -0.21629698574543, 0.1370684802532196, -0.002460222691297531, 0.13743659853935242, 0.1419249027967453, 0.22575810551643372, 0.003906499594449997, 0.17300349473953247, -0.30417850613594055, -0.42623576521873474, -0.2583119571208954, 0.3981923460960388, -0.1674565225839615, -0.4312320053577423, -0.13075807690620422, -0.412043035030365, -0.2913597524166107, -0.24916468560695648, -0.5085940957069397, -0.2731797993183136, -0.2647988796234131, 0.07676959037780762, -0.10128945112228394, 0.18763047456741333, 0.43296313285827637, -0.1366918832063675, 0.007290573790669441, -0.1077185720205307, -0.3787585198879242, 0.10941623896360397, 0.6233231425285339, 0.33914685249328613, -0.17505919933319092, 0.07401008903980255, 0.1227031797170639, 0.26482102274894714, 0.5041713118553162, 0.1349877268075943, 0.3246050477027893, -0.025841770693659782, 0.3386654257774353, -0.4063771665096283, -0.3055649995803833, 0.024931853637099266, -0.04189251363277435, -0.2154117375612259, 0.16607514023780823, -0.03011021390557289, -0.06916960328817368, 0.22065100073814392, -0.14328628778457642, 0.08145936578512192, -0.2529395818710327, 0.31321707367897034, 0.13260215520858765, -0.11459938436746597, 0.21710462868213654, 0.12980741262435913, -0.14669951796531677, -0.09244915843009949, -0.05965369567275047, -0.014953382313251495, 0.25183194875717163, -0.12240011245012283, -0.3494623005390167, -0.030558394268155098, -0.5364782810211182, 0.10570796579122543, 0.09137613326311111, 0.2547118663787842, 0.06191941723227501, -0.13216593861579895, 0.12325038015842438, 0.17376326024532318, 0.7487340569496155, -0.3830302655696869, -0.14949645102024078, 0.4169183671474457, 0.13813170790672302, -0.7982856035232544, 0.057598087936639786, -0.11159667372703552, 0.27961936593055725, -0.018843937665224075, 0.5624135732650757, -0.3875039517879486, 0.028673406690359116, 0.20276665687561035, 0.6242923736572266, -0.3589979112148285, -0.04007023200392723, -0.420489102602005, -0.15947917103767395, -0.23569472134113312, 0.1196843609213829, -0.08855221420526505, 0.25656676292419434, -0.023866938427090645, -0.045039497315883636, -0.2402857095003128, -0.35631057620048523, 0.0010798051953315735, 0.06255996227264404, 0.5620766282081604, -0.05676446855068207, 0.4440241754055023, -0.05621334910392761, 0.04306177794933319, -0.10258762538433075, 0.6471168398857117, -0.10218381881713867, 0.432754248380661, 0.4237678050994873, 0.04171228036284447, 0.18473529815673828, 0.5298871994018555, 0.045030929148197174, -0.030408240854740143, -0.32600438594818115, 0.12310771644115448, -0.5695065855979919, -0.058568324893713, -0.09935152530670166, -0.15113341808319092, -0.18142956495285034, 0.04569017142057419, 0.6157163977622986, -0.13149990141391754, 0.015429370105266571, 0.12881307303905487, 0.15165063738822937, -0.02866271324455738, 0.5707931518554688, 0.08816171437501907, 1.1782716512680054, 0.31319886445999146, 0.3699631989002228, 0.11779257655143738, 0.05078046768903732, 0.021213974803686142, -0.006873328238725662, 0.2866959571838379, -0.4577906131744385, -0.38757941126823425, 0.09477446228265762, -0.16784438490867615, -0.17799508571624756, -0.05195876955986023, -0.3754054307937622, 0.16282574832439423, -0.3178015947341919, 0.16251857578754425, -0.1886516958475113, 0.18587292730808258, -0.43483155965805054, -0.28142115473747253, 0.2553520202636719, 0.1592429280281067, 0.31824928522109985, 0.012846745550632477, 0.16565677523612976, -0.09242857992649078, -0.31483015418052673, -0.05116986483335495, 0.02261587232351303, 0.06380628049373627, -0.10008068382740021, 0.2999175786972046, -0.19633059203624725, -0.3779584765434265, -0.157782182097435, -0.03857441619038582, 0.28127044439315796, 0.37995821237564087, -0.12034440040588379, 0.01217292807996273, -0.047868743538856506, 0.29079028964042664, 0.03429371863603592, -0.08703656494617462, 0.14270153641700745, 0.05667032301425934, -0.14696627855300903, -0.23200109601020813, -0.1031452938914299, -0.022887997329235077, -0.23702120780944824, 0.11623912304639816, 0.1313956379890442, -0.38035160303115845, -0.5229949355125427, -0.1011296808719635, -0.058908611536026, -0.40264132618904114, 0.1399395912885666, 0.13382908701896667, 0.02678997442126274, 0.4578516185283661, -0.048617299646139145, -0.2966035008430481, -0.14474859833717346, 0.45094987750053406, 0.2740956246852875, 0.19877983629703522, 0.30911025404930115, -0.44510477781295776, -0.09258346259593964, -0.23655223846435547, 0.49655765295028687, -0.08050106465816498, -0.2603079080581665, 0.3644474148750305, -0.31316694617271423, -0.1086236983537674, -0.31941771507263184, 0.01207813248038292, 0.20853564143180847, -0.011286228895187378, -0.3115013837814331, -0.18515464663505554, -0.13354307413101196, 0.09752106666564941, 0.4229351878166199, 0.5104905366897583, -0.04832983762025833, -0.20134848356246948, -0.18083804845809937, 0.1785978078842163, -0.34033194184303284, 0.07638208568096161, -0.25809478759765625, 0.31043002009391785, -0.1376062035560608, -0.033519238233566284, 0.19947609305381775, -0.31775566935539246, 0.08678518980741501, 0.3904881477355957, -0.05399966239929199, -0.28595709800720215, -0.2714773118495941, 0.11724961549043655, 0.09882447123527527, -0.1296178549528122, 0.05114903673529625, -0.041594307869672775, -0.10277286171913147, -0.16642501950263977, 0.15131185948848724, 0.09631992131471634, -0.05837118625640869, -0.11342675238847733, 0.31031808257102966, 0.015018131583929062, -0.004258830100297928, 0.023488955572247505, -0.01432463526725769, 0.07591717690229416, -0.08317264914512634, 0.180332213640213, -0.07660888880491257, -0.04531702771782875, -0.24565841257572174, -0.14421755075454712, 0.030453123152256012, -0.06826222687959671, 0.07029686123132706, -0.022058293223381042, -0.08852457255125046, -0.05846024677157402, 0.23933908343315125, 0.2604295015335083, -0.22502538561820984, -0.2046167105436325, 0.2988019585609436, 0.22911545634269714, -0.10053427517414093, -0.3801712691783905, 0.1059645563364029, -0.0016029411926865578, 0.025846105068922043, 0.12559328973293304, 0.3103979527950287, 0.22296351194381714, -0.3913891315460205, -0.0024975892156362534, 0.13418667018413544, 0.025883395224809647, -0.05754057690501213, 0.4859201908111572, -0.16785137355327606, -0.010259557515382767, 0.20231536030769348, -0.17049400508403778, 0.2492598295211792, 0.4352070093154907, 0.003186434507369995, 0.6322427988052368, 0.26085978746414185, -0.21427518129348755, 0.020669855177402496, -0.2657678723335266, 0.11078669130802155, 0.023084886372089386, -0.16110476851463318, 0.3072734475135803, 0.15229260921478271, 0.16894382238388062, -0.4930610656738281, -0.15330110490322113, -0.2475423514842987, 0.07254943251609802, -0.3863580524921417, -0.051445767283439636, -0.011837664991617203, -0.16073162853717804, -0.0872625932097435, -0.01018480584025383, -0.17735783755779266, -0.28965598344802856, 0.15822872519493103, 0.09666559100151062, -0.09990879893302917, 0.1507338434457779, 0.02078964188694954, 0.2822010815143585, 0.06947532296180725, -0.25531378388404846, -0.008915098384022713, 0.2264508306980133, -0.018955573439598083, -0.3264181315898895, 0.49580326676368713, 0.41737163066864014, 0.17175507545471191, -0.3538123369216919, 0.007830476388335228, 0.3738967776298523, -0.019341597333550453, 0.007126986980438232, 0.20814964175224304, -0.04215739667415619, -0.018652021884918213, 0.33760231733322144, 0.11071759462356567, -0.24401503801345825, -0.1172351986169815, 0.21530413627624512, 0.0772763267159462, -0.42086464166641235, 0.19258186221122742, -0.009911876171827316, -0.1690269112586975, -0.058036014437675476, -0.07723567634820938, -0.15349453687667847, 0.0126065444201231, 0.5117272138595581, -0.0804462730884552, 0.2956418991088867, -0.2919516861438751, 0.09981613606214523, -0.21345080435276031, 0.5274792909622192, 0.05914170667529106, -0.42279475927352905, -0.35386067628860474, 0.1241680383682251, -0.3841005563735962, 0.05731986090540886, -0.10136766731739044, 0.11130239069461823, 0.17457520961761475, 0.3061278164386749, -0.1675696074962616, 0.22427362203598022, -0.14691291749477386, 0.20122531056404114, 0.1111474558711052, 0.4832462966442108, -0.22429969906806946, 0.01260928064584732, -0.05830715596675873, -0.13366399705410004, 0.07749245315790176, -0.7374876141548157, 0.26066750288009644, 0.01053879875689745, 0.0876937136054039, 0.02464866265654564, -0.017389964312314987, 0.13341745734214783, 0.509745717048645, 0.494139701128006, 0.18099242448806763, 0.1563747525215149, -0.2964325249195099, -0.06164330244064331, 0.018576912581920624, 0.06136571243405342, -0.1375250667333603, -0.036374859511852264, 0.155465230345726, 0.4584283232688904, -0.1845625340938568, 0.024163341149687767, -0.027904583141207695, -0.04290107637643814, 0.03022223711013794, 0.14934249222278595, -0.13930857181549072, 0.15150681138038635, -0.15790748596191406, 0.2534415125846863, 0.2148885577917099, 0.3549879491329193, -0.08584238588809967, 0.2823910415172577, -0.08210992813110352, -0.45862019062042236, 0.4106898903846741, -0.006982864812016487, -0.20816098153591156, -0.11085426807403564, 0.24992001056671143, 0.1845492273569107, 0.027128254994750023, -0.2440761923789978, -0.14027918875217438, 0.2432594746351242, -0.13375112414360046, 0.015232935547828674, 0.3717367649078369, -0.009736442938446999, -0.06668577343225479, -0.025049744173884392, 0.5816609859466553, 0.12389815598726273, -0.28448188304901123, 0.49450621008872986, -0.5318922400474548 ]
https://github.com/huggingface/datasets/issues/3040
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset
That works! Thansk! Might be worth doing that automatically actually in case the `save_to_disk` is called on a dataset that has an indices mapping :-)
## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0
25
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset ## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0 That works! Thansk! Might be worth doing that automatically actually in case the `save_to_disk` is called on a dataset that has an indices mapping :-)
[ -0.19778689742088318, -0.1849527806043625, 0.07286867499351501, 0.21102294325828552, 0.16404788196086884, 0.17200499773025513, 0.23644040524959564, 0.4040082097053528, 0.17118023335933685, 0.4311818480491638, 0.13336525857448578, 0.4044635593891144, -0.17570066452026367, -0.021643389016389847, 0.12365889549255371, 0.06885106861591339, 0.1950649619102478, 0.16091980040073395, 0.04077158868312836, -0.20920833945274353, -0.3665637969970703, -0.039378345012664795, -0.20078101754188538, -0.23949946463108063, -0.5679108500480652, -0.1390291452407837, -0.2600003182888031, 0.3170103132724762, -0.22395069897174835, -0.14099198579788208, 0.2029298096895218, -0.18356777727603912, -0.013042749837040901, 0.3703456223011017, -0.00011005820852005854, -0.03776286169886589, 0.3083374500274658, -0.14728206396102905, -0.5062393546104431, -0.07019838690757751, -0.04574650526046753, -0.31109774112701416, -0.008848066441714764, -0.3288085162639618, 0.09491512924432755, 0.2151668667793274, 0.07917560636997223, -0.09136208146810532, 0.0012333467602729797, 0.05056972801685333, 0.2513640522956848, 0.41084858775138855, -0.24654871225357056, -0.2575869858264923, 0.12231583893299103, 0.18642830848693848, -0.31101441383361816, 0.3966171145439148, 0.04984372481703758, 0.02424710802733898, 0.07495725899934769, 0.02074817754328251, -0.07384754717350006, -0.21603691577911377, 0.0505221001803875, 0.18690218031406403, 0.09454172849655151, -0.39781132340431213, 0.18293336033821106, 0.19015035033226013, 0.26952627301216125, -0.3909195363521576, -0.2869187593460083, -0.3718160390853882, 0.07272039353847504, -0.15213866531848907, 0.09928475320339203, 0.34735360741615295, 0.042013369500637054, 0.025247832760214806, 0.0034332883078604937, 0.09284868836402893, -0.07063069194555283, 0.06942048668861389, 0.12275651097297668, 0.14490151405334473, 0.04586993157863617, 0.1241287887096405, 0.27173295617103577, 0.07369766384363174, -0.003349214792251587, -0.3851344585418701, -0.08986401557922363, -0.005683357827365398, -0.3101034164428711, -0.2732905149459839, -0.030543066561222076, -0.10671769827604294, 0.1926315724849701, 0.14447331428527832, 0.01426809560507536, -0.05913718789815903, 0.11080825328826904, 0.09052997827529907, 0.17137175798416138, 0.3588758409023285, -0.05669654160737991, 0.23537209630012512, 0.2473844587802887, -0.038470763713121414, 0.2235182225704193, 0.11611257493495941, -0.04704664275050163, -0.059105318039655685, 0.213126078248024, -0.12782955169677734, 0.0539078488945961, -0.07070725411176682, -0.4778517484664917, 0.11043113470077515, -0.04284793883562088, 0.23201316595077515, -0.04961935058236122, 0.21690213680267334, -0.10599145293235779, -0.13077911734580994, -0.12725836038589478, 0.3900386691093445, -0.39084377884864807, 0.15202243626117706, -0.2745406925678253, 0.0693812370300293, -0.0031494833528995514, -0.11552607268095016, 0.125714972615242, -0.10849447548389435, 0.15395420789718628, 0.13674581050872803, -0.03604602813720703, 0.17174607515335083, 0.23288023471832275, -0.3360839784145355, 0.13975371420383453, 0.32247254252433777, 0.23097872734069824, 0.1605299711227417, -0.07207693159580231, -0.5434203743934631, -0.1970374882221222, 0.344959020614624, 0.04515473544597626, -0.24267518520355225, -0.1659771054983139, 0.21793025732040405, -0.09899993240833282, 0.057385094463825226, -0.18799090385437012, 0.23071007430553436, 0.044905565679073334, 0.041329655796289444, 0.10909659415483475, -0.008723091334104538, -0.15542809665203094, -0.38996484875679016, 0.1429949849843979, 0.21009978652000427, -0.2669970393180847, 0.13452689349651337, 0.05784398317337036, 0.06739754974842072, 0.14840063452720642, 0.1618483066558838, -0.03363851457834244, 0.17856623232364655, -0.1696215718984604, 0.43840473890304565, 0.22840246558189392, -0.08796100318431854, -0.6092959046363831, -0.044481873512268066, -0.13916879892349243, 0.038528867065906525, -0.021806277334690094, 0.3064076900482178, 0.07807550579309464, 0.050004709511995316, 0.13820794224739075, 0.33940720558166504, 0.030091004446148872, -0.03118133172392845, -0.48853376507759094, -0.16771140694618225, 0.06532109528779984, 0.11101807653903961, -0.08436846733093262, 0.02162051945924759, 0.025253914296627045, 0.18527168035507202, 0.3233737051486969, -0.02690247818827629, 0.15998555719852448, 0.2770000696182251, 0.2414495199918747, -0.5311182737350464, -0.04658391699194908, -0.18059983849525452, -0.29711875319480896, 0.22762876749038696, -0.043540794402360916, 0.039655040949583054, 0.21414412558078766, -0.3296993374824524, -0.4157264530658722, -0.07316820323467255, -0.09657633304595947, 0.00233643501996994, 0.12090730667114258, -0.027838192880153656, 0.19017204642295837, 0.019509971141815186, -0.042080316692590714, 0.163455069065094, -0.1658807396888733, -0.06541217863559723, -0.5854560732841492, 0.362255722284317, -0.09863501042127609, -0.3251301944255829, -0.019905632361769676, 0.226220965385437, 0.18579742312431335, -0.08789010345935822, -0.11687915772199631, 0.31786012649536133, -0.0640416368842125, 0.04938451200723648, -0.04079924523830414, -0.03905615210533142, 0.14581575989723206, 0.09607820212841034, 0.13517436385154724, 0.24772745370864868, 0.28516730666160583, -0.015745628625154495, -0.4594493806362152, 0.21196889877319336, -0.24500752985477448, -0.08659683912992477, -0.1098814606666565, -0.05114739015698433, 0.07951491326093674, -0.0634501576423645, -0.02424616739153862, -0.17205917835235596, 0.06268209964036942, 0.3055984377861023, 0.14867646992206573, -0.10580141842365265, -0.2393772453069687, 0.1272457093000412, 0.3296094238758087, -0.1535169631242752, 0.36746060848236084, 0.21595242619514465, -0.24346178770065308, -0.13314896821975708, 0.009065069258213043, 0.013643939048051834, 0.5998483300209045, 0.15518006682395935, 0.09682133793830872, -0.07775416225194931, -0.24244225025177002, -0.18391668796539307, 0.30359283089637756, 0.10497376322746277, -0.17539267241954803, 0.2799508571624756, 0.13322976231575012, -0.09440381824970245, -0.43305703997612, 0.40026363730430603, 0.044456593692302704, 0.14319658279418945, -0.032062359154224396, -0.07061205804347992, -0.22517193853855133, -0.0026557818055152893, 0.09201005846261978, -0.034713611006736755, -0.1509559005498886, -0.2977166175842285, 0.05491315573453903, 0.5223662853240967, -0.17314095795154572, -0.018334094434976578, 0.055640820413827896, 0.4244436025619507, 0.10246521234512329, 0.014214832335710526, 0.010344080626964569, 0.11490020900964737, -0.3767624497413635, 0.11102943122386932, 0.0764087662100792, 0.2917807996273041, 0.4058230221271515, -0.0029615741223096848, -0.019971737638115883, -0.14762026071548462, -0.18719173967838287, -0.0304834246635437, -0.16383051872253418, 0.5393264889717102, 0.027833588421344757, 0.1262160837650299, -0.1849326193332672, 0.14181667566299438, 0.06258358806371689, 0.07913164049386978, -0.18600445985794067, 0.21476806700229645, 0.06518174707889557, -0.17252038419246674, -0.254678338766098, -0.36865317821502686, -0.3149782121181488, -0.2519778311252594, 0.13704508543014526, 0.011955909430980682, 0.11559100449085236, 0.17569006979465485, 0.22557517886161804, -0.003788900561630726, 0.21761932969093323, -0.33315756916999817, -0.4415976405143738, -0.19039525091648102, 0.41907358169555664, -0.21703138947486877, -0.4003565311431885, -0.11114649474620819, -0.4238256812095642, -0.24462512135505676, -0.2530267834663391, -0.4782189130783081, -0.31550851464271545, -0.27662113308906555, 0.08510340750217438, -0.13382990658283234, 0.1919112205505371, 0.43824923038482666, -0.13542665541172028, -0.017597083002328873, -0.12201522290706635, -0.3827521800994873, 0.09511154145002365, 0.6282554864883423, 0.35030969977378845, -0.1803288757801056, 0.09188485145568848, 0.1060125082731247, 0.1967717707157135, 0.45778223872184753, 0.13044458627700806, 0.3684525191783905, -0.08556369692087173, 0.3643559515476227, -0.39716047048568726, -0.27996036410331726, 0.03581910952925682, -0.04193440079689026, -0.1887224167585373, 0.18025298416614532, 0.0032001715153455734, -0.09617161750793457, 0.15626677870750427, -0.13311073184013367, 0.07796028256416321, -0.22646506130695343, 0.2782634496688843, 0.14632567763328552, -0.11433590203523636, 0.20080728828907013, 0.16283175349235535, -0.1916525512933731, -0.0938442125916481, -0.04138988256454468, -0.05757056176662445, 0.17688080668449402, -0.1282537579536438, -0.3387622833251953, -0.017470696941018105, -0.5606281161308289, 0.08375285565853119, 0.08045578002929688, 0.24176813662052155, 0.08828584849834442, -0.13386815786361694, 0.10702481120824814, 0.15415328741073608, 0.7228220105171204, -0.42803964018821716, -0.14789870381355286, 0.3404981195926666, 0.14044326543807983, -0.812729001045227, 0.044242050498723984, -0.1428530067205429, 0.23231197893619537, 0.0003927145153284073, 0.532172679901123, -0.37297701835632324, 0.028595659881830215, 0.1928722858428955, 0.5991670489311218, -0.33397090435028076, -0.0656810849905014, -0.4303623139858246, -0.175681471824646, -0.23387733101844788, 0.14130491018295288, -0.06278137117624283, 0.24923957884311676, 0.006052533630281687, -0.062367893755435944, -0.22581765055656433, -0.34981295466423035, 0.038212768733501434, 0.060966361314058304, 0.5515708327293396, -0.06336618959903717, 0.425639271736145, -0.004427097737789154, 0.05069497972726822, -0.10127841681241989, 0.6451178193092346, -0.08417563140392303, 0.4002247452735901, 0.40245071053504944, 0.014335344545543194, 0.19152647256851196, 0.5243135094642639, 0.04163241758942604, -0.0332525297999382, -0.3735451400279999, 0.10194165259599686, -0.5634267330169678, -0.031742922961711884, -0.04320405423641205, -0.11842140555381775, -0.15952083468437195, 0.047431834042072296, 0.5589544773101807, -0.11249646544456482, 0.002496771514415741, 0.10308077931404114, 0.05319391191005707, -0.09234412014484406, 0.522550106048584, 0.07097669690847397, 1.1548534631729126, 0.3087608814239502, 0.37221500277519226, 0.14051440358161926, -0.062269359827041626, 0.0504612997174263, -0.011492744088172913, 0.2785363793373108, -0.4947848618030548, -0.3721263110637665, 0.09324858337640762, -0.1839611977338791, -0.18465808033943176, -0.06776833534240723, -0.37267428636550903, 0.17375177145004272, -0.29602956771850586, 0.21198442578315735, -0.20426136255264282, 0.21626794338226318, -0.44917032122612, -0.3010612428188324, 0.2105340212583542, 0.1896461397409439, 0.3072575330734253, 0.027358602732419968, 0.1459837555885315, -0.11145470291376114, -0.30364155769348145, -0.04953957349061966, 0.012031033635139465, 0.07130119949579239, -0.130699023604393, 0.25384002923965454, -0.1173928827047348, -0.26548051834106445, -0.14590424299240112, 0.001622762531042099, 0.3161199688911438, 0.4339923858642578, -0.12954792380332947, 0.05056242644786835, -0.06683655828237534, 0.30891361832618713, 0.056049469858407974, -0.08530987799167633, 0.15533913671970367, 0.023521393537521362, -0.1304701864719391, -0.228255033493042, -0.09494273364543915, -0.024240894243121147, -0.24338176846504211, 0.11899794638156891, 0.1585037261247635, -0.37631118297576904, -0.48919448256492615, -0.07348807156085968, -0.08890741318464279, -0.4319094121456146, 0.16380144655704498, 0.08153581619262695, 0.006010774523019791, 0.44421008229255676, -0.05023360624909401, -0.31553521752357483, -0.15456078946590424, 0.46357300877571106, 0.24394211173057556, 0.1516658365726471, 0.30631309747695923, -0.4356895387172699, -0.08991970121860504, -0.2524777948856354, 0.5002024173736572, -0.0479576475918293, -0.30751630663871765, 0.34645628929138184, -0.25545305013656616, -0.1594548374414444, -0.271119624376297, -0.00023733079433441162, 0.21316948533058167, -0.01843021810054779, -0.2652197480201721, -0.1532483845949173, -0.1614031046628952, 0.09833649545907974, 0.4643232524394989, 0.5141516923904419, -0.10023736953735352, -0.18007031083106995, -0.13492631912231445, 0.14274898171424866, -0.36940890550613403, 0.05610132962465286, -0.26348116993904114, 0.2924922704696655, -0.193089097738266, -0.05024871230125427, 0.15127858519554138, -0.28710687160491943, 0.12381675839424133, 0.38873159885406494, -0.09652862697839737, -0.30720755457878113, -0.31186237931251526, 0.10913430154323578, 0.08755375444889069, -0.13941507041454315, 0.08028262853622437, -0.06226329132914543, -0.09478358924388885, -0.15798458456993103, 0.14646492898464203, 0.1382683515548706, -0.08864976465702057, -0.1514693647623062, 0.33442622423171997, 0.04066596180200577, 0.0014050379395484924, 0.029005583375692368, -0.023526631295681, 0.08791787922382355, -0.056125905364751816, 0.12074200063943863, -0.05781340226531029, -0.05065172165632248, -0.2691150903701782, -0.1308317482471466, 0.060360416769981384, -0.05405903607606888, 0.018384519964456558, 0.0008674263954162598, -0.09461245685815811, -0.005097059532999992, 0.23136240243911743, 0.23966091871261597, -0.22017037868499756, -0.20442146062850952, 0.27315589785575867, 0.2640783190727234, -0.1519222855567932, -0.3821151554584503, 0.027132676914334297, -0.030802424997091293, 0.05154647305607796, 0.14981815218925476, 0.35013702511787415, 0.2249656617641449, -0.3444124460220337, -0.02039973996579647, 0.09289023280143738, 0.02756124548614025, -0.08593444526195526, 0.480882465839386, -0.17417366802692413, -0.025065403431653976, 0.20290569961071014, -0.18870769441127777, 0.24968677759170532, 0.46094030141830444, 0.04985650256276131, 0.5769596099853516, 0.3226025700569153, -0.20961681008338928, 0.05181117355823517, -0.21730893850326538, 0.07148879766464233, -0.0073366910219192505, -0.1882147490978241, 0.278874009847641, 0.14522354304790497, 0.097074493765831, -0.5059454441070557, -0.15782856941223145, -0.25148874521255493, 0.03740296885371208, -0.3890116214752197, -0.0531577430665493, -0.013396453112363815, -0.14916391670703888, -0.17768257856369019, -0.007539303973317146, -0.1759335845708847, -0.30925416946411133, 0.0914040133357048, 0.0980001762509346, -0.06010846793651581, 0.13181455433368683, 0.02215532772243023, 0.27407634258270264, 0.09313751012086868, -0.25811707973480225, 0.0037716738879680634, 0.20439684391021729, 0.02278890088200569, -0.2904118299484253, 0.5170527696609497, 0.39623385667800903, 0.21309326589107513, -0.3750290274620056, 0.03543118014931679, 0.3497941792011261, 0.0011054705828428268, 0.00754106231033802, 0.1794518530368805, -0.010047249495983124, -0.009532839059829712, 0.32814812660217285, 0.13843923807144165, -0.26611560583114624, -0.0958690196275711, 0.169016495347023, 0.04178311675786972, -0.4100736379623413, 0.26959937810897827, 0.010542567819356918, -0.16752400994300842, -0.10206834971904755, -0.05448705703020096, -0.1859884113073349, 0.030698802322149277, 0.4977630078792572, -0.0787634626030922, 0.30733662843704224, -0.31773510575294495, 0.11112087965011597, -0.19948714971542358, 0.5584346055984497, 0.06302980333566666, -0.4028874635696411, -0.35358375310897827, 0.10262186825275421, -0.41440507769584656, 0.05230583995580673, -0.11592768132686615, 0.08329065144062042, 0.11041048914194107, 0.2545323371887207, -0.19229933619499207, 0.19078855216503143, -0.10415801405906677, 0.24780629575252533, 0.14129747450351715, 0.4671538174152374, -0.25157561898231506, 0.02842129021883011, 0.0008184909820556641, -0.09015242010354996, 0.09273969382047653, -0.7554388642311096, 0.23023256659507751, -0.030373018234968185, 0.1087724044919014, 0.03404393792152405, -0.03934120386838913, 0.09522244334220886, 0.5482968091964722, 0.5185004472732544, 0.14301417768001556, 0.16613352298736572, -0.30447131395339966, -0.053745023906230927, 0.010110151022672653, 0.052562303841114044, -0.14668501913547516, -0.03703507035970688, 0.15252457559108734, 0.44273480772972107, -0.13655219972133636, 0.058002959936857224, -0.003616168862208724, -0.06456955522298813, 0.0783878043293953, 0.15607941150665283, -0.1534876525402069, 0.1369892805814743, -0.14194178581237793, 0.2594921588897705, 0.18125367164611816, 0.3957882225513458, -0.09460525214672089, 0.25524213910102844, -0.09617573022842407, -0.47927942872047424, 0.41164273023605347, 0.030890293419361115, -0.2455330193042755, -0.14102141559123993, 0.2734678387641907, 0.21574562788009644, 0.04594249278306961, -0.23218277096748352, -0.11736232787370682, 0.23944662511348724, -0.13885706663131714, -0.0153341144323349, 0.37773817777633667, -0.057061817497015, -0.03932766988873482, -0.023627350106835365, 0.5280665755271912, 0.12478189915418625, -0.24501295387744904, 0.4972430169582367, -0.5173007845878601 ]
https://github.com/huggingface/datasets/issues/3040
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset
I agree with @patrickvonplaten: this issue is reported recurrently, so better if we implement the `.flatten_indices()` automatically?
## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0
17
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset ## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0 I agree with @patrickvonplaten: this issue is reported recurrently, so better if we implement the `.flatten_indices()` automatically?
[ -0.18242110311985016, -0.1138092577457428, 0.09770150482654572, 0.34852248430252075, 0.13966810703277588, 0.2466380000114441, 0.22026723623275757, 0.43214473128318787, 0.09317527711391449, 0.4231395125389099, 0.2067134827375412, 0.41093724966049194, -0.1631096452474594, 0.024122750386595726, 0.02575458399951458, 0.08983850479125977, 0.18562264740467072, 0.186303973197937, 0.11334914714097977, -0.18672652542591095, -0.36798909306526184, -0.03469684720039368, -0.2251632958650589, -0.2867274284362793, -0.5878717303276062, -0.13526654243469238, -0.21500235795974731, 0.24004828929901123, -0.21914362907409668, -0.12557798624038696, 0.2466326206922531, -0.19219443202018738, 0.010856032371520996, 0.3942236602306366, -0.00011805140820797533, -0.03063267096877098, 0.2950562834739685, -0.13832159340381622, -0.5959519743919373, -0.08724553883075714, -0.10213269293308258, -0.3036235570907593, 0.043159112334251404, -0.33666670322418213, 0.15491503477096558, 0.17525950074195862, -0.021522773429751396, -0.1752217710018158, -0.05001842975616455, -0.10981559753417969, 0.17737887799739838, 0.3541214168071747, -0.24851776659488678, -0.19968894124031067, 0.09630955755710602, 0.26067373156547546, -0.2917030453681946, 0.4178818464279175, -0.025249667465686798, 0.012756206095218658, 0.07957641780376434, 0.07721929252147675, -0.12692740559577942, -0.22744949162006378, 0.01355823129415512, 0.1542256772518158, 0.20821362733840942, -0.42710715532302856, 0.0888294130563736, 0.17587104439735413, 0.35146787762641907, -0.4096337556838989, -0.3287009000778198, -0.4679728150367737, 0.10708419978618622, -0.14540064334869385, 0.07909946143627167, 0.3163136839866638, 0.11172431707382202, 0.028448903933167458, -0.008043690584599972, 0.016564026474952698, -0.040681175887584686, 0.05666612088680267, 0.17163361608982086, 0.08032815158367157, 0.06599501520395279, 0.11124803125858307, 0.32443463802337646, 0.06071750819683075, 0.1576552391052246, -0.42573902010917664, -0.04986939951777458, -0.051387522369623184, -0.3459394574165344, -0.31443193554878235, -0.06461260467767715, -0.23314759135246277, 0.21410739421844482, 0.14666342735290527, 0.08288995921611786, -0.05126599222421646, 0.10393191874027252, 0.0972088873386383, 0.2802480459213257, 0.40420588850975037, -0.004504851996898651, 0.2779262959957123, 0.23862485587596893, 0.003167476737871766, 0.31116390228271484, 0.1591966450214386, -0.054332900792360306, -0.027781538665294647, 0.2901395261287689, -0.10677961260080338, 0.10790181159973145, -0.039005912840366364, -0.5261319279670715, 0.2403637170791626, -0.07856117188930511, 0.12537433207035065, -0.09907267987728119, 0.045020073652267456, 0.001291867345571518, 0.04605688899755478, -0.12956970930099487, 0.3285558223724365, -0.3600682020187378, 0.17685794830322266, -0.20480301976203918, -0.08183406293392181, 0.13391515612602234, -0.026259103789925575, 0.13519509136676788, -0.18086473643779755, 0.054402075707912445, 0.19635409116744995, 0.011033598333597183, 0.15257956087589264, 0.21403394639492035, -0.30120718479156494, 0.15476347506046295, 0.3042813837528229, 0.16463327407836914, 0.16462484002113342, -0.010729566216468811, -0.5549109578132629, -0.2624776363372803, 0.4457956552505493, -0.047182828187942505, -0.28133538365364075, -0.1600615680217743, 0.1427326649427414, -0.047338053584098816, 0.10456155240535736, -0.24958854913711548, 0.2826412320137024, 0.1285540610551834, 0.004947688430547714, 0.09370501339435577, -0.05988740921020508, -0.20702476799488068, -0.33903375267982483, 0.1187291219830513, 0.2781880497932434, -0.3131513297557831, 0.18237550556659698, 0.09345633536577225, 0.12861646711826324, 0.16211993992328644, 0.24208353459835052, -0.0059808180667459965, 0.14650283753871918, -0.17752668261528015, 0.34665775299072266, 0.11174439638853073, 0.0016742944717407227, -0.6249181628227234, 0.020983941853046417, -0.14786756038665771, 0.12975367903709412, -0.02761276811361313, 0.23822450637817383, 0.10305074602365494, 0.0496228002011776, 0.20672215521335602, 0.2870352864265442, -0.005713732913136482, -0.09309174120426178, -0.5067901611328125, -0.2917131781578064, 0.13254515826702118, 0.09961196780204773, -0.1132606714963913, 0.11683951318264008, -0.05418498069047928, 0.15279220044612885, 0.29843661189079285, 0.011578474193811417, 0.1294957846403122, 0.253818154335022, 0.27449846267700195, -0.581274688243866, 0.007386708166450262, -0.1941845715045929, -0.4004681706428528, 0.2022341787815094, -0.05755354091525078, -0.03348735719919205, 0.20779630541801453, -0.43593859672546387, -0.35483190417289734, -0.03410385549068451, -0.10600386559963226, 0.19533398747444153, 0.023669295012950897, -0.11098206043243408, 0.1759207844734192, 0.07103098928928375, -0.055008664727211, 0.09247566014528275, -0.21183264255523682, -0.08805949240922928, -0.5480939149856567, 0.3700674772262573, -0.03348889946937561, -0.26995259523391724, -0.04775693267583847, 0.21483787894248962, 0.20617982745170593, -0.1658431738615036, -0.12139644473791122, 0.23993200063705444, -0.06878157705068588, -0.020642288029193878, -0.028773799538612366, 0.008721262216567993, 0.2264527976512909, 0.1362418830394745, 0.08908785134553909, 0.3028983175754547, 0.2653176784515381, -0.03868528828024864, -0.38668692111968994, 0.23563742637634277, -0.3323500156402588, -0.022868908941745758, -0.1523449420928955, -0.07451903820037842, 0.041155457496643066, -0.031532298773527145, -0.04609684646129608, -0.2976563572883606, -0.005544774234294891, 0.26227548718452454, 0.03868841007351875, -0.08882218599319458, -0.24184148013591766, 0.1259613037109375, 0.2611564099788666, -0.17255450785160065, 0.32591116428375244, 0.3228485584259033, -0.13743263483047485, -0.08329274505376816, 0.007028185762465, -0.06313470751047134, 0.5287137031555176, 0.09568262845277786, 0.09316834807395935, -0.11797981709241867, -0.10515477508306503, -0.1470584273338318, 0.3237074017524719, 0.1603640913963318, -0.12559327483177185, 0.4035593271255493, 0.08902448415756226, -0.017505116760730743, -0.3983679413795471, 0.4373589754104614, 0.08740359544754028, 0.15741993486881256, -0.07412540912628174, -0.038484614342451096, -0.2540959119796753, 0.001375243067741394, 0.08566712588071823, -0.07802745699882507, -0.13555175065994263, -0.28280287981033325, 0.054701536893844604, 0.5230620503425598, -0.2340424656867981, 0.004505504854023457, -0.03435605391860008, 0.5282376408576965, 0.19257476925849915, -0.08006172627210617, 0.014167211949825287, 0.1471470147371292, -0.3374713063240051, 0.016541533172130585, 0.14928613603115082, 0.1304272562265396, 0.31696438789367676, -0.018137497827410698, -0.012461092323064804, -0.17898230254650116, -0.22093993425369263, 0.014924775809049606, -0.13370411098003387, 0.49106037616729736, -0.03716200590133667, 0.07393821328878403, -0.25810182094573975, 0.09029883146286011, 0.006587164476513863, 0.18452124297618866, -0.12701821327209473, 0.19909243285655975, 0.048837725073099136, -0.1689404547214508, -0.2667788565158844, -0.30446237325668335, -0.28985291719436646, -0.19313637912273407, 0.14968669414520264, -0.07944263517856598, 0.18080703914165497, 0.13493189215660095, 0.22458535432815552, -0.1167481318116188, 0.17969582974910736, -0.3212718069553375, -0.40623146295547485, -0.19911152124404907, 0.421710342168808, -0.10445132851600647, -0.3260516822338104, -0.20644108951091766, -0.4594878554344177, -0.3912562429904938, -0.22836065292358398, -0.5592185258865356, -0.29909470677375793, -0.25147947669029236, 0.0949832946062088, -0.18026892840862274, 0.22586320340633392, 0.3877161145210266, -0.11210954934358597, 0.03816942125558853, -0.034117624163627625, -0.3819516599178314, 0.11714285612106323, 0.6907030940055847, 0.3149608075618744, -0.11981970816850662, 0.08925345540046692, 0.10768993198871613, 0.1742883026599884, 0.5434102416038513, 0.18350081145763397, 0.32489466667175293, 0.017683491110801697, 0.37730085849761963, -0.3554062247276306, -0.2926703989505768, -0.08096103370189667, -0.09571050107479095, -0.22149400413036346, 0.1065998300909996, -0.03604612872004509, -0.08089619874954224, 0.20507290959358215, -0.13332192599773407, 0.16021448373794556, -0.2450007051229477, 0.30513259768486023, 0.047656212002038956, -0.05344525724649429, 0.19419407844543457, 0.16357901692390442, -0.1325596570968628, -0.07164012640714645, -0.020808164030313492, -0.07276038825511932, 0.31718507409095764, -0.15774303674697876, -0.2714567482471466, -0.034538302570581436, -0.5426712036132812, 0.07026264071464539, 0.12414129823446274, 0.32086703181266785, 0.10924363136291504, -0.11563405394554138, 0.04392034932971001, 0.21393877267837524, 0.7828258275985718, -0.3001754581928253, -0.18380892276763916, 0.39719393849372864, 0.12277121841907501, -0.8086742162704468, 0.024592284113168716, -0.04393438622355461, 0.2834562361240387, -0.01962360367178917, 0.5932028293609619, -0.4172537922859192, 0.0553242452442646, 0.22522856295108795, 0.6368518471717834, -0.3829866051673889, -0.09479693323373795, -0.38322168588638306, -0.1333463490009308, -0.16188034415245056, 0.15269798040390015, -0.04311123490333557, 0.27660542726516724, 0.0114454859867692, -0.05465726554393768, -0.2188342660665512, -0.34852269291877747, 0.015031985938549042, 0.015938492491841316, 0.6031662821769714, -0.01870913803577423, 0.4844663143157959, 0.05758791044354439, 0.004523683339357376, -0.04500555992126465, 0.7048278450965881, -0.20177751779556274, 0.36839208006858826, 0.41705140471458435, 0.05051755905151367, 0.16943135857582092, 0.6118110418319702, 0.07602913677692413, -0.02982359379529953, -0.3598349094390869, 0.13030347228050232, -0.6441342234611511, -0.20024317502975464, -0.10020507872104645, -0.14470595121383667, -0.20807361602783203, -0.02804437093436718, 0.599928617477417, -0.09099505841732025, 0.052513912320137024, 0.18930426239967346, 0.1315828412771225, -0.01190808042883873, 0.5307204723358154, 0.07222741842269897, 1.1901862621307373, 0.3051142692565918, 0.36130890250205994, 0.066293865442276, 0.027692288160324097, -0.06788848340511322, -0.044188085943460464, 0.3134858012199402, -0.49145272374153137, -0.3777740001678467, 0.08652415126562119, -0.2067347913980484, -0.25234535336494446, -0.04737430810928345, -0.34305161237716675, 0.19090916216373444, -0.3928706645965576, 0.10518486052751541, -0.21118924021720886, 0.21709835529327393, -0.5343679189682007, -0.2500878572463989, 0.2916605472564697, 0.07783489674329758, 0.30594199895858765, 0.02492368593811989, 0.13245889544487, -0.13465364277362823, -0.24305565655231476, -0.06721912324428558, 0.00822591781616211, 0.014081872999668121, -0.11253529787063599, 0.37293845415115356, -0.21140480041503906, -0.39904481172561646, -0.08521975576877594, -0.09088028967380524, 0.2647327184677124, 0.35482820868492126, -0.10353802144527435, -0.09712372720241547, 0.01304444670677185, 0.3168499171733856, 0.023932594805955887, -0.0860966295003891, 0.1526731550693512, 0.13432741165161133, -0.06471209973096848, -0.34592458605766296, -0.10176589339971542, -0.03872551769018173, -0.3059709370136261, 0.11088097095489502, 0.16111677885055542, -0.39469558000564575, -0.5389984846115112, -0.09521505236625671, -0.00031963735818862915, -0.37870267033576965, 0.09089367091655731, 0.10959859192371368, 0.04608350247144699, 0.48769956827163696, -0.09653517603874207, -0.29790058732032776, -0.12910139560699463, 0.4790354371070862, 0.2514461576938629, 0.18117228150367737, 0.2603760063648224, -0.4870704114437103, -0.12125761061906815, -0.1965140700340271, 0.5596079230308533, -0.10072644054889679, -0.24371230602264404, 0.43726831674575806, -0.326992005109787, -0.10627228766679764, -0.36945784091949463, -0.0038131438195705414, 0.20684818923473358, 0.01571051776409149, -0.3250982463359833, -0.15045279264450073, -0.10821261256933212, 0.10184445232152939, 0.46628040075302124, 0.5012093186378479, 0.00240422785282135, -0.3389853239059448, -0.222835972905159, 0.09287239611148834, -0.268039345741272, 0.07745024561882019, -0.11977457255125046, 0.23781488835811615, -0.14686837792396545, -0.0026867613196372986, 0.1724570393562317, -0.33071985840797424, 0.0317070409655571, 0.3723018765449524, 0.0007377788424491882, -0.22336345911026, -0.28000447154045105, 0.14260053634643555, 0.06708493083715439, -0.10484280437231064, 0.08419591933488846, -0.10582854598760605, -0.12689924240112305, -0.20725159347057343, 0.12545722723007202, 0.178587406873703, -0.02679429203271866, -0.1461612731218338, 0.24037952721118927, -0.021006979048252106, -0.0004083700478076935, 0.11807427555322647, 0.044019754976034164, 0.13608014583587646, -0.01915922947227955, 0.23486649990081787, -0.1007847711443901, 0.01243511587381363, -0.31764495372772217, -0.12201044708490372, 0.02726040780544281, -0.08734183013439178, 0.09424881637096405, -0.10032643377780914, -0.06834520399570465, 0.08024021983146667, 0.20704595744609833, 0.347097247838974, -0.25199180841445923, -0.2396305501461029, 0.24410057067871094, 0.17631138861179352, -0.11808082461357117, -0.4534838795661926, 0.04297831654548645, 0.0389280840754509, -0.07626558840274811, 0.15079939365386963, 0.392194002866745, 0.1426626443862915, -0.393595814704895, -0.02703334391117096, 0.09941986948251724, 0.12211430072784424, 0.006966698914766312, 0.5440518260002136, -0.07984502613544464, -0.03836348280310631, 0.1996602565050125, -0.18422476947307587, 0.2504185736179352, 0.3526575565338135, 0.039891235530376434, 0.5691938996315002, 0.30462515354156494, -0.17251822352409363, -0.013167493045330048, -0.25469771027565, 0.16278447210788727, 0.002735525369644165, -0.09824435412883759, 0.3227437138557434, 0.22463367879390717, 0.15321481227874756, -0.5348473191261292, -0.15554656088352203, -0.24791745841503143, -0.007889192551374435, -0.4145127236843109, -0.014822149649262428, 0.13558146357536316, -0.15490084886550903, -0.008854009211063385, 0.03798290714621544, -0.2295500636100769, -0.24731360375881195, 0.07021720707416534, 0.12963035702705383, -0.11828240752220154, 0.13316626846790314, 0.03953507915139198, 0.33687087893486023, 0.17471526563167572, -0.28678181767463684, -0.03169108182191849, 0.25597071647644043, -0.06554564833641052, -0.3696058392524719, 0.5479506254196167, 0.4310316741466522, 0.1872076690196991, -0.3636632263660431, -0.057464350014925, 0.34797942638397217, 0.048932820558547974, 0.09089436382055283, 0.1920243352651596, -0.02434779703617096, -0.06330083310604095, 0.3049141466617584, 0.02946668677031994, -0.20580539107322693, -0.06696327030658722, 0.24818004667758942, 0.09169332683086395, -0.42456382513046265, 0.18079900741577148, 0.09857728332281113, -0.1307145208120346, -0.02068345621228218, -0.07524190098047256, -0.07403459399938583, 0.033286530524492264, 0.5529133081436157, -0.042450033128261566, 0.2321450114250183, -0.227715864777565, 0.0672270655632019, -0.16801387071609497, 0.466129869222641, 0.0868244394659996, -0.5075997114181519, -0.3641817569732666, 0.17443342506885529, -0.3953263759613037, 0.06851299107074738, -0.04953133687376976, 0.17240145802497864, 0.2872258424758911, 0.26400381326675415, -0.19105014204978943, 0.23921386897563934, -0.14716647565364838, 0.1481321007013321, 0.09728208184242249, 0.46679314970970154, -0.24317513406276703, -0.009048789739608765, -0.028555884957313538, -0.1410462111234665, 0.060360878705978394, -0.7755917310714722, 0.23850809037685394, 0.026865389198064804, 0.007911190390586853, -0.007997767999768257, 0.017538852989673615, 0.039269331842660904, 0.5732824802398682, 0.5139349699020386, 0.18080241978168488, 0.11255130171775818, -0.23217910528182983, -0.03808573633432388, 0.053043022751808167, 0.03842678666114807, -0.13736136257648468, 0.02440713718533516, 0.17421701550483704, 0.3960408866405487, -0.27014264464378357, -0.03884170576930046, -0.09143280982971191, -0.06396620720624924, 0.025562211871147156, 0.0902002602815628, -0.20583312213420868, 0.10974013805389404, -0.16604304313659668, 0.25771230459213257, 0.1998351812362671, 0.3812979757785797, -0.04852022975683212, 0.3212392330169678, 0.004899643361568451, -0.4181925654411316, 0.35331612825393677, 0.05431312322616577, -0.19762420654296875, -0.1276913285255432, 0.24191142618656158, 0.2161218822002411, 0.03568929433822632, -0.19287143647670746, -0.1253126859664917, 0.26738619804382324, -0.17138910293579102, 0.020687803626060486, 0.37559211254119873, -0.042677588760852814, -0.05843594670295715, -0.037987370043992996, 0.6188091039657593, 0.1048002541065216, -0.2734295427799225, 0.48625674843788147, -0.5388700366020203 ]
https://github.com/huggingface/datasets/issues/3040
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset
That would be great indeed - I don't really see a use case where one would not like to call `.flatten_indices()` before calling `save_to_disk`
## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0
24
[save_to_disk] Using `select()` followed by `save_to_disk` saves complete dataset making it hard to create dummy dataset ## Describe the bug When only keeping a dummy size of a dataset (say the first 100 samples), and then saving it to disk to upload it in the following to the hub for easy demo/use - not just the small dataset is saved but the whole dataset with an indices file. The problem with this is that the dataset is still very big. ## Steps to reproduce the bug E.g. run the following: ```python from datasets import load_dataset, save_to_disk nlp = load_dataset("glue", "mnli", split="train") nlp.save_to_disk("full") nlp = nlp.select(range(100)) nlp.save_to_disk("dummy") ``` Now one can see that both `"dummy"` and `"full"` have the same size. This shouldn't be the case IMO. ## Expected results IMO `"dummy"` should be much smaller so that one can easily play around with the dataset on the hub. ## Actual results Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0 That would be great indeed - I don't really see a use case where one would not like to call `.flatten_indices()` before calling `save_to_disk`
[ -0.19779251515865326, -0.1417638659477234, 0.06662298738956451, 0.24847929179668427, 0.14022479951381683, 0.21322035789489746, 0.2300780713558197, 0.40928664803504944, 0.10484512150287628, 0.41884171962738037, 0.17984937131404877, 0.4132266640663147, -0.1830233633518219, -0.011367501690983772, 0.0974142774939537, 0.08159030973911285, 0.2100723385810852, 0.1471537947654724, 0.08578340709209442, -0.1938105672597885, -0.353857159614563, -0.04293811321258545, -0.20317158102989197, -0.24029891192913055, -0.5825730562210083, -0.15385496616363525, -0.25529611110687256, 0.35035082697868347, -0.19362777471542358, -0.14880861341953278, 0.18299105763435364, -0.15214939415454865, -0.0034612109884619713, 0.373210608959198, -0.00011187553900526837, -0.03259414806962013, 0.2789492607116699, -0.14524319767951965, -0.5515750050544739, -0.047120630741119385, -0.059047993272542953, -0.3082060217857361, -0.007899560034275055, -0.3504584729671478, 0.1207970455288887, 0.18925470113754272, 0.02103697694838047, -0.13031160831451416, 0.01427537202835083, -0.0035846675746142864, 0.23840804398059845, 0.394894003868103, -0.2610616981983185, -0.2463669776916504, 0.116862952709198, 0.20671695470809937, -0.26168543100357056, 0.39710134267807007, 0.04372857138514519, 0.02327379770576954, 0.08798354119062424, 0.041666507720947266, -0.09895702451467514, -0.2398889809846878, 0.02747959829866886, 0.19914105534553528, 0.12527303397655487, -0.3865593373775482, 0.15194477140903473, 0.1520228534936905, 0.32656365633010864, -0.40740352869033813, -0.3049965500831604, -0.4118422865867615, 0.08309910446405411, -0.14628075063228607, 0.07418916374444962, 0.30147257447242737, 0.05920851603150368, 0.04247186332941055, -0.002161862561479211, 0.03353849798440933, -0.05223719775676727, 0.058020398020744324, 0.15351034700870514, 0.1139572337269783, 0.0477704182267189, 0.11774806678295135, 0.2698829770088196, 0.07824333012104034, 0.05755621939897537, -0.4144050180912018, -0.05114111676812172, -0.026135075837373734, -0.2801525294780731, -0.304194837808609, -0.012545779347419739, -0.1516769528388977, 0.18971744179725647, 0.14375334978103638, 0.05160005763173103, -0.07595121115446091, 0.13281182944774628, 0.08825042843818665, 0.20176638662815094, 0.3657114803791046, -0.061190165579319, 0.2186090350151062, 0.2735136151313782, -0.012381840497255325, 0.2792714536190033, 0.11094607412815094, -0.0763513520359993, -0.04215070232748985, 0.2625473737716675, -0.10830377787351608, 0.10043205320835114, -0.07614737004041672, -0.514313280582428, 0.15277162194252014, -0.04900088161230087, 0.17970488965511322, -0.06290527433156967, 0.18619678914546967, -0.07731479406356812, -0.06857654452323914, -0.12806618213653564, 0.3488468527793884, -0.3783808946609497, 0.16372455656528473, -0.2652185559272766, 0.027206290513277054, 0.05392366275191307, -0.06933886557817459, 0.12731850147247314, -0.1293838769197464, 0.1086358055472374, 0.1448059380054474, -0.004594750702381134, 0.2118903398513794, 0.20695452392101288, -0.3078588843345642, 0.14244848489761353, 0.32785922288894653, 0.19403639435768127, 0.1614963859319687, -0.06641758978366852, -0.5430278182029724, -0.2594833970069885, 0.39242008328437805, 0.003893807530403137, -0.2803143262863159, -0.17100930213928223, 0.20753230154514313, -0.11431830376386642, 0.06359776109457016, -0.16679328680038452, 0.2285080999135971, 0.07535658776760101, 0.006248489022254944, 0.11779893934726715, -0.02118988335132599, -0.14147427678108215, -0.41208088397979736, 0.14495733380317688, 0.22910387814044952, -0.3432753086090088, 0.14771273732185364, 0.055811360478401184, 0.0793074518442154, 0.1419508159160614, 0.17440611124038696, -0.044193800538778305, 0.18854182958602905, -0.15776976943016052, 0.4118063449859619, 0.2100582718849182, -0.09764593094587326, -0.6079844236373901, -0.046669088304042816, -0.15980255603790283, 0.12482953816652298, -0.027463741600513458, 0.28379061818122864, 0.0746336504817009, 0.03794771060347557, 0.1873246133327484, 0.3415534496307373, 0.017985422164201736, -0.06585371494293213, -0.5190655589103699, -0.20994700491428375, 0.06552695482969284, 0.13628263771533966, -0.10643705725669861, 0.03950443118810654, 0.008747480809688568, 0.1809941530227661, 0.34468355774879456, -0.02021162584424019, 0.15792444348335266, 0.25674155354499817, 0.2704087793827057, -0.5342032313346863, -0.04116816818714142, -0.1754535436630249, -0.35143613815307617, 0.24007105827331543, -0.052609436213970184, -0.012504763901233673, 0.19983148574829102, -0.39442354440689087, -0.4044261574745178, -0.05535449832677841, -0.08776064217090607, 0.07287883013486862, 0.09794707596302032, -0.06151546537876129, 0.18258099257946014, 0.04259204491972923, -0.07597966492176056, 0.15855002403259277, -0.19357463717460632, -0.06182583421468735, -0.5536086559295654, 0.3859690725803375, -0.0915115475654602, -0.3280574083328247, -0.035028815269470215, 0.21263015270233154, 0.17720606923103333, -0.1135067269206047, -0.09409134835004807, 0.31624412536621094, -0.09510546177625656, 0.04069780930876732, -0.020118676126003265, 0.0025904476642608643, 0.16083498299121857, 0.12444040179252625, 0.15710081160068512, 0.24982233345508575, 0.2735661566257477, -0.023507840931415558, -0.477165549993515, 0.2311612069606781, -0.29275915026664734, -0.08104395121335983, -0.12084963917732239, -0.06089694797992706, 0.03199175000190735, -0.04281915724277496, -0.042548395693302155, -0.17634718120098114, 0.07033412903547287, 0.29093581438064575, 0.09096099436283112, -0.11516135931015015, -0.24191904067993164, 0.17355850338935852, 0.3396458923816681, -0.19197379052639008, 0.3474773168563843, 0.28176170587539673, -0.20034655928611755, -0.1335473358631134, 0.03736771643161774, -0.037768490612506866, 0.6007305383682251, 0.15589867532253265, 0.08835795521736145, -0.10083303600549698, -0.2186986356973648, -0.15954488515853882, 0.29644834995269775, 0.12231625616550446, -0.14363647997379303, 0.2958211600780487, 0.11778319627046585, -0.049610916525125504, -0.38156235218048096, 0.36605632305145264, 0.039735034108161926, 0.14030393958091736, -0.07461227476596832, -0.04687516391277313, -0.22202709317207336, 0.00914829596877098, 0.09756871312856674, -0.08454832434654236, -0.15186186134815216, -0.297579824924469, 0.07702892273664474, 0.5313760638237, -0.1911173164844513, -0.031100323423743248, 0.023233767598867416, 0.5041888952255249, 0.12114377319812775, -0.04255396127700806, -0.012235604226589203, 0.11547041684389114, -0.34341588616371155, 0.10028265416622162, 0.09539724141359329, 0.2601551115512848, 0.40031588077545166, 0.0021408796310424805, -0.019724566489458084, -0.13490769267082214, -0.1973680555820465, -0.025996685028076172, -0.16351200640201569, 0.5417495965957642, 0.01835791766643524, 0.09916297346353531, -0.19663842022418976, 0.09676162153482437, 0.05614930018782616, 0.14063438773155212, -0.13660867512226105, 0.17278078198432922, 0.06874112039804459, -0.16535384953022003, -0.24819543957710266, -0.3254328668117523, -0.3048187792301178, -0.2542738616466522, 0.15376634895801544, -0.012288292869925499, 0.13131548464298248, 0.14483436942100525, 0.2448846697807312, 0.0041393376886844635, 0.22240345180034637, -0.3101131021976471, -0.41916054487228394, -0.22389236092567444, 0.38322126865386963, -0.1818074733018875, -0.360220342874527, -0.15312233567237854, -0.41021960973739624, -0.3148636817932129, -0.25004541873931885, -0.5173296332359314, -0.3352140188217163, -0.26550498604774475, 0.10033410787582397, -0.15303170680999756, 0.19276383519172668, 0.41057923436164856, -0.11442000418901443, -0.01171991415321827, -0.08610502630472183, -0.3866618573665619, 0.07985393702983856, 0.666232168674469, 0.3316211998462677, -0.18583792448043823, 0.04593440890312195, 0.1075594574213028, 0.22063297033309937, 0.44301435351371765, 0.14055520296096802, 0.3218773603439331, -0.01920381747186184, 0.36167487502098083, -0.36656004190444946, -0.28066790103912354, -0.012996608391404152, -0.06700757145881653, -0.2410377413034439, 0.1282021403312683, -0.012903567403554916, -0.0871686041355133, 0.17972394824028015, -0.1236904114484787, 0.09491895884275436, -0.23642107844352722, 0.2984071671962738, 0.12242335081100464, -0.10016048699617386, 0.17954771220684052, 0.14143919944763184, -0.17830094695091248, -0.053945016115903854, -0.032154399901628494, -0.026330284774303436, 0.25578778982162476, -0.14662910997867584, -0.3243378698825836, -0.0351242795586586, -0.580231785774231, 0.08438218384981155, 0.09368781000375748, 0.20443964004516602, 0.05619100108742714, -0.15825071930885315, 0.08519846946001053, 0.1368573158979416, 0.7432159781455994, -0.38425931334495544, -0.17802850902080536, 0.4033298194408417, 0.13423380255699158, -0.8143318295478821, 0.021382737904787064, -0.12937669456005096, 0.2648558020591736, -0.03309069201350212, 0.5621827840805054, -0.37609854340553284, 0.011005702428519726, 0.22960853576660156, 0.6112475395202637, -0.35044437646865845, -0.058257199823856354, -0.43244773149490356, -0.18855887651443481, -0.2546665072441101, 0.15037228167057037, -0.0716479942202568, 0.23971781134605408, -0.040527887642383575, -0.04442257061600685, -0.21214289963245392, -0.3270796537399292, 0.011380814015865326, 0.06772041320800781, 0.5561856031417847, -0.08252236247062683, 0.4180172085762024, 0.024246133863925934, 0.04018162190914154, -0.0594477504491806, 0.6598943471908569, -0.10362900793552399, 0.391808420419693, 0.4049888551235199, 0.047543060034513474, 0.20633432269096375, 0.5773274302482605, 0.05011840537190437, -0.02284308522939682, -0.3488180935382843, 0.11129923164844513, -0.6011791229248047, -0.07453316450119019, -0.05721700191497803, -0.14231781661510468, -0.19754979014396667, 0.04335794597864151, 0.597832977771759, -0.07876285910606384, -0.007223039865493774, 0.14389503002166748, 0.11784426122903824, -0.05872076749801636, 0.5333468317985535, 0.10054744780063629, 1.2180800437927246, 0.3039317727088928, 0.393790602684021, 0.130112886428833, -0.048112038522958755, 0.008600235916674137, -0.04558739438652992, 0.27148306369781494, -0.481036514043808, -0.3676052987575531, 0.09624908864498138, -0.19214940071105957, -0.196785569190979, -0.07780815660953522, -0.3975014388561249, 0.16044968366622925, -0.3495584726333618, 0.15912911295890808, -0.21148641407489777, 0.1839335858821869, -0.48481571674346924, -0.2814483642578125, 0.224626824259758, 0.1578032225370407, 0.32338839769363403, 0.01597829908132553, 0.09173218905925751, -0.10065329074859619, -0.29253673553466797, -0.02968515269458294, 0.045927226543426514, 0.040031798183918, -0.09952989965677261, 0.27501940727233887, -0.20057249069213867, -0.34643828868865967, -0.12456569075584412, -0.02557259425520897, 0.2890236973762512, 0.37448522448539734, -0.10337977111339569, -0.02629425749182701, -0.041754014790058136, 0.30920276045799255, 0.05942460522055626, -0.08957739919424057, 0.17092600464820862, 0.0615583211183548, -0.1399831771850586, -0.21906909346580505, -0.08528530597686768, -0.026670940220355988, -0.242777019739151, 0.12609300017356873, 0.16157004237174988, -0.3827994465827942, -0.48936986923217773, -0.04466681182384491, -0.06155847758054733, -0.4063911736011505, 0.14543455839157104, 0.10539787262678146, 0.02597370743751526, 0.45557376742362976, -0.07908093929290771, -0.2972027659416199, -0.1543000042438507, 0.4494309723377228, 0.2478713095188141, 0.14807869493961334, 0.2710425853729248, -0.44696885347366333, -0.10388381034135818, -0.23875883221626282, 0.5026150941848755, -0.07091682404279709, -0.2859806716442108, 0.3701176345348358, -0.287880539894104, -0.1450565755367279, -0.3442719876766205, -0.010762844234704971, 0.2299572080373764, -0.020529955625534058, -0.30772459506988525, -0.14149537682533264, -0.14315080642700195, 0.14314471185207367, 0.49001696705818176, 0.5240741968154907, -0.07805220037698746, -0.23983199894428253, -0.18315979838371277, 0.10844093561172485, -0.3599901795387268, 0.08111399412155151, -0.2394697368144989, 0.2686325013637543, -0.17247462272644043, -0.03590598702430725, 0.1664494127035141, -0.30049338936805725, 0.10655523836612701, 0.37567830085754395, -0.05411498248577118, -0.29694995284080505, -0.26961275935173035, 0.11659436672925949, 0.054514430463314056, -0.14646193385124207, 0.09565015882253647, -0.07384511083364487, -0.05772646889090538, -0.15120922029018402, 0.17077414691448212, 0.15649938583374023, -0.04725901037454605, -0.1470356434583664, 0.3203545808792114, 0.04255253076553345, -0.0024794675409793854, 0.07546113431453705, 0.026170864701271057, 0.09178390353918076, -0.048147398978471756, 0.18870732188224792, -0.11667642742395401, -0.04484425112605095, -0.2422877699136734, -0.11951602250337601, 0.09797442704439163, -0.04747261852025986, 0.060402460396289825, 0.000650845468044281, -0.10519908368587494, 0.00402319198474288, 0.2393452227115631, 0.2737487554550171, -0.2484891414642334, -0.2356603592634201, 0.2625885307788849, 0.24864725768566132, -0.10573754459619522, -0.4118331968784332, 0.018912285566329956, -0.03927845507860184, 0.005162864923477173, 0.16412721574306488, 0.3545633852481842, 0.24278151988983154, -0.362148642539978, -0.01699763536453247, 0.12322381138801575, 0.09623512625694275, -0.06543517112731934, 0.5216039419174194, -0.16655005514621735, -0.01506655290722847, 0.2121862769126892, -0.1681821644306183, 0.2664479613304138, 0.4092085361480713, 0.053191062062978745, 0.5925388932228088, 0.3080637454986572, -0.19143718481063843, 0.04085936024785042, -0.2369118332862854, 0.11704172194004059, -0.009393632411956787, -0.13974805176258087, 0.29417088627815247, 0.16541576385498047, 0.11484811455011368, -0.5094159841537476, -0.15623323619365692, -0.247700497508049, 0.042699843645095825, -0.39790210127830505, -0.02557945065200329, 0.05290141701698303, -0.16952283680438995, -0.11162501573562622, -0.009831802919507027, -0.2114027440547943, -0.31233012676239014, 0.10784836113452911, 0.09626302868127823, -0.05195322632789612, 0.15018151700496674, 0.057824864983558655, 0.2662908732891083, 0.11655739694833755, -0.2532816231250763, -0.04126603901386261, 0.25128066539764404, -0.011427298188209534, -0.3073458671569824, 0.5325505137443542, 0.4416760802268982, 0.17973265051841736, -0.38422027230262756, 0.02153603360056877, 0.3273889124393463, 0.029428502544760704, 0.031207814812660217, 0.17780821025371552, -0.022671595215797424, -0.03093782439827919, 0.31510645151138306, 0.12519924342632294, -0.26224687695503235, -0.07327459752559662, 0.18540391325950623, 0.04456256330013275, -0.4210135340690613, 0.2265492081642151, 0.043454818427562714, -0.1790267825126648, -0.03864605724811554, -0.05815986543893814, -0.14116209745407104, 0.026764318346977234, 0.5199747681617737, -0.07285095751285553, 0.2796631157398224, -0.2618967294692993, 0.10354581475257874, -0.17783766984939575, 0.5215604901313782, 0.07920904457569122, -0.4038259983062744, -0.37571218609809875, 0.11963434517383575, -0.4081849455833435, 0.047380223870277405, -0.08574728667736053, 0.11179684102535248, 0.17738908529281616, 0.2658410370349884, -0.18804284930229187, 0.23020309209823608, -0.10261258482933044, 0.1999199539422989, 0.10512170940637589, 0.4548667371273041, -0.23845438659191132, 0.0179176926612854, -0.006391093134880066, -0.13862201571464539, 0.06790123879909515, -0.7550702095031738, 0.24751222133636475, -0.006185803562402725, 0.08449580520391464, 0.018809447064995766, -0.043428681790828705, 0.10932494699954987, 0.5545260906219482, 0.5381201505661011, 0.14627830684185028, 0.1516859233379364, -0.2922501564025879, -0.07997690141201019, 0.02912125363945961, 0.05646934732794762, -0.16120150685310364, -0.05504024773836136, 0.1266663372516632, 0.40731939673423767, -0.20245926082134247, 0.010312780737876892, -0.029301825910806656, -0.06901773065328598, 0.06568099558353424, 0.14791838824748993, -0.16944491863250732, 0.10526987165212631, -0.14053869247436523, 0.2752906084060669, 0.19976745545864105, 0.38101449608802795, -0.06808601319789886, 0.29937446117401123, -0.11080576479434967, -0.4180839955806732, 0.41772592067718506, 0.06668367236852646, -0.21765269339084625, -0.12745723128318787, 0.28557783365249634, 0.1705632358789444, 0.04618779569864273, -0.2137611210346222, -0.13344812393188477, 0.2530684471130371, -0.1423836052417755, -0.021228602156043053, 0.39463678002357483, -0.047562126070261, -0.07349271327257156, -0.022004472091794014, 0.5571455359458923, 0.0664406567811966, -0.25635719299316406, 0.4690866768360138, -0.5414257049560547 ]
https://github.com/huggingface/datasets/issues/3036
Protect master branch to force contributions via Pull Requests
It would be nice to protect the master from direct commits, but still having a way to merge our own PRs when no review is required (for example when updating a dataset_infos.json file, or minor bug fixes - things that happen quite often actually). Do you know if there's a way ?
In order to have a clearer Git history in the master branch, I propose to protect it so that all contributions must be done through a Pull Request and no direct commits to master are allowed. - The Pull Request allows to give context, discuss any potential issues and improve the quality of the contribution - The Pull Request will eventually be squashed and merged into master with a single commit that links to the Pull Request page (with all the context/discussions) Note that we already implemented a protection in the master branch to avoid *merge* commits and ensure a linear history. This proposal goes one step further by avoiding all kind of direct commits and forcing contributions **only** through Pull Requests. Please note that we can temporarily deactivate this protection if we need to make a direct commit, e.g. at each new version release. The only way GitHub allows this kind or protection is by requiring a minimal number (at least one) of approvals of the Pull Request. The inconvenient is that the PR creator cannot approve their own PR: another person must approve it before it can be merged into master. To circumvent this, we could eventually disable this protection in the master branch when an urgent commit is needed (e.g. for a hotfix) and there is no other person available at that time to approve the PR.
52
Protect master branch to force contributions via Pull Requests In order to have a clearer Git history in the master branch, I propose to protect it so that all contributions must be done through a Pull Request and no direct commits to master are allowed. - The Pull Request allows to give context, discuss any potential issues and improve the quality of the contribution - The Pull Request will eventually be squashed and merged into master with a single commit that links to the Pull Request page (with all the context/discussions) Note that we already implemented a protection in the master branch to avoid *merge* commits and ensure a linear history. This proposal goes one step further by avoiding all kind of direct commits and forcing contributions **only** through Pull Requests. Please note that we can temporarily deactivate this protection if we need to make a direct commit, e.g. at each new version release. The only way GitHub allows this kind or protection is by requiring a minimal number (at least one) of approvals of the Pull Request. The inconvenient is that the PR creator cannot approve their own PR: another person must approve it before it can be merged into master. To circumvent this, we could eventually disable this protection in the master branch when an urgent commit is needed (e.g. for a hotfix) and there is no other person available at that time to approve the PR. It would be nice to protect the master from direct commits, but still having a way to merge our own PRs when no review is required (for example when updating a dataset_infos.json file, or minor bug fixes - things that happen quite often actually). Do you know if there's a way ?
[ -0.03921014070510864, 0.005262106657028198, 0.03028886765241623, -0.08345499634742737, -0.27376389503479004, -0.1612032651901245, -0.09115782380104065, 0.37512096762657166, -0.21837487816810608, 0.2085062861442566, 0.4694803059101105, -0.13393093645572662, 0.027509167790412903, -0.035808876156806946, 0.026731498539447784, 0.20965194702148438, 0.1608106642961502, 0.17437967658042908, 0.26827824115753174, 0.20843102037906647, 0.05790054053068161, -0.17851579189300537, 0.1868508905172348, -0.0017589032649993896, 0.09511076658964157, 0.1634182333946228, 0.007741877809166908, -0.036475904285907745, -0.4017792344093323, -0.17432639002799988, -0.0019096415489912033, 0.39848995208740234, -0.14365129172801971, 0.6452503204345703, -0.00011339223419781774, -0.022314172238111496, 0.2096763253211975, -0.06761109083890915, -0.03403010219335556, -0.4536478519439697, -0.5846635699272156, -0.2676280736923218, -0.049304135143756866, 0.06361716240644455, -0.055710531771183014, 0.07297086715698242, -0.0732375755906105, 0.3697609305381775, 0.455858051776886, -0.02347947657108307, 0.11697158217430115, -0.09221632778644562, 0.07672809064388275, -0.02954520657658577, 0.19378255307674408, 0.5988352298736572, -0.16550777852535248, 0.17806662619113922, 0.034116994589567184, -0.06011858582496643, 0.18212655186653137, -0.01579691842198372, -0.07993971556425095, -0.20910191535949707, 0.2245458960533142, -0.2560281455516815, 0.5261797904968262, -0.31687474250793457, -0.30299046635627747, 0.04099351167678833, -0.08905201405286789, -0.2014775574207306, -0.40036407113075256, -0.33743220567703247, -0.007690972648561001, 0.28731244802474976, -0.041270799934864044, 0.3878721594810486, -0.22784827649593353, 0.0271871630102396, -0.26309505105018616, -0.2275310754776001, 0.01583503931760788, 0.17101842164993286, 0.5028073787689209, -0.43015554547309875, 0.16498452425003052, -0.09574797004461288, 0.5486341714859009, 0.17891788482666016, -0.10148486495018005, -0.21616849303245544, -0.27331721782684326, 0.15841712057590485, -0.0027300752699375153, -0.2721872627735138, -0.2254757583141327, -0.25378555059432983, 0.3094600439071655, 0.2149471491575241, -0.30988436937332153, -0.018003113567829132, 0.020944293588399887, -0.06101955473423004, 0.31126582622528076, -0.05847598984837532, -0.11462055891752243, 0.02296512946486473, 0.33267974853515625, 0.06238405779004097, 0.17851708829402924, 0.34943947196006775, 0.2525050938129425, -0.1642996370792389, -0.2030288279056549, 0.385574072599411, 0.20559343695640564, -0.20888914167881012, 0.34280088543891907, -0.012268655933439732, -0.4945056140422821, -0.2900828421115875, -0.11710505932569504, 0.025325044989585876, 0.1301983743906021, 0.20158082246780396, -0.08597692847251892, 0.00046763569116592407, 0.17249879240989685, 0.20594047009944916, -0.198253333568573, -0.0658474862575531, -0.3138450086116791, -0.04178987443447113, -0.027780020609498024, -0.4428146183490753, 0.01866287738084793, 0.42331570386886597, -0.06629569828510284, -0.3024791479110718, 0.16602922976016998, 0.21529248356819153, 0.04970577731728554, 0.40262940526008606, -0.006592128425836563, -0.4961526393890381, 0.35686567425727844, -0.05706769600510597, -0.10371023416519165, 0.039858438074588776, 0.029221665114164352, -0.19803577661514282, -0.010102776810526848, 0.11629176139831543, -0.11969462037086487, 0.612095832824707, -0.5425117611885071, -0.14077937602996826, 0.01797320693731308, 0.28241273760795593, 0.38983839750289917, 0.19488994777202606, 0.43297067284584045, 0.1622471660375595, -0.07335888594388962, 0.1150764673948288, 0.3443804681301117, -0.11515891551971436, 0.03136493265628815, -0.297506719827652, -0.039351604878902435, 0.2056732326745987, -0.09921813011169434, -0.028971657156944275, 0.1462288349866867, -0.13181662559509277, -0.07619618624448776, -0.2383786290884018, -0.06597471982240677, 0.0858420804142952, -0.3900192975997925, 0.026389049366116524, 0.2227001190185547, -0.011128668673336506, 0.05140718072652817, -0.43808713555336, -0.05467425286769867, 0.03187768906354904, -0.21414431929588318, 0.11928948014974594, -0.2857345938682556, -0.5958313345909119, -0.40897029638290405, -0.10593834519386292, 0.01841522380709648, 0.3025842308998108, 0.3793970048427582, -0.054687343537807465, 0.07139734923839569, -0.2730156481266022, 0.015447649173438549, -0.02303527295589447, 0.38944703340530396, -0.10475718975067139, -0.18020695447921753, 0.11944200843572617, 0.1101895123720169, -0.017056671902537346, -0.10464583337306976, 0.3519253432750702, 0.247092604637146, -0.38970309495925903, 0.37824907898902893, -0.12057571113109589, 0.11586933583021164, 0.0447273924946785, 0.08319250494241714, -0.08203926682472229, -0.33107462525367737, -0.365737646818161, -0.15045976638793945, 0.09800484776496887, -0.3836086094379425, 0.21988993883132935, 0.2598740756511688, -0.21211063861846924, -0.12185213714838028, -0.07579344511032104, 0.036620430648326874, 0.3938519358634949, -0.006448686122894287, 0.06418956816196442, -0.026084188371896744, 0.07301092147827148, -0.16462872922420502, 0.03731977567076683, -0.052583321928977966, 0.5259109735488892, 0.07618249207735062, 0.012388493865728378, -0.4151853621006012, 0.13579979538917542, -0.1271124929189682, -0.06255557388067245, -0.39430832862854004, 0.2311583310365677, 0.07496426999568939, 0.11777675151824951, -0.1957343965768814, -0.06537864357233047, -0.19101475179195404, -0.3806608319282532, -0.17813415825366974, -0.044088296592235565, -0.06886191666126251, 0.28233176469802856, 0.0771656185388565, 0.08587773889303207, 0.014781147241592407, 0.03360384702682495, -0.2472756803035736, -0.10529927909374237, 0.011050410568714142, 0.19180536270141602, 0.050971247255802155, -0.03161996603012085, 0.07383314520120621, 0.41116392612457275, -0.14077995717525482, 0.26749226450920105, -0.1470269113779068, 0.03590558096766472, 0.33764520287513733, -0.03504325449466705, 0.22286848723888397, 0.054402127861976624, -0.31333082914352417, -0.1801367998123169, 0.14557665586471558, 0.33285942673683167, 0.2928329408168793, 0.5328117609024048, -0.20696048438549042, 0.20323744416236877, -0.2630002498626709, -0.02725151553750038, -0.08485286682844162, -0.27630501985549927, 0.3925245404243469, -0.012053093872964382, -0.2765251398086548, 0.22969354689121246, 0.007154963910579681, 0.1550295203924179, -0.3339754045009613, 0.06547587364912033, 0.5088149309158325, 0.3635985255241394, -0.20513750612735748, -0.22957639396190643, 0.21803134679794312, -0.19570353627204895, 0.026049192994832993, 0.09892311692237854, 0.46139824390411377, -0.29162704944610596, 0.32607293128967285, 0.386762410402298, -0.20795032382011414, -0.22829727828502655, -0.16503240168094635, 0.10540156066417694, -0.4090089201927185, -0.1873527616262436, -0.042415812611579895, 0.06491568684577942, 0.45010191202163696, -0.10423336178064346, -0.40968820452690125, -0.03231101483106613, -0.435075581073761, -0.1864556074142456, 0.013902871869504452, 0.0550449900329113, -0.43595588207244873, 0.4609283208847046, -0.11666331440210342, -0.16486449539661407, 0.7095140814781189, 0.0767156183719635, 0.2302682101726532, 0.01940532773733139, 0.0865752324461937, -0.1598648875951767, 0.06260406970977783, 0.10686825960874557, 0.14341016113758087, -0.3210088312625885, -0.16771996021270752, 0.15953296422958374, 0.10128232836723328, 0.2945515811443329, 0.1268044412136078, -0.4788978099822998, 0.0440492257475853, -0.236342191696167, -0.3687496483325958, 0.1799381822347641, 0.3901878595352173, 0.33105161786079407, -0.033926576375961304, 0.3394642174243927, -0.03592899814248085, -0.11897260695695877, 0.12262318283319473, -0.22397853434085846, 0.09647045284509659, 0.2854647636413574, 0.286508172750473, -0.018442608416080475, 0.05987673997879028, 0.0820179283618927, 0.7869046330451965, 0.14971819519996643, 0.09597232937812805, -0.18527081608772278, 0.20667403936386108, 0.1392292082309723, 0.08529946208000183, -0.1458652764558792, -0.2054571956396103, 0.04780343919992447, 0.03792603313922882, 0.13320212066173553, 0.08159149438142776, -0.17433123290538788, 0.0007223822176456451, -0.4119855761528015, 0.1388905644416809, -0.2865208089351654, -0.25400030612945557, -0.1534401923418045, 0.09578254073858261, -0.05488673225045204, -0.16072547435760498, 0.06338439881801605, -0.06992387771606445, 0.10102923214435577, 0.2230674922466278, 0.2097577452659607, 0.09202276170253754, 0.2612347900867462, 0.11755921691656113, -0.13098645210266113, -0.06842389702796936, 0.08652473241090775, -0.13556739687919617, -0.039598338305950165, 0.009004317224025726, 0.19783714413642883, -0.030726652592420578, 0.3099437355995178, 0.007268175482749939, 0.130966454744339, -0.06310661137104034, -0.3789931833744049, 0.6964177489280701, -0.15634509921073914, 0.35291457176208496, 0.2622953951358795, 0.8374143838882446, 0.11972872912883759, -0.39683327078819275, -0.149632066488266, -0.003813035786151886, -0.036036692559719086, 0.06865955889225006, -0.04808368533849716, -0.11568303406238556, 0.3487933278083801, -0.3357851505279541, 0.43118324875831604, 0.2559790015220642, -0.30382174253463745, 0.010468028485774994, 0.2378188520669937, -0.09282645583152771, 0.011265255510807037, 0.07351250946521759, -0.22473503649234772, -0.20451265573501587, 0.05943568795919418, -0.13267719745635986, 0.012266185134649277, -0.1394401341676712, 0.10414822399616241, 0.31065788865089417, 0.3557991683483124, -0.32565829157829285, 0.053718630224466324, -0.2228899449110031, -0.13041386008262634, 0.3345259726047516, 0.4204176962375641, 0.382114440202713, 0.27195754647254944, 0.2728896141052246, -0.012353167869150639, -0.14158977568149567, -0.4363844394683838, -0.29905954003334045, -0.11059897392988205, -0.2523155212402344, 0.11076037585735321, -0.09032990038394928, -0.034336525946855545, 0.10890289396047592, 0.289584755897522, -0.3099628984928131, 0.13450562953948975, 0.5430850386619568, 1.0368242263793945, 0.17794334888458252, 0.16625221073627472, -0.2907530665397644, -0.2622401714324951, 0.3283100724220276, -0.2952840328216553, -0.12162703275680542, -0.21034356951713562, 0.15310858190059662, -0.20138458907604218, -0.29629185795783997, -0.2506059408187866, -0.41350656747817993, -0.24209390580654144, 0.10881255567073822, -0.007690168917179108, 0.5291516780853271, 0.48427292704582214, 0.24297994375228882, 0.31788867712020874, -0.23661291599273682, 0.2603657841682434, 0.11400081217288971, 0.21102140843868256, -0.08305998146533966, 0.14434102177619934, -0.44762122631073, -0.07905569672584534, -0.007063999772071838, -0.5527560114860535, -0.03817007690668106, -0.16999243199825287, -0.38139331340789795, -0.15996864438056946, -0.5255421996116638, 0.2626716196537018, -0.07500474154949188, 0.5421010255813599, 0.3031884729862213, -0.27099278569221497, 0.05558967590332031, 0.281299352645874, 0.2881533205509186, -0.2797309160232544, -0.1128363311290741, 0.273964524269104, -0.15244095027446747, 0.06317088752985, 0.06444872915744781, -0.10344307124614716, -0.7558953762054443, -0.3922565281391144, 0.29732292890548706, -0.4339498281478882, 0.22703249752521515, 0.06680722534656525, 0.23518915474414825, 0.007804952561855316, -0.05621367692947388, 0.10055974125862122, 0.07056188583374023, -0.04935202747583389, -0.1525384485721588, -0.2649347186088562, -0.07712198793888092, 0.10165517032146454, 0.1406249850988388, 0.18696370720863342, -0.18264606595039368, -0.0024208612740039825, 0.0230557881295681, 0.025855906307697296, -0.18594902753829956, -0.42771172523498535, -0.02339811995625496, -0.09458546340465546, -0.04605844244360924, -0.3063797354698181, -0.4524269700050354, -0.0026128229219466448, 0.06359951198101044, 0.1909753829240799, 0.3833422362804413, 0.07986162602901459, -0.014776870608329773, -0.19891950488090515, -0.18422098457813263, -0.32128408551216125, -0.001812804490327835, 0.08913177996873856, 0.399799644947052, -0.13799013197422028, 0.2607037127017975, -0.26892000436782837, -0.008396284654736519, -0.14534629881381989, 0.005489464849233627, -0.11108751595020294, -0.05491559952497482, 0.022296786308288574, -0.3725236654281616, -0.10672881454229355, 0.024537205696105957, -0.11044376343488693, -0.2620765268802643, 0.033623192459344864, 0.08580641448497772, 0.027892906218767166, 0.052656643092632294, -0.011676567606627941, 0.14271853864192963, 0.01342946756631136, 0.2820652723312378, 0.12414322793483734, -0.2655143141746521, 0.05789198726415634, -0.35716044902801514, 0.10064102709293365, 0.3600033223628998, -0.23233819007873535, -0.06163359433412552, -0.09591628611087799, -0.09391134977340698, -0.02915121056139469, 0.23100142180919647, -0.16739186644554138, -0.028256643563508987, -0.2811630964279175, 0.2162109911441803, 0.3449963331222534, 0.5151646733283997, 0.13115139305591583, 0.28058481216430664, -0.3886399269104004, -0.024606503546237946, 0.03496450185775757, -0.11734172701835632, -0.17389623820781708, -0.00981996487826109, 0.09761833399534225, 0.13079947233200073, 0.0723515972495079, -0.10299617797136307, 0.19904249906539917, 0.14507853984832764, -0.004964601248502731, 0.17452675104141235, 0.32209160923957825, 0.0017521679401397705, -0.07247903943061829, 0.22459623217582703, 0.3547176420688629, 0.07243260741233826, 0.26692312955856323, 0.2632671296596527, 0.056534457951784134, -0.04787075147032738, -0.11065257340669632, -0.11120632290840149, 0.12731397151947021, -0.779236376285553, 0.09689667075872421, 0.116793692111969, 0.297620564699173, -0.42010071873664856, 0.0942266657948494, 0.2231283336877823, 0.2982451021671295, 0.12166979163885117, 0.23126643896102905, -0.30602604150772095, 0.35459253191947937, 0.29239651560783386, 0.2906554937362671, -0.2864477038383484, 0.13017871975898743, 0.37162768840789795, 0.37958115339279175, 0.3017283082008362, -0.6312107443809509, 0.12466981261968613, 0.20366477966308594, -0.07104384899139404, 0.10409516096115112, 0.08929874002933502, -0.28888604044914246, 0.37072449922561646, 0.04344598576426506, 0.15698926150798798, -0.2291547656059265, 0.34804996848106384, 0.2323833405971527, -0.1604854166507721, -0.3837152123451233, 0.11638382822275162, -0.17235718667507172, 0.0747668668627739, 0.17086488008499146, 0.07432281225919724, -0.18176071345806122, -0.1439029574394226, -0.08397626131772995, 0.2547420561313629, -0.0700659453868866, 0.029239561408758163, -0.06467261910438538, -0.2148432731628418, 0.2540946304798126, -0.1660955846309662, 0.1381046175956726, -0.06224308907985687, 0.007969848811626434, -0.1787482649087906, -0.40861138701438904, -0.07750566303730011, 0.4224797487258911, 0.5896531343460083, -0.31564661860466003, 0.3878399431705475, 0.1756167858839035, 0.3943755626678467, 0.30666789412498474, 0.14136117696762085, -0.10779975354671478, -0.07486744225025177, -0.055481918156147, 0.08940020948648453, 0.07922632992267609, 0.24784162640571594, 0.1138332337141037, 0.013362344354391098, -0.11674012988805771, 0.14363732933998108, 0.01635821908712387, 0.09008069336414337, -0.2483270764350891, 0.18294858932495117, 0.12152409553527832, -0.35993167757987976, 0.29422205686569214, 0.3047971725463867, -0.32741761207580566, -0.3536812961101532, -0.07073211669921875, 0.12623807787895203, -0.28850701451301575, 0.2827048897743225, 0.24402448534965515, -0.0033901818096637726, 0.11432190239429474, 0.054770633578300476, 0.2501124441623688, 0.046704795211553574, 0.06587709486484528, 0.22319486737251282, -0.0363900288939476, 0.31841841340065, -0.08752021193504333, 0.05469830706715584, -0.007757619023323059, -0.22243502736091614, 0.01800468936562538, -0.09633062034845352, 0.024445120245218277, 0.3535770773887634, -0.569815993309021, -0.30382588505744934, -0.15292257070541382, 0.28067144751548767, -0.22567448019981384, -0.012302722781896591, -0.3624456524848938, 0.16819410026073456, -0.16262280941009521, 0.2708546817302704, -0.1577618420124054, 0.10482395440340042, -0.012714441865682602, 0.19098635017871857, -0.1016077846288681, -0.04060005396604538, -0.10025739669799805, 0.22733762860298157, -0.3786161541938782, 0.11558182537555695, 0.09414786845445633, -0.4468309283256531, 0.029929019510746002, -0.09265744686126709, 0.3993571400642395, 0.23318752646446228, -0.2621024250984192, -0.056673064827919006, -0.22219178080558777, -0.11848630011081696, -0.10225231200456619, -0.45777541399002075, 0.21263387799263, -0.06528574228286743, 0.25345665216445923, -0.10201176255941391, -0.20253241062164307, 0.03804647922515869, -0.07417351007461548, -0.014947356656193733, -0.2644021213054657 ]
https://github.com/huggingface/datasets/issues/3036
Protect master branch to force contributions via Pull Requests
This is done. Now the master branch is protected: - [x] Require a pull request before merging: all commits must be made to a non-protected branch and submitted via a pull request - Required number of approvals before merging: 1 - [x] Require linear history: prevent merge commits from being pushed - [x] These requirements are not enforced for administrators - [x] Additionally, the master branch is also protected against deletion and force pushes CC: @lhoestq @julien-c @thomwolf
In order to have a clearer Git history in the master branch, I propose to protect it so that all contributions must be done through a Pull Request and no direct commits to master are allowed. - The Pull Request allows to give context, discuss any potential issues and improve the quality of the contribution - The Pull Request will eventually be squashed and merged into master with a single commit that links to the Pull Request page (with all the context/discussions) Note that we already implemented a protection in the master branch to avoid *merge* commits and ensure a linear history. This proposal goes one step further by avoiding all kind of direct commits and forcing contributions **only** through Pull Requests. Please note that we can temporarily deactivate this protection if we need to make a direct commit, e.g. at each new version release. The only way GitHub allows this kind or protection is by requiring a minimal number (at least one) of approvals of the Pull Request. The inconvenient is that the PR creator cannot approve their own PR: another person must approve it before it can be merged into master. To circumvent this, we could eventually disable this protection in the master branch when an urgent commit is needed (e.g. for a hotfix) and there is no other person available at that time to approve the PR.
78
Protect master branch to force contributions via Pull Requests In order to have a clearer Git history in the master branch, I propose to protect it so that all contributions must be done through a Pull Request and no direct commits to master are allowed. - The Pull Request allows to give context, discuss any potential issues and improve the quality of the contribution - The Pull Request will eventually be squashed and merged into master with a single commit that links to the Pull Request page (with all the context/discussions) Note that we already implemented a protection in the master branch to avoid *merge* commits and ensure a linear history. This proposal goes one step further by avoiding all kind of direct commits and forcing contributions **only** through Pull Requests. Please note that we can temporarily deactivate this protection if we need to make a direct commit, e.g. at each new version release. The only way GitHub allows this kind or protection is by requiring a minimal number (at least one) of approvals of the Pull Request. The inconvenient is that the PR creator cannot approve their own PR: another person must approve it before it can be merged into master. To circumvent this, we could eventually disable this protection in the master branch when an urgent commit is needed (e.g. for a hotfix) and there is no other person available at that time to approve the PR. This is done. Now the master branch is protected: - [x] Require a pull request before merging: all commits must be made to a non-protected branch and submitted via a pull request - Required number of approvals before merging: 1 - [x] Require linear history: prevent merge commits from being pushed - [x] These requirements are not enforced for administrators - [x] Additionally, the master branch is also protected against deletion and force pushes CC: @lhoestq @julien-c @thomwolf
[ -0.05463016778230667, 0.0769248902797699, -0.04441084712743759, -0.07143589854240417, -0.26914262771606445, -0.1964896023273468, 0.05768818035721779, 0.36484402418136597, -0.22068078815937042, 0.1525517702102661, 0.3992951512336731, -0.060955751687288284, 0.036936983466148376, -0.09867889434099197, -0.05564381182193756, 0.19576381146907806, 0.06360755860805511, 0.15722878277301788, 0.1213737204670906, 0.15434178709983826, 0.024342447519302368, -0.17899209260940552, 0.11724205315113068, 0.02779167890548706, 0.03789801523089409, 0.05244772508740425, 0.005312563851475716, 0.14915713667869568, -0.3218849301338196, -0.23113678395748138, -0.06117526441812515, 0.3277316689491272, -0.21579420566558838, 0.6871516704559326, -0.00009820971899898723, -0.00007729977369308472, 0.15429630875587463, -0.08006126433610916, -0.17252366244792938, -0.37306898832321167, -0.5741581916809082, -0.241832435131073, -0.07540447264909744, -0.055511750280857086, -0.17618077993392944, 0.11480578780174255, -0.08049500733613968, 0.27282872796058655, 0.5183384418487549, 0.010514759458601475, 0.26336196064949036, -0.10835154354572296, 0.07108768820762634, -0.06833668798208237, 0.2550578713417053, 0.5172874331474304, -0.15730229020118713, 0.1469675749540329, -0.001851104199886322, 0.0981510654091835, 0.03406389430165291, 0.0749678760766983, 0.00041477568447589874, -0.13942532241344452, 0.17878448963165283, -0.2518008053302765, 0.49818578362464905, -0.22987830638885498, -0.24962764978408813, -0.008662760257720947, -0.04761406034231186, -0.19213595986366272, -0.34194979071617126, -0.3052257001399994, -0.12911038100719452, 0.12637856602668762, 0.03362615406513214, 0.2996911406517029, -0.1646392047405243, 0.07145778834819794, -0.19085010886192322, -0.14442719519138336, -0.013539411127567291, 0.15907251834869385, 0.4159233868122101, -0.32728466391563416, 0.050769317895174026, -0.09181588143110275, 0.34102386236190796, 0.07336293905973434, -0.21397040784358978, -0.25176772475242615, -0.09797798097133636, 0.08514683693647385, 0.03265245258808136, -0.21868018805980682, -0.12021633237600327, -0.18223229050636292, 0.31112632155418396, 0.15923798084259033, -0.3786868453025818, 0.033606503158807755, -0.006678353529423475, -0.029959872364997864, 0.2217688113451004, 0.08300919830799103, -0.12140976637601852, 0.025363851338624954, 0.33965569734573364, 0.040002524852752686, 0.0859399288892746, 0.34917518496513367, 0.21458221971988678, -0.1333055943250656, -0.1731320321559906, 0.3905530869960785, 0.22102339565753937, -0.16228196024894714, 0.23605599999427795, -0.017941147089004517, -0.3859712779521942, -0.29425904154777527, -0.04423901066184044, 0.12271787971258163, 0.06324584782123566, 0.11564632505178452, -0.17303456366062164, -0.055870458483695984, 0.16876617074012756, 0.21986623108386993, -0.28008201718330383, -0.15369272232055664, -0.40882909297943115, -0.02085615135729313, 0.029481571167707443, -0.3727649748325348, 0.059808775782585144, 0.4221438467502594, -0.17888185381889343, -0.21729923784732819, 0.1418459713459015, 0.18373776972293854, 0.18090663850307465, 0.34179314970970154, -0.04249894991517067, -0.41801461577415466, 0.32520830631256104, -0.03982750326395035, -0.08757409453392029, 0.043222010135650635, -0.024921730160713196, -0.1701916605234146, 0.03691653907299042, 0.24572068452835083, -0.11232312768697739, 0.5937803983688354, -0.4279769957065582, -0.08607825636863708, 0.01814854145050049, 0.29837316274642944, 0.37471356987953186, 0.17717425525188446, 0.3874097466468811, 0.009529193863272667, -0.04111655056476593, 0.09893950819969177, 0.34842124581336975, -0.11972437798976898, -0.02317303605377674, -0.2468147873878479, -0.007091321051120758, 0.20817872881889343, -0.19168663024902344, -0.06394542008638382, 0.06831352412700653, -0.062483444809913635, -0.03507184237241745, -0.26410821080207825, -0.10783576965332031, -0.01660034991800785, -0.36897265911102295, 0.11379679292440414, 0.14310762286186218, -0.16437222063541412, 0.1553986370563507, -0.5000047087669373, -0.040775083005428314, 0.09150409698486328, -0.2658820152282715, 0.2019304633140564, -0.37962019443511963, -0.5285712480545044, -0.31069087982177734, -0.10917848348617554, -0.005822021514177322, 0.2283456027507782, 0.36684903502464294, 0.017244689166545868, 0.13265147805213928, -0.21560847759246826, 0.009041015058755875, -0.03743547946214676, 0.438749760389328, -0.06404422223567963, -0.15071120858192444, 0.14981716871261597, 0.006482724100351334, -0.029720868915319443, -0.022036723792552948, 0.3783266544342041, 0.16424043476581573, -0.2938959002494812, 0.3065730929374695, -0.14110153913497925, 0.025092411786317825, -0.0011001043021678925, 0.26937928795814514, 0.04563748091459274, -0.3084658086299896, -0.3313813805580139, -0.09417687356472015, 0.08180452883243561, -0.3662634491920471, 0.21485471725463867, 0.17924733459949493, -0.263901948928833, -0.17784808576107025, -0.12283338606357574, 0.007277537137269974, 0.3856516182422638, -0.009858950972557068, 0.02106495015323162, -0.10285000503063202, 0.09509158134460449, -0.1343250423669815, 0.05022067204117775, -0.04641878604888916, 0.5333325862884521, 0.0985555425286293, -0.02907867170870304, -0.312652587890625, 0.14362835884094238, -0.12728065252304077, 0.028488561511039734, -0.35495299100875854, 0.22609546780586243, 0.09144234657287598, 0.02226584404706955, -0.11290904134511948, -0.14495176076889038, -0.10579636693000793, -0.3777463436126709, -0.13030876219272614, -0.06479217112064362, -0.11645129323005676, 0.2615475654602051, 0.04680515453219414, 0.1408681571483612, 0.015328563749790192, 0.18364959955215454, -0.08882544934749603, -0.07982014119625092, 0.05601565167307854, 0.16592615842819214, 0.03090459480881691, -0.15622898936271667, 0.09959232062101364, 0.34997233748435974, -0.214924618601799, 0.330516517162323, -0.028280336409807205, 0.004310894757509232, 0.2621327340602875, -0.06540811061859131, 0.22364121675491333, -0.0046037063002586365, -0.1696360558271408, -0.17005211114883423, 0.1573258936405182, 0.31955957412719727, 0.2790389060974121, 0.4257166087627411, -0.18355022370815277, 0.2620307207107544, -0.2240247279405594, -0.01942106895148754, -0.03203003853559494, -0.20419323444366455, 0.39735686779022217, -0.040205471217632294, -0.212287038564682, 0.1489671766757965, 0.0500451996922493, 0.0972130224108696, -0.38052821159362793, 0.09179586917161942, 0.5346758961677551, 0.3667451739311218, -0.11536228656768799, -0.05197441577911377, 0.13932408392429352, -0.20122627913951874, -0.046584226191043854, 0.23787859082221985, 0.4073154926300049, -0.2428218573331833, 0.3220580518245697, 0.31141385436058044, -0.1779220849275589, -0.15450464189052582, -0.24448662996292114, 0.13428209722042084, -0.41493499279022217, -0.13856622576713562, -0.0739893764257431, 0.09183221310377121, 0.3514863848686218, -0.11778479069471359, -0.3493911027908325, -0.039328671991825104, -0.38937363028526306, -0.26096969842910767, 0.039201803505420685, 0.05545249208807945, -0.41298145055770874, 0.27585306763648987, -0.15727226436138153, -0.2601734399795532, 0.684377133846283, 0.13368576765060425, 0.20779412984848022, 0.05864476040005684, -0.014399426057934761, -0.16390366852283478, 0.09066285938024521, 0.3026430308818817, 0.007921223528683186, -0.34727224707603455, -0.1967206448316574, 0.02435602992773056, 0.09684574604034424, 0.2546086311340332, 0.08328413963317871, -0.39483797550201416, 0.005692615173757076, -0.17639145255088806, -0.3079241216182709, 0.1376846581697464, 0.39853185415267944, 0.35206496715545654, -0.039095379412174225, 0.35873347520828247, 0.05439335107803345, -0.2461724877357483, 0.0639038011431694, -0.19730758666992188, 0.09880629926919937, 0.2149086892604828, 0.2828919589519501, -0.08690765500068665, -0.010325584560632706, 0.1060948371887207, 0.711759626865387, 0.12434259057044983, 0.10058821737766266, -0.2020202875137329, 0.18104979395866394, 0.03705016151070595, -0.027591757476329803, -0.0837438702583313, -0.09090494364500046, 0.009627163410186768, 0.004243569448590279, 0.21477100253105164, 0.08281620591878891, -0.19021596014499664, 0.014515280723571777, -0.43351536989212036, 0.0739334374666214, -0.40753480792045593, -0.18599359691143036, -0.1842154562473297, 0.08072639256715775, -0.07812649011611938, -0.21877923607826233, 0.04639316722750664, -0.04701077565550804, 0.11305491626262665, 0.20561815798282623, 0.14423085749149323, 0.03451235964894295, 0.19610434770584106, 0.16852793097496033, -0.1468205451965332, -0.06497219204902649, 0.05678819119930267, -0.174838587641716, -0.09506772458553314, -0.14135903120040894, 0.1277729570865631, -0.053286682814359665, 0.12514495849609375, 0.03077063523232937, 0.1357848048210144, -0.13440172374248505, -0.37401461601257324, 0.5705130100250244, -0.11780208349227905, 0.2398725152015686, 0.18743012845516205, 0.7420174479484558, 0.2367304116487503, -0.44303956627845764, -0.22253508865833282, 0.003114592283964157, -0.08315882086753845, 0.08053454756736755, 0.010364110581576824, -0.09243960678577423, 0.3075007498264313, -0.3651406466960907, 0.3522947132587433, 0.25234702229499817, -0.3267405927181244, -0.013666832819581032, 0.2387668341398239, -0.04297120124101639, 0.060912735760211945, 0.0810815617442131, -0.12448439002037048, -0.18137764930725098, 0.022528143599629402, -0.1755087524652481, 0.05097958818078041, -0.02324662357568741, 0.09671136736869812, 0.34477710723876953, 0.2877472937107086, -0.17888522148132324, 0.12501166760921478, -0.25638818740844727, -0.24988475441932678, 0.3440089225769043, 0.3288628160953522, 0.28636229038238525, 0.09824015945196152, 0.298420250415802, -0.08088298887014389, -0.14041085541248322, -0.3924526572227478, -0.22114667296409607, -0.05831421539187431, -0.2038702815771103, 0.07358133792877197, -0.11959557235240936, -0.11381224542856216, 0.1394195556640625, 0.2306337207555771, -0.3381367325782776, 0.23124000430107117, 0.4818416237831116, 1.0101219415664673, 0.20418642461299896, 0.16525959968566895, -0.06979092955589294, -0.14423175156116486, 0.24398307502269745, -0.2229326218366623, -0.13605180382728577, -0.16374854743480682, 0.23041792213916779, -0.07593753933906555, -0.1989162564277649, -0.27755630016326904, -0.3822060227394104, -0.31422221660614014, 0.011944625526666641, -0.07434091717004776, 0.4888971447944641, 0.40170326828956604, 0.2653293013572693, 0.2999490201473236, -0.21786266565322876, 0.16321642696857452, 0.27049821615219116, 0.24678176641464233, -0.10497815907001495, 0.18910658359527588, -0.4390890598297119, -0.08820202946662903, 0.0604078471660614, -0.40588778257369995, -0.016296757385134697, -0.22233161330223083, -0.2332039624452591, -0.14450596272945404, -0.44065797328948975, 0.1670089066028595, -0.12915582954883575, 0.5059278011322021, 0.24407467246055603, -0.20935404300689697, 0.10277289152145386, 0.2649608850479126, 0.29161420464515686, -0.18534351885318756, -0.08199168741703033, 0.3827393651008606, -0.17660778760910034, 0.004497848451137543, 0.0444609709084034, -0.14674648642539978, -0.682578444480896, -0.33008915185928345, 0.22435815632343292, -0.4181094765663147, 0.15288276970386505, 0.11499841511249542, 0.22955521941184998, -0.16216832399368286, -0.0313652902841568, 0.23547504842281342, 0.012725830078125, -0.05047673359513283, -0.15626192092895508, -0.1764851212501526, -0.09496292471885681, -0.011537585407495499, 0.057272717356681824, 0.1776353120803833, -0.12218229472637177, -0.004348676651716232, 0.046248484402894974, -0.06372033804655075, -0.26762109994888306, -0.3622899651527405, 0.02698388323187828, -0.07033976167440414, -0.06820883601903915, -0.33365604281425476, -0.4414447546005249, 0.04156869277358055, 0.1549951285123825, 0.19357959926128387, 0.36580029129981995, 0.011620081961154938, 0.11788354814052582, -0.21543098986148834, -0.11361320316791534, -0.2377064973115921, 0.021186688914895058, 0.057322874665260315, 0.31691813468933105, -0.13348065316677094, 0.2033970057964325, -0.4532179534435272, -0.003506775014102459, -0.1455860584974289, 0.04553891345858574, -0.09640632569789886, -0.1757650077342987, 0.07252339273691177, -0.26973190903663635, 0.05966746807098389, -0.005845252424478531, -0.13405609130859375, -0.39211606979370117, 0.08413030207157135, 0.026701927185058594, 0.02061650902032852, -0.054950445890426636, -0.10698319971561432, 0.13146404922008514, 0.0660911351442337, 0.2539781928062439, 0.23021194338798523, -0.2561480402946472, 0.04478523135185242, -0.2317013144493103, -0.029118839651346207, 0.24043619632720947, -0.15361431241035461, -0.09622681140899658, -0.08939535915851593, -0.07346141338348389, -0.06993865966796875, 0.2590690851211548, -0.29490402340888977, -0.09568528085947037, -0.30099931359291077, 0.32551223039627075, 0.19046440720558167, 0.611600935459137, 0.14949318766593933, 0.282451331615448, -0.3490388095378876, 0.008494634181261063, 0.04907847195863724, -0.21946460008621216, -0.1845228374004364, -0.10542076081037521, 0.049194563180208206, 0.3083280026912689, 0.0818328857421875, -0.02546626888215542, 0.08280108869075775, 0.07078712433576584, 0.16143003106117249, 0.19475072622299194, 0.30722466111183167, 0.003227606415748596, -0.09592723846435547, 0.1920979917049408, 0.45090556144714355, 0.035457439720630646, 0.26870647072792053, 0.2249559462070465, -0.03603063151240349, -0.02297927811741829, -0.007860733196139336, -0.07722674310207367, 0.2085632085800171, -0.5608744621276855, 0.07359585165977478, 0.18516755104064941, 0.2538556158542633, -0.3577564060688019, 0.15153977274894714, 0.25508415699005127, 0.40184226632118225, 0.20726244151592255, 0.07811454683542252, -0.27312135696411133, 0.3473391830921173, 0.1850321888923645, 0.24695326387882233, -0.3630998134613037, 0.09735876321792603, 0.35809987783432007, 0.26088812947273254, 0.2641497552394867, -0.5512396693229675, 0.05993782728910446, 0.12806284427642822, -0.11401313543319702, 0.007069539278745651, 0.14833718538284302, -0.17266660928726196, 0.3484259843826294, 0.07017535716295242, 0.11731711775064468, -0.15768644213676453, 0.2537464499473572, 0.2547808587551117, -0.10030078887939453, -0.2567453384399414, 0.1413746327161789, -0.17866066098213196, -0.04499618336558342, 0.19897682964801788, 0.13226747512817383, -0.15866035223007202, -0.09726853668689728, -0.008687789551913738, 0.21000802516937256, -0.123922199010849, -0.024613667279481888, -0.07833825051784515, -0.1761467158794403, 0.19989408552646637, -0.0950508564710617, 0.27616986632347107, -0.1862761676311493, 0.0008207522332668304, -0.12704186141490936, -0.4025529623031616, 0.08459936082363129, 0.26412320137023926, 0.49484941363334656, -0.33157140016555786, 0.32640382647514343, 0.18198230862617493, 0.2723071575164795, 0.3279452919960022, 0.17802463471889496, -0.18811221420764923, 0.012425728142261505, -0.1509706825017929, 0.17888610064983368, 0.13148880004882812, 0.2729458510875702, 0.11577975749969482, 0.023493360728025436, -0.10065582394599915, 0.04099613428115845, -0.014723077416419983, 0.15427806973457336, -0.24277019500732422, 0.11677283048629761, 0.08594359457492828, -0.21831950545310974, 0.2752506732940674, 0.30804675817489624, -0.26774245500564575, -0.3893899917602539, -0.14796201884746552, 0.02706191875040531, -0.2963758111000061, 0.3225807249546051, 0.32614731788635254, 0.0010135509073734283, 0.1081579327583313, -0.006466224789619446, 0.2519918382167816, -0.019113050773739815, 0.24886742234230042, 0.1714693158864975, -0.01965724676847458, 0.3282759487628937, -0.0788058340549469, 0.009903877973556519, -0.014186004176735878, -0.2689398527145386, -0.04742693901062012, -0.21183820068836212, 0.02412537857890129, 0.30483388900756836, -0.5105574131011963, -0.30308765172958374, -0.16351018846035004, 0.2892409563064575, -0.058955125510692596, -0.035043638199567795, -0.37141045928001404, 0.17459245026111603, -0.059210993349552155, 0.2475358545780182, -0.18859371542930603, 0.14538608491420746, 0.1247231587767601, 0.18520036339759827, -0.15091557800769806, -0.014913275837898254, -0.08261632919311523, 0.18600042164325714, -0.3763687014579773, -0.018830833956599236, 0.08196684718132019, -0.3698541224002838, -0.04167110100388527, -0.12322923541069031, 0.397532194852829, 0.255304753780365, -0.10482155531644821, -0.11646547168493271, -0.1795663833618164, -0.05574344843626022, -0.07542786002159119, -0.5268599390983582, 0.14451558887958527, 0.006246032193303108, 0.17176873981952667, -0.09638261049985886, -0.1835618019104004, 0.003545450046658516, -0.08708324283361435, -0.05323643237352371, -0.2481440305709839 ]
https://github.com/huggingface/datasets/issues/3035
`load_dataset` does not work with uploaded arrow file
Hi ! This is not a bug, this is simply not implemented. `save_to_disk` is for on-disk serialization and was not made compatible for the Hub. That being said, I agree we actually should make it work with the Hub x)
## Describe the bug I've preprocessed and uploaded a dataset here: https://huggingface.co/datasets/ami-wav2vec2/ami_headset_single_preprocessed . The dataset is in `.arrow` format. The dataset can correctly be loaded when doing: ```bash git lfs install git clone https://huggingface.co/datasets/ami-wav2vec2/ami_headset_single_preprocessed ``` followed by ```python from datasets import load_from_disk ds = load_from_disk("./ami_headset_single_preprocessed") ``` However when I try to directly download the dataset as follows: ```python from datasets import load_dataset ds = load_dataset("ami-wav2vec2/ami_headset_single_preprocessed") ``` the following error occurs: ```bash /usr/local/lib/python3.7/dist-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, script_version, use_auth_token, task, streaming, **config_kwargs) 1115 ignore_verifications=ignore_verifications, 1116 try_from_hf_gcs=try_from_hf_gcs, -> 1117 use_auth_token=use_auth_token, 1118 ) 1119 /usr/local/lib/python3.7/dist-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) 635 if not downloaded_from_gcs: 636 self._download_and_prepare( --> 637 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 638 ) 639 # Sync info /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 724 try: 725 # Prepare split will record examples associated to the split --> 726 self._prepare_split(split_generator, **prepare_split_kwargs) 727 except OSError as e: 728 raise OSError( /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _prepare_split(self, split_generator) 1186 generator, unit=" tables", leave=False, disable=bool(logging.get_verbosity() == logging.NOTSET) 1187 ): -> 1188 writer.write_table(table) 1189 num_examples, num_bytes = writer.finalize() 1190 /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in write_table(self, pa_table, writer_batch_size) 424 # reorder the arrays if necessary + cast to self._schema 425 # we can't simply use .cast here because we may need to change the order of the columns --> 426 pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) 427 batches: List[pa.RecordBatch] = pa_table.to_batches(max_chunksize=writer_batch_size) 428 self._num_bytes += sum(batch.nbytes for batch in batches) /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_arrays() /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib._sanitize_arrays() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.asarray() /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() /usr/local/lib/python3.7/dist-packages/pyarrow/compute.py in cast(arr, target_type, safe) 279 else: 280 options = CastOptions.unsafe(target_type) --> 281 return call_function("cast", [arr], options) 282 283 /usr/local/lib/python3.7/dist-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() /usr/local/lib/python3.7/dist-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<train: struct<name: string, num_bytes: int64, num_examples: int64, dataset_name: string>, validation: struct<name: string, num_bytes: int64, num_examples: int64, dataset_name: string>, test: struct<name: string, num_bytes: int64, num_examples: int64, dataset_name: string>> to list using function cast_list ``` ## Expected results The dataset should be correctly loaded with `load_dataset` IMO. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0
40
`load_dataset` does not work with uploaded arrow file ## Describe the bug I've preprocessed and uploaded a dataset here: https://huggingface.co/datasets/ami-wav2vec2/ami_headset_single_preprocessed . The dataset is in `.arrow` format. The dataset can correctly be loaded when doing: ```bash git lfs install git clone https://huggingface.co/datasets/ami-wav2vec2/ami_headset_single_preprocessed ``` followed by ```python from datasets import load_from_disk ds = load_from_disk("./ami_headset_single_preprocessed") ``` However when I try to directly download the dataset as follows: ```python from datasets import load_dataset ds = load_dataset("ami-wav2vec2/ami_headset_single_preprocessed") ``` the following error occurs: ```bash /usr/local/lib/python3.7/dist-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, script_version, use_auth_token, task, streaming, **config_kwargs) 1115 ignore_verifications=ignore_verifications, 1116 try_from_hf_gcs=try_from_hf_gcs, -> 1117 use_auth_token=use_auth_token, 1118 ) 1119 /usr/local/lib/python3.7/dist-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) 635 if not downloaded_from_gcs: 636 self._download_and_prepare( --> 637 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 638 ) 639 # Sync info /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 724 try: 725 # Prepare split will record examples associated to the split --> 726 self._prepare_split(split_generator, **prepare_split_kwargs) 727 except OSError as e: 728 raise OSError( /usr/local/lib/python3.7/dist-packages/datasets/builder.py in _prepare_split(self, split_generator) 1186 generator, unit=" tables", leave=False, disable=bool(logging.get_verbosity() == logging.NOTSET) 1187 ): -> 1188 writer.write_table(table) 1189 num_examples, num_bytes = writer.finalize() 1190 /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in write_table(self, pa_table, writer_batch_size) 424 # reorder the arrays if necessary + cast to self._schema 425 # we can't simply use .cast here because we may need to change the order of the columns --> 426 pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) 427 batches: List[pa.RecordBatch] = pa_table.to_batches(max_chunksize=writer_batch_size) 428 self._num_bytes += sum(batch.nbytes for batch in batches) /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_arrays() /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib._sanitize_arrays() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.asarray() /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.ChunkedArray.cast() /usr/local/lib/python3.7/dist-packages/pyarrow/compute.py in cast(arr, target_type, safe) 279 else: 280 options = CastOptions.unsafe(target_type) --> 281 return call_function("cast", [arr], options) 282 283 /usr/local/lib/python3.7/dist-packages/pyarrow/_compute.pyx in pyarrow._compute.call_function() /usr/local/lib/python3.7/dist-packages/pyarrow/_compute.pyx in pyarrow._compute.Function.call() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowNotImplementedError: Unsupported cast from struct<train: struct<name: string, num_bytes: int64, num_examples: int64, dataset_name: string>, validation: struct<name: string, num_bytes: int64, num_examples: int64, dataset_name: string>, test: struct<name: string, num_bytes: int64, num_examples: int64, dataset_name: string>> to list using function cast_list ``` ## Expected results The dataset should be correctly loaded with `load_dataset` IMO. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.10 - Python version: 3.8.5 - PyArrow version: 5.0.0 Hi ! This is not a bug, this is simply not implemented. `save_to_disk` is for on-disk serialization and was not made compatible for the Hub. That being said, I agree we actually should make it work with the Hub x)
[ -0.3928038477897644, -0.038575515151023865, 0.01674840599298477, 0.22262603044509888, 0.17542119324207306, -0.009485594928264618, 0.5628117322921753, 0.08513772487640381, 0.20555567741394043, -0.017303913831710815, 0.08802209049463272, 0.4524753987789154, -0.017156202346086502, 0.02389376424252987, -0.01791016384959221, 0.03338884562253952, 0.08531206846237183, 0.10291872918605804, -0.3803859353065491, 0.019657455384731293, -0.14427202939987183, 0.2501572072505951, -0.22726038098335266, 0.13198933005332947, -0.21226705610752106, 0.1587941199541092, 0.24641606211662292, 0.43144020438194275, -0.1021871417760849, -0.40406906604766846, 0.48246973752975464, 0.0766630619764328, 0.1761624664068222, 0.5237106084823608, -0.0001266861509066075, 0.23808704316616058, 0.4700068235397339, -0.19627989828586578, -0.48346689343452454, -0.39519739151000977, -0.34880077838897705, -0.1319032907485962, 0.3145773410797119, -0.06404796242713928, 0.12316916137933731, -0.40044763684272766, -0.2247779816389084, -0.42060407996177673, 0.4897966980934143, 0.19578750431537628, 0.12335851788520813, 0.1910225749015808, 0.2313358336687088, -0.01897486299276352, 0.07459146529436111, 0.31109029054641724, -0.17524787783622742, 0.3732423782348633, -0.01380658894777298, 0.13298116624355316, 0.2628330886363983, 0.1539948582649231, 0.05156524479389191, 0.16249464452266693, 0.3405149579048157, -0.0448477603495121, -0.15777957439422607, -0.09085656702518463, 0.03677922859787941, 0.21831071376800537, 0.6042831540107727, -0.32759737968444824, -0.5339693427085876, -0.2552393972873688, 0.045233964920043945, -0.20889164507389069, 0.27474990487098694, 0.18282893300056458, -0.09221932291984558, 0.10724437236785889, 0.000766048557125032, -0.1723814308643341, -0.2028944492340088, 0.1726585477590561, 0.15618231892585754, -0.030246324837207794, -0.16119809448719025, 0.26438528299331665, 0.09483115375041962, -0.08242101222276688, 0.014734548516571522, -0.1557416170835495, -0.24285981059074402, 0.3321095407009125, -0.2456998974084854, 0.3146848976612091, -0.25712478160858154, -0.3491086959838867, 0.17999419569969177, 0.4133507013320923, 0.3458425998687744, 0.09463566541671753, -0.13478679955005646, 0.189029723405838, 0.32556042075157166, 0.1741340607404709, 0.047479793429374695, 0.13203807175159454, 0.20257942378520966, 0.2669733464717865, -0.01240706630051136, -0.08570240437984467, -0.3571219742298126, -0.3845461308956146, 0.3005622923374176, -0.18313193321228027, 0.25581276416778564, -0.0825498104095459, -0.21889980137348175, -0.03537147864699364, -0.04990636184811592, -0.07168613374233246, -0.08038334548473358, 0.1496349275112152, 0.2561114430427551, 0.24592354893684387, 0.20735089480876923, 0.5286036133766174, -0.026019759476184845, -0.09351097047328949, 0.016767438501119614, -0.25166478753089905, -0.04890373721718788, -0.04884513467550278, 0.2139725238084793, -0.2573978006839752, 0.4595927596092224, -0.04999031871557236, 0.05454244837164879, -0.3271282911300659, 0.04265587776899338, -0.04413740709424019, 0.14649108052253723, 0.30492058396339417, 0.19138257205486298, 0.1889035552740097, 0.06831025332212448, 0.012745857238769531, -0.045257844030857086, 0.3910394310951233, -0.4058476388454437, -0.22617791593074799, -0.17809990048408508, 0.06575050950050354, -0.16173310577869415, -0.010690368711948395, -0.6739574074745178, -0.09223055839538574, -0.06153928488492966, -0.18518275022506714, -0.0032766014337539673, -0.2532429099082947, -0.22166961431503296, -0.1961095780134201, 0.380597323179245, 0.3868359327316284, -0.4505644738674164, -0.1303248405456543, -0.36704686284065247, -0.07866902649402618, 0.08146427571773529, 0.21253062784671783, -0.2620469331741333, 0.2521251440048218, -0.44391492009162903, 0.21126557886600494, 0.6082782745361328, -0.4810083210468292, -0.36927011609077454, 0.34204623103141785, 0.08528022468090057, 0.3052791357040405, -0.0568237379193306, -0.100657619535923, -0.20485877990722656, -0.03422493487596512, 0.016190432012081146, 0.35354745388031006, 0.21852391958236694, -0.03799072280526161, -0.12387676537036896, -0.32449448108673096, -0.19627796113491058, 0.021968640387058258, -0.22398869693279266, 0.011456795036792755, 0.22587770223617554, -0.24543286859989166, 0.28168466687202454, 0.018782231956720352, 0.0667981207370758, 0.1274469941854477, 0.12353646755218506, -0.12711097300052643, 0.03714466840028763, -0.009103721007704735, -0.801745593547821, 0.2910636067390442, -0.06012997776269913, -0.30094221234321594, -0.4226381182670593, 0.06787557154893875, -0.39607831835746765, 0.2581459879875183, -0.4720349609851837, 0.10352163016796112, -0.11192946135997772, 0.059212472289800644, 0.058804403990507126, -0.027445022016763687, -0.24269583821296692, 0.25913184881210327, -0.061054691672325134, 0.13897956907749176, -0.11251655220985413, 0.13072045147418976, 0.22214238345623016, -0.17468716204166412, 0.03255155682563782, -0.004812493920326233, 0.052401989698410034, -0.08853667974472046, -0.28773173689842224, 0.4403913617134094, -0.007363118696957827, 0.28403499722480774, -0.0813920721411705, -0.17851193249225616, 0.0485590323805809, -0.3220827281475067, -0.16978055238723755, 0.17438159883022308, 0.3360583782196045, -0.0005537793040275574, -0.18710866570472717, 0.22884665429592133, -0.15623979270458221, 0.36417558789253235, 0.10033679008483887, -0.06622126698493958, 0.25250887870788574, 0.2296377718448639, -0.13183452188968658, -0.19035866856575012, 0.005325581878423691, 0.06728240847587585, 0.43754857778549194, -0.0502098947763443, 0.018476784229278564, -0.1339343786239624, 0.27607470750808716, 0.09365460276603699, 0.043107472360134125, 0.11311618983745575, -0.33504346013069153, -0.005207687616348267, -0.02365422062575817, 0.23961888253688812, 0.49543076753616333, 0.07715115696191788, -0.03734969720244408, -0.061565764248371124, 0.08609123528003693, -0.11675459891557693, 0.29732999205589294, 0.009210079908370972, 0.5016460418701172, 0.5203506946563721, -0.03808370232582092, -0.04299610108137131, -0.14531797170639038, 0.08577455580234528, 0.012348109856247902, 0.1249866932630539, -0.4560660421848297, 0.10692582279443741, -0.22041983902454376, 0.1423385739326477, -0.18256282806396484, -0.21595412492752075, -0.23909729719161987, -0.05870836228132248, -0.2701590657234192, 0.18043740093708038, -0.048464104533195496, 0.013007703237235546, -0.30172502994537354, 0.029741808772087097, 0.17595155537128448, -0.6335484385490417, -0.20361509919166565, 0.1180640459060669, -0.1505991518497467, -0.14503662288188934, 0.2618306279182434, 0.029444115236401558, 0.108705535531044, 0.10600725561380386, 0.11527180671691895, -0.2883918881416321, 0.12739408016204834, 0.09434638917446136, 0.032535847276449203, 0.32520627975463867, 0.003200903534889221, 0.012899599969387054, 0.19550642371177673, 0.02353716269135475, 0.21075941622257233, -0.060944847762584686, -0.15646947920322418, 0.13691818714141846, 0.04090236872434616, -0.014000753872096539, -0.20850114524364471, -0.08711034804582596, -0.0875755324959755, -0.4136025905609131, 0.14808830618858337, 0.2105265110731125, 0.08910337090492249, 0.2594257593154907, 0.32792356610298157, 0.04599882662296295, 0.2531629800796509, -0.06816381961107254, -0.09981711208820343, -0.2595491409301758, 0.4124751091003418, -0.16519248485565186, -0.29548659920692444, 0.12002098560333252, 0.06893131136894226, 0.25981220602989197, 0.39765363931655884, -0.24478361010551453, 0.3146597445011139, -0.08637429773807526, 0.1802363395690918, -0.1535915583372116, 0.12985320389270782, 0.09409766644239426, 0.056991808116436005, 0.08426322042942047, -0.2452421486377716, -0.13713893294334412, 0.4301892817020416, -0.08577098697423935, -0.03949827700853348, 0.19206127524375916, 0.2589605450630188, -0.19205792248249054, 0.9589229226112366, 0.1657000184059143, -0.18991385400295258, 0.4515734910964966, -0.06260322034358978, 0.2651636600494385, -0.2975688874721527, -0.1488749235868454, -0.3305049538612366, -0.09490406513214111, 0.38344329595565796, 0.16919708251953125, 0.15344828367233276, -0.04643060266971588, -0.2906718850135803, 0.14978526532649994, -0.3273988664150238, -0.15335114300251007, 0.02452954649925232, -0.21679410338401794, 0.15565800666809082, 0.08043316006660461, 0.041408248245716095, 0.04521351680159569, -0.06204511970281601, 0.15443779528141022, 0.1561475396156311, 0.3488093912601471, 0.0958566665649414, -0.0648316740989685, 0.11524953693151474, -0.19786742329597473, 0.3099138140678406, -0.09902840107679367, 0.4291456639766693, 0.06365475058555603, -0.2493884265422821, 0.07668855041265488, -0.08760423213243484, 0.1605839729309082, -0.04889175295829773, 0.13114449381828308, 0.058844540268182755, 0.27140748500823975, -0.530174970626831, -0.10547924041748047, 0.0336594395339489, 0.26962730288505554, -0.07787726819515228, 0.325843870639801, -0.27576538920402527, -0.22105318307876587, -0.10895811021327972, 0.18998706340789795, -0.16858741641044617, -0.23208576440811157, -0.4995458424091339, -0.09378731995820999, -0.44600367546081543, -0.26154711842536926, 0.06927778571844101, 0.05570331588387489, -0.03754805773496628, 0.04407171532511711, -0.3059919774532318, -0.047764912247657776, -0.15595974028110504, -0.046153388917446136, 0.5293853282928467, -0.03468560799956322, 0.2297746241092682, 0.25336146354675293, 0.2043483704328537, 0.39236515760421753, 0.994692325592041, 0.11700917780399323, -0.3605111837387085, -0.018995068967342377, -0.19549475610256195, 0.013446435332298279, 0.19954551756381989, -0.1793263703584671, -0.03703185170888901, 0.06596773862838745, -0.0958578884601593, -0.23786358535289764, -0.057988546788692474, 0.37197408080101013, -0.13460773229599, -0.17797988653182983, -0.3902963697910309, 0.4403552711009979, -0.046335622668266296, 0.022622868418693542, 0.6479895710945129, 0.29456615447998047, -0.2893545925617218, 0.3713156580924988, -0.18570610880851746, 0.6410073637962341, -0.007292456924915314, 0.16651363670825958, 0.36130326986312866, -0.20306488871574402, 0.05812319368124008, 0.21075882017612457, -0.11793144047260284, -0.18333807587623596, 0.22112002968788147, 0.05182133615016937, -0.17089053988456726, 0.14487409591674805, 0.3337962031364441, 0.08690018951892853, 0.1629762351512909, -0.24697847664356232, -0.45461851358413696, 0.07156603783369064, 0.25560426712036133, 0.019236121326684952, -0.29825857281684875, -0.18393070995807648, -0.008816748857498169, 0.021273232996463776, 0.27813565731048584, -0.010842986404895782, -0.2668907642364502, -0.26117074489593506, -0.25812244415283203, -0.2708302438259125, 0.3368840217590332, -0.27887895703315735, 0.07531629502773285, -0.024183448404073715, -0.25038379430770874, 0.42954933643341064, 0.1168101578950882, -0.08224688470363617, -0.06746622920036316, -0.11819805204868317, 0.22644728422164917, 0.0750826746225357, 0.19118797779083252, -0.1344941407442093, 0.0470430925488472, 0.25395458936691284, -0.08241572976112366, -0.08295349776744843, -0.03717682510614395, -0.27380266785621643, -0.4156753420829773, 0.2229025959968567, 0.15071898698806763, 0.15076106786727905, -0.09655193984508514, -0.5121361017227173, 0.005867958068847656, 0.06014726683497429, -0.1327400952577591, 0.013540398329496384, 0.20989938080310822, -0.06148204207420349, -0.039988502860069275, 0.07674798369407654, -0.34448495507240295, 0.13994929194450378, 0.3128020763397217, -0.2815854847431183, -0.12541702389717102, 0.753657341003418, 0.01798706129193306, -0.02452973648905754, -0.11339663714170456, 0.13974452018737793, 0.29686471819877625, -0.7724610567092896, 0.15448564291000366, 0.09286150336265564, 0.2531687021255493, -0.12570050358772278, 0.16483554244041443, -0.0060048289597034454, -0.05968823283910751, 0.0369214229285717, -0.39232495427131653, -0.2604139745235443, -0.11871154606342316, -0.14819777011871338, 0.07499807327985764, -0.05298972874879837, -0.4901479482650757, 0.0359702929854393, -0.012128626927733421, -0.11228407174348831, 0.1884344071149826, 0.2668176293373108, -0.10876098275184631, 0.05479363352060318, 0.16385695338249207, 0.3520558178424835, -0.10771100223064423, 0.07149606198072433, -0.1255728006362915, -0.17318874597549438, -0.07954699546098709, -0.33162742853164673, 0.2414635419845581, -0.046279698610305786, -0.2366829216480255, -0.054296448826789856, -0.35989534854888916, -0.2673959732055664, -0.09788576513528824, 0.1496715545654297, 0.11080390959978104, -0.10590165853500366, -0.05542407184839249, 0.27342209219932556, 0.1384604126214981, -0.5284571647644043, 0.14038392901420593, -0.08636294305324554, 0.27187973260879517, 0.03673525154590607, 0.10911251604557037, 0.023267630487680435, -0.015755504369735718, -0.28537383675575256, -0.10987747460603714, 0.15219950675964355, 0.18255743384361267, 0.4346969723701477, -0.5272276401519775, 0.12167136371135712, -0.2600214183330536, 0.44823166728019714, 0.47126325964927673, -0.296611487865448, -0.09696520119905472, 0.050544314086437225, 0.07317294925451279, -0.30878782272338867, 0.014794016256928444, -0.014091797173023224, -0.020552445203065872, -0.02723429724574089, 0.06065485253930092, 0.11670322716236115, -0.056894637644290924, -0.18294911086559296, 0.04675816744565964, 0.08479204773902893, 0.1346624344587326, 0.033409398049116135, 0.23939187824726105, 0.128516286611557, 0.34233495593070984, 0.0011635329574346542, 0.04451318085193634, 0.2231580913066864, 0.35523325204849243, -0.4064995348453522, 0.03295847773551941, 0.2613241672515869, -0.08027872443199158, -0.1125844195485115, -0.5766575336456299, -0.11682561039924622, 0.0341823548078537, -0.024809449911117554, 0.3383745551109314, 0.23500289022922516, 0.43454405665397644, 0.015135749243199825, -0.32634252309799194, -0.017382636666297913, -0.08097314834594727, 0.10556599497795105, -0.1739930510520935, -0.2680952548980713, -0.22432586550712585, -0.4313214123249054, 0.04118364676833153, -0.11401276290416718, -0.05633797496557236, 0.050193801522254944, 0.42214351892471313, 0.03477377071976662, -0.398587703704834, -0.014373864978551865, 0.1931207776069641, 0.09587357938289642, -0.20883211493492126, 0.37591737508773804, 0.1985502541065216, -0.1322643756866455, 0.35450971126556396, 0.12563379108905792, 0.5038222074508667, 0.33453401923179626, 0.1414293348789215, 0.12339440733194351, 0.031089413911104202, 0.02894113026559353, -0.05101137235760689, 0.19507509469985962, 0.15366002917289734, 0.13459521532058716, 0.393248587846756, 0.04794275760650635, -0.03344457969069481, -0.12139514088630676, 0.152932271361351, 0.2026507705450058, -0.2858663499355316, 0.37517836689949036, -0.4824717938899994, -0.11879011988639832, -0.2758618891239166, 0.2221386432647705, -0.11454789340496063, 0.12088516354560852, 0.44897323846817017, 0.07572592794895172, 0.055718794465065, -0.18209603428840637, -0.0023133419454097748, -0.02830331027507782, 0.5782277584075928, 0.47883284091949463, 0.28984060883522034, -0.09480331838130951, -0.12316291034221649, -0.7397434115409851, 0.1035163551568985, -0.09459443390369415, 0.1611814796924591, 0.11319375038146973, 0.2436010092496872, 0.13807198405265808, 0.1662856936454773, 0.4788471460342407, -0.12082581967115402, 0.3649386763572693, 0.3390941917896271, -0.2787328362464905, -0.07585766911506653, -0.0599624365568161, 0.17156651616096497, -0.139990895986557, -0.732459306716919, -0.09372510015964508, -0.20769962668418884, -0.1209668442606926, 0.16903933882713318, -0.20403024554252625, 0.10342113673686981, 0.2372511625289917, 0.6178174018859863, -0.021299121901392937, 0.2736259400844574, -0.1037549376487732, -0.2025933563709259, -0.41338878870010376, -0.13630986213684082, -0.16966964304447174, 0.30231064558029175, 0.03009803406894207, 0.3296400010585785, -0.23585407435894012, -0.0351925827562809, -0.37757638096809387, -0.13588662445545197, -0.10198035836219788, -0.21452507376670837, -0.36846432089805603, -0.04041094332933426, -0.2793084979057312, 0.08774193376302719, 0.08115265518426895, 0.005038753151893616, -0.1258525252342224, 0.1431509554386139, -0.3643750548362732, -0.1473311334848404, 0.5720822811126709, -0.30366331338882446, -0.1985093653202057, 0.16549406945705414, 0.30974048376083374, 0.17134803533554077, 0.0038208886981010437, -0.4751100242137909, 0.2150406837463379, 0.4010898768901825, -0.10701674968004227, -0.08496615290641785, 0.06747044622898102, -0.29614904522895813, 0.08493049442768097, -0.015588466078042984, 0.6250619888305664, -0.01131422445178032, -0.33833998441696167, -0.12041342258453369, -0.3342060446739197 ]
https://github.com/huggingface/datasets/issues/3032
Error when loading private dataset with "data_files" arg
We'll do a release tomorrow or on wednesday to make the fix available :) Thanks for reproting !
## Describe the bug A clear and concise description of what the bug is. Private datasets with no loading script can't be loaded using `data_files` parameter. ## Steps to reproduce the bug ```python from datasets import load_dataset data_files = {"train": "**/train/*/*.jsonl", "valid": "**/valid/*/*.jsonl"} dataset = load_dataset('dalle-mini/encoded', data_files=data_files, use_auth_token=True, streaming=True) ``` Same error happens in non-streaming mode. ## Expected results Files should be loaded (whether in streaming or not). ## Actual results Error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, return_associated_base_path, data_files, **download_kwargs) 539 try: --> 540 local_path = cached_path(file_path, download_config=download_config) 541 except FileNotFoundError: 8 frames FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/dalle-mini/encoded/resolve/main/encoded.py During handling of the above exception, another exception occurred: HTTPError Traceback (most recent call last) HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/datasets/dalle-mini/encoded?full=true During handling of the above exception, another exception occurred: FileNotFoundError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, return_associated_base_path, data_files, **download_kwargs) 547 except Exception: 548 raise FileNotFoundError( --> 549 f"Couldn't find a directory or a {resource_type} named '{path}'. " 550 f"It doesn't exist locally at {expected_dir_for_combined_path_abs} or remotely on {hf_api.endpoint}/datasets" 551 ) FileNotFoundError: Couldn't find a directory or a dataset named 'dalle-mini/encoded'. It doesn't exist locally at /content/dalle-mini/encoded or remotely on https://huggingface.co/datasets ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 @lhoestq
18
Error when loading private dataset with "data_files" arg ## Describe the bug A clear and concise description of what the bug is. Private datasets with no loading script can't be loaded using `data_files` parameter. ## Steps to reproduce the bug ```python from datasets import load_dataset data_files = {"train": "**/train/*/*.jsonl", "valid": "**/valid/*/*.jsonl"} dataset = load_dataset('dalle-mini/encoded', data_files=data_files, use_auth_token=True, streaming=True) ``` Same error happens in non-streaming mode. ## Expected results Files should be loaded (whether in streaming or not). ## Actual results Error: ``` --------------------------------------------------------------------------- FileNotFoundError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, return_associated_base_path, data_files, **download_kwargs) 539 try: --> 540 local_path = cached_path(file_path, download_config=download_config) 541 except FileNotFoundError: 8 frames FileNotFoundError: Couldn't find file at https://huggingface.co/datasets/dalle-mini/encoded/resolve/main/encoded.py During handling of the above exception, another exception occurred: HTTPError Traceback (most recent call last) HTTPError: 404 Client Error: Not Found for url: https://huggingface.co/api/datasets/dalle-mini/encoded?full=true During handling of the above exception, another exception occurred: FileNotFoundError Traceback (most recent call last) /usr/local/lib/python3.7/dist-packages/datasets/load.py in prepare_module(path, script_version, download_config, download_mode, dataset, force_local_path, dynamic_modules_path, return_resolved_file_path, return_associated_base_path, data_files, **download_kwargs) 547 except Exception: 548 raise FileNotFoundError( --> 549 f"Couldn't find a directory or a {resource_type} named '{path}'. " 550 f"It doesn't exist locally at {expected_dir_for_combined_path_abs} or remotely on {hf_api.endpoint}/datasets" 551 ) FileNotFoundError: Couldn't find a directory or a dataset named 'dalle-mini/encoded'. It doesn't exist locally at /content/dalle-mini/encoded or remotely on https://huggingface.co/datasets ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 @lhoestq We'll do a release tomorrow or on wednesday to make the fix available :) Thanks for reproting !
[ -0.29036954045295715, 0.1561492383480072, 0.030724775046110153, 0.4303286671638489, 0.19117800891399384, 0.02577962726354599, 0.4299962818622589, 0.4009224474430084, 0.15519699454307556, 0.05512695014476776, -0.15647612512111664, 0.2306966781616211, -0.16255861520767212, -0.0824602022767067, 0.06502524763345718, 0.06663410365581512, -0.08496693521738052, 0.10852759331464767, 0.022583749145269394, 0.05798937380313873, -0.29593873023986816, 0.10745798051357269, -0.23760667443275452, -0.1826736479997635, 0.15919078886508942, -0.005786294117569923, 0.1428612619638443, 0.45981326699256897, -0.1129722073674202, -0.33643582463264465, 0.1604580581188202, -0.2739298939704895, 0.34518611431121826, 0.5930113196372986, -0.00011658960283966735, 0.324057400226593, 0.578717052936554, -0.1371544450521469, -0.5110735893249512, -0.31308531761169434, -0.4098590910434723, -0.002905596047639847, 0.18081225454807281, -0.1826782524585724, -0.13133682310581207, -0.3966875672340393, -0.02815987356007099, -0.4218597412109375, 0.5495311617851257, 0.37868010997772217, 0.17119203507900238, 0.30914947390556335, -0.19857965409755707, -0.1525229960680008, 0.1244911402463913, 0.11657093465328217, -0.01787608116865158, 0.2135334461927414, -0.013781286776065826, 0.17126913368701935, -0.16688546538352966, 0.2870497405529022, -0.31488344073295593, -0.0619247741997242, 0.3347286880016327, 0.11404819786548615, -0.09244980663061142, -0.209716796875, 0.13814914226531982, 0.111452616751194, 0.7266331315040588, -0.2186492383480072, -0.38168591260910034, -0.27972152829170227, 0.13423369824886322, -0.26649749279022217, 0.1291687935590744, 0.23790811002254486, -0.1455371081829071, 0.08229294419288635, -0.12565316259860992, -0.025685235857963562, -0.25561439990997314, 0.22868619859218597, 0.32360342144966125, -0.12960770726203918, -0.05988842248916626, 0.07807996869087219, -0.19618496298789978, -0.12954576313495636, 0.011527198366820812, -0.14083750545978546, -0.09188809990882874, 0.20590966939926147, -0.004939276725053787, 0.16669271886348724, 0.13419465720653534, 0.0815419852733612, 0.15961045026779175, 0.3349066972732544, 0.2448388934135437, -0.07390259206295013, -0.10382731258869171, 0.07557287812232971, 0.027255119755864143, 0.15856781601905823, 0.033809248358011246, 0.13745488226413727, 0.4046429991722107, 0.4681552052497864, -0.0009268708527088165, 0.010207470506429672, -0.1450333297252655, -0.05774787440896034, -0.12409457564353943, -0.1071585938334465, 0.5488464832305908, -0.2591852843761444, -0.40941619873046875, -0.00856130663305521, -0.08536610007286072, 0.05560167506337166, 0.027859145775437355, 0.4063493311405182, -0.011629901826381683, -0.09492645412683487, 0.21507470309734344, 0.16857145726680756, -0.0836133360862732, -0.23573541641235352, -0.19697871804237366, -0.15804292261600494, 0.044206421822309494, 0.13605672121047974, 0.3235349953174591, -0.1387709677219391, 0.3186033070087433, 0.18172547221183777, 0.01746334135532379, 0.012920401990413666, 0.12379394471645355, 0.0407034195959568, -0.23956969380378723, 0.3833337724208832, 0.11976608633995056, 0.06581349670886993, 0.23782514035701752, -0.3579257130622864, 0.04980552941560745, 0.14133700728416443, -0.33219459652900696, -0.40535590052604675, 0.08615917712450027, 0.15520721673965454, -0.3704569935798645, 0.11703439056873322, -0.3429155945777893, -0.07250186800956726, 0.06526169925928116, -0.33192160725593567, 0.016729190945625305, -0.19413158297538757, -0.3359285295009613, -0.24447502195835114, 0.35451582074165344, 0.8923539519309998, -0.29053860902786255, -0.10322344303131104, -0.2116887867450714, -0.31945255398750305, 0.26641765236854553, 0.1446482241153717, -0.1367926448583603, -0.02817235141992569, -0.41252756118774414, 0.08165578544139862, 0.5212771892547607, -0.2712142765522003, -0.4752935767173767, 0.617785632610321, -0.1550975888967514, 0.3110103905200958, 0.2835176885128021, 0.0969899594783783, 0.17508460581302643, -0.028084786608815193, 0.3497490882873535, 0.20681250095367432, 0.04694444686174393, -0.07083769142627716, -0.3066215217113495, -0.1830463707447052, 0.26434415578842163, 0.29974982142448425, 0.011530708521604538, 0.15022794902324677, 0.14050978422164917, -0.02366567775607109, 0.26528221368789673, 0.022309139370918274, -0.050390273332595825, 0.10508765280246735, 0.2761020064353943, -0.0372774600982666, 0.18141721189022064, 0.039646245539188385, -0.5989333987236023, 0.217180997133255, -0.039985381066799164, -0.1016433984041214, -0.2662973403930664, -0.09130165725946426, -0.19018220901489258, -0.14784646034240723, -0.26573216915130615, -0.1175491213798523, 0.018194932490587234, 0.11515559256076813, -0.17107798159122467, 0.11369064450263977, -0.27510979771614075, 0.49891766905784607, -0.3676988482475281, 0.10531724989414215, -0.47989508509635925, 0.12616181373596191, 0.1682884246110916, -0.26561275124549866, 0.19409297406673431, -0.017059072852134705, 0.2895064651966095, -0.03216008469462395, -0.1867906153202057, 0.30342578887939453, 0.3349783718585968, 0.10365021973848343, 0.10652673244476318, -0.06943662464618683, 0.09225992113351822, -0.13989034295082092, 0.055677734315395355, 0.42800173163414, 0.22954165935516357, 0.10583660751581192, 0.0752289816737175, 0.25719356536865234, -0.046953778713941574, 0.25724491477012634, 0.048985280096530914, -0.16298189759254456, 0.05405811965465546, -0.03140381723642349, -0.3879786729812622, -0.26816749572753906, 0.3927336633205414, -0.22257556021213531, 0.3901299834251404, 0.07902398705482483, -0.2781415581703186, -0.022677607834339142, 0.010561689734458923, -0.05042200908064842, 0.06518686562776566, 0.2716168463230133, -0.27751919627189636, 0.08464816212654114, -0.0451970174908638, 0.45222315192222595, 0.6720916032791138, 0.13801723718643188, -0.17318770289421082, 0.10560273379087448, 0.03503933548927307, -0.21626748144626617, 0.1507759690284729, -0.05681502819061279, 0.1227644830942154, 0.34487366676330566, -0.03283464163541794, 0.08520674705505371, -0.10007456690073013, -0.25313809514045715, -0.06096489727497101, 0.19227923452854156, -0.5153964757919312, -0.12623478472232819, -0.4613441228866577, -0.1893221139907837, 0.06683067232370377, -0.06251302361488342, -0.17291831970214844, 0.0013633165508508682, -0.046790026128292084, -0.0019260570406913757, -0.11010594666004181, 0.02736811712384224, -0.5067342519760132, 0.2731795012950897, 0.2176574468612671, -0.4486323595046997, -0.30389779806137085, 0.08130892366170883, -0.08047740906476974, -0.02936887927353382, 0.3875233232975006, -0.0793241485953331, 0.23273701965808868, -0.17700599133968353, -0.3405681252479553, -0.21453145146369934, -0.10170423984527588, -0.08726601302623749, 0.010622983798384666, 0.5590319037437439, 0.0862337276339531, 0.20605793595314026, 0.3480830192565918, 0.02711809054017067, 0.24625946581363678, -0.056885167956352234, -0.18718895316123962, 0.14242009818553925, -0.0919245257973671, 0.08206155896186829, -0.43199846148490906, -0.36231863498687744, -0.2072739154100418, -0.4887995719909668, 0.11068305373191833, 0.14850923418998718, 0.10301005840301514, 0.1551559865474701, 0.30547481775283813, 0.25578534603118896, 0.054363466799259186, 0.12569555640220642, -0.12813369929790497, -0.22773179411888123, 0.6152669787406921, -0.26030269265174866, -0.3239282965660095, 0.21706053614616394, 0.05508921295404434, 0.09618446230888367, 0.06846065074205399, -0.597839891910553, -0.28899964690208435, 0.011682882905006409, -0.020706981420516968, -0.19829820096492767, -0.22231300175189972, 0.021602287888526917, -0.11615926027297974, 0.02596672810614109, -0.25376978516578674, -0.22821016609668732, 0.01589202880859375, -0.14880701899528503, 0.15968747437000275, 0.08370724320411682, 0.5658369064331055, -0.023126762360334396, 0.6997226476669312, 0.2779694199562073, 0.04210794344544411, 0.19894810020923615, -0.08022919297218323, 0.4185764193534851, -0.11455617100000381, -0.13487893342971802, -0.0882573053240776, 0.0967889130115509, -0.20616044104099274, 0.1728050410747528, 0.0015980163589119911, 0.023550868034362793, -0.2556643486022949, -0.15218834578990936, -0.34540900588035583, -0.0506315641105175, -0.02936454303562641, 0.07127805799245834, 0.05945992097258568, 0.05941324308514595, 0.17681530117988586, -0.008801618590950966, -0.08074687421321869, -0.1292518526315689, 0.44182151556015015, 0.3338131904602051, 0.2300061136484146, 0.27888917922973633, 0.06889210641384125, -0.06493554264307022, 0.40479594469070435, 0.0028077259194105864, 0.3561449646949768, -0.18120644986629486, -0.11767623573541641, 0.044160570949316025, -0.03877560421824455, 0.5842128396034241, 0.05363953858613968, 0.2430351972579956, 0.128813236951828, 0.03884133696556091, -0.48912838101387024, -0.11796313524246216, -0.00484844297170639, -0.045588329434394836, -0.09681554138660431, 0.7392321228981018, -0.13031740486621857, -0.04290413111448288, -0.07093308120965958, 0.07885266095399857, -0.04468582570552826, -0.23047296702861786, -0.47713401913642883, -0.3460107743740082, -0.16653427481651306, -0.05024268478155136, -0.2072109878063202, 0.0862213522195816, -0.2813725173473358, 0.040102433413267136, 0.14255951344966888, -0.027481863275170326, 0.05851404368877411, -0.044183939695358276, 0.38630223274230957, -0.12007781863212585, 0.2472982406616211, 0.2623210549354553, 0.2557327151298523, 0.4818252921104431, 0.650627613067627, 0.15596868097782135, -0.40941470861434937, 0.10546081513166428, 0.006589413620531559, -0.021168924868106842, 0.3709872364997864, -0.21360163390636444, -0.0021402165293693542, 0.41299620270729065, 0.17392456531524658, -0.16921888291835785, 0.07557544112205505, 0.2809079885482788, -0.4007249176502228, -0.21199731528759003, -0.5948712229728699, 0.45862460136413574, 0.013293776661157608, 0.10366123914718628, 0.2204693853855133, -0.10381127893924713, -0.2536267042160034, 0.21512529253959656, -0.23464232683181763, 0.5241377353668213, 0.20972949266433716, 0.17130286991596222, 0.34096890687942505, -0.07987947762012482, 0.1852021962404251, -0.12350809574127197, 0.10910738259553909, -0.13650651276111603, -0.3133643865585327, -0.01706581935286522, -0.2032271772623062, 0.3189789056777954, -0.17780689895153046, -0.04047359153628349, 0.22839760780334473, -0.16538141667842865, 0.23960989713668823, 0.13766230642795563, -0.07873133569955826, -0.25314587354660034, -0.03962825611233711, -0.40629589557647705, 0.07415874302387238, -0.21262426674365997, 0.05785919725894928, 0.08187271654605865, -0.2441771775484085, -0.2912781536579132, -0.2526930570602417, -0.10787352174520493, 0.35577380657196045, -0.3060319721698761, -0.05629822611808777, -0.021871093660593033, -0.4766618013381958, 0.2733483910560608, 0.432485967874527, -0.28188854455947876, -0.032804567366838455, -0.29718151688575745, 0.1951252818107605, -0.2432137429714203, 0.14138375222682953, -0.11503127962350845, 0.0688113272190094, 0.31033268570899963, -0.02218223176896572, 0.0023682639002799988, 0.020862296223640442, -0.20217928290367126, -0.18087849020957947, 0.04139032959938049, 0.18313375115394592, 0.16768744587898254, -0.2042568176984787, -0.35557079315185547, -0.22662317752838135, 0.19029594957828522, -0.102780282497406, 0.09667590260505676, 0.10618069022893906, -0.15894216299057007, -0.03262294828891754, -0.092027947306633, -0.2998102903366089, -0.03567483648657799, 0.6921850442886353, -0.05973655730485916, 0.0674770250916481, 0.5617210865020752, -0.0027465447783470154, -0.01091541163623333, -0.18210673332214355, 0.21933278441429138, 0.029429912567138672, -0.14109010994434357, 0.26674461364746094, 0.3428713083267212, 0.42759132385253906, -0.07956293225288391, -0.24197828769683838, -0.11235204339027405, -0.23188531398773193, -0.08567368239164352, -0.5077095031738281, -0.2654089033603668, 0.35174697637557983, -0.28277358412742615, -0.09314523637294769, 0.00841725617647171, -0.11199864745140076, -0.009397929534316063, -0.3472171127796173, -0.2792290449142456, 0.23947550356388092, -0.001309642568230629, -0.006481945514678955, 0.25170427560806274, 0.19459623098373413, 0.32137835025787354, 0.07954320311546326, 0.13451650738716125, 0.11706940084695816, -0.24730294942855835, -0.1882493793964386, -0.2004789412021637, 0.161599263548851, 0.08795057982206345, -0.08658523112535477, -0.012775812298059464, -0.27664947509765625, -0.18106524646282196, 0.01002546027302742, 0.23244202136993408, 0.2003152072429657, -0.0023612305521965027, -0.12323271483182907, -0.17428579926490784, 0.1943897008895874, -0.10163270682096481, 0.22558079659938812, -0.277281254529953, 0.2832351624965668, 0.08795138448476791, 0.056734900921583176, -0.26292964816093445, 0.09444232285022736, -0.025489646941423416, -0.09371163696050644, 0.056923650205135345, 0.27191096544265747, 0.4807797074317932, -0.4850408434867859, 0.043846916407346725, -0.10831455141305923, 0.18589498102664948, 0.1689242422580719, -0.373069703578949, 0.017418676987290382, 0.15200653672218323, 0.10073432326316833, -0.23485155403614044, 0.05293518677353859, 0.36018863320350647, 0.11794626712799072, -0.01557638868689537, 0.10940869897603989, 0.05561882629990578, -0.012200996279716492, -0.14922404289245605, -0.02523808181285858, 0.5479941368103027, -0.05116000771522522, 0.1291135549545288, 0.3964274525642395, -0.058019012212753296, 0.22975049912929535, -0.13880710303783417, 0.1604858636856079, 0.10226061195135117, 0.6611014008522034, -0.23596903681755066, 0.24802342057228088, -0.07587657868862152, -0.017477449029684067, -0.3604586124420166, -0.7424253225326538, -0.21687151491641998, 0.20461389422416687, -0.11850583553314209, 0.35316893458366394, -0.28210657835006714, 0.341793954372406, -0.28508105874061584, 0.2414044290781021, -0.05537298321723938, -0.20457333326339722, 0.03830411657691002, 0.08938111364841461, -0.31467199325561523, -0.17224766314029694, -0.183003231883049, 0.08248262107372284, -0.07888244092464447, -0.08855505287647247, -0.29408562183380127, 0.18266721069812775, -0.2920399308204651, -0.08524961024522781, -0.29269254207611084, 0.2863389849662781, -0.018453523516654968, -0.28419938683509827, 0.29489389061927795, 0.21592065691947937, 0.09103764593601227, 0.31712043285369873, 0.012422814965248108, 0.450368195772171, 0.40699782967567444, 0.06714513152837753, -0.07115908712148666, 0.3148636221885681, -0.07541213184595108, -0.029016956686973572, 0.3210367262363434, 0.22937671840190887, 0.01014983281493187, 0.20396700501441956, 0.12191365659236908, -0.1549086719751358, 0.24555091559886932, 0.07960085570812225, 0.23098553717136383, -0.17402489483356476, 0.2963155210018158, -0.43780043721199036, 0.0741400197148323, -0.20078282058238983, -0.05484854429960251, -0.4127604365348816, 0.0008651008829474449, 0.4227393567562103, 0.344922810792923, 0.07409901916980743, 0.0471121110022068, 0.04464150220155716, -0.3646557331085205, 0.2673088014125824, 0.4039835035800934, 0.11035655438899994, -0.19506004452705383, -0.004582367837429047, -0.5818870067596436, 0.2494298815727234, 0.007726702839136124, -0.04972607642412186, -0.06561094522476196, 0.12718656659126282, 0.05282536894083023, -0.06647802144289017, 0.3057737946510315, -0.14053550362586975, 0.2272215038537979, 0.1210920587182045, -0.07363990694284439, -0.2520380914211273, -0.27297258377075195, 0.12810571491718292, -0.13266226649284363, -0.34220650792121887, -0.058048445731401443, -0.47233128547668457, 0.04986543953418732, 0.20511364936828613, -0.16465406119823456, 0.04811793193221092, 0.03509588539600372, 0.6480146646499634, -0.07519687712192535, 0.39392492175102234, -0.0980953574180603, -0.27169737219810486, -0.35807085037231445, -0.0549715980887413, -0.1285025179386139, -0.07117731124162674, 0.04697000980377197, 0.4296199381351471, -0.20084859430789948, -0.015069518238306046, -0.37250611186027527, 0.47679635882377625, -0.21339529752731323, -0.11592677235603333, -0.07720178365707397, 0.23536470532417297, -0.3474005162715912, -0.0049589830450713634, -0.05546315386891365, -0.03856905549764633, -0.14083273708820343, 0.04302532970905304, -0.24690130352973938, -0.1702256202697754, 0.751918375492096, -0.5599157214164734, -0.0575709268450737, 0.07934834063053131, 0.24759550392627716, 0.08327258378267288, 0.03379608318209648, -0.11476515978574753, 0.1833260953426361, 0.30099278688430786, -0.09458818286657333, -0.18444672226905823, 0.12270957231521606, -0.19101181626319885, 0.06338512897491455, -0.055267754942178726, -0.06530489027500153, 0.07657398283481598, -0.10377489030361176, 0.2832106649875641, -0.2753114104270935 ]
https://github.com/huggingface/datasets/issues/3027
Resolve data_files by split name
Awesome @lhoestq I like the proposal and it works great on my JSON community dataset. Here is the [log](https://gist.github.com/vblagoje/714babc325bcbdd5de579fd8e1648892).
This issue is about discussing the default behavior when someone loads a dataset that consists in data files. For example: ```python load_dataset("lhoestq/demo1") ``` should return two splits "train" and "test" since the dataset repostiory is like ``` data/ ├── train.csv └── test.csv ``` Currently it returns only one split "train" which contains the data of both files I started playing with this idea on this branch btw: `resolve-data_files-by-split-name` Basically the idea is that if you named you data files after split names then the default pattern is ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` otherwise it's ```python { "train": ["*"] } ``` Let me know what you think ! cc @albertvillanova @LysandreJik @vblagoje
19
Resolve data_files by split name This issue is about discussing the default behavior when someone loads a dataset that consists in data files. For example: ```python load_dataset("lhoestq/demo1") ``` should return two splits "train" and "test" since the dataset repostiory is like ``` data/ ├── train.csv └── test.csv ``` Currently it returns only one split "train" which contains the data of both files I started playing with this idea on this branch btw: `resolve-data_files-by-split-name` Basically the idea is that if you named you data files after split names then the default pattern is ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` otherwise it's ```python { "train": ["*"] } ``` Let me know what you think ! cc @albertvillanova @LysandreJik @vblagoje Awesome @lhoestq I like the proposal and it works great on my JSON community dataset. Here is the [log](https://gist.github.com/vblagoje/714babc325bcbdd5de579fd8e1648892).
[ 0.0484917052090168, 0.09161588549613953, -0.08407853543758392, 0.10354280471801758, 0.14218522608280182, -0.05122068524360657, 0.3762041926383972, 0.6377534866333008, 0.14259424805641174, 0.0023931264877319336, 0.2522256076335907, 0.36616724729537964, -0.15676362812519073, 0.24765513837337494, -0.33652210235595703, -0.21404844522476196, -0.04557836800813675, 0.06326430290937424, 0.1257699728012085, 0.10078264772891998, -0.22934725880622864, 0.12884224951267242, -0.06364041566848755, 0.13439881801605225, -0.2772204875946045, 0.13378220796585083, 0.09310267865657806, 0.2215471863746643, -0.08483057469129562, -0.4323835074901581, 0.3156614899635315, 0.2500081956386566, -0.011630630120635033, 0.2212948203086853, -0.0001169831957668066, -0.005529932677745819, 0.5372303128242493, -0.07953689992427826, 0.1203419417142868, -0.29808610677719116, -0.33110296726226807, -0.20231948792934418, 0.3802294135093689, -0.40925973653793335, -0.19965630769729614, -0.3569052517414093, 0.028547700494527817, -0.4087566137313843, 0.49690020084381104, -0.1903088539838791, 0.1064983457326889, -0.33419227600097656, -0.14905771613121033, 0.1212783083319664, 0.028791941702365875, 0.5580282807350159, 0.08296111971139908, 0.30460602045059204, 0.13288988173007965, -0.18833738565444946, 0.0007316544651985168, 0.028477752581238747, -0.053393371403217316, 0.13596154749393463, 0.05546434223651886, 0.056560445576906204, -0.25602298974990845, -0.2581552267074585, -0.145162433385849, 0.33355584740638733, 0.3176945447921753, -0.07039882242679596, -0.060489244759082794, -0.4967842102050781, -0.07800418883562088, 0.015509894117712975, 0.27516815066337585, 0.29974615573883057, -0.07491502910852432, 0.1399318277835846, 0.09387403726577759, -0.06699385493993759, -0.02165955677628517, 0.07438437640666962, -0.35281938314437866, 0.3124585747718811, -0.18102702498435974, 0.36096078157424927, 0.0582050196826458, -0.09425486624240875, 0.0945126935839653, -0.14570210874080658, 0.1116316169500351, 0.09553880989551544, -0.38426461815834045, -0.17021626234054565, 0.10309235006570816, 0.016098719090223312, 0.40975046157836914, 0.1238878071308136, -0.0354953333735466, -0.04440724849700928, -0.12366501986980438, 0.03100307658314705, 0.4373090863227844, 0.0915280431509018, 0.3856504261493683, -0.0563327930867672, 0.37706172466278076, 0.10023122280836105, -0.15394124388694763, 0.08277438580989838, -0.09266949445009232, -0.1620345264673233, -0.4499310255050659, 0.05984204635024071, 0.46205663681030273, 0.06736312806606293, -0.11573341488838196, -0.051950231194496155, -0.1281438171863556, -0.42697030305862427, 0.11726033687591553, 0.30657944083213806, 0.08318861573934555, 0.7180423736572266, -0.23172499239444733, 0.12479883432388306, 0.0857584998011589, -0.19263707101345062, -0.039987146854400635, -0.21273434162139893, -0.4407871961593628, -0.0654415637254715, 0.27836936712265015, -0.029897883534431458, 0.11526630818843842, 0.17608918249607086, 0.019524507224559784, -0.30248335003852844, 0.3420533835887909, -0.002825645264238119, -0.021623022854328156, 0.10221325606107712, -0.07542102038860321, 0.17909088730812073, 0.17041032016277313, -0.26375696063041687, -0.35458895564079285, 0.2716412842273712, -0.6915873289108276, -0.3307424783706665, 0.03400783613324165, 0.13162533938884735, -0.13354887068271637, 0.48917636275291443, -0.10782816261053085, 0.18865162134170532, 0.1335793435573578, -0.05989835783839226, -0.003085881471633911, -0.1096145510673523, 0.19389548897743225, -0.32938650250434875, 0.12776285409927368, 0.22366344928741455, -0.41194891929626465, 0.09597703814506531, -0.3117310404777527, -0.22926893830299377, 0.010142236948013306, 0.3284602463245392, -0.31654542684555054, 0.12137485295534134, -0.4301155209541321, 0.46938204765319824, 0.26690012216567993, -0.3092690408229828, -0.39122533798217773, 0.4877557158470154, 0.03676997870206833, 0.05019323527812958, 0.34084415435791016, -0.06378845125436783, 0.19578376412391663, -0.07293301075696945, 0.25290170311927795, 0.27602922916412354, -0.0891668051481247, 0.07959754019975662, -0.08618956804275513, -0.32317543029785156, 0.059139057993888855, 0.06069605425000191, -0.24858354032039642, 0.04781625047326088, 0.0718526765704155, -0.0717722475528717, 0.4694214463233948, -0.0062853507697582245, 0.0036109338980168104, -0.1257491558790207, 0.0644969791173935, -0.01311405748128891, 0.23280347883701324, 0.1169755682349205, -0.4437186121940613, 0.11970808357000351, -0.0020402688533067703, -0.4397471845149994, -0.3041677474975586, -0.3698078393936157, -0.3315551280975342, -0.09354502707719803, -0.3471478819847107, 0.42956724762916565, 0.07548400014638901, 0.1173449158668518, -0.2267548143863678, -0.08756877481937408, -0.34548792243003845, 0.39264562726020813, -0.31707268953323364, -0.0018359225941821933, -0.523558497428894, 0.4450726807117462, 0.23229160904884338, 0.10517281293869019, -0.31463441252708435, -0.08712003380060196, 0.0367162711918354, -0.1903735101222992, 0.16031968593597412, 0.44647109508514404, 0.39516860246658325, 0.14840887486934662, 0.10156367719173431, 0.1335923969745636, 0.1295887678861618, -0.26087498664855957, 0.10936172306537628, 0.17228665947914124, -0.014012472704052925, -0.08157165348529816, -0.42328357696533203, 0.4477927088737488, -0.5527259111404419, 0.33656519651412964, -0.10637719184160233, -0.26231649518013, 0.37596726417541504, -0.17322996258735657, -0.49075260758399963, -0.3021469712257385, -0.07660456001758575, 0.26476994156837463, 0.400458961725235, 0.07589613646268845, -0.18436110019683838, -0.1648479402065277, 0.5294557809829712, -0.1916438639163971, 0.01648009568452835, 0.2196841537952423, 0.0794808492064476, -0.0882285088300705, 0.010117640718817711, 0.5111572742462158, 0.677302896976471, 0.13026395440101624, -0.07459211349487305, 0.04252021759748459, 0.26953282952308655, -0.22762168943881989, 0.07090051472187042, -0.11630943417549133, -0.17087821662425995, 0.5061201453208923, 0.009311491623520851, -0.1584080010652542, -0.25464028120040894, -0.1289423704147339, 0.1608850359916687, -0.12056310474872589, -0.2696039378643036, -0.04088801145553589, -0.1837712675333023, 0.044823117554187775, -0.1489158421754837, -0.033150143921375275, -0.18179486691951752, -0.13447222113609314, 0.018648333847522736, -0.21703386306762695, -0.3004828989505768, 0.03728979825973511, 0.05557307228446007, 0.45273107290267944, 0.010159416124224663, -0.4609625041484833, -0.06667947769165039, -0.16801737248897552, 0.1394440233707428, 0.015168502926826477, -0.0012350678443908691, 0.023681681603193283, 0.2326028198003769, -0.36727598309516907, -0.1663760393857956, 0.019158540293574333, -0.4854014217853546, 0.2369818389415741, 0.007000420242547989, 0.16708721220493317, 0.39722639322280884, 0.22649189829826355, 0.4059487581253052, -0.5073139667510986, 0.0826786532998085, 0.15793149173259735, -0.06123223155736923, -0.09705757349729538, 0.31839248538017273, 0.380666583776474, -0.25374165177345276, -0.4357580840587616, -0.22117561101913452, -0.44913965463638306, 0.5271550416946411, -0.04994410648941994, 0.005986597388982773, -0.30488160252571106, -0.28394562005996704, -0.10556840151548386, -0.16233469545841217, -0.1549110859632492, -0.2264876514673233, -0.16208778321743011, 0.14532038569450378, 0.01890013925731182, 0.12652453780174255, -0.015334710478782654, -0.30127954483032227, 0.17624513804912567, -0.02205459214746952, -0.18480250239372253, -0.1673271358013153, -0.019525831565260887, 0.2870692014694214, -0.04918515682220459, -0.038761287927627563, 0.12955342233181, 0.22561965882778168, 0.015945522114634514, -0.13668516278266907, 0.1209058165550232, 0.053790051490068436, 0.0361715666949749, 0.10139359533786774, 0.5023611187934875, 0.255330353975296, -0.014604736119508743, 0.7181845903396606, 0.2735147774219513, 0.06777893751859665, 0.0763777568936348, 0.13267287611961365, 0.07949770241975784, -0.0032312795519828796, -0.0855955109000206, 0.022018205374479294, 0.008788764476776123, -0.12468558549880981, 0.3496933579444885, 0.17482778429985046, -0.1661127209663391, -0.12741976976394653, 0.17786826193332672, -0.34804946184158325, -0.3591395318508148, 0.12791737914085388, -0.2824628949165344, 0.10609889030456543, -0.1360621154308319, -0.22060608863830566, 0.20202374458312988, -0.015670858323574066, -0.12062890827655792, 0.4974486231803894, 0.04747689515352249, -0.20218367874622345, -0.3181726634502411, -0.15327687561511993, -0.05311957746744156, 0.23602616786956787, 0.11013109982013702, 0.06073452904820442, 0.09936638176441193, -0.16948029398918152, 0.054172053933143616, 0.020574349910020828, 0.9643561244010925, 0.15716971457004547, 0.02601129189133644, -0.03611285239458084, 0.20829181373119354, 0.11401542276144028, -0.12838654220104218, -0.056567974388599396, 0.18951667845249176, -0.05686377361416817, 0.44135454297065735, -0.47809144854545593, -0.1680968850851059, -0.11370387673377991, 0.12820592522621155, -0.05897113308310509, -0.2093212902545929, -0.1453801691532135, -0.051164403557777405, -0.15222066640853882, 0.022360026836395264, 0.1410265415906906, -0.2559520900249481, -0.3986920714378357, -0.15952765941619873, -0.11647970974445343, -0.27224114537239075, 0.08672577142715454, 0.135435551404953, 0.37755391001701355, -0.1100306510925293, 0.09144912660121918, 0.2685760259628296, 0.3362179696559906, 0.026921402662992477, 0.34983187913894653, -0.1561347395181656, -0.3365444242954254, 0.19135168194770813, -0.18772555887699127, 0.23735615611076355, 0.34440481662750244, -0.2934020161628723, -0.07307831197977066, 0.0014326609671115875, 0.17245197296142578, -0.39215603470802307, 0.3477824926376343, 0.41070905327796936, -0.22361893951892853, -0.5386248230934143, -0.5756872892379761, 0.5857539772987366, 0.13001368939876556, -0.3407086730003357, 0.33516398072242737, 0.14211775362491608, -0.3038368225097656, 0.28156042098999023, -0.27950504422187805, 1.0091357231140137, -0.023433908820152283, 0.09997653216123581, -0.04738342761993408, -0.06428933143615723, 0.6039754152297974, -0.5008090734481812, 0.13080769777297974, -0.3162202835083008, 0.05771271884441376, -0.05489704757928848, -0.16288061439990997, 0.25980985164642334, 0.6810418367385864, -0.3250270187854767, 0.145650252699852, -0.21274419128894806, 0.008727014064788818, -0.08914148807525635, 0.374441534280777, -0.023742789402604103, 0.06848448514938354, -0.38032373785972595, -0.008083602413535118, -0.3366808295249939, -0.09920533001422882, -0.06962545216083527, -0.036918338388204575, 0.23667415976524353, -0.2520407438278198, 0.13235001266002655, -0.09223412722349167, 0.32560524344444275, -0.056600287556648254, 0.055278509855270386, -0.2505068778991699, 0.2433927357196808, 0.10747800767421722, -0.15597102046012878, 0.27842873334884644, -0.14346180856227875, 0.23948027193546295, 0.04581213742494583, 0.22587579488754272, 0.07886727899312973, -0.04671342670917511, 0.15523968636989594, 0.32405462861061096, -0.1333787441253662, -0.2240711748600006, -0.17405615746974945, -0.11992696672677994, -0.3732627034187317, 0.41579025983810425, 0.23767058551311493, -0.5886802077293396, -0.1996457278728485, 0.022200584411621094, 0.0013541169464588165, 0.06349341571331024, 0.09061048924922943, 0.04175669699907303, -0.180507630109787, 0.31176331639289856, -0.16591930389404297, -0.24596159160137177, 0.049937039613723755, 0.11560976505279541, 0.31979814171791077, -0.23650705814361572, 0.06662245094776154, -0.2165909707546234, -0.11462815850973129, -0.12366606295108795, 0.27338793873786926, 0.17012499272823334, -0.2765028178691864, 0.23181678354740143, -0.009886328130960464, -0.09109791368246078, 0.219582200050354, -0.10600340366363525, 0.18847733736038208, 0.06283603608608246, 0.009323861449956894, -0.2751418650150299, -0.07007982581853867, 0.4887527823448181, -0.014534089714288712, 0.2858186662197113, 0.34501105546951294, -0.0058429669588804245, -0.24753427505493164, -0.11203774809837341, -0.20819728076457977, 0.20970100164413452, -0.06290251761674881, 0.21963265538215637, 0.09800760447978973, 0.13346609473228455, -0.06188923120498657, 0.08461667597293854, 0.1669911891222, -0.023609057068824768, -0.06908663362264633, -0.19636675715446472, -0.1121722012758255, 0.22218197584152222, 0.014548959210515022, 0.1711810976266861, 0.1342008262872696, -0.4678768515586853, -0.08698302507400513, -0.16449016332626343, 0.3166227340698242, -0.0944056361913681, 0.09549199044704437, 0.006127131171524525, 0.2846202254295349, -0.10881530493497849, -0.24252206087112427, 0.2945615351200104, -0.036583833396434784, 0.2692628502845764, 0.18783552944660187, 0.308403342962265, -0.36908137798309326, 0.13590498268604279, -0.3501490354537964, 0.09114682674407959, 0.2797408103942871, 0.273808091878891, 0.11794450879096985, -0.132466658949852, -0.021654969081282616, -0.32171204686164856, 0.6874305009841919, 0.5198124051094055, -0.42841464281082153, -0.07016472518444061, 0.1843203902244568, 0.14609724283218384, -0.16744472086429596, -0.1303461790084839, 0.2792673707008362, 0.22672688961029053, 0.14581198990345, 0.12189126014709473, 0.22149282693862915, 0.2751305103302002, -0.0213872492313385, -0.08584492653608322, 0.6800705194473267, 0.03835425153374672, 0.47943559288978577, 0.7950754165649414, -0.11204535514116287, 0.023085258901119232, 0.29869523644447327, -0.16273976862430573, 0.1509484499692917, 0.5919937491416931, -0.007775202393531799, 0.2872377634048462, 0.09409742057323456, 0.28030577301979065, 0.13752791285514832, -0.1612989902496338, 0.14364592730998993, 0.12249251455068588, -0.42673271894454956, 0.1079498678445816, 0.06377512216567993, 0.395251601934433, -0.2858513593673706, -0.041602954268455505, 0.0027760136872529984, -0.009899593889713287, -0.008008129894733429, -0.26083144545555115, -0.01269986480474472, -0.3922567367553711, -0.21637749671936035, -0.16404658555984497, -0.21017667651176453, 0.13154727220535278, 0.2779446244239807, 0.27930948138237, 0.21220123767852783, -0.3695017397403717, 0.35790228843688965, -0.050891757011413574, 0.3659485876560211, -0.23713694512844086, 0.28767505288124084, 0.17468151450157166, -0.02540302276611328, 0.3640136122703552, -0.1406894475221634, 0.10568183660507202, 0.3371892273426056, 0.009218377992510796, -0.3600667119026184, -0.18268835544586182, -0.00372307188808918, -0.2645570635795593, 0.13560152053833008, 0.1910119652748108, -0.02244274690747261, 0.1040901392698288, 0.18910428881645203, -0.10269954055547714, 0.008393611758947372, 0.11764974147081375, -0.11949442327022552, -0.5660679340362549, 0.3744082450866699, -0.010950155556201935, -0.03824404999613762, 0.07826988399028778, -0.09348339587450027, -0.7509059906005859, -0.2504294216632843, 0.2566380202770233, 0.17838914692401886, 0.08469662815332413, 0.008860092610120773, 0.05733868479728699, -0.13954542577266693, 0.16899755597114563, -0.2574000656604767, 0.12812474370002747, -0.023354776203632355, -0.28536373376846313, -0.4736919105052948, 0.07245214283466339, 0.13426481187343597, -0.09417854994535446, 0.11825501173734665, 0.09602060168981552, 0.11634033918380737, 0.1866634637117386, -0.27676457166671753, -0.14506742358207703, -0.06257566064596176, -0.07347509264945984, -0.12318609654903412, -0.13326406478881836, -0.14284484088420868, 0.109970323741436, -0.02697487361729145, -0.3344844877719879, -0.0692252367734909, 0.45474639534950256, -0.21196496486663818, -0.09819798916578293, -0.09536635130643845, 0.43744513392448425, 0.06414362043142319, 0.08966235816478729, 0.3730219006538391, 0.3601672649383545, -0.06610048562288284, 0.01962418295443058, -0.1400778591632843, -0.23888233304023743, -0.15354523062705994, 0.20921656489372253, 0.019116463139653206, 0.14490947127342224, -0.24007868766784668, 0.08491358906030655, -0.3337804675102234, -0.18419501185417175, -0.004864934831857681, 0.0035100143868476152, -0.4720480442047119, -0.23309536278247833, -0.21545463800430298, 0.0004308961215429008, -0.16171221435070038, 0.46210119128227234, -0.07029230892658234, 0.018698254600167274, 0.05914407968521118, 0.03396028280258179, 0.22123301029205322, -0.16910706460475922, -0.35716375708580017, 0.0788937658071518, 0.2526713013648987, -0.3451993465423584, 0.1559637188911438, -0.09394726902246475, -0.012575171887874603, 0.5273631811141968, -0.13264846801757812, -0.07656917721033096, -0.0026066284626722336, 0.008185169659554958, -0.27007895708084106, -0.16027218103408813, -0.18309438228607178, 0.4533025622367859, -0.2098136693239212, 0.10909213125705719, -0.19921916723251343 ]
https://github.com/huggingface/datasets/issues/3027
Resolve data_files by split name
From my discussion with @borisdayma it would be more general the files match if their paths contains the split name - not only if the filename contains the split name. For example for a dataset like this: ``` train/ └── data.csv test/ └── data.csv ``` But IMO the default should be ``` data/ ├── train.csv └── test.csv ``` because it allows people to have other directories if they have different subsets of their data (different configurations, not splits)
This issue is about discussing the default behavior when someone loads a dataset that consists in data files. For example: ```python load_dataset("lhoestq/demo1") ``` should return two splits "train" and "test" since the dataset repostiory is like ``` data/ ├── train.csv └── test.csv ``` Currently it returns only one split "train" which contains the data of both files I started playing with this idea on this branch btw: `resolve-data_files-by-split-name` Basically the idea is that if you named you data files after split names then the default pattern is ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` otherwise it's ```python { "train": ["*"] } ``` Let me know what you think ! cc @albertvillanova @LysandreJik @vblagoje
78
Resolve data_files by split name This issue is about discussing the default behavior when someone loads a dataset that consists in data files. For example: ```python load_dataset("lhoestq/demo1") ``` should return two splits "train" and "test" since the dataset repostiory is like ``` data/ ├── train.csv └── test.csv ``` Currently it returns only one split "train" which contains the data of both files I started playing with this idea on this branch btw: `resolve-data_files-by-split-name` Basically the idea is that if you named you data files after split names then the default pattern is ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` otherwise it's ```python { "train": ["*"] } ``` Let me know what you think ! cc @albertvillanova @LysandreJik @vblagoje From my discussion with @borisdayma it would be more general the files match if their paths contains the split name - not only if the filename contains the split name. For example for a dataset like this: ``` train/ └── data.csv test/ └── data.csv ``` But IMO the default should be ``` data/ ├── train.csv └── test.csv ``` because it allows people to have other directories if they have different subsets of their data (different configurations, not splits)
[ 0.027063872665166855, -0.08924920111894608, -0.10976296663284302, 0.13513866066932678, 0.05384983867406845, -0.15210586786270142, 0.3358279764652252, 0.5063108205795288, 0.16210544109344482, -0.01668207347393036, 0.22284626960754395, 0.13512156903743744, -0.11368829756975174, 0.2894289493560791, -0.19985663890838623, -0.22720101475715637, -0.05636908859014511, 0.08846400678157806, 0.08388865739107132, 0.045775726437568665, -0.31674671173095703, 0.09986869245767593, -0.11704124510288239, 0.11797685921192169, -0.39236530661582947, 0.2584533095359802, 0.01155952550470829, 0.38570037484169006, -0.03776417672634125, -0.35342109203338623, 0.2145465612411499, 0.1814076453447342, 0.1407526135444641, 0.1639416366815567, -0.00011854020704049617, -0.07210962474346161, 0.43639254570007324, -0.15223415195941925, 0.2201811820268631, -0.3678044080734253, -0.45102232694625854, -0.2540361285209656, 0.30847835540771484, -0.4188291132450104, -0.06762509793043137, -0.13939577341079712, 0.08062810450792313, -0.2843281924724579, 0.3402706980705261, -0.05524231120944023, 0.09520667791366577, -0.22532634437084198, -0.0863787978887558, 0.1467776745557785, 0.17629604041576385, 0.3417208194732666, 0.11261103302240372, 0.28385671973228455, 0.05242905393242836, -0.2838113307952881, 0.10410639643669128, -0.10282224416732788, -0.05846620351076126, 0.1761574000120163, 0.12458110600709915, 0.11750998347997665, -0.15459012985229492, -0.35096225142478943, -0.1656114161014557, 0.380214661359787, 0.2660922408103943, -0.047812752425670624, -0.1946505606174469, -0.5157235264778137, -0.1008806973695755, -0.08950433135032654, 0.31681951880455017, 0.26148197054862976, -0.051609814167022705, 0.1412384957075119, 0.12363837659358978, -0.0023077873047441244, 0.023771964013576508, 0.07972657680511475, -0.41120144724845886, 0.24402067065238953, -0.12610618770122528, 0.24950963258743286, 0.12410025298595428, 0.0006030313670635223, 0.08523959666490555, -0.3216853141784668, 0.18441660702228546, 0.16786529123783112, -0.37332168221473694, -0.10847105085849762, -0.0317976251244545, 0.17470641434192657, 0.27930763363838196, 0.03833669796586037, -0.022567488253116608, -0.056816019117832184, -0.10617831349372864, 0.0022386908531188965, 0.3379703462123871, 0.2131718546152115, 0.2825787663459778, -0.03702773526310921, 0.2807852625846863, 0.03679792582988739, -0.26369211077690125, 0.13095757365226746, -0.0679045021533966, -0.34932783246040344, -0.3827223777770996, 0.11933895200490952, 0.4428096413612366, 0.017413463443517685, -0.16576027870178223, -0.04232204332947731, -0.12416715174913406, -0.49899351596832275, 0.1497686505317688, 0.21211972832679749, 0.048475008457899094, 0.5931285619735718, -0.322695791721344, 0.09461510926485062, 0.07537709921598434, -0.11292207986116409, -0.02093418873846531, -0.32090866565704346, -0.4212557077407837, -0.04912804812192917, 0.17557936906814575, -0.00499751977622509, 0.1248716488480568, 0.13425692915916443, 0.05888344720005989, -0.19496165215969086, 0.31180065870285034, -0.11396665871143341, 0.06841635704040527, 0.16438886523246765, -0.11776103079319, 0.18981792032718658, 0.08669663220643997, -0.20049476623535156, -0.3348342478275299, 0.32983118295669556, -0.784676194190979, -0.4369291067123413, 0.16338182985782623, 0.12319093942642212, -0.1893172711133957, 0.4690489172935486, -0.005163908004760742, 0.03483422473073006, 0.09762773662805557, -0.10307160019874573, -0.06310687214136124, -0.36953192949295044, 0.17015469074249268, -0.3755718767642975, 0.25214695930480957, 0.14124658703804016, -0.34512263536453247, 0.16523167490959167, -0.3239671587944031, -0.26786524057388306, -0.0005795210599899292, 0.40285974740982056, -0.30525457859039307, 0.13106581568717957, -0.43762707710266113, 0.46046435832977295, 0.3293555974960327, -0.18569587171077728, -0.3755878508090973, 0.3393336236476898, 0.033866822719573975, 0.13996301591396332, 0.2919975817203522, 0.03676726669073105, 0.1881825029850006, -0.07225814461708069, 0.1695462465286255, 0.26103681325912476, -0.08013198524713516, 0.04557391256093979, -0.09777770936489105, -0.25546881556510925, -0.02596200257539749, -0.02198784053325653, -0.21036027371883392, -0.011520452797412872, 0.0805356353521347, -0.16000588238239288, 0.5113763809204102, 0.006515521556138992, -0.1614559143781662, -0.0932048112154007, 0.13505953550338745, 0.13347846269607544, 0.24915453791618347, 0.18072527647018433, -0.4748728275299072, 0.20740357041358948, -0.12245310097932816, -0.5045093894004822, -0.2311447411775589, -0.3620300889015198, -0.1528390347957611, -0.16789226233959198, -0.3231683075428009, 0.40381574630737305, 0.06231462210416794, 0.13335499167442322, -0.2513744533061981, -0.11299216747283936, -0.39456260204315186, 0.2968933582305908, -0.3069309592247009, 0.012259183451533318, -0.42658331990242004, 0.4831370711326599, 0.14469090104103088, 0.20094507932662964, -0.3460204005241394, 0.043363992124795914, 0.041418589651584625, -0.1183132752776146, 0.21009701490402222, 0.4449145793914795, 0.47871673107147217, 0.1327356994152069, 0.13885128498077393, 0.2663666307926178, 0.08230914920568466, -0.23280709981918335, 0.06621608883142471, 0.07878637313842773, -0.02388342097401619, -0.05508483201265335, -0.24581724405288696, 0.32105159759521484, -0.5423386096954346, 0.3390040695667267, 0.006330650299787521, -0.3598770499229431, 0.24386155605316162, -0.20791862905025482, -0.36722350120544434, -0.26973599195480347, 0.05508163571357727, 0.21478712558746338, 0.44449812173843384, 0.3003086745738983, -0.20104563236236572, -0.1982327699661255, 0.46534839272499084, -0.22038157284259796, 0.0030786357820034027, 0.17860400676727295, 0.03843003511428833, -0.07265081256628036, -0.07884531468153, 0.49240413308143616, 0.6452200412750244, 0.18511170148849487, 0.06229636073112488, -0.004056854173541069, 0.09170877188444138, -0.2873217463493347, 0.16231922805309296, -0.012694761157035828, -0.2111666053533554, 0.4826071262359619, -0.19995948672294617, -0.00644452590495348, -0.24087762832641602, -0.11916136741638184, 0.01336786150932312, -0.1565803736448288, -0.3247489929199219, -0.173537477850914, -0.1142810508608818, 0.018656238913536072, -0.29347676038742065, -0.04605146870017052, -0.3018512427806854, -0.09840879589319229, 0.05899063125252724, -0.260900616645813, -0.2200455218553543, 0.04815682768821716, 0.05377251282334328, 0.4499249756336212, -0.10415111482143402, -0.48239052295684814, 0.010930858552455902, -0.1258496344089508, 0.0902598425745964, 0.0256824791431427, 0.011639728210866451, 0.023302458226680756, 0.17683839797973633, -0.4497425854206085, -0.12019899487495422, -0.030991559848189354, -0.5094626545906067, 0.06068848818540573, 0.08794353157281876, 0.1646248996257782, 0.37042105197906494, 0.20709441602230072, 0.5094425678253174, -0.49924173951148987, 0.051342904567718506, 0.3034723997116089, -0.0733082965016365, -0.1588931381702423, 0.3971947133541107, 0.17933259904384613, -0.13913345336914062, -0.31260374188423157, -0.26049718260765076, -0.4406670033931732, 0.40374380350112915, -0.02759723737835884, 0.03681338578462601, -0.268892377614975, -0.24154327809810638, -0.15697091817855835, -0.42510777711868286, -0.052357569336891174, -0.1164754331111908, -0.03215982764959335, 0.15376342833042145, 0.16658753156661987, 0.05994971841573715, -0.027472276240587234, -0.25579148530960083, 0.07765427231788635, 0.12245184183120728, -0.12527550756931305, -0.20228679478168488, -0.14855621755123138, 0.22699975967407227, 0.0817575603723526, 0.09488154202699661, 0.09271278232336044, 0.20698027312755585, 0.048703983426094055, -0.09226804226636887, 0.11755923926830292, 0.09066709131002426, 0.09261125326156616, 0.11743434518575668, 0.5096936225891113, 0.09759815782308578, -0.09318245947360992, 0.719566285610199, 0.27496102452278137, 0.02526283450424671, 0.07631479203701019, 0.13444802165031433, 0.16962091624736786, -0.012127228081226349, -0.13340459764003754, 0.007903355173766613, -0.009010061621665955, -0.2168181836605072, 0.4865507483482361, 0.11873490363359451, -0.011764021590352058, -0.16061490774154663, 0.14082998037338257, -0.3070542812347412, -0.33874407410621643, 0.19252318143844604, -0.21536672115325928, 0.2105850875377655, -0.17503274977207184, -0.3312683701515198, 0.2745007872581482, -0.05839390307664871, -0.15756100416183472, 0.6674461364746094, 0.08012326806783676, -0.12614889442920685, -0.2087228149175644, -0.20277221500873566, 0.11694246530532837, 0.23616954684257507, 0.24692201614379883, 0.1048269048333168, 0.03991710767149925, -0.29194480180740356, 0.018513984978199005, 0.14816103875637054, 1.015001654624939, 0.14395320415496826, -0.055671751499176025, -0.16290055215358734, 0.1275365799665451, 0.2201908677816391, -0.12642493844032288, -0.07741620391607285, 0.09829011559486389, -0.10261398553848267, 0.4668508768081665, -0.3454955518245697, -0.14534705877304077, -0.15771380066871643, 0.3126106560230255, -0.019589006900787354, -0.20655326545238495, -0.1962544471025467, 0.1626075804233551, -0.05229979008436203, -0.07318098098039627, 0.08294478058815002, -0.37393897771835327, -0.34863489866256714, -0.19881373643875122, -0.16965781152248383, -0.3105761706829071, 0.1925288736820221, 0.12322933971881866, 0.4097321629524231, -0.1911715418100357, 0.11198882758617401, 0.32391002774238586, 0.3557857573032379, 0.014531104825437069, 0.3123929798603058, -0.4825657308101654, -0.25235608220100403, 0.08037720620632172, -0.16929154098033905, 0.2833825945854187, 0.3894641399383545, -0.239561527967453, -0.1740935742855072, -0.027105819433927536, 0.15430426597595215, -0.3597346246242523, 0.28459295630455017, 0.5503156781196594, -0.040508490055799484, -0.6324173808097839, -0.6308743953704834, 0.546730101108551, 0.07518921792507172, -0.3690571188926697, 0.28751808404922485, 0.2575165033340454, -0.3384929597377777, 0.18605954945087433, -0.3243257403373718, 1.0977976322174072, 0.041214000433683395, 0.2035473883152008, -0.10231373459100723, -0.012176819145679474, 0.39971864223480225, -0.2346331626176834, 0.05626136437058449, -0.2826586067676544, -0.114395871758461, -0.11127506196498871, -0.2262130081653595, 0.3153937757015228, 0.6895779967308044, -0.2106652855873108, 0.21510115265846252, -0.03478599712252617, -0.08013220131397247, -0.01890094019472599, 0.2752845585346222, 0.05136319249868393, 0.23116452991962433, -0.284053236246109, -0.04596368968486786, -0.17762497067451477, 0.015380291268229485, -0.0002354094758629799, 0.0009071473032236099, 0.19836163520812988, -0.2670038640499115, 0.2530161142349243, -0.1855873465538025, 0.07362338900566101, -0.08109492808580399, -0.16133132576942444, -0.319338321685791, 0.02260996401309967, 0.19991013407707214, -0.18146772682666779, 0.1393308937549591, -0.029113197699189186, 0.22571228444576263, 0.17239484190940857, 0.19571958482265472, 0.09822577983140945, -0.10103792697191238, 0.05803599953651428, 0.3187808394432068, -0.004105396568775177, -0.2137281596660614, -0.18557432293891907, -0.020028002560138702, -0.44989967346191406, 0.40715891122817993, 0.1464778035879135, -0.48795396089553833, -0.4339681565761566, -0.017574645578861237, -0.014261392876505852, 0.15857632458209991, 0.07999549061059952, 0.04231749475002289, -0.11306943744421005, 0.42949968576431274, -0.15912653505802155, -0.3519008457660675, 0.005359737202525139, 0.05016421899199486, 0.21580585837364197, -0.07329447567462921, 0.012779492884874344, -0.33391252160072327, -0.16827471554279327, -0.05481794476509094, 0.2807158827781677, -0.00701527576893568, -0.3519238829612732, 0.19928810000419617, 0.02931809239089489, -0.04813191294670105, 0.15770676732063293, -0.11565762758255005, 0.3893250823020935, -0.08240193873643875, -0.051424216479063034, -0.23533038794994354, 0.09084697812795639, 0.5664874315261841, 0.032555706799030304, 0.43022122979164124, 0.27134913206100464, -0.0832088440656662, -0.16269412636756897, -0.14968276023864746, -0.20468769967556, 0.24031060934066772, 0.11288738995790482, 0.20789697766304016, 0.11733626574277878, 0.1699088215827942, -0.029080966487526894, -0.033749405294656754, 0.15570160746574402, -0.24972115457057953, -0.058408595621585846, -0.17332658171653748, -0.04006713256239891, 0.19688819348812103, -0.0016829781234264374, 0.16135959327220917, 0.13404548168182373, -0.5623926520347595, 0.010631341487169266, -0.19487501680850983, 0.19630809128284454, 0.007382255047559738, 0.09600463509559631, -0.015417980030179024, 0.3122358024120331, -0.25551101565361023, -0.38112229108810425, 0.4588366448879242, -0.16886723041534424, 0.1482895165681839, 0.2380097657442093, 0.29721248149871826, -0.5308622121810913, 0.1368330717086792, -0.22154021263122559, -0.011722423136234283, 0.1427353024482727, 0.18485257029533386, 0.0562283918261528, 0.0728476494550705, 0.02528228983283043, -0.31182506680488586, 0.7487245798110962, 0.4285578727722168, -0.3455674946308136, -0.09862890839576721, 0.24288269877433777, 0.13953161239624023, -0.25475481152534485, -0.11251457035541534, 0.1653764247894287, 0.15140976011753082, 0.1507904976606369, 0.20105376839637756, 0.2006370723247528, 0.32822632789611816, -0.08307425677776337, -0.09525515139102936, 0.6378190517425537, 0.16524964570999146, 0.47148895263671875, 0.8784751296043396, 0.11793974041938782, 0.09559684991836548, 0.18628115952014923, -0.04818183556199074, 0.15150593221187592, 0.5667091608047485, -0.13616406917572021, 0.3498615026473999, 0.10694025456905365, 0.15921026468276978, 0.2751747667789459, -0.2490902841091156, 0.07576632499694824, 0.11001341044902802, -0.398651123046875, 0.0006063133478164673, 0.05365699157118797, 0.34974050521850586, -0.29913845658302307, -0.08339893072843552, 0.01656690053641796, -0.06640288233757019, 0.022570619359612465, -0.21068790555000305, 0.1594795286655426, -0.3991621732711792, -0.21608871221542358, -0.23318733274936676, -0.26044943928718567, 0.09492196887731552, 0.33225494623184204, 0.28723829984664917, 0.3322550058364868, -0.21489153802394867, 0.29973697662353516, 0.005625233054161072, 0.2486666440963745, -0.14277875423431396, 0.2889852821826935, 0.09550193697214127, -0.011978968977928162, 0.4035440683364868, -0.09308992326259613, 0.17262764275074005, 0.3683162331581116, 0.06613701581954956, -0.36726295948028564, -0.10097096860408783, 0.014386432245373726, -0.24986284971237183, 0.08463731408119202, 0.07544185221195221, 0.0150825884193182, 0.12236091494560242, 0.23091375827789307, -0.06393790245056152, 0.093491330742836, 0.033986613154411316, -0.16359631717205048, -0.5364468693733215, 0.495059072971344, 0.060106001794338226, 0.0003157183527946472, 0.13981465995311737, -0.03965982049703598, -0.7992085218429565, -0.19816118478775024, 0.2695060074329376, 0.11466795951128006, 0.03458588942885399, 0.17201463878154755, 0.052657485008239746, -0.024784043431282043, 0.09666448831558228, -0.09742967784404755, 0.2692852318286896, -0.09940806031227112, -0.1278330534696579, -0.686098575592041, 0.0676155835390091, 0.1661301702260971, -0.10112383961677551, 0.12702026963233948, -0.012033704668283463, 0.03532585874199867, 0.1610565483570099, -0.04196280241012573, -0.07096332311630249, -0.053786762058734894, -0.04110000282526016, -0.0005478300154209137, -0.15509197115898132, -0.2604176998138428, 0.07313506305217743, -0.07807601988315582, -0.3723444938659668, 0.036156296730041504, 0.456595778465271, -0.1876714527606964, -0.018180251121520996, -0.03743472322821617, 0.5529680252075195, 0.12165513634681702, -0.02041778713464737, 0.24146664142608643, 0.49282318353652954, -0.08186306804418564, 0.1661689281463623, -0.04862469062209129, -0.24875612556934357, -0.11806057393550873, 0.1815362423658371, -0.049454476684331894, -0.011710653081536293, -0.24863630533218384, 0.007588330656290054, -0.2733668088912964, -0.09263470023870468, 0.026020750403404236, 0.02514357678592205, -0.45725634694099426, -0.2705690562725067, -0.11319506168365479, -0.04465338587760925, -0.00020960532128810883, 0.5400716066360474, -0.11244040727615356, -0.01591736264526844, 0.0865083634853363, 0.009441280737519264, 0.26375919580459595, -0.04514964297413826, -0.11353632807731628, -0.010625025257468224, 0.2802310883998871, -0.17110973596572876, 0.2984359562397003, -0.16515624523162842, -0.13190409541130066, 0.6074886322021484, -0.13135525584220886, -0.04189872741699219, -0.007243994623422623, 0.02259291335940361, -0.23619335889816284, -0.18531030416488647, -0.18621906638145447, 0.33742666244506836, -0.28807181119918823, 0.126292884349823, -0.14048466086387634 ]
https://github.com/huggingface/datasets/issues/3027
Resolve data_files by split name
I just created a PR for this at https://github.com/huggingface/datasets/pull/3221, let me know what you think :)
This issue is about discussing the default behavior when someone loads a dataset that consists in data files. For example: ```python load_dataset("lhoestq/demo1") ``` should return two splits "train" and "test" since the dataset repostiory is like ``` data/ ├── train.csv └── test.csv ``` Currently it returns only one split "train" which contains the data of both files I started playing with this idea on this branch btw: `resolve-data_files-by-split-name` Basically the idea is that if you named you data files after split names then the default pattern is ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` otherwise it's ```python { "train": ["*"] } ``` Let me know what you think ! cc @albertvillanova @LysandreJik @vblagoje
16
Resolve data_files by split name This issue is about discussing the default behavior when someone loads a dataset that consists in data files. For example: ```python load_dataset("lhoestq/demo1") ``` should return two splits "train" and "test" since the dataset repostiory is like ``` data/ ├── train.csv └── test.csv ``` Currently it returns only one split "train" which contains the data of both files I started playing with this idea on this branch btw: `resolve-data_files-by-split-name` Basically the idea is that if you named you data files after split names then the default pattern is ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` otherwise it's ```python { "train": ["*"] } ``` Let me know what you think ! cc @albertvillanova @LysandreJik @vblagoje I just created a PR for this at https://github.com/huggingface/datasets/pull/3221, let me know what you think :)
[ 0.06496599316596985, -0.17201891541481018, -0.0812089741230011, 0.16020703315734863, 0.21432627737522125, -0.042224250733852386, 0.36304986476898193, 0.49190202355384827, 0.15666258335113525, 0.06425923109054565, 0.14751900732517242, 0.14048245549201965, -0.1865476816892624, 0.35948264598846436, -0.09180235117673874, -0.32151907682418823, -0.023905746638774872, 0.06279407441616058, 0.17888426780700684, 0.14500366151332855, -0.22765617072582245, 0.10441670566797256, -0.10961392521858215, 0.1137428730726242, -0.37656477093696594, 0.11979351192712784, 0.03243560343980789, 0.2874339818954468, -0.103987917304039, -0.4631798267364502, 0.2672523558139801, 0.2680550515651703, 0.13159990310668945, 0.14341504871845245, -0.00011554780940059572, -0.04531995207071304, 0.40949946641921997, -0.09892607480287552, 0.21886107325553894, -0.22036610543727875, -0.2925214469432831, -0.21038880944252014, 0.3251117467880249, -0.38985756039619446, -0.2154361605644226, -0.2910706400871277, -0.0040323492139577866, -0.22054091095924377, 0.41398346424102783, -0.03395693376660347, 0.12878882884979248, -0.13263490796089172, -0.08285487443208694, 0.021676121279597282, 0.12257685512304306, 0.3465762138366699, 0.04679906368255615, 0.24578222632408142, 0.08854170143604279, -0.18267343938350677, 0.05059150978922844, 0.05071393400430679, 0.023746924474835396, 0.21220983564853668, 0.09074035286903381, 0.10796340554952621, -0.1833348572254181, -0.32709869742393494, -0.18664124608039856, 0.3506259024143219, 0.22303569316864014, -0.13720816373825073, -0.22898240387439728, -0.532219409942627, 0.02475675567984581, -0.18351896107196808, 0.3046512007713318, 0.2867860198020935, -0.05760163441300392, 0.21374964714050293, 0.08615618944168091, -0.0549740269780159, 0.042764872312545776, 0.010628819465637207, -0.3746063709259033, 0.12759637832641602, -0.21992772817611694, 0.22647756338119507, 0.22973507642745972, -0.03446631133556366, 0.02812952920794487, -0.19042406976222992, 0.12593203783035278, 0.08102520555257797, -0.4435291886329651, -0.10239158570766449, 0.07268722355365753, 0.18501046299934387, 0.38634657859802246, 0.057732418179512024, -0.10910829156637192, -0.08429961651563644, -0.19646666944026947, 0.011039640754461288, 0.3263120949268341, 0.24360264837741852, 0.30304044485092163, -0.09316035360097885, 0.348336398601532, 0.1637202501296997, -0.09235907346010208, 0.02563665807247162, -0.06036156415939331, -0.23486383259296417, -0.36827775835990906, 0.030014079064130783, 0.4863569736480713, 0.003614801913499832, -0.22772161662578583, -0.026995129883289337, -0.11334925144910812, -0.4427512288093567, 0.15130257606506348, 0.26865309476852417, -0.0038664392195641994, 0.6585212349891663, -0.23081856966018677, 0.09418642520904541, 0.009617960080504417, -0.2555781900882721, -0.10255208611488342, -0.22019633650779724, -0.5276188254356384, 0.02224940061569214, 0.1477232575416565, -0.08101402223110199, 0.09435705095529556, 0.23153740167617798, 0.07851213216781616, -0.2548885941505432, 0.2924029231071472, -0.0848221480846405, -0.007178023457527161, 0.10243546962738037, -0.12107798457145691, 0.0948379635810852, 0.1206606924533844, -0.23089493811130524, -0.2997901141643524, 0.2124730944633484, -0.6993403434753418, -0.4020501375198364, 0.0393141433596611, 0.13908982276916504, -0.1968967616558075, 0.47999244928359985, -0.07992830127477646, 0.19789554178714752, 0.11752517521381378, -0.07527433335781097, 0.021904639899730682, -0.20688699185848236, 0.12204231321811676, -0.31082573533058167, 0.21694323420524597, 0.1160011887550354, -0.3441193103790283, 0.03838314116001129, -0.18530146777629852, -0.4143194556236267, 0.004138253629207611, 0.43574243783950806, -0.3004791736602783, 0.1542767733335495, -0.49250146746635437, 0.40936213731765747, 0.3056257367134094, -0.19454222917556763, -0.38875746726989746, 0.324422150850296, 0.03868178278207779, 0.11640127748250961, 0.3471747040748596, -0.061161383986473083, 0.18682998418807983, -0.09922268241643906, 0.21476726233959198, 0.19835378229618073, -0.13637512922286987, 0.0314808115363121, -0.05638100951910019, -0.2625824809074402, -0.03333029896020889, 0.05073239281773567, -0.21529100835323334, 0.08855797350406647, 0.053321871906518936, -0.13718977570533752, 0.4872748851776123, -0.06388381123542786, -0.04406970739364624, -0.04105314612388611, 0.1441478431224823, 0.1745726466178894, 0.1638551950454712, 0.012492511421442032, -0.45990943908691406, 0.17035183310508728, -0.09477072954177856, -0.42311596870422363, -0.24574975669384003, -0.4675447344779968, -0.22031885385513306, -0.13254481554031372, -0.3175484836101532, 0.31435444951057434, 0.05895192176103592, 0.1363338977098465, -0.15399394929409027, -0.021502140909433365, -0.3564300239086151, 0.35328903794288635, -0.3079814612865448, -0.002218846697360277, -0.5760573744773865, 0.4602973461151123, 0.22535140812397003, 0.1146567314863205, -0.34998637437820435, 0.08166119456291199, -0.018087908625602722, -0.16105784475803375, 0.23636719584465027, 0.446068674325943, 0.41467979550361633, 0.10974932461977005, 0.1686042696237564, 0.27105849981307983, 0.16703855991363525, -0.2693635821342468, 0.06275177001953125, -0.00164024718105793, -0.04100668430328369, -0.04333169385790825, -0.39341363310813904, 0.42211616039276123, -0.4550402760505676, 0.21559256315231323, -0.04981441795825958, -0.23810124397277832, 0.37197843194007874, -0.2404187023639679, -0.37154558300971985, -0.3221816122531891, 0.055509887635707855, 0.20133163034915924, 0.3979922831058502, 0.13802306354045868, -0.32309427857398987, -0.2223692238330841, 0.556817352771759, -0.26772335171699524, -0.04408383369445801, 0.2187604308128357, 0.07677383720874786, -0.09269988536834717, -0.0063626524060964584, 0.42714568972587585, 0.5686037540435791, 0.1891498565673828, -0.005097825080156326, 0.07261601835489273, 0.16203762590885162, -0.217112198472023, 0.09316989034414291, -0.05699975788593292, -0.2845197021961212, 0.4713268578052521, -0.13067825138568878, -0.09478337317705154, -0.1979997754096985, -0.09946781396865845, 0.11942096799612045, -0.07970374822616577, -0.29462501406669617, -0.1620979756116867, -0.1482629030942917, -0.0003963783383369446, -0.28775396943092346, -0.030816376209259033, -0.2367900311946869, -0.08274909108877182, 0.01803433522582054, -0.21799075603485107, -0.22842687368392944, 0.11625074595212936, 0.032313790172338486, 0.5113558173179626, -0.06593779474496841, -0.3209170401096344, -0.007401403039693832, -0.09862445294857025, 0.13293278217315674, 0.03752262517809868, 0.014052382670342922, 0.02934514544904232, 0.34445300698280334, -0.45398956537246704, -0.15738338232040405, -0.13549263775348663, -0.45234668254852295, 0.2571451961994171, 0.025269798934459686, 0.20227272808551788, 0.4698035418987274, 0.14966171979904175, 0.4038851857185364, -0.4223380386829376, 0.11724047362804413, 0.19501161575317383, -0.05848681181669235, -0.1571606993675232, 0.31282782554626465, 0.31039395928382874, -0.1627747267484665, -0.3867175281047821, -0.25805431604385376, -0.4590802788734436, 0.503145694732666, -0.1358199566602707, -0.02243734896183014, -0.1487896740436554, -0.2745598554611206, -0.0523809976875782, -0.2959289848804474, -0.12565316259860992, -0.19968217611312866, -0.17663255333900452, 0.03549739718437195, 0.06095343455672264, 0.05368118733167648, -0.0477326326072216, -0.2104068249464035, 0.034153543412685394, 0.07444876432418823, -0.20403142273426056, -0.3255489766597748, -0.13630418479442596, 0.33904847502708435, 0.011205211281776428, 0.08158638328313828, 0.1067790761590004, 0.17586979269981384, 0.00000529363751411438, -0.08013242483139038, 0.0681530237197876, 0.030322149395942688, -0.014952115714550018, 0.05729653686285019, 0.5393956899642944, 0.23279660940170288, -0.0576661191880703, 0.7472339272499084, 0.3775460720062256, 0.06265422701835632, 0.11625101417303085, 0.0669216439127922, 0.17093205451965332, -0.000594116747379303, -0.16077925264835358, -0.00003033294342458248, -0.05668385326862335, -0.09263704717159271, 0.47505825757980347, 0.1403418928384781, 0.011711583472788334, -0.10150240361690521, 0.1976109892129898, -0.27084001898765564, -0.3659682273864746, 0.15918685495853424, -0.20052412152290344, 0.19680248200893402, -0.23614120483398438, -0.3024654984474182, 0.2158326506614685, 0.022823579609394073, -0.10308553278446198, 0.5496345162391663, 0.0370485745370388, -0.18387500941753387, -0.2712216377258301, -0.031243791803717613, -0.08373307436704636, 0.24944020807743073, 0.17372126877307892, 0.01498924195766449, 0.0675283670425415, -0.1672510802745819, 0.098173126578331, 0.10796429961919785, 1.0811164379119873, 0.1788974404335022, -0.05246056616306305, -0.07617934048175812, 0.033071182668209076, 0.19554449617862701, -0.12759751081466675, -0.20393364131450653, 0.13039515912532806, -0.01906098797917366, 0.4882529377937317, -0.5070168375968933, -0.27854886651039124, -0.027771152555942535, 0.20738404989242554, -0.05457349121570587, -0.2268562763929367, -0.13973480463027954, 0.06586670130491257, -0.12955519556999207, 0.04301606863737106, 0.13743063807487488, -0.24519094824790955, -0.3927065432071686, -0.16166409850120544, -0.1458761841058731, -0.21744588017463684, 0.19766440987586975, 0.10104329884052277, 0.43013229966163635, -0.11604522913694382, 0.09119348227977753, 0.3577500879764557, 0.3226158022880554, 0.02028498612344265, 0.4102915823459625, -0.47188958525657654, -0.41261833906173706, 0.10731641203165054, -0.07426506280899048, 0.28444570302963257, 0.3385419249534607, -0.27201470732688904, -0.07015814632177353, 0.02712254971265793, 0.2678045332431793, -0.47754448652267456, 0.38099125027656555, 0.5574836730957031, -0.10230296850204468, -0.5943627953529358, -0.6634493470191956, 0.5417012572288513, 0.17934589087963104, -0.32107895612716675, 0.2962116599082947, 0.3138681948184967, -0.3164081573486328, 0.112538643181324, -0.3175489902496338, 1.0416971445083618, -0.010899603366851807, 0.16754524409770966, 0.001336701214313507, 0.06641865521669388, 0.49879416823387146, -0.360288143157959, 0.07075823843479156, -0.315672904253006, -0.14633774757385254, -0.08285816013813019, -0.11403772234916687, 0.2824695408344269, 0.47120940685272217, -0.3149436116218567, 0.2415650486946106, -0.09053444862365723, -0.04235256835818291, -0.06769274920225143, 0.30078941583633423, -0.026263704523444176, 0.05620255321264267, -0.40967628359794617, -0.0034014787524938583, -0.21259702742099762, -0.06500022113323212, -0.08382342755794525, -0.03846731036901474, 0.29840630292892456, -0.17134107649326324, 0.16339929401874542, -0.17225977778434753, 0.14772994816303253, -0.06864795833826065, -0.010989375412464142, -0.2912520170211792, 0.12698057293891907, 0.2733588218688965, -0.11321334540843964, 0.1404915452003479, -0.13761332631111145, 0.15848952531814575, 0.032396528869867325, 0.16817744076251984, 0.03027191571891308, -0.06327825784683228, 0.19658513367176056, 0.32514673471450806, -0.12558551132678986, -0.21500936150550842, -0.09962819516658783, 0.04924708604812622, -0.3875619173049927, 0.3375183939933777, 0.13769251108169556, -0.6305497884750366, -0.3615400791168213, -0.04571452736854553, 0.06483431160449982, 0.03580159321427345, 0.09497924149036407, 0.12757974863052368, -0.27391237020492554, 0.29700785875320435, -0.08743306994438171, -0.2532707154750824, -0.0208822600543499, 0.09080297499895096, 0.18459993600845337, -0.1315150260925293, 0.022490177303552628, -0.17988111078739166, -0.16909678280353546, -0.11977884918451309, 0.23268857598304749, 0.15933369100093842, -0.4164409041404724, 0.3130958080291748, 0.08939652889966965, -0.06178518384695053, 0.124458909034729, -0.04650675132870674, 0.3036099672317505, -0.113744355738163, -0.016096048057079315, -0.20340029895305634, -0.06211747229099274, 0.5099204182624817, 0.05310520902276039, 0.45436686277389526, 0.25949543714523315, 0.022586200386285782, -0.24925768375396729, -0.12793011963367462, -0.24582616984844208, 0.21206851303577423, -0.020329058170318604, 0.17754708230495453, 0.15291333198547363, 0.08825767785310745, 0.03821270167827606, 0.0274304561316967, 0.16096888482570648, -0.09838363528251648, -0.10490375012159348, -0.1971648931503296, -0.1833123117685318, 0.1996545046567917, -0.11164840310811996, 0.1351354867219925, 0.24508550763130188, -0.3828120827674866, -0.03726237639784813, -0.23196303844451904, 0.3633868098258972, 0.05836610496044159, 0.17102238535881042, 0.047173772007226944, 0.3491781949996948, -0.11108126491308212, -0.2921587824821472, 0.37315693497657776, -0.014302082359790802, 0.13623277842998505, 0.19099600613117218, 0.21591581404209137, -0.5582266449928284, 0.11605365574359894, -0.23002907633781433, 0.07067503035068512, 0.37774568796157837, 0.16891628503799438, 0.0498492456972599, -0.007053248584270477, -0.01038368046283722, -0.15778297185897827, 0.7432067394256592, 0.4274047017097473, -0.4165801405906677, -0.01769794151186943, 0.26424843072891235, 0.18080149590969086, -0.23860609531402588, -0.10779067873954773, 0.23238597810268402, 0.18514195084571838, 0.15526846051216125, 0.21748079359531403, 0.23014777898788452, 0.3970573842525482, -0.04648485779762268, -0.14168676733970642, 0.607969343662262, 0.08078152686357498, 0.4475245177745819, 0.8007003664970398, 0.007441233843564987, 0.0718502402305603, 0.3057956397533417, -0.019192636013031006, 0.14811794459819794, 0.5727335810661316, -0.1499139964580536, 0.33032435178756714, 0.01219528540968895, 0.2710840106010437, 0.21830147504806519, -0.31724783778190613, 0.0953790470957756, 0.13286058604717255, -0.45253366231918335, -0.011919066309928894, -0.11010478436946869, 0.5057721734046936, -0.32304900884628296, -0.08986116200685501, -0.03810488432645798, 0.16234076023101807, -0.049335360527038574, -0.2530212104320526, 0.17963063716888428, -0.3319825530052185, -0.2227908819913864, -0.16659881174564362, -0.17476823925971985, 0.08267205208539963, 0.33988451957702637, 0.2150868922472, 0.2756175994873047, -0.3264671564102173, 0.2206340730190277, 0.01378978043794632, 0.36586621403694153, -0.1821214109659195, 0.31995877623558044, 0.18133598566055298, -0.0029469430446624756, 0.33902716636657715, 0.004818793386220932, 0.19668728113174438, 0.2849864661693573, 0.11964213848114014, -0.3461155593395233, -0.1810968667268753, 0.04134909063577652, -0.2030726820230484, 0.13038361072540283, 0.12804588675498962, 0.11520795524120331, 0.08399224281311035, 0.18860973417758942, -0.13827598094940186, 0.020560048520565033, -0.026300806552171707, -0.137348935008049, -0.6669573187828064, 0.5236172676086426, 0.025366686284542084, -0.06520336866378784, 0.003256397321820259, -0.0458211675286293, -0.8148399591445923, -0.1184779703617096, 0.3094722330570221, 0.0844641923904419, 0.07291971892118454, 0.13817131519317627, 0.0796412006020546, -0.051273997873067856, 0.0948893129825592, -0.16587845981121063, 0.25057342648506165, -0.09497066587209702, -0.14415785670280457, -0.641851544380188, 0.09077649563550949, 0.22154082357883453, -0.12526261806488037, 0.13178502023220062, -0.028813257813453674, -0.0447261705994606, 0.16467948257923126, -0.24092061817646027, -0.17093071341514587, 0.06196552515029907, -0.09603564441204071, -0.1118348240852356, -0.13848215341567993, -0.21012569963932037, 0.09686010330915451, 0.016922153532505035, -0.31280970573425293, -0.019959237426519394, 0.46496304869651794, -0.21707263588905334, -0.08939870446920395, 0.029874570667743683, 0.40159276127815247, 0.005002826452255249, 0.06256760656833649, 0.32403364777565, 0.4233109951019287, -0.08194775134325027, 0.08553899079561234, -0.06990157067775726, -0.2420572191476822, -0.143411785364151, 0.1320825219154358, -0.029984373599290848, 0.09477764368057251, -0.2783896327018738, -0.07147516310214996, -0.3300524055957794, -0.042318057268857956, 0.12165531516075134, 0.08116080611944199, -0.5107961893081665, -0.14050059020519257, -0.1606339067220688, -0.11286599934101105, 0.07199834287166595, 0.5833612680435181, -0.0941118597984314, 0.02097375877201557, 0.07733891904354095, -0.04037417843937874, 0.3142376244068146, -0.16187399625778198, -0.1829291731119156, 0.03176993131637573, 0.2825925946235657, -0.1698932945728302, 0.022887883707880974, -0.30343878269195557, -0.015691302716732025, 0.5484158396720886, -0.11127319186925888, -0.08395278453826904, 0.12127749621868134, 0.03874705731868744, -0.21060870587825775, -0.1320749819278717, -0.026435725390911102, 0.3835369050502777, -0.2983129918575287, 0.2151959240436554, -0.20311561226844788 ]
https://github.com/huggingface/datasets/issues/3018
Support multiple zipped CSV data files
@lhoestq I would like to draw your attention to the proposed API by @lewtun, using `data_dir` to pass the ZIP URL. I'm not totally convinced with this... What do you think? Maybe we could discuss other approaches... One brainstorming idea: what about using URL chaining with the hop operator in `data_files`?
As requested by @lewtun, support loading multiple zipped CSV data files. ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "train_filename.csv", "test": "test_filename.csv"} dataset = load_dataset("csv", data_dir=url, data_files=data_files) ```
51
Support multiple zipped CSV data files As requested by @lewtun, support loading multiple zipped CSV data files. ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "train_filename.csv", "test": "test_filename.csv"} dataset = load_dataset("csv", data_dir=url, data_files=data_files) ``` @lhoestq I would like to draw your attention to the proposed API by @lewtun, using `data_dir` to pass the ZIP URL. I'm not totally convinced with this... What do you think? Maybe we could discuss other approaches... One brainstorming idea: what about using URL chaining with the hop operator in `data_files`?
[ -0.04363630712032318, 0.026397183537483215, -0.2615996301174164, -0.018547475337982178, 0.02556236833333969, -0.042207807302474976, 0.39677372574806213, 0.2515754699707031, 0.30051636695861816, 0.13865631818771362, 0.024600304663181305, 0.3511757552623749, -0.07382473349571228, 0.4689003527164459, -0.05530344694852829, -0.031526416540145874, 0.10495620965957642, 0.03718385100364685, -0.2543557584285736, 0.17983296513557434, -0.46063584089279175, 0.1624908149242401, -0.26747390627861023, -0.2959582209587097, 0.17311742901802063, 0.15129728615283966, -0.44637566804885864, 0.13816601037979126, -0.18523092567920685, -0.26033419370651245, 0.31033819913864136, 0.43196552991867065, 0.08322698622941971, 0.3215491473674774, -0.00010024600487668067, -0.011101223528385162, 0.11562630534172058, -0.03826610743999481, -0.24987278878688812, -0.49662643671035767, -0.06188434362411499, -0.5920060276985168, 0.15078820288181305, -0.3615574538707733, -0.027074411511421204, -0.2116898149251938, 0.022740934044122696, -0.3560550808906555, 0.5224736332893372, 0.06439563632011414, 0.24782636761665344, -0.11205168813467026, -0.20258690416812897, -0.09203703701496124, 0.023445021361112595, 0.14292097091674805, -0.05548268184065819, 0.23008684813976288, 0.39406660199165344, -0.31526756286621094, -0.15962979197502136, 0.018650449812412262, -0.015417012386023998, 0.15072080492973328, 0.22668668627738953, 0.029269546270370483, -0.2085193395614624, -0.20158444344997406, -0.20373126864433289, -0.07872477918863297, 0.5302679538726807, -0.11503473669290543, -0.4657897651195526, -0.22536936402320862, -0.1263517439365387, -0.2694246172904968, 0.0023907795548439026, 0.26223304867744446, -0.09076456725597382, 0.20150916278362274, -0.11809564381837845, -0.16336902976036072, -0.29831790924072266, 0.13972041010856628, 0.016654416918754578, 0.4006107747554779, -0.0975458174943924, 0.1752038598060608, 0.1303570717573166, 0.07589512318372726, 0.33321109414100647, -0.22813856601715088, 0.4936172366142273, 0.12712468206882477, -0.2799767851829529, -0.1529814600944519, -0.030307888984680176, -0.19521209597587585, 0.22601917386054993, 0.4028480648994446, 0.26829084753990173, -0.0182478167116642, -0.19993776082992554, 0.10686399042606354, 0.3378009498119354, 0.031778447329998016, -0.13539353013038635, -0.046031419187784195, 0.2748934328556061, 0.17316819727420807, 0.18572087585926056, -0.13636529445648193, -0.07588699460029602, -0.16929735243320465, -0.21451634168624878, 0.26363903284072876, 0.13670292496681213, 0.26795023679733276, -0.11500445753335953, -0.17115849256515503, -0.12393658608198166, -0.33249109983444214, 0.04835081100463867, 0.1693086326122284, -0.2614631652832031, 0.4086420238018036, -0.09110656380653381, 0.20818479359149933, 0.13569016754627228, -0.001618947833776474, -0.08102568238973618, 0.06362348794937134, -0.2558550536632538, 0.1231585368514061, 0.29672980308532715, 0.019493378698825836, 0.05088698863983154, 0.26651328802108765, 0.23753543198108673, -0.04838581010699272, 0.27659478783607483, 0.027485325932502747, 0.1173677146434784, -0.002527400851249695, 0.13463617861270905, 0.11254776269197464, 0.20613671839237213, -0.13830271363258362, -0.15425193309783936, 0.2669120132923126, -0.6838106513023376, -0.23875172436237335, 0.07504397630691528, 0.2425270527601242, -0.11183131486177444, 0.012240434065461159, -0.22119367122650146, 0.20787674188613892, -0.28098833560943604, -0.0636904239654541, -0.0652964785695076, 0.13972915709018707, -0.21206703782081604, -0.4275166690349579, 0.019595755264163017, 0.42194151878356934, -0.16445931792259216, 0.03976340591907501, -0.10269856452941895, 0.0638880729675293, -0.04152510315179825, 0.15561619400978088, -0.4455315172672272, -0.06309033185243607, -0.25269776582717896, 0.1106395572423935, 0.4125577211380005, -0.5059447884559631, -0.19212879240512848, 0.5535316467285156, 0.0032557323575019836, 0.1533464640378952, 0.312389075756073, -0.09827566146850586, 0.1020750179886818, -0.10970810055732727, 0.21937087178230286, 0.42604726552963257, -0.011163989081978798, 0.07631085067987442, -0.14288267493247986, -0.41901955008506775, 0.278504341840744, 0.2693854868412018, -0.10899126529693604, -0.1277965009212494, -0.07689667493104935, -0.7075769305229187, 0.5397414565086365, -0.15052913129329681, 0.017147889360785484, -0.20352694392204285, 0.045646119862794876, 0.11321918666362762, -0.043005313724279404, 0.11500950902700424, -0.42361825704574585, 0.1653788983821869, -0.07175375521183014, -0.11565101146697998, -0.14649516344070435, -0.28642863035202026, -0.10965590178966522, -0.015944160521030426, -0.1837443858385086, -0.04717892035841942, 0.23301604390144348, 0.05391523987054825, -0.2111234962940216, -0.09624665975570679, -0.27586695551872253, 0.28247734904289246, 0.20669130980968475, 0.18459154665470123, -0.1800289899110794, 0.31128525733947754, 0.05139433965086937, 0.3126392364501953, 0.0851908028125763, 0.06416597962379456, 0.17828218638896942, -0.32194235920906067, 0.14811217784881592, 0.28008320927619934, 0.11034747213125229, 0.027867034077644348, 0.21545082330703735, -0.024693042039871216, 0.2957794666290283, 0.019136492162942886, 0.11117695271968842, 0.2755138874053955, 0.07022813707590103, -0.1409219205379486, -0.35950976610183716, 0.5948728919029236, -0.3154376745223999, 0.13556289672851562, 0.09292684495449066, 0.08859317004680634, 0.2146630436182022, -0.18987400829792023, -0.2741462290287018, -0.010142754763364792, -0.000311434268951416, 0.27298828959465027, 0.20206162333488464, -0.10277993977069855, -0.08319144695997238, 0.003927610814571381, -0.04920468106865883, -0.17052344977855682, -0.2223511040210724, 0.17586806416511536, 0.06126854941248894, -0.1614273190498352, 0.15479831397533417, 0.578302264213562, 0.5669013261795044, 0.3175036609172821, -0.02225390449166298, -0.14767193794250488, 0.11433277279138565, -0.2679820954799652, 0.2796592116355896, -0.05659988522529602, -0.0011970174964517355, 0.17335164546966553, 0.023410527035593987, 0.000752313993871212, -0.11475730687379837, -0.3495037853717804, 0.2905476689338684, -0.0434749573469162, -0.05258416384458542, 0.07750619202852249, -0.18526530265808105, -0.40476953983306885, -0.16975577175617218, -0.22956514358520508, 0.11561110615730286, -0.22311906516551971, 0.0008892752230167389, 0.06275010854005814, -0.14850777387619019, 0.0615699365735054, -0.01491818018257618, 0.4625589847564697, -0.11604365706443787, -0.24570594727993011, 0.07402005791664124, 0.12031105905771255, 0.11114998906850815, 0.2595193386077881, 0.32159462571144104, -0.17300766706466675, 0.31037843227386475, 0.37678954005241394, 0.12284991145133972, -0.29427099227905273, -0.026455741375684738, -0.019800491631031036, 0.0405316986143589, 0.24147237837314606, 0.19985586404800415, 0.022043928503990173, 0.28293663263320923, -0.19152222573757172, 0.08307092636823654, 0.21607935428619385, 0.19347935914993286, -0.29498913884162903, 0.2222932130098343, 0.010738358832895756, -0.1970660537481308, -0.26883718371391296, -0.4581338167190552, -0.23011788725852966, 0.41335201263427734, -0.022476907819509506, 0.18049533665180206, 0.11787537485361099, 0.09565419703722, -0.11485271900892258, 0.3196910321712494, -0.32194212079048157, -0.1252061128616333, -0.507675051689148, 0.2632462978363037, -0.2517261803150177, -0.1867697685956955, -0.10309967398643494, -0.01843499392271042, 0.2382459044456482, 0.0730055496096611, -0.1397067904472351, -0.27296099066734314, -0.03262042999267578, 0.29858851432800293, -0.19662421941757202, 0.0010506585240364075, 0.2337559163570404, 0.13405930995941162, -0.17060041427612305, 0.010445371270179749, -0.19022421538829803, -0.03869803994894028, 0.01944577693939209, -0.025213338434696198, 0.28760623931884766, 0.03794857859611511, 0.17658424377441406, 0.5748735070228577, 0.2305494248867035, 0.34276196360588074, 0.4909660220146179, 0.06968642771244049, 0.1371338814496994, 0.252977579832077, -0.42367371916770935, -0.1547652930021286, -0.2582741975784302, -0.09930137544870377, 0.23897093534469604, 0.16200411319732666, -0.21191762387752533, -0.30413293838500977, -0.0874243974685669, -0.24665915966033936, -0.2997458577156067, 0.27221253514289856, -0.12146048247814178, 0.08197729289531708, -0.10656769573688507, -0.2922973334789276, -0.21373501420021057, 0.1334162950515747, -0.14462466537952423, 0.14360785484313965, 0.40055525302886963, -0.29040706157684326, 0.03397095575928688, -0.015043423511087894, -0.4335342049598694, 0.2562676668167114, 0.19543221592903137, -0.11444804072380066, 0.2545015513896942, -0.004276018589735031, -0.02485106885433197, -0.1719619780778885, 0.8443657159805298, -0.23992829024791718, -0.10582852363586426, 0.0560486875474453, -0.055708564817905426, -0.05179473012685776, 0.00757545605301857, -0.0749862864613533, 0.17258429527282715, -0.05991228297352791, 0.6023207306861877, -0.06904426217079163, -0.23726442456245422, -0.03643423318862915, 0.04617350921034813, -0.07646296918392181, -0.4154781103134155, 0.03088560327887535, -0.1420423686504364, -0.18543082475662231, -0.23167777061462402, 0.18943923711776733, 0.002945548389106989, -0.1819392591714859, -0.32565948367118835, 0.16301777958869934, -0.27035820484161377, 0.19068658351898193, -0.18895669281482697, -0.1525898575782776, 0.026738109067082405, 0.057970184832811356, -0.023832961916923523, 0.12849028408527374, -0.026828357949852943, 0.5123255848884583, -0.3112597167491913, -0.4419209361076355, -0.15963271260261536, 0.008882873691618443, 0.346659392118454, 0.2170015573501587, -0.1177179142832756, 0.30777662992477417, -0.1870565414428711, 0.12406663596630096, -0.20736823976039886, -0.14355650544166565, 0.27796754240989685, -0.22112798690795898, -0.3391639292240143, -0.6646482944488525, 0.4754728376865387, 0.04188357666134834, -0.14402124285697937, 0.5803977251052856, -0.2641393542289734, -0.17840032279491425, 0.22421537339687347, -0.10042599588632584, 0.6979025602340698, -0.056044042110443115, 0.23041987419128418, 0.0730275809764862, -0.10018498450517654, 0.40268179774284363, -0.3819875717163086, 0.07373231649398804, -0.1766742616891861, -0.1108650490641594, -0.21096813678741455, 0.08114548027515411, 0.28231754899024963, 0.26978281140327454, -0.38401854038238525, 0.1904999315738678, 0.1522936373949051, 0.06488260626792908, -0.05847316235303879, 0.35878342390060425, -0.2687631845474243, -0.2687596082687378, -0.19717493653297424, 0.24047842621803284, 0.1327703893184662, -0.19581273198127747, -0.08331871032714844, -0.4029221534729004, 0.09521710872650146, -0.18761134147644043, -0.10051321238279343, -0.024993717670440674, -0.19805921614170074, 0.2668449878692627, -0.07695402204990387, -0.12490205466747284, 0.12406042218208313, 0.24176432192325592, -0.16142034530639648, -0.21713827550411224, -0.2727912366390228, -0.05074628069996834, -0.3296756148338318, 0.04144413396716118, -0.3553839325904846, -0.30952924489974976, 0.22352059185504913, 0.0028106272220611572, -0.14359068870544434, 0.10087253153324127, 0.002497442066669464, -0.47416508197784424, 0.0037841051816940308, 0.3981918692588806, 0.2765812873840332, -0.485666960477829, -0.11462216079235077, -0.04622769355773926, -0.17438998818397522, -0.1404399275779724, 0.1834312379360199, 0.14706233143806458, 0.07561594992876053, 0.11830981075763702, -0.03644515201449394, -0.002843022346496582, -0.036438021808862686, 0.2152424454689026, -0.03576746582984924, -0.17669974267482758, 0.04841427132487297, -0.04017370939254761, -0.08931049704551697, -0.1768966019153595, 0.23403412103652954, -0.11260829120874405, -0.02426934614777565, 0.14556021988391876, 0.13346876204013824, 0.21554626524448395, 0.020725086331367493, 0.23828193545341492, 0.18148818612098694, 0.21598032116889954, 0.10494129359722137, -0.48277461528778076, 0.10863334685564041, 0.2172345072031021, -0.1722259521484375, 0.15915557742118835, -0.052989039570093155, 0.0073596397414803505, 0.28373345732688904, -0.10901437699794769, -0.4119296669960022, 0.33964046835899353, 0.21132616698741913, -0.2107933759689331, 0.231686532497406, -0.01870770752429962, -0.02910589799284935, 0.1412697732448578, 0.23721611499786377, -0.04930558055639267, -0.10174743831157684, -0.3119331896305084, -0.16294796764850616, 0.09693007171154022, 0.09849397838115692, 0.05711505562067032, 0.14117680490016937, -0.20811349153518677, -0.20902542769908905, -0.16771025955677032, -0.12529750168323517, 0.010683882981538773, -0.07880312204360962, -0.0352216400206089, 0.024159681051969528, 0.061120569705963135, -0.3474843502044678, 0.2156696617603302, 0.09356745332479477, 0.2527228593826294, 0.09411680698394775, 0.03343226760625839, -0.17128479480743408, -0.07021088898181915, -0.22746750712394714, 0.09895960241556168, 0.18232524394989014, 0.13340620696544647, 0.22306042909622192, -0.042748771607875824, -0.026774464175105095, 0.19254760444164276, 0.4988725483417511, 0.41284218430519104, -0.24677948653697968, 0.3378990888595581, 0.14444369077682495, 0.2865644097328186, -0.18953652679920197, -0.04402158781886101, -0.06681536138057709, 0.04934724420309067, 0.1692691594362259, 0.24107302725315094, 0.15660342574119568, -0.04649100452661514, 0.32984983921051025, -0.07598257809877396, 0.4292852282524109, 0.036021895706653595, 0.30898767709732056, 0.36906951665878296, 0.011773761361837387, 0.05716679245233536, 0.039406269788742065, -0.0650230199098587, 0.24287444353103638, 0.16222959756851196, -0.24452689290046692, 0.11195003241300583, 0.2162938117980957, 0.06698574870824814, -0.0734778419137001, -0.3386809825897217, 0.1718769669532776, 0.020538926124572754, -0.19340717792510986, 0.20714208483695984, 0.17752796411514282, 0.8204314708709717, -0.4228864312171936, 0.027328873053193092, -0.1850319355726242, 0.26838135719299316, 0.08384473621845245, -0.1920389086008072, 0.14274318516254425, -0.12164701521396637, -0.34092390537261963, 0.11071175336837769, -0.08271415531635284, -0.10416276752948761, 0.36343273520469666, -0.06186167895793915, 0.13418564200401306, -0.21294856071472168, -0.0011269114911556244, 0.09801595658063889, 0.3138020932674408, -0.3279118835926056, -0.01721564494073391, 0.32139477133750916, -0.1736566573381424, -0.005059573799371719, -0.07391933351755142, 0.33379068970680237, 0.19714055955410004, 0.16627156734466553, -0.007977611385285854, -0.3583986163139343, 0.07121405005455017, -0.021134153008461, -0.0043742042034864426, 0.19838273525238037, -0.01826457679271698, 0.3485848307609558, 0.25596582889556885, -0.21356584131717682, 0.40572863817214966, 0.2306509166955948, 0.05288977921009064, -0.5972954630851746, 0.06463584303855896, 0.22511443495750427, 0.00009441375732421875, -0.06350643932819366, -0.09652987867593765, -0.5209172964096069, -0.201587975025177, 0.06930148601531982, -0.03232860565185547, 0.15749067068099976, 0.051184311509132385, 0.15692785382270813, 0.07926728576421738, 0.21470476686954498, -0.04917528107762337, 0.1600676029920578, -0.3750808537006378, -0.3442463278770447, -0.6343666315078735, -0.1843772530555725, 0.06105992943048477, 0.05832718312740326, -0.35011300444602966, 0.02569403685629368, 0.14811007678508759, 0.20718279480934143, -0.2560754418373108, -0.21060435473918915, 0.519183874130249, 0.19175314903259277, -0.2793998718261719, -0.056350644677877426, 0.3478943109512329, 0.14798982441425323, 0.11690913140773773, -0.1997033953666687, 0.049906663596630096, 0.0090964799746871, 0.06768657267093658, -0.2504599094390869, -0.07819005846977234, 0.052067648619413376, -0.17951343953609467, 0.5305584669113159, -0.10280962288379669, 0.2437041848897934, -0.27539464831352234, 0.13181789219379425, -0.10094784200191498, 0.15800903737545013, 0.0018559722229838371, -0.03759481757879257, 0.23761959373950958, 0.03570445626974106, -0.2538922429084778, 0.11355845630168915, -0.1296253651380539, -0.05341138318181038, -0.06028270348906517, -0.013697854243218899, -0.12251689285039902, 0.03444515913724899, 0.018568336963653564, -0.11334444582462311, -0.17042677104473114, 0.3096362054347992, -0.211735337972641, 0.047227077186107635, 0.044680431485176086, -0.23324626684188843, 0.2912091612815857, -0.2441503405570984, -0.11881007254123688, -0.004693725146353245, 0.1982915699481964, -0.22001367807388306, 0.35547515749931335, -0.2046433389186859, 0.017053432762622833, 0.4160434305667877, 0.2202560305595398, -0.19397129118442535, 0.5686308145523071, 0.002793273888528347, -0.17731986939907074, -0.16138239204883575, 0.35925617814064026, 0.20224902033805847, -0.21612223982810974, -0.025156868621706963, -0.3636344075202942 ]
https://github.com/huggingface/datasets/issues/3018
Support multiple zipped CSV data files
`data_dir` is currently exclusively used for manually downloaded data. Maybe we can have an API that only uses data_files as you are suggesting, using URL chaining ? ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "zip://train_filename.csv::" + url, "test": "zip://test_filename.csv::" + url} dataset = load_dataset("csv", data_files=data_files) ``` URL chaining is used by `fsspec` to get access to files in nested filesystems of any kind. Since `fsspec` is being used by `pandas`, `dask` and also extensively by `datasets` I think it would be nice to use it here too
As requested by @lewtun, support loading multiple zipped CSV data files. ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "train_filename.csv", "test": "test_filename.csv"} dataset = load_dataset("csv", data_dir=url, data_files=data_files) ```
91
Support multiple zipped CSV data files As requested by @lewtun, support loading multiple zipped CSV data files. ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "train_filename.csv", "test": "test_filename.csv"} dataset = load_dataset("csv", data_dir=url, data_files=data_files) ``` `data_dir` is currently exclusively used for manually downloaded data. Maybe we can have an API that only uses data_files as you are suggesting, using URL chaining ? ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "zip://train_filename.csv::" + url, "test": "zip://test_filename.csv::" + url} dataset = load_dataset("csv", data_files=data_files) ``` URL chaining is used by `fsspec` to get access to files in nested filesystems of any kind. Since `fsspec` is being used by `pandas`, `dask` and also extensively by `datasets` I think it would be nice to use it here too
[ -0.1517477035522461, 0.020762011408805847, -0.2865627706050873, 0.04248727113008499, 0.08390659093856812, 0.014205150306224823, 0.3182390630245209, 0.31929534673690796, 0.3058346211910248, 0.16242416203022003, -0.17525261640548706, 0.20039620995521545, 0.017909416928887367, 0.5145025253295898, -0.06358318030834198, -0.04735378921031952, 0.07355905324220657, 0.0708630308508873, -0.3205331265926361, 0.26263290643692017, -0.39636683464050293, 0.12305881083011627, -0.10516638308763504, -0.22344885766506195, 0.1980772614479065, 0.06683182716369629, -0.4705534279346466, 0.19467416405677795, -0.08261734247207642, -0.3332027494907379, 0.46310439705848694, 0.3740043342113495, 0.14448046684265137, 0.3535309135913849, -0.00009542697080178186, 0.02682315558195114, 0.057708580046892166, -0.0029178932309150696, -0.24938060343265533, -0.5013347268104553, -0.08666808903217316, -0.5928838849067688, 0.17448201775550842, -0.36211851239204407, -0.06696787476539612, -0.421496719121933, 0.22771158814430237, -0.3604799509048462, 0.6344603896141052, 0.09141354262828827, 0.29182395339012146, -0.1238212138414383, -0.10960935056209564, -0.11048389226198196, -0.020204022526741028, -0.0644003301858902, 0.05197492241859436, 0.09506596624851227, 0.2567533850669861, -0.15880154073238373, -0.09238021820783615, -0.05365515127778053, -0.07466590404510498, 0.1222236156463623, 0.12953561544418335, 0.0855313241481781, -0.15971514582633972, -0.24943062663078308, -0.1584966778755188, 0.06114784628152847, 0.37258216738700867, -0.23394185304641724, -0.48238223791122437, -0.32445642352104187, -0.14750100672245026, -0.3678244352340698, 0.04392869025468826, 0.2593333423137665, 0.05935756489634514, 0.23941616714000702, 0.07468193769454956, -0.02459489181637764, -0.21023890376091003, 0.21143628656864166, 0.037444375455379486, 0.2570928931236267, -0.05284099280834198, 0.08025804162025452, 0.2477475255727768, -0.0034379325807094574, 0.18807551264762878, -0.20322780311107635, 0.34106406569480896, 0.14678512513637543, -0.2746538519859314, -0.11035539209842682, 0.027799833565950394, -0.42589303851127625, 0.1661970317363739, 0.3727760910987854, 0.16014039516448975, 0.07970772683620453, -0.2558283805847168, 0.1621585637331009, 0.3093789219856262, -0.005006909370422363, -0.10449757426977158, 0.026896055787801743, 0.42628371715545654, 0.11148519814014435, 0.09302705526351929, -0.1796223521232605, -0.07527919113636017, -0.10468580573797226, -0.3051147162914276, 0.20633259415626526, 0.06163965165615082, 0.26724743843078613, -0.1085621565580368, -0.20549219846725464, 0.07163362950086594, -0.1665530651807785, 0.005724379792809486, 0.21810230612754822, -0.20452556014060974, 0.41972947120666504, -0.09735210239887238, 0.16103464365005493, 0.18879111111164093, 0.17518405616283417, -0.11374885588884354, 0.07972358167171478, -0.20047226548194885, 0.14098066091537476, 0.26282525062561035, -0.007488815113902092, 0.09171628952026367, 0.12225811928510666, 0.05672549828886986, 0.07923378050327301, 0.26850685477256775, -0.08562086522579193, 0.0937943384051323, 0.15729308128356934, 0.19051536917686462, 0.06271345913410187, 0.1468757688999176, -0.21121299266815186, -0.2346840798854828, 0.029027298092842102, -0.6596563458442688, -0.19318224489688873, -0.04677041620016098, 0.2708577513694763, -0.07890453934669495, 0.006990525871515274, -0.3474186956882477, 0.261584997177124, -0.22693824768066406, -0.20311228930950165, -0.05784109979867935, 0.19775301218032837, -0.2535293698310852, -0.3325173556804657, -0.06803864985704422, 0.24412712454795837, -0.1340225338935852, 0.013405680656433105, -0.11227427423000336, -0.03675598278641701, -0.058759696781635284, 0.1993151307106018, -0.2851105332374573, -0.14262613654136658, -0.2443639487028122, 0.17772136628627777, 0.3718692362308502, -0.511182963848114, -0.22730763256549835, 0.4465683102607727, 0.06716249883174896, 0.09141471982002258, 0.3676990270614624, -0.03171336650848389, 0.13306714594364166, -0.07593417912721634, 0.10982968658208847, 0.4537595510482788, 0.15331459045410156, 0.051590874791145325, 0.0385945625603199, -0.47133976221084595, 0.13350576162338257, 0.18160435557365417, -0.15115894377231598, -0.028471797704696655, 0.12182838469743729, -0.5766503810882568, 0.45456013083457947, -0.2646491825580597, 0.018290385603904724, -0.0200403593480587, 0.0656290128827095, 0.135321706533432, -0.08599544316530228, -0.1473807990550995, -0.40939417481422424, 0.24010539054870605, -0.23238123953342438, -0.19994908571243286, -0.24382226169109344, -0.41817766427993774, 0.016464635729789734, -0.09419496357440948, -0.13364866375923157, -0.05032959207892418, 0.27719342708587646, 0.09423091262578964, -0.11745744943618774, -0.06566059589385986, -0.278460294008255, 0.20170441269874573, 0.2097972333431244, 0.10024850070476532, -0.1811525672674179, 0.3082321584224701, 0.10871075838804245, 0.2168254554271698, 0.23145371675491333, 0.05603835731744766, 0.10860864818096161, -0.2269899696111679, 0.21709954738616943, 0.33871346712112427, 0.1782854199409485, 0.04151804372668266, 0.23869091272354126, 0.17499558627605438, 0.2587142288684845, 0.13881981372833252, -0.07809942215681076, 0.20990584790706635, 0.06723139435052872, -0.04170295596122742, -0.37287208437919617, 0.5488945841789246, -0.1888822615146637, 0.1369539052248001, 0.24537311494350433, 0.04459099471569061, 0.43684524297714233, -0.23252691328525543, -0.19306135177612305, -0.13279488682746887, -0.15028983354568481, 0.19996440410614014, 0.21448864042758942, -0.04841791093349457, -0.18784356117248535, 0.10585479438304901, 0.03687874600291252, -0.09849745035171509, -0.06347712129354477, 0.1418626308441162, 0.06216766685247421, -0.11279628425836563, 0.15982453525066376, 0.48577848076820374, 0.4743587374687195, 0.4172951877117157, 0.11532197147607803, -0.04902782291173935, 0.08359315991401672, -0.22941960394382477, 0.31380903720855713, -0.08818727731704712, -0.06477351486682892, 0.18695586919784546, 0.08178507536649704, -0.10130058974027634, -0.1387663334608078, -0.32490238547325134, 0.19328342378139496, -0.05258321017026901, -0.042862989008426666, 0.05863555520772934, -0.45768293738365173, -0.45720964670181274, -0.08494812250137329, -0.07617150247097015, 0.10274997353553772, -0.1674535572528839, -0.01118958368897438, 0.24124088883399963, -0.2840838134288788, 0.0993322879076004, -0.07949870079755783, 0.323881059885025, 0.009662946686148643, -0.18175008893013, 0.030561640858650208, 0.04478975012898445, 0.1886535882949829, 0.28840795159339905, 0.3991665542125702, -0.06147155910730362, 0.3297422528266907, 0.3392840623855591, 0.02571168541908264, -0.3063802421092987, 0.010246187448501587, 0.009659122675657272, 0.14480608701705933, 0.08703253418207169, 0.1366739273071289, 0.08753693848848343, 0.23044587671756744, -0.230373352766037, 0.07457315921783447, 0.20037882030010223, 0.02976342849433422, -0.19621050357818604, 0.18817351758480072, 0.02587776444852352, -0.1892685890197754, -0.201928973197937, -0.44729700684547424, -0.35721835494041443, 0.4445303678512573, -0.013166720047593117, 0.2705976963043213, 0.12639166414737701, 0.13655830919742584, -0.05333511158823967, 0.24671262502670288, -0.21577326953411102, -0.07480763643980026, -0.49448612332344055, 0.3398914635181427, -0.3314998745918274, -0.26881808042526245, -0.11873555183410645, -0.07097266614437103, 0.13817933201789856, 0.0270798671990633, -0.18652589619159698, -0.3547494113445282, -0.11429695785045624, 0.3215602934360504, 0.004412688314914703, 0.017223812639713287, 0.2845309376716614, 0.1248975619673729, -0.233791321516037, 0.03950110822916031, 0.0011550020426511765, 0.08259640634059906, -0.06080132722854614, -0.07622895389795303, 0.21261385083198547, -0.00827816128730774, 0.16921518743038177, 0.5917462110519409, 0.23975643515586853, 0.2618878185749054, 0.4686519503593445, -0.10275373607873917, 0.21649929881095886, 0.168903648853302, -0.3466765880584717, -0.3183974027633667, -0.3281098008155823, 0.05414358526468277, 0.3167024850845337, 0.059204600751399994, -0.11986390501260757, -0.3046017587184906, -0.08389982581138611, -0.26936447620391846, -0.27256453037261963, 0.127524271607399, -0.13001787662506104, 0.06777267158031464, -0.033230021595954895, -0.29819440841674805, -0.16510498523712158, 0.07958128303289413, -0.14887933433055878, 0.13892501592636108, 0.14258259534835815, -0.21264314651489258, 0.06474162638187408, -0.09684120863676071, -0.4147571623325348, 0.317594975233078, 0.1888633519411087, -0.12214156985282898, 0.31977176666259766, -0.0514703132212162, -0.026715919375419617, -0.19484996795654297, 0.7665687203407288, -0.10926973074674606, -0.1227901428937912, 0.028499778360128403, -0.21150951087474823, -0.16730520129203796, 0.047133129090070724, -0.028222938999533653, 0.06055576354265213, -0.1366349458694458, 0.5622584223747253, -0.28304219245910645, -0.21709109842777252, -0.1665978580713272, -0.030576715245842934, -0.12279647588729858, -0.31365224719047546, -0.0406004935503006, -0.0398242250084877, -0.20807518064975739, -0.22242331504821777, 0.043111540377140045, 0.10705097019672394, -0.14504672586917877, -0.3647410571575165, -0.06971710175275803, -0.258254736661911, 0.20688921213150024, -0.10431921482086182, -0.08607681095600128, 0.06307169049978256, 0.0699915885925293, -0.02701295167207718, 0.27457237243652344, 0.15826013684272766, 0.5792912244796753, -0.2881736159324646, -0.3358476758003235, -0.10459578782320023, 0.08316268771886826, 0.10090658813714981, 0.10700584203004837, -0.09798768162727356, 0.38065528869628906, -0.045736007392406464, 0.11158560961484909, -0.25802183151245117, -0.009007515385746956, 0.2616070508956909, -0.041595522314310074, -0.2729899287223816, -0.6354970335960388, 0.4942608177661896, 0.09256207942962646, -0.1375204622745514, 0.4306374490261078, -0.22455205023288727, -0.24543161690235138, 0.14819498360157013, -0.07149495929479599, 0.6370521783828735, -0.020732633769512177, 0.2663729190826416, 0.11518826335668564, -0.13084881007671356, 0.39317914843559265, -0.40161824226379395, 0.13324223458766937, -0.14376401901245117, -0.20602214336395264, -0.20593148469924927, 0.03482959046959877, 0.25467967987060547, 0.22378362715244293, -0.24308115243911743, 0.21188122034072876, 0.2281566709280014, 0.044855598360300064, -0.1183416098356247, 0.35054096579551697, -0.2258675992488861, -0.2676326632499695, -0.3453044295310974, 0.25926312804222107, 0.18981491029262543, -0.21843203902244568, -0.01147010549902916, -0.35474538803100586, 0.09031599760055542, -0.052602268755435944, -0.013939812779426575, -0.03014129213988781, -0.20424720644950867, 0.41498827934265137, -0.2218005359172821, -0.0276796892285347, -0.16229985654354095, 0.27335235476493835, -0.1415223777294159, -0.14737316966056824, -0.2914777398109436, -0.025795739144086838, -0.33933743834495544, 0.008769459091126919, -0.4306793510913849, -0.30293577909469604, 0.280635267496109, -0.0251474566757679, -0.10798739641904831, 0.17188353836536407, 0.11293937265872955, -0.39675086736679077, 0.1515217423439026, 0.4203018546104431, 0.03466925770044327, -0.26729270815849304, -0.14015337824821472, 0.03828229010105133, -0.11923272907733917, -0.18856100738048553, 0.21216024458408356, 0.011755082756280899, 0.10444463044404984, 0.10572671890258789, -0.12604597210884094, -0.01629789173603058, -0.07546921074390411, 0.4173347055912018, 0.06778999418020248, 0.06192054599523544, 0.14775291085243225, -0.08526767790317535, -0.12038008123636246, -0.18040025234222412, 0.21007469296455383, -0.1562613695859909, 0.09252933412790298, 0.25870823860168457, 0.10609877109527588, 0.08810141682624817, -0.1067926436662674, 0.15239940583705902, 0.1901794970035553, 0.22033393383026123, -0.003920905292034149, -0.41254502534866333, -0.0547974556684494, 0.22258901596069336, -0.13143794238567352, 0.20946669578552246, 0.01688477396965027, 0.08498507738113403, 0.057763561606407166, -0.0696859285235405, -0.452258437871933, 0.2736905515193939, 0.09095937013626099, -0.23024043440818787, 0.24943596124649048, 0.05113683640956879, 0.13223089277744293, 0.0642274022102356, 0.22773674130439758, 0.014194920659065247, -0.15919679403305054, -0.36947599053382874, -0.21431474387645721, 0.05538910627365112, 0.06411107629537582, 0.06614672392606735, 0.17040462791919708, -0.2459053099155426, -0.13269123435020447, -0.1964026391506195, -0.0965166687965393, 0.11566143482923508, -0.04175878316164017, -0.0023351525887846947, -0.008745033293962479, 0.05433844029903412, -0.28046178817749023, 0.26704031229019165, -0.011891327798366547, 0.1583993136882782, 0.04972758889198303, 0.13890546560287476, -0.3045825660228729, -0.0585985891520977, -0.006715369410812855, 0.05388795584440231, 0.20221640169620514, -0.08901221305131912, 0.2932175397872925, 0.0548279695212841, -0.16670534014701843, 0.22427013516426086, 0.46943578124046326, 0.3716886341571808, -0.16410210728645325, 0.32519984245300293, 0.20866411924362183, 0.29946279525756836, -0.332502543926239, 0.027959534898400307, 0.031187908723950386, 0.035772327333688736, 0.30698466300964355, 0.15944904088974, 0.17353253066539764, -0.1646827757358551, 0.15222716331481934, -0.06356349587440491, 0.24091240763664246, 0.14272695779800415, 0.3258797228336334, 0.28627389669418335, 0.10445459187030792, -0.03816036507487297, 0.012823308818042278, 0.0179950799793005, 0.267912358045578, 0.28579437732696533, -0.331038236618042, 0.11962845921516418, 0.07061203569173813, -0.05295820161700249, -0.06765275448560715, -0.3362651467323303, 0.12207116186618805, -0.04018528759479523, -0.2368721067905426, 0.09468547254800797, 0.1175190657377243, 0.6745263934135437, -0.3839992880821228, 0.037832651287317276, -0.10900512337684631, 0.38545098900794983, 0.12529008090496063, -0.3119085133075714, 0.11361265182495117, -0.07545894384384155, -0.23451730608940125, 0.0636492371559143, 0.03590288758277893, -0.22072742879390717, 0.1789293885231018, -0.13202571868896484, 0.1432013064622879, -0.1690681129693985, 0.11379573494195938, 0.189968079328537, 0.3017153739929199, -0.23328934609889984, -0.03199761360883713, 0.4509716033935547, -0.17905807495117188, 0.004991885274648666, 0.03907878324389458, 0.302541047334671, 0.0035860128700733185, 0.1371610462665558, -0.021672729402780533, -0.23600368201732635, -0.011461996473371983, -0.09965822100639343, -0.03522913530468941, 0.06390990316867828, 0.009416276589035988, 0.43400028347969055, 0.317590594291687, -0.23506711423397064, 0.3133411407470703, 0.0691099762916565, 0.09460990130901337, -0.5450379252433777, 0.0403282530605793, 0.13196969032287598, 0.04030048847198486, 0.05100681260228157, -0.0800974890589714, -0.5003822445869446, -0.28141769766807556, 0.1548924297094345, -0.15730325877666473, 0.22968143224716187, 0.00003208243288099766, 0.17148877680301666, 0.06490018218755722, 0.2986057996749878, -0.008239854127168655, 0.14130164682865143, -0.06286413967609406, -0.21048317849636078, -0.5520573258399963, -0.06893263012170792, -0.008215095847845078, -0.03529580682516098, -0.4314816892147064, 0.0391174852848053, 0.10466545820236206, 0.07356259226799011, -0.17064686119556427, -0.10060662776231766, 0.2605523467063904, 0.22693462669849396, -0.21063196659088135, 0.022205809131264687, 0.030951038002967834, 0.10495232790708542, 0.07323665916919708, -0.31542396545410156, 0.042414434254169464, 0.010767425410449505, 0.11630012840032578, -0.021755967289209366, 0.028454244136810303, -0.0734659880399704, -0.37359994649887085, 0.5263381004333496, 0.06336455047130585, 0.26848268508911133, -0.37592267990112305, 0.14445717632770538, 0.043850742280483246, 0.055659569799900055, -0.07376603037118912, 0.033087749034166336, 0.3003068268299103, 0.08847576379776001, -0.3698351979255676, 0.003566380590200424, 0.01110841240733862, 0.15524905920028687, 0.02596389502286911, -0.14002220332622528, -0.020125307142734528, 0.04026859253644943, -0.014988452196121216, -0.06977158784866333, -0.11257777363061905, 0.3600764274597168, -0.17568114399909973, -0.010437661781907082, 0.16615711152553558, -0.2933172285556793, 0.23445722460746765, -0.3556143343448639, -0.08295954018831253, 0.017970696091651917, 0.18965168297290802, -0.06339579075574875, 0.408000111579895, -0.11800171434879303, 0.01833111047744751, 0.357018381357193, 0.18130040168762207, -0.2150728404521942, 0.3705940842628479, -0.15697081387043, -0.15430043637752533, -0.18962062895298004, 0.18647685647010803, 0.28556111454963684, -0.32507359981536865, -0.013273961842060089, -0.44399333000183105 ]
https://github.com/huggingface/datasets/issues/3018
Support multiple zipped CSV data files
URL chaining sounds super nice to me! And it's also a nice way to leverage the same concepts we currently have in the docs around `fsspec` :)
As requested by @lewtun, support loading multiple zipped CSV data files. ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "train_filename.csv", "test": "test_filename.csv"} dataset = load_dataset("csv", data_dir=url, data_files=data_files) ```
27
Support multiple zipped CSV data files As requested by @lewtun, support loading multiple zipped CSV data files. ```python from datasets import load_dataset url = "https://domain.org/filename.zip" data_files = {"train": "train_filename.csv", "test": "test_filename.csv"} dataset = load_dataset("csv", data_dir=url, data_files=data_files) ``` URL chaining sounds super nice to me! And it's also a nice way to leverage the same concepts we currently have in the docs around `fsspec` :)
[ -0.21574154496192932, -0.16426095366477966, -0.2551282048225403, -0.12608523666858673, 0.14161860942840576, -0.034590113908052444, 0.26529502868652344, 0.25139865279197693, 0.2857457995414734, 0.27834904193878174, -0.05897706747055054, 0.05548643320798874, 0.06691203266382217, 0.7944067120552063, -0.0695708692073822, 0.09967304766178131, 0.13154929876327515, 0.03560544550418854, -0.3957929313182831, 0.21550767123699188, -0.27898144721984863, 0.1462830901145935, -0.1596728414297104, -0.2834046483039856, 0.0354686975479126, 0.2469329982995987, -0.38672634959220886, 0.2361738681793213, -0.11876576393842697, -0.4162020683288574, 0.36888670921325684, 0.3585108816623688, 0.09337753057479858, 0.23473185300827026, -0.00009808076720219105, -0.09453336894512177, 0.01604379341006279, -0.03523385152220726, -0.18285858631134033, -0.21790550649166107, -0.10814150422811508, -0.4635157883167267, 0.03173693269491196, -0.2648179233074188, -0.05044900253415108, -0.203447625041008, 0.22888261079788208, -0.3065231442451477, 0.5155298709869385, 0.27221810817718506, 0.31277763843536377, -0.02485959231853485, -0.20821554958820343, -0.19848935306072235, 0.1797330379486084, -0.04884457588195801, -0.04899805784225464, -0.1329624205827713, 0.06967461109161377, -0.34057578444480896, -0.030309103429317474, -0.02054467611014843, -0.01212712936103344, 0.13217681646347046, 0.21497493982315063, 0.016210433095693588, -0.007965430617332458, -0.2031976580619812, -0.22861185669898987, -0.02179960161447525, 0.3442907929420471, -0.09391654282808304, -0.40078791975975037, -0.15332093834877014, -0.1404774785041809, -0.20542369782924652, -0.03944476693868637, 0.12867693603038788, 0.027152638882398605, 0.14282631874084473, 0.05360005050897598, 0.008475118316709995, -0.1783859133720398, 0.08937842398881912, -0.09280438721179962, 0.17402809858322144, -0.17402000725269318, 0.09210629016160965, 0.3015057146549225, -0.0435771718621254, -0.03076351061463356, -0.09219318628311157, 0.27628859877586365, 0.12548743188381195, -0.3249480426311493, -0.1768932193517685, 0.15374822914600372, -0.2983546257019043, 0.17026638984680176, 0.32955843210220337, 0.14994041621685028, -0.021393008530139923, -0.10389521718025208, 0.17527082562446594, 0.24173392355442047, -0.035351067781448364, -0.02021169662475586, -0.09263786673545837, 0.27763646841049194, -0.006134157534688711, -0.0037256553769111633, -0.12333265691995621, -0.01675570383667946, -0.2298647165298462, -0.37681370973587036, 0.16095265746116638, 0.0012653172016143799, 0.08509953320026398, -0.17152191698551178, -0.00034544989466667175, 0.26520615816116333, -0.2182272970676422, -0.1445247232913971, 0.3320530354976654, -0.183578222990036, 0.5021543502807617, -0.07779639959335327, 0.08370667695999146, -0.0339619405567646, -0.00779238436371088, -0.13279031217098236, 0.10787199437618256, -0.3132190704345703, 0.09649642556905746, 0.2124573439359665, -0.019806500524282455, 0.0747847855091095, 0.05582762509584427, 0.11878618597984314, -0.04747956246137619, 0.10434918850660324, -0.015301801264286041, 0.11251895129680634, 0.20895832777023315, 0.15100671350955963, -0.0021079685539007187, 0.09730291366577148, -0.06740593910217285, -0.22666388750076294, 0.03840812295675278, -0.49483639001846313, -0.14444121718406677, 0.00915263406932354, 0.27526795864105225, -0.056733451783657074, -0.1325119137763977, -0.24987143278121948, 0.20600299537181854, -0.26393836736679077, -0.17244766652584076, -0.09981214255094528, 0.052681680768728256, -0.3640330135822296, -0.2438753992319107, -0.008063829503953457, 0.4704189896583557, -0.11582061648368835, -0.04916802793741226, 0.011215317994356155, -0.10406573116779327, -0.13627472519874573, 0.14894738793373108, -0.1779744029045105, -0.07638075202703476, -0.24728766083717346, 0.22692354023456573, 0.35291996598243713, -0.5110204815864563, -0.089820995926857, 0.561873197555542, 0.09461966156959534, 0.0262689758092165, 0.3620939254760742, -0.14198097586631775, 0.16463033854961395, -0.048069875687360764, 0.05581892281770706, 0.39493799209594727, 0.009122950956225395, 0.12709306180477142, -0.050040241330862045, -0.4293939471244812, 0.19446776807308197, 0.20606949925422668, -0.043204840272665024, 0.015520423650741577, 0.09424491971731186, -0.5977075099945068, 0.4833746552467346, -0.2354206144809723, -0.05388478934764862, -0.053725361824035645, 0.11259160935878754, 0.18866311013698578, -0.08711360394954681, -0.197013258934021, -0.39706453680992126, 0.1463342010974884, -0.1394943743944168, -0.14962653815746307, 0.02566342055797577, -0.30652618408203125, -0.1116737648844719, -0.03153689578175545, -0.10812345147132874, -0.11355611681938171, 0.22050967812538147, 0.21333250403404236, -0.09014619886875153, -0.1916045844554901, -0.28236785531044006, 0.220455601811409, 0.16190025210380554, 0.09838041663169861, -0.11962589621543884, 0.3327171206474304, 0.08228988200426102, 0.17917561531066895, 0.16493168473243713, 0.16629812121391296, 0.21243372559547424, -0.25595203042030334, 0.1811179518699646, 0.43267878890037537, 0.36937230825424194, -0.024731077253818512, 0.3216705918312073, 0.2530791163444519, 0.12434510886669159, -0.09704914689064026, -0.12934042513370514, 0.22105097770690918, -0.00047504762187600136, 0.015989869832992554, -0.3453483581542969, 0.5397232174873352, -0.13640311360359192, 0.16192521154880524, 0.22545675933361053, 0.06522707641124725, 0.3308142125606537, -0.2609620988368988, -0.2954789698123932, 0.0022279098629951477, 0.03950240835547447, 0.3374919295310974, 0.10943612456321716, 0.06400035321712494, -0.1317661702632904, 0.10060305148363113, 0.06270063668489456, -0.12991976737976074, -0.24013668298721313, 0.19261109828948975, 0.03466994687914848, -0.08492596447467804, 0.19491398334503174, 0.3218878507614136, 0.4343252182006836, 0.39898356795310974, -0.07127727568149567, -0.03414127230644226, -0.02778371050953865, -0.1839132010936737, 0.2907155156135559, -0.19373606145381927, -0.03759494423866272, 0.15984855592250824, 0.07258014380931854, -0.07452419400215149, -0.31083810329437256, -0.2874618470668793, 0.11633867770433426, -0.14576353132724762, -0.12535075843334198, 0.14499051868915558, -0.2655477225780487, -0.37749314308166504, -0.22703811526298523, 0.19961728155612946, 0.14142443239688873, -0.19381140172481537, -0.005635790526866913, 0.29089754819869995, -0.3346063494682312, 0.05732324719429016, -0.12380760908126831, 0.4895161986351013, 0.013413714244961739, -0.1013067439198494, 0.07953450083732605, 0.09315840154886246, 0.11220822483301163, 0.23714414238929749, 0.3086268901824951, -0.06334619224071503, 0.24045604467391968, 0.2850184440612793, 0.038770705461502075, -0.39971616864204407, -0.04442942887544632, 0.062362052500247955, 0.10507818311452866, 0.17423191666603088, 0.11773568391799927, 0.05506310611963272, 0.3674740195274353, -0.17673978209495544, 0.07253319770097733, -0.007001088932156563, 0.03639332205057144, -0.1584513932466507, 0.18980273604393005, -0.13015636801719666, -0.2549799978733063, -0.3965543210506439, -0.33326661586761475, -0.2602420747280121, 0.38562798500061035, -0.1999126672744751, 0.21208612620830536, 0.08627845346927643, 0.08634866774082184, -0.17356139421463013, 0.06577441841363907, -0.20499788224697113, -0.1973900943994522, -0.43865934014320374, 0.33723151683807373, -0.3546918034553528, -0.3027248978614807, -0.05989885330200195, -0.011783421970903873, -0.07912544906139374, -0.03888522461056709, -0.20889326930046082, -0.1570747345685959, -0.26691940426826477, 0.22845035791397095, -0.12153603136539459, 0.13558745384216309, 0.354852557182312, 0.08634632080793381, -0.3350387215614319, -0.059675611555576324, -0.03222716972231865, 0.08635306358337402, 0.05328298732638359, 0.015309728682041168, -0.014719672501087189, -0.05974036455154419, 0.12141016125679016, 0.5251371264457703, 0.3025651276111603, 0.28987789154052734, 0.43038904666900635, -0.17266947031021118, 0.11587437987327576, 0.14960870146751404, -0.30786004662513733, 0.016198812052607536, -0.3823150098323822, -0.02180408500134945, 0.4027807116508484, 0.09896368533372879, 0.02170363999903202, -0.19781102240085602, 0.20153750479221344, -0.2537323832511902, -0.2165193408727646, 0.15090498328208923, -0.11008156836032867, 0.1336294710636139, -0.054991867393255234, -0.21628069877624512, -0.04997130110859871, 0.2182328701019287, -0.10096919536590576, 0.16547875106334686, 0.20902250707149506, -0.2402198761701584, -0.04526283219456673, -0.048340365290641785, -0.4167111814022064, 0.2869713008403778, 0.2287326604127884, -0.16157065331935883, 0.1597614586353302, -0.110231913626194, -0.11325235664844513, -0.18713276088237762, 0.8276088833808899, -0.1146201565861702, -0.026852354407310486, 0.10285277664661407, -0.12147271633148193, -0.20613114535808563, -0.05964784324169159, -0.002705618739128113, -0.07051151990890503, -0.021719615906476974, 0.32108038663864136, -0.15454596281051636, -0.2653874456882477, 0.027888745069503784, -0.0736728236079216, -0.12415564060211182, -0.2255796641111374, -0.06956185400485992, 0.03138519078493118, -0.1164890006184578, -0.1660321056842804, 0.04101607948541641, 0.066007599234581, -0.20635202527046204, -0.24698881804943085, 0.03638746589422226, -0.364533931016922, 0.2148512899875641, -0.07745715975761414, -0.07659196853637695, 0.20248138904571533, -0.023982850834727287, 0.032317642122507095, 0.2278095781803131, 0.0805511400103569, 0.5133695006370544, -0.2256489396095276, -0.3884093463420868, -0.02290455251932144, 0.08903302252292633, 0.2703250050544739, 0.17719009518623352, -0.10030896961688995, 0.2377268373966217, -0.17007291316986084, 0.21789555251598358, -0.38930121064186096, 0.21325461566448212, 0.3826071619987488, -0.04158381372690201, -0.13987398147583008, -0.5144093632698059, 0.49476906657218933, 0.037294842302799225, -0.10976209491491318, 0.31844931840896606, -0.1817767471075058, -0.1623961627483368, 0.26708799600601196, -0.2946739196777344, 0.6357083916664124, -0.07997924089431763, 0.32957524061203003, 0.0764724463224411, -0.07013096660375595, 0.2079945057630539, -0.5114866495132446, -0.023945990949869156, -0.09439907968044281, -0.13757076859474182, -0.12797488272190094, 0.03403512015938759, 0.3589833974838257, 0.2372589260339737, -0.3464072346687317, 0.33990946412086487, 0.23189817368984222, -0.10060183703899384, -0.029245221987366676, 0.2875198423862457, 0.0034055961295962334, -0.214620441198349, -0.37800028920173645, 0.3154739439487457, 0.23202356696128845, -0.14117690920829773, -0.006074567791074514, -0.19419366121292114, 0.23995408415794373, -0.1212172582745552, -0.1338566243648529, 0.1308203935623169, -0.14397196471691132, 0.18037496507167816, -0.15863120555877686, 0.1611524075269699, -0.1386467069387436, 0.2057940810918808, -0.13842721283435822, -0.12665024399757385, -0.21235018968582153, 0.024068418890237808, -0.12655586004257202, 0.10840274393558502, -0.4173720180988312, -0.31407997012138367, 0.22953318059444427, -0.052733585238456726, -0.112460196018219, 0.15114334225654602, 0.025085866451263428, -0.44549793004989624, 0.23022854328155518, 0.282633900642395, 0.21842961013317108, -0.360818088054657, 0.02163822203874588, 0.16601437330245972, -0.08606996387243271, -0.2310129553079605, 0.22465099394321442, -0.0165509432554245, -0.021959535777568817, 0.18417033553123474, 0.020685940980911255, -0.06497339904308319, -0.10398893058300018, 0.3144083321094513, -0.1057688519358635, 0.00023029372096061707, 0.011845234781503677, -0.0933472067117691, -0.07404902577400208, -0.2816590666770935, 0.28011175990104675, -0.17163757979869843, 0.12438102811574936, 0.21100828051567078, 0.02791903354227543, -0.057661786675453186, -0.029874395579099655, 0.6145710349082947, 0.18222607672214508, 0.16937342286109924, 0.05908385291695595, -0.2602871060371399, 0.08993905782699585, 0.042093683034181595, -0.03492778167128563, 0.25761520862579346, 0.10397743433713913, 0.36505359411239624, -0.014398302882909775, -0.048192404210567474, -0.4659029543399811, 0.22765454649925232, 0.0753202885389328, -0.09046541154384613, 0.24505138397216797, 0.019490564242005348, 0.16858968138694763, -0.00863274559378624, 0.26518571376800537, 0.06975260376930237, -0.15597257018089294, -0.4086107611656189, -0.2945184111595154, 0.060013093054294586, 0.1640687882900238, 0.029448052868247032, 0.1009262427687645, -0.048538289964199066, -0.09259100258350372, -0.26909151673316956, -0.1508675217628479, 0.13269761204719543, -0.09654653072357178, 0.13445888459682465, -0.08109824359416962, -0.028277583420276642, -0.13496530055999756, 0.1697562336921692, 0.06601011753082275, 0.31435173749923706, 0.1553710252046585, 0.0897495374083519, -0.3922692835330963, -0.06615706533193588, 0.02364262007176876, 0.15694531798362732, 0.2902901768684387, 0.01771937683224678, 0.09278426319360733, 0.00139545276761055, -0.28685426712036133, 0.1541014313697815, 0.48164960741996765, 0.4245690405368805, -0.24768857657909393, 0.3051094710826874, 0.17650309205055237, 0.33466458320617676, -0.2970127761363983, -0.004038078244775534, -0.09603379666805267, 0.03606095910072327, 0.3065550923347473, 0.12320337444543839, 0.15595410764217377, -0.09375016391277313, 0.36094921827316284, 0.006621699780225754, -0.056715015321969986, 0.24251577258110046, 0.3754691481590271, -0.02203044667840004, 0.10230685770511627, 0.028154874220490456, 0.037160474807024, -0.15141242742538452, 0.2065563201904297, 0.30073606967926025, -0.11529286950826645, 0.1067388728260994, -0.12573304772377014, 0.10934697091579437, -0.17091435194015503, -0.3548569977283478, 0.3118549883365631, -0.14618554711341858, -0.19505932927131653, 0.16075260937213898, 0.14154767990112305, 0.7088832259178162, -0.3581688702106476, -0.23028813302516937, -0.23728643357753754, 0.3376352787017822, 0.12309665977954865, -0.39480602741241455, 0.16864745318889618, -0.017390526831150055, -0.22427037358283997, 0.16208131611347198, 0.0024497434496879578, -0.2023298591375351, 0.4761190414428711, -0.06936980783939362, 0.15774618089199066, -0.17525526881217957, 0.06037820875644684, 0.10981500148773193, 0.4184522330760956, -0.20301459729671478, 0.041267696768045425, 0.24588720500469208, -0.1641799658536911, 0.1169133335351944, -0.01184087060391903, 0.2944754660129547, 0.05307156220078468, 0.08633105456829071, -0.07455292344093323, -0.2570761442184448, 0.01942267082631588, -0.05744967237114906, -0.10883823037147522, -0.04325366020202637, 0.06949562579393387, 0.49190565943717957, 0.3221948444843292, -0.2805757224559784, 0.2374967485666275, -0.0051581971347332, -0.01728801429271698, -0.6208219528198242, 0.032024189829826355, 0.28174087405204773, 0.20368611812591553, -0.08997739106416702, -0.003733210265636444, -0.6412091851234436, -0.24767912924289703, 0.12045273184776306, -0.16663417220115662, 0.27080291509628296, 0.06514744460582733, 0.17472076416015625, 0.13846513628959656, 0.33416691422462463, -0.023022297769784927, 0.22622951865196228, -0.21315668523311615, -0.30239248275756836, -0.5262435674667358, -0.09661998599767685, 0.03252521529793739, 0.0700763612985611, -0.32811659574508667, 0.18673434853553772, 0.08279149979352951, 0.09067633002996445, -0.053141579031944275, -0.19811226427555084, 0.2772861421108246, 0.24114666879177094, -0.20566323399543762, 0.03019474446773529, -0.06558963656425476, 0.19067421555519104, 0.19357234239578247, -0.32560572028160095, 0.04756004363298416, 0.030512366443872452, 0.15521234273910522, 0.006287556141614914, -0.11888179928064346, -0.0763905867934227, -0.5364553928375244, 0.5572024583816528, -0.10566483438014984, 0.398832231760025, -0.4390983581542969, 0.042567938566207886, -0.01177084818482399, -0.016460014507174492, 0.0006797369569540024, -0.1906467080116272, 0.08412615954875946, 0.10561476647853851, -0.2900914251804352, 0.1771012246608734, -0.0422576367855072, 0.06193036586046219, 0.158406063914299, -0.1882435381412506, -0.10558642446994781, 0.13540776073932648, 0.037823714315891266, -0.08705662935972214, -0.3375324606895447, 0.3985273540019989, -0.2461203634738922, 0.014538684859871864, 0.17311374843120575, -0.1958886981010437, 0.3663681745529175, -0.21345406770706177, -0.08433271944522858, -0.09188270568847656, 0.26784735918045044, -0.1417403519153595, 0.34502851963043213, -0.19375017285346985, 0.023117952048778534, 0.22158941626548767, 0.2877822518348694, -0.2734282314777374, 0.5126168131828308, -0.29935941100120544, -0.27849796414375305, -0.22497820854187012, 0.5064927339553833, 0.2685045301914215, -0.21366330981254578, 0.04171266779303551, -0.5304153561592102 ]
https://github.com/huggingface/datasets/issues/3013
Improve `get_dataset_infos`?
To keeps things simple maybe we should use `load_dataset_builder` in `get_dataset_infos`. `load_dataset_builder` instantiates a builder and runs the _infos() method in order to give you the most up-to-date infos, even if the dataset_infos.json is outdated or missing.
Using the dedicated function `get_dataset_infos` on a dataset that has no dataset-info.json file returns an empty info: ``` >>> from datasets import get_dataset_infos >>> get_dataset_infos('wit') {} ``` While it's totally possible to get it (regenerate it) with: ``` >>> from datasets import load_dataset_builder >>> builder = load_dataset_builder('wit') >>> builder.info DatasetInfo(description='Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual dataset. WIT is composed of a curated set\n of 37.6 million entity rich image-text examples with 11.5 million unique images across 108 Wikipedia languages. Its\n size enables WIT to be used as a pretraining dataset for multimodal machine learning models.\n', citation='@article{srinivasan2021wit,\n title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},\n author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},\n journal={arXiv preprint arXiv:2103.01913},\n year={2021}\n}\n', homepage='https://github.com/google-research-datasets/wit', license='', features={'b64_bytes': Value(dtype='string', id=None), 'embedding': Sequence(feature=Value(dtype='float64', id=None), length=-1, id=None), 'image_url': Value(dtype='string', id=None), 'metadata_url': Value(dtype='string', id=None), 'original_height': Value(dtype='int32', id=None), 'original_width': Value(dtype='int32', id=None), 'mime_type': Value(dtype='string', id=None), 'caption_attribution_description': Value(dtype='string', id=None), 'wit_features': Sequence(feature={'language': Value(dtype='string', id=None), 'page_url': Value(dtype='string', id=None), 'attribution_passes_lang_id': Value(dtype='string', id=None), 'caption_alt_text_description': Value(dtype='string', id=None), 'caption_reference_description': Value(dtype='string', id=None), 'caption_title_and_reference_description': Value(dtype='string', id=None), 'context_page_description': Value(dtype='string', id=None), 'context_section_description': Value(dtype='string', id=None), 'hierarchical_section_title': Value(dtype='string', id=None), 'is_main_image': Value(dtype='string', id=None), 'page_changed_recently': Value(dtype='string', id=None), 'page_title': Value(dtype='string', id=None), 'section_title': Value(dtype='string', id=None)}, length=-1, id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name='wit', config_name='default', version=0.0.0, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None) ``` Should we test if info is empty, and in that case regenerate it? Or always generate it?
37
Improve `get_dataset_infos`? Using the dedicated function `get_dataset_infos` on a dataset that has no dataset-info.json file returns an empty info: ``` >>> from datasets import get_dataset_infos >>> get_dataset_infos('wit') {} ``` While it's totally possible to get it (regenerate it) with: ``` >>> from datasets import load_dataset_builder >>> builder = load_dataset_builder('wit') >>> builder.info DatasetInfo(description='Wikipedia-based Image Text (WIT) Dataset is a large multimodal multilingual dataset. WIT is composed of a curated set\n of 37.6 million entity rich image-text examples with 11.5 million unique images across 108 Wikipedia languages. Its\n size enables WIT to be used as a pretraining dataset for multimodal machine learning models.\n', citation='@article{srinivasan2021wit,\n title={WIT: Wikipedia-based Image Text Dataset for Multimodal Multilingual Machine Learning},\n author={Srinivasan, Krishna and Raman, Karthik and Chen, Jiecao and Bendersky, Michael and Najork, Marc},\n journal={arXiv preprint arXiv:2103.01913},\n year={2021}\n}\n', homepage='https://github.com/google-research-datasets/wit', license='', features={'b64_bytes': Value(dtype='string', id=None), 'embedding': Sequence(feature=Value(dtype='float64', id=None), length=-1, id=None), 'image_url': Value(dtype='string', id=None), 'metadata_url': Value(dtype='string', id=None), 'original_height': Value(dtype='int32', id=None), 'original_width': Value(dtype='int32', id=None), 'mime_type': Value(dtype='string', id=None), 'caption_attribution_description': Value(dtype='string', id=None), 'wit_features': Sequence(feature={'language': Value(dtype='string', id=None), 'page_url': Value(dtype='string', id=None), 'attribution_passes_lang_id': Value(dtype='string', id=None), 'caption_alt_text_description': Value(dtype='string', id=None), 'caption_reference_description': Value(dtype='string', id=None), 'caption_title_and_reference_description': Value(dtype='string', id=None), 'context_page_description': Value(dtype='string', id=None), 'context_section_description': Value(dtype='string', id=None), 'hierarchical_section_title': Value(dtype='string', id=None), 'is_main_image': Value(dtype='string', id=None), 'page_changed_recently': Value(dtype='string', id=None), 'page_title': Value(dtype='string', id=None), 'section_title': Value(dtype='string', id=None)}, length=-1, id=None)}, post_processed=None, supervised_keys=None, task_templates=None, builder_name='wit', config_name='default', version=0.0.0, splits=None, download_checksums=None, download_size=None, post_processing_size=None, dataset_size=None, size_in_bytes=None) ``` Should we test if info is empty, and in that case regenerate it? Or always generate it? To keeps things simple maybe we should use `load_dataset_builder` in `get_dataset_infos`. `load_dataset_builder` instantiates a builder and runs the _infos() method in order to give you the most up-to-date infos, even if the dataset_infos.json is outdated or missing.
[ -0.03345417231321335, 0.20615550875663757, -0.17455936968326569, 0.31409624218940735, 0.27583783864974976, -0.05295097827911377, 0.17135600745677948, 0.5251322984695435, -0.06918732821941376, 0.17565122246742249, 0.0600980743765831, 0.22919747233390808, 0.06210097298026085, 0.10812398046255112, -0.06533676385879517, 0.12993088364601135, -0.21710205078125, 0.29510268568992615, 0.16271337866783142, -0.39375215768814087, -0.18675750494003296, -0.05631417781114578, -0.2302013784646988, -0.32134169340133667, -0.3358129858970642, 0.153682142496109, -0.11947285383939743, 0.14979110658168793, -0.14945006370544434, -0.19493548572063446, 0.08070176839828491, -0.0780499130487442, -0.14890679717063904, 0.1531967967748642, -0.00010389175440650433, 0.05245687812566757, 0.5534232258796692, -0.17779523134231567, -0.34180474281311035, -0.15670885145664215, -0.32453978061676025, -0.58543860912323, -0.14910325407981873, -0.48918241262435913, -0.17600828409194946, -0.2954668700695038, 0.03804923966526985, -0.14071062207221985, 0.16585078835487366, 0.31370601058006287, 0.25656431913375854, -0.08707012236118317, 0.09326188266277313, 0.07697900384664536, 0.1724294126033783, 0.40633708238601685, -0.15180563926696777, -0.26642993092536926, -0.07684096693992615, -0.0628427118062973, 0.12233736366033554, 0.6122496128082275, -0.22476552426815033, -0.04940016195178032, 0.14356163144111633, 0.0622970312833786, -0.13736844062805176, -0.25646302103996277, 0.34536975622177124, 0.271297425031662, 0.7522833943367004, -0.0253584161400795, -0.29785391688346863, -0.33843499422073364, 0.20183666050434113, 0.05962684005498886, 0.08892575651407242, 0.17347772419452667, -0.06378091871738434, 0.11028282344341278, -0.2851334810256958, -0.23049692809581757, -0.1781085580587387, 0.08969332277774811, -0.1758011430501938, 0.3796132206916809, 0.0320524238049984, 0.04000537097454071, -0.18050982058048248, -0.2603100538253784, 0.06412859261035919, -0.3207339644432068, -0.3087480962276459, 0.1897551566362381, -0.06817181408405304, -0.08199187368154526, 0.41341716051101685, -0.12743306159973145, 0.17847022414207458, 0.11004701256752014, -0.1594197005033493, 0.16574978828430176, -0.34435802698135376, -0.10884831100702286, 0.24116066098213196, -0.19684384763240814, 0.19181931018829346, 0.01677393540740013, 0.2059238851070404, -0.013621503487229347, -0.04833013564348221, -0.12389711290597916, 0.11521134525537491, 0.18593581020832062, 0.01627432182431221, -0.050628215074539185, 0.35651588439941406, -0.00021659955382347107, 0.011870959773659706, 0.20507586002349854, -0.3223838806152344, -0.02336983010172844, -0.07701802253723145, 0.22447791695594788, -0.2602084279060364, 0.3806169927120209, 0.18862715363502502, -0.2091173678636551, -0.0791546180844307, -0.2555488646030426, -0.2285606861114502, 0.04061504453420639, 0.008559633046388626, -0.05283581465482712, 0.2444271594285965, 0.31015700101852417, 0.3834150433540344, -0.06018173694610596, -0.1776164323091507, 0.047982797026634216, 0.1572519838809967, -0.036268312484025955, 0.2999792993068695, 0.35530585050582886, 0.14662781357765198, 0.27699893712997437, -0.01988210529088974, -0.2852190434932709, 0.05634254962205887, 0.15216511487960815, -0.34048911929130554, -0.2834468483924866, -0.44255441427230835, 0.2581709623336792, -0.31846070289611816, 0.26893728971481323, -0.008411489427089691, 0.5213382840156555, -0.23929160833358765, -0.10499879717826843, 0.030391067266464233, 0.15734165906906128, -0.1347370147705078, -0.1958782970905304, 0.4010683596134186, 0.49553626775741577, -0.27263206243515015, 0.08635307848453522, -0.1794569045305252, -0.0366973839700222, -0.05354567617177963, -0.11843863129615784, -0.1413104385137558, 0.4051978588104248, -0.0547599121928215, -0.006090149283409119, 0.41164612770080566, -0.21449781954288483, -0.3026268482208252, 0.20574603974819183, 0.19204117357730865, 0.2037702053785324, 0.004524484276771545, 0.1405544877052307, -0.04068727791309357, 0.3160434067249298, -0.0006625652313232422, 0.31901270151138306, 0.003484107553958893, 0.08487968146800995, -0.17851433157920837, -0.11584880948066711, 0.01722399704158306, 0.12320689857006073, 0.1329961121082306, -0.020497024059295654, 0.10225272178649902, 0.2846868336200714, 0.4099697172641754, -0.22494608163833618, 0.07212673127651215, 0.38861775398254395, 0.2679019868373871, -0.011716842651367188, 0.07858283817768097, -0.129399374127388, -0.6393070816993713, 0.25915804505348206, 0.207956925034523, 0.2568538784980774, -0.4003848433494568, -0.2732285261154175, 0.12954041361808777, -0.013379668816924095, 0.056356463581323624, -0.3491613566875458, 0.2960684597492218, 0.12832483649253845, 0.23543673753738403, 0.15950138866901398, 0.05414045229554176, 0.11024508625268936, -0.23608370125293732, -0.06760425120592117, -0.40717968344688416, 0.32692888379096985, 0.19472357630729675, 0.0377085916697979, 0.09281264245510101, 0.059997864067554474, 0.08969567716121674, 0.1459406316280365, -0.024964280426502228, 0.16512073576450348, 0.1401596963405609, 0.10332036018371582, 0.11147783696651459, 0.16746631264686584, 0.12476462125778198, -0.09772597253322601, -0.0412236750125885, 0.05128229036927223, 0.24739989638328552, -0.14525851607322693, -0.38473767042160034, 0.24399933218955994, 0.20471525192260742, 0.28363341093063354, -0.01710408553481102, 0.07759765535593033, 0.24082842469215393, 0.004943031817674637, -0.07064466178417206, -0.16571426391601562, -0.28950372338294983, 0.25002723932266235, -0.14245344698429108, 0.08837807178497314, -0.27197006344795227, 0.265103816986084, 0.6384277939796448, 0.08028070628643036, -0.031769901514053345, -0.10186406224966049, -0.18432527780532837, -0.26386740803718567, 0.34131065011024475, -0.10867827385663986, 0.13122254610061646, 0.27732565999031067, -0.15686292946338654, 0.05641373619437218, 0.23439623415470123, 0.03101862594485283, 0.273431658744812, 0.11704142391681671, 0.16363857686519623, 0.12284454703330994, 0.12489726394414902, 0.0004229312762618065, -0.10737289488315582, -0.25319287180900574, -0.02256632409989834, 0.4294435679912567, -0.12447452545166016, -0.24745550751686096, -0.35528236627578735, -0.2883387804031372, 0.19375577569007874, 0.12982779741287231, -0.16369256377220154, -0.3487307131290436, -0.1259528547525406, -0.0782926082611084, -0.22521640360355377, 0.1918266862630844, -0.03446299955248833, -0.008953198790550232, 0.2262830287218094, -0.33195462822914124, -0.25811469554901123, -0.23399154841899872, -0.011037763208150864, 0.15959042310714722, 0.021610908210277557, 0.3327694535255432, 0.07189597189426422, -0.1803659200668335, 0.001498442143201828, -0.5359104871749878, -0.3476378619670868, 0.22148959338665009, -0.2525467276573181, 0.16430267691612244, 0.19653117656707764, 0.3480837941169739, -0.05223378539085388, 0.10196942836046219, 0.1464666873216629, 0.054900988936424255, -0.09400312602519989, -0.041460633277893066, -0.017769332975149155, 0.00839588139206171, -0.26119187474250793, -0.4069514870643616, -0.0017971750348806381, -0.2890121042728424, 0.14435157179832458, 0.12852974236011505, 0.17032703757286072, 0.2320341169834137, 0.37529030442237854, 0.11710386723279953, 0.0706070140004158, 0.056245096027851105, -0.26348876953125, -0.235556960105896, 0.4781815707683563, -0.044419270008802414, -0.23522205650806427, 0.09024098515510559, -0.09038251638412476, 0.11496962606906891, 0.0934409350156784, -0.6104689240455627, -0.14913897216320038, -0.08977000415325165, 0.32340967655181885, -0.10871395468711853, 0.22581088542938232, 0.3890785872936249, -0.0003676312044262886, -0.12418564409017563, -0.1488194763660431, -0.21236564218997955, -0.15089958906173706, -0.2982988953590393, 0.11656267940998077, 0.10736075788736343, 0.20042547583580017, 0.01816762238740921, 0.33997488021850586, -0.13757771253585815, 0.009161006659269333, -0.07079078257083893, -0.16926003992557526, 0.6448238492012024, -0.04412936419248581, -0.21971732378005981, 0.18825934827327728, 0.31725752353668213, -0.004635974764823914, 0.1685469150543213, -0.025867953896522522, -0.12087709456682205, -0.26516056060791016, -0.10461804270744324, -0.34764477610588074, -0.22248996794223785, 0.19761225581169128, 0.11327225714921951, 0.07892285287380219, 0.19175057113170624, 0.42153799533843994, -0.15553319454193115, 0.04427872598171234, 0.013998912647366524, 0.07903975248336792, 0.15711504220962524, -0.1582690328359604, -0.27752459049224854, -0.007643404416739941, -0.2506113350391388, 0.2671301066875458, 0.12567363679409027, -0.15139642357826233, 0.2815271019935608, -0.03327295556664467, -0.08621478080749512, -0.09443078190088272, 0.15850242972373962, -0.5256463289260864, -0.12957225739955902, 0.3798460364341736, 0.005671467632055283, -0.21105055510997772, 0.0823405385017395, -0.2583542764186859, 0.17249418795108795, 0.1550828069448471, 0.418150931596756, -0.31972789764404297, -0.17367957532405853, 0.346336305141449, 0.1565956473350525, -0.2220410704612732, 0.002112981863319874, -0.033729955554008484, -0.3751039505004883, -0.16425088047981262, -0.12002425640821457, -0.08042127639055252, 0.20065602660179138, 0.22472664713859558, 0.16700012981891632, -0.22019004821777344, 0.16512641310691833, 0.11805760860443115, 0.19808904826641083, 0.18634659051895142, 0.2593143582344055, 0.2087923139333725, 0.05350762605667114, 0.06927623599767685, 0.1103328987956047, 0.5257445573806763, 0.02445283532142639, -0.36602362990379333, -0.15598538517951965, -0.12202485650777817, 0.30456918478012085, 0.2902487516403198, 0.0017757988534867764, -0.06678693741559982, -0.04931601881980896, 0.018737521022558212, -0.24575918912887573, 0.07322800159454346, 0.30713871121406555, -0.1096046194434166, -0.31708410382270813, -0.6070477366447449, 0.32201701402664185, -0.15288874506950378, -0.014626383781433105, 0.1894509494304657, 0.08851522952318192, -0.3403915762901306, 0.1755671501159668, 0.04364710673689842, 0.7371026277542114, 0.4090843200683594, 0.0036351531744003296, 0.22471579909324646, 0.1937437355518341, 0.6895455121994019, -0.3098903298377991, -0.06562724709510803, -0.23744136095046997, -0.05845997482538223, 0.07351691275835037, 0.24666979908943176, 0.011822178959846497, 0.1552298665046692, 0.0813746452331543, 0.13004477322101593, 0.1615358293056488, 0.326173335313797, 0.06096848100423813, 0.5653749108314514, 0.06356092542409897, -0.399597704410553, -0.3466210961341858, 0.2225058376789093, -0.08876711130142212, -0.10031093657016754, 0.06950320303440094, -0.2158394753932953, -0.0379599966108799, -0.15746727585792542, -0.39153003692626953, 0.10365208238363266, -0.24088090658187866, 0.07655796408653259, -0.048492398113012314, -0.3178062438964844, -0.12567147612571716, 0.013803485780954361, -0.01645985245704651, 0.6363005042076111, -0.3294845521450043, 0.33321458101272583, -0.14072972536087036, 0.016247546300292015, 0.0765630304813385, -0.08151624351739883, 0.30101528763771057, 0.09719211608171463, -0.35329481959342957, 0.13807834684848785, -0.20398740470409393, -0.13368111848831177, -0.137232705950737, -0.07844816148281097, 0.024170447140932083, 0.0023223417811095715, -0.17364062368869781, 0.4307467043399811, 0.003908101469278336, -0.1647936999797821, 0.22367776930332184, 0.09640541672706604, -0.03756948933005333, 0.18130257725715637, 0.05403974652290344, -0.30114832520484924, -0.20066353678703308, 0.3285175859928131, 0.30307531356811523, -0.05671481415629387, 0.2507152557373047, 0.06461262702941895, -0.14129126071929932, -0.2983669638633728, 0.21521103382110596, 0.11154313385486603, 0.006462119519710541, -0.004984349012374878, 0.23143263161182404, 0.18853436410427094, -0.25118643045425415, 0.01748054474592209, -0.19895952939987183, -0.12312576919794083, -0.008698828518390656, -0.1742151975631714, 0.028106754645705223, 0.494931161403656, -0.12674017250537872, 0.18498049676418304, 0.01816963031888008, -0.025446511805057526, -0.009057307615876198, -0.13277505338191986, -0.4332481920719147, 0.005490549374371767, 0.11816319078207016, 0.10809165984392166, 0.10919792950153351, 0.11861622333526611, 0.21748141944408417, -0.1972547471523285, 0.2362440526485443, 0.04712992161512375, 0.10449837148189545, -0.3284594416618347, -0.18384218215942383, 0.09722741693258286, 0.04820535331964493, 0.09778960049152374, 0.13890019059181213, -0.2706076502799988, -0.2120962291955948, -0.32074519991874695, 0.16104552149772644, 0.10384342819452286, 0.040516603738069534, 0.40716224908828735, -0.20769883692264557, 0.2542050778865814, -0.1979324370622635, 0.1797419786453247, -0.10126881301403046, 0.5528286695480347, -0.08772120624780655, 0.21639569103717804, 0.02819511853158474, 0.004381842911243439, 0.006061445455998182, 0.010256677865982056, -0.5032160878181458, 0.3105575144290924, 0.4316045939922333, 0.14952892065048218, -0.003047950565814972, 0.18434900045394897, 0.15539517998695374, 0.21014243364334106, -0.1736743003129959, 0.05060520023107529, 0.15153774619102478, 0.3359167277812958, -0.35056862235069275, 0.03608096390962601, 0.09018172323703766, -0.09316056966781616, 0.2941098213195801, 0.1951826810836792, -0.018094908446073532, -0.08749493211507797, 0.06223691999912262, 0.055506713688373566, 0.2890155017375946, -0.330041766166687, -0.05105530843138695, 0.10918550193309784, -0.03984121233224869, -0.12313525378704071, 0.023238899186253548, 0.08107095956802368, 0.1669873297214508, 0.5291815400123596, -0.003998696804046631, 0.21039265394210815, 0.2634257376194, -0.10788367688655853, -0.028440624475479126, -0.2291070818901062, 0.16513854265213013, 0.12884125113487244, -0.3179374039173126, 0.34731099009513855, -0.17163342237472534, -0.16177687048912048, 0.015565029345452785, 0.06834743916988373, -0.12209153175354004, 0.010220082476735115, -0.13309907913208008, 0.08891518414020538, -0.29903411865234375, -0.20312665402889252, -0.21234138309955597, 0.11186675727367401, 0.22696945071220398, -0.2756718397140503, -0.0008668974041938782, -0.1479603499174118, -0.24972598254680634, -0.1904318928718567, 0.3045760691165924, -0.13649824261665344, 0.34277382493019104, -0.18126726150512695, 0.028607657179236412, 0.11178240180015564, -0.07605938613414764, 0.031153839081525803, 0.44757166504859924, 0.25397443771362305, 0.08474583923816681, 0.1511615514755249, -0.06439200788736343, -0.04956471547484398, -0.182575985789299, -0.29764530062675476, 0.16634099185466766, -0.08046092092990875, -0.35345759987831116, 0.08270066976547241, 0.23839393258094788, -0.29718199372291565, -0.04086543992161751, 0.3304486870765686, 0.006332647055387497, -0.2566085457801819, -0.15131115913391113, 0.14107370376586914, -0.11805494129657745, -0.23934131860733032, -0.08809172362089157, -0.24154561758041382, -0.3837791681289673, 0.30114638805389404, 0.3963180482387543, 0.10672072321176529, -0.20981784164905548, 0.12636061012744904, -0.276387482881546, 0.3094869554042816, 0.2040533721446991, -0.02410624921321869, -0.0024654166772961617, -0.06210178881883621, -0.7367199659347534, -0.10415715724229813, 0.007514946162700653, -0.23536317050457, -0.08791934698820114, 0.4001688063144684, -0.010219216346740723, 0.16351190209388733, 0.038179539144039154, -0.2331327199935913, 0.043121032416820526, -0.11628986895084381, -0.4398098289966583, -0.2387665957212448, -0.06554058194160461, -0.1032199114561081, 0.09338455647230148, -0.34751924872398376, 0.033313557505607605, -0.16869959235191345, 0.1815304458141327, -0.27331602573394775, -0.20717808604240417, 0.1254441887140274, 0.2506749629974365, 0.3834284245967865, 0.20681288838386536, 0.031440213322639465, -0.32173672318458557, -0.21808309853076935, -0.4026273787021637, -0.13543318212032318, 0.023302625864744186, 0.5543332099914551, 0.14228856563568115, 0.4590686559677124, 0.047669485211372375, 0.002825699746608734, -0.0050340378656983376, 0.18334230780601501, -0.01701606623828411, 0.0015825278824195266, -0.360464483499527, 0.23106232285499573, -0.23305556178092957, 0.23754598200321198, -0.40127187967300415, 0.15507876873016357, -0.1239093542098999, -0.04904884099960327, -0.3073679804801941, -0.43804484605789185, 0.3614763915538788, -0.2817268669605255, -0.28923189640045166, -0.22513090074062347, 0.13170471787452698, -0.11719139665365219, 0.2133379727602005, -0.49258342385292053, 0.11518349498510361, 0.5094767212867737, -0.08527383953332901, -0.23122060298919678, -0.08716331422328949, -0.034108564257621765, 0.03797590360045433, -0.2219737470149994, 0.05188789218664169, -0.03597016632556915, -0.40719181299209595, -0.009971518069505692, -0.24330078065395355 ]
https://github.com/huggingface/datasets/issues/3011
load_dataset_builder should error if "name" does not exist?
Yes I think it should raise an error. Currently it looks like it instantiates a custom configuration with the name given by the user: https://github.com/huggingface/datasets/blob/ba27ce33bf568374cf23a07669fdd875b5718bc2/src/datasets/builder.py#L391-L397
``` import datasets as ds builder = ds.load_dataset_builder('sent_comp', name="doesnotexist") builder.info.config_name ``` returns ``` 'doesnotexist' ``` Shouldn't it raise an error instead? For this dataset, the only valid values for `name` should be: `"default"` or `None` (ie. argument not passed)
25
load_dataset_builder should error if "name" does not exist? ``` import datasets as ds builder = ds.load_dataset_builder('sent_comp', name="doesnotexist") builder.info.config_name ``` returns ``` 'doesnotexist' ``` Shouldn't it raise an error instead? For this dataset, the only valid values for `name` should be: `"default"` or `None` (ie. argument not passed) Yes I think it should raise an error. Currently it looks like it instantiates a custom configuration with the name given by the user: https://github.com/huggingface/datasets/blob/ba27ce33bf568374cf23a07669fdd875b5718bc2/src/datasets/builder.py#L391-L397
[ -0.13651539385318756, -0.06782180815935135, 0.05152690038084984, 0.47973453998565674, 0.19397421181201935, 0.13136377930641174, 0.45077794790267944, 0.05843076854944229, 0.18851575255393982, 0.407167911529541, 0.2744370996952057, 0.0654158890247345, -0.15594229102134705, 0.0452122688293457, 0.07486629486083984, 0.10922224074602127, 0.05159400403499603, 0.40535271167755127, 0.09327379614114761, -0.08200357854366302, -0.3264884352684021, 0.06900222599506378, -0.20510363578796387, 0.2054220288991928, -0.3182513117790222, 0.19244852662086487, 0.02453850768506527, 0.361824095249176, 0.031082680448889732, -0.5019711852073669, 0.32968470454216003, 0.12694327533245087, -0.07982125878334045, 0.425662100315094, -0.00012278750364203006, 0.2216547578573227, 0.3875076174736023, -0.12575411796569824, -0.33840399980545044, -0.28788530826568604, -0.4218554198741913, -0.31411755084991455, 0.19632910192012787, -0.3155789077281952, -0.18809950351715088, -0.035633619874715805, -0.029478149488568306, -0.08462667465209961, 0.20109564065933228, 0.3315224051475525, 0.10192574560642242, 0.19956764578819275, -0.09286603331565857, -0.10977769643068314, -0.0304010808467865, 0.14221537113189697, -0.05067071318626404, -0.03115774691104889, -0.2171076536178589, 0.31048667430877686, 0.3165411353111267, -0.003183695487678051, -0.20347750186920166, 0.02267683483660221, 0.21198496222496033, 0.0614575520157814, 0.2954947352409363, -0.20960633456707, 0.26711806654930115, 0.4647546410560608, 0.6100269556045532, -0.21848392486572266, -0.15890909731388092, -0.34880608320236206, 0.14561523497104645, -0.17714527249336243, 0.4762198328971863, -0.11909720301628113, -0.4372707009315491, -0.0038973018527030945, 0.0531538724899292, -0.370291143655777, -0.02743929624557495, 0.004406377673149109, -0.17948035895824432, 0.31118354201316833, -0.29522159695625305, 0.29183194041252136, -0.25325024127960205, -0.06340986490249634, 0.09506794065237045, -0.5572367310523987, -0.03226666525006294, 0.03540737181901932, -0.3109019994735718, -0.16819407045841217, 0.10044919699430466, -0.023566074669361115, 0.04617910832166672, -0.07661519199609756, 0.019302748143672943, -0.10037685185670853, 0.2705608010292053, 0.20082178711891174, 0.3124345541000366, -0.1943701207637787, 0.4022132158279419, 0.02443014085292816, 0.15325462818145752, -0.18886198103427887, 0.015358615666627884, -0.13261103630065918, -0.22016967833042145, -0.2243310958147049, 0.22241513431072235, -0.11308718472719193, 0.5471591353416443, -0.08599075675010681, -0.26071861386299133, 0.37009623646736145, -0.030943240970373154, -0.023501070216298103, 0.3581155240535736, 0.434070348739624, -0.34597840905189514, -0.06022705137729645, -0.010969305410981178, 0.028787238523364067, 0.1162928119301796, -0.21851813793182373, -0.24485185742378235, -0.28647521138191223, -0.15811002254486084, 0.014115216210484505, 0.11010555922985077, -0.1437312513589859, 0.31573382019996643, 0.020947054028511047, 0.015805553644895554, -0.11466345936059952, 0.0012019556015729904, 0.0427887998521328, 0.17379778623580933, 0.4335070252418518, -0.07738365232944489, -0.020879019051790237, 0.17793476581573486, -0.5118985772132874, -0.16169726848602295, 0.3676542043685913, -0.3195556700229645, -0.5034797191619873, -0.1444903016090393, 0.19873680174350739, -0.3553117513656616, 0.06824079900979996, -0.016622394323349, 0.1797618865966797, 0.30399617552757263, -0.19318944215774536, -0.0041006505489349365, -0.01539016142487526, -0.056624606251716614, -0.3033476769924164, 0.19277532398700714, 0.6054328083992004, -0.31534630060195923, -0.15517054498195648, -0.12666267156600952, -0.2349187433719635, -0.1522904932498932, -0.1622680276632309, -0.2928965091705322, 0.18579435348510742, -0.35039037466049194, -0.12192000448703766, 0.6622508764266968, 0.0525318942964077, 0.05149048566818237, 0.12712034583091736, -0.05602484196424484, -0.018081922084093094, 0.2535821199417114, 0.05314995348453522, -0.47489067912101746, -0.20827408134937286, 0.03209955245256424, -0.0735042467713356, -0.26703864336013794, -0.1277976632118225, 0.058102402836084366, 0.08057019859552383, 0.18494227528572083, 0.029055170714855194, 0.14834028482437134, 0.20967625081539154, -0.19698932766914368, 0.12046041339635849, 0.17791981995105743, 0.04422648996114731, -0.29868897795677185, 0.07086426019668579, 0.0739729180932045, 0.12807071208953857, -0.01846528984606266, 0.05188114941120148, -0.5132175087928772, 0.3952570855617523, 0.2898363471031189, 0.0761168822646141, 0.18801355361938477, -0.210004061460495, -0.023621074855327606, 0.25494468212127686, -0.23133279383182526, 0.2855648994445801, -0.0021309461444616318, 0.21371781826019287, -0.020003460347652435, -0.16339021921157837, -0.5911722183227539, 0.07300326228141785, -0.5128946304321289, 0.11344078928232193, -0.25114110112190247, 0.05701069533824921, 0.06572622060775757, 0.08401361107826233, -0.331781268119812, 0.14564897119998932, 0.08311871439218521, 0.11145323514938354, 0.03152824938297272, 0.3394145965576172, -0.029268866404891014, -0.3182825446128845, -0.36874958872795105, -0.13653554022312164, -0.1261918842792511, -0.13120192289352417, 0.04794090613722801, 0.22639474272727966, 0.25942766666412354, -0.22738423943519592, 0.05456684157252312, 0.16537900269031525, 0.07683597505092621, 0.31235775351524353, 0.004527125507593155, -0.16201812028884888, 0.027076667174696922, 0.031267549842596054, -0.19967791438102722, -0.25767403841018677, -0.03663068637251854, -0.08375410735607147, 0.28446492552757263, 0.11258978396654129, -0.31421756744384766, -0.43741655349731445, 0.1415320187807083, -0.0316721610724926, -0.03888484835624695, -0.11865239590406418, 0.04243151843547821, 0.15335506200790405, 0.08114252984523773, 0.17940424382686615, 0.7374491095542908, 0.16469253599643707, -0.2438904345035553, 0.20971159636974335, -0.1587425172328949, -0.09061495959758759, 0.174716979265213, 0.20985421538352966, 0.331741064786911, 0.31835299730300903, -0.23067936301231384, -0.00008685048669576645, -0.4921308755874634, -0.1336328685283661, 0.24206167459487915, -0.06121070683002472, -0.5944669246673584, -0.028982695192098618, 0.2129340022802353, -0.2268887162208557, -0.10552286356687546, -0.1379869133234024, -0.5043969750404358, -0.18962346017360687, -0.038021519780159, -0.040182117372751236, -0.09140284359455109, 0.16411074995994568, -0.2888195216655731, 0.03422747552394867, -0.13562719523906708, -0.6813526153564453, -0.20778489112854004, 0.0796029195189476, -0.21664869785308838, -0.006820008158683777, -0.1274285763502121, -0.16447216272354126, 0.28294041752815247, -0.30814439058303833, -0.15797224640846252, -0.011564871296286583, -0.1641717255115509, 0.33203136920928955, -0.1385512799024582, 0.2675160765647888, 0.5650125741958618, -0.02273503690958023, 0.48708146810531616, 0.007612139917910099, 0.4722796678543091, 0.1429276466369629, -0.055350154638290405, 0.08238836377859116, 0.24376218020915985, -0.24916771054267883, -0.10303403437137604, -0.031697556376457214, -0.08042334020137787, -0.19199000298976898, -0.31542664766311646, 0.2807677090167999, 0.22672708332538605, 0.6292540431022644, 0.34691447019577026, 0.18284198641777039, 0.10064152628183365, 0.22976936399936676, -0.3656281530857086, -0.5135586261749268, 0.057532791048288345, -0.028656480833888054, -0.0654871016740799, 0.15614214539527893, -0.21540220081806183, 0.38545432686805725, -0.15879414975643158, -0.29873722791671753, 0.0278928205370903, 0.014279955998063087, 0.3960190713405609, -0.04039176553487778, 0.34050774574279785, 0.3123461902141571, 0.24687132239341736, -0.019067350775003433, -0.19240334630012512, -0.506135106086731, 0.24841418862342834, 0.01141580380499363, 0.32643845677375793, 0.3032837510108948, 0.22443899512290955, -0.42601174116134644, 0.24369047582149506, 0.09516723453998566, -0.21610398590564728, 0.3231157660484314, -0.3334348499774933, 0.7303141951560974, 0.010177649557590485, -0.279840350151062, -0.13164253532886505, 0.5664821267127991, -0.2619679570198059, 0.23842689394950867, 0.07191164046525955, 0.010489893145859241, -0.48252391815185547, -0.1885090172290802, -0.019325846806168556, -0.12177146971225739, -0.0343983918428421, -0.4004529118537903, -0.02153656631708145, -0.013380217365920544, 0.05378008633852005, -0.3231835663318634, 0.13881176710128784, -0.30742359161376953, 0.37683355808258057, 0.1411336362361908, -0.14208118617534637, -0.10490703582763672, -0.06014995649456978, -0.24178823828697205, 0.1641690582036972, -0.06924689561128616, 0.20174150168895721, -0.06121325492858887, -0.012941282242536545, 0.11506325751543045, 0.13270747661590576, 0.5302445888519287, -0.5483933091163635, 0.00024023279547691345, 0.17403236031532288, 0.34018704295158386, -0.27497655153274536, -0.022502629086375237, 0.11929544806480408, 0.15956886112689972, -0.08513805270195007, 0.14894312620162964, -0.20028620958328247, -0.46633636951446533, 0.501286506652832, 0.30208125710487366, -0.30081501603126526, -0.480183869600296, -0.4925651550292969, -0.25959011912345886, -0.049807704985141754, -0.0978248193860054, -0.1283116489648819, 0.007919862866401672, 0.2878061532974243, 0.06129247322678566, -0.293657511472702, 0.059324346482753754, 0.2766285538673401, 0.2085518091917038, 0.0899289920926094, -0.14781439304351807, 0.1025342047214508, 0.03637475147843361, 0.2374931275844574, 0.007662246003746986, 0.6811564564704895, -0.14066506922245026, -0.291544109582901, -0.1206158921122551, 0.005934423767030239, 0.6092289090156555, 0.34182658791542053, -0.2901497185230255, -0.24569815397262573, 0.0613727867603302, 0.062461744993925095, -0.15754568576812744, 0.03880476951599121, 0.4360448122024536, 0.13587278127670288, -0.45328792929649353, -0.47117501497268677, 0.5903027057647705, -0.04280807822942734, -0.024907998740673065, 0.16894221305847168, 0.38416045904159546, -0.4552389681339264, 0.10869850218296051, 0.018193170428276062, 0.7410932779312134, 0.18878984451293945, 0.09417258203029633, 0.3292866051197052, 0.1513085514307022, 0.5806100964546204, 0.17671911418437958, -0.05514661967754364, -0.24987375736236572, -0.054514020681381226, -0.09563885629177094, -0.06136082112789154, 0.46047621965408325, 0.3859042525291443, -0.06027809903025627, 0.25974932312965393, -0.19996969401836395, 0.40357786417007446, 0.11238973587751389, 0.2004590779542923, -0.293750137090683, -0.004890391603112221, -0.36676979064941406, 0.06317983567714691, -0.007394343614578247, 0.2786101698875427, -0.1318528801202774, 0.09799014031887054, 0.22610563039779663, -0.33577197790145874, -0.06717841327190399, -0.01794561743736267, -0.24762369692325592, -0.21387048065662384, 0.2314872443675995, -0.07408052682876587, 0.044858332723379135, 0.3108617067337036, 0.2951084077358246, 0.34529179334640503, -0.04938589781522751, 0.16982583701610565, -0.0011079534888267517, 0.25469326972961426, -0.11406754702329636, 0.04007823020219803, 0.45468103885650635, 0.07970412820577621, -0.2662011682987213, 0.2104623019695282, -0.37779563665390015, -0.16351407766342163, 0.0056130290031433105, 0.042615875601768494, 0.28087925910949707, -0.44166648387908936, -0.11704039573669434, -0.03671461343765259, 0.15971438586711884, 0.09218379855155945, 0.08809274435043335, -0.08708460628986359, -0.29562851786613464, 0.06619642674922943, -0.1922563910484314, -0.20497746765613556, -0.0974046140909195, -0.0829562321305275, 0.18691202998161316, 0.14282305538654327, 0.4490415155887604, -0.33284029364585876, 0.14728263020515442, -0.14109036326408386, 0.05655016005039215, 0.24657511711120605, -0.2029908001422882, 0.09956519305706024, 0.4769243597984314, -0.1950526237487793, 0.06039587780833244, 0.2897782027721405, 0.1814202070236206, 0.07394830882549286, 0.12462061643600464, -0.06654070317745209, -0.17294543981552124, -0.16466717422008514, 0.21217967569828033, 0.3656896948814392, 0.09604247659444809, 0.09627389907836914, 0.12598977982997894, -0.23090964555740356, -0.24708248674869537, -0.19441455602645874, -0.12034385651350021, 0.18867872655391693, 0.15934768319129944, 0.40428873896598816, 0.07153152674436569, -0.24581597745418549, 0.1429242342710495, -0.25528162717819214, -0.1311904639005661, -0.10383810102939606, -0.1317303627729416, 0.2465730607509613, 0.2764912247657776, 0.05672014504671097, -0.009641280397772789, -0.28256016969680786, -0.2375035583972931, -0.12695154547691345, 0.19603067636489868, 0.1783897876739502, -0.16422463953495026, 0.18579626083374023, 0.24655193090438843, 0.18807944655418396, -0.3917269706726074, 0.32139918208122253, -0.051935821771621704, 0.33208054304122925, -0.07698795944452286, 0.09171587228775024, -0.30661359429359436, -0.061506256461143494, 0.09748610109090805, 0.31124818325042725, -0.31796300411224365, -0.21102815866470337, 0.18204087018966675, -0.4527447819709778, 0.13116896152496338, 0.05664657801389694, 0.27237701416015625, 0.465323269367218, -0.11927281320095062, 0.0013651344925165176, 0.20292210578918457, 0.12730659544467926, -0.337820440530777, 0.043917588889598846, 0.056023575365543365, -0.013075155206024647, 0.25907355546951294, 0.5391258597373962, -0.06556758284568787, -0.12942679226398468, 0.0988723486661911, 0.04491619020700455, 0.2581394910812378, -0.06411823630332947, 0.11199447512626648, 0.4979023039340973, -0.24254979193210602, 0.3873385190963745, 0.504936158657074, 0.2677801251411438, -0.009805038571357727, 0.3156614303588867, -0.11439531296491623, 0.1745048314332962, 0.17413759231567383, 0.008331388235092163, -0.08242582529783249, -0.3958592414855957, 0.6731086373329163, 0.056056782603263855, -0.19661268591880798, -0.04568187892436981, 0.0031228065490722656, 0.09030421078205109, -0.5454508662223816, 0.12457411736249924, -0.2871447205543518, -0.16935725510120392, -0.26811841130256653, -0.01752483658492565, -0.3052287697792053, -0.1467166543006897, -0.0036437585949897766, -0.06007682904601097, 0.08732222020626068, -0.40768539905548096, -0.12606637179851532, -0.0968722254037857, 0.09508658945560455, -0.3334887623786926, 0.17344000935554504, 0.1914498209953308, -0.19873309135437012, -0.22854161262512207, 0.35832667350769043, 0.1663638800382614, -0.05778057873249054, 0.2984377443790436, 0.37794941663742065, 0.4319034814834595, 0.3739011287689209, 0.2924429774284363, -0.05594497546553612, 0.10485713183879852, -0.07606162875890732, -0.16978855431079865, 0.12274990975856781, -0.07058997452259064, 0.11101776361465454, 0.1585208773612976, 0.1597968339920044, -0.08283227682113647, -0.055633511394262314, 0.09914438426494598, 0.13895371556282043, -0.49373170733451843, 0.4338573217391968, -0.1046576052904129, -0.08913278579711914, -0.2765573263168335, 0.0776381865143776, -0.3604068458080292, -0.1406303495168686, 0.5702712535858154, 0.14302153885364532, 0.09473486989736557, -0.09734243899583817, 0.029034994542598724, -0.19219467043876648, 0.23415911197662354, 0.14542746543884277, 0.06530355662107468, -0.3083300292491913, 0.2014160007238388, -0.655885636806488, 0.140060156583786, 0.052444640547037125, -0.10664380341768265, 0.2856493592262268, -0.08221497386693954, 0.05790545791387558, 0.1918543130159378, -0.08928559720516205, -0.056937504559755325, 0.29051169753074646, -0.22797733545303345, 0.07115140557289124, -0.5084410309791565, -0.17639482021331787, 0.06186418980360031, -0.02973058819770813, -0.4389966130256653, -0.10978367924690247, -0.2996751666069031, -0.0892743468284607, -0.19900202751159668, 0.15184327960014343, 0.25069284439086914, -0.014478631317615509, 0.31981149315834045, -0.046989768743515015, 0.4335167706012726, -0.005800735205411911, 0.0635097399353981, 0.0669451355934143, 0.08624797314405441, -0.5620439052581787, 0.27281370759010315, 0.08318263292312622, 0.04697681963443756, -0.10081899911165237, 0.1448400616645813, -0.16997484862804413, -0.15594449639320374, 0.21134240925312042, -0.03602274879813194, -0.20941346883773804, 0.26012906432151794, -0.30431297421455383, 0.33286675810813904, 0.19425299763679504, -0.025855466723442078, 0.045498885214328766, 0.2605119049549103, -0.23560866713523865, -0.15557461977005005, 0.624803900718689, 0.03434935584664345, -0.26594242453575134, -0.25953784584999084, 0.34495216608047485, 0.0508338138461113, -0.17426185309886932, -0.5233398079872131, -0.026179730892181396, 0.5499690771102905, -0.1726459562778473, -0.18552270531654358, 0.004886861890554428, -0.20918114483356476, -0.007593952119350433, 0.07364436984062195, 0.03402267396450043, -0.14234307408332825, -0.18798115849494934, -0.07030882686376572, -0.1918414831161499 ]
https://github.com/huggingface/datasets/issues/3010
Chain filtering is leaking
### Update: I wrote a bit cleaner code snippet (without transforming to json) that can expose leaking. ```python import datasets import json items = ['ab', 'c', 'df'] ds = datasets.Dataset.from_dict({'col': items}) print(list(ds)) # > Prints: [{'col': 'ab'}, {'col': 'c'}, {'col': 'df'}] filtered = ds # get all items that are starting with a character with ascii code bigger than 'a' filtered = filtered.filter(lambda x: x['col'][0] > 'a', load_from_cache_file=False) print(list(filtered)) # > Prints: [{'col': 'c'}, {'col': 'df'}] as expected # get all items that are shorter than 2 filtered = filtered.filter(lambda x: len(x['col']) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'col': 'ab'}] -> this is a leaked item from the first filter # > Should be: [{'col': 'c'}] ```
## Describe the bug As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'. These samples show that filtering behavior diverges from what's expected when chaining filterings. On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results. ## Steps to reproduce the bug Sample 1: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected filtered = ds # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Should be: [{'a': [4]}] # > Prints: [{'a': [3]}] ``` Sample 2: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] filtered = ds # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[4]'}] as expected # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[1, 2]'}] # > Should be: [{'a': '[4]'}] (remain intact) ``` ## Expected results Expected and actual results are attached to the code snippets. ## Actual results Expected and actual results are attached to the code snippets. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.9.7 - PyArrow version: 5.0.0
118
Chain filtering is leaking ## Describe the bug As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'. These samples show that filtering behavior diverges from what's expected when chaining filterings. On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results. ## Steps to reproduce the bug Sample 1: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected filtered = ds # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Should be: [{'a': [4]}] # > Prints: [{'a': [3]}] ``` Sample 2: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] filtered = ds # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[4]'}] as expected # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[1, 2]'}] # > Should be: [{'a': '[4]'}] (remain intact) ``` ## Expected results Expected and actual results are attached to the code snippets. ## Actual results Expected and actual results are attached to the code snippets. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.9.7 - PyArrow version: 5.0.0 ### Update: I wrote a bit cleaner code snippet (without transforming to json) that can expose leaking. ```python import datasets import json items = ['ab', 'c', 'df'] ds = datasets.Dataset.from_dict({'col': items}) print(list(ds)) # > Prints: [{'col': 'ab'}, {'col': 'c'}, {'col': 'df'}] filtered = ds # get all items that are starting with a character with ascii code bigger than 'a' filtered = filtered.filter(lambda x: x['col'][0] > 'a', load_from_cache_file=False) print(list(filtered)) # > Prints: [{'col': 'c'}, {'col': 'df'}] as expected # get all items that are shorter than 2 filtered = filtered.filter(lambda x: len(x['col']) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'col': 'ab'}] -> this is a leaked item from the first filter # > Should be: [{'col': 'c'}] ```
[ -0.18471510708332062, 0.16124606132507324, -0.15162700414657593, 0.22353093326091766, -0.12694312632083893, -0.1254190355539322, 0.297874391078949, 0.23607715964317322, 0.3307054340839386, -0.2883334755897522, -0.08475915342569351, 0.5628126263618469, 0.17767268419265747, 0.05403637886047363, -0.15571986138820648, -0.014278315007686615, 0.08184784650802612, -0.24361154437065125, -0.07721114158630371, 0.0644923746585846, -0.009900938719511032, 0.1094735711812973, -0.05029169097542763, -0.1966572254896164, 0.18985892832279205, -0.18312270939350128, 0.1703658252954483, -0.044810302555561066, 0.03138240426778793, -0.3397790193557739, 0.18612316250801086, 0.1549554467201233, -0.175240620970726, 0.27250856161117554, -0.00011364613601472229, 0.017922699451446533, 0.4603433609008789, -0.0023182500153779984, -0.25606265664100647, -0.2721797823905945, -0.6779728531837463, -0.38432472944259644, 0.47518104314804077, 0.10452938824892044, 0.15815964341163635, -0.1409381628036499, -0.39439818263053894, -0.5809842944145203, 0.5498982071876526, 0.08364998549222946, 0.1865929812192917, 0.12394566833972931, 0.20131294429302216, 0.22799529135227203, 0.3071094751358032, 0.061276841908693314, -0.13291847705841064, -0.09857551753520966, 0.5059637427330017, 0.18163520097732544, -0.06062806397676468, 0.2830309569835663, -0.3123328983783722, -0.17993146181106567, -0.04569987952709198, 0.05149250105023384, -0.08057678490877151, -0.4002590477466583, 0.05598491430282593, 0.13273397088050842, 0.12094507366418839, -0.12226682156324387, -0.4533759355545044, -0.4508509039878845, -0.3495272397994995, -0.24326762557029724, 0.03143620863556862, 0.14143703877925873, -0.35386037826538086, 0.2027984857559204, -0.2764708697795868, -0.15564551949501038, 0.07275025546550751, 0.09354928880929947, -0.04994375631213188, 0.3183330297470093, -0.05502086877822876, -0.09428121894598007, -0.1449710875749588, -0.08416622877120972, 0.23272110521793365, -0.4712362289428711, -0.04653477296233177, -0.09894506633281708, -0.15490633249282837, -0.09155411273241043, 0.19651684165000916, -0.1078544333577156, 0.12434492260217667, 0.13708582520484924, -0.3421187996864319, 0.06782835721969604, 0.01036111544817686, 0.10231222212314606, 0.6082577705383301, -0.06460198760032654, 0.08349255472421646, 0.3204422891139984, -0.18848592042922974, 0.03615323081612587, -0.09405317902565002, -0.09709242731332779, 0.5751079320907593, 0.24249714612960815, 0.07030156254768372, -0.05738260596990585, 0.24192626774311066, -0.2012382596731186, -0.27594664692878723, 0.12025956064462662, -0.43741515278816223, 0.04930628463625908, 0.2863561809062958, -0.03169584274291992, 0.07126736640930176, 0.4016805589199066, 0.08979307115077972, 0.2228568196296692, 0.041494131088256836, 0.024008825421333313, -0.1476507931947708, -0.39274850487709045, -0.09273605048656464, 0.033222079277038574, -0.07205766439437866, -0.22173410654067993, 0.1971171796321869, 0.30137762427330017, 0.030212044715881348, -0.062028903514146805, -0.06995752453804016, -0.01826993003487587, 0.13095194101333618, 0.3366762101650238, -0.03153586387634277, 0.19307729601860046, 0.34083932638168335, -0.4169310927391052, 0.06291050463914871, 0.2294759452342987, -0.3842695951461792, 0.20784299075603485, -0.005167139694094658, 0.12131292372941971, -0.11193210631608963, 0.06075574830174446, -0.12062525004148483, 0.31636232137680054, 0.29558122158050537, 0.177317813038826, -0.07133614271879196, -0.17401935160160065, -0.2285032719373703, -0.1540699303150177, -0.13432055711746216, 0.41017383337020874, -0.39212068915367126, -0.06231335923075676, 0.008797498419880867, 0.17045332491397858, 0.2360628843307495, 0.22571583092212677, -0.341820627450943, -0.09326686710119247, 0.09233676642179489, -0.09113244712352753, 0.19583526253700256, -0.32950568199157715, -0.43985381722450256, 0.44211632013320923, 0.021187007427215576, 0.4617266356945038, 0.021836958825588226, -0.16580262780189514, 0.2958744764328003, -0.23839834332466125, 0.2526777684688568, 0.15854552388191223, -0.25399747490882874, -0.015349149703979492, -0.2694908082485199, 0.051836878061294556, 0.11757702380418777, -0.3335338532924652, -0.18580935895442963, 0.33279505372047424, 0.010090157389640808, 0.17931778728961945, 0.1677999198436737, 0.08307278156280518, 0.19885596632957458, 0.27634507417678833, 0.0519530214369297, 0.07036425918340683, -0.12756416201591492, -0.0912705659866333, -0.2597222924232483, -0.13545387983322144, 0.02083509787917137, -0.3145243227481842, -0.5268624424934387, -0.1500765085220337, -0.055661797523498535, 0.3636550009250641, 0.03191576898097992, 0.05908573418855667, 0.16264881193637848, 0.08878257870674133, -0.3272233307361603, 0.03652988001704216, -0.1532629132270813, 0.2062530368566513, 0.01905345357954502, 0.06944604963064194, -0.2959236204624176, 0.1946905255317688, 0.29362261295318604, 0.021441232413053513, -0.0025376565754413605, -0.10918959230184555, 0.3430593013763428, 0.22865790128707886, -0.058969929814338684, 0.2945376932621002, 0.5386203527450562, -0.1742345243692398, -0.1106800064444542, 0.25079262256622314, 0.2530078887939453, 0.07625488936901093, -0.07008570432662964, 0.4580594301223755, 0.1266881823539734, -0.08467762172222137, -0.19482064247131348, 0.45514386892318726, -0.42921361327171326, 0.18992091715335846, 0.06705782562494278, 0.24976962804794312, 0.33045893907546997, -0.09860967099666595, -0.33118847012519836, -0.328803688287735, -0.280112624168396, -0.21658159792423248, 0.2056816965341568, -0.1593928039073944, -0.4222959280014038, 0.49275341629981995, 0.2779899835586548, 0.2250119149684906, 0.021030619740486145, 0.10326145589351654, 0.14265291392803192, -0.031179528683423996, -0.024438707157969475, 0.3411138355731964, 0.34935134649276733, 0.23548288643360138, 0.25337904691696167, -0.06178046762943268, 0.014917995780706406, -0.20694728195667267, 0.25835832953453064, 0.25579479336738586, 0.144441619515419, 0.10698258876800537, 0.3125620186328888, -0.09406055510044098, -0.07033827155828476, -0.19859136641025543, -0.0905192568898201, -0.02392958663403988, -0.24676096439361572, 0.5204170942306519, -0.531216025352478, -0.19819524884223938, -0.18273968994617462, -0.5116313695907593, 0.1445445865392685, -0.4857126772403717, 0.09238561987876892, 0.43138372898101807, -0.29412367939949036, -0.08765720576047897, -0.11199457943439484, -0.06553788483142853, 0.23736660182476044, -0.08893074840307236, -0.14849349856376648, -0.07832250744104385, -0.15404203534126282, 0.040227700024843216, 0.41829076409339905, -0.16594769060611725, -0.09452129900455475, 0.2740504741668701, -0.2734483480453491, -0.18640801310539246, -0.40677547454833984, 0.21006429195404053, 0.040600501000881195, 0.330720990896225, 0.14016911387443542, -0.11338931322097778, -0.20448815822601318, -0.23777073621749878, -0.0199925284832716, 0.036894313991069794, -0.2550297975540161, 0.05976678431034088, 0.07305621355772018, 0.1169709637761116, -0.0949096828699112, -0.16077911853790283, -0.17772947251796722, -0.14106325805187225, 0.08273650705814362, 0.13721825182437897, 0.06860106438398361, 0.4495680630207062, -0.16903916001319885, -0.3041932284832001, 0.032164566218853, 0.008521631360054016, -0.07808867841959, -0.4054817855358124, 0.22192679345607758, -0.2311035692691803, -0.22205694019794464, -0.10034516453742981, 0.0942799523472786, -0.13705287873744965, 0.26311957836151123, -0.3425103425979614, 0.09814891219139099, 0.08787870407104492, 0.03522726520895958, -0.0163983553647995, -0.06004703789949417, 0.018178731203079224, 0.1340135931968689, -0.03300359845161438, -0.31385865807533264, 0.006215963512659073, -0.08298433572053909, -0.23921474814414978, 0.43581581115722656, -0.04881978780031204, 0.4624006152153015, 0.16438411176204681, 0.36496520042419434, 0.36749032139778137, 0.08791748434305191, 0.16323086619377136, 0.13793505728244781, 0.08475412428379059, -0.16782847046852112, -0.32899951934814453, -0.6673761606216431, -0.11209100484848022, -0.25302284955978394, -0.08225513994693756, 0.10795596241950989, -0.41625216603279114, -0.03765716031193733, 0.06028519198298454, -0.25022706389427185, -0.22656212747097015, -0.02649696357548237, -0.36271706223487854, 0.1486148089170456, 0.2905975580215454, 0.130977064371109, -0.14214836061000824, -0.3163142800331116, -0.3697647154331207, -0.09058123826980591, 0.20171557366847992, -0.07974778115749359, -0.15714214742183685, -0.014398939907550812, -0.24823617935180664, 0.04183030128479004, 0.09273546189069748, 0.42633700370788574, -0.05000689625740051, -0.032130636274814606, -0.20998559892177582, 0.1423538774251938, 0.6453760266304016, -0.29845911264419556, -0.0834609717130661, 0.2110823690891266, -0.26264095306396484, -0.19242334365844727, 0.1152464747428894, -0.3326689898967743, 0.3275090157985687, 0.4433329999446869, -0.011102169752120972, -0.18846862018108368, -0.1750921756029129, -0.06867260485887527, -0.014710838906466961, -0.004992462694644928, 0.09845558553934097, -0.1255108118057251, -0.14720851182937622, 0.10609346628189087, 0.03616345301270485, 0.1492302268743515, 0.3048466444015503, 0.05410340428352356, -0.1684626191854477, -0.08123810589313507, -0.13016849756240845, -0.12729477882385254, -0.13913168013095856, 0.21888837218284607, 0.17156873643398285, 0.1832258552312851, -0.17132169008255005, 0.3192785680294037, 0.10201427340507507, 0.27067720890045166, 0.3981141149997711, -0.06250803172588348, 0.009797077625989914, 0.011818298138678074, -0.02159755676984787, 0.2598821818828583, -0.09648823738098145, 0.15029768645763397, -0.05775175243616104, 0.10325708985328674, 0.2792081832885742, -0.6098539233207703, 0.034682244062423706, -0.10847191512584686, -0.10197070986032486, -0.16931428015232086, 0.23707109689712524, -0.13309696316719055, -0.14387227594852448, 0.4556034207344055, -0.28139281272888184, -0.27852505445480347, 0.4674651026725769, 0.11959974467754364, 0.6618340611457825, 0.3297942280769348, -0.2453741431236267, 0.2692957818508148, -0.41026097536087036, 0.7219453454017639, -0.29045727849006653, 0.08459067344665527, -0.06325919181108475, -0.20089615881443024, -0.08382243663072586, -0.07499277591705322, 0.1761646717786789, 0.031644828617572784, -0.006535220891237259, 0.2107536792755127, -0.32049262523651123, 0.222605362534523, 0.07729260623455048, 0.02532956749200821, 0.22957226634025574, -0.24130895733833313, -0.5211859345436096, 0.09048736095428467, 0.12214045226573944, -0.19663318991661072, -0.13640904426574707, -0.3907931447029114, -0.05222019925713539, -0.09972627460956573, -0.20704370737075806, 0.07715503126382828, 0.1347195953130722, 0.27535462379455566, 0.4606737792491913, -0.18466851115226746, 0.11649522185325623, 0.1171574741601944, 0.14283780753612518, -0.1567739099264145, -0.13529211282730103, 0.04578973725438118, -0.22437387704849243, 0.51961350440979, 0.18086965382099152, -0.2338750660419464, 0.4920262396335602, 0.08173316717147827, -0.13560819625854492, -0.07182902842760086, 0.1434355527162552, -0.5613762736320496, 0.011172041296958923, 0.2747534215450287, -0.0452338382601738, -0.2436586171388626, 0.0944947898387909, 0.18402695655822754, 0.20183150470256805, -0.24574318528175354, 0.13079310953617096, 0.05789077654480934, -0.29176589846611023, 0.4274536371231079, -0.17285974323749542, -0.017984561622142792, -0.15788590908050537, 0.5307115912437439, 0.29150572419166565, 0.13631436228752136, -0.07392647862434387, 0.3858100473880768, -0.23223838210105896, -0.058217961341142654, 0.1815846860408783, -0.06511852145195007, 0.06787378340959549, 0.15481099486351013, -0.555107593536377, 0.00037428736686706543, -0.12190186977386475, 0.03468655049800873, -0.21077950298786163, 0.34630411863327026, -0.07457844167947769, -0.6530781984329224, 0.10513518005609512, 0.26574742794036865, 0.12432244420051575, -0.2326275259256363, -0.30688369274139404, 0.26090100407600403, -0.14465603232383728, 0.09689679741859436, -0.24884207546710968, -0.05964972823858261, -0.005240526050329208, -0.014421321451663971, -0.23527631163597107, 0.16784068942070007, 0.31763458251953125, -0.21044813096523285, 0.06188749521970749, 0.0872306376695633, 0.05151189863681793, -0.19532406330108643, 0.04055096581578255, 0.07088762521743774, -0.03922044485807419, -0.14792178571224213, -0.09954273700714111, -0.09687874466180801, -0.031540919095277786, 0.010131449438631535, 0.198311910033226, 0.14919352531433105, 0.04643206298351288, -0.1515311896800995, -0.16322992742061615, -0.007141433656215668, 0.10607472062110901, -0.166041761636734, 0.11117732524871826, 0.1066613718867302, -0.056284766644239426, 0.40056973695755005, 0.10505474358797073, 0.04555714130401611, -0.4834800958633423, 0.0008832290768623352, -0.21841372549533844, 0.0506884902715683, 0.5528396964073181, -0.2080826610326767, -0.1635860949754715, 0.4838204085826874, 0.5228288173675537, 0.17978227138519287, -0.13799671828746796, 0.18275859951972961, -0.3051489591598511, 0.15276768803596497, -0.04152936860918999, -0.267403781414032, 0.4470843970775604, 0.5047742128372192, -0.03580132871866226, 0.2872407138347626, 0.18127256631851196, -0.09025882184505463, 0.35309332609176636, -0.02926560677587986, 0.4476739764213562, -0.10542336106300354, 0.49834680557250977, 0.3203928768634796, 0.13003745675086975, 0.267472505569458, 0.23362503945827484, 0.03326718881726265, 0.02263769507408142, 0.5594005584716797, 0.3961308002471924, 0.27259108424186707, 0.33177274465560913, -0.08140088617801666, -0.20188990235328674, -0.03707050159573555, 0.05720505863428116, 0.24540704488754272, 0.0425366647541523, -0.07093798369169235, 0.04003749042749405, -0.48923689126968384, 0.2463550716638565, -0.2254829704761505, 0.057664766907691956, 0.24185016751289368, -0.14157900214195251, -0.22742711007595062, -0.28106796741485596, -0.32666707038879395, 0.07072590291500092, 0.039452653378248215, 0.06773944944143295, -0.08611531555652618, 0.2598244547843933, 0.007378436625003815, 0.21841000020503998, -0.5806428790092468, -0.09142421931028366, 0.10469457507133484, 0.23849302530288696, -0.240794837474823, 0.24509786069393158, 0.09652667492628098, 0.053557105362415314, 0.08609718084335327, 0.28432661294937134, 0.1256157010793686, 0.23700442910194397, 0.052191246300935745, -0.12150833755731583, 0.03160984814167023, -0.3754718005657196, -0.1297173798084259, 0.4204675853252411, -0.12074658274650574, 0.03733726590871811, 0.22721998393535614, 0.15827718377113342, -0.054694078862667084, 0.43903645873069763, 0.3265421688556671, 0.0583549439907074, -0.29050013422966003, 0.17546817660331726, 0.001623891294002533, 0.25145241618156433, 0.10473670065402985, -0.3202597200870514, -0.036327995359897614, -0.17979688942432404, 0.4957881271839142, -0.07421441376209259, 0.2648763954639435, 0.044036272913217545, 0.08657921850681305, 0.05552198365330696, -0.006475280970335007, -0.10174722969532013, 0.03807356208562851, -0.026632823050022125, -0.09586816281080246, -0.07976920157670975, 0.11278996616601944, -0.0980355441570282, -0.10216651856899261, 0.15249906480312347, 0.3529859483242035, 0.11771857738494873, 0.47654467821121216, -0.29885268211364746, -0.3513239324092865, -0.21330595016479492, 0.05412466451525688, -0.13679374754428864, -0.1280902773141861, 0.04767461121082306, 0.15149345993995667, -0.08838944137096405, -0.20396503806114197, 0.316901296377182, 0.0006154812872409821, 0.07496444135904312, -0.08436522632837296, -0.05878712609410286, -0.1354571282863617, 0.029416240751743317, -0.2451590895652771, 0.453250527381897, 0.31441226601600647, 0.03421614319086075, -0.10491890460252762, -0.18291650712490082, -0.5120857954025269, -0.20767933130264282, 0.42216455936431885, -0.1766946017742157, 0.5816004276275635, -0.10095850378274918, -0.23453958332538605, -0.19947512447834015, 0.09709728509187698, -0.07152687013149261, 0.08942792564630508, -0.37973257899284363, 0.14483970403671265, -0.1123412549495697, 0.20501232147216797, -0.13135424256324768, 0.46511414647102356, -0.16083931922912598, 0.5011341571807861, 0.014713294804096222, -0.2652541697025299, 0.23650744557380676, -0.6418450474739075, -0.27973079681396484, 0.09028656035661697, 0.08008381724357605, 0.1353803128004074, -0.3896629810333252, -0.09858385473489761, -0.18193095922470093, 0.2118419110774994, -0.32046133279800415, -0.35762226581573486, 0.012697928585112095, 0.13775475323200226, 0.03040274605154991, -0.11123630404472351, -0.11333644390106201, 0.2854593098163605, -0.12270402163267136, 0.36201074719429016, -0.18197228014469147 ]
https://github.com/huggingface/datasets/issues/3010
Chain filtering is leaking
I just pushed a fix ! We'll do a new release soon. In the meantime feel free to install `datasets` from source to play with it
## Describe the bug As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'. These samples show that filtering behavior diverges from what's expected when chaining filterings. On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results. ## Steps to reproduce the bug Sample 1: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected filtered = ds # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Should be: [{'a': [4]}] # > Prints: [{'a': [3]}] ``` Sample 2: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] filtered = ds # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[4]'}] as expected # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[1, 2]'}] # > Should be: [{'a': '[4]'}] (remain intact) ``` ## Expected results Expected and actual results are attached to the code snippets. ## Actual results Expected and actual results are attached to the code snippets. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.9.7 - PyArrow version: 5.0.0
26
Chain filtering is leaking ## Describe the bug As there's no support for lists within dataset fields, I convert my lists to json-string format. However, the bug described is occurring even when the data format is 'string'. These samples show that filtering behavior diverges from what's expected when chaining filterings. On sample 2 the second filtering leads to "leaking" of data that should've been filtered on the first filtering into the results. ## Steps to reproduce the bug Sample 1: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] as expected filtered = ds # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[3]'}, {'a': '[4]'}] as expected # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Should be: [{'a': [4]}] # > Prints: [{'a': [3]}] ``` Sample 2: ```python import datasets import json items = [[1, 2], [3], [4]] jsoned_items = map(json.dumps, [[1, 2], [3], [4]]) ds = datasets.Dataset.from_dict({'a': jsoned_items}) print(list(ds)) # > Prints: [{'a': '[1, 2]'}, {'a': '[3]'}, {'a': '[4]'}] filtered = ds # get all lists, which have a value bigger than 3 on its zero index filtered = filtered.filter(lambda x: json.loads(x['a'])[0] > 3, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[4]'}] as expected # get all lists that are shorter than 2 filtered = filtered.filter(lambda x: len(json.loads(x['a'])) < 2, load_from_cache_file=False) print(list(filtered)) # > Prints: [{'a': '[1, 2]'}] # > Should be: [{'a': '[4]'}] (remain intact) ``` ## Expected results Expected and actual results are attached to the code snippets. ## Actual results Expected and actual results are attached to the code snippets. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.9.7 - PyArrow version: 5.0.0 I just pushed a fix ! We'll do a new release soon. In the meantime feel free to install `datasets` from source to play with it
[ -0.18471510708332062, 0.16124606132507324, -0.15162700414657593, 0.22353093326091766, -0.12694312632083893, -0.1254190355539322, 0.297874391078949, 0.23607715964317322, 0.3307054340839386, -0.2883334755897522, -0.08475915342569351, 0.5628126263618469, 0.17767268419265747, 0.05403637886047363, -0.15571986138820648, -0.014278315007686615, 0.08184784650802612, -0.24361154437065125, -0.07721114158630371, 0.0644923746585846, -0.009900938719511032, 0.1094735711812973, -0.05029169097542763, -0.1966572254896164, 0.18985892832279205, -0.18312270939350128, 0.1703658252954483, -0.044810302555561066, 0.03138240426778793, -0.3397790193557739, 0.18612316250801086, 0.1549554467201233, -0.175240620970726, 0.27250856161117554, -0.00011364613601472229, 0.017922699451446533, 0.4603433609008789, -0.0023182500153779984, -0.25606265664100647, -0.2721797823905945, -0.6779728531837463, -0.38432472944259644, 0.47518104314804077, 0.10452938824892044, 0.15815964341163635, -0.1409381628036499, -0.39439818263053894, -0.5809842944145203, 0.5498982071876526, 0.08364998549222946, 0.1865929812192917, 0.12394566833972931, 0.20131294429302216, 0.22799529135227203, 0.3071094751358032, 0.061276841908693314, -0.13291847705841064, -0.09857551753520966, 0.5059637427330017, 0.18163520097732544, -0.06062806397676468, 0.2830309569835663, -0.3123328983783722, -0.17993146181106567, -0.04569987952709198, 0.05149250105023384, -0.08057678490877151, -0.4002590477466583, 0.05598491430282593, 0.13273397088050842, 0.12094507366418839, -0.12226682156324387, -0.4533759355545044, -0.4508509039878845, -0.3495272397994995, -0.24326762557029724, 0.03143620863556862, 0.14143703877925873, -0.35386037826538086, 0.2027984857559204, -0.2764708697795868, -0.15564551949501038, 0.07275025546550751, 0.09354928880929947, -0.04994375631213188, 0.3183330297470093, -0.05502086877822876, -0.09428121894598007, -0.1449710875749588, -0.08416622877120972, 0.23272110521793365, -0.4712362289428711, -0.04653477296233177, -0.09894506633281708, -0.15490633249282837, -0.09155411273241043, 0.19651684165000916, -0.1078544333577156, 0.12434492260217667, 0.13708582520484924, -0.3421187996864319, 0.06782835721969604, 0.01036111544817686, 0.10231222212314606, 0.6082577705383301, -0.06460198760032654, 0.08349255472421646, 0.3204422891139984, -0.18848592042922974, 0.03615323081612587, -0.09405317902565002, -0.09709242731332779, 0.5751079320907593, 0.24249714612960815, 0.07030156254768372, -0.05738260596990585, 0.24192626774311066, -0.2012382596731186, -0.27594664692878723, 0.12025956064462662, -0.43741515278816223, 0.04930628463625908, 0.2863561809062958, -0.03169584274291992, 0.07126736640930176, 0.4016805589199066, 0.08979307115077972, 0.2228568196296692, 0.041494131088256836, 0.024008825421333313, -0.1476507931947708, -0.39274850487709045, -0.09273605048656464, 0.033222079277038574, -0.07205766439437866, -0.22173410654067993, 0.1971171796321869, 0.30137762427330017, 0.030212044715881348, -0.062028903514146805, -0.06995752453804016, -0.01826993003487587, 0.13095194101333618, 0.3366762101650238, -0.03153586387634277, 0.19307729601860046, 0.34083932638168335, -0.4169310927391052, 0.06291050463914871, 0.2294759452342987, -0.3842695951461792, 0.20784299075603485, -0.005167139694094658, 0.12131292372941971, -0.11193210631608963, 0.06075574830174446, -0.12062525004148483, 0.31636232137680054, 0.29558122158050537, 0.177317813038826, -0.07133614271879196, -0.17401935160160065, -0.2285032719373703, -0.1540699303150177, -0.13432055711746216, 0.41017383337020874, -0.39212068915367126, -0.06231335923075676, 0.008797498419880867, 0.17045332491397858, 0.2360628843307495, 0.22571583092212677, -0.341820627450943, -0.09326686710119247, 0.09233676642179489, -0.09113244712352753, 0.19583526253700256, -0.32950568199157715, -0.43985381722450256, 0.44211632013320923, 0.021187007427215576, 0.4617266356945038, 0.021836958825588226, -0.16580262780189514, 0.2958744764328003, -0.23839834332466125, 0.2526777684688568, 0.15854552388191223, -0.25399747490882874, -0.015349149703979492, -0.2694908082485199, 0.051836878061294556, 0.11757702380418777, -0.3335338532924652, -0.18580935895442963, 0.33279505372047424, 0.010090157389640808, 0.17931778728961945, 0.1677999198436737, 0.08307278156280518, 0.19885596632957458, 0.27634507417678833, 0.0519530214369297, 0.07036425918340683, -0.12756416201591492, -0.0912705659866333, -0.2597222924232483, -0.13545387983322144, 0.02083509787917137, -0.3145243227481842, -0.5268624424934387, -0.1500765085220337, -0.055661797523498535, 0.3636550009250641, 0.03191576898097992, 0.05908573418855667, 0.16264881193637848, 0.08878257870674133, -0.3272233307361603, 0.03652988001704216, -0.1532629132270813, 0.2062530368566513, 0.01905345357954502, 0.06944604963064194, -0.2959236204624176, 0.1946905255317688, 0.29362261295318604, 0.021441232413053513, -0.0025376565754413605, -0.10918959230184555, 0.3430593013763428, 0.22865790128707886, -0.058969929814338684, 0.2945376932621002, 0.5386203527450562, -0.1742345243692398, -0.1106800064444542, 0.25079262256622314, 0.2530078887939453, 0.07625488936901093, -0.07008570432662964, 0.4580594301223755, 0.1266881823539734, -0.08467762172222137, -0.19482064247131348, 0.45514386892318726, -0.42921361327171326, 0.18992091715335846, 0.06705782562494278, 0.24976962804794312, 0.33045893907546997, -0.09860967099666595, -0.33118847012519836, -0.328803688287735, -0.280112624168396, -0.21658159792423248, 0.2056816965341568, -0.1593928039073944, -0.4222959280014038, 0.49275341629981995, 0.2779899835586548, 0.2250119149684906, 0.021030619740486145, 0.10326145589351654, 0.14265291392803192, -0.031179528683423996, -0.024438707157969475, 0.3411138355731964, 0.34935134649276733, 0.23548288643360138, 0.25337904691696167, -0.06178046762943268, 0.014917995780706406, -0.20694728195667267, 0.25835832953453064, 0.25579479336738586, 0.144441619515419, 0.10698258876800537, 0.3125620186328888, -0.09406055510044098, -0.07033827155828476, -0.19859136641025543, -0.0905192568898201, -0.02392958663403988, -0.24676096439361572, 0.5204170942306519, -0.531216025352478, -0.19819524884223938, -0.18273968994617462, -0.5116313695907593, 0.1445445865392685, -0.4857126772403717, 0.09238561987876892, 0.43138372898101807, -0.29412367939949036, -0.08765720576047897, -0.11199457943439484, -0.06553788483142853, 0.23736660182476044, -0.08893074840307236, -0.14849349856376648, -0.07832250744104385, -0.15404203534126282, 0.040227700024843216, 0.41829076409339905, -0.16594769060611725, -0.09452129900455475, 0.2740504741668701, -0.2734483480453491, -0.18640801310539246, -0.40677547454833984, 0.21006429195404053, 0.040600501000881195, 0.330720990896225, 0.14016911387443542, -0.11338931322097778, -0.20448815822601318, -0.23777073621749878, -0.0199925284832716, 0.036894313991069794, -0.2550297975540161, 0.05976678431034088, 0.07305621355772018, 0.1169709637761116, -0.0949096828699112, -0.16077911853790283, -0.17772947251796722, -0.14106325805187225, 0.08273650705814362, 0.13721825182437897, 0.06860106438398361, 0.4495680630207062, -0.16903916001319885, -0.3041932284832001, 0.032164566218853, 0.008521631360054016, -0.07808867841959, -0.4054817855358124, 0.22192679345607758, -0.2311035692691803, -0.22205694019794464, -0.10034516453742981, 0.0942799523472786, -0.13705287873744965, 0.26311957836151123, -0.3425103425979614, 0.09814891219139099, 0.08787870407104492, 0.03522726520895958, -0.0163983553647995, -0.06004703789949417, 0.018178731203079224, 0.1340135931968689, -0.03300359845161438, -0.31385865807533264, 0.006215963512659073, -0.08298433572053909, -0.23921474814414978, 0.43581581115722656, -0.04881978780031204, 0.4624006152153015, 0.16438411176204681, 0.36496520042419434, 0.36749032139778137, 0.08791748434305191, 0.16323086619377136, 0.13793505728244781, 0.08475412428379059, -0.16782847046852112, -0.32899951934814453, -0.6673761606216431, -0.11209100484848022, -0.25302284955978394, -0.08225513994693756, 0.10795596241950989, -0.41625216603279114, -0.03765716031193733, 0.06028519198298454, -0.25022706389427185, -0.22656212747097015, -0.02649696357548237, -0.36271706223487854, 0.1486148089170456, 0.2905975580215454, 0.130977064371109, -0.14214836061000824, -0.3163142800331116, -0.3697647154331207, -0.09058123826980591, 0.20171557366847992, -0.07974778115749359, -0.15714214742183685, -0.014398939907550812, -0.24823617935180664, 0.04183030128479004, 0.09273546189069748, 0.42633700370788574, -0.05000689625740051, -0.032130636274814606, -0.20998559892177582, 0.1423538774251938, 0.6453760266304016, -0.29845911264419556, -0.0834609717130661, 0.2110823690891266, -0.26264095306396484, -0.19242334365844727, 0.1152464747428894, -0.3326689898967743, 0.3275090157985687, 0.4433329999446869, -0.011102169752120972, -0.18846862018108368, -0.1750921756029129, -0.06867260485887527, -0.014710838906466961, -0.004992462694644928, 0.09845558553934097, -0.1255108118057251, -0.14720851182937622, 0.10609346628189087, 0.03616345301270485, 0.1492302268743515, 0.3048466444015503, 0.05410340428352356, -0.1684626191854477, -0.08123810589313507, -0.13016849756240845, -0.12729477882385254, -0.13913168013095856, 0.21888837218284607, 0.17156873643398285, 0.1832258552312851, -0.17132169008255005, 0.3192785680294037, 0.10201427340507507, 0.27067720890045166, 0.3981141149997711, -0.06250803172588348, 0.009797077625989914, 0.011818298138678074, -0.02159755676984787, 0.2598821818828583, -0.09648823738098145, 0.15029768645763397, -0.05775175243616104, 0.10325708985328674, 0.2792081832885742, -0.6098539233207703, 0.034682244062423706, -0.10847191512584686, -0.10197070986032486, -0.16931428015232086, 0.23707109689712524, -0.13309696316719055, -0.14387227594852448, 0.4556034207344055, -0.28139281272888184, -0.27852505445480347, 0.4674651026725769, 0.11959974467754364, 0.6618340611457825, 0.3297942280769348, -0.2453741431236267, 0.2692957818508148, -0.41026097536087036, 0.7219453454017639, -0.29045727849006653, 0.08459067344665527, -0.06325919181108475, -0.20089615881443024, -0.08382243663072586, -0.07499277591705322, 0.1761646717786789, 0.031644828617572784, -0.006535220891237259, 0.2107536792755127, -0.32049262523651123, 0.222605362534523, 0.07729260623455048, 0.02532956749200821, 0.22957226634025574, -0.24130895733833313, -0.5211859345436096, 0.09048736095428467, 0.12214045226573944, -0.19663318991661072, -0.13640904426574707, -0.3907931447029114, -0.05222019925713539, -0.09972627460956573, -0.20704370737075806, 0.07715503126382828, 0.1347195953130722, 0.27535462379455566, 0.4606737792491913, -0.18466851115226746, 0.11649522185325623, 0.1171574741601944, 0.14283780753612518, -0.1567739099264145, -0.13529211282730103, 0.04578973725438118, -0.22437387704849243, 0.51961350440979, 0.18086965382099152, -0.2338750660419464, 0.4920262396335602, 0.08173316717147827, -0.13560819625854492, -0.07182902842760086, 0.1434355527162552, -0.5613762736320496, 0.011172041296958923, 0.2747534215450287, -0.0452338382601738, -0.2436586171388626, 0.0944947898387909, 0.18402695655822754, 0.20183150470256805, -0.24574318528175354, 0.13079310953617096, 0.05789077654480934, -0.29176589846611023, 0.4274536371231079, -0.17285974323749542, -0.017984561622142792, -0.15788590908050537, 0.5307115912437439, 0.29150572419166565, 0.13631436228752136, -0.07392647862434387, 0.3858100473880768, -0.23223838210105896, -0.058217961341142654, 0.1815846860408783, -0.06511852145195007, 0.06787378340959549, 0.15481099486351013, -0.555107593536377, 0.00037428736686706543, -0.12190186977386475, 0.03468655049800873, -0.21077950298786163, 0.34630411863327026, -0.07457844167947769, -0.6530781984329224, 0.10513518005609512, 0.26574742794036865, 0.12432244420051575, -0.2326275259256363, -0.30688369274139404, 0.26090100407600403, -0.14465603232383728, 0.09689679741859436, -0.24884207546710968, -0.05964972823858261, -0.005240526050329208, -0.014421321451663971, -0.23527631163597107, 0.16784068942070007, 0.31763458251953125, -0.21044813096523285, 0.06188749521970749, 0.0872306376695633, 0.05151189863681793, -0.19532406330108643, 0.04055096581578255, 0.07088762521743774, -0.03922044485807419, -0.14792178571224213, -0.09954273700714111, -0.09687874466180801, -0.031540919095277786, 0.010131449438631535, 0.198311910033226, 0.14919352531433105, 0.04643206298351288, -0.1515311896800995, -0.16322992742061615, -0.007141433656215668, 0.10607472062110901, -0.166041761636734, 0.11117732524871826, 0.1066613718867302, -0.056284766644239426, 0.40056973695755005, 0.10505474358797073, 0.04555714130401611, -0.4834800958633423, 0.0008832290768623352, -0.21841372549533844, 0.0506884902715683, 0.5528396964073181, -0.2080826610326767, -0.1635860949754715, 0.4838204085826874, 0.5228288173675537, 0.17978227138519287, -0.13799671828746796, 0.18275859951972961, -0.3051489591598511, 0.15276768803596497, -0.04152936860918999, -0.267403781414032, 0.4470843970775604, 0.5047742128372192, -0.03580132871866226, 0.2872407138347626, 0.18127256631851196, -0.09025882184505463, 0.35309332609176636, -0.02926560677587986, 0.4476739764213562, -0.10542336106300354, 0.49834680557250977, 0.3203928768634796, 0.13003745675086975, 0.267472505569458, 0.23362503945827484, 0.03326718881726265, 0.02263769507408142, 0.5594005584716797, 0.3961308002471924, 0.27259108424186707, 0.33177274465560913, -0.08140088617801666, -0.20188990235328674, -0.03707050159573555, 0.05720505863428116, 0.24540704488754272, 0.0425366647541523, -0.07093798369169235, 0.04003749042749405, -0.48923689126968384, 0.2463550716638565, -0.2254829704761505, 0.057664766907691956, 0.24185016751289368, -0.14157900214195251, -0.22742711007595062, -0.28106796741485596, -0.32666707038879395, 0.07072590291500092, 0.039452653378248215, 0.06773944944143295, -0.08611531555652618, 0.2598244547843933, 0.007378436625003815, 0.21841000020503998, -0.5806428790092468, -0.09142421931028366, 0.10469457507133484, 0.23849302530288696, -0.240794837474823, 0.24509786069393158, 0.09652667492628098, 0.053557105362415314, 0.08609718084335327, 0.28432661294937134, 0.1256157010793686, 0.23700442910194397, 0.052191246300935745, -0.12150833755731583, 0.03160984814167023, -0.3754718005657196, -0.1297173798084259, 0.4204675853252411, -0.12074658274650574, 0.03733726590871811, 0.22721998393535614, 0.15827718377113342, -0.054694078862667084, 0.43903645873069763, 0.3265421688556671, 0.0583549439907074, -0.29050013422966003, 0.17546817660331726, 0.001623891294002533, 0.25145241618156433, 0.10473670065402985, -0.3202597200870514, -0.036327995359897614, -0.17979688942432404, 0.4957881271839142, -0.07421441376209259, 0.2648763954639435, 0.044036272913217545, 0.08657921850681305, 0.05552198365330696, -0.006475280970335007, -0.10174722969532013, 0.03807356208562851, -0.026632823050022125, -0.09586816281080246, -0.07976920157670975, 0.11278996616601944, -0.0980355441570282, -0.10216651856899261, 0.15249906480312347, 0.3529859483242035, 0.11771857738494873, 0.47654467821121216, -0.29885268211364746, -0.3513239324092865, -0.21330595016479492, 0.05412466451525688, -0.13679374754428864, -0.1280902773141861, 0.04767461121082306, 0.15149345993995667, -0.08838944137096405, -0.20396503806114197, 0.316901296377182, 0.0006154812872409821, 0.07496444135904312, -0.08436522632837296, -0.05878712609410286, -0.1354571282863617, 0.029416240751743317, -0.2451590895652771, 0.453250527381897, 0.31441226601600647, 0.03421614319086075, -0.10491890460252762, -0.18291650712490082, -0.5120857954025269, -0.20767933130264282, 0.42216455936431885, -0.1766946017742157, 0.5816004276275635, -0.10095850378274918, -0.23453958332538605, -0.19947512447834015, 0.09709728509187698, -0.07152687013149261, 0.08942792564630508, -0.37973257899284363, 0.14483970403671265, -0.1123412549495697, 0.20501232147216797, -0.13135424256324768, 0.46511414647102356, -0.16083931922912598, 0.5011341571807861, 0.014713294804096222, -0.2652541697025299, 0.23650744557380676, -0.6418450474739075, -0.27973079681396484, 0.09028656035661697, 0.08008381724357605, 0.1353803128004074, -0.3896629810333252, -0.09858385473489761, -0.18193095922470093, 0.2118419110774994, -0.32046133279800415, -0.35762226581573486, 0.012697928585112095, 0.13775475323200226, 0.03040274605154991, -0.11123630404472351, -0.11333644390106201, 0.2854593098163605, -0.12270402163267136, 0.36201074719429016, -0.18197228014469147 ]
https://github.com/huggingface/datasets/issues/3005
DatasetDict.filter and Dataset.filter crashes with any "fn_kwargs" argument
Hi @DrMatters, thanks for reporting. This issue was fixed 14 days ago: #2950. Currently, the fix is only in the master branch and will be made available in our next library release. In the meantime, you can incorporate the fix by installing datasets from the master branch: ```shell pip install -U git+ssh://git@github.com/huggingface/datasets.git@master#egg=datasest ``` or ```shell pip install -U git+https://github.com/huggingface/datasets.git@master#egg=datasets ```
## Describe the bug The ".filter" method of DatasetDict or Dataset objects fails when passing any "fn_kwargs" argument ## Steps to reproduce the bug ```python import datasets example_dataset = datasets.Dataset.from_dict({"a": {1, 2, 3, 4}}) def filter_value(example, value): return example['a'] == value filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3}) ``` ## Expected results `filtered` is a dataset containing {"a": {3}} ## Actual results > Traceback (most recent call last): > File "C:\Users\qsemi\Documents\git\nlp_experiments\gpt_celebrity\src\test_faulty_filter.py", line 8, in <module> > filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3}) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper > out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper > out = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2169, in filter > indices = self.map( > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1686, in map > return self._map_single( > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper > out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper > out = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2048, in _map_single > batch = apply_function_on_filtered_inputs( > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1939, in apply_function_on_filtered_inputs > function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) > TypeError: get_indices_from_mask_function() got an unexpected keyword argument 'value' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.9.7 - PyArrow version: 5.0.0
60
DatasetDict.filter and Dataset.filter crashes with any "fn_kwargs" argument ## Describe the bug The ".filter" method of DatasetDict or Dataset objects fails when passing any "fn_kwargs" argument ## Steps to reproduce the bug ```python import datasets example_dataset = datasets.Dataset.from_dict({"a": {1, 2, 3, 4}}) def filter_value(example, value): return example['a'] == value filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3}) ``` ## Expected results `filtered` is a dataset containing {"a": {3}} ## Actual results > Traceback (most recent call last): > File "C:\Users\qsemi\Documents\git\nlp_experiments\gpt_celebrity\src\test_faulty_filter.py", line 8, in <module> > filtered = example_dataset.filter(filter_value, fn_kwargs={'value': 3}) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper > out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper > out = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2169, in filter > indices = self.map( > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1686, in map > return self._map_single( > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 185, in wrapper > out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\fingerprint.py", line 398, in wrapper > out = func(self, *args, **kwargs) > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 2048, in _map_single > batch = apply_function_on_filtered_inputs( > File "C:\Users\qsemi\miniconda3\envs\main\lib\site-packages\datasets\arrow_dataset.py", line 1939, in apply_function_on_filtered_inputs > function(*fn_args, effective_indices, **fn_kwargs) if with_indices else function(*fn_args, **fn_kwargs) > TypeError: get_indices_from_mask_function() got an unexpected keyword argument 'value' ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.19042-SP0 - Python version: 3.9.7 - PyArrow version: 5.0.0 Hi @DrMatters, thanks for reporting. This issue was fixed 14 days ago: #2950. Currently, the fix is only in the master branch and will be made available in our next library release. In the meantime, you can incorporate the fix by installing datasets from the master branch: ```shell pip install -U git+ssh://git@github.com/huggingface/datasets.git@master#egg=datasest ``` or ```shell pip install -U git+https://github.com/huggingface/datasets.git@master#egg=datasets ```
[ -0.16900233924388885, 0.1079782247543335, -0.09904605150222778, 0.21686837077140808, 0.0916617214679718, -0.12447191029787064, 0.06166013702750206, 0.34265387058258057, 0.12888695299625397, -0.004532530903816223, -0.07759284973144531, 0.511611819267273, -0.22486451268196106, 0.12225622683763504, -0.18081650137901306, -0.16172362864017487, 0.06691599637269974, -0.030667513608932495, -0.06286276876926422, -0.027979187667369843, -0.27750951051712036, 0.14598482847213745, -0.36335426568984985, 0.2622736990451813, 0.004214683547616005, -0.058163776993751526, 0.007182551547884941, 0.11706380546092987, -0.09769100695848465, -0.3816312849521637, 0.31975382566452026, 0.10381561517715454, -0.18842960894107819, 0.5421863794326782, -0.0001097718850360252, 0.2262018769979477, 0.3147907257080078, -0.0706833004951477, -0.48984935879707336, 0.04446091502904892, -0.16915404796600342, 0.0168052576482296, 0.08792440593242645, -0.20473849773406982, 0.03501542657613754, -0.3247828781604767, -0.3048883378505707, -0.39921343326568604, 0.32022860646247864, 0.5379630327224731, 0.22392944991588593, 0.12173525989055634, 0.09867225587368011, 0.05867614224553108, -0.050081245601177216, 0.2121107429265976, -0.11636234074831009, 0.05623682960867882, 0.2613701820373535, -0.17812399566173553, 0.031888365745544434, 0.16178204119205475, -0.3746825158596039, -0.22989647090435028, 0.08320745080709457, -0.23833619058132172, 0.013981692492961884, -0.1912640631198883, 0.2338470220565796, -0.02414003014564514, 0.02944907173514366, -0.38593053817749023, -0.3008987009525299, -0.2289021611213684, -0.17486074566841125, -0.07260236889123917, -0.12124650925397873, -0.06889645010232925, -0.514478862285614, 0.17256750166416168, -0.15251846611499786, 0.1442769467830658, -0.03066113218665123, 0.2332361787557602, -0.013353031128644943, 0.5024591684341431, -0.07433902472257614, 0.25034359097480774, 0.09684564918279648, -0.13969938457012177, 0.03322674706578255, -0.3823409080505371, -0.19653041660785675, -0.014739728532731533, -0.23400650918483734, -0.04102756828069687, 0.20074108242988586, -0.07176131755113602, 0.2608826160430908, -0.17365145683288574, -0.05090634524822235, 0.18814784288406372, 0.28515052795410156, 0.17322179675102234, 0.17173871397972107, 0.007445348426699638, 0.471015989780426, 0.34669893980026245, 0.1967473328113556, -0.23138457536697388, -0.2463461458683014, -0.004111144691705704, 0.21340909600257874, -0.17840316891670227, 0.025481898337602615, -0.03210902586579323, 0.3665739893913269, -0.23473097383975983, -0.42336204648017883, -0.12408929318189621, -0.22740831971168518, 0.28777849674224854, 0.3114435374736786, 0.32567501068115234, 0.1808873564004898, 0.1783577799797058, 0.07675447314977646, 0.02578698843717575, -0.010937506332993507, 0.0470324382185936, -0.20457300543785095, -0.1862516850233078, 0.07433702051639557, -0.0065200719982385635, 0.127401202917099, -0.2614809274673462, 0.29820486903190613, -0.16893091797828674, -0.0635608434677124, -0.04205574840307236, 0.17783045768737793, -0.10953782498836517, 0.11150780320167542, 0.3363690674304962, -0.27050545811653137, 0.06830398738384247, 0.27357757091522217, -0.271277517080307, 0.0021328404545783997, -0.05827298015356064, -0.3282701075077057, -0.19168536365032196, -0.002513384446501732, 0.2654924988746643, 0.09057116508483887, 0.03675173968076706, -0.3647671639919281, 0.35280725359916687, 0.19092947244644165, -0.14703015983104706, -0.03239195793867111, -0.40322256088256836, -0.44274240732192993, -0.4158332347869873, 0.32005879282951355, 0.3416738510131836, -0.39227259159088135, -0.08183448016643524, -0.29810741543769836, -0.1453658640384674, 0.10268861800432205, 0.10376285016536713, -0.2703128755092621, 0.0615401566028595, -0.20823585987091064, -0.01887037605047226, 0.5001471042633057, -0.29207733273506165, -0.32073095440864563, 0.18427887558937073, 0.1780930757522583, 0.3510618507862091, -0.12475099414587021, -0.02542426437139511, 0.10284463316202164, -0.1985168755054474, 0.28658393025398254, 0.2779533863067627, -0.1625915914773941, 0.037018924951553345, -0.17979039251804352, -0.12325389683246613, 0.1489044725894928, 0.07477185130119324, 0.057679932564496994, -0.021622806787490845, 0.057590167969465256, -0.38283970952033997, 0.18916350603103638, -0.08041428029537201, -0.09083353728055954, 0.12079378217458725, 0.5088139176368713, 0.03176562860608101, 0.2157408744096756, -0.29365405440330505, -0.3297326862812042, 0.1875578761100769, 0.2089962661266327, -0.2932584881782532, -0.27240681648254395, -0.3248456120491028, -0.12386534363031387, 0.22283527255058289, -0.27200475335121155, -0.2518543303012848, 0.26145410537719727, 0.04449593275785446, 0.12674351036548615, 0.03724035248160362, -0.012483052909374237, 0.28530701994895935, -0.2086115926504135, -0.01521280873566866, -0.00015056133270263672, 0.23706047236919403, -0.030649399384856224, -0.19987502694129944, -0.16629989445209503, 0.05568994581699371, 0.3513309955596924, 0.03849411755800247, -0.0839657261967659, 0.32906031608581543, 0.3637554943561554, -0.306731641292572, -0.032593339681625366, -0.01409865915775299, -0.06534798443317413, -0.25105124711990356, -0.02553573064506054, 0.46462884545326233, 0.2510257959365845, -0.20402494072914124, -0.025207147002220154, 0.26183563470840454, -0.027946095913648605, 0.1923235058784485, 0.0660528689622879, 0.17421361804008484, 0.18152044713497162, 0.1254570335149765, -0.13300099968910217, -0.04824452102184296, 0.024385176599025726, -0.23001424968242645, 0.20806430280208588, -0.08766654133796692, -0.30866768956184387, 0.16384634375572205, 0.23933498561382294, 0.20335577428340912, 0.29839032888412476, 0.11539062857627869, -0.11938218027353287, 0.12765511870384216, 0.014292610809206963, 0.27952706813812256, 0.6075778603553772, 0.20278939604759216, -0.15403592586517334, -0.04465079307556152, -0.12094759196043015, -0.07045434415340424, 0.2789676785469055, 0.2302938848733902, 0.07047560811042786, 0.11820845305919647, 0.226997971534729, 0.02804524451494217, -0.3119044303894043, -0.2885095477104187, -0.1402568221092224, 0.11482185125350952, -0.2915375530719757, 0.33860793709754944, -0.15047700703144073, -0.31108248233795166, -0.05685462802648544, 0.06912200152873993, 0.1010141670703888, -0.4233442544937134, -0.008594624698162079, 0.2850896418094635, -0.2425682544708252, 0.1305285394191742, -0.20986099541187286, 0.1827579140663147, 0.2200363129377365, -0.10053423792123795, -0.0754382461309433, -0.2359614074230194, -0.21000567078590393, 0.08826833963394165, 0.2592341899871826, 0.2625146508216858, 0.4690304398536682, 0.36222076416015625, -0.10231862962245941, -0.2637175917625427, -0.5074988007545471, -0.09689301252365112, -0.09478774666786194, 0.688158392906189, 0.3183228373527527, 0.278073787689209, -0.034182317554950714, -0.31620752811431885, 0.07453671842813492, 0.05255158245563507, -0.10962837189435959, 0.23273181915283203, 0.10516244173049927, -0.06747540086507797, -0.2983948886394501, -0.08077826350927353, -0.5075432062149048, -0.4076521098613739, -0.19958676397800446, -0.19432301819324493, 0.09093952178955078, 0.47227761149406433, 0.243912935256958, 0.3095429539680481, -0.11694952100515366, 0.09393908828496933, 0.056086841970682144, 0.16937875747680664, 0.18553966283798218, -0.15245723724365234, -0.2668394148349762, -0.29217901825904846, -0.048536643385887146, -0.0816715657711029, 0.1622704118490219, -0.39211124181747437, -0.38289088010787964, -0.17462897300720215, 0.11370807886123657, 0.24659541249275208, -0.15690506994724274, 0.005277067422866821, 0.1844130903482437, -0.06085427105426788, -0.24716460704803467, -0.15497371554374695, -0.02687940001487732, -0.21905550360679626, 0.02875041961669922, 0.17315077781677246, 0.5743713974952698, 0.16422149538993835, 0.5488060712814331, 0.35254138708114624, -0.2236236184835434, 0.20972999930381775, 0.060183703899383545, 0.2790089547634125, -0.16776582598686218, -0.6527611613273621, -0.1466996669769287, -0.03839707374572754, 0.018252212554216385, -0.1010265201330185, -0.0464368611574173, -0.07527272403240204, -0.1530894637107849, -0.11731119453907013, -0.13675156235694885, -0.2625899314880371, 0.014611000195145607, -0.10699479281902313, 0.18115583062171936, -0.07632564753293991, 0.20059442520141602, -0.12168841063976288, 0.027478523552417755, -0.1504603922367096, 0.06460673362016678, -0.03498976677656174, 0.07190969586372375, -0.48168277740478516, -0.2141844779253006, -0.023986317217350006, 0.2693648338317871, 0.04976885765790939, 0.555006206035614, -0.1073121502995491, 0.1943889558315277, -0.19192905724048615, -0.04723218455910683, 0.8466086387634277, -0.27575185894966125, 0.14587362110614777, 0.15939855575561523, -0.010564209893345833, -0.6463456153869629, 0.12671756744384766, -0.22278614342212677, 0.2210211455821991, 0.12656031548976898, 0.2599549889564514, -0.1384579837322235, -0.1297437995672226, 0.022649288177490234, 0.12990745902061462, -0.11543616652488708, 0.03869137912988663, -0.10205353051424026, -0.4619157910346985, -0.062279023230075836, 0.09820739179849625, 0.0031231921166181564, 0.05828782543540001, -0.27508416771888733, -0.15991507470607758, -0.1245405375957489, -0.2991049885749817, 0.0929211750626564, 0.26083043217658997, 0.18045726418495178, -0.05871692672371864, 0.14715057611465454, -0.22342729568481445, 0.08711406588554382, 0.32452043890953064, 0.42467421293258667, 0.035054512321949005, -0.2160862386226654, -0.22813495993614197, 0.13090240955352783, 0.24171212315559387, 0.24637269973754883, -0.33580097556114197, 0.19305580854415894, -0.18135876953601837, 0.08306602388620377, 0.28669050335884094, 0.04428129643201828, 0.26948508620262146, -0.08021427690982819, -0.4215717315673828, -0.2529114782810211, 0.42855170369148254, 0.19223983585834503, -0.03250281512737274, 0.6893377304077148, 0.2067144364118576, -0.5298973321914673, 0.45586079359054565, 0.0253191739320755, 0.643305242061615, 0.39183175563812256, -0.07658839225769043, 0.18433865904808044, -0.23688705265522003, 0.2939629554748535, 0.42007458209991455, -0.03727835416793823, -0.14476849138736725, -0.28995952010154724, -0.001526394858956337, -0.24498295783996582, 0.339754581451416, 0.034513913094997406, -0.4310869872570038, 0.23520071804523468, -0.2878590226173401, -0.12632668018341064, 0.03316306322813034, 0.17827846109867096, 0.037151556462049484, 0.08179232478141785, -0.32886242866516113, 0.24432724714279175, -0.13776777684688568, -0.2126445472240448, 0.13524535298347473, -0.1226300597190857, 0.08049535751342773, -0.42199820280075073, -0.3645240068435669, -0.04106799513101578, -0.43004855513572693, 0.4141045808792114, 0.1808406561613083, -0.11072088032960892, 0.07746641337871552, -0.0077536702156066895, 0.2179054468870163, 0.13790357112884521, -0.09815237671136856, 0.11168290674686432, 0.07590557634830475, 0.3120613992214203, -0.015312465839087963, -0.08343350887298584, 0.3994103670120239, 0.09763035923242569, -0.24761784076690674, 0.3056807518005371, -0.051569703966379166, -0.44889819622039795, -0.25844815373420715, -0.06393574178218842, 0.03099392168223858, -0.06493119150400162, -0.35310983657836914, -0.28179022669792175, -0.3351396918296814, -0.265668660402298, 0.172392800450325, -0.03659456968307495, -0.10042092204093933, 0.36068999767303467, 0.05284885689616203, -0.06554287672042847, 0.11190038919448853, 0.3254490792751312, -0.11493971198797226, 0.29409727454185486, 0.40401726961135864, 0.18210287392139435, -0.17271077632904053, -0.2407223880290985, -0.09208402782678604, 0.12335558235645294, -0.11593861877918243, 0.1962098777294159, -0.10819896310567856, 0.03823380172252655, 0.2234247624874115, 0.34345242381095886, -0.14704203605651855, 0.0462162047624588, -0.29322555661201477, -0.41208624839782715, 0.030984537675976753, 0.19004496932029724, 0.041654203087091446, 0.2860916256904602, -0.022320488467812538, -0.03730236366391182, -0.08012514561414719, 0.22115874290466309, -0.35711729526519775, 0.018292495980858803, -0.03229503333568573, 0.2716785669326782, 0.11750908195972443, 0.24916157126426697, -0.005028287880122662, -0.049779195338487625, 0.1287449151277542, 0.16591644287109375, -0.09759615361690521, -0.27918973565101624, -0.032890643924474716, 0.0834021046757698, 0.10337536782026291, -0.19982951879501343, -0.12160643935203552, -0.306459903717041, -0.13562114536762238, 0.0749501883983612, 0.22012591361999512, 0.17795276641845703, -0.2221096009016037, 0.20917552709579468, -0.008190881460905075, 0.1308487504720688, 0.43776237964630127, 0.16444604098796844, -0.22790521383285522, -0.2515941858291626, 0.24602724611759186, 0.31497591733932495, -0.00048267957754433155, -0.06321914494037628, -0.16051167249679565, 0.04230331629514694, -0.390891969203949, 0.11013748496770859, 0.27136826515197754, -0.3385276198387146, -0.10844074189662933, 0.16073466837406158, 0.05976119637489319, 0.5403458476066589, -0.3430769443511963, 0.11123745143413544, 0.17645305395126343, 0.2362789511680603, -0.14765790104866028, -0.2225094586610794, 0.2155805081129074, 0.28721171617507935, 0.22843429446220398, 0.13830560445785522, -0.2653595805168152, -0.26006966829299927, 0.31282928586006165, 0.11862156540155411, 0.44033870100975037, 0.009339114651083946, 0.21654944121837616, 0.3943580985069275, 0.09324398636817932, -0.1905049830675125, -0.20051054656505585, 0.024281024932861328, 0.20440199971199036, 0.703144907951355, 0.0067305490374565125, 0.3847803771495819, 0.1138620600104332, -0.11087210476398468, 0.2865806221961975, 0.0555807389318943, 0.14541953802108765, 0.048222124576568604, -0.5161336064338684, 0.1754084676504135, 0.10785812139511108, -0.17005711793899536, -0.10373099148273468, -0.41124406456947327, 0.09826534241437912, 0.18520070612430573, -0.13346409797668457, -0.0605752170085907, -0.5739434957504272, -0.15216052532196045, 0.06582729518413544, -0.20965225994586945, 0.03419128805398941, -0.2641203999519348, 0.17529910802841187, -0.07350559532642365, -0.2042621225118637, -0.30797529220581055, 0.005703704431653023, 0.16891786456108093, 0.2716524004936218, -0.08692436665296555, 0.139002725481987, 0.34906381368637085, 0.16072160005569458, 0.08618014305830002, 0.2168220579624176, 0.30634480714797974, 0.597375750541687, -0.064398854970932, 0.07130127400159836, -0.02787080407142639, -0.28381723165512085, -0.08431697636842728, 0.17824096977710724, -0.12849949300289154, 0.053710244596004486, 0.3853857219219208, 0.2489846646785736, -0.12815025448799133, -0.22266022861003876, 0.3440536856651306, 0.23526163399219513, -0.39211583137512207, 0.25443845987319946, -0.14846836030483246, 0.034094229340553284, 0.04231365770101547, -0.00661429762840271, -0.29848894476890564, -0.1345064491033554, 0.479280948638916, 0.07098560035228729, 0.3277207314968109, -0.13466647267341614, 0.10645164549350739, 0.015158090740442276, 0.36090219020843506, 0.11147364974021912, 0.11130374670028687, -0.13464346528053284, -0.10951586067676544, -0.40272653102874756, -0.16309881210327148, -0.13120749592781067, -0.05242049694061279, 0.1003156453371048, -0.09221760928630829, 0.07478846609592438, 0.20510192215442657, -0.13150350749492645, 0.31283584237098694, 0.024981942027807236, 0.03934129327535629, -0.3758438229560852, -0.17704689502716064, -0.16953352093696594, 0.06467875093221664, 0.14386117458343506, -0.5005151033401489, 0.13376101851463318, -0.4088295102119446, 0.28763195872306824, -0.012862786650657654, -0.17550677061080933, 0.16429422795772552, 0.17909197509288788, 0.07675023376941681, 0.17067395150661469, 0.37910979986190796, -0.004608193412423134, 0.0519602969288826, -0.16822272539138794, -0.033914823085069656, -0.18038688600063324, -0.01174934208393097, 0.12465520203113556, 0.5006591081619263, -0.0698176920413971, -0.32596835494041443, 0.05194275826215744, 0.142104372382164, -0.011861860752105713, -0.08782830834388733, -0.010507885366678238, 0.22999802231788635, 0.08306818455457687, -0.07677371054887772, -0.24664825201034546, 0.20442244410514832, -0.05112341046333313, 0.24686236679553986, -0.0974562019109726, -0.389078289270401, 0.6315686702728271, -0.6145281791687012, -0.3486621677875519, -0.03141311928629875, 0.18276934325695038, -0.0020262226462364197, -0.2349810004234314, -0.14368045330047607, -0.17303243279457092, 0.4358137547969818, -0.19789433479309082, -0.07395245879888535, 0.24156512320041656, 0.006253949366509914, 0.05849289521574974, -0.058847952634096146, -0.2149347960948944, 0.22629445791244507, -0.035429760813713074, 0.2560603618621826, -0.12461379915475845 ]
https://github.com/huggingface/datasets/issues/2997
Dataset has incorrect labels
Hi @marshmellow77, thanks for reporting. That issue is fixed since `datasets` version 1.9.0 (see 16bc665f2753677c765011ef79c84e55486d4347). Please, update `datasets` with: `pip install -U datasets`
The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached: ![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG)
23
Dataset has incorrect labels The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached: ![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG) Hi @marshmellow77, thanks for reporting. That issue is fixed since `datasets` version 1.9.0 (see 16bc665f2753677c765011ef79c84e55486d4347). Please, update `datasets` with: `pip install -U datasets`
[ 0.08271722495555878, -0.3300798237323761, -0.16857731342315674, 0.15476930141448975, 0.03819574415683746, 0.21518635749816895, 0.3849946856498718, 0.004070485010743141, -0.16301171481609344, -0.10926732420921326, -0.30495673418045044, 0.14517641067504883, 0.14692085981369019, 0.5568857789039612, 0.05491439253091812, 0.10131125152111053, 0.2955244779586792, -0.13420556485652924, 0.03686109930276871, -0.2108727991580963, -0.2134610265493393, 0.1943989396095276, -0.1512172818183899, 0.10988305509090424, -0.36909815669059753, 0.036876942962408066, 0.19585520029067993, -0.4579507112503052, -0.08220301568508148, -0.59345942735672, 0.25208213925361633, 0.15212737023830414, -0.3049568831920624, 0.46990767121315, -0.00010665196168702096, -0.0895581915974617, 0.30183857679367065, 0.06576065719127655, -0.015221023932099342, -0.33976519107818604, 0.08911088854074478, -0.5006153583526611, -0.13890962302684784, -0.0888424888253212, -0.08918868005275726, -0.3566967248916626, -0.08528877049684525, 0.19741284847259521, 0.08241648226976395, 0.1368916928768158, 0.2477027177810669, -0.020301127806305885, -0.08233252912759781, 0.066472627222538, 0.15348777174949646, 0.3733442425727844, -0.212785005569458, 0.05245766416192055, 0.09073618054389954, -0.0468922033905983, 0.18765044212341309, 0.5746163725852966, -0.14989124238491058, -0.027110349386930466, 0.13524892926216125, -0.023033685982227325, 0.02356594055891037, -0.46602609753608704, 0.35386693477630615, 0.38765081763267517, 0.716380774974823, -0.420276403427124, -0.5077400803565979, -0.24382182955741882, -0.06626922637224197, -0.3324432373046875, 0.03357063606381416, 0.26809075474739075, 0.05533787980675697, 0.05984670668840408, -0.29841986298561096, 0.04034972935914993, 0.08721606433391571, 0.15965121984481812, 0.09317415952682495, 0.3455204963684082, -0.14065121114253998, 0.02868802472949028, 0.17366841435432434, -0.10517837107181549, 0.29987746477127075, 0.18378056585788727, -0.10752584040164948, 0.08256173133850098, -0.3549918532371521, -0.0566536970436573, -0.030934877693653107, 0.2112623155117035, 0.2016008198261261, -0.07698014378547668, 0.17085614800453186, 0.04612807556986809, -0.031593043357133865, -0.036134421825408936, 0.1173602044582367, 0.17514900863170624, 0.5971418619155884, 0.16371537744998932, -0.13754919171333313, 0.12728837132453918, 0.20485875010490417, 0.059558674693107605, 0.13903935253620148, -0.133886456489563, 0.1390378475189209, 0.025407077744603157, -0.24100849032402039, -0.23127129673957825, -0.36424168944358826, 0.37828007340431213, -0.21078738570213318, -0.006928723771125078, 0.0735931470990181, 0.21733450889587402, -0.09652387350797653, 0.07327884435653687, -0.2972213625907898, 0.22618155181407928, 0.02391660399734974, -0.07305513322353363, -0.19054996967315674, 0.1514110416173935, -0.17105911672115326, -0.0996088758111, 0.3232778310775757, -0.14798104763031006, 0.5818251371383667, 0.0012213224545121193, -0.09486818313598633, -0.27632224559783936, -0.19505135715007782, -0.330287903547287, 0.26331964135169983, 0.298204630613327, -0.20061397552490234, 0.27611780166625977, 0.14480799436569214, 0.0609835684299469, -0.0716899037361145, 0.26492762565612793, -0.27693507075309753, 0.1679258495569229, 0.10861267149448395, 0.20462261140346527, -0.17089523375034332, -0.49598827958106995, -0.23382624983787537, 0.28752851486206055, 0.12084770202636719, 0.158343106508255, 0.05143335089087486, -0.012853957712650299, -0.09522104263305664, -0.056392841041088104, 0.03082233853638172, 0.11143840849399567, -0.46093907952308655, -0.1728873997926712, -0.3021656274795532, -0.06757086515426636, -0.011901013553142548, 0.3279072344303131, 0.17353245615959167, 0.13095511496067047, 0.19325807690620422, 0.1423787921667099, -0.02640477567911148, -0.2673938572406769, -0.37471628189086914, -0.08253484964370728, 0.048275090754032135, -0.16601790487766266, -0.13217812776565552, 0.20467227697372437, 0.11089114099740982, 0.17529082298278809, -0.14344504475593567, -0.11852683126926422, 0.3017590641975403, 0.15967503190040588, -0.27081969380378723, -0.23433935642242432, 0.20064270496368408, 0.1868005394935608, 0.20925919711589813, 0.016237765550613403, -0.3023097515106201, -0.34593290090560913, 0.19302967190742493, 0.16903935372829437, -0.1395741105079651, 0.4623104929924011, 0.4301406443119049, 0.36498701572418213, 0.21819955110549927, 0.008318986743688583, -0.3710203766822815, -0.006448268890380859, -0.20468920469284058, 0.1879345178604126, 0.17895716428756714, -0.31648218631744385, -0.5133300423622131, 0.007411671802401543, -0.10405795276165009, -0.1723654568195343, 0.23632577061653137, 0.023368142545223236, -0.14598214626312256, 0.20999765396118164, -0.21804890036582947, 0.2396513968706131, 0.12502604722976685, 0.24497270584106445, 0.11816054582595825, 0.11703436076641083, 0.03447841852903366, 0.062439583241939545, 0.13359150290489197, 0.22139936685562134, 0.23872846364974976, 0.18186688423156738, -0.025570575147867203, 0.15884147584438324, -0.17046700417995453, 0.22293879091739655, -0.051041729748249054, 0.028074875473976135, 0.1396649330854416, -0.3854641616344452, -0.30651718378067017, 0.24867451190948486, 0.017702724784612656, 0.01734595000743866, -0.17849165201187134, 0.28581270575523376, -0.08308793604373932, 0.04021110013127327, -0.36367809772491455, 0.0962584912776947, 0.0925723984837532, -0.1040455549955368, -0.013748017139732838, -0.49955886602401733, 0.4471006691455841, -0.23862765729427338, 0.3529192805290222, 0.1672915667295456, -0.01738050952553749, 0.25891533493995667, 0.3035740554332733, -0.009061070159077644, 0.03365959972143173, 0.0664556473493576, -0.053818605840206146, -0.012112983502447605, 0.2746826708316803, 0.11380369961261749, 0.03327921777963638, 0.18771040439605713, -0.19043084979057312, 0.12061396986246109, 0.005571957677602768, -0.08816477656364441, 0.00334920734167099, -0.06419378519058228, -0.06505770236253738, 0.19527053833007812, 0.18827275931835175, -0.23156307637691498, -0.3235931098461151, 0.18722854554653168, 0.15604320168495178, 0.34564951062202454, -0.4204520285129547, 0.06962312012910843, -0.20377829670906067, -0.17378589510917664, -0.24009636044502258, -0.3208130896091461, -0.5267137289047241, -0.46271488070487976, 0.22741928696632385, -0.04281110689043999, -0.08017997443675995, 0.24582692980766296, 0.14559124410152435, -0.09851564466953278, -0.2612766921520233, 0.12303576618432999, -0.26089414954185486, -0.36474302411079407, -0.1340237557888031, -0.009642872959375381, -0.0974869579076767, 0.17701147496700287, 0.3007126748561859, -0.4100845754146576, -0.28387510776519775, -0.28167539834976196, -0.387836754322052, 0.15966829657554626, -0.2572084069252014, 0.0755259096622467, -0.02350062131881714, -0.07198768854141235, -0.2795679569244385, 0.16346220672130585, 0.3201037645339966, 0.003661593422293663, 0.029768871143460274, -0.05422501638531685, -0.16009218990802765, -0.19951672852039337, -0.051356375217437744, -0.3800831437110901, -0.13248665630817413, -0.0038542822003364563, 0.18675664067268372, -0.14260944724082947, 0.17302599549293518, 0.008248121477663517, -0.16968347132205963, -0.11815512925386429, -0.2791818678379059, -0.02261182852089405, -0.37515440583229065, -0.21142368018627167, 0.008340053260326385, -0.09207595139741898, -0.21125248074531555, 0.05768616870045662, 0.22495974600315094, -0.028400558978319168, -0.09164147078990936, -0.3723657727241516, 0.001077449880540371, 0.01445801556110382, 0.05632421001791954, 0.13783769309520721, -0.04762258380651474, -0.11904498934745789, 0.11508551985025406, -0.04731373116374016, -0.26238468289375305, -0.2892483174800873, 0.13638609647750854, -0.19761943817138672, 0.21095524728298187, -0.15588602423667908, 0.10900382697582245, 0.013791650533676147, 0.1759946048259735, 0.31667476892471313, -0.0861085057258606, 0.12549491226673126, -0.16264763474464417, 0.29855790734291077, 0.15132950246334076, -0.42801201343536377, 0.17175012826919556, 0.08116722106933594, 0.2911854386329651, 0.35442274808883667, 0.041858553886413574, -0.15510810911655426, -0.15428878366947174, 0.19734492897987366, -0.5767567157745361, -0.008731890469789505, -0.14571312069892883, 0.15369099378585815, 0.16815941035747528, 0.13925467431545258, 0.09371399134397507, -0.1579010784626007, -0.2913406193256378, 0.11774922907352448, -0.1667502075433731, -0.24493452906608582, 0.041028447449207306, -0.648054838180542, -0.2468327432870865, -0.37395110726356506, -0.004772305488586426, 0.0921241044998169, 0.3312281668186188, -0.22123970091342926, 0.22559890151023865, 0.13763542473316193, 0.09249363839626312, 0.5424327850341797, -0.416706919670105, 0.18558132648468018, 0.08201582729816437, 0.31678974628448486, -0.22883200645446777, -0.10380556434392929, -0.20825570821762085, 0.3379409611225128, 0.10152676701545715, 0.26709237694740295, -0.36814457178115845, -0.06026102602481842, 0.35024651885032654, 0.07745923846960068, -0.20475910604000092, -0.12130234390497208, -0.3867678940296173, -0.2813328504562378, 0.12656153738498688, -0.0771932378411293, 0.007819106802344322, 0.1082065999507904, -0.1458393633365631, 0.16327376663684845, 0.3105723559856415, 0.3206292390823364, 0.09345492720603943, 0.11299657821655273, 0.1941642463207245, -0.0760892853140831, 0.01186252012848854, 0.008379146456718445, 0.1496829390525818, 0.21745428442955017, 0.6610541939735413, -0.12131448090076447, -0.6747933626174927, -0.2841811776161194, -0.32531583309173584, 0.07934747636318207, 0.09502261877059937, 0.17528586089611053, 0.1405489593744278, -0.06874154508113861, 0.13549664616584778, 0.1912100464105606, -0.02055506967008114, 0.46935102343559265, 0.38813847303390503, -0.3005380928516388, -0.26662304997444153, 0.7396883368492126, 0.12045229971408844, 0.005161657929420471, 0.035615187138319016, 0.35315775871276855, -0.13117411732673645, 0.10191472619771957, 0.18855437636375427, 0.8115168809890747, 0.0903697982430458, -0.11393947899341583, 0.1669594943523407, -0.28149718046188354, 0.2880137860774994, -0.03995860740542412, 0.03367617726325989, -0.5040927529335022, -0.041235629469156265, -0.10143531858921051, 0.13521720468997955, -0.03036344051361084, 0.38988643884658813, -0.09854912757873535, 0.2825697362422943, -0.08968064188957214, 0.16968253254890442, 0.0014509642496705055, -0.2735339403152466, 0.07515198737382889, -0.06327532231807709, -0.16674228012561798, 0.22321566939353943, -0.19634856283664703, 0.47661271691322327, -0.22023814916610718, 0.2415948361158371, -0.18260179460048676, 0.004125773906707764, -0.543358564376831, -0.18991944193840027, -0.21015797555446625, -0.0756591185927391, 0.2777573764324188, -0.27569085359573364, -0.1721847504377365, 0.19620151817798615, 0.6663334965705872, 0.17142397165298462, -0.1466401219367981, -0.060592446476221085, 0.15527042746543884, 0.14135752618312836, 0.2448473572731018, 0.00909260381013155, 0.25474947690963745, -0.05643070861697197, -0.4309333264827728, -0.13902881741523743, 0.21086564660072327, 0.26713669300079346, -0.27373844385147095, -0.04678866267204285, -0.36669087409973145, -0.1524207592010498, -0.06268033385276794, 0.037121355533599854, 0.13988585770130157, -0.1112188994884491, 0.17401082813739777, 0.06190074235200882, -0.10665936768054962, 0.1407741904258728, -0.08300520479679108, -0.3194647431373596, -0.2214176207780838, 0.3882100582122803, -0.011974833905696869, -0.18485195934772491, 0.1041790246963501, 0.06574538350105286, -0.34159862995147705, -0.2729063332080841, 0.08851013332605362, 0.29923784732818604, -0.49147146940231323, -0.08253628015518188, 0.015711599960923195, -0.19602413475513458, -0.15230824053287506, 0.16289731860160828, 0.17686502635478973, 0.2576024830341339, -0.04183965176343918, -0.07677852362394333, -0.027411766350269318, 0.31853121519088745, 0.3038652241230011, -0.09323492646217346, 0.019573763012886047, 0.07523389905691147, 0.30183714628219604, -0.2312910556793213, -0.35275888442993164, 0.13643674552440643, -0.047087691724300385, 0.012489767745137215, 0.030271951109170914, -0.05624467879533768, -0.1266905665397644, -0.06486043334007263, 0.18287697434425354, -0.09427087008953094, -0.02774001657962799, -0.2027912735939026, -0.06583966314792633, 0.07156994938850403, 0.1181945949792862, 0.05167455971240997, -0.132337287068367, 0.1378336101770401, -0.1606297791004181, -0.09722059220075607, 0.19250676035881042, 0.543721079826355, 0.15682163834571838, 0.5790255069732666, -0.07831385731697083, 0.21885061264038086, 0.12661421298980713, -0.02635093405842781, -0.0684516578912735, -0.20796798169612885, 0.20480641722679138, 0.09418168663978577, 0.22852511703968048, 0.1154855489730835, 0.1651855707168579, 0.04198930412530899, 0.014640569686889648, 0.10082236677408218, 0.33673566579818726, -0.4975811243057251, 0.6125786900520325, 0.438999742269516, 0.5735172033309937, 0.1275961995124817, -0.011471163481473923, -0.06736654788255692, 0.45124152302742004, 0.26137858629226685, -0.41758081316947937, -0.3979511559009552, 0.2180318981409073, 0.011425357311964035, 0.12988795340061188, 0.002790480852127075, 0.2452327311038971, 0.06406435370445251, 0.06462381035089493, 0.08768142014741898, 0.5999375581741333, -0.19635246694087982, 0.2197331339120865, 0.19205361604690552, -0.07776333391666412, 0.23048433661460876, 0.41367340087890625, 0.01675877347588539, -0.035973452031612396, 0.14317992329597473, 0.15819883346557617, 0.41868242621421814, 0.0423557385802269, 0.0990937352180481, -0.011545591056346893, 0.03310411050915718, -0.006292976438999176, 0.15510569512844086, -0.15681859850883484, 0.3422335684299469, -0.07738779485225677, 0.4299315810203552, -0.1964656114578247, -0.1453889161348343, -0.3830498456954956, 0.023374030366539955, -0.236561119556427, -0.17280276119709015, -0.1845380663871765, 0.0366685688495636, -0.09158135205507278, -0.010438350960612297, -0.27287575602531433, -0.39288002252578735, 0.19313886761665344, -0.0852513462305069, -0.38491833209991455, -0.5086577534675598, -0.4164449870586395, 0.22173449397087097, 0.41210347414016724, -0.07397973537445068, -0.01048400066792965, 0.031772442162036896, 0.01719198375940323, -0.05668443813920021, 0.4673250615596771, 0.23516236245632172, 0.17401140928268433, 0.2302669733762741, -0.2000739723443985, -0.3095571994781494, -0.046459052711725235, 0.15020297467708588, 0.20646053552627563, 0.09532375633716583, -0.16513629257678986, 0.1365053951740265, 0.12215277552604675, -0.23517024517059326, 0.2622763216495514, 0.07005905359983444, 0.4042035937309265, -0.07523606717586517, -0.1681349277496338, -0.46961739659309387, -0.21520650386810303, -0.2715360224246979, -0.2647153437137604, -0.2630104422569275, -0.09870368987321854, 0.32953333854675293, 0.18931804597377777, 0.21890860795974731, -0.1986813247203827, 0.15166057646274567, -0.09218278527259827, 0.41379472613334656, 0.2053239345550537, -0.10092047601938248, -0.044097550213336945, 0.08146136999130249, -0.5271426439285278, 0.1077788770198822, -0.08721216022968292, -0.052435483783483505, 0.09682431071996689, -0.31414857506752014, -0.1925967037677765, 0.3057958483695984, 0.15629571676254272, -0.05139511451125145, 0.01961176097393036, 0.12133844941854477, -0.34647423028945923, 0.05768997594714165, 0.05083046853542328, 0.1679554432630539, 0.005645580589771271, 0.07862567156553268, 0.09269054234027863, 0.024033650755882263, 0.033844418823719025, -0.2172323614358902, 0.11110417544841766, 0.044744882732629776, 0.05567605048418045, -0.08665403723716736, -0.044498369097709656, 0.38621652126312256, 0.05459339916706085, -0.03247792646288872, -0.17946624755859375, -0.2871556580066681, -0.25892600417137146, 0.34603503346443176, -0.023273244500160217, 0.2552734315395355, -0.06348875910043716, -0.2715824842453003, 0.11716819554567337, 0.06076718121767044, 0.2782953977584839, -0.13352227210998535, -0.36931803822517395, -0.010167205706238747, 0.38351425528526306, -0.2909552752971649, 0.10843292623758316, 0.14684391021728516, 0.07382349669933319, 0.20234480500221252, -0.16170187294483185, -0.5683605074882507, 0.4541153311729431, -0.08587515354156494, 0.09556293487548828, -0.16616640985012054, 0.2398301362991333, 0.565208375453949, -0.25668302178382874, -0.36857831478118896, 0.22395938634872437, 0.22757691144943237, 0.08712723851203918, -0.22105194628238678, 0.15025274455547333, -0.3327466547489166, 0.03112935647368431, -0.09050486981868744, 0.24651038646697998, 0.3206457197666168, -0.1745673418045044, 0.18511521816253662, 0.021222375333309174 ]
https://github.com/huggingface/datasets/issues/2997
Dataset has incorrect labels
Thanks. Please note that the dataset explorer (https://huggingface.co/datasets/viewer/?dataset=turkish_product_reviews) still shows the incorrect state. The sentiment for the first few customer reviews is actually negative and should be labelled with "0", see screenshot: ![Capture1](https://user-images.githubusercontent.com/63367770/135637150-93d9b09b-f1dd-4701-97a5-5cb2672ec0c7.PNG)
The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached: ![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG)
33
Dataset has incorrect labels The dataset https://huggingface.co/datasets/turkish_product_reviews has incorrect labels - all reviews are labelled with "1" (positive sentiment). None of the reviews is labelled with "0". See screenshot attached: ![Capture](https://user-images.githubusercontent.com/63367770/135617428-14ce0b27-5208-4e66-a3ee-71542e3257b4.PNG) Thanks. Please note that the dataset explorer (https://huggingface.co/datasets/viewer/?dataset=turkish_product_reviews) still shows the incorrect state. The sentiment for the first few customer reviews is actually negative and should be labelled with "0", see screenshot: ![Capture1](https://user-images.githubusercontent.com/63367770/135637150-93d9b09b-f1dd-4701-97a5-5cb2672ec0c7.PNG)
[ 0.09255559742450714, -0.34241512417793274, -0.14701488614082336, 0.22143594920635223, -0.12447524070739746, 0.17507696151733398, 0.20920506119728088, -0.009016752243041992, -0.19046731293201447, -0.2527102828025818, -0.32562360167503357, -0.024850919842720032, 0.10527165979146957, 0.48313236236572266, 0.01002389658242464, 0.07661415636539459, 0.30299434065818787, -0.14755824208259583, 0.17476686835289001, -0.233675017952919, -0.16301724314689636, 0.24473311007022858, -0.18437567353248596, 0.10971922427415848, -0.4816229045391083, -0.00869760476052761, 0.14641882479190826, -0.41384652256965637, -0.08079244941473007, -0.5444644689559937, 0.2882568836212158, 0.21829161047935486, -0.22968237102031708, 0.4476235806941986, -0.00010887943062698469, -0.09778626263141632, 0.22525963187217712, 0.027698686346411705, 0.13301868736743927, -0.26601213216781616, 0.02553141862154007, -0.5164727568626404, -0.08597182482481003, -0.04657956585288048, -0.1656324565410614, -0.46077612042427063, -0.12228195369243622, 0.1521805226802826, 0.11880441009998322, 0.1382308304309845, 0.20505157113075256, -0.0610746368765831, -0.16241104900836945, 0.0877261608839035, 0.024696484208106995, 0.539818286895752, -0.12854087352752686, 0.04630041867494583, 0.02371545508503914, 0.030164135619997978, 0.015870198607444763, 0.4995582103729248, -0.07224675267934799, -0.18407109379768372, 0.1814393550157547, -0.09061777591705322, -0.1119098886847496, -0.39757630228996277, 0.3953450620174408, 0.3383181691169739, 0.7514035701751709, -0.3189276456832886, -0.538109540939331, -0.24982601404190063, -0.06542076915502548, -0.29266566038131714, 0.07061858475208282, 0.16588683426380157, 0.04371796175837517, 0.07822571694850922, -0.31691211462020874, 0.04864279925823212, 0.10968482494354248, 0.13095951080322266, -0.08184512704610825, 0.26223060488700867, -0.19506114721298218, -0.050563693046569824, 0.16855047643184662, -0.1881687194108963, 0.24023738503456116, 0.20029610395431519, -0.1427432745695114, 0.055098727345466614, -0.4516897201538086, -0.13236965239048004, 0.02770208567380905, 0.25827208161354065, 0.17655110359191895, -0.07972285896539688, 0.1655907779932022, 0.04876481741666794, -0.025406181812286377, -0.13234928250312805, 0.19360002875328064, 0.19144688546657562, 0.6559135913848877, -0.06528075784444809, -0.17391850054264069, 0.10095971077680588, 0.13013297319412231, 0.059778787195682526, 0.11069096624851227, -0.14695850014686584, 0.08684532344341278, -0.05630524456501007, -0.35014522075653076, -0.2870481610298157, -0.31282269954681396, 0.37078550457954407, -0.21093612909317017, -0.060480520129203796, 0.12829791009426117, 0.1985502541065216, -0.03885600343346596, 0.1409616619348526, -0.3294706344604492, 0.19690458476543427, 0.02573036216199398, -0.13287660479545593, -0.18109004199504852, 0.12089884281158447, -0.22009718418121338, -0.002192443236708641, 0.2898964583873749, -0.17911873757839203, 0.5723324418067932, -0.00010215304791927338, -0.14104905724525452, -0.3301346004009247, -0.28118857741355896, -0.43433693051338196, 0.3018735945224762, 0.20967957377433777, -0.21760009229183197, 0.3176570236682892, 0.12719985842704773, 0.03615660220384598, -0.02986375242471695, 0.21222376823425293, -0.19015038013458252, 0.20182226598262787, 0.04028785973787308, 0.1588369756937027, -0.2872501015663147, -0.47013506293296814, -0.07710305601358414, 0.3606429994106293, 0.04519704356789589, 0.15916404128074646, 0.02260812371969223, 0.029981957748532295, -0.04892444983124733, 0.028579039499163628, 0.12547145783901215, 0.1486034393310547, -0.5311079621315002, -0.14663183689117432, -0.29282283782958984, -0.09099291265010834, -0.007120981812477112, 0.29308515787124634, 0.17748939990997314, 0.16735391318798065, 0.15781153738498688, 0.16142117977142334, -0.04752185195684433, -0.1990637630224228, -0.4214950501918793, -0.015914717689156532, 0.05715474486351013, -0.12563872337341309, -0.11849621683359146, 0.2174258828163147, 0.20661583542823792, 0.293748140335083, -0.17590457201004028, -0.20562593638896942, 0.3906102478504181, 0.15443482995033264, -0.29138433933258057, -0.19150419533252716, 0.22088319063186646, 0.17640694975852966, 0.18626829981803894, 0.04810282588005066, -0.2642694413661957, -0.2381032556295395, 0.27318665385246277, 0.21212095022201538, -0.12878835201263428, 0.43394583463668823, 0.28172579407691956, 0.39141911268234253, 0.15093380212783813, 0.1307966709136963, -0.4305356442928314, -0.01302696019411087, -0.2612329125404358, 0.17622625827789307, 0.2740204632282257, -0.2632717490196228, -0.5795592665672302, -0.09119509160518646, -0.127468541264534, -0.1828564554452896, 0.2207564115524292, 0.08637820929288864, -0.22295226156711578, 0.25030791759490967, -0.24177080392837524, 0.2290884405374527, 0.18969935178756714, 0.1300666332244873, 0.12919002771377563, 0.10482724010944366, 0.07257810235023499, 0.10521380603313446, 0.17829005420207977, 0.1867225468158722, 0.2586907148361206, 0.18601785600185394, -0.006402617320418358, 0.13963589072227478, -0.20659497380256653, 0.2743644714355469, -0.09083545953035355, 0.040051430463790894, 0.14148761332035065, -0.42968398332595825, -0.3346502482891083, 0.21240079402923584, -0.040397923439741135, 0.014285065233707428, -0.2832314074039459, 0.3753644824028015, 0.031465958803892136, 0.028353042900562286, -0.39774465560913086, 0.09311962872743607, 0.10927058756351471, -0.09877042472362518, -0.02575226128101349, -0.5242962837219238, 0.39483895897865295, -0.2650358974933624, 0.4269769489765167, 0.27896398305892944, -0.11357114464044571, 0.25739002227783203, 0.22877630591392517, 0.04571213945746422, 0.03480594605207443, 0.08607508987188339, -0.10339904576539993, -0.10269629210233688, 0.3983832597732544, 0.0348392017185688, -0.08069509267807007, 0.1857796162366867, -0.20745378732681274, 0.018010996282100677, 0.000383252277970314, -0.05428026616573334, -0.0025297924876213074, -0.09285981953144073, 0.05968369171023369, 0.24308109283447266, 0.09868789464235306, -0.2536665201187134, -0.35791003704071045, 0.12616099417209625, 0.12573225796222687, 0.39637961983680725, -0.4340936243534088, -0.03249223157763481, -0.20330965518951416, -0.3048999309539795, -0.21534833312034607, -0.30795854330062866, -0.5704948902130127, -0.5030297040939331, 0.16177956759929657, -0.16315655410289764, -0.0779116302728653, 0.17973119020462036, 0.03561222925782204, -0.02286246418952942, -0.3221242427825928, 0.19765518605709076, -0.27433234453201294, -0.33200007677078247, -0.15518978238105774, -0.03773871809244156, -0.08062408119440079, 0.217860147356987, 0.24238629639148712, -0.3808183968067169, -0.20896992087364197, -0.19041374325752258, -0.2644408941268921, 0.14639273285865784, -0.22056491672992706, 0.03501809388399124, -0.09067326784133911, -0.01908419281244278, -0.3397006392478943, 0.14825214445590973, 0.22322934865951538, 0.08817897737026215, 0.037966400384902954, -0.05469946935772896, -0.1406259983778, -0.1526515632867813, -0.0025035589933395386, -0.32320740818977356, -0.07443397492170334, 0.02070845291018486, 0.09468895196914673, -0.14302878081798553, 0.15347668528556824, 0.04728296771645546, -0.1591154783964157, -0.015072896145284176, -0.33960744738578796, -0.025122201070189476, -0.2941174805164337, -0.2728945016860962, 0.00803491473197937, -0.051753900945186615, -0.21712224185466766, 0.006131138652563095, 0.2858325242996216, -0.02812061831355095, -0.1632905900478363, -0.27199894189834595, 0.3200104534626007, -0.01171606220304966, 0.07149142026901245, 0.17104223370552063, -0.222687229514122, -0.15185990929603577, 0.09451904892921448, -0.058665722608566284, -0.17016679048538208, -0.2833763062953949, 0.118997722864151, -0.2403700351715088, 0.266047865152359, -0.20291689038276672, -0.05887546390295029, 0.04635036364197731, 0.10669323801994324, 0.344266414642334, -0.20919816195964813, 0.08093807846307755, -0.14607186615467072, 0.2613450586795807, 0.2141658067703247, -0.5074371099472046, 0.1574741005897522, 0.15025299787521362, 0.3344958424568176, 0.4176046848297119, 0.04447411000728607, -0.11094541847705841, -0.15183863043785095, 0.19822537899017334, -0.5896283984184265, -0.03646905720233917, -0.17022234201431274, 0.12540732324123383, 0.18365302681922913, 0.08577394485473633, 0.09737638384103775, -0.0915968269109726, -0.25540435314178467, 0.1446312516927719, -0.13469837605953217, -0.20176824927330017, 0.06725353002548218, -0.6596441864967346, -0.13887473940849304, -0.40137261152267456, 0.009179718792438507, 0.09008574485778809, 0.37931838631629944, -0.21840167045593262, 0.20485135912895203, 0.13405054807662964, 0.06201539933681488, 0.6262127757072449, -0.2884118854999542, 0.19783441722393036, 0.07252898812294006, 0.27267181873321533, -0.17839382588863373, 0.04034506157040596, -0.11565878987312317, 0.3531547486782074, 0.09928807616233826, 0.3214799165725708, -0.29674360156059265, -0.19967758655548096, 0.2908281981945038, 0.01570369303226471, -0.31344690918922424, -0.13870273530483246, -0.34005796909332275, -0.24085640907287598, 0.24538573622703552, -0.07239776104688644, -0.10353996604681015, 0.11385585367679596, -0.15742534399032593, 0.18395666778087616, 0.3267190456390381, 0.30554327368736267, 0.16524407267570496, 0.09096367657184601, 0.2611370086669922, -0.017689814791083336, -0.041625719517469406, 0.17575298249721527, 0.3325350284576416, 0.19166062772274017, 0.5591403245925903, 0.0848286896944046, -0.6143068075180054, -0.1968947947025299, -0.32064902782440186, 0.1377769112586975, 0.14935454726219177, 0.20090974867343903, 0.23442736268043518, 0.028444575145840645, 0.09421120584011078, 0.23596374690532684, 0.0016710413619875908, 0.3838805854320526, 0.31652072072029114, -0.27047181129455566, -0.13782916963100433, 0.7595300078392029, 0.1182338297367096, -0.02577850967645645, -0.1550731211900711, 0.4505147933959961, -0.11927638947963715, 0.1750858724117279, 0.3059898912906647, 0.90140700340271, 0.10462166368961334, -0.08029547333717346, 0.1834232211112976, -0.3417418599128723, 0.3840625584125519, -0.05779877305030823, -0.04822155833244324, -0.4676741361618042, 0.06899044662714005, -0.09779573976993561, 0.13426573574543, 0.031754929572343826, 0.3878999352455139, -0.0850139930844307, 0.1950923651456833, -0.14452201128005981, 0.13280260562896729, 0.04426533728837967, -0.265546053647995, 0.24143120646476746, -0.0690065324306488, -0.07388157397508621, 0.17196336388587952, -0.14787817001342773, 0.4726240634918213, -0.20442137122154236, 0.17467710375785828, -0.18481440842151642, 0.14353932440280914, -0.4609411954879761, -0.25203508138656616, -0.09336559474468231, -0.14541594684123993, 0.14360912144184113, -0.23765215277671814, -0.04752045124769211, 0.37008941173553467, 0.6383299827575684, 0.1688404381275177, -0.2045293152332306, -0.03654429689049721, 0.18067403137683868, 0.095317542552948, 0.2156190425157547, -0.03781319782137871, 0.30771610140800476, 0.004391364753246307, -0.37548086047172546, -0.13214010000228882, 0.17093156278133392, 0.36666470766067505, -0.3415185511112213, -0.041696950793266296, -0.3408973813056946, -0.20078346133232117, -0.1128099262714386, 0.12208765745162964, 0.08667165040969849, -0.08163347840309143, 0.15233580768108368, 0.0904478132724762, 0.02226337045431137, 0.11124724894762039, -0.06711414456367493, -0.3180428147315979, -0.19371573626995087, 0.4465152621269226, -0.002194710075855255, -0.25672781467437744, 0.15826526284217834, 0.05985095724463463, -0.36232990026474, -0.2720286250114441, 0.14934954047203064, 0.3688036799430847, -0.596197247505188, -0.1424497663974762, 0.031237486749887466, -0.26602184772491455, -0.20557309687137604, 0.1683952361345291, 0.25233426690101624, 0.2163178026676178, -0.04714251309633255, 0.00027686357498168945, -0.08527009934186935, 0.3684162497520447, 0.29002660512924194, -0.14406336843967438, -0.036804333329200745, 0.12320555746555328, 0.3581993579864502, -0.2635042369365692, -0.3181944787502289, 0.11965907365083694, -0.0914287269115448, -0.015515338629484177, -0.09220492839813232, -0.030440427362918854, -0.1821044683456421, -0.07480540871620178, 0.14603327214717865, -0.07607327401638031, 0.06205746904015541, -0.15901774168014526, -0.03307872265577316, 0.09191618859767914, 0.23270240426063538, 0.032465383410453796, -0.09259316325187683, 0.1844979226589203, -0.10513833165168762, -0.004933435469865799, 0.0722229927778244, 0.5212813019752502, 0.228664368391037, 0.5307396650314331, -0.10274939239025116, 0.18969380855560303, -0.04327182471752167, -0.09182010591030121, 0.15620189905166626, -0.19151164591312408, 0.1758420467376709, 0.09861014783382416, 0.12731488049030304, 0.08088473975658417, 0.1535477340221405, 0.17500948905944824, -0.005736656486988068, 0.13557255268096924, 0.387307733297348, -0.46528834104537964, 0.5622754693031311, 0.43631425499916077, 0.6221858263015747, 0.07619540393352509, 0.05335613340139389, -0.13450993597507477, 0.4390888512134552, 0.20906679332256317, -0.4460899531841278, -0.2936290204524994, 0.19848498702049255, -0.048355940729379654, 0.051383111625909805, -0.06437661498785019, 0.20972192287445068, 0.07649949193000793, 0.041781917214393616, -0.014730745926499367, 0.5819715857505798, -0.1435035914182663, 0.1853792518377304, 0.12184798717498779, -0.15321844816207886, 0.1540520042181015, 0.49593108892440796, -0.025460485368967056, -0.0000014603137969970703, 0.08411842584609985, 0.17665383219718933, 0.3983313739299774, -0.0016079284250736237, 0.20192334055900574, -0.14832919836044312, 0.0021523572504520416, 0.11891016364097595, 0.25930255651474, -0.18180736899375916, 0.34318971633911133, -0.10955679416656494, 0.47338739037513733, -0.09649701416492462, -0.25240519642829895, -0.29266035556793213, 0.0452941432595253, -0.2518409490585327, -0.12621527910232544, -0.33128291368484497, -0.04077863320708275, -0.12119675427675247, -0.03660283982753754, -0.2959122359752655, -0.3931933045387268, 0.030082091689109802, -0.1309446096420288, -0.41035568714141846, -0.5030313730239868, -0.33764803409576416, 0.19684264063835144, 0.42033183574676514, -0.008474282920360565, 0.07926177233457565, 0.07153311371803284, 0.08318997174501419, 0.013546736910939217, 0.570012629032135, 0.08642661571502686, 0.14932186901569366, 0.2973431348800659, -0.17778423428535461, -0.24011363089084625, -0.05997614562511444, 0.18612776696681976, 0.17308367788791656, 0.0824924111366272, -0.2581191658973694, 0.2251792550086975, 0.08365615457296371, -0.2171919196844101, 0.25022560358047485, 0.09498074650764465, 0.5398204326629639, 0.005103896372020245, -0.23856550455093384, -0.490029901266098, -0.2670363783836365, -0.12211863696575165, -0.3038233518600464, -0.21571576595306396, -0.11196517944335938, 0.17314228415489197, 0.12195014208555222, 0.22682973742485046, -0.1817217916250229, 0.13247841596603394, -0.09052598476409912, 0.41057661175727844, 0.14342665672302246, -0.013621829450130463, -0.1181856021285057, 0.0035088062286376953, -0.6107086539268494, 0.04617100954055786, 0.18471404910087585, 0.007521944120526314, 0.10928115248680115, -0.2431047111749649, -0.14219647645950317, 0.2629869282245636, 0.06738971918821335, -0.038573719561100006, 0.08445606380701065, 0.08054816722869873, -0.32852786779403687, 0.20588727295398712, 0.0612163245677948, 0.30078837275505066, -0.088630311191082, 0.1795525848865509, 0.2111460566520691, 0.05323542281985283, 0.035763390362262726, -0.22799696028232574, 0.0860600620508194, 0.01733006164431572, 0.02050277404487133, -0.11541083455085754, -0.0722845271229744, 0.32755786180496216, 0.035013310611248016, 0.022239988669753075, -0.20475676655769348, -0.2337471842765808, -0.218756765127182, 0.29010504484176636, 0.051720887422561646, 0.39901819825172424, 0.0027319733053445816, -0.25800037384033203, 0.1511768400669098, -0.08043690025806427, 0.25591522455215454, -0.13845135271549225, -0.4494353234767914, -0.033019065856933594, 0.326651930809021, -0.3690016567707062, 0.07132530957460403, 0.2376789152622223, 0.051427122205495834, 0.22392797470092773, -0.2088260054588318, -0.4328082203865051, 0.4172181487083435, 0.005555477924644947, 0.21956750750541687, -0.0636325553059578, 0.27239570021629333, 0.6544496417045593, -0.26179641485214233, -0.18875546753406525, 0.13347584009170532, 0.22098186612129211, 0.14412975311279297, -0.20366166532039642, 0.12241028249263763, -0.40090152621269226, -0.02671254798769951, -0.11621503531932831, 0.326361745595932, 0.39391326904296875, -0.17528362572193146, 0.15615874528884888, 0.07821047306060791 ]
https://github.com/huggingface/datasets/issues/2993
Can't download `trivia_qa/unfiltered`
wooo that was fast! thank you @lhoestq ! it is able to process now, though it's ignoring all files and ending up with 0 examples now haha :/ For subset "unfiltered": ```python >>> load_dataset("trivia_qa", "unfiltered") Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab... 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 1354.53it/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 40.60it/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset use_auth_token=use_auth_token, File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits raise NonMatchingSplitsSizesError(str(bad_splits)) datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=2906575347, num_examples=10832, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=3038966234, num_examples=11313, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}] ``` For subset "rc": ```python >>> load_dataset("trivia_qa", "rc") Downloading and preparing dataset trivia_qa/rc (download: 2.48 GiB, generated: 14.92 GiB, post-processed: Unknown size, total: 17.40 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/rc/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab... 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3806.08it/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 51.57it/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset use_auth_token=use_auth_token, File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits raise NonMatchingSplitsSizesError(str(bad_splits)) datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=1577814583, num_examples=17210, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='train', num_bytes=12750976012, num_examples=138384, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=1688535379, num_examples=18669, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}] ``` Could you look into that when you get a chance? I wonder if it's not something they changed on the file to download? i couldn't find any information
## Describe the bug For some reason, I can't download `trivia_qa/unfilted`. A file seems to be missing... I am able to see it fine though the viewer tough... ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> load_dataset("trivia_qa", "unfiltered") Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6... Traceback (most recent call last): File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 251, in _add_context with open(os.path.join(file_dir, fname), encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: '/gpfsscratch/rech/six/commun/datasets/downloads/extracted/9fcb7eddc6afd46fd074af3c5128931dfe4b548f933c925a23847faf4c1995ad/evidence/wikipedia/Peanuts.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset use_auth_token=use_auth_token, File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 1107, in _prepare_split disable=bool(logging.get_verbosity() == logging.NOTSET), File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 303, in _generate_examples example = parse_example(article) File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 274, in parse_example _add_context(article.get("EntityPages", []), "WikiContext", wiki_dir), File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 253, in _add_context except (IOError, datasets.Value("errors").NotFoundError): File "<string>", line 5, in __init__ File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 265, in __post_init__ self.pa_type = string_to_arrow(self.dtype) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 134, in string_to_arrow f"Neither {datasets_dtype} nor {datasets_dtype + '_'} seems to be a pyarrow data type. " ValueError: Neither errors nor errors_ seems to be a pyarrow data type. Please make sure to use a correct data type, see: https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions ``` ## Expected results I am able to load another subset (`rc`), but unable to load. I am not sure why the try/except doesn't catch it... https://github.com/huggingface/datasets/blob/9675a5a1e7b99a86f9c250f6ea5fa5d1e6d5cc7d/datasets/trivia_qa/trivia_qa.py#L253 ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.11.0 - Platform: Linux-4.18.0-147.51.2.el8_1.x86_64-x86_64-with-redhat-8.1-Ootpa - Python version: 3.7.10 - PyArrow version: 3.0.0
264
Can't download `trivia_qa/unfiltered` ## Describe the bug For some reason, I can't download `trivia_qa/unfilted`. A file seems to be missing... I am able to see it fine though the viewer tough... ## Steps to reproduce the bug ```python >>> from datasets import load_dataset >>> load_dataset("trivia_qa", "unfiltered") Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6... Traceback (most recent call last): File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 251, in _add_context with open(os.path.join(file_dir, fname), encoding="utf-8") as f: FileNotFoundError: [Errno 2] No such file or directory: '/gpfsscratch/rech/six/commun/datasets/downloads/extracted/9fcb7eddc6afd46fd074af3c5128931dfe4b548f933c925a23847faf4c1995ad/evidence/wikipedia/Peanuts.txt' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 852, in load_dataset use_auth_token=use_auth_token, File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 616, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 693, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 1107, in _prepare_split disable=bool(logging.get_verbosity() == logging.NOTSET), File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/tqdm/std.py", line 1133, in __iter__ for obj in iterable: File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 303, in _generate_examples example = parse_example(article) File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 274, in parse_example _add_context(article.get("EntityPages", []), "WikiContext", wiki_dir), File "/gpfswork/rech/six/commun/modules/datasets_modules/datasets/trivia_qa/9977a5d6f72acfd92f587de052403e8138b43bb0d1ce595016c3baf7e14deba6/trivia_qa.py", line 253, in _add_context except (IOError, datasets.Value("errors").NotFoundError): File "<string>", line 5, in __init__ File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 265, in __post_init__ self.pa_type = string_to_arrow(self.dtype) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/features.py", line 134, in string_to_arrow f"Neither {datasets_dtype} nor {datasets_dtype + '_'} seems to be a pyarrow data type. " ValueError: Neither errors nor errors_ seems to be a pyarrow data type. Please make sure to use a correct data type, see: https://arrow.apache.org/docs/python/api/datatypes.html#factory-functions ``` ## Expected results I am able to load another subset (`rc`), but unable to load. I am not sure why the try/except doesn't catch it... https://github.com/huggingface/datasets/blob/9675a5a1e7b99a86f9c250f6ea5fa5d1e6d5cc7d/datasets/trivia_qa/trivia_qa.py#L253 ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.11.0 - Platform: Linux-4.18.0-147.51.2.el8_1.x86_64-x86_64-with-redhat-8.1-Ootpa - Python version: 3.7.10 - PyArrow version: 3.0.0 wooo that was fast! thank you @lhoestq ! it is able to process now, though it's ignoring all files and ending up with 0 examples now haha :/ For subset "unfiltered": ```python >>> load_dataset("trivia_qa", "unfiltered") Downloading and preparing dataset trivia_qa/unfiltered (download: 3.07 GiB, generated: 27.23 GiB, post-processed: Unknown size, total: 30.30 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/unfiltered/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab... 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 1354.53it/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 40.60it/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset use_auth_token=use_auth_token, File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits raise NonMatchingSplitsSizesError(str(bad_splits)) datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=2906575347, num_examples=10832, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=3038966234, num_examples=11313, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}] ``` For subset "rc": ```python >>> load_dataset("trivia_qa", "rc") Downloading and preparing dataset trivia_qa/rc (download: 2.48 GiB, generated: 14.92 GiB, post-processed: Unknown size, total: 17.40 GiB) to /gpfsscratch/rech/six/commun/datasets/trivia_qa/rc/1.1.0/910043a609bb2bdf62b4874f68e0c24fb648cf81e40a358f4bd54c919d72c9ab... 100%|███████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 3806.08it/s] 100%|█████████████████████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 51.57it/s] Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/load.py", line 1198, in load_dataset use_auth_token=use_auth_token, File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 647, in download_and_prepare dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/builder.py", line 748, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/gpfswork/rech/six/commun/conda/victor/lib/python3.7/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits raise NonMatchingSplitsSizesError(str(bad_splits)) datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='test', num_bytes=1577814583, num_examples=17210, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='train', num_bytes=12750976012, num_examples=138384, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}, {'expected': SplitInfo(name='validation', num_bytes=1688535379, num_examples=18669, dataset_name='trivia_qa'), 'recorded': SplitInfo(name='validation', num_bytes=0, num_examples=0, dataset_name='trivia_qa')}] ``` Could you look into that when you get a chance? I wonder if it's not something they changed on the file to download? i couldn't find any information
[ -0.1447088122367859, -0.13158252835273743, -0.0809883400797844, 0.27586111426353455, 0.4623158574104309, 0.3147662878036499, 0.08203501999378204, 0.2365659773349762, 0.1864875704050064, 0.12130631506443024, -0.10474646836519241, 0.01685229316353798, 0.007184319198131561, -0.17923729121685028, -0.026129987090826035, -0.1387263387441635, -0.06435363739728928, -0.08730950951576233, 0.23229296505451202, 0.10132536292076111, -0.2905994653701782, 0.2706826627254486, -0.29175782203674316, -0.05392782390117645, -0.18677301704883575, 0.002068381756544113, 0.02714530937373638, 0.3517015874385834, -0.1980823129415512, -0.19028086960315704, 0.0393858477473259, 0.03156871721148491, -0.02640805020928383, 0.5587809085845947, -0.00011614500544965267, -0.050230469554662704, 0.23072554171085358, -0.21657457947731018, -0.2700593173503876, -0.29729580879211426, -0.31872737407684326, 0.0021523581817746162, -0.1289208084344864, -0.024636439979076385, -0.009166350588202477, 0.11792352795600891, 0.21889446675777435, -0.3271936774253845, 0.024342432618141174, 0.2475951910018921, 0.21544304490089417, -0.13995566964149475, 0.2990694046020508, -0.24213887751102448, 0.21151867508888245, -0.21758852899074554, -0.09018530696630478, 0.31483182311058044, 0.08932460844516754, 0.1804855614900589, 0.32962000370025635, 0.19915978610515594, -0.09219124168157578, -0.049384575337171555, 0.09088481962680817, -0.18652862310409546, -0.3333742916584015, -0.4321649968624115, 0.3027578294277191, 0.4389566481113434, 0.3177225887775421, -0.0553484708070755, -0.6114199161529541, -0.04031825065612793, 0.22278377413749695, -0.1834738850593567, 0.11754544079303741, 0.26766812801361084, -0.24458587169647217, 0.1215389221906662, 0.052308935672044754, -0.48032015562057495, -0.032134924083948135, 0.008269209414720535, -0.2620547413825989, 0.19191715121269226, -0.07989891618490219, 0.09575841575860977, -0.2800918221473694, 0.02293904684484005, -0.08347004652023315, -0.2190040796995163, 0.038074176758527756, 0.18100515007972717, -0.1479458063840866, 0.23624202609062195, 0.19012224674224854, -0.040777698159217834, 0.017984595149755478, 0.0846962183713913, -0.15687163174152374, -0.061283133924007416, -0.3658033013343811, 0.17855483293533325, 0.1689220517873764, 0.015649646520614624, -0.12967771291732788, 0.3591114282608032, 0.2757449448108673, 0.3697735071182251, -0.14778053760528564, -0.2764607071876526, -0.18872714042663574, 0.050840895622968674, -0.06193947419524193, 0.13900235295295715, 0.3612704277038574, -0.2981186509132385, -0.5449506044387817, -0.038609787821769714, -0.19870370626449585, 0.257060170173645, -0.26614639163017273, 0.1698181927204132, -0.19613240659236908, 0.2867235243320465, 0.043071746826171875, 0.2466430813074112, -0.1259748786687851, -0.19192343950271606, -0.20746171474456787, 0.06152595579624176, 0.13029684126377106, 0.01873968169093132, 0.01314111053943634, -0.34109827876091003, 0.412990927696228, -0.28245797753334045, -0.13029125332832336, -0.06415970623493195, -0.0678202211856842, -0.2422221451997757, -0.3612651228904724, 0.5236301422119141, 0.17692042887210846, 0.1769421100616455, 0.13649345934391022, -0.15746119618415833, 0.09092054516077042, 0.27153080701828003, -0.24815374612808228, -0.14422574639320374, -0.1438058465719223, 0.20798088610172272, -0.2853928208351135, -0.10310563445091248, 0.18295729160308838, 0.03380120173096657, -0.030809082090854645, -0.41038164496421814, 0.08788737654685974, -0.15179824829101562, -0.22525613009929657, -0.447755366563797, 0.20627792179584503, 0.5398128628730774, -0.47830209136009216, 0.029170319437980652, -0.2839590311050415, -0.10508356988430023, 0.07344987243413925, 0.05077579990029335, 0.07156789302825928, 0.18638113141059875, -0.2867978811264038, 0.30136096477508545, 0.46900954842567444, -0.6225539445877075, -0.41407379508018494, 0.11545068025588989, -0.17665256559848785, 0.4788351058959961, 0.1688825488090515, 0.021621758118271828, 0.21537306904792786, -0.2463669329881668, 0.27740925550460815, 0.25890201330184937, -0.30094534158706665, -0.32279881834983826, -0.2626434862613678, -0.26208269596099854, 0.10299267619848251, 0.054475169628858566, 0.3256145417690277, 0.08182185888290405, 0.11700707674026489, 0.0771208330988884, 0.43681883811950684, 0.25163233280181885, 0.07207893580198288, 0.3099304437637329, 0.6050542593002319, 0.29039251804351807, 0.014632033184170723, -0.5332843065261841, -0.30273759365081787, 0.24105942249298096, 0.09416241198778152, -0.20376697182655334, -0.2042156606912613, -0.3050152063369751, -0.4655899107456207, -0.01923166587948799, -0.02955203875899315, -0.31231415271759033, 0.1047569066286087, 0.18416301906108856, -0.003219468519091606, 0.31604450941085815, -0.033712372183799744, 0.1506028175354004, 0.03833772987127304, 0.13624924421310425, -0.051387395709753036, 0.04441922903060913, -0.013398157432675362, -0.06465032696723938, 0.11562736332416534, -0.00542023777961731, 0.3512854278087616, -0.018567325547337532, -0.0031675854697823524, 0.46852853894233704, 0.2631203830242157, 0.03081876039505005, 0.20653527975082397, 0.19963565468788147, 0.18770338594913483, -0.0820680633187294, -0.1333809792995453, 0.376240611076355, 0.26014444231987, -0.05053885653614998, -0.2880825996398926, 0.0112222358584404, -0.04019904509186745, 0.01134093850851059, 0.14894868433475494, 0.2050505131483078, 0.3028258979320526, 0.014302130788564682, 0.043306052684783936, 0.04472583532333374, 0.2907608449459076, -0.034004442393779755, -0.3414191007614136, -0.19239747524261475, -0.20893016457557678, 0.44898882508277893, 0.32024604082107544, 0.002198789268732071, -0.09909575432538986, 0.07859846949577332, -0.15581557154655457, 0.08185618370771408, -0.05373471975326538, 0.18181189894676208, 0.5929803252220154, 0.14406315982341766, 0.09917280077934265, -0.09602099657058716, 0.13609378039836884, -0.31118378043174744, 0.23306715488433838, 0.18511483073234558, -0.04703135788440704, 0.392548143863678, 0.044147491455078125, 0.20952141284942627, 0.13114681839942932, -0.1531832069158554, -0.05697768181562424, 0.2275855839252472, -0.35530367493629456, -0.0056570302695035934, -0.2527715563774109, -0.13791510462760925, 0.045678507536649704, -0.10741858184337616, -0.0023537538945674896, -0.4432319104671478, 0.13088726997375488, 0.4339796006679535, 0.044626686722040176, -0.09728916734457016, -0.384317547082901, 0.05375422537326813, 0.09044469892978668, -0.3527258038520813, -0.17747363448143005, -0.010787583887577057, -0.08398136496543884, 0.09890228509902954, 0.09841246157884598, -0.05135136470198631, 0.23516078293323517, 0.056668154895305634, -0.013991857878863811, -0.3682751953601837, -0.33422887325286865, -0.19839411973953247, -0.08159095793962479, 0.6031449437141418, 0.28075164556503296, 0.4727475643157959, -0.050437428057193756, -0.0891786590218544, 0.1254507601261139, -0.10593678802251816, -0.10984545201063156, -0.0953695997595787, 0.0004086614353582263, -0.06828740984201431, -0.10309404134750366, -0.44399622082710266, -0.2509037256240845, -0.47667938470840454, 0.07622030377388, 0.16524921357631683, -0.03781967610120773, 0.03798958286643028, -0.02178175188601017, 0.0736738070845604, 0.1130339577794075, -0.15865671634674072, -0.11043056845664978, -0.009724386036396027, 0.5126015543937683, -0.27777042984962463, -0.3480977416038513, 0.4913218319416046, 0.07557806372642517, 0.1444997638463974, 0.17079384624958038, -0.6691319942474365, -0.03748887777328491, -0.1030585914850235, 0.2736332416534424, -0.1462506651878357, -0.1364404559135437, 0.24686966836452484, -0.2043958455324173, -0.012272948399186134, -0.14158481359481812, -0.016222747042775154, -0.1445463001728058, 0.01176944188773632, 0.3115707039833069, -0.22592419385910034, 0.16139981150627136, 0.06434591114521027, 0.6258365511894226, 0.27161452174186707, 0.6232299208641052, 0.052445925772190094, -0.14549469947814941, 0.41748178005218506, -0.1778515875339508, -0.2010694295167923, 0.2108573168516159, -0.0056008994579315186, -0.09863761812448502, 0.17694158852100372, 0.09908012300729752, 0.3543202579021454, -0.178005188703537, -0.09110009670257568, -0.4208897650241852, -0.2243472784757614, 0.0120396101847291, -0.09355105459690094, 0.06192275509238243, 0.29015377163887024, -0.024358797818422318, 0.07831814885139465, -0.3387160003185272, 0.1924627423286438, 0.4507150650024414, 0.31363794207572937, 0.17880134284496307, 0.20871300995349884, -0.22061069309711456, -0.07982634752988815, 0.14021314680576324, 0.15634667873382568, 0.23733170330524445, -0.2472287118434906, 0.08480992913246155, 0.1328723281621933, 0.09338480979204178, 0.6674953699111938, -0.09707023203372955, 0.17884570360183716, 0.21226605772972107, 0.018933750689029694, -0.3812636733055115, -0.05881930887699127, -0.13831619918346405, 0.011906946077942848, 0.2202356606721878, 0.23010101914405823, -0.29858511686325073, 0.3029148280620575, 0.30247238278388977, 0.18146005272865295, -0.19554275274276733, -0.12935960292816162, -0.31811293959617615, -0.44268298149108887, -0.17673443257808685, -0.3510822057723999, 0.11704126745462418, 0.37005752325057983, -0.12188255786895752, 0.08477875590324402, -0.1361059993505478, -0.07402362674474716, -0.10653190314769745, -0.22938936948776245, 0.2195018231868744, -0.02213960886001587, 0.22102275490760803, 0.2326098531484604, -0.4485161006450653, 0.045987628400325775, 0.6037805676460266, 0.2725217938423157, -0.2803696393966675, 0.030279677361249924, -0.12516912817955017, -0.1567014455795288, 0.2752262055873871, -0.17458295822143555, 0.038941770792007446, -0.030465688556432724, 0.10304030030965805, 0.18896880745887756, -0.11776898056268692, 0.043088607490062714, -0.18260321021080017, -0.11203379184007645, -0.2687402069568634, 0.20187275111675262, 0.06561101973056793, -0.08502081036567688, 0.7250926494598389, 0.015182442963123322, -0.06299155950546265, 0.26501351594924927, -0.23635539412498474, 1.0257568359375, -0.03733610361814499, -0.09470683336257935, 0.30783611536026, -0.24762682616710663, 0.5092242956161499, -0.4280369281768799, 0.21180298924446106, -0.0823032557964325, -0.5314568877220154, -0.05372955650091171, 0.07958906888961792, 0.2430604100227356, -0.12012487649917603, -0.21974317729473114, 0.345140278339386, -0.2826294004917145, 0.11915375292301178, 0.2650335729122162, -0.2127446085214615, 0.015081657096743584, 0.2977842390537262, 0.012532529421150684, 0.16667726635932922, -0.017155520617961884, 0.46275413036346436, -0.2087443470954895, 0.18251928687095642, -0.254381000995636, -0.00038604438304901123, -0.5547752380371094, 0.0410783514380455, -0.31910789012908936, -0.12937423586845398, 0.07368332892656326, -0.06863211840391159, -0.09629057347774506, 0.23128096759319305, -0.18996818363666534, 0.2663188874721527, -0.3747490346431732, 0.4927268326282501, 0.07489113509654999, -0.2724505364894867, 0.17871063947677612, 0.12066924571990967, 0.2599054276943207, -0.15148663520812988, -0.17304706573486328, 0.4972728192806244, -0.31689688563346863, -0.09991233795881271, 0.029554516077041626, -0.0026259273290634155, 0.2071598768234253, -0.02186073549091816, -0.38531967997550964, -0.13150255382061005, 0.21656885743141174, -0.21250192821025848, 0.12417113780975342, 0.05995214357972145, 0.07028401643037796, -0.054613687098026276, 0.03837022930383682, -0.23510973155498505, -0.13704124093055725, 0.5115265846252441, 0.07970637828111649, -0.2650931775569916, 0.4515700042247772, 0.0809812843799591, -0.27786287665367126, -0.11225514113903046, -0.03419571369886398, -0.5452458262443542, -0.11756578832864761, 0.20660439133644104, -0.13184599578380585, 0.2931598424911499, -0.053068771958351135, 0.06728645414113998, 0.17396365106105804, -0.2915482819080353, -0.15146273374557495, -0.8227075934410095, 0.11378941684961319, -0.0886649340391159, -0.1289985626935959, -0.2592082917690277, -0.3778093755245209, -0.2687615156173706, 0.3560739755630493, 0.03790389746427536, -0.2789890170097351, 0.08557158708572388, -0.2535538077354431, -0.09734269976615906, 0.22249151766300201, 0.3875310719013214, 0.2463521808385849, -0.08860348165035248, 0.1265321522951126, 0.06227751448750496, 0.05746060237288475, -0.18065249919891357, -0.10754407942295074, 0.178962841629982, 0.004806863144040108, -0.14317522943019867, 0.19053401052951813, -0.19926638901233673, -0.12076878547668457, 0.2926652431488037, 0.09726998209953308, 0.1991579532623291, 0.008697181940078735, -0.14423571527004242, -0.11612854897975922, 0.11149238795042038, -0.2998383641242981, 0.3840121626853943, -0.11772739887237549, 0.46043145656585693, 0.1662839949131012, 0.09543562680482864, 0.3092704117298126, 0.020340897142887115, -0.3490012586116791, -0.15351560711860657, -0.1621561199426651, 0.12257228046655655, 0.4378725290298462, -0.2538362145423889, 0.21422690153121948, 0.09601036459207535, 0.007588010281324387, 0.24284902215003967, -0.2876523435115814, 0.155343160033226, 0.12173794955015182, 0.20117786526679993, -0.29488855600357056, 0.2729780673980713, 0.1938268393278122, 0.11778783798217773, -0.1614026576280594, 0.060268279165029526, -0.05672288313508034, -0.29634857177734375, 0.26914677023887634, 0.33106309175491333, 0.37864693999290466, -0.020400509238243103, 0.31214767694473267, 0.26298877596855164, 0.09314456582069397, 0.07320151478052139, -0.12182798236608505, 0.004962440580129623, -0.09669750183820724, 0.5946816802024841, 0.035232674330472946, -0.17341847717761993, -0.1166461631655693, -0.15653496980667114, -0.032360583543777466, -0.4656074345111847, -0.04141855612397194, 0.16351966559886932, -0.38981178402900696, -0.04134514182806015, 0.017589107155799866, -0.07540229707956314, -0.20587335526943207, 0.03120291605591774, 0.07431521266698837, 0.0827862098813057, -0.06414324790239334, 0.20989172160625458, 0.06566814333200455, -0.15857544541358948, -0.16917002201080322, 0.08893375098705292, 0.3092236816883087, -0.04208207130432129, 0.1944393813610077, 0.17096814513206482, -0.29662156105041504, -0.28973588347435, 0.10889452695846558, -0.19243720173835754, 0.3507319986820221, -0.3306485414505005, 0.08298610150814056, 0.2702898681163788, -0.0009340420365333557, 0.47539839148521423, 0.34641724824905396, 0.30407610535621643, 0.18966960906982422, -0.08481138944625854, -0.0936349406838417, -0.09817790985107422, -0.1412465125322342, -0.02516399323940277, 0.4650095999240875, 0.22869059443473816, 0.295195072889328, 0.19086377322673798, 0.20211593806743622, -0.17042113840579987, 0.32513898611068726, 0.21240133047103882, 0.04713348299264908, -0.35821184515953064, 0.32037562131881714, -0.3666989207267761, -0.024253223091363907, -0.13552924990653992, -0.25197136402130127, -0.31011393666267395, -0.10817305743694305, 0.06840872764587402, -0.03428347036242485, 0.08982288837432861, -0.10705208778381348, 0.08843362331390381, -0.003008756786584854, 0.0345299132168293, 0.45886871218681335, 0.050470806658267975, -0.2515659034252167, -0.19286049902439117, -0.5551360845565796, 0.21079139411449432, 0.020177466794848442, -0.3079710304737091, -0.040458135306835175, 0.32044681906700134, -0.26205211877822876, 0.16515204310417175, -0.00736159086227417, 0.01395939290523529, 0.05008181184530258, 0.24106109142303467, -0.23104903101921082, -0.47334736585617065, 0.013272669166326523, 0.08157561719417572, -0.08910369873046875, -0.40101858973503113, 0.1395554095506668, -0.49848753213882446, 0.052958473563194275, 0.057735513895750046, -0.29855701327323914, 0.2403792142868042, -0.009615130722522736, 0.349008709192276, 0.05810753256082535, 0.3133126497268677, -0.035465825349092484, -0.3403124511241913, -0.18285533785820007, 0.06744640320539474, -0.23487041890621185, 0.20793354511260986, 0.025958463549613953, 0.2836211621761322, -0.04341293126344681, -0.24023793637752533, -0.11617320030927658, 0.4901312589645386, 0.003744371235370636, 0.2519439160823822, -0.2613743841648102, 0.20627868175506592, -0.2154553234577179, 0.2277580350637436, 0.2303689420223236, -0.029629819095134735, -0.2680415213108063, 0.04926435649394989, -0.25044742226600647, -0.40825536847114563, 0.687886118888855, -0.21425761282444, -0.16029980778694153, 0.019195284694433212, 0.33512604236602783, -0.09757242351770401, -0.08887378126382828, -0.6165841221809387, 0.19690826535224915, 0.5191516280174255, 0.05490659922361374, -0.07369513809680939, 0.20688962936401367, -0.458553284406662, 0.04487000033259392, 0.08542080223560333, 0.09223449975252151, -0.07266827672719955, -0.1066298857331276, 0.3631933927536011, -0.004396645352244377 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
Hi ! Could you check the length of the `self.dataset` object (i.e. the Dataset object passed to the data loader) ? It looks like the dataset is empty. Not sure why the SWA optimizer would cause this though.
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
38
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 Hi ! Could you check the length of the `self.dataset` object (i.e. the Dataset object passed to the data loader) ? It looks like the dataset is empty. Not sure why the SWA optimizer would cause this though.
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
Any updates on this? The same error occurred to me too when running `cardiffnlp/twitter-roberta-base-sentiment` on a custom dataset. This happened when I tried to do `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3])` without using sagemaker distribution. Python: 3.6.13 datasets: 1.6.2
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
40
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 Any updates on this? The same error occurred to me too when running `cardiffnlp/twitter-roberta-base-sentiment` on a custom dataset. This happened when I tried to do `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3])` without using sagemaker distribution. Python: 3.6.13 datasets: 1.6.2
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
Hi @ruisi-su, do you have this issue while using SWA as well, or just data parallel ? If you have a code example to reproduce this issue it would also be helpful
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
32
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 Hi @ruisi-su, do you have this issue while using SWA as well, or just data parallel ? If you have a code example to reproduce this issue it would also be helpful
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
@lhoestq I had this issue without SWA. I followed [this](https://github.com/huggingface/notebooks/blob/master/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb) notebook to utilize multiple gpus on the [roberta-base](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment) model. This tutorial could only work if I am on `ml.p3.16xlarge`, which I don't have access to. So I tried using just `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3]` before calling `trainer.fit()`. But maybe this is not the right way to do distributed training. I can provide a code example if that will be more helpful.
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
74
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 @lhoestq I had this issue without SWA. I followed [this](https://github.com/huggingface/notebooks/blob/master/sagemaker/03_distributed_training_data_parallelism/sagemaker-notebook.ipynb) notebook to utilize multiple gpus on the [roberta-base](https://huggingface.co/cardiffnlp/twitter-roberta-base-sentiment) model. This tutorial could only work if I am on `ml.p3.16xlarge`, which I don't have access to. So I tried using just `model = torch.nn.DataParallel(model, device_ids=[0, 1, 2, 3]` before calling `trainer.fit()`. But maybe this is not the right way to do distributed training. I can provide a code example if that will be more helpful.
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
It might be an issue with old versions of `datasets`, can you try updating `datasets` ?
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
16
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 It might be an issue with old versions of `datasets`, can you try updating `datasets` ?
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
FYI I encountered the exact same error using the latest versions of `datasets`, `transformers` and `pyarrow`, without using any kind of SWA or dataparallel: ``` # packages in environment at C:\Users\zhang\mambaforge: # # Name Version Build Channel cudatoolkit 11.0.3 h3f58a73_9 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge datasets 1.17.0 pypi_0 pypi pyarrow 6.0.1 pypi_0 pypi pytorch 1.7.1 py3.9_cuda110_cudnn8_0 pytorch tornado 6.1 py39hb82d6ee_2 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge ``` ``` > python --version > 3.9.7 ```
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
65
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 FYI I encountered the exact same error using the latest versions of `datasets`, `transformers` and `pyarrow`, without using any kind of SWA or dataparallel: ``` # packages in environment at C:\Users\zhang\mambaforge: # # Name Version Build Channel cudatoolkit 11.0.3 h3f58a73_9 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge datasets 1.17.0 pypi_0 pypi pyarrow 6.0.1 pypi_0 pypi pytorch 1.7.1 py3.9_cuda110_cudnn8_0 pytorch tornado 6.1 py39hb82d6ee_2 https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge ``` ``` > python --version > 3.9.7 ```
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
Same error here! Datasets version `1.18.3` freshly updated. `IndexError: Invalid key: 90 is out of bounds for size 0` My task is finetuning the model for token classification. **Solved**: I make a mistake while updating the dataset during the map, you should check that you return the correct values.
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
49
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 Same error here! Datasets version `1.18.3` freshly updated. `IndexError: Invalid key: 90 is out of bounds for size 0` My task is finetuning the model for token classification. **Solved**: I make a mistake while updating the dataset during the map, you should check that you return the correct values.
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
cc @sgugger This probably comes from the `Trainer` removing all the columns of a dataset, do you think we can improve the error message in this case ?
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
28
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 cc @sgugger This probably comes from the `Trainer` removing all the columns of a dataset, do you think we can improve the error message in this case ?
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
The `Trainer` clearly logs when it removes columns in the dataset. I'm not too sure of where the bug appears as I haven't seen a clear reproducer. Happy to display a more helpful error message, but I'd need a reproducer to see what the exact problem is to design the right test and warning :-)
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
55
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 The `Trainer` clearly logs when it removes columns in the dataset. I'm not too sure of where the bug appears as I haven't seen a clear reproducer. Happy to display a more helpful error message, but I'd need a reproducer to see what the exact problem is to design the right test and warning :-)
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
Well, if I can try to suggest how to reproduce, please try by do not returning any updated content in the map function used to tokenize input (e.g., in TokenClassification). I can leave here my wrong version for reference: ```python def preprocess_function(examples): text = examples["text"] inputs = tokenizer( text, max_length=512, truncation="only_second", return_offsets_mapping=True, padding="max_length", ) offset_mapping = inputs.pop("offset_mapping") # ... processing code inputs["labels"] = label_ids #return inputs train_ds = train_ds.map(preprocess_function, batched=False) test_ds = test_ds.map(preprocess_function, batched=False) eval_ds = eval_ds.map(preprocess_function, batched=False) ``` Of course, returning inputs solved the problem. As suggestion, a possible error message could display "IndexError: the `key` required by trainer are not found in the dataset" (just an hypothesis, I think there could be something better). Please tell me if you need more details to reproduce, glad to help!
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
129
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 Well, if I can try to suggest how to reproduce, please try by do not returning any updated content in the map function used to tokenize input (e.g., in TokenClassification). I can leave here my wrong version for reference: ```python def preprocess_function(examples): text = examples["text"] inputs = tokenizer( text, max_length=512, truncation="only_second", return_offsets_mapping=True, padding="max_length", ) offset_mapping = inputs.pop("offset_mapping") # ... processing code inputs["labels"] = label_ids #return inputs train_ds = train_ds.map(preprocess_function, batched=False) test_ds = test_ds.map(preprocess_function, batched=False) eval_ds = eval_ds.map(preprocess_function, batched=False) ``` Of course, returning inputs solved the problem. As suggestion, a possible error message could display "IndexError: the `key` required by trainer are not found in the dataset" (just an hypothesis, I think there could be something better). Please tell me if you need more details to reproduce, glad to help!
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2988
IndexError: Invalid key: 14 is out of bounds for size 0
That's the thing though. The `Trainer` has no idea which inputs are required or not since all models can have different kinds of inputs, and it can work for models outside of the Transformers library. I can add a clear error message if I get an empty batch, as this is easy to detect, but that's pretty much it.
## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0
59
IndexError: Invalid key: 14 is out of bounds for size 0 ## Describe the bug A clear and concise description of what the bug is. Hi. I am trying to implement stochastic weighted averaging optimizer with transformer library as described here https://pytorch.org/blog/pytorch-1.6-now-includes-stochastic-weight-averaging/ , for this I am using a run_clm.py codes which is working fine before adding SWA optimizer, the moment I modify the model with `swa_model = AveragedModel(model)` in this script, I am getting the below error, since I am NOT touching the dataloader part, I am confused why this is occurring, I very much appreciate your opinion on this @lhoestq ## Steps to reproduce the bug ``` Traceback (most recent call last): File "run_clm.py", line 723, in <module> main() File "run_clm.py", line 669, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/transformers/trainer.py", line 1258, in train for step, inputs in enumerate(epoch_iterator): File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 435, in __next__ data = self._next_data() File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 475, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1530, in __getitem__ format_kwargs=self._format_kwargs, File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 368, in query_table _check_valid_index_key(key, size) File "/user/dara/libs/anaconda3/envs/success/lib/python3.7/site-packages/datasets/formatting/formatting.py", line 311, in _check_valid_index_key raise IndexError(f"Invalid key: {key} is out of bounds for size {size}") IndexError: Invalid key: 14 is out of bounds for size 0 ``` ## Expected results not getting the index error ## Actual results Please see the above ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: datasets 1.12.1 - Platform: linux - Python version: 3.7.11 - PyArrow version: 5.0.0 That's the thing though. The `Trainer` has no idea which inputs are required or not since all models can have different kinds of inputs, and it can work for models outside of the Transformers library. I can add a clear error message if I get an empty batch, as this is easy to detect, but that's pretty much it.
[ -0.38961416482925415, -0.28968849778175354, -0.014630173332989216, 0.3087922930717468, 0.34734809398651123, -0.24184107780456543, 0.3561576306819916, 0.2430756837129593, 0.19433623552322388, 0.34438180923461914, 0.03162959963083267, 0.18565458059310913, -0.12412982434034348, 0.0681879073381424, -0.3634170889854431, -0.3182573914527893, -0.138527512550354, 0.13195499777793884, -0.2823425531387329, 0.16124854981899261, -0.2188626378774643, 0.20609746873378754, -0.2639537453651428, 0.17589250206947327, -0.04977121949195862, -0.037160083651542664, 0.09921909868717194, -0.0780251994729042, 0.03202243894338608, -0.249423548579216, 0.33544787764549255, -0.3468518853187561, 0.24570882320404053, 0.7273563742637634, -0.00011929123138543218, -0.025481637567281723, 0.44139719009399414, -0.22307606041431427, -0.0005034012719988823, -0.07462464272975922, 0.6110764741897583, -0.3019437789916992, -0.014057506807148457, -0.2531580328941345, 0.206074059009552, -0.3909287750720978, -0.13411979377269745, -0.027949806302785873, 0.1947905570268631, 0.25877809524536133, 0.14318333566188812, 0.30598995089530945, 0.07808321714401245, -0.2722993493080139, -0.11236945539712906, -0.21180535852909088, 0.04021751880645752, 0.2579286992549896, 0.0773186981678009, -0.17404809594154358, -0.24389883875846863, 0.0654502809047699, 0.11490541696548462, -0.056648191064596176, 0.5178042650222778, -0.28402504324913025, 0.11439041793346405, -0.1758088618516922, -0.01459578424692154, -0.0034221410751342773, 0.26110145449638367, -0.0868973359465599, -0.19315093755722046, -0.35896584391593933, 0.06259354948997498, -0.025444677099585533, 0.09882371872663498, 0.07030243426561356, 0.02249864861369133, 0.052388787269592285, 0.1724584698677063, 0.39398059248924255, -0.1061742901802063, 0.22591786086559296, -0.08005930483341217, 0.3932596445083618, -0.07562904059886932, 0.2439517080783844, 0.5022859573364258, -0.10245822370052338, 0.10658102482557297, 0.28659865260124207, 0.0634874626994133, 0.2548938989639282, -0.3530232012271881, -0.20108839869499207, 0.2330772578716278, -0.6732482314109802, -0.19281402230262756, 0.20074816048145294, 0.1331625133752823, -0.09082765877246857, 0.6408693790435791, -0.12303396314382553, 0.22539052367210388, 0.3644767701625824, -0.2757491171360016, 0.13004153966903687, 0.3418734073638916, 0.22270937263965607, 0.1012674868106842, -0.21183788776397705, 0.23604802787303925, -0.30045053362846375, 0.08319613337516785, -0.0416879840195179, -0.0521920770406723, 0.1723071187734604, -0.15865060687065125, 0.22815188765525818, -0.035368312150239944, -0.14321620762348175, 0.07903230935335159, 0.30534741282463074, 0.14847815036773682, 0.2386113405227661, 0.3460196256637573, 0.19625204801559448, -0.21350082755088806, 0.21457527577877045, -0.1948220133781433, 0.18090662360191345, 0.08934511244297028, -0.2781766951084137, -0.008950814604759216, -0.0071540717035532, 0.43080753087997437, -0.07015309482812881, 0.36314791440963745, -0.5140985250473022, 0.10392394661903381, -0.10845634341239929, -0.28153231739997864, 0.4845500588417053, -0.12155155837535858, -0.05170917510986328, 0.1621130108833313, -0.03601115569472313, -0.12428304553031921, 0.2764679789543152, -0.4824528098106384, -0.6505848169326782, 0.018349993973970413, 0.09181711077690125, -0.2360074669122696, 0.2977597117424011, -0.09810016304254532, -0.1434907466173172, 0.2951728105545044, 0.06482012569904327, 0.18493054807186127, -0.39213889837265015, -0.04306938499212265, -0.04960064962506294, 0.06026586890220642, 0.05684710294008255, -0.04716766998171806, -0.20999394357204437, -0.044807318598032, -0.08339522778987885, 0.12594746053218842, 0.08747196197509766, -0.35431718826293945, 0.32842740416526794, -0.33129340410232544, 0.16925396025180817, 0.3340458869934082, -0.22916513681411743, -0.7091077566146851, 0.006151547189801931, -0.4203283190727234, -0.15053370594978333, 0.09039139002561569, 0.14348718523979187, 0.1855771243572235, -0.004922959487885237, -0.08241525292396545, 0.16053612530231476, 0.03819338232278824, 0.012447653338313103, -0.10243916511535645, -0.05443987995386124, 0.27477478981018066, 0.09308211505413055, 0.24783633649349213, 0.06887242197990417, -0.011341884732246399, 0.4366554021835327, -0.05443703383207321, -0.016929540783166885, 0.030648332089185715, 0.136325865983963, 0.10234545171260834, -0.2260519117116928, 0.31371885538101196, -0.20963165163993835, 0.05509715527296066, 0.10353685170412064, -0.3195702135562897, 0.18819710612297058, -0.03635603189468384, -0.036387763917446136, -0.35400164127349854, 0.07939799875020981, 0.10376819223165512, -0.09912732243537903, 0.03520279377698898, -0.14506088197231293, -0.0832667276263237, -0.38847920298576355, 0.03415064886212349, -0.003755347803235054, -0.40482762455940247, -0.0301959291100502, -0.0421595573425293, 0.1399485468864441, -0.22817586362361908, -0.17466206848621368, -0.23530182242393494, 0.1891426146030426, -0.07527143508195877, -0.18338213860988617, -0.31183913350105286, 0.26747041940689087, -0.15483880043029785, -0.03721486032009125, -0.3062782883644104, 0.17641529440879822, 0.19576901197433472, -0.05091927945613861, 0.2716097831726074, 0.40830978751182556, 0.11796461045742035, -0.25626087188720703, 0.454143226146698, 0.6124861240386963, -0.12885814905166626, 0.05794360861182213, -0.13821206986904144, -0.060069479048252106, 0.313953697681427, -0.01766008883714676, -0.08809716254472733, -0.02221262827515602, 0.02085895836353302, -0.3356960713863373, 0.08024349808692932, -0.27823665738105774, -0.10842689871788025, -0.2599349915981293, 0.022138118743896484, 0.11739203333854675, -0.01866750419139862, 0.25550368428230286, -0.03471837937831879, 0.21164631843566895, -0.28275808691978455, 0.24824608862400055, 0.519213855266571, 0.06964714825153351, -0.2654946744441986, 0.15916486084461212, 0.35440757870674133, -0.045387424528598785, 0.22925728559494019, 0.33594173192977905, 0.27286991477012634, 0.4669201374053955, 0.1930987387895584, 0.13998723030090332, 0.008598759770393372, -0.3180224895477295, -0.06416616588830948, 0.44248056411743164, -0.2965272068977356, 0.2216304987668991, 0.13437290489673615, 0.03989400714635849, -0.1693694293498993, -0.11875443905591965, -0.1792629361152649, -0.2337692826986313, -0.12373021245002747, 0.3886534571647644, -0.4316181242465973, 0.053036466240882874, -0.2674811780452728, 0.2882053256034851, 0.257682204246521, 0.32597100734710693, 0.14786340296268463, 0.2398405820131302, 0.013971617445349693, -0.10785804688930511, 0.09400195628404617, -0.02516482211649418, -0.019272351637482643, 0.15829703211784363, 0.056291669607162476, 0.4700145721435547, -0.4344230592250824, -0.059987448155879974, 0.03430094197392464, 0.12940895557403564, 0.25922560691833496, 0.11206109076738358, -0.11112827062606812, -0.2542455494403839, 0.28708532452583313, -0.16612036526203156, -0.17537474632263184, 0.25201359391212463, -0.04502458497881889, 0.27331435680389404, -0.32961732149124146, -0.25297853350639343, -0.32492339611053467, -0.4631486237049103, -0.12745843827724457, -0.020683202892541885, 0.2834063172340393, -0.06593043357133865, 0.39486896991729736, 0.1004977896809578, 0.30037423968315125, -0.0638103112578392, -0.025614116340875626, 0.1553848832845688, 0.38771745562553406, -0.03663138300180435, -0.38858509063720703, -0.02184174209833145, -0.14969170093536377, -0.023551899939775467, -0.42202311754226685, -0.5347439050674438, -0.010410458780825138, -0.10613086819648743, -0.15528109669685364, -0.3330343961715698, 0.03990568220615387, 0.6237719058990479, -0.17321085929870605, -0.0035059675574302673, -0.12276292592287064, -0.08435828238725662, 0.305091917514801, -0.028502386063337326, 0.10498210787773132, 0.14101329445838928, 0.5239763855934143, 0.09099666774272919, 0.66153883934021, 0.08057276904582977, -0.22199003398418427, 0.07311124354600906, 0.03397224098443985, -0.11559538543224335, -0.13298162817955017, -0.2787257730960846, -0.12614399194717407, 0.11704343557357788, 0.05323879420757294, 0.14626802504062653, -0.040653157979249954, -0.05889919400215149, -0.0442400686442852, -0.3898814618587494, 0.06793922185897827, -0.11911322176456451, 0.43924108147621155, 0.039263732731342316, -0.14626750349998474, -0.20175516605377197, 0.15628564357757568, -0.3677309453487396, 0.04542769119143486, 0.06065913662314415, 0.08319652080535889, -0.005758047103881836, -0.0681999921798706, -0.15381164848804474, -0.18215715885162354, -0.18418529629707336, 0.14828504621982574, -0.07782144844532013, 0.46433210372924805, 0.32828179001808167, -0.4003276824951172, 0.020160026848316193, -0.2008957713842392, 0.536335289478302, 0.41096195578575134, 0.021490460261702538, 0.09031404554843903, -0.21880853176116943, -0.31099933385849, -0.3306913673877716, -0.20264002680778503, 0.0749422088265419, 0.45884034037590027, 0.6667370200157166, -0.12704643607139587, -0.0343615785241127, 0.09654522687196732, -0.024578796699643135, -0.409981369972229, -0.4310482442378998, -0.21460118889808655, -0.2960514426231384, -0.2913318872451782, 0.31083324551582336, 0.20960071682929993, 0.579138457775116, -0.03624066710472107, 0.23551343381404877, 0.006162825971841812, -0.29118621349334717, -0.10626596212387085, 0.054715845733881, 0.3968638479709625, -0.15097011625766754, 0.15114529430866241, -0.11939238011837006, 0.1363823264837265, 0.3010886311531067, 0.25734710693359375, 0.46277254819869995, 0.0616532564163208, 0.2689111530780792, -0.0687384381890297, 0.0620281845331192, 0.09510886669158936, -0.028758764266967773, 0.0753098577260971, 0.04269995540380478, 0.4076946973800659, -0.30399081110954285, -0.2850577235221863, 0.013832193799316883, 0.14249679446220398, 0.13186712563037872, 0.16279156506061554, 0.2829703986644745, -0.16612645983695984, 0.09333519637584686, 0.11444802582263947, 0.05980921536684036, -0.1312911957502365, 0.4492308497428894, 0.01478683203458786, 0.9463523626327515, 0.3311305642127991, -0.09304291009902954, 0.2114553451538086, 0.06937861442565918, -0.04607903212308884, -0.10623674839735031, 0.12901389598846436, -0.3233069181442261, -0.66611647605896, 0.10166561603546143, -0.3873283267021179, 0.09942353516817093, -0.13969704508781433, -0.12259916961193085, -0.1698266714811325, -0.2352546900510788, 0.17387157678604126, -0.16422419250011444, 0.24713090062141418, -0.10082082450389862, -0.13730986416339874, 0.05053336173295975, -0.02595522254705429, -0.1100231409072876, 0.37434616684913635, -0.0031825732439756393, -0.17974260449409485, -0.121736079454422, -0.3162456154823303, -0.02307721972465515, -0.03911083936691284, 0.14653919637203217, -0.07120765000581741, 0.2969760298728943, -0.072672039270401, 0.3097129762172699, 0.025480784475803375, -0.17211411893367767, 0.08968078345060349, 0.08669941872358322, -0.06966829299926758, -0.21987521648406982, 0.1336294561624527, 0.1406128704547882, 0.1632135957479477, 0.22908125817775726, -0.24555441737174988, -0.32761403918266296, 0.04813876748085022, -0.1031927540898323, -0.45088863372802734, 0.47224223613739014, 0.05936601012945175, -0.29625970125198364, -0.3895045220851898, -0.2472313791513443, -0.10255323350429535, -0.18713828921318054, -0.2765868604183197, 0.05568400025367737, 0.05542202293872833, -0.40723294019699097, 0.1004980206489563, 0.036712996661663055, -0.39161938428878784, -0.030907027423381805, 0.6225136518478394, 0.3503401279449463, -0.24192100763320923, 0.7473562955856323, 0.18199871480464935, -0.18084658682346344, -0.10853638499975204, -0.19507461786270142, 0.35355642437934875, -0.5627776980400085, 0.19947326183319092, -0.36830058693885803, -0.2971738874912262, 0.03346848115324974, 0.034085772931575775, 0.3909316062927246, 0.3391759991645813, -0.4339446723461151, -0.536709189414978, -0.7545616030693054, 0.12734933197498322, 0.1564338505268097, 0.059490133076906204, -0.37287604808807373, 0.11671845614910126, -0.08291173726320267, 0.14614711701869965, -0.22829872369766235, 0.1284327208995819, -0.008562969043850899, 0.0038312599062919617, 0.003142779693007469, -0.1480109989643097, -0.1682533174753189, 0.22929485142230988, -0.1295420080423355, 0.28406059741973877, -0.2598877549171448, -0.11226344853639603, -0.21449416875839233, 0.1628766655921936, 0.045687370002269745, -0.24145889282226562, 0.0780562236905098, -0.3333054184913635, -0.17155684530735016, -0.049201615154743195, 0.017212580889463425, -0.08404744416475296, -0.13535235822200775, 0.2390272170305252, 0.49655863642692566, 0.18768277764320374, -0.002117358148097992, 0.10194448381662369, 0.04704609140753746, 0.3931734561920166, 0.038890544325113297, 0.27767863869667053, 0.16084545850753784, -0.014615148305892944, -0.7097653150558472, 0.02339271828532219, -0.2320084124803543, 0.314942866563797, 0.21927103400230408, -0.23054976761341095, 0.15108060836791992, 0.30132532119750977, 0.31492865085601807, 0.23369167745113373, -0.2265133261680603, -0.03712926805019379, 0.05876831337809563, 0.09518101811408997, -0.41619905829429626, 0.08858506381511688, -0.07294662296772003, 0.21166786551475525, -0.14518652856349945, 0.3370388448238373, 0.21750450134277344, -0.3061087727546692, 0.017047367990016937, 0.32706382870674133, 0.4434661567211151, 0.008415114134550095, 0.344849169254303, 0.704658567905426, -0.21098937094211578, 0.00044386088848114014, 0.5873837471008301, -0.038960594683885574, 0.20582205057144165, 0.23870177567005157, -0.12565821409225464, 0.0768689513206482, 0.2728784382343292, 0.13426335155963898, -0.38591182231903076, -0.3516209125518799, -0.14306792616844177, 0.41513046622276306, 0.13848820328712463, -0.08844106644392014, 0.2173749953508377, 0.20476184785366058, 0.1229977011680603, -0.188259094953537, -0.1687011420726776, 0.17884083092212677, -0.4863318204879761, 0.03182581067085266, -0.18999788165092468, -0.22957473993301392, -0.06886588782072067, -0.11843337118625641, 0.19856470823287964, 0.00039333850145339966, 0.17019212245941162, -0.15846776962280273, -0.6220911145210266, 0.10150320827960968, -0.17919501662254333, 0.05036601796746254, 0.08142925798892975, -0.4935533404350281, -0.054016873240470886, 0.5459262132644653, 0.11020417511463165, 0.1745654195547104, 0.30704379081726074, 0.49149346351623535, 0.23895461857318878, -0.15015731751918793, 0.2299441397190094, 0.1902155876159668, -0.09879368543624878, -0.026118094101548195, 0.17979398369789124, 0.19596362113952637, 0.05089590698480606, 0.16051073372364044, -0.018972501158714294, -0.2620551288127899, 0.1531515270471573, 0.2661645710468292, 0.4774605929851532, -0.04038560763001442, 0.4247019290924072, -0.0009854696691036224, -0.19162186980247498, 0.04060396924614906, 0.009948037564754486, -0.016658347100019455, 0.20932845771312714, 0.2510598599910736, -0.12156867980957031, 0.15603306889533997, -0.11049360781908035, 0.023783762007951736, -0.22391533851623535, 0.3886372447013855, 0.17897489666938782, -0.2362096607685089, -0.1515505462884903, 0.05732974410057068, -0.4185594320297241, 0.3234848976135254, -0.12326028943061829, 0.10798381268978119, 0.24811989068984985, 0.09377361834049225, -0.11242275685071945, -0.2457316666841507, 0.3506767153739929, -0.13493989408016205, 0.1341017484664917, 0.33113202452659607, -0.13716255128383636, -0.2804759442806244, -0.35879582166671753, 0.2100536823272705, 0.11082346737384796, -0.19921386241912842, -0.1049848347902298, -0.09895213693380356, 0.12053313106298447, -0.08914081752300262, 0.03945520520210266, -0.10397021472454071, 0.2759314179420471, 0.29313528537750244, 0.001987401396036148, 0.32021382451057434, 0.06722622364759445, 0.29832836985588074, -0.20937129855155945, -0.11110232025384903, -0.17512115836143494, 0.03614480420947075, 0.3861500322818756, 0.4726257026195526, -0.14270088076591492, 0.0302245132625103, -0.3821081519126892, -0.10918727517127991, -0.14929568767547607, -0.20008553564548492, -0.3047293424606323, 0.395378053188324, -0.2962297797203064, -0.11997285485267639, 0.2076253741979599, 0.04917402192950249, 0.2501022219657898, 0.04612021893262863, -0.18871837854385376, -0.2930038273334503, 0.28579413890838623, -0.3343796730041504, -0.290103554725647, -0.11649977415800095, 0.09065078943967819, -0.24980279803276062, 0.06247948855161667, -0.5397148132324219, 0.10796872526407242, 0.14491821825504303, -0.055877767503261566, -0.045102864503860474, 0.14936649799346924, -0.21657995879650116, -0.081943079829216, 0.042178329080343246, 0.28114068508148193, 0.08152201026678085, -0.13325752317905426, -0.27174240350723267, -0.17234395444393158 ]
https://github.com/huggingface/datasets/issues/2987
ArrowInvalid: Can only convert 1-dimensional array values
Hi @NielsRogge, thanks for reporting! In `datasets`, we were handling N-dimensional arrays only when passed as an instance of `np.array`, not when passed as a list of `np.array`s. I'm fixing it.
## Describe the bug For the ViT and LayoutLMv2 demo notebooks in my [Transformers-Tutorials repo](https://github.com/NielsRogge/Transformers-Tutorials), people reported an ArrowInvalid issue after applying the following function to a Dataset: ``` def preprocess_data(examples): images = [Image.open(path).convert("RGB") for path in examples['image_path']] words = examples['words'] boxes = examples['bboxes'] word_labels = examples['ner_tags'] encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels, padding="max_length", truncation=True) return encoded_inputs ``` ``` Full trace: --------------------------------------------------------------------------- ArrowInvalid Traceback (most recent call last) <ipython-input-8-0fc3efc6f0c2> in <module>() 27 28 train_dataset = datasets['train'].map(preprocess_data, batched=True, remove_columns=datasets['train'].column_names, ---> 29 features=features) 30 test_dataset = datasets['test'].map(preprocess_data, batched=True, remove_columns=datasets['test'].column_names, 31 features=features) 13 frames /usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1701 new_fingerprint=new_fingerprint, 1702 disable_tqdm=disable_tqdm, -> 1703 desc=desc, 1704 ) 1705 else: /usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 183 } 184 # apply actual function --> 185 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 186 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 187 # re-apply format to the output /usr/local/lib/python3.7/dist-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 396 # Call actual function 397 --> 398 out = func(self, *args, **kwargs) 399 400 # Update fingerprint of in-place transforms + update in-place history of transforms /usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2063 writer.write_table(batch) 2064 else: -> 2065 writer.write_batch(batch) 2066 if update_data and writer is not None: 2067 writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 409 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) 410 typed_sequence_examples[col] = typed_sequence --> 411 pa_table = pa.Table.from_pydict(typed_sequence_examples) 412 self.write_table(pa_table, writer_batch_size) 413 /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pydict() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.asarray() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 106 storage = numpy_to_pyarrow_listarray(self.data, type=type.value_type) 107 else: --> 108 storage = pa.array(self.data, type.storage_dtype) 109 out = pa.ExtensionArray.from_storage(type, storage) 110 elif isinstance(self.data, np.ndarray): /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: Can only convert 1-dimensional array values ``` It can be fixed by adding the following line: ```diff def preprocess_data(examples): images = [Image.open(path).convert("RGB") for path in examples['image_path']] words = examples['words'] boxes = examples['bboxes'] word_labels = examples['ner_tags'] encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels, padding="max_length", truncation=True) + encoded_inputs["image"] = np.array(encoded_inputs["image"]) return encoded_inputs ``` However, would be great if this can be fixed within Datasets itself.
31
ArrowInvalid: Can only convert 1-dimensional array values ## Describe the bug For the ViT and LayoutLMv2 demo notebooks in my [Transformers-Tutorials repo](https://github.com/NielsRogge/Transformers-Tutorials), people reported an ArrowInvalid issue after applying the following function to a Dataset: ``` def preprocess_data(examples): images = [Image.open(path).convert("RGB") for path in examples['image_path']] words = examples['words'] boxes = examples['bboxes'] word_labels = examples['ner_tags'] encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels, padding="max_length", truncation=True) return encoded_inputs ``` ``` Full trace: --------------------------------------------------------------------------- ArrowInvalid Traceback (most recent call last) <ipython-input-8-0fc3efc6f0c2> in <module>() 27 28 train_dataset = datasets['train'].map(preprocess_data, batched=True, remove_columns=datasets['train'].column_names, ---> 29 features=features) 30 test_dataset = datasets['test'].map(preprocess_data, batched=True, remove_columns=datasets['test'].column_names, 31 features=features) 13 frames /usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in map(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, num_proc, suffix_template, new_fingerprint, desc) 1701 new_fingerprint=new_fingerprint, 1702 disable_tqdm=disable_tqdm, -> 1703 desc=desc, 1704 ) 1705 else: /usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in wrapper(*args, **kwargs) 183 } 184 # apply actual function --> 185 out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) 186 datasets: List["Dataset"] = list(out.values()) if isinstance(out, dict) else [out] 187 # re-apply format to the output /usr/local/lib/python3.7/dist-packages/datasets/fingerprint.py in wrapper(*args, **kwargs) 396 # Call actual function 397 --> 398 out = func(self, *args, **kwargs) 399 400 # Update fingerprint of in-place transforms + update in-place history of transforms /usr/local/lib/python3.7/dist-packages/datasets/arrow_dataset.py in _map_single(self, function, with_indices, input_columns, batched, batch_size, drop_last_batch, remove_columns, keep_in_memory, load_from_cache_file, cache_file_name, writer_batch_size, features, disable_nullable, fn_kwargs, new_fingerprint, rank, offset, disable_tqdm, desc, cache_only) 2063 writer.write_table(batch) 2064 else: -> 2065 writer.write_batch(batch) 2066 if update_data and writer is not None: 2067 writer.finalize() # close_stream=bool(buf_writer is None)) # We only close if we are writing in a file /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in write_batch(self, batch_examples, writer_batch_size) 409 typed_sequence = OptimizedTypedSequence(batch_examples[col], type=col_type, try_type=col_try_type, col=col) 410 typed_sequence_examples[col] = typed_sequence --> 411 pa_table = pa.Table.from_pydict(typed_sequence_examples) 412 self.write_table(pa_table, writer_batch_size) 413 /usr/local/lib/python3.7/dist-packages/pyarrow/table.pxi in pyarrow.lib.Table.from_pydict() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.asarray() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._handle_arrow_array_protocol() /usr/local/lib/python3.7/dist-packages/datasets/arrow_writer.py in __arrow_array__(self, type) 106 storage = numpy_to_pyarrow_listarray(self.data, type=type.value_type) 107 else: --> 108 storage = pa.array(self.data, type.storage_dtype) 109 out = pa.ExtensionArray.from_storage(type, storage) 110 elif isinstance(self.data, np.ndarray): /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib.array() /usr/local/lib/python3.7/dist-packages/pyarrow/array.pxi in pyarrow.lib._sequence_to_array() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() /usr/local/lib/python3.7/dist-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: Can only convert 1-dimensional array values ``` It can be fixed by adding the following line: ```diff def preprocess_data(examples): images = [Image.open(path).convert("RGB") for path in examples['image_path']] words = examples['words'] boxes = examples['bboxes'] word_labels = examples['ner_tags'] encoded_inputs = processor(images, words, boxes=boxes, word_labels=word_labels, padding="max_length", truncation=True) + encoded_inputs["image"] = np.array(encoded_inputs["image"]) return encoded_inputs ``` However, would be great if this can be fixed within Datasets itself. Hi @NielsRogge, thanks for reporting! In `datasets`, we were handling N-dimensional arrays only when passed as an instance of `np.array`, not when passed as a list of `np.array`s. I'm fixing it.
[ 0.01255839318037033, -0.22509056329727173, -0.06407824158668518, 0.3261036276817322, 0.31389617919921875, -0.05451763793826103, 0.5233936309814453, 0.3854966461658478, -0.1324627548456192, 0.16101792454719543, -0.09981141239404678, 0.39055025577545166, -0.15413916110992432, -0.3239714205265045, -0.05269082635641098, -0.26015904545783997, 0.05688773840665817, 0.24710258841514587, -0.35043397545814514, -0.11361657828092575, -0.21518899500370026, 0.1386076658964157, -0.3287164568901062, 0.17850688099861145, -0.49045851826667786, 0.0188538059592247, 0.24386292695999146, -0.09677373617887497, -0.028074322268366814, -0.4570605158805847, 0.44344937801361084, -0.5039923787117004, -0.03662490099668503, 0.09867359697818756, -0.00012006761971861124, 0.31303274631500244, 0.25925150513648987, -0.05646013841032982, -0.21380417048931122, 0.04174689203500748, -0.2138555943965912, -0.21976393461227417, -0.057279862463474274, -0.11272214353084564, 0.047504618763923645, -0.14225445687770844, -0.16037625074386597, -0.42064714431762695, 0.2123163938522339, 0.3096625506877899, 0.12904773652553558, 0.028949767351150513, 0.29422658681869507, 0.16279244422912598, 0.24448814988136292, 0.41791248321533203, -0.35360804200172424, -0.08958563208580017, -0.004634097218513489, -0.09599572420120239, 0.019061118364334106, 0.6528993844985962, 0.07977082580327988, 0.310849666595459, 0.12191591411828995, 0.0385066457092762, 0.08144660294055939, -0.14191120862960815, -0.05926210433244705, -0.05508960783481598, -0.13484826683998108, -0.13455381989479065, -0.37509921193122864, -0.009920105338096619, -0.16194792091846466, -0.10329184681177139, -0.020307622849941254, 0.22548510134220123, -0.15967923402786255, 0.132292240858078, -0.33192262053489685, 0.10162176936864853, -0.3584592938423157, 0.12739692628383636, 0.04825223237276077, 0.3908790946006775, 0.019235072657465935, 0.4149588346481323, 0.017909135669469833, -0.2151845246553421, 0.13250814378261566, 0.17078818380832672, 0.005198188126087189, 0.041252657771110535, -0.16711080074310303, 0.0354253426194191, -0.27626365423202515, -0.6151008009910583, -0.027829844504594803, -0.35557979345321655, 0.2759591042995453, -0.09991302341222763, 0.2962430417537689, 0.17830415070056915, -0.042534466832876205, 0.12813138961791992, -0.0734110102057457, 0.6897249817848206, 0.0573909655213356, -0.346184641122818, 0.22242966294288635, 0.04894333705306053, -0.19994772970676422, -0.26272085309028625, 0.32724809646606445, 0.16212642192840576, 0.5192002654075623, -0.023493926972150803, -0.2893504798412323, 0.038450658321380615, -0.6805960536003113, 0.177480548620224, -0.02797047793865204, -0.08286292105913162, 0.3832974433898926, 0.32376784086227417, 0.2564535140991211, 0.010777734220027924, -0.20522964000701904, -0.2501850128173828, -0.017116403207182884, 0.16800549626350403, -0.3766368627548218, -0.09058104455471039, 0.3041079640388489, 0.343429297208786, -0.09620639681816101, 0.022897131741046906, 0.10224054753780365, -0.3123776614665985, 0.2665746510028839, -0.15680427849292755, 0.5608104467391968, 0.25381582975387573, -0.6018442511558533, 0.20649465918540955, 0.20241788029670715, -0.015257555991411209, -0.10678879916667938, 0.17391455173492432, -0.2174772322177887, -0.047963518649339676, -0.08438435196876526, 0.04928690195083618, 0.31012219190597534, -0.0314699187874794, 0.12636850774288177, -0.016326013952493668, 0.35440853238105774, -0.15035007894039154, 0.23416277766227722, -0.602918267250061, 0.13116170465946198, 0.0172601155936718, 0.022054029628634453, -0.015189185738563538, -0.48419076204299927, 0.013819634914398193, 0.17113786935806274, 0.13948874175548553, 0.10182545334100723, 0.49684378504753113, -0.2680497169494629, -0.03322529047727585, -0.07119141519069672, 0.12722988426685333, 0.2004065066576004, -0.4127586781978607, -0.39246314764022827, 0.1324339658021927, 0.020244330167770386, -0.2523575723171234, -0.1226910874247551, 0.26513269543647766, 0.06271957606077194, -0.04710930958390236, 0.11052268743515015, 0.2199370265007019, 0.15054771304130554, 0.41985031962394714, -0.3076920509338379, -0.2884521186351776, 0.04342552274465561, -0.01032683439552784, 0.06612107157707214, -0.08102700859308243, -0.1773376762866974, 0.0003423793241381645, 0.06111340969800949, -0.31039005517959595, 0.5417240858078003, 0.3083401918411255, 0.14078664779663086, -0.3482534885406494, 0.33308228850364685, -0.029644088819622993, -0.3960367739200592, -0.011701907962560654, 0.10143373906612396, -0.14603114128112793, -0.42563068866729736, -0.056558772921562195, -0.3827603757381439, 0.30259501934051514, -0.045217547565698624, -0.1996525079011917, 0.10040086507797241, 0.16159430146217346, -0.03236953914165497, -0.48258474469184875, -0.13365702331066132, -0.1162039116024971, 0.2961221933364868, -0.008988412097096443, -0.25008586049079895, 0.14425908029079437, 0.09965021163225174, -0.42371150851249695, -0.1166839674115181, 0.08758457005023956, 0.07122407108545303, -0.04410843923687935, -0.3085283935070038, 0.24070242047309875, 0.3227181136608124, -0.05856448411941528, 0.10229293256998062, 0.1582079827785492, 0.11552576720714569, -0.6222928762435913, 0.07593078911304474, 0.42412030696868896, 0.3624918460845947, 0.19299283623695374, -0.3624495565891266, 0.3452550768852234, -0.18644309043884277, 0.20535165071487427, -0.2351037561893463, 0.24812817573547363, 0.19281987845897675, 0.10884548723697662, -0.20785513520240784, -0.25624650716781616, -0.2983057200908661, 0.08053107559680939, 0.46338486671447754, 0.04263218864798546, -0.12019193172454834, -0.022179923951625824, -0.008312735706567764, 0.026004794985055923, 0.06232420355081558, -0.03655194491147995, -0.18903326988220215, 0.12388067692518234, 0.2677147686481476, 0.19311414659023285, 0.06816849857568741, 0.154281884431839, -0.0379517562687397, 0.02705826610326767, -0.22759492695331573, -0.03098307177424431, 0.33533135056495667, 0.12552958726882935, 0.12496954947710037, 0.11436361074447632, 0.27035093307495117, -0.06541936099529266, -0.20631340146064758, 0.014313116669654846, 0.05713404715061188, 0.22684796154499054, -0.3831495940685272, 0.3173161745071411, -0.26169875264167786, 0.18249592185020447, -0.22616012394428253, -0.3586672842502594, 0.12529867887496948, 0.05419921875, -0.21380431950092316, 0.06851287186145782, -0.24795174598693848, 0.3261955678462982, -0.00705873966217041, 0.1636604517698288, 0.5131136775016785, -0.028504086658358574, -0.3113807141780853, -0.14216019213199615, -0.16694802045822144, -0.03138351812958717, 0.06167569011449814, 0.0145106241106987, 0.015928473323583603, 0.48689791560173035, 0.18057624995708466, -0.40632325410842896, -0.2867932617664337, 0.14078423380851746, -0.18489134311676025, 0.037194643169641495, 0.14058871567249298, -0.10171493887901306, -0.09185568988323212, -0.15230417251586914, 0.06140372157096863, 0.17649424076080322, 0.02847481705248356, 0.3431154191493988, -0.07045508176088333, -0.15987713634967804, -0.2897120714187622, -0.24043336510658264, 0.018866930156946182, -0.22445857524871826, 0.15901388227939606, -0.28537440299987793, 0.07004433870315552, 0.15292780101299286, 0.33718591928482056, 0.19001047313213348, -0.006433613132685423, -0.05146647244691849, -0.05487687140703201, 0.5552840828895569, 0.495171457529068, -0.04479420185089111, -0.22651509940624237, -0.21449783444404602, -0.20408625900745392, 0.24364295601844788, 0.5884453058242798, -0.18599911034107208, 0.20786117017269135, -0.3209335207939148, -0.051339369267225266, -0.1826600879430771, -0.058674074709415436, 0.3935036063194275, 0.18987978994846344, -0.005537230521440506, -0.11697635799646378, -0.08620300889015198, 0.20122472941875458, -0.14514634013175964, -0.05135863274335861, -0.13598236441612244, 0.35425880551338196, 0.12523874640464783, 0.37172484397888184, 0.17331482470035553, 0.008098147809505463, 0.12453632056713104, -0.1433454304933548, -0.10082268714904785, -0.1750982105731964, -0.19152387976646423, -0.18963532149791718, -0.06505869328975677, -0.36086899042129517, -0.3378477096557617, -0.04587908089160919, -0.4603222608566284, 0.07823169231414795, 0.30854174494743347, -0.1492069661617279, -0.24910184741020203, 0.1571226269006729, 0.11906996369361877, 0.29976338148117065, -0.002518409863114357, 0.13765323162078857, -0.18547232449054718, 0.06715825200080872, -0.07710759341716766, -0.20382611453533173, 0.10754822939634323, 0.02165132761001587, -0.03666552156209946, -0.15029270946979523, 0.3300292491912842, 0.15858730673789978, 0.2960927486419678, 0.8456713557243347, 0.13181959092617035, -0.3496983051300049, 0.16407012939453125, -0.03747531771659851, 0.07768402993679047, 0.07178971916437149, -0.0578157976269722, 0.3210577070713043, -0.26265430450439453, -0.5090612173080444, -0.3463709056377411, -0.41351640224456787, 0.07887863367795944, 0.18313902616500854, 0.43490102887153625, -0.16502031683921814, -0.19203788042068481, 0.47325819730758667, -0.07235202193260193, -0.0261598601937294, 0.217335507273674, -0.1983688771724701, 0.12752559781074524, -0.36055687069892883, 0.12226057052612305, 0.21374382078647614, 0.03274396061897278, 0.34269168972969055, -0.09843097627162933, -0.48438599705696106, -0.37039071321487427, -0.060304105281829834, 0.11373452842235565, 0.18395349383354187, -0.12426653504371643, 0.06837226450443268, 0.05367911234498024, 0.016857292503118515, 0.04482584819197655, 0.09681177139282227, 0.2275030016899109, -0.38515016436576843, 0.3284243941307068, -0.06556859612464905, 0.11807052791118622, 0.24517369270324707, -0.20022614300251007, -0.2845921814441681, -0.050482623279094696, 0.003297559916973114, -0.05893433466553688, 0.04385804012417793, 0.2717450261116028, -0.09628952294588089, -0.1025603786110878, 0.02239931933581829, 0.47970110177993774, -0.20610275864601135, -0.15812921524047852, 0.5564020872116089, 0.20417620241641998, -0.2528536319732666, 0.24662746489048004, 0.4357397258281708, 0.6493765711784363, 0.3540728688240051, 0.1794760376214981, 0.5074694752693176, -0.3954145908355713, -0.12251564860343933, 0.5111298561096191, 0.23949851095676422, -0.4205932021141052, 0.36926645040512085, -0.057644691318273544, -0.19595207273960114, -0.07119078189134598, 0.0023291558027267456, -0.21885259449481964, -0.19009682536125183, -0.017359934747219086, -0.03684721514582634, -0.0725957527756691, -0.2702902853488922, 0.026393327862024307, -0.28181955218315125, -0.00965200923383236, 0.10631591081619263, -0.1425771415233612, 0.030350835993885994, -0.010813485831022263, -0.255027711391449, -0.49820664525032043, -0.1181071326136589, -0.14993253350257874, 0.06401607394218445, -0.28670674562454224, 0.6785610318183899, 0.22714515030384064, -0.15225790441036224, -0.10004398226737976, -0.06554405391216278, -0.07378217577934265, -0.012116935104131699, -0.16415145993232727, 0.007758166640996933, 0.14250022172927856, 0.10212334990501404, -0.1084601953625679, -0.025878116488456726, 0.2030746191740036, 0.13003483414649963, 0.028062187135219574, -0.0326898992061615, 0.01639387756586075, -0.22589252889156342, -0.03268469125032425, -0.1726241260766983, -0.17007027566432953, -0.1519261598587036, 0.03914766386151314, 0.09284801036119461, -0.2348971962928772, -0.03397057577967644, 0.08018624782562256, -0.022528015077114105, 0.039187800139188766, 0.00020334124565124512, 0.1943952590227127, -0.4165036082267761, 0.3416062891483307, 0.22691160440444946, 0.06821145862340927, -0.12236859649419785, 0.3732702136039734, -0.11936140060424805, -0.14620661735534668, -0.23747307062149048, 0.4362774193286896, 0.36357346177101135, -0.6791540384292603, 0.3279580771923065, -0.48325732350349426, -0.2333100289106369, 0.007834864780306816, 0.35309645533561707, 0.3235827088356018, 0.17802050709724426, -0.3887230157852173, 0.10498397052288055, -0.4631405472755432, 0.2422143518924713, -0.05110570415854454, 0.3958306312561035, -0.2877264618873596, -0.28667619824409485, -0.1718761920928955, -0.12109410762786865, -0.22597244381904602, -0.23112180829048157, -0.015270745381712914, 0.07658718526363373, -0.10814391076564789, -0.11731221526861191, -0.19368070363998413, -0.05587330088019371, 0.0754404366016388, 0.19618339836597443, -0.2455611526966095, -0.07031354308128357, -0.21464505791664124, 0.09654057770967484, 0.10836777836084366, -0.023058684542775154, -0.24199213087558746, -0.04408903419971466, -0.17886042594909668, -0.13247345387935638, 0.025695256888866425, -0.037504296749830246, -0.052859604358673096, 0.44068121910095215, 0.05420346558094025, -0.08123206347227097, 0.20541012287139893, -0.18915322422981262, 0.035292673856019974, -0.03563034534454346, 0.2018156349658966, 0.32740363478660583, 0.11870017647743225, 0.016646258533000946, -0.28268885612487793, 0.11378596723079681, -0.13907365500926971, 0.15653055906295776, 0.27559879422187805, -0.2667803168296814, -0.0005218572914600372, -0.021399833261966705, 0.0041132476180791855, 0.24084590375423431, -0.2556471526622772, -0.16722063720226288, -0.14727360010147095, 0.16081754863262177, -0.0000022705644369125366, 0.1003357321023941, -0.008805109187960625, 0.07433678954839706, 0.014554966241121292, 0.08021143078804016, -0.10447922348976135, 0.12438206374645233, 0.14639082551002502, 0.1078810915350914, 0.16049312055110931, -0.49647021293640137, -0.13500827550888062, 0.4465981423854828, -0.24594295024871826, -0.013535883277654648, 0.28445830941200256, -0.1426519900560379, 0.3968803286552429, 0.26200634241104126, -0.20317575335502625, 0.3282071650028229, 0.37748032808303833, 0.4343092143535614, 0.15494896471500397, 0.2871042490005493, -0.23943419754505157, -0.15924662351608276, -0.1728682518005371, 0.0680525079369545, 0.33191800117492676, 0.014210700988769531, -0.062038835138082504, -0.11774177104234695, -0.14415699243545532, 0.06161193549633026, -0.18076112866401672, -0.06365232914686203, -0.4641631245613098, 0.011013731360435486, -0.4689880907535553, 0.012768108397722244, -0.24767592549324036, 0.43135422468185425, 0.4240415692329407, 0.3701445460319519, 0.011225216090679169, -0.14305755496025085, 0.16175514459609985, 0.3740921914577484, 0.28941255807876587, -0.3515531122684479, 0.22356314957141876, 0.2786955237388611, -0.031911492347717285, -0.24380579590797424, 0.43886739015579224, 0.2777833342552185, 0.4348893165588379, -0.041069261729717255, -0.09349191933870316, -0.03171161189675331, -0.16328567266464233, 0.030692312866449356, 0.3204730451107025, 0.10288117825984955, 0.5434848666191101, -0.07209975272417068, 0.01940312422811985, -0.009594446048140526, -0.013501569628715515, -0.13518601655960083, -0.04951782152056694, -0.029357178136706352, 0.22157108783721924, -0.22207945585250854, -0.3395206928253174, 0.1910618096590042, -0.14623266458511353, -0.2388240098953247, -0.049090202897787094, 0.36864009499549866, 0.09574487805366516, 0.18440240621566772, 0.19808965921401978, 0.039428409188985825, 0.17629693448543549, 0.4864247739315033, -0.027031008154153824, 0.052098434418439865, -0.0872192531824112, 0.0016328170895576477, -0.3551192581653595, 0.101887047290802, -0.06261073052883148, 0.05144663155078888, 0.25717663764953613, 0.2388819307088852, 0.17833450436592102, 0.3627086877822876, 0.19644580781459808, -0.04615969955921173, -0.046802762895822525, 0.36781740188598633, -0.23362059891223907, 0.11170351505279541, 0.6678335666656494, -0.09312286227941513, 0.20162756741046906, -0.489218145608902, 0.17610757052898407, 0.5673794746398926, 0.0768849328160286, 0.005017569288611412, -0.18209898471832275, 0.03545666113495827, 0.019618619233369827, 0.2910621166229248, 0.2148861587047577, 0.10334507375955582, 0.059940487146377563, -0.09788358956575394, -0.46956849098205566, -0.33920758962631226, -0.20070727169513702, 0.04332137480378151, -0.02367004007101059, 0.5683691501617432, -0.0340517982840538, -0.18961679935455322, -0.1435554474592209, 0.08271662145853043, -0.19856396317481995, -0.14662155508995056, -0.04067391902208328, 0.2729591727256775, -0.3029424846172333, 0.1958610862493515, -0.3956502676010132, -0.05582723766565323, 0.2643531858921051, 0.14520393311977386, -0.2761285901069641, -0.5357804894447327, 0.3915225863456726, -0.011737065389752388, -0.5077089071273804, 0.20810548961162567, 0.15825359523296356, 0.473277747631073, 0.08319012820720673, -0.390700101852417, -0.146109938621521, 0.1562667340040207, -0.16405066847801208, -0.20049400627613068, 0.1527426540851593, 0.3952907621860504, 0.12618619203567505, -0.22739660739898682, 0.5982168912887573, 0.2339686155319214, -0.01751873642206192, -0.2675033509731293, -0.2836204171180725 ]
https://github.com/huggingface/datasets/issues/2984
Exceeded maximum rows when reading large files
Hi @zijwang, thanks for reporting this issue. You did not mention which `datasets` version you are using, but looking at the code in the stack trace, it seems you are using an old version. Could you please update `datasets` (`pip install -U datasets`) and check if the problem persists?
## Describe the bug A clear and concise description of what the bug is. When using `load_dataset` with json files, if the files are too large, there will be "Exceeded maximum rows" error. ## Steps to reproduce the bug ```python dataset = load_dataset('json', data_files=data_files) # data files have 3M rows in a single file ``` ## Expected results No error ## Actual results ``` ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files) 134 with open(file, encoding="utf-8") as f: --> 135 dataset = json.load(f) 136 except json.JSONDecodeError: ~/anaconda3/envs/python/lib/python3.9/json/__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 292 """ --> 293 return loads(fp.read(), 294 cls=cls, object_hook=object_hook, ~/anaconda3/envs/python/lib/python3.9/json/__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None: ~/anaconda3/envs/python/lib/python3.9/json/decoder.py in decode(self, s, _w) 339 if end != len(s): --> 340 raise JSONDecodeError("Extra data", s, end) 341 return obj JSONDecodeError: Extra data: line 2 column 1 (char 20321) During handling of the above exception, another exception occurred: ArrowInvalid Traceback (most recent call last) <ipython-input-20-ab3718a6482f> in <module> ----> 1 dataset = load_dataset('json', data_files=data_files) ~/anaconda3/envs/python/lib/python3.9/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, script_version, use_auth_token, task, streaming, **config_kwargs) 841 842 # Download and prepare data --> 843 builder_instance.download_and_prepare( 844 download_config=download_config, 845 download_mode=download_mode, ~/anaconda3/envs/python/lib/python3.9/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) 606 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 607 if not downloaded_from_gcs: --> 608 self._download_and_prepare( 609 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 610 ) ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 684 try: 685 # Prepare split will record examples associated to the split --> 686 self._prepare_split(split_generator, **prepare_split_kwargs) 687 except OSError as e: 688 raise OSError( ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1153 generator = self._generate_tables(**split_generator.gen_kwargs) 1154 with ArrowWriter(features=self.info.features, path=fpath) as writer: -> 1155 for key, table in utils.tqdm( 1156 generator, unit=" tables", leave=False, disable=bool(logging.get_verbosity() == logging.NOTSET) 1157 ): ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files) 135 dataset = json.load(f) 136 except json.JSONDecodeError: --> 137 raise e 138 raise ValueError( 139 f"Not able to read records in the JSON file at {file}. " ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files) 114 while True: 115 try: --> 116 pa_table = paj.read_json( 117 BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) 118 ) ~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/_json.pyx in pyarrow._json.read_json() ~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: Exceeded maximum rows ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: 3.9 - PyArrow version: 4.0.1
49
Exceeded maximum rows when reading large files ## Describe the bug A clear and concise description of what the bug is. When using `load_dataset` with json files, if the files are too large, there will be "Exceeded maximum rows" error. ## Steps to reproduce the bug ```python dataset = load_dataset('json', data_files=data_files) # data files have 3M rows in a single file ``` ## Expected results No error ## Actual results ``` ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files) 134 with open(file, encoding="utf-8") as f: --> 135 dataset = json.load(f) 136 except json.JSONDecodeError: ~/anaconda3/envs/python/lib/python3.9/json/__init__.py in load(fp, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 292 """ --> 293 return loads(fp.read(), 294 cls=cls, object_hook=object_hook, ~/anaconda3/envs/python/lib/python3.9/json/__init__.py in loads(s, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw) 345 parse_constant is None and object_pairs_hook is None and not kw): --> 346 return _default_decoder.decode(s) 347 if cls is None: ~/anaconda3/envs/python/lib/python3.9/json/decoder.py in decode(self, s, _w) 339 if end != len(s): --> 340 raise JSONDecodeError("Extra data", s, end) 341 return obj JSONDecodeError: Extra data: line 2 column 1 (char 20321) During handling of the above exception, another exception occurred: ArrowInvalid Traceback (most recent call last) <ipython-input-20-ab3718a6482f> in <module> ----> 1 dataset = load_dataset('json', data_files=data_files) ~/anaconda3/envs/python/lib/python3.9/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, script_version, use_auth_token, task, streaming, **config_kwargs) 841 842 # Download and prepare data --> 843 builder_instance.download_and_prepare( 844 download_config=download_config, 845 download_mode=download_mode, ~/anaconda3/envs/python/lib/python3.9/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) 606 logger.warning("HF google storage unreachable. Downloading and preparing it from source") 607 if not downloaded_from_gcs: --> 608 self._download_and_prepare( 609 dl_manager=dl_manager, verify_infos=verify_infos, **download_and_prepare_kwargs 610 ) ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _download_and_prepare(self, dl_manager, verify_infos, **prepare_split_kwargs) 684 try: 685 # Prepare split will record examples associated to the split --> 686 self._prepare_split(split_generator, **prepare_split_kwargs) 687 except OSError as e: 688 raise OSError( ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/builder.py in _prepare_split(self, split_generator) 1153 generator = self._generate_tables(**split_generator.gen_kwargs) 1154 with ArrowWriter(features=self.info.features, path=fpath) as writer: -> 1155 for key, table in utils.tqdm( 1156 generator, unit=" tables", leave=False, disable=bool(logging.get_verbosity() == logging.NOTSET) 1157 ): ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files) 135 dataset = json.load(f) 136 except json.JSONDecodeError: --> 137 raise e 138 raise ValueError( 139 f"Not able to read records in the JSON file at {file}. " ~/anaconda3/envs/python/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py in _generate_tables(self, files) 114 while True: 115 try: --> 116 pa_table = paj.read_json( 117 BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size) 118 ) ~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/_json.pyx in pyarrow._json.read_json() ~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.pyarrow_internal_check_status() ~/anaconda3/envs/python/lib/python3.9/site-packages/pyarrow/error.pxi in pyarrow.lib.check_status() ArrowInvalid: Exceeded maximum rows ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - Platform: Linux - Python version: 3.9 - PyArrow version: 4.0.1 Hi @zijwang, thanks for reporting this issue. You did not mention which `datasets` version you are using, but looking at the code in the stack trace, it seems you are using an old version. Could you please update `datasets` (`pip install -U datasets`) and check if the problem persists?
[ -0.07694624364376068, -0.15560293197631836, -0.13526898622512817, 0.538463294506073, 0.15408354997634888, 0.22822865843772888, 0.09058680385351181, 0.3988283574581146, 0.2924414873123169, 0.09290391206741333, 0.0769098773598671, 0.24269162118434906, -0.004468849860131741, 0.16530831158161163, -0.038523994386196136, 0.10863638669252396, 0.056919388473033905, -0.021820813417434692, -0.06941922008991241, 0.11774401366710663, -0.5645868182182312, -0.011686651036143303, -0.11654684692621231, -0.2815800905227661, -0.137403205037117, 0.04579334333539009, 0.07671403884887695, 0.11934986710548401, -0.08510176837444305, -0.27415287494659424, 0.05897964537143707, -0.12516136467456818, 0.05060673505067825, 0.5795962810516357, -0.00010261622082907706, -0.07413497567176819, 0.282317578792572, -0.1580398976802826, -0.19144611060619354, 0.05247911065816879, -0.15882058441638947, -0.49011948704719543, -0.04460690915584564, -0.4243278205394745, 0.05201263725757599, -0.44418469071388245, -0.45827990770339966, -0.3565165102481842, 0.24676719307899475, 0.39933931827545166, 0.30293935537338257, -0.11070945858955383, 0.3546788692474365, 0.05066998675465584, 0.4560399055480957, 0.009779088199138641, -0.015902724117040634, 0.511215090751648, 0.37274646759033203, 0.02506006322801113, -0.12673348188400269, 0.04516303166747093, 0.1047983467578888, 0.07463344931602478, 0.24789711833000183, -0.016189102083444595, 0.02518458664417267, -0.09675481915473938, 0.1495007425546646, 0.0957239642739296, 0.36407235264778137, -0.16235658526420593, -0.2619970142841339, -0.4543038010597229, 0.09670440107584, -0.14902441203594208, 0.20101186633110046, 0.40333905816078186, -0.2749600112438202, 0.09397692233324051, -0.04903847724199295, -0.16094009578227997, -0.2947118878364563, 0.10803442448377609, -0.1828068345785141, -0.2629234194755554, -0.07036995142698288, -0.09841100126504898, 0.3635617196559906, -0.30427974462509155, 0.16418145596981049, 0.020235523581504822, -0.1379188597202301, -0.018239550292491913, -0.5389520525932312, -0.17759563028812408, 0.24049490690231323, -0.18676573038101196, 0.23799720406532288, -0.048362091183662415, 0.326785147190094, -0.06612151861190796, 0.0765911117196083, 0.16073165833950043, 0.3481047749519348, 0.114504873752594, -0.35956045985221863, 0.14027197659015656, 0.07464007288217545, 0.28767696022987366, -0.05225294828414917, 0.003994356840848923, 0.09305859357118607, -0.14148375391960144, -0.03268260508775711, -0.08247187733650208, 0.16889649629592896, -0.24565815925598145, -0.004477096721529961, 0.5148533582687378, -0.3092025816440582, 0.08403805643320084, 0.023189013823866844, 0.16854479908943176, 0.13308201730251312, 0.1576656699180603, 0.04165789484977722, 0.18856650590896606, -0.07021252065896988, -0.16407528519630432, -0.15973159670829773, 0.0010665487498044968, 0.0312005914747715, -0.039143964648246765, 0.3320557177066803, 0.004641185514628887, 0.060889460146427155, 0.09605976939201355, 0.06003757566213608, -0.4427107274532318, 0.06547635048627853, -0.34706437587738037, 0.1403879076242447, 0.2625475227832794, 0.04370185360312462, -0.24833227694034576, 0.03617887198925018, 0.0029279738664627075, -0.033671457320451736, 0.3558741509914398, -0.30377691984176636, -0.19702033698558807, 0.014378953725099564, 0.3456524610519409, -0.19123558700084686, 0.14957311749458313, -0.5972543358802795, 0.11980155110359192, 0.022066861391067505, -0.05014710873365402, 0.08482420444488525, -0.29662173986434937, 0.11000989377498627, -0.201649010181427, -0.009757746942341328, 0.1833481341600418, -0.4004993736743927, 0.2971416711807251, 0.20973874628543854, 0.07426506280899048, -0.10326334089040756, 0.25265777111053467, -0.2942621409893036, 0.16846388578414917, -0.1902892142534256, -0.18199047446250916, 0.08192077279090881, -0.1772238314151764, -0.5631123185157776, 0.29710522294044495, 0.01196126639842987, 0.382685124874115, 0.06971196830272675, -0.24843314290046692, 0.33105796575546265, -0.10101516544818878, 0.3935410678386688, 0.22248037159442902, 0.10442479699850082, 0.1172240599989891, -0.29268190264701843, -0.09885067492723465, 0.01867586001753807, 0.06834349036216736, -0.12238405644893646, -0.04494500905275345, 0.1086772233247757, -0.11793551594018936, 0.33721891045570374, -0.07968176901340485, -0.08426108956336975, 0.4627377390861511, -0.19427001476287842, 0.13346433639526367, 0.05917154252529144, -0.03882800042629242, -0.2622416019439697, 0.058191701769828796, -0.27454209327697754, -0.05994425714015961, -0.10473577678203583, -0.13304492831230164, -0.05806403607130051, 0.034041956067085266, 0.011157330125570297, 0.12802983820438385, 0.2872224450111389, -0.04724375903606415, 0.09313406050205231, 0.06414583325386047, 0.10538972914218903, -0.05410821735858917, -0.26506561040878296, 0.05669127404689789, -0.5503028035163879, 0.2793128490447998, 0.022192614153027534, -0.22524043917655945, 0.21969306468963623, 0.0734969899058342, 0.08909976482391357, -0.18026360869407654, -0.1316661238670349, -0.05171417444944382, 0.2320387214422226, -0.12324360013008118, -0.21571210026741028, 0.11670227348804474, 0.07955371588468552, 0.03441907837986946, -0.008253416046500206, 0.30606359243392944, 0.11107844114303589, 0.09545732289552689, -0.15485873818397522, 0.21503978967666626, -0.19857127964496613, 0.06954429298639297, -0.026487577706575394, -0.28821778297424316, 0.24656933546066284, -0.010423876345157623, 0.10667253285646439, -0.15635719895362854, 0.2474527657032013, 0.43648281693458557, -0.1290821135044098, -0.0276940930634737, -0.03388841822743416, 0.003799714148044586, 0.5654009580612183, -0.19875499606132507, -0.05266794562339783, 0.343343585729599, -0.03179018944501877, -0.1613454818725586, -0.037909239530563354, 0.3309774100780487, 0.31821393966674805, 0.3212844133377075, -0.09079690277576447, -0.04856105148792267, 0.23480473458766937, -0.2390991747379303, 0.11826908588409424, 0.22155606746673584, 0.24589823186397552, 0.2771698534488678, 0.4468897581100464, -0.17056666314601898, -0.18675270676612854, -0.27507707476615906, 0.14407558739185333, 0.44734013080596924, -0.28586459159851074, 0.09327464550733566, -0.17219312489032745, -0.11512890458106995, -0.09148120880126953, -0.007512069307267666, -0.016844283789396286, -0.30072176456451416, -0.014126550406217575, 0.1908281445503235, -0.24683831632137299, -0.21418432891368866, -0.12069983780384064, 0.1980583816766739, 0.2621043920516968, -0.04841143637895584, -0.16775673627853394, -0.014475306496024132, -0.1371251940727234, 0.14085139334201813, 0.29102805256843567, -0.12483065575361252, 0.09970619529485703, 0.053126297891139984, 0.004761941730976105, 0.11438930034637451, -0.10242433100938797, -0.040911659598350525, -0.04043583571910858, 0.313834547996521, -0.09500603377819061, 0.1014423593878746, 0.1307108998298645, -0.0399068184196949, -0.008961169049143791, 0.07727567106485367, -0.12635831534862518, 0.16556748747825623, 0.22102877497673035, 0.3231652081012726, -0.0048628635704517365, -0.36954453587532043, -0.07823507487773895, -0.6428579092025757, 0.48044878244400024, 0.1689864695072174, 0.11327635496854782, -0.07326999306678772, 0.25644704699516296, 0.18997232615947723, 0.13950057327747345, 0.12854357063770294, -0.24308796226978302, -0.2960595190525055, 0.34887102246284485, -0.0963599756360054, -0.32506808638572693, -0.045148324221372604, 0.004792477935552597, 0.015384618192911148, -0.001287098042666912, -0.6893305778503418, -0.017411187291145325, -0.09123235195875168, 0.16961319744586945, -0.4645301103591919, -0.29904642701148987, -0.040145307779312134, -0.1662217080593109, -0.09401872754096985, 0.040293723344802856, 0.0415424145758152, -0.19252091646194458, 0.05806104838848114, -0.01087142527103424, -0.07573570311069489, 0.47082945704460144, 0.053180303424596786, 0.00935741513967514, 0.27493423223495483, 0.08801045268774033, 0.24732637405395508, 0.08266813308000565, 0.365444540977478, -0.18848279118537903, -0.22607216238975525, -0.1005350649356842, -0.11109557747840881, -0.0003642253577709198, 0.05212945491075516, -0.004522871226072311, -0.12316936999559402, -0.07811753451824188, -0.3973400294780731, -0.27545788884162903, -0.25425437092781067, 0.37492635846138, -0.25650089979171753, 0.09344109147787094, -0.13066020607948303, 0.1410377323627472, -0.07691003382205963, -0.13856172561645508, -0.21508589386940002, -0.15434546768665314, 0.2307095229625702, 0.06098178029060364, -0.12873989343643188, -0.15425220131874084, -0.18146905303001404, 0.2915510833263397, -0.15003176033496857, 0.36254870891571045, 0.20801933109760284, 0.058461450040340424, 0.011273697018623352, -0.3066418170928955, 0.8161036968231201, 0.0901666134595871, 0.18494419753551483, 0.1701292097568512, 0.11714166402816772, -0.3560525178909302, 0.10716399550437927, -0.29674363136291504, 0.07318258285522461, 0.4052351117134094, 0.48099109530448914, -0.13507524132728577, 0.12583553791046143, 0.05131196230649948, 0.3642323613166809, -0.15164782106876373, -0.41445982456207275, -0.21401235461235046, -0.38112157583236694, -0.4561503529548645, 0.08290206640958786, 0.17742259800434113, 0.17901767790317535, -0.2094651460647583, -0.27876749634742737, 0.08719558268785477, -0.23176977038383484, -0.1607256382703781, 0.14012040197849274, 0.1727459728717804, -0.018196269869804382, 0.23829609155654907, 0.015350466594099998, 0.004942458122968674, 0.7299177646636963, 0.6435986161231995, 0.21608416736125946, -0.29896867275238037, 0.02865753322839737, -0.25271379947662354, -0.048074446618556976, 0.02185574173927307, -0.008862653747200966, 0.2802879512310028, -0.09565389156341553, 0.1615985631942749, -0.06264744699001312, -0.029533751308918, 0.17340227961540222, -0.024129163473844528, -0.09884724766016006, -0.4473108649253845, 0.4108327627182007, -0.20753169059753418, 0.12534193694591522, 0.0021626465022563934, -0.12638776004314423, -0.18077223002910614, 0.36103057861328125, -0.1348954737186432, 0.7015455365180969, 0.11619704216718674, -0.04856259003281593, 0.011591322720050812, -0.3474123477935791, 0.4007163643836975, -0.4440617561340332, 0.1750795990228653, -0.2143467664718628, -0.13895395398139954, 0.06589847803115845, -0.2576444149017334, 0.12133300304412842, 0.11580026149749756, -0.09119518101215363, 0.02547408454120159, -0.09752185642719269, -0.40888160467147827, -0.10722839087247849, 0.23055946826934814, -0.15863284468650818, -0.04512028768658638, -0.5657756328582764, 0.23826870322227478, -0.2618759274482727, -0.2535056471824646, 0.043556906282901764, -0.008696524426341057, -0.12935785949230194, -0.19370585680007935, -0.1907702535390854, -0.018055696040391922, 0.04769054427742958, -0.024674423038959503, 0.1349555104970932, -0.4527207016944885, 0.038205716758966446, -0.06390367448329926, -0.4773334264755249, 0.326751172542572, -0.16642454266548157, -0.10150900483131409, -0.07702385634183884, -0.07485482841730118, 0.2117253690958023, -0.02930370345711708, 0.3480875492095947, -0.08993023633956909, -0.413082480430603, 0.3659428656101227, 0.1024765893816948, -0.276310533285141, 0.09620869159698486, 0.21693988144397736, -0.25388801097869873, -0.35494861006736755, -0.0936013013124466, -0.2154594361782074, -0.1831337809562683, -0.26255518198013306, 0.2122209370136261, 0.19778575003147125, -0.21080952882766724, 0.24762877821922302, -0.19639334082603455, -0.26813751459121704, -0.19005878269672394, 0.5076436400413513, 0.27010926604270935, -0.044998910278081894, 0.2305973917245865, 0.33013811707496643, -0.08300980925559998, -0.26823970675468445, 0.2920953631401062, 0.02254251204431057, -0.3338894248008728, 0.24416355788707733, -0.08401099592447281, 0.2538588047027588, 0.04162711277604103, -0.12830375134944916, 0.21810762584209442, -0.056368209421634674, 0.11542272567749023, -0.447235643863678, -0.37573522329330444, 0.09318770468235016, 0.11988945305347443, 0.11567191779613495, 0.30612221360206604, -0.08129838109016418, -0.1221308633685112, 0.18101832270622253, -0.3828662931919098, 0.2920583486557007, -0.19643227756023407, 0.008235819637775421, -0.09859741479158401, -0.2328350841999054, -0.019910581409931183, 0.011741867288947105, 0.19203941524028778, 0.1787673532962799, 0.06144721060991287, -0.33970457315444946, -0.05918813496828079, 0.022786587476730347, 0.0976855531334877, 0.023355286568403244, -0.31085434556007385, -0.32747358083724976, -0.19738316535949707, -0.07068604230880737, 0.07050058245658875, -0.12891772389411926, 0.039814695715904236, -0.04936504736542702, 0.14749333262443542, -0.09457910805940628, 0.07361085712909698, 0.09912265092134476, -0.07111024856567383, 0.23228633403778076, 0.04785316437482834, 0.24800458550453186, 0.0961269959807396, 0.12014484405517578, -0.6293112635612488, 0.19532233476638794, -0.10352477431297302, 0.1918179988861084, 0.5360260009765625, -0.3536311388015747, 0.09850478172302246, 0.1533370018005371, 0.08003266155719757, 0.3409457802772522, -0.34973084926605225, -0.05930788815021515, 0.13428381085395813, 0.2887668013572693, -0.17347735166549683, -0.21711216866970062, 0.15515634417533875, -0.015421519987285137, 0.07887692749500275, 0.26444771885871887, -0.0775974690914154, -0.3196973204612732, -0.039674848318099976, 0.12007883936166763, 0.36657798290252686, 0.18871696293354034, 0.07596756517887115, 0.3153259754180908, -0.09708495438098907, -0.1954825073480606, 0.28415730595588684, 0.17829182744026184, 0.43258368968963623, 0.6219760179519653, 0.17072030901908875, 0.007801199331879616, 0.05476871505379677, -0.16762207448482513, -0.24095579981803894, -0.45077118277549744, -0.04252925142645836, 0.2500340938568115, -0.07927444577217102, 0.3892359435558319, 0.06359565258026123, -0.0867406502366066, 0.09758775681257248, 0.19967876374721527, -0.31501102447509766, -0.119460329413414, -0.24513524770736694, 0.1609729826450348, 0.029911920428276062, -0.23556047677993774, 0.0843420922756195, 0.09548214077949524, 0.030154123902320862, -0.07608230412006378, 0.05941865220665932, 0.04538770765066147, -0.28422707319259644, -0.1410006284713745, 0.3557135760784149, 0.004229370504617691, 0.06779757887125015, -0.25725966691970825, 0.23278556764125824, 0.4366834759712219, 0.12670397758483887, 0.1451587677001953, 0.08683982491493225, 0.37923064827919006, 0.21323272585868835, 0.09161914885044098, -0.0422215573489666, 0.00409249123185873, -0.08846918493509293, -0.31085777282714844, 0.4045143723487854, 0.2354917973279953, 0.15570883452892303, 0.36729031801223755, 0.24944573640823364, -0.25595489144325256, 0.23406296968460083, 0.3131909966468811, 0.11073020100593567, -0.29241684079170227, 0.13489055633544922, -0.049622662365436554, -0.2994643449783325, -0.17845571041107178, -0.06702350825071335, -0.43043068051338196, -0.06251349300146103, 0.16250525414943695, 0.03848985955119133, 0.12984970211982727, 0.10863101482391357, 0.13992232084274292, -0.23749026656150818, 0.6446391940116882, 0.19791416823863983, 0.09256632626056671, -0.1176837757229805, 0.0693795382976532, -0.13942241668701172, 0.29258325695991516, -0.40529534220695496, -0.021801557391881943, 0.04708649963140488, 0.13764071464538574, 0.16047202050685883, 0.1551135927438736, 0.03336842358112335, 0.09920072555541992, -0.13979877531528473, 0.11730919778347015, -0.36916810274124146, -0.44471898674964905, 0.228611558675766, 0.021180182695388794, -0.14915737509727478, -0.209028959274292, 0.2539427876472473, -0.20142608880996704, 0.19371142983436584, -0.16224895417690277, -0.024651166051626205, -0.11439675092697144, 0.1725047379732132, 0.40193018317222595, 0.274381548166275, 0.30538174510002136, -0.09713023900985718, -0.19483418762683868, -0.19332954287528992, -0.21545159816741943, -0.03616492077708244, 0.3476850390434265, 0.1808914840221405, 0.3069441020488739, -0.09609725326299667, -0.2679131329059601, 0.04593610018491745, -0.002160455100238323, -0.2222776561975479, 0.02788497880101204, -0.09351921826601028, 0.13646343350410461, 0.03266243636608124, -0.0701666921377182, 0.04681641608476639, 0.20995143055915833, -0.00942433625459671, 0.13124053180217743, -0.20733916759490967, -0.04955856502056122, 0.2836284041404724, -0.141691192984581, -0.3169243037700653, 0.09144224226474762, 0.33304882049560547, -0.21675100922584534, -0.04961896687746048, -0.24017217755317688, 0.2595120370388031, 0.5366330146789551, 0.14685359597206116, -0.29606443643569946, 0.42135491967201233, -0.3954288959503174, -0.06042834371328354, -0.026456693187355995, 0.17079415917396545, 0.27186545729637146, -0.2806563377380371, 0.12634626030921936, 0.004101965576410294 ]
https://github.com/huggingface/datasets/issues/2980
OpenSLR 25: ASR data for Amharic, Swahili and Wolof
Whoever handles this just needs to: - [ ] fork the HuggingFace Datasets repo - [ ] update the [existing dataset script](https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py) to add SLR25. Lots of copypasting from other sections of the script should make that easy. Amharic URL: https://www.openslr.org/resources/25/data_readspeech_am.tar.bz2. Swahili URL: https://www.openslr.org/resources/25/data_broadcastnews_sw.tar.bz2, Wolof URL: https://www.openslr.org/resources/25/data_readspeech_wo.tar.bz2 - [ ] update the [data card](https://github.com/huggingface/datasets/blob/master/datasets/openslr/README.md) to include information about SLR25. There's lots of other examples to draw from. - [ ] add the appropriate language tags to the data card as well. https://www.w3.org/International/questions/qa-choosing-language-tags, or just use `sw`, `am`, and `wo` for consistency. - [ ] make a pull request to merge your changes back into HuggingFace's repo
## Adding a Dataset - **Name:** *SLR25* - **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data* - **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. * - **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/* - **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.* https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do.
106
OpenSLR 25: ASR data for Amharic, Swahili and Wolof ## Adding a Dataset - **Name:** *SLR25* - **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data* - **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. * - **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/* - **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.* https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do. Whoever handles this just needs to: - [ ] fork the HuggingFace Datasets repo - [ ] update the [existing dataset script](https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py) to add SLR25. Lots of copypasting from other sections of the script should make that easy. Amharic URL: https://www.openslr.org/resources/25/data_readspeech_am.tar.bz2. Swahili URL: https://www.openslr.org/resources/25/data_broadcastnews_sw.tar.bz2, Wolof URL: https://www.openslr.org/resources/25/data_readspeech_wo.tar.bz2 - [ ] update the [data card](https://github.com/huggingface/datasets/blob/master/datasets/openslr/README.md) to include information about SLR25. There's lots of other examples to draw from. - [ ] add the appropriate language tags to the data card as well. https://www.w3.org/International/questions/qa-choosing-language-tags, or just use `sw`, `am`, and `wo` for consistency. - [ ] make a pull request to merge your changes back into HuggingFace's repo
[ -0.1494903713464737, -0.0371018648147583, -0.12790320813655853, -0.022976361215114594, 0.15993620455265045, -0.02780725434422493, 0.07721668481826782, 0.20951026678085327, -0.2027437537908554, 0.2747544050216675, -0.3528316020965576, 0.09953749924898148, -0.05927971750497818, 0.2058955281972885, -0.010249688290059566, -0.08018139004707336, 0.06358049809932709, -0.07423865795135498, -0.29668012261390686, -0.0928758829832077, -0.20024865865707397, 0.2756386995315552, 0.006017148494720459, -0.28668659925460815, -0.06961217522621155, 0.13324393332004547, -0.19034558534622192, -0.20725080370903015, -0.3418058753013611, -0.25497695803642273, -0.1400926560163498, 0.2056073099374771, 0.32457777857780457, -0.018672026693820953, -0.00010256964742438868, -0.31268590688705444, 0.27028292417526245, -0.12315935641527176, -0.3281959295272827, -0.24180744588375092, 0.06242626905441284, -0.2593786418437958, -0.24065397679805756, -0.0355340912938118, 0.022795580327510834, -0.25910094380378723, 0.27180445194244385, -0.17945975065231323, 0.17316696047782898, 0.34748151898384094, 0.24949140846729279, 0.06053435057401657, 0.15069125592708588, 0.019154204055666924, 0.31604382395744324, 0.17654046416282654, -0.027239516377449036, 0.22046707570552826, 0.2990598678588867, 0.16703081130981445, -0.3545989692211151, 0.5121777057647705, 0.11496472358703613, -0.3883589506149292, 0.20727461576461792, -0.10684431344270706, 0.06394395977258682, -0.453375905752182, 0.1386508196592331, 0.07946164906024933, 0.27220144867897034, -0.1322607398033142, -0.38750991225242615, -0.1294626146554947, -0.09411880373954773, -0.07404353469610214, 0.05317489802837372, 0.4415181577205658, -0.07723831385374069, 0.3047996461391449, 0.057773709297180176, -0.11920589208602905, -0.1423463225364685, 0.3094683289527893, 0.18340574204921722, 0.7573243379592896, -0.21837912499904633, -0.16668570041656494, 0.1823100745677948, -0.30347156524658203, 0.07102746516466141, -0.019025951623916626, -0.027467388659715652, 0.05584808066487312, -0.2618972063064575, -0.010620567947626114, 0.23710080981254578, -0.0022110044956207275, 0.4064849615097046, 0.31284189224243164, 0.40731221437454224, 0.2605694830417633, -0.19208666682243347, 0.05473939701914787, -0.23093140125274658, 0.17293092608451843, 0.1567380428314209, -0.06835475564002991, 0.09804343432188034, 0.15373222529888153, 0.26664718985557556, -0.07580006122589111, -0.015617760829627514, 0.038585834205150604, -0.5644583702087402, 0.021954361349344254, 0.10716797411441803, -0.2900063395500183, -0.021124113351106644, -0.10178343951702118, -0.32292571663856506, -0.3385739326477051, -0.1552174985408783, 0.1792522668838501, 0.1265690177679062, 0.1671822965145111, -0.05986834317445755, 0.24890688061714172, 0.005637377500534058, -0.15968626737594604, -0.10507138818502426, 0.1128602921962738, -0.040821660310029984, 0.33582979440689087, 0.17356061935424805, -0.15450969338417053, 0.22824402153491974, -0.038716208189725876, 0.10661809146404266, -0.06048133224248886, 0.03696279972791672, 0.1061248928308487, 0.0022575482726097107, -0.06846891343593597, -0.10458680987358093, 0.028645483776926994, -0.18594415485858917, 0.030868716537952423, -0.2907165586948395, -0.1491231918334961, 0.05972936376929283, -0.11217577010393143, -0.15509510040283203, 0.2807641625404358, -0.1461338996887207, -0.1179647147655487, 0.2480357587337494, 0.6364675164222717, -0.0032850652933120728, -0.18198516964912415, 0.050707634538412094, 0.2555229663848877, -0.4952884614467621, -0.12443335354328156, 0.11410544067621231, 0.2683204412460327, -0.005191545933485031, -0.20107851922512054, 0.23721157014369965, 0.012758849188685417, 0.17945244908332825, -0.1395672857761383, -0.0013117404887452722, -0.35093963146209717, -0.16525223851203918, 0.22239841520786285, 0.12491682171821594, -0.26162007451057434, -0.3386905789375305, 0.18315361440181732, -0.03049439936876297, -0.22087852656841278, 0.5791752934455872, 0.00027447970933280885, -0.037248771637678146, -0.19261598587036133, 0.11419673264026642, 0.3625524044036865, 0.05794677883386612, -0.033165428787469864, -0.35493120551109314, -0.20775340497493744, -0.07103431224822998, 0.4536609649658203, -0.03194407746195793, -0.02923024445772171, 0.24048635363578796, -0.1688464879989624, 0.407342791557312, -0.3942110240459442, 0.29000669717788696, 0.0627514198422432, 0.09592945128679276, -0.1335812360048294, 0.031378842890262604, -0.09860115498304367, -0.020549707114696503, -0.0957331508398056, -0.38820940256118774, 0.4308164417743683, -0.11983849108219147, -0.1787988841533661, -0.11279761791229248, -0.3409571945667267, -0.040663715451955795, -0.06789351999759674, 0.2375352382659912, 0.37446311116218567, 0.21788358688354492, 0.18944749236106873, -0.07102431356906891, 0.17073455452919006, -0.25439831614494324, -0.024490009993314743, -0.49566102027893066, 0.3473989963531494, -0.11426454037427902, -0.12527577579021454, 0.5034677982330322, 0.28554821014404297, -0.03049120306968689, -0.013570984825491905, -0.004781241528689861, 0.17523470520973206, -0.35394808650016785, 0.30067187547683716, 0.09138094633817673, 0.24569332599639893, 0.040396176278591156, -0.3858622908592224, 0.23543398082256317, 0.043421126902103424, -0.07231997698545456, 0.1197066381573677, -0.1595270037651062, 0.3711625337600708, -0.09440422058105469, 0.2158742994070053, 0.22351957857608795, 0.21168284118175507, 0.1389428824186325, 0.021403808146715164, -0.39802950620651245, -0.08348381519317627, 0.0905144065618515, -0.19404546916484833, 0.290815144777298, 0.07205936312675476, -0.06696455925703049, 0.46218645572662354, 0.29279911518096924, -0.22800061106681824, -0.09999611228704453, 0.1527003049850464, -0.27369192242622375, -0.10300504416227341, 0.028317362070083618, 0.2720390856266022, 0.08255323767662048, 0.37049400806427, 0.07634510099887848, -0.15752346813678741, 0.3251897096633911, -0.11228504031896591, 0.19508260488510132, 0.3276345729827881, -0.2879220247268677, 0.2455546259880066, 0.2602163553237915, 0.06324656307697296, -0.2890087962150574, -0.24108567833900452, -0.10028275847434998, 0.0633525475859642, -0.004999466240406036, -0.09542723745107651, -0.04976784810423851, -0.34834983944892883, -0.2504275143146515, 0.12019698321819305, -0.38118353486061096, -0.1958135962486267, 0.011982638388872147, -0.0865849107503891, -0.24907821416854858, 0.12680019438266754, -0.08234381675720215, 0.16821852326393127, -0.22805044054985046, 0.2646937966346741, -0.014281142503023148, 0.02530599758028984, 0.05793178081512451, 0.1634073108434677, 0.4988400340080261, 0.028770653530955315, 0.34231269359588623, -0.11276215314865112, 0.17884282767772675, -0.14464221894741058, -0.5261297821998596, 0.028726493939757347, -0.09690040349960327, -0.06842899322509766, 0.10900469124317169, -0.4852854609489441, -0.46484994888305664, -0.5123023390769958, 0.005030436906963587, 0.012985212728381157, -0.35569337010383606, -0.11356862634420395, -0.08990970253944397, 0.2749379575252533, -0.20868343114852905, -0.21150770783424377, -0.3682238757610321, -0.383609414100647, 0.3271874189376831, 0.0230397991836071, 0.12420719116926193, 0.29601940512657166, -0.01493869163095951, 0.05038793757557869, -0.04150122404098511, 0.07182318717241287, -0.24272672832012177, -0.17658093571662903, 0.40932580828666687, -0.3729282021522522, -0.38396745920181274, -0.1302313655614853, -0.14141970872879028, 0.09406328201293945, -0.13748785853385925, -0.30943429470062256, -0.19964177906513214, -0.14134010672569275, 0.090483158826828, -0.020470350980758667, 0.15185333788394928, 0.5067282915115356, 0.35861822962760925, -0.18739137053489685, -0.09038788825273514, -0.2241498976945877, 0.14307381212711334, -0.034647755324840546, 0.07510965317487717, -0.046669185161590576, 0.11369089037179947, 0.005188640207052231, 0.4282902479171753, 0.09175261855125427, 0.23399315774440765, 0.3536900281906128, 0.35270461440086365, -0.03309499844908714, 0.11330493539571762, -0.17784084379673004, 0.5233632922172546, 0.06152099370956421, 0.09399924427270889, 0.4749322533607483, 0.19010144472122192, -0.08966866880655289, -0.16381339728832245, -0.3501838147640228, -0.26515936851501465, -0.23711423575878143, 0.15843980014324188, -0.16008131206035614, 0.3901822566986084, -0.05814705789089203, -0.286758154630661, -0.3040471076965332, -0.2631227374076843, 0.05848006531596184, -0.022354908287525177, 0.24909156560897827, -0.06063077598810196, -0.6992995738983154, 0.0552084743976593, -0.5163187384605408, 0.3542766571044922, 0.3438425660133362, -0.01597931981086731, -0.06544321030378342, -0.27571749687194824, -0.13779553771018982, -0.03651493787765503, -0.183756485581398, -0.24191217124462128, -0.10884220898151398, 0.17621517181396484, 0.15672166645526886, -0.19410045444965363, 0.22550176084041595, -0.09250758588314056, -0.15359458327293396, -0.17823897302150726, -0.007464878261089325, -0.48571544885635376, -0.18121662735939026, 0.4237489104270935, 0.19002275168895721, -0.08157313615083694, -0.030593305826187134, -0.16643968224525452, -0.40665730834007263, -0.03536461293697357, -0.26678523421287537, -0.15713708102703094, 0.08969374001026154, -0.24129025638103485, 0.15072394907474518, 0.17704324424266815, -0.07922959327697754, 0.4676428437232971, -0.030731484293937683, 0.1767725646495819, 0.40915971994400024, 0.1549532264471054, 0.18649838864803314, 0.1475450098514557, 0.1474854052066803, 0.5390040278434753, -0.049590062350034714, -0.38909098505973816, 0.24308449029922485, -0.13344961404800415, 0.48912227153778076, 0.18484818935394287, 0.12632565200328827, 0.25119128823280334, 0.15873032808303833, -0.10396450757980347, -0.20268100500106812, 0.1723337322473526, 0.011403672397136688, 0.1981326788663864, -0.21669360995292664, -0.24100956320762634, 0.4193350374698639, -0.09675736725330353, -0.14105910062789917, -0.15054601430892944, -0.0521775484085083, -0.14938978850841522, 0.5256380438804626, -0.04174710065126419, 1.2176740169525146, 0.030470147728919983, 0.1309192180633545, -0.005968581885099411, -0.017471879720687866, 0.38874709606170654, -0.15530642867088318, 0.0009038150310516357, -0.16524575650691986, -0.18269912898540497, 0.08521579951047897, 0.09649477899074554, -0.12491878122091293, 0.0696207582950592, -0.417434960603714, -0.12292027473449707, 0.16668857634067535, -0.009056247770786285, 0.28266021609306335, 0.3936646580696106, -0.3646048605442047, -0.48521992564201355, -0.6116846203804016, 0.17767344415187836, -0.06900042295455933, 0.05462262034416199, 0.24205821752548218, -0.3474058508872986, -0.04241887480020523, -0.23736269772052765, 0.03732083737850189, 0.08617713302373886, -0.055445410311222076, -0.1673646867275238, -0.05204066261649132, -0.1871744841337204, 0.2694506049156189, 0.3767368197441101, 0.27298682928085327, 0.11017979681491852, -0.04649970680475235, -0.13170361518859863, -0.21498137712478638, -0.028488729149103165, 0.21332088112831116, 0.08410084992647171, 0.14993327856063843, -0.23475834727287292, -0.23250329494476318, 0.23777851462364197, 0.3624730408191681, 0.05046854913234711, -0.4581145942211151, -0.18239210546016693, 0.1606787145137787, -0.2473740428686142, 0.09204906225204468, 0.1656804382801056, -0.327823668718338, -0.3078143000602722, 0.1670352667570114, 0.10611309856176376, -0.3576810956001282, -0.0910058543086052, 0.20825928449630737, 0.044317826628685, -0.055853892117738724, 0.3152567744255066, -0.019796159118413925, -0.25632989406585693, 0.31471192836761475, 0.1685851812362671, -0.025234617292881012, -0.19195041060447693, -0.010017339140176773, -0.041124261915683746, -0.45676252245903015, -0.09955071657896042, 0.03754464536905289, -0.06171964108943939, -0.261386901140213, 0.5224418640136719, 0.018226133659482002, 0.02590204030275345, 0.11881572008132935, -0.18790732324123383, -0.5527355074882507, 0.32761096954345703, 0.1381676346063614, 0.1319357007741928, -0.29922428727149963, 0.12812335789203644, -0.29048067331314087, 0.2988312244415283, -0.44656288623809814, -0.048202626407146454, -0.10649777203798294, 0.030715957283973694, -0.13710057735443115, -0.3495903015136719, 0.19671738147735596, 0.13206736743450165, 0.19841936230659485, 0.036140989512205124, -0.12847702205181122, -0.18678349256515503, -0.2698480188846588, 0.11295116692781448, 0.017845842987298965, 0.04505128413438797, 0.13450218737125397, 0.14167043566703796, -0.10251308977603912, -0.05539745092391968, -0.13991835713386536, 0.08162710815668106, -0.040069274604320526, 0.10229502618312836, 0.024697035551071167, 0.08250998705625534, 0.18137602508068085, -0.03901771456003189, 0.03144633024930954, 0.2180744707584381, 0.19606183469295502, 0.29187798500061035, 0.05408014729619026, -0.09448986500501633, 0.39342036843299866, 0.3050086498260498, 0.24669420719146729, -0.008792929351329803, 0.25313088297843933, 0.029664533212780952, -0.1376684606075287, 0.06619108468294144, 0.22555163502693176, 0.11001960933208466, -0.06631563603878021, 0.1289518028497696, 0.14304280281066895, 0.32460248470306396, -0.3628670573234558, 0.16905665397644043, 0.034312352538108826, -0.1469767987728119, 0.24136126041412354, 0.40061187744140625, 0.13121633231639862, -0.19484759867191315, 0.3965293765068054, 0.0013729967176914215, 0.05014798045158386, 0.3664731979370117, 0.1015218049287796, 0.3128456473350525, 0.1877771019935608, 0.03707580268383026, 0.39615383744239807, -0.13131403923034668, 0.22721189260482788, -0.147719606757164, -0.31090807914733887, 0.4414992928504944, -0.07795201987028122, 0.22345291078090668, 0.23281753063201904, -0.30574703216552734, 0.10980004072189331, 0.24682816863059998, 0.26681309938430786, 0.3402659595012665, -0.13797667622566223, 0.673761785030365, 0.10711317509412766, -0.07949946075677872, 0.03777860105037689, 0.3701327443122864, 0.11101820319890976, -0.27751004695892334, -0.1068851500749588, -0.3811885714530945, -0.1775994896888733, 0.0076849572360515594, 0.1388682872056961, -0.07809004187583923, 0.48977407813072205, 0.014189854264259338, 0.006627969443798065, 0.07372840493917465, -0.28988116979599, 0.23930442333221436, 0.3136671185493469, -0.11199282854795456, 0.1617921143770218, 0.33969777822494507, 0.0814691111445427, 0.21681590378284454, 0.3034907877445221, 0.24431642889976501, -0.07458481192588806, -0.1260955035686493, 0.28578153252601624, -0.34113869071006775, 0.0038821641355752945, 0.00034835562109947205, 0.4188355505466461, 0.2909298241138458, 0.024070274084806442, 0.31761300563812256, 0.09545215219259262, -0.21421563625335693, 0.06309765577316284, -0.1337471604347229, -0.2988654673099518, -0.0003862944431602955, -0.08389361947774887, -0.1526881903409958, -0.11967800557613373, -0.39535966515541077, -0.12734386324882507, -0.4449075758457184, -0.10032440721988678, -0.08866196870803833, 0.06567909568548203, 0.02690965309739113, -0.21786339581012726, 0.11957401037216187, 0.02135360985994339, 0.3990723490715027, 0.4184153974056244, 0.19180643558502197, -0.1638449877500534, -0.5346734523773193, -0.22208689153194427, -0.025036685168743134, 0.1835753619670868, 0.02072775922715664, -0.41418081521987915, 0.12236633896827698, 0.39981210231781006, 0.14681345224380493, -0.16920442879199982, 0.23616401851177216, -0.2480693757534027, 0.22699105739593506, -0.253511518239975, 0.01811547949910164, -0.07286190986633301, 0.2532002925872803, -0.0443836972117424, -0.0049658529460430145, -0.054799679666757584, -0.024155817925930023, 0.11533478647470474, -0.20491217076778412, 0.007668785750865936, -0.2881661057472229, -0.23576512932777405, 0.2941533625125885, 0.327879935503006, 0.38435330986976624, -0.26594826579093933, -0.5109383463859558, -0.23709210753440857, -0.28040611743927, -0.14052149653434753, 0.14675503969192505, 0.12998968362808228, 0.6900428533554077, -0.14287330210208893, -0.08132703602313995, -0.12235581874847412, 0.4390146732330322, -0.019488194957375526, -0.31948280334472656, -0.1534963995218277, 0.3363440930843353, -0.13042953610420227, -0.0591588169336319, 0.09708376228809357, 0.28098633885383606, 0.03898809105157852, 0.01235729455947876, -0.34580087661743164, -0.4826076924800873, 0.28136146068573, -0.21114517748355865, 0.014590989798307419, -0.06485383957624435, 0.27060186862945557, 0.16446110606193542, 0.03572399541735649, -0.6242696642875671, 0.142266184091568, 0.2360285073518753, 0.29926711320877075, 0.09371840953826904, 0.39983728528022766, 0.08860689401626587, -0.21272249519824982, -0.1821630597114563, -0.18665996193885803, 0.20621874928474426, -0.12562574446201324, -0.009561851620674133, -0.2397885024547577 ]
https://github.com/huggingface/datasets/issues/2980
OpenSLR 25: ASR data for Amharic, Swahili and Wolof
... also the example in "use in datasets library" should be updated. It currently says ![image](https://user-images.githubusercontent.com/4109253/135115980-8583a44a-cae6-4121-b699-00667020849f.png) But you actually have to specify a subset, e.g. ```python dataset = load_dataset("openslr", "SLR32") ```
## Adding a Dataset - **Name:** *SLR25* - **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data* - **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. * - **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/* - **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.* https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do.
31
OpenSLR 25: ASR data for Amharic, Swahili and Wolof ## Adding a Dataset - **Name:** *SLR25* - **Description:** *Subset 25 from OpenSLR. Other subsets have been added to https://huggingface.co/datasets/openslr, 25 covers Amharic, Swahili and Wolof data* - **Paper:** *https://www.openslr.org/25/ has citations for each of the three subsubsets. * - **Data:** *Currently the three links to the .tar.bz2 files can be found a thttps://www.openslr.org/25/* - **Motivation:** *Increase ASR data for underrepresented African languages. Also, other subsets of OpenSLR speech recognition have been uploaded, so this would be easy.* https://github.com/huggingface/datasets/blob/master/datasets/openslr/openslr.py already has been created for various other OpenSLR subsets, this should be relatively straightforward to do. ... also the example in "use in datasets library" should be updated. It currently says ![image](https://user-images.githubusercontent.com/4109253/135115980-8583a44a-cae6-4121-b699-00667020849f.png) But you actually have to specify a subset, e.g. ```python dataset = load_dataset("openslr", "SLR32") ```
[ -0.2541200518608093, 0.014993533492088318, -0.15688814222812653, -0.06664495170116425, 0.17273111641407013, 0.01961921900510788, 0.19565442204475403, 0.23513412475585938, -0.07794727385044098, 0.22440391778945923, -0.32279565930366516, 0.11050920933485031, -0.049799248576164246, 0.10228613764047623, -0.004450120963156223, -0.11122870445251465, 0.01897280663251877, 0.09345091879367828, -0.3194478452205658, -0.137139230966568, -0.24149392545223236, 0.265155166387558, -0.11385849118232727, -0.1909170299768448, -0.150392547249794, 0.14285077154636383, -0.1503923535346985, -0.17857173085212708, -0.3060547113418579, -0.27441567182540894, -0.13755705952644348, 0.12452229857444763, 0.41410619020462036, -0.03990115970373154, -0.00010084413952426985, -0.2749471366405487, 0.2809062600135803, -0.21320542693138123, -0.34608131647109985, -0.29724979400634766, -0.03734557330608368, -0.3054201900959015, -0.21940302848815918, -0.01942940056324005, 0.012214705348014832, -0.35321906208992004, 0.27229931950569153, -0.27620041370391846, 0.09230418503284454, 0.5146609544754028, 0.2764802575111389, 0.03327081725001335, 0.14327873289585114, 0.025140810757875443, 0.3011718690395355, 0.04386689513921738, -0.024972248822450638, 0.11599525809288025, 0.33358442783355713, 0.039372965693473816, -0.31759971380233765, 0.4325481653213501, 0.07903674989938736, -0.262107253074646, 0.09320742636919022, -0.08965341001749039, 0.11020132899284363, -0.5220060348510742, 0.22020414471626282, 0.15822604298591614, 0.3744141161441803, -0.10999123007059097, -0.3572247326374054, -0.09982328116893768, -0.10533696413040161, -0.011111019179224968, 0.005463875830173492, 0.664206326007843, -0.1384601593017578, 0.31500598788261414, 0.05650976300239563, -0.04386967793107033, -0.1717049777507782, 0.4587360620498657, 0.028763428330421448, 0.7883154153823853, -0.20506832003593445, -0.09993792325258255, 0.1189725250005722, -0.2580259442329407, 0.20150022208690643, -0.0021521076560020447, 0.03667132183909416, 0.16337335109710693, -0.35904785990715027, 0.05303400754928589, 0.2335588037967682, -0.03631002455949783, 0.3703726828098297, 0.23217497766017914, 0.4167262315750122, 0.20820584893226624, -0.26866379380226135, 0.09909370541572571, -0.22403840720653534, 0.17499634623527527, 0.1631714254617691, 0.01486149150878191, 0.10788661241531372, 0.01231931522488594, 0.19738422334194183, -0.09878892451524734, -0.08412625640630722, -0.07472303509712219, -0.4523790180683136, 0.00010587088763713837, 0.1480618566274643, -0.2625630497932434, -0.08826843649148941, -0.07656264305114746, -0.4151190519332886, -0.32934245467185974, -0.1381579339504242, 0.17473630607128143, 0.1431475579738617, 0.12872160971164703, -0.029395878314971924, 0.36760151386260986, -0.05566956847906113, -0.14002364873886108, -0.08479093015193939, 0.17080000042915344, -0.07930450141429901, 0.15543609857559204, 0.18807463347911835, -0.11968320608139038, 0.32112839818000793, -0.08579647541046143, 0.0188269205391407, -0.0667794793844223, 0.12553738057613373, 0.069890096783638, 0.07908924669027328, 0.06327902525663376, -0.0021236762404441833, -0.00511874258518219, -0.10469996929168701, -0.023313287645578384, -0.2753021717071533, 0.03577694669365883, -0.016692660748958588, -0.0674438327550888, -0.2392839640378952, 0.2772398293018341, -0.1464591771364212, -0.16889967024326324, 0.26885056495666504, 0.6259335279464722, -0.005678087472915649, -0.15007838606834412, 0.044754792004823685, 0.15425121784210205, -0.46114659309387207, -0.13055020570755005, 0.022331038489937782, 0.1516461968421936, -0.1165311336517334, -0.15720032155513763, 0.2840597629547119, 0.0148355383425951, 0.20182964205741882, -0.16145695745944977, -0.0298159159719944, -0.26068079471588135, -0.19372640550136566, 0.263263463973999, 0.22352701425552368, -0.28478875756263733, -0.3911619186401367, 0.12673498690128326, 0.13571591675281525, -0.28118711709976196, 0.5081934928894043, 0.03852417692542076, 0.047437120229005814, -0.0889035016298294, 0.13945350050926208, 0.5031152963638306, 0.08833611756563187, 0.03034845180809498, -0.28342604637145996, -0.1665794998407364, -0.016792800277471542, 0.5109142065048218, -0.06341123580932617, 0.03755858913064003, 0.22234609723091125, -0.14731399714946747, 0.4631277024745941, -0.4892174303531647, 0.2842026948928833, -0.016550034284591675, 0.08897142112255096, -0.17261339724063873, -0.023067252710461617, -0.1378183364868164, 0.10418739914894104, -0.052076466381549835, -0.35086551308631897, 0.4322320818901062, -0.1415489763021469, -0.04808400571346283, -0.08188896626234055, -0.34670940041542053, -0.11559298634529114, -0.07083019614219666, 0.24226373434066772, 0.332928329706192, 0.1923546940088272, 0.17779484391212463, -0.05716991052031517, 0.215773344039917, -0.2157716304063797, -0.09800203144550323, -0.36585113406181335, 0.4185875654220581, -0.018268024548888206, -0.14685790240764618, 0.4904654622077942, 0.28127726912498474, 0.02240489050745964, 0.04309529811143875, -0.07001844793558121, 0.15356463193893433, -0.2236766666173935, 0.19351127743721008, 0.001475658267736435, 0.2192421704530716, 0.025272013619542122, -0.35862454771995544, 0.36497804522514343, 0.18157096207141876, 0.03751369193196297, 0.13462013006210327, -0.10871531814336777, 0.37796592712402344, 0.08463296294212341, 0.13124218583106995, 0.25440406799316406, 0.26741287112236023, 0.2050269991159439, 0.010431300848722458, -0.4168975055217743, -0.08466129750013351, 0.05871420353651047, -0.17003697156906128, 0.31732216477394104, 0.053583450615406036, -0.08952157199382782, 0.32560765743255615, 0.3877067267894745, -0.23262745141983032, 0.09945696592330933, 0.1777907907962799, -0.3705994188785553, -0.11575321853160858, 0.04312192648649216, 0.23668421804904938, 0.18141424655914307, 0.3706634044647217, -0.02517886832356453, -0.18555909395217896, 0.22906169295310974, -0.09915036708116531, 0.22225844860076904, 0.3611581325531006, -0.20867814123630524, 0.21587243676185608, 0.3066403865814209, -0.10620591044425964, -0.3816695511341095, -0.27794861793518066, -0.15186522901058197, 0.09712967276573181, -0.013674389570951462, -0.029156610369682312, -0.0979849174618721, -0.19473963975906372, -0.16337035596370697, 0.048986129462718964, -0.2585560381412506, -0.1879461407661438, 0.024911802262067795, -0.10665023326873779, -0.14472737908363342, 0.1578497290611267, -0.1753021627664566, 0.1839388906955719, -0.1423017829656601, 0.21336831152439117, 0.09306718409061432, 0.006837816908955574, -0.1011718288064003, 0.17964361608028412, 0.39953622221946716, 0.002632482908666134, 0.4266229569911957, -0.1119566559791565, 0.15833748877048492, -0.11681251972913742, -0.4218912124633789, 0.015353169292211533, -0.02731461077928543, -0.03961525857448578, 0.04330100864171982, -0.39613425731658936, -0.3890518546104431, -0.3723088502883911, 0.048213232308626175, -0.03819223493337631, -0.3012906312942505, -0.07227174192667007, -0.08382957428693771, 0.2788323163986206, -0.12629032135009766, -0.1988775134086609, -0.4832141399383545, -0.38631999492645264, 0.1878182590007782, 0.12982068955898285, 0.13840655982494354, 0.2832687199115753, 0.12443940341472626, 0.0005440497770905495, 0.041994620114564896, 0.01947193592786789, -0.29207026958465576, -0.13306039571762085, 0.4992426037788391, -0.33926963806152344, -0.4198153018951416, -0.06878242641687393, -0.1743161827325821, 0.06922657042741776, -0.0860467478632927, -0.25322285294532776, -0.21089206635951996, -0.215505450963974, 0.0839104950428009, -0.051204413175582886, 0.22241432964801788, 0.47145208716392517, 0.26971548795700073, -0.148265540599823, -0.15244171023368835, -0.23051616549491882, 0.08192401379346848, 0.09487955272197723, 0.10567956417798996, -0.0212240070104599, 0.15542489290237427, -0.04177884757518768, 0.3390538692474365, 0.06933887302875519, 0.11932608485221863, 0.5018686056137085, 0.1942719966173172, -0.11619940400123596, 0.011123612523078918, -0.20005634427070618, 0.45739760994911194, 0.11315600574016571, 0.06199343502521515, 0.4364096522331238, 0.1948031187057495, -0.230224609375, -0.1445707082748413, -0.2506011426448822, -0.3457310199737549, -0.15272299945354462, 0.19099076092243195, -0.11284641921520233, 0.36911892890930176, -0.07249544560909271, -0.24471744894981384, -0.3276505172252655, -0.313914954662323, 0.03545638918876648, -0.07907025516033173, 0.19067184627056122, -0.0757867842912674, -0.6608148813247681, 0.05332666262984276, -0.5419995188713074, 0.28398919105529785, 0.2949613034725189, 0.10854021459817886, 0.028309371322393417, -0.1755543053150177, -0.11447711288928986, 0.04903154447674751, -0.15854023396968842, -0.2956480383872986, -0.12508316338062286, 0.21551086008548737, 0.15196402370929718, -0.2270728349685669, 0.13390345871448517, -0.12045276165008545, -0.07809939235448837, -0.2568483054637909, -0.08534352481365204, -0.3475519120693207, -0.1014663428068161, 0.37548577785491943, 0.25665080547332764, -0.1228509247303009, -0.1016484946012497, -0.256111741065979, -0.4495089054107666, -0.1690787822008133, -0.23119357228279114, -0.0701758861541748, 0.21323230862617493, -0.16053414344787598, 0.14999575912952423, 0.08061697334051132, -0.10612913966178894, 0.4095720648765564, 0.010014891624450684, 0.19671779870986938, 0.42015838623046875, 0.09120969474315643, 0.13503867387771606, 0.1551729440689087, 0.04408906027674675, 0.5899514555931091, -0.02900349721312523, -0.402998685836792, 0.28832587599754333, -0.2554645836353302, 0.4770618677139282, 0.12599417567253113, 0.06955229490995407, 0.11714224517345428, 0.03698774054646492, -0.16090983152389526, -0.2581675350666046, 0.19042007625102997, 0.04440087080001831, 0.21771405637264252, -0.1855015605688095, -0.39608559012413025, 0.49347805976867676, -0.1527784913778305, -0.0867629200220108, -0.0897739827632904, -0.18651442229747772, -0.17145827412605286, 0.630066990852356, -0.02138575166463852, 1.0919945240020752, -0.04804129898548126, 0.21468211710453033, -0.03132305294275284, -0.005269654095172882, 0.24061763286590576, -0.19661013782024384, 0.03873574733734131, -0.17529064416885376, -0.13120780885219574, 0.04132158309221268, 0.030092816799879074, -0.04689079523086548, 0.11475078761577606, -0.3547988533973694, -0.12438010424375534, 0.11194722354412079, -0.10519331693649292, 0.27385732531547546, 0.3271074891090393, -0.24575617909431458, -0.5262114405632019, -0.7408384084701538, 0.2164529711008072, -0.05281205475330353, 0.0944310873746872, 0.25211191177368164, -0.2037172168493271, -0.0488034226000309, -0.1668110489845276, -0.0019474998116493225, 0.09146252274513245, -0.04091095179319382, -0.13448497653007507, -0.08325505256652832, -0.21335330605506897, 0.2233319878578186, 0.4955609440803528, 0.19774401187896729, 0.1045270711183548, 0.03180196136236191, -0.052612025290727615, -0.17207986116409302, -0.0066913156770169735, 0.2287840098142624, 0.09456975758075714, 0.16665208339691162, -0.21729767322540283, -0.29282259941101074, 0.35871222615242004, 0.36096322536468506, -0.002176627516746521, -0.38889798521995544, -0.08512657880783081, 0.20210647583007812, -0.20425720512866974, -0.16919894516468048, 0.08261774480342865, -0.2413768768310547, -0.2678747773170471, 0.19044344127178192, 0.27162835001945496, -0.32014912366867065, -0.09107736498117447, 0.19243378937244415, -0.04991444572806358, -0.02581784874200821, 0.3332902789115906, 0.013057192787528038, -0.15808063745498657, 0.33766016364097595, 0.1793784201145172, 0.010285843163728714, -0.18636727333068848, 0.040924668312072754, -0.007114925421774387, -0.337916761636734, -0.07970424741506577, 0.05096998065710068, -0.09966442734003067, -0.28952085971832275, 0.5169093012809753, -0.08743833005428314, -0.015680216252803802, 0.17202778160572052, -0.2767258286476135, -0.5471622943878174, 0.19470809400081635, 0.12190882861614227, 0.1385434865951538, -0.29952123761177063, 0.042511388659477234, -0.22546301782131195, 0.14430519938468933, -0.4374582767486572, -0.02471308223903179, -0.08481462299823761, 0.08405593037605286, -0.29356881976127625, -0.26982298493385315, 0.12786242365837097, 0.12037692964076996, 0.22511856257915497, -0.009244881570339203, -0.13903990387916565, -0.24661856889724731, -0.34139496088027954, 0.1008404791355133, 0.118159718811512, -0.006802772171795368, 0.1984068900346756, -0.052418313920497894, -0.142631396651268, -0.09537113457918167, -0.12829387187957764, 0.14275631308555603, -0.13124330341815948, 0.1440589427947998, 0.04078913480043411, -0.10347291082143784, 0.1699834018945694, -0.06277712434530258, -0.12565115094184875, 0.14515048265457153, 0.2893202602863312, 0.2671017646789551, 0.17200881242752075, -0.06808306276798248, 0.3175119161605835, 0.2697230577468872, 0.17738690972328186, -0.0029284246265888214, 0.2104056179523468, -0.04975106567144394, 0.03594788536429405, 0.038526322692632675, 0.15925753116607666, 0.0582890510559082, -0.19003307819366455, 0.1261652708053589, 0.15819281339645386, 0.34787145256996155, -0.4131332337856293, 0.08539451658725739, 0.06440132856369019, -0.08644716441631317, 0.31471818685531616, 0.3538943827152252, 0.09771400690078735, -0.15122367441654205, 0.24630530178546906, -0.05484679713845253, -0.05869832634925842, 0.3425155282020569, 0.0176285021007061, 0.39404547214508057, 0.19541187584400177, 0.12617188692092896, 0.36697936058044434, -0.1644275188446045, 0.11111999303102493, 0.14803318679332733, -0.3428097665309906, 0.42456915974617004, 0.06548956781625748, 0.18359920382499695, 0.08343454450368881, -0.3424999713897705, 0.12090477347373962, 0.17318886518478394, 0.1350567489862442, 0.39885666966438293, -0.13687516748905182, 0.460859090089798, 0.08798786252737045, 0.04651622101664543, -0.05016268044710159, 0.2546265423297882, 0.07329733669757843, -0.347077876329422, -0.09689591825008392, -0.3792246878147125, -0.09662951529026031, 0.08723379671573639, 0.05305127054452896, -0.13088005781173706, 0.3753651976585388, 0.010130278766155243, 0.04466387256979942, 0.05554258078336716, -0.19138354063034058, 0.155798077583313, 0.17796207964420319, -0.09233751893043518, 0.13989323377609253, 0.1633870005607605, 0.12809690833091736, 0.24354636669158936, 0.2802991271018982, 0.2511501610279083, 0.020587719976902008, -0.1279829442501068, 0.24161510169506073, -0.40343111753463745, 0.0008315462619066238, -0.07582320272922516, 0.38967403769493103, 0.33848223090171814, 0.08928728103637695, 0.3349551260471344, 0.13560597598552704, -0.20018692314624786, 0.14347898960113525, -0.06612680852413177, -0.3880191147327423, -0.05397408828139305, -0.09294489771127701, -0.11185778677463531, -0.11568392068147659, -0.38714107871055603, -0.15704357624053955, -0.35848236083984375, -0.10799106955528259, 0.03402731195092201, 0.11379267275333405, 0.08913977444171906, -0.24893824756145477, 0.1311255693435669, -0.14014190435409546, 0.3508121371269226, 0.42574769258499146, 0.25263917446136475, -0.194437175989151, -0.44800615310668945, -0.26982957124710083, -0.027525343000888824, -0.0357060469686985, -0.07787051051855087, -0.36543089151382446, 0.09461022168397903, 0.4243761897087097, 0.2627566456794739, -0.1703750342130661, 0.3244681656360626, -0.21208232641220093, 0.3071403503417969, -0.24249809980392456, -0.06722278892993927, -0.07813218235969543, 0.4600687623023987, -0.1257944405078888, -0.08489418029785156, -0.1010759025812149, -0.13095207512378693, 0.1765180230140686, -0.2919737696647644, -0.00870257243514061, -0.24848255515098572, -0.24506574869155884, 0.3721027076244354, 0.2780182361602783, 0.44783568382263184, -0.2694911062717438, -0.30744919180870056, -0.20062431693077087, -0.22496993839740753, -0.16407376527786255, 0.059232357889413834, 0.12196922302246094, 0.6513028144836426, -0.11434733867645264, 0.035856302827596664, -0.0970093384385109, 0.4924297034740448, 0.011726021766662598, -0.2668973505496979, -0.17002251744270325, 0.2984575629234314, -0.07694988697767258, -0.13742326200008392, 0.0434253066778183, 0.2891024947166443, -0.021375909447669983, -0.04808802902698517, -0.2234058380126953, -0.45204564929008484, 0.2122962921857834, -0.35122978687286377, -0.14939461648464203, -0.0960484966635704, 0.21730937063694, 0.13101159036159515, 0.12439104914665222, -0.4883289337158203, 0.21638312935829163, 0.2735157012939453, 0.26022869348526, 0.03591713681817055, 0.38764601945877075, 0.16424624621868134, -0.12157882750034332, -0.163081094622612, -0.18732592463493347, 0.15000537037849426, -0.06440957635641098, -0.04522004351019859, -0.2907809019088745 ]
https://github.com/huggingface/datasets/issues/2978
Run CI tests against non-production server
Hey @albertvillanova could you provide more context, including extracts from the discussion we had ? Let's ping @Pierrci @julien-c and @n1t0 for their opinion about that
Currently, the CI test suite performs requests to the HF production server. As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`.
26
Run CI tests against non-production server Currently, the CI test suite performs requests to the HF production server. As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`. Hey @albertvillanova could you provide more context, including extracts from the discussion we had ? Let's ping @Pierrci @julien-c and @n1t0 for their opinion about that
[ -0.258196622133255, -0.2636909484863281, -0.11364038288593292, -0.23575951159000397, -0.34446579217910767, -0.2215365767478943, 0.48000285029411316, 0.29813557863235474, 0.15893465280532837, 0.19311410188674927, -0.011650914326310158, -0.19298627972602844, 0.05546509474515915, 0.5981816649436951, -0.01195573154836893, -0.06944144517183304, -0.20036593079566956, 0.22953417897224426, -0.4537282884120941, 0.05899474769830704, -0.048989005386829376, 0.08192150294780731, -0.014033906161785126, 0.20606404542922974, -0.22455346584320068, -0.28040802478790283, -0.07846961915493011, 0.2029877007007599, 0.2365463525056839, -0.07697972655296326, 0.1586601436138153, 0.3057916462421417, -0.12128639221191406, 0.2439485490322113, -0.00009821615822147578, 0.2524148225784302, 0.21837984025478363, -0.16406191885471344, -0.12618380784988403, 0.15166455507278442, 0.21077358722686768, 0.35681936144828796, -0.2911551296710968, -0.004659466445446014, -0.4559677243232727, 0.1889888346195221, -0.17939229309558868, 0.03205827623605728, 0.09363207221031189, 0.3777404725551605, 0.33497315645217896, 0.60816490650177, -0.6110963821411133, -0.21379278600215912, -0.2298475205898285, 0.35833626985549927, -0.1512903869152069, -0.21117238700389862, 0.3925918638706207, -0.12745356559753418, -0.2299598753452301, 0.04605589061975479, 0.12087439000606537, 0.0756426751613617, -0.2281797230243683, -0.049590688198804855, 0.05867757648229599, -0.09730112552642822, 0.2002834677696228, 0.08885329216718674, 0.13305149972438812, 0.07978558540344238, -0.0752846896648407, 0.30612674355506897, -0.034795019775629044, -0.10041763633489609, 0.43442150950431824, -0.09605319797992706, -0.08580653369426727, 0.19864331185817719, -0.5596023797988892, -0.20804913341999054, -0.23613552749156952, -0.27600008249282837, 0.045158714056015015, -0.12319782376289368, -0.037678007036447525, 0.06301141530275345, -0.03297991678118706, 0.12851136922836304, -0.0008786329999566078, 0.009778999723494053, -0.11287194490432739, -0.24935902655124664, -0.01962435618042946, -0.3633947968482971, -0.07910176366567612, 0.29122596979141235, 0.11553383618593216, 0.34368109703063965, -0.31102412939071655, 0.07716499269008636, 0.11002294719219208, 0.06988711655139923, -0.25547099113464355, 0.15067853033542633, -0.07247889786958694, 0.004521502181887627, 0.29420387744903564, 0.4493352472782135, -0.17347753047943115, 0.05039946734905243, 0.23014195263385773, -0.3306615948677063, -0.42467185854911804, -0.1809385120868683, -0.10571905970573425, -0.3326230049133301, -0.08495184034109116, 0.003334382548928261, 0.16010421514511108, 0.1471260040998459, 0.18029256165027618, 0.4874814748764038, 0.16785068809986115, 0.1627969741821289, 0.07146090269088745, 0.11836319416761398, -0.11850874125957489, -0.10662171244621277, -0.1939215362071991, 0.16418351233005524, -0.05332261323928833, 0.2761267125606537, 0.32277631759643555, -0.197835311293602, 0.2043023407459259, 0.08928796648979187, 0.5762527585029602, 0.014670178294181824, 0.23464998602867126, 0.2547368109226227, 0.1740656942129135, 0.40024206042289734, 0.0842057466506958, -0.25581100583076477, 0.0694846361875534, 0.06956307590007782, 0.033833637833595276, -0.04991491138935089, -0.20864522457122803, -0.2899095118045807, 0.16049189865589142, 0.2470574676990509, -0.22529150545597076, -0.17644436657428741, -0.04571183770895004, -0.3540531396865845, -0.45603063702583313, -0.07207424938678741, 0.1713736653327942, 0.050896428525447845, 0.0008696690201759338, 0.2565487325191498, -0.0667315125465393, 0.2634351849555969, 0.1388746052980423, 0.1118544489145279, 0.2989213764667511, -0.025278877466917038, 0.038981903344392776, 0.2006596475839615, -0.13849808275699615, -0.07165306061506271, -0.14769183099269867, -0.4803522825241089, 0.0507495179772377, -0.6395083665847778, 0.09930014610290527, 0.32265758514404297, -0.2871624827384949, -0.14635686576366425, 0.051006387919187546, -0.2201726734638214, 0.13912338018417358, 0.09337165206670761, -0.328685998916626, 0.09463679790496826, -0.16409699618816376, 0.265178382396698, -0.401349812746048, -0.31914886832237244, -0.25503456592559814, 0.0878981351852417, 0.3312150835990906, 0.055453598499298096, -0.08290717750787735, -0.11124363541603088, 0.1865362972021103, -0.21450096368789673, -0.1126515194773674, -0.13327482342720032, 0.10594365000724792, -0.08009454607963562, -0.13633659482002258, 0.34224948287010193, 0.05768516659736633, 0.24497336149215698, -0.3302887976169586, 0.39150285720825195, 0.5867267847061157, -0.05256948620080948, -0.3458612263202667, -0.1250942200422287, 0.1672413945198059, -0.24302029609680176, 0.19002187252044678, 0.23435078561306, 0.049047913402318954, -0.16853216290473938, -0.10341194272041321, 0.19228261709213257, -0.033542782068252563, 0.021535735577344894, 0.12492723762989044, 0.2115403413772583, -0.1932801902294159, 0.07919805496931076, 0.032993629574775696, -0.13973134756088257, -0.02651228755712509, -0.14787738025188446, -0.14708220958709717, 0.1770462989807129, -0.11744348704814911, 0.39190179109573364, 0.4954919219017029, 0.21954214572906494, 0.14448922872543335, -0.23481333255767822, -0.019289905205368996, 0.023845430463552475, -0.14457470178604126, 0.1852429211139679, 0.06127351149916649, 0.42943495512008667, -0.1603241115808487, 0.10281988978385925, 0.041880182921886444, 0.09289487451314926, 0.18204668164253235, -0.2280777096748352, -0.14536555111408234, 0.05299761891365051, 0.1474515199661255, -0.15812960267066956, -0.08428451418876648, 0.0038672201335430145, 0.02642153948545456, -0.10950317233800888, 0.13537561893463135, -0.08494491875171661, 0.07104497402906418, -0.14138194918632507, 0.22266221046447754, -0.06940393894910812, 0.25532472133636475, -0.14631439745426178, 0.17997854948043823, 0.19630898535251617, -0.07162638008594513, 0.16479037702083588, -0.07587465643882751, -0.12612904608249664, 0.18981525301933289, 0.04247071593999863, 0.08857788145542145, -0.236011803150177, 0.1619628369808197, -0.1015683114528656, -0.18508073687553406, -0.17613446712493896, 0.04087557643651962, -0.033959537744522095, -0.44179123640060425, 0.2206096351146698, 0.010766522958874702, 0.3679775595664978, -0.034586742520332336, 0.3067290484905243, -0.16089241206645966, -0.1483864039182663, 0.30726075172424316, 0.24637778103351593, -0.3023310899734497, 0.11788534373044968, -0.199293851852417, 0.5673122406005859, -0.2471860945224762, -0.3327309489250183, -0.26534411311149597, 0.08606229722499847, -0.27842745184898376, 0.25734132528305054, -0.028712131083011627, 0.014846747741103172, 0.29364973306655884, -0.2988932430744171, 0.0970841720700264, -0.060905613005161285, -0.23386293649673462, 0.2345752716064453, -0.025040455162525177, 0.1252274513244629, 0.08473002910614014, 0.03455345705151558, -0.018983040004968643, -0.12625060975551605, 0.024001682177186012, -0.5183690786361694, -0.004764193668961525, 0.023704789578914642, -0.16608668863773346, 0.10267189890146255, -0.19560155272483826, -0.4401955306529999, 0.15640859305858612, -0.3722035586833954, -0.10868637263774872, -0.11821319162845612, -0.010657541453838348, 0.17721885442733765, -0.15146274864673615, -0.05754828825592995, 0.030576540157198906, 0.09116633236408234, -0.19159771502017975, -0.5478983521461487, -0.007574301213026047, -0.3402535915374756, -0.0971221774816513, 0.07832977175712585, -0.12222667038440704, 0.2481231540441513, -0.17080773413181305, -0.41402602195739746, -0.27718251943588257, 0.19348476827144623, 0.16473166644573212, 0.32677900791168213, -0.31970930099487305, 0.20822358131408691, -0.11113963276147842, -0.2431178241968155, -0.016203973442316055, 0.149575337767601, 0.09642849862575531, 0.2615318298339844, 0.0019402429461479187, 0.034231752157211304, 0.05080948397517204, -0.0063383206725120544, 0.521765410900116, 0.0905851423740387, 0.004429753869771957, 0.2895391285419464, -0.06078347563743591, 0.2372371256351471, -0.03324851393699646, -0.11965473741292953, 0.004195722751319408, 0.15918762981891632, -0.2578071057796478, 0.4432467818260193, 0.0692809447646141, 0.13975009322166443, -0.1462121456861496, -0.166887104511261, 0.06731484830379486, -0.3676801323890686, 0.17830292880535126, -0.13195161521434784, 0.36131593585014343, 0.040329333394765854, 0.18483808636665344, -0.03142265975475311, -0.15016701817512512, 0.2855944037437439, 0.1495094895362854, 0.16683149337768555, -0.2167445570230484, -0.08215001225471497, 0.09134916961193085, -0.168558269739151, 0.40019410848617554, 0.13687558472156525, 0.30396580696105957, -0.24201974272727966, -0.08623938262462616, 0.007485002279281616, -0.23155048489570618, 0.09464682638645172, -0.3121930956840515, -0.044173404574394226, 0.08886612951755524, -0.3639799952507019, -0.08499652147293091, -0.03803922235965729, -0.08797788619995117, -0.007022792939096689, 0.11567343771457672, 0.5060594081878662, 0.26943492889404297, -0.39078062772750854, 0.3741951584815979, -0.14887864887714386, -0.2501803934574127, 0.06540775299072266, -0.34699776768684387, -0.5282936096191406, -0.20929351449012756, 0.41827908158302307, -0.20764687657356262, -0.08064405620098114, -0.5061274766921997, -0.014687597751617432, 0.22671538591384888, -0.00722895935177803, 0.08755336701869965, 0.4260649085044861, -0.27993249893188477, -0.0418798103928566, -0.017648953944444656, 0.2571941018104553, 0.10908117890357971, 0.05292639881372452, 0.10184982419013977, -0.014348343014717102, 0.3166068494319916, 0.12455422431230545, 0.07814277708530426, 0.30641961097717285, 0.4314710199832916, 0.044589996337890625, -0.08251573890447617, 0.09718268364667892, 0.13713714480400085, -0.3089737892150879, 0.15780912339687347, 0.10720978677272797, 0.005780979059636593, 0.08109093457460403, 0.2981179356575012, 0.08313825726509094, -0.14291884005069733, -0.17001700401306152, -0.2119128704071045, 0.5097306966781616, -0.13653825223445892, 0.3650398850440979, 0.09266819059848785, 0.5950025916099548, 0.06839519739151001, -0.12725545465946198, 0.05289990082383156, -0.2361874133348465, 0.1294645220041275, -0.15278857946395874, 0.027839621528983116, -0.12401524186134338, -0.5115202069282532, 0.08324069529771805, -0.0981307327747345, 0.22966623306274414, -0.05315708369016647, -0.1779530942440033, 0.4154099225997925, 0.11896868050098419, 0.2312471717596054, 0.10902959853410721, 0.26094961166381836, -0.022168492898344994, -0.14359121024608612, -0.1267724186182022, 0.31097307801246643, 0.08658745139837265, 0.3622501492500305, -0.13689348101615906, 0.03748775273561478, 0.08887261152267456, -0.19869069755077362, -0.033157072961330414, -0.006971418857574463, -0.02918403223156929, -0.2035389393568039, -0.016483139246702194, 0.22177673876285553, 0.17662161588668823, -0.04416337236762047, 0.29587650299072266, 0.3345562219619751, -0.1831599473953247, 0.05800300091505051, -0.011746466159820557, 0.15714021027088165, 0.19807168841362, 0.003294801339507103, 0.13095317780971527, -0.21369090676307678, -0.5210878849029541, 0.04684193432331085, -0.10217937082052231, -0.36173534393310547, 0.29686981439590454, -0.3882983922958374, -0.107816681265831, -0.135043665766716, 0.4681825041770935, -0.0892937034368515, -0.1502959281206131, -0.10920186340808868, 0.2552054822444916, -0.25702613592147827, -0.1576770544052124, 0.22431784868240356, 0.2206822633743286, -0.31469935178756714, -0.2518253028392792, -0.13307616114616394, -0.23251664638519287, -0.03386720269918442, -0.11490191519260406, -0.004799295216798782, -0.0321960411965847, -0.42890477180480957, 0.03305990993976593, 0.1555705964565277, -0.26088106632232666, 0.18523287773132324, 0.1653788536787033, -0.4582303762435913, 0.007249733898788691, 0.5749487280845642, 0.2776024043560028, -0.07628113776445389, -0.2580310106277466, 0.055090636014938354, -0.5330297946929932, 0.3565348982810974, 0.1914328634738922, 0.2175636887550354, 0.2813720703125, 0.12519314885139465, 0.0032146796584129333, 0.056142695248126984, -0.4671475291252136, -0.2232692986726761, -0.43980634212493896, 0.15715764462947845, -0.06009028106927872, -0.38390791416168213, 0.4839033782482147, 0.12827520072460175, 0.19441331923007965, -0.10722671449184418, -0.15474124252796173, -0.31964027881622314, -0.009730308316648006, 0.06585535407066345, -0.1528608798980713, 0.03590010851621628, -0.026570260524749756, 0.04356309026479721, -0.08850434422492981, -0.08038859814405441, 0.3073439598083496, -0.042358387261629105, 0.022224295884370804, -0.07642911374568939, -0.20393188297748566, -0.2657450735569, -0.47891658544540405, 0.1996745616197586, 0.22264344990253448, 0.36144256591796875, -0.30394434928894043, 0.03905755281448364, -0.01885189302265644, -0.30894869565963745, 0.0200047567486763, 0.36756381392478943, 0.24757903814315796, 0.3548658490180969, 0.000950392335653305, 0.13009902834892273, -0.11206763982772827, 0.25523823499679565, 0.20994649827480316, -0.2082371711730957, 0.2562214732170105, 0.10512596368789673, -0.033596817404031754, 0.3720659613609314, -0.11289368569850922, 0.05018848180770874, -0.13911984860897064, -0.04672463983297348, 0.27577027678489685, 0.44935575127601624, 0.3997461497783661, -0.22290588915348053, 0.5163305401802063, 0.126388818025589, 0.10805323719978333, -0.05503786355257034, -0.0596851147711277, -0.044717732816934586, -0.3952483832836151, 0.19778217375278473, 0.17346957325935364, -0.3660294711589813, 0.01971007138490677, -0.3006935715675354, 0.08722659200429916, 0.49487563967704773, -0.2239433228969574, 0.23330330848693848, 0.35952168703079224, -0.031449876725673676, 0.21161550283432007, -0.36785751581192017, 0.17903448641300201, 0.25316834449768066, -0.0384419783949852, 0.1854971945285797, -0.19677101075649261, -0.4504600763320923, -0.6634379029273987, -0.04637589678168297, -0.08955279737710953, -0.1079932302236557, -0.14724969863891602, 0.036675550043582916, -0.13028720021247864, 0.20118220150470734, 0.14060182869434357, 0.3048023581504822, 0.07898391783237457, 0.21470250189304352, -0.06890633702278137, 0.23758572340011597, -0.21806642413139343, 0.029067639261484146, 0.11537647247314453, -0.03713712468743324, 0.23676082491874695, 0.15134672820568085, 0.020443838089704514, 0.2199925184249878, 0.22694414854049683, 0.15175655484199524, -0.42085564136505127, -0.18163788318634033, -0.14973235130310059, -0.020754732191562653, 0.06486950814723969, -0.06831832975149155, 0.07642900198698044, -0.18852010369300842, -0.09284789860248566, 0.16349144279956818, 0.3056139051914215, -0.20132437348365784, -0.09765413403511047, -0.1987651139497757, -0.1311832070350647, -0.2008064240217209, 0.310981422662735, 0.3289546072483063, -0.06477051228284836, -0.2850455641746521, 0.12757188081741333, 0.04961983859539032, 0.251253217458725, -0.030397340655326843, -0.37995144724845886, 0.11786631494760513, 0.08822032809257507, 0.14720992743968964, 0.054408177733421326, 0.4812881350517273, -0.047701168805360794, 0.17642748355865479, -0.1537836790084839, -0.07985363155603409, -0.031037721782922745, 0.2082463651895523, 0.08495819568634033, 0.3863937258720398, -0.03591015562415123, -0.05842113494873047, 0.34981027245521545, 0.020502101629972458, 0.16476115584373474, -0.47354981303215027, -0.07807524502277374, 0.05711124464869499, -0.1070956140756607, 0.2718674838542938, 0.01196720078587532, -0.1626908779144287, 0.051168687641620636, -0.32481446862220764, 0.23913446068763733, 0.19966430962085724, 0.11694876104593277, 0.0720217302441597, -0.06440334767103195, 0.42963907122612, -0.4180888831615448, 0.12090785801410675, 0.07066074013710022, 0.29573506116867065, -0.17759501934051514, -0.14299799501895905, -0.21485444903373718, -0.31439775228500366, -0.033681727945804596, -0.2060667872428894, -0.10592776536941528, 0.04611745476722717, 0.3437282145023346, -0.10954335331916809, -0.10639294236898422, -0.0505652092397213, 0.1992541253566742, 0.14168064296245575, -0.11756376177072525, -0.16231085360050201, -0.29147985577583313, -0.01944124698638916, 0.17763535678386688, 0.3739004135131836, -0.00840989500284195, -0.24497458338737488, -0.06489692628383636, -0.05853085219860077, 0.2897525429725647, -0.09232926368713379, -0.3273906111717224, -0.3235529959201813, 0.39847898483276367, 0.07756955176591873, 0.10566175729036331, 0.12093044072389603, -0.0757971704006195, -0.1565503180027008, 0.10186995565891266, 0.12584105134010315, 0.30992746353149414, 0.23733767867088318, -0.027936669066548347, -0.07319393754005432, 0.3621010184288025, -0.190932959318161, 0.057940781116485596, -0.3451226055622101, -0.04436034709215164 ]
https://github.com/huggingface/datasets/issues/2978
Run CI tests against non-production server
@julien-c increased the huggingface.co production workers in order to see if it solve [the 502 you had this morning](https://app.circleci.com/pipelines/github/huggingface/datasets/7843/workflows/fc83fa32-18f5-4dc3-9e2f-ba277ae1af74) For the decision process: be aware that moon-staging does not have persistent repos (they are deleted regularly). as a consequence, **if the moon-staging solution is validated**, you should consider a way to keep the repository that are loaded in tests. These are the ones I found : https://github.com/huggingface/datasets/blob/d488db2f64f312f88f72bbc57a09b7eddb329182/tests/test_load.py and https://github.com/huggingface/datasets/blob/40773111c3e7db8a992fa1c48af32d900a1018d6/tests/test_streaming_download_manager.
Currently, the CI test suite performs requests to the HF production server. As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`.
69
Run CI tests against non-production server Currently, the CI test suite performs requests to the HF production server. As discussed with @elishowk, we should refactor our tests to use the HF staging server instead, like `huggingface_hub` and `transformers`. @julien-c increased the huggingface.co production workers in order to see if it solve [the 502 you had this morning](https://app.circleci.com/pipelines/github/huggingface/datasets/7843/workflows/fc83fa32-18f5-4dc3-9e2f-ba277ae1af74) For the decision process: be aware that moon-staging does not have persistent repos (they are deleted regularly). as a consequence, **if the moon-staging solution is validated**, you should consider a way to keep the repository that are loaded in tests. These are the ones I found : https://github.com/huggingface/datasets/blob/d488db2f64f312f88f72bbc57a09b7eddb329182/tests/test_load.py and https://github.com/huggingface/datasets/blob/40773111c3e7db8a992fa1c48af32d900a1018d6/tests/test_streaming_download_manager.
[ -0.13052642345428467, -0.4287920594215393, -0.02454814687371254, -0.05014416575431824, -0.0372760146856308, -0.331485390663147, 0.34192538261413574, 0.268729567527771, 0.0688500851392746, 0.10764239728450775, -0.1735491305589676, -0.030778126791119576, 0.01306983269751072, 0.5772929191589355, 0.03403433784842491, 0.01953090727329254, -0.1025429293513298, -0.02505543828010559, -0.3881969749927521, 0.13470277190208435, -0.20169836282730103, 0.20191599428653717, 0.19600485265254974, -0.0386471152305603, -0.23491953313350677, -0.04350324720144272, -0.04272926598787308, 0.40015333890914917, -0.08127070963382721, -0.20702821016311646, 0.2559806704521179, 0.4386575520038605, -0.08377600461244583, 0.3032744526863098, -0.00010190771718043834, 0.21460001170635223, 0.31832849979400635, -0.08160708099603653, -0.2325218766927719, -0.005547374486923218, 0.3747105002403259, 0.050613388419151306, -0.14162151515483856, -0.057802800089120865, -0.3539261519908905, 0.43182551860809326, -0.24152694642543793, 0.04970590025186539, 0.4061838388442993, 0.26556751132011414, 0.28368809819221497, 0.7704788446426392, -0.23710104823112488, -0.22270217537879944, 0.02983924001455307, 0.1852056384086609, 0.017845040187239647, 0.2147379070520401, 0.4013451337814331, 0.07586465030908585, -0.14278000593185425, 0.13164938986301422, 0.1060747504234314, 0.09117269515991211, -0.2191721796989441, -0.07480418682098389, 0.1811399757862091, -0.33148396015167236, 0.20280736684799194, 0.07309339940547943, -0.0733722671866417, 0.022777670994400978, -0.22509147226810455, -0.037815965712070465, -0.06352371722459793, 0.00017287395894527435, 0.3170166015625, 0.02992955408990383, -0.10950954258441925, 0.01246774010360241, -0.5568786859512329, -0.07959023863077164, -0.03165311738848686, -0.2211890071630478, -0.1934071034193039, 0.02837131917476654, -0.179820254445076, -0.011013507843017578, 0.12773191928863525, -0.10336865484714508, -0.3625871241092682, 0.09443867951631546, -0.15300993621349335, -0.04345957562327385, -0.16345714032649994, -0.33321356773376465, 0.13397619128227234, 0.13139455020427704, 0.3033832907676697, 0.4456384778022766, -0.4202320873737335, 0.07526698708534241, 0.00436754897236824, 0.195619136095047, -0.06641122698783875, 0.09035636484622955, -0.13794821500778198, -0.10310707986354828, 0.46023160219192505, 0.5199606418609619, -0.03297889232635498, 0.11406006664037704, 0.14762987196445465, -0.29224658012390137, -0.40591707825660706, -0.35473766922950745, 0.18014566600322723, -0.380106121301651, -0.22971147298812866, 0.07622922211885452, -0.011928759515285492, 0.18397018313407898, 0.2951189875602722, 0.568884551525116, 0.11721746623516083, 0.24924084544181824, 0.0761985182762146, 0.20576700568199158, -0.16226421296596527, -0.010624511167407036, -0.23754003643989563, -0.0012926924973726273, -0.06391418725252151, 0.17762812972068787, 0.34262460470199585, -0.19802680611610413, 0.4622860252857208, 0.030496716499328613, 0.3654649257659912, -0.08465038239955902, 0.04398062825202942, 0.20021608471870422, 0.01264934241771698, 0.47381865978240967, 0.07304152846336365, -0.0687331110239029, 0.008919645100831985, 0.043388351798057556, -0.08884265273809433, -0.2946823239326477, -0.10907889157533646, -0.295148640871048, 0.20624613761901855, 0.25378045439720154, -0.34158527851104736, -0.0016138777136802673, -0.08469847589731216, -0.20995672047138214, -0.09351726621389389, 0.052858006209135056, 0.09737124294042587, 0.12868165969848633, -0.15244005620479584, 0.08227776736021042, 0.30047231912612915, 0.5897506475448608, 0.24191001057624817, -0.14635375142097473, 0.15917789936065674, -0.032230786979198456, 0.0842837393283844, 0.24403588473796844, -0.08151786774396896, -0.22649678587913513, -0.322454571723938, -0.2526628077030182, -0.17895162105560303, -0.48677363991737366, -0.10773107409477234, 0.3008037209510803, -0.4121316075325012, -0.04982563108205795, 0.11611896008253098, -0.1185394898056984, -0.002565906383097172, -0.16037189960479736, 0.027264773845672607, -0.06758906692266464, -0.1215335875749588, 0.2308696210384369, -0.4781525135040283, -0.3641110062599182, -0.41658633947372437, 0.24968327581882477, 0.2646138072013855, 0.010775670409202576, -0.045967765152454376, -0.1707906872034073, 0.1450500190258026, -0.08939562737941742, -0.030769431963562965, -0.014205504208803177, 0.3855171203613281, 0.0039989277720451355, -0.040951550006866455, 0.19500002264976501, 0.061440758407115936, 0.2799168527126312, -0.49302759766578674, 0.1695723533630371, 0.24985042214393616, -0.2613476514816284, -0.42182183265686035, 0.03522293269634247, 0.08196800947189331, -0.410043865442276, 0.12814895808696747, 0.18019342422485352, 0.14266254007816315, -0.07844778150320053, -0.17427858710289001, 0.22189344465732574, -0.2013101875782013, 0.17312230169773102, -0.2767748236656189, 0.34178775548934937, -0.06304934620857239, -0.05267413333058357, 0.2559363543987274, 0.013343065977096558, -0.05328970402479172, -0.15587931871414185, -0.008780132979154587, 0.2850830554962158, -0.3434050679206848, 0.34264758229255676, 0.33658361434936523, 0.2865997552871704, 0.13210779428482056, 0.04304121062159538, -0.08579319715499878, 0.03327105939388275, -0.10331293940544128, 0.14024093747138977, -0.053964242339134216, 0.600831151008606, -0.17911852896213531, 0.0073937103152275085, 0.10794727504253387, 0.10327404737472534, 0.4119400382041931, -0.15348710119724274, -0.15287335216999054, -0.058341626077890396, 0.1286035180091858, -0.1215985119342804, 0.2406560331583023, -0.011597482487559319, -0.06669300049543381, 0.1434532254934311, 0.2606135904788971, -0.0441657118499279, -0.10875164717435837, 0.019066600129008293, -0.04658782482147217, -0.09604820609092712, 0.14315730333328247, 0.217497780919075, 0.38791126012802124, 0.19608697295188904, -0.14939728379249573, 0.14956142008304596, 0.011837035417556763, -0.21954195201396942, 0.23033687472343445, 0.04641840234398842, -0.16080982983112335, -0.11871697753667831, 0.18347857892513275, -0.11358065158128738, -0.27812501788139343, 0.20121924579143524, 0.015185927972197533, 0.07319357991218567, -0.5638832449913025, 0.01446215994656086, 0.0327579528093338, -0.2468794584274292, -0.1718577891588211, 0.39947840571403503, -0.16761790215969086, -0.33222031593322754, 0.2349865585565567, 0.4071696102619171, -0.39051175117492676, 0.1045716181397438, 0.0341118685901165, 0.47494739294052124, -0.15251567959785461, -0.15588918328285217, -0.2198828011751175, 0.00503890123218298, -0.022842075675725937, 0.17887623608112335, 0.1698392927646637, -0.2724338471889496, 0.4506473243236542, -0.29807618260383606, -0.07355153560638428, -0.2653985619544983, -0.5127331018447876, 0.19883374869823456, 0.024975953623652458, 0.2091192603111267, 0.05179008096456528, 0.14903193712234497, 0.00358688086271286, -0.051689013838768005, 0.17796069383621216, -0.488973468542099, -0.16705173254013062, 0.0861843079328537, -0.00831625796854496, -0.11120830476284027, -0.296272337436676, -0.3347023129463196, 0.2434137910604477, -0.4091587960720062, 0.14743687212467194, -0.07068239152431488, -0.0814465582370758, 0.04475795850157738, -0.17445267736911774, 0.15645372867584229, 0.042986806482076645, -0.06692179292440414, -0.3200812339782715, -0.6977433562278748, 0.0929189920425415, -0.3355582654476166, -0.18847066164016724, 0.13224051892757416, -0.03215295448899269, 0.24685588479042053, -0.20343375205993652, -0.2921002507209778, -0.49908801913261414, -0.0531155988574028, 0.2948760688304901, 0.3427008092403412, -0.10225169360637665, 0.24740366637706757, -0.12101409584283829, -0.22323773801326752, -0.03388574346899986, 0.07341158390045166, 0.25577548146247864, 0.2977086901664734, 0.11111985146999359, 0.021138465031981468, 0.21015891432762146, -0.12414926290512085, 0.7180442214012146, 0.26759588718414307, -0.05354100838303566, 0.29478827118873596, 0.012892755679786205, 0.18914423882961273, 0.07045512646436691, -0.09803163260221481, 0.04583242908120155, 0.06464893370866776, -0.09516781568527222, 0.5410001277923584, 0.2238268256187439, 0.0827895775437355, -0.17309273779392242, -0.24455295503139496, -0.11600062996149063, -0.5141211748123169, 0.002311011776328087, -0.10250765085220337, 0.1973920464515686, -0.014416647143661976, 0.06559403985738754, 0.10742783546447754, -0.14595717191696167, 0.1728500872850418, 0.19145911931991577, 0.127905935049057, -0.08010326325893402, -0.025300689041614532, 0.061471451073884964, -0.4723016023635864, 0.2677757143974304, -0.04537149891257286, 0.21102425456047058, -0.19855059683322906, -0.11240404099225998, 0.041041843593120575, -0.42422404885292053, 0.2313583344221115, -0.12620383501052856, 0.25944605469703674, -0.09818039834499359, -0.43280866742134094, -0.14802959561347961, -0.009486977010965347, -0.12456625699996948, 0.17579469084739685, 0.1801677793264389, 0.47106820344924927, -0.15840384364128113, -0.2804301083087921, 0.2973279356956482, -0.1674153059720993, -0.06320980936288834, 0.18942353129386902, -0.36590906977653503, -0.5978123545646667, -0.31405988335609436, 0.29436513781547546, -0.11023348569869995, -0.09522280097007751, -0.42824870347976685, -0.03391589596867561, 0.14079800248146057, -0.12633630633354187, 0.21906128525733948, 0.32820385694503784, 0.052532944828271866, 0.011785190552473068, 0.21789871156215668, 0.299893319606781, 0.12104855477809906, 0.06415443867444992, 0.6295457482337952, 0.04705166816711426, 0.11877225339412689, 0.05059240385890007, 0.1169072687625885, 0.03726944327354431, 0.5984959602355957, -0.04238881170749664, 0.19747750461101532, 0.2520776689052582, 0.3209155797958374, -0.3322308659553528, 0.12700757384300232, 0.2103523313999176, 0.1942371279001236, 0.0832240954041481, 0.12536662817001343, 0.15276628732681274, -0.04515928030014038, -0.05681503936648369, -0.06504892557859421, 0.2835509777069092, -0.11220210790634155, 0.09611999243497849, 0.16347607970237732, 0.8365246057510376, -0.00646626204252243, -0.07745301723480225, 0.22977054119110107, -0.22775425016880035, 0.22235321998596191, -0.12279324233531952, 0.009405994787812233, -0.2476474791765213, -0.040512651205062866, 0.21644505858421326, 0.06679078936576843, -0.01220734417438507, -0.1882733851671219, -0.19138936698436737, 0.154290109872818, 0.21104027330875397, 0.46756014227867126, 0.007507080677896738, 0.2544517517089844, -0.25800812244415283, -0.19581635296344757, -0.3338824510574341, 0.2814615070819855, -0.010202988982200623, 0.29465535283088684, -0.21410569548606873, -0.10887482017278671, 0.07224754989147186, -0.31091225147247314, -0.07608470320701599, 0.05405823141336441, -0.13334810733795166, -0.07966921478509903, 0.08588722348213196, 0.24069271981716156, 0.012730296701192856, 0.06064942106604576, 0.36776381731033325, 0.31957095861434937, -0.18340642750263214, 0.16467039287090302, -0.09966898709535599, 0.049235619604587555, 0.15393349528312683, -0.025802116841077805, 0.2757321000099182, -0.18651032447814941, -0.37430599331855774, -0.017661772668361664, -0.021163761615753174, -0.06836063414812088, 0.02819088101387024, -0.1235402524471283, -0.3013644218444824, -0.173800989985466, 0.3123824894428253, -0.04998350143432617, -0.2712176740169525, -0.15259213745594025, 0.2139756977558136, -0.053921520709991455, -0.2320421040058136, 0.10153645277023315, 0.1822834014892578, -0.17805902659893036, -0.22300396859645844, 0.15412691235542297, -0.3284570574760437, 0.07269158214330673, 0.0364561527967453, 0.07104818522930145, -0.046938229352235794, -0.3214905858039856, -0.02399897202849388, -0.03714817762374878, -0.48393693566322327, 0.3281986117362976, 0.2544776499271393, -0.29239654541015625, 0.10734187811613083, 0.2851200997829437, 0.1879066377878189, -0.16750675439834595, -0.03797426074743271, -0.1712922751903534, -0.5183637142181396, 0.27370399236679077, 0.11816719174385071, 0.15031661093235016, 0.14797130227088928, 0.03873760998249054, -0.062869593501091, 0.1123724952340126, -0.45183467864990234, -0.06930618733167648, -0.5786073207855225, 0.10187677294015884, 0.042673297226428986, -0.3162952661514282, 0.46082374453544617, -0.17166243493556976, 0.14610421657562256, 0.019511107355356216, -0.34124475717544556, -0.29026830196380615, -0.14888662099838257, 0.08928440511226654, -0.19745370745658875, -0.1358933001756668, 0.16550493240356445, 0.19275730848312378, -0.09136557579040527, -0.036879993975162506, 0.42224156856536865, 0.021337155252695084, 0.080665722489357, -0.4009174704551697, -0.15014135837554932, -0.06881312280893326, -0.4255428910255432, 0.1989271193742752, 0.18149445950984955, 0.21295166015625, -0.09766320884227753, 0.03207964450120926, -0.09165076166391373, -0.2175828516483307, 0.20597773790359497, 0.2676822543144226, 0.250832736492157, 0.10722439736127853, 0.22061705589294434, -0.0649687722325325, -0.19935546815395355, 0.10986471176147461, 0.34275150299072266, 0.03542279824614525, 0.04347414895892143, 0.051746152341365814, 0.15460067987442017, 0.31797415018081665, -0.21736378967761993, 0.16312140226364136, -0.0066496506333351135, -0.1779451221227646, 0.24505615234375, 0.47026708722114563, 0.3607681095600128, -0.08032291382551193, 0.44167423248291016, 0.25233450531959534, 0.3752816915512085, -0.020661134272813797, 0.057065386325120926, -0.09286166727542877, -0.16801488399505615, 0.1716158390045166, 0.03972678631544113, -0.13213549554347992, 0.07381808757781982, -0.3403550386428833, -0.007041461765766144, 0.4322502911090851, -0.38021519780158997, 0.1991395652294159, 0.3026219308376312, -0.07544267177581787, 0.05920501798391342, 0.0390363484621048, -0.24605390429496765, 0.39898574352264404, -0.10945849120616913, 0.6748166084289551, -0.2839204967021942, -0.466217577457428, -0.5090405941009521, 0.275950163602829, -0.1484573781490326, -0.11377257108688354, -0.2090817093849182, -0.16608001291751862, -0.38804876804351807, 0.3010248839855194, 0.19360408186912537, 0.08289223909378052, -0.023312091827392578, 0.17167183756828308, -0.11791880428791046, -0.2728273272514343, -0.0635739266872406, 0.00713580846786499, 0.3315895199775696, -0.11985006928443909, 0.3330364227294922, 0.34760892391204834, -0.07950606942176819, 0.3160404860973358, 0.2113574594259262, 0.4214112460613251, -0.24717652797698975, -0.0017237700521945953, 0.12357489764690399, 0.13095691800117493, 0.09296563267707825, -0.1330510973930359, 0.009175771847367287, -0.09279754757881165, -0.2413642257452011, 0.22276917099952698, 0.287493497133255, -0.2764193117618561, -0.039940182119607925, -0.341920405626297, 0.00939931906759739, -0.17140428721904755, 0.41308701038360596, -0.016144022345542908, 0.0053379833698272705, -0.3094727098941803, -0.2333661913871765, -0.19304656982421875, 0.2132871001958847, -0.12954497337341309, -0.142075315117836, 0.17399805784225464, -0.09309349209070206, 0.14103956520557404, 0.126373291015625, 0.5193093419075012, 0.04041382670402527, -0.004789389669895172, -0.0562090203166008, -0.19585517048835754, -0.37714019417762756, 0.0019122809171676636, 0.1444263607263565, 0.2511082589626312, -0.07488207519054413, -0.11695463210344315, 0.172061949968338, -0.015923842787742615, 0.05822398513555527, -0.4812083840370178, 0.10857175290584564, -0.0747571736574173, -0.04836641624569893, 0.1962830275297165, -0.1954120248556137, -0.19676724076271057, 0.18671613931655884, -0.28548482060432434, 0.03313198685646057, -0.1305837631225586, 0.07831651717424393, 0.21839773654937744, 0.09135785698890686, 0.053518716245889664, -0.5762660503387451, 0.050994500517845154, 0.14941726624965668, 0.17691972851753235, -0.20049867033958435, -0.1598048210144043, -0.19713491201400757, -0.29584789276123047, -0.18511052429676056, -0.22110065817832947, -0.12566809356212616, 0.421731173992157, 0.2618999183177948, -0.2173698991537094, -0.19825053215026855, -0.0722610205411911, 0.21749325096607208, -0.06547591835260391, 0.10415712743997574, -0.1222786083817482, -0.16125431656837463, 0.05790558084845543, 0.26722973585128784, 0.48214709758758545, 0.007406540215015411, -0.03361618146300316, -0.27205124497413635, -0.282877653837204, 0.39647987484931946, -0.18140336871147156, -0.043938830494880676, -0.10013039410114288, 0.5388935804367065, 0.060932159423828125, -0.11989777535200119, -0.22940516471862793, 0.06989360600709915, -0.1444987952709198, 0.08340209722518921, -0.0668463259935379, 0.2790697515010834, 0.11545749008655548, -0.22894157469272614, -0.12281519174575806, 0.1009371280670166, 0.08089665323495865, 0.0480094850063324, 0.04930544272065163, 0.03116714209318161 ]
https://github.com/huggingface/datasets/issues/2977
Impossible to load compressed csv
Hi @Valahaar, thanks for reporting and for your investigation about the source cause. You are right and that commit prevents `pandas` from inferring the compression. On the other hand, @lhoestq did that change to support loading that dataset in streaming mode. I'm fixing it.
## Describe the bug It is not possible to load from a compressed csv anymore. ## Steps to reproduce the bug ```python load_dataset('csv', data_files=['/path/to/csv.bz2']) ``` ## Problem and possible solution This used to work, but the commit that broke it is [this one](https://github.com/huggingface/datasets/commit/ad489d4597381fc2d12c77841642cbeaecf7a2e0#diff-6f60f8d0552b75be8b3bfd09994480fd60dcd4e7eb08d02f721218c3acdd2782). `pandas` usually gets the compression information from the filename itself (which was previously directly passed). Now, since it gets a file descriptor, it might be good to auto-infer the compression or let the user pass the `compression` kwarg to `load_dataset` (or maybe warn the user if the file ends with a commonly known compression scheme?). ## Environment info - `datasets` version: 1.10.0 (and over) - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 3.0.0
44
Impossible to load compressed csv ## Describe the bug It is not possible to load from a compressed csv anymore. ## Steps to reproduce the bug ```python load_dataset('csv', data_files=['/path/to/csv.bz2']) ``` ## Problem and possible solution This used to work, but the commit that broke it is [this one](https://github.com/huggingface/datasets/commit/ad489d4597381fc2d12c77841642cbeaecf7a2e0#diff-6f60f8d0552b75be8b3bfd09994480fd60dcd4e7eb08d02f721218c3acdd2782). `pandas` usually gets the compression information from the filename itself (which was previously directly passed). Now, since it gets a file descriptor, it might be good to auto-infer the compression or let the user pass the `compression` kwarg to `load_dataset` (or maybe warn the user if the file ends with a commonly known compression scheme?). ## Environment info - `datasets` version: 1.10.0 (and over) - Platform: Linux-5.8.0-45-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 3.0.0 Hi @Valahaar, thanks for reporting and for your investigation about the source cause. You are right and that commit prevents `pandas` from inferring the compression. On the other hand, @lhoestq did that change to support loading that dataset in streaming mode. I'm fixing it.
[ -0.061478301882743835, -0.30513638257980347, -0.05142776668071747, 0.15288187563419342, 0.258648157119751, 0.15448212623596191, 0.22306255996227264, 0.4252108335494995, -0.0204914603382349, 0.13781537115573883, 0.016965627670288086, 0.2389489859342575, 0.0854327380657196, 0.08745384216308594, 0.1481856405735016, -0.022284172475337982, 0.03294049948453903, 0.3155576288700104, 0.025474142283201218, 0.17528632283210754, -0.2651689350605011, 0.2333432137966156, -0.22709301114082336, -0.002651415765285492, -0.04543276131153107, 0.08453742414712906, -0.08331050723791122, 0.22569787502288818, -0.25921061635017395, -0.33559131622314453, 0.4326030910015106, -0.09343564510345459, 0.30097952485084534, 0.3950255215167999, -0.00010205911530647427, -0.12267328798770905, 0.39611250162124634, -0.16347664594650269, -0.29914137721061707, -0.4494855999946594, -0.0744105875492096, -0.5960686802864075, 0.06200118362903595, -0.12669728696346283, -0.13242970407009125, -0.2974298298358917, -0.04142862558364868, -0.2888426184654236, 0.42628949880599976, 0.182260200381279, 0.3117644488811493, 0.10468629002571106, 0.13002268970012665, -0.3514537215232849, -0.0887356624007225, -0.19958718121051788, -0.1068221777677536, 0.36479368805885315, 0.15569297969341278, -0.10324392467737198, 0.025112882256507874, -0.03384237736463547, -0.22190959751605988, 0.03377595171332359, 0.2967721223831177, 0.06480024009943008, -0.1226712241768837, -0.19311827421188354, 0.08034694939851761, 0.1834525465965271, 0.3346794545650482, -0.01486603170633316, -0.3791016936302185, -0.24108314514160156, 0.13075003027915955, -0.40788719058036804, 0.21410644054412842, 0.4929455816745758, -0.18637539446353912, 0.19310466945171356, -0.0965447649359703, 0.05798410251736641, -0.14350861310958862, -0.06644700467586517, -0.07690979540348053, -0.18687504529953003, -0.3574593961238861, -0.06256233900785446, 0.3124011158943176, 0.15853764116764069, 0.006397094577550888, -0.1115628182888031, -0.16256585717201233, 0.21775269508361816, -0.29562580585479736, 0.18258734047412872, 0.1144232302904129, -0.06928540021181107, 0.12206529825925827, -0.0564759224653244, 0.31077587604522705, -0.1003032997250557, 0.0719246044754982, 0.13699227571487427, 0.17123030126094818, 0.208151176571846, -0.09487318247556686, -0.13050732016563416, 0.24130314588546753, 0.28538766503334045, 0.18215376138687134, -0.12727084755897522, -0.17786523699760437, -0.49020835757255554, 0.0759301632642746, 0.09203594923019409, 0.23482264578342438, -0.16212382912635803, -0.19040027260780334, -0.02313762903213501, -0.12214835733175278, 0.13457873463630676, -0.20489084720611572, 0.23254552483558655, -0.18046890199184418, 0.16375261545181274, 0.08631119132041931, 0.1327105164527893, -0.04386712610721588, 0.14970353245735168, -0.15111143887043, -0.09410850703716278, -0.01692952960729599, -0.20260033011436462, 0.297002911567688, -0.8424340486526489, 0.11617232859134674, 0.3937283754348755, 0.18051773309707642, -0.15584129095077515, -0.2820662260055542, -0.05725701525807381, 0.06751319020986557, 0.33304664492607117, 0.11543497443199158, 0.09702426195144653, 0.31625279784202576, -0.19667398929595947, -0.11402959376573563, 0.0809401273727417, -0.46380317211151123, -0.2509194314479828, -0.2219679206609726, 0.2281770408153534, -0.1592298001050949, 0.16081969439983368, -0.31230342388153076, 0.1663161963224411, -0.14354434609413147, -0.12470653653144836, -0.28499385714530945, -0.03661151975393295, 0.1117139458656311, -0.23431849479675293, 0.3406650722026825, 0.08113497495651245, -0.6112301349639893, 0.11690676212310791, -0.0734356939792633, 0.0971405953168869, 0.23918083310127258, 0.2400672435760498, -0.36679449677467346, -0.3219698667526245, -0.18169403076171875, 0.06689044833183289, 0.05889030545949936, 0.09423056244850159, -0.4198096990585327, 0.25847965478897095, -0.07878206670284271, 0.45459526777267456, 0.0716637596487999, -0.18793857097625732, 0.23474660515785217, -0.12936462461948395, 0.2298520803451538, 0.2900305986404419, 0.07705707103013992, -0.15873107314109802, -0.32931122183799744, -0.3160003423690796, 0.3811200261116028, -0.18987174332141876, 0.027272095903754234, 0.2593711018562317, 0.07116472721099854, -0.15067215263843536, 0.28254181146621704, -0.11109407246112823, -0.07450594753026962, 0.12384922802448273, 0.13488318026065826, -0.1400371491909027, 0.17196978628635406, -0.15562079846858978, -0.13678494095802307, 0.23151177167892456, -0.018672648817300797, -0.07471412420272827, -0.26431334018707275, -0.08910604566335678, -0.26310887932777405, -0.0998091921210289, 0.07424107939004898, -0.17380742728710175, 0.17766164243221283, -0.10066011548042297, 0.0009258966892957687, -0.004517326131463051, -0.31785184144973755, 0.3350277245044708, -0.15538282692432404, 0.014716356992721558, -0.2690112292766571, 0.09861427545547485, 0.04425433650612831, 0.022345036268234253, 0.1994420289993286, -0.16289284825325012, 0.16413702070713043, -0.11560385674238205, -0.3098379969596863, 0.15055051445960999, -0.15603113174438477, 0.38756972551345825, -0.1568925380706787, -0.34634917974472046, 0.09376891702413559, 0.019259754568338394, 0.11268138885498047, 0.17161676287651062, 0.18781889975070953, 0.12334141880273819, -0.231439471244812, 0.3860321640968323, -0.07952156662940979, -0.004500381648540497, 0.0004963092505931854, -0.053954266011714935, 0.5088997483253479, -0.12365990877151489, -0.1814277172088623, 0.024787671864032745, 0.2003861367702484, -0.039735909551382065, -0.12848898768424988, 0.23882272839546204, -0.22207285463809967, -0.13133814930915833, 0.33719760179519653, -0.020916733890771866, -0.26005977392196655, 0.37410807609558105, -0.17201724648475647, -0.031183507293462753, 0.12638194859027863, 0.16297338902950287, 0.27915412187576294, 0.12435276806354523, -0.14370079338550568, -0.1017002984881401, -0.028296399861574173, -0.17369627952575684, 0.38610386848449707, -0.09229469299316406, 0.21562662720680237, 0.11536750197410583, 0.035531580448150635, 0.2927546799182892, -0.3319064676761627, 0.2514705955982208, -0.01468582171946764, -0.005363442003726959, -0.3241729438304901, 0.21280425786972046, -0.4665180742740631, 0.013110294938087463, 0.09605696052312851, -0.10425923019647598, -0.07520623505115509, -0.12622137367725372, -0.12262135744094849, 0.30952179431915283, 0.08837659657001495, -0.04225796461105347, -0.1398979276418686, 0.4042471647262573, 0.13574324548244476, -0.07806876301765442, -0.2033824473619461, -0.0445190891623497, -0.024703361093997955, 0.18941816687583923, 0.0382956825196743, -0.12397965043783188, 0.05944276601076126, 0.02431427501142025, -0.11755400151014328, -0.01907259412109852, -0.2250998318195343, -0.029257886111736298, -0.22309674322605133, 0.33623504638671875, -0.07950527966022491, 0.30718672275543213, -0.10868572443723679, -0.2262098789215088, 0.09170546382665634, -0.1023673489689827, -0.03641808405518532, 0.25846797227859497, 0.04431241750717163, -0.1336541771888733, -0.17748208343982697, -0.22083431482315063, -0.37524938583374023, -0.390093058347702, 0.3315507173538208, 0.07571305334568024, -0.03918463736772537, 0.2658913731575012, 0.15504144132137299, -0.03500059247016907, 0.27678540349006653, 0.055335767567157745, -0.24750088155269623, -0.4915824830532074, 0.538897693157196, -0.1564398854970932, -0.6152290105819702, 0.0602860264480114, 0.1061403751373291, 0.03574199229478836, 0.17246566712856293, -0.2620430588722229, 0.13762740790843964, -0.1477699726819992, 0.06439171731472015, 0.11305272579193115, -0.08009051531553268, 0.0127505362033844, -0.08343197405338287, -0.15703144669532776, -0.10177628695964813, -0.16105498373508453, -0.278685986995697, 0.3573164641857147, 0.3818061053752899, 0.04941872879862785, 0.2696261405944824, 0.12111113965511322, 0.35343873500823975, 0.16597594320774078, 0.015264265239238739, 0.31939586997032166, 0.07904428243637085, 0.5739268660545349, -0.14056143164634705, -0.43061208724975586, -0.1056520938873291, -0.34622833132743835, -0.13837026059627533, 0.09732908755540848, 0.01565122976899147, -0.13088326156139374, -0.2666434943675995, -0.05234094336628914, -0.22670209407806396, -0.18281197547912598, 0.18298150599002838, -0.17933772504329681, -0.010968275368213654, 0.16767320036888123, 0.119822658598423, -0.14490772783756256, -0.09741450101137161, -0.09377937018871307, 0.23451527953147888, 0.44932517409324646, -0.07503484189510345, 0.36101213097572327, 0.0502755381166935, -0.5287262201309204, 0.1426052451133728, -0.029392970725893974, 0.3338611125946045, -0.011767037212848663, -0.09581887722015381, 0.11118786782026291, -0.04377926141023636, 0.755544900894165, 0.21968451142311096, -0.028231181204319, 0.22631703317165375, -0.11583206802606583, -0.4461900293827057, 0.006167959421873093, -0.03888705000281334, 0.21713311970233917, 0.03716527298092842, 0.4727119207382202, -0.08104029297828674, -0.07511679083108902, -0.04437434673309326, 0.40053611993789673, -0.1391289234161377, -0.16201475262641907, -0.36399316787719727, -0.17665910720825195, -0.1815541535615921, -0.24545300006866455, 0.18665382266044617, 0.2945113480091095, -0.39901503920555115, -0.2794480621814728, -0.1526137739419937, -0.22153306007385254, 0.27967700362205505, 0.10447317361831665, 0.21542870998382568, 0.13858799636363983, 0.025878146290779114, 0.047535162419080734, 0.15348666906356812, 0.06810116022825241, 0.4438507854938507, 0.16489240527153015, -0.47437894344329834, 0.013415510766208172, 0.03334476426243782, 0.23465456068515778, 0.29715704917907715, -0.4338621199131012, 0.1135454773902893, 0.05472613498568535, 0.1096053496003151, -0.3401717245578766, -0.14207209646701813, 0.38200947642326355, 0.11398965120315552, -0.4441687762737274, -0.2969275712966919, 0.45067402720451355, 0.03047483041882515, 0.04312655329704285, 0.3533467948436737, -0.05957406759262085, -0.15031641721725464, 0.13447777926921844, 0.01570185273885727, 0.803827702999115, -0.197337344288826, -0.06161459907889366, 0.13723087310791016, 0.05173591524362564, 0.5494524240493774, -0.19677098095417023, 0.1730254888534546, -0.07576405256986618, -0.6269330978393555, -0.1473371386528015, -0.028389835730195045, 0.32694268226623535, -0.07313354313373566, -0.21651747822761536, 0.1294335424900055, -0.26190251111984253, 0.1987076699733734, 0.17005348205566406, -0.029310960322618484, -0.22787965834140778, -0.26909589767456055, -0.7500174045562744, 0.2585565149784088, -0.029655292630195618, 0.14163975417613983, 0.1367998719215393, -0.22725090384483337, -0.07277131080627441, -0.14201238751411438, -0.1921570748090744, 0.34106409549713135, 0.2034449726343155, 0.032500289380550385, -0.19847612082958221, -0.41759032011032104, 0.0411161333322525, 0.09173087030649185, -0.0033160224556922913, 0.15637175738811493, -0.1690303534269333, 0.10846196115016937, -0.12501996755599976, 0.07743610441684723, -0.08938679844141006, 0.11747750639915466, 0.18229816854000092, 0.03812895715236664, -0.06513552367687225, 0.19609519839286804, -0.23037143051624298, -0.2795262634754181, 0.5904501080513, 0.09041161835193634, -0.04223231226205826, -0.11005808413028717, -0.28909963369369507, -0.1336553543806076, 0.32205045223236084, -0.2268076092004776, 0.2672688364982605, -0.005200542509555817, -0.03130108118057251, 0.0952887237071991, 0.07500611245632172, -0.2591210603713989, -0.1060045063495636, 0.44604000449180603, -0.04733825474977493, 0.09470869600772858, 0.31035396456718445, 0.06494283676147461, -0.17595888674259186, -0.10713379830121994, -0.06530609726905823, -0.14476606249809265, -0.12291214615106583, 0.3357425034046173, 0.2449691891670227, 0.18998779356479645, -0.20288041234016418, 0.2501462996006012, 0.3540129065513611, -0.16706350445747375, -0.19716018438339233, -0.5406633615493774, -0.18357813358306885, -0.012555502355098724, -0.07926367223262787, 0.15948639810085297, 0.29239919781684875, -0.07855777442455292, 0.0369546040892601, 0.09006235748529434, -0.39337241649627686, 0.20211808383464813, 0.04388879984617233, 0.006539620459079742, 0.14889724552631378, 0.10676469653844833, 0.1596420705318451, -0.27981457114219666, 0.22854694724082947, 0.21859131753444672, 0.11084224283695221, -0.3754286468029022, -0.23166850209236145, 0.07768035680055618, -0.05352766066789627, -0.11189097166061401, -0.08490514755249023, -0.2377665936946869, -0.3556218147277832, -0.2838208079338074, 0.13887621462345123, 0.20998305082321167, 0.1078229770064354, -0.10337777435779572, 0.08081777393817902, 0.0020144209265708923, -0.23706194758415222, 0.10037960112094879, -0.2291717827320099, 0.3495699167251587, -0.02525854855775833, 0.025431351736187935, -0.11135910451412201, 0.21222537755966187, -0.3304199278354645, -0.06431224197149277, -0.1386851966381073, -0.004957854747772217, 0.5995150804519653, -0.12876123189926147, 0.06541125476360321, 0.01836620271205902, 0.33552852272987366, 0.34240204095840454, -0.019642505794763565, 0.13894623517990112, 0.2358594834804535, 0.2522881031036377, -0.36629217863082886, 0.10426407307386398, -0.17390944063663483, 0.08171725273132324, -0.22403942048549652, -0.06248841434717178, 0.15864697098731995, -0.12809105217456818, 0.15024441480636597, -0.0700899064540863, 0.5453240871429443, 0.016958419233560562, 0.42188429832458496, 0.45513173937797546, 0.22803770005702972, 0.143271341919899, 0.07105965167284012, -0.019024763256311417, 0.09490649402141571, 0.07498260587453842, -0.19148588180541992, -0.18755361437797546, -0.00610698014497757, 0.33154693245887756, -0.27288907766342163, -0.5209437608718872, 0.3141327202320099, 0.32851940393447876, -0.26052868366241455, 0.22248554229736328, 0.3452817499637604, 0.7781437039375305, -0.5015643835067749, -0.15813732147216797, -0.3588793873786926, 0.3367840051651001, -0.07132626324892044, -0.002787425648421049, 0.060170888900756836, -0.08777867257595062, 0.12552760541439056, 0.15580527484416962, 0.12245780229568481, 0.014714885503053665, 0.06752321869134903, 0.19243690371513367, -0.071883425116539, -0.30462250113487244, -0.021916620433330536, 0.0705665796995163, 0.3605392575263977, -0.09567271173000336, 0.08400904387235641, 0.09148862212896347, 0.023050662130117416, 0.1481585055589676, 0.16270799934864044, 0.4941023588180542, 0.2274387925863266, 0.31743282079696655, -0.10073154419660568, 0.2196933776140213, -0.07435107976198196, 0.12950801849365234, 0.3987055718898773, 0.1966942399740219, 0.20535168051719666, 0.09613877534866333, 0.29578548669815063, -0.218221515417099, 0.21079547703266144, 0.051411647349596024, 0.3185533881187439, -0.3271854817867279, 0.06862609088420868, 0.04430801793932915, -0.04634945094585419, -0.1377096325159073, -0.14905381202697754, -0.08974669873714447, 0.06369175016880035, 0.2309972494840622, 0.035896409302949905, 0.12402238696813583, 0.05974968150258064, 0.1510111540555954, 0.15762442350387573, 0.21472464501857758, 0.15703435242176056, -0.08552830666303635, -0.11346172541379929, 0.058577761054039, -0.6319911479949951, 0.13915134966373444, 0.08519309759140015, 0.12453263998031616, 0.07286838442087173, -0.14182041585445404, 0.1884152591228485, 0.05797231197357178, -0.09996950626373291, -0.03219761326909065, 0.2303536981344223, -0.06396675109863281, -0.14538784325122833, -0.18404942750930786, 0.1526237577199936, 0.00838202703744173, -0.26158803701400757, -0.15175792574882507, 0.2362203299999237, -0.3401488959789276, 0.0891384556889534, -0.18033334612846375, 0.08947381377220154, -0.09264446794986725, 0.13978250324726105, 0.391896516084671, 0.06780391186475754, 0.20452675223350525, -0.2304019331932068, 0.0048427823930978775, -0.3381117582321167, -0.01333615556359291, -0.020196329802274704, 0.11170637607574463, 0.08057991415262222, 0.10532914102077484, -0.07089293748140335, -0.15303504467010498, -0.2840498089790344, 0.30836620926856995, -0.05695447325706482, -0.16492289304733276, -0.30279603600502014, -0.04447486251592636, -0.17524313926696777, -0.13475091755390167, 0.1541268527507782, 0.25197455286979675, -0.21676313877105713, 0.14436905086040497, -0.09359242022037506, -0.2656097114086151, 0.42945539951324463, -0.32670164108276367, -0.26076391339302063, 0.2711884379386902, 0.13503247499465942, 0.10096528381109238, -0.04415396600961685, -0.12375163286924362, 0.19060590863227844, 0.22463786602020264, -0.12062614411115646, -0.0027152951806783676, 0.3308187425136566, -0.222920760512352, 0.010129105299711227, -0.1630997508764267, 0.17940732836723328, 0.3326173722743988, -0.312093049287796, -0.00969720259308815, -0.2334633469581604 ]
https://github.com/huggingface/datasets/issues/2976
Can't load dataset
Hi @mskovalova, Some datasets have multiple configurations. Therefore, in order to load them, you have to specify both the *dataset name* and the *configuration name*. In the error message you got, you have a usage example: - To load the 'wikitext-103-raw-v1' configuration of the 'wikitext' dataset, you should use: ```python load_dataset('wikitext', 'wikitext-103-raw-v1') ``` In your case, if you would like to load the 'wikitext-2-v1' configuration of the 'wikitext' dataset, please use: ```python raw_datasets = load_dataset("wikitext", "wikitext-2-v1") ```
I'm trying to load a wikitext dataset ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext") ``` ValueError: Config name is missing. Please pick one among the available configs: ['wikitext-103-raw-v1', 'wikitext-2-raw-v1', 'wikitext-103-v1', 'wikitext-2-v1'] Example of usage: `load_dataset('wikitext', 'wikitext-103-raw-v1')`. If I try ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext-2-v1") ``` FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.12.1/datasets/wikitext-2-v1/wikitext-2-v1.py #### Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic (colab) - Python version: 3.7.12 - PyArrow version: 3.0.0
77
Can't load dataset I'm trying to load a wikitext dataset ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext") ``` ValueError: Config name is missing. Please pick one among the available configs: ['wikitext-103-raw-v1', 'wikitext-2-raw-v1', 'wikitext-103-v1', 'wikitext-2-v1'] Example of usage: `load_dataset('wikitext', 'wikitext-103-raw-v1')`. If I try ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext-2-v1") ``` FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.12.1/datasets/wikitext-2-v1/wikitext-2-v1.py #### Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic (colab) - Python version: 3.7.12 - PyArrow version: 3.0.0 Hi @mskovalova, Some datasets have multiple configurations. Therefore, in order to load them, you have to specify both the *dataset name* and the *configuration name*. In the error message you got, you have a usage example: - To load the 'wikitext-103-raw-v1' configuration of the 'wikitext' dataset, you should use: ```python load_dataset('wikitext', 'wikitext-103-raw-v1') ``` In your case, if you would like to load the 'wikitext-2-v1' configuration of the 'wikitext' dataset, please use: ```python raw_datasets = load_dataset("wikitext", "wikitext-2-v1") ```
[ -0.09673402458429337, -0.26058730483055115, -0.07978537678718567, 0.08486078679561615, 0.24834276735782623, 0.39907023310661316, 0.3288693130016327, 0.18291039764881134, 0.23151764273643494, 0.21772906184196472, 0.1168222427368164, 0.24779929220676422, 0.007703122217208147, 0.1976594775915146, 0.09335741400718689, -0.13308529555797577, 0.04956633225083351, 0.21568745374679565, 0.29710906744003296, 0.044012248516082764, -0.21113048493862152, 0.22978699207305908, -0.27239978313446045, 0.28420865535736084, -0.28812846541404724, 0.16741697490215302, -0.06828088313341141, 0.17989452183246613, -0.11215979605913162, -0.403048574924469, 0.46938884258270264, -0.0903511494398117, 0.1952044814825058, 0.3504016101360321, -0.00010964112152578309, 0.14612434804439545, 0.39313066005706787, -0.10935156792402267, -0.3158324360847473, -0.36903107166290283, -0.44393664598464966, -0.376432865858078, 0.219206303358078, -0.21394941210746765, -0.176479309797287, -0.30197063088417053, 0.2062353640794754, -0.22974631190299988, 0.12171739339828491, 0.14131802320480347, 0.1870117485523224, 0.1579395830631256, 0.35191527009010315, -0.10465408116579056, -0.020349271595478058, -0.1574949473142624, -0.04061044380068779, 0.11093272268772125, 0.17764489352703094, -0.17089103162288666, 0.5759912133216858, 0.0713048130273819, -0.0390351302921772, -0.0635155588388443, 0.4338322579860687, 0.1229536309838295, 0.019055906683206558, -0.41802215576171875, 0.2929028570652008, 0.36564335227012634, 0.6226115226745605, -0.20670461654663086, -0.3309413194656372, -0.21320369839668274, 0.15522228181362152, -0.22146166861057281, 0.341288298368454, 0.09138687700033188, -0.18727464973926544, 0.12162399291992188, -0.24229905009269714, -0.2899407148361206, -0.03437457233667374, 0.2559741139411926, -0.15884193778038025, 0.5330592393875122, -0.033352237194776535, 0.2572158873081207, -0.04489053413271904, -0.11570681631565094, 0.1821158081293106, -0.26381850242614746, 0.019927360117435455, 0.23132702708244324, -0.4350583553314209, 0.294649213552475, -0.07782318443059921, -0.06440053135156631, -0.04484397545456886, -0.2138107270002365, -0.008980480022728443, -0.16536343097686768, 0.07904962450265884, 0.377368688583374, 0.2167264074087143, 0.013413241133093834, 0.35249394178390503, 0.18039259314537048, -0.1300218105316162, 0.022634463384747505, 0.056922148913145065, -0.22904077172279358, -0.30144619941711426, -0.39331936836242676, -0.13124892115592957, -0.07787731289863586, 0.12856589257717133, -0.06952930986881256, -0.17671267688274384, -0.15381000936031342, -0.030222082510590553, 0.06499775499105453, 0.21509447693824768, 0.2775915861129761, -0.10540022701025009, 0.28218623995780945, 0.03111100196838379, 0.17308947443962097, -0.039578258991241455, 0.059999678283929825, -0.24991527199745178, 0.058209117501974106, -0.1042519211769104, -0.01442406140267849, 0.03541356697678566, -0.2822655439376831, 0.43180546164512634, -0.016221268102526665, 0.13269048929214478, -0.06784766167402267, -0.08699169754981995, 0.12058524787425995, -0.19749414920806885, 0.37293142080307007, 0.118486687541008, 0.34204185009002686, 0.23228400945663452, -0.4099900722503662, -0.22827261686325073, 0.10490098595619202, -0.6848441958427429, -0.3727268576622009, -0.10564403235912323, 0.2250058501958847, -0.13999412953853607, -0.195479616522789, -0.38232648372650146, -0.022533047944307327, 0.11082001030445099, -0.3745192587375641, -0.20010927319526672, -0.20519578456878662, -0.09196914732456207, -0.33806800842285156, 0.4893403947353363, 0.20054952800273895, -0.45069602131843567, -0.1715911626815796, -0.17559391260147095, -0.20787039399147034, -0.11802034825086594, -0.07937780022621155, -0.4771016240119934, 0.29592445492744446, -0.1663760244846344, 0.024016551673412323, 0.5427583456039429, -0.4997711777687073, -0.3670864701271057, -0.03881552070379257, 0.01647532731294632, 0.006510315462946892, -0.022685043513774872, -0.06018730252981186, -0.19857320189476013, -0.1382559984922409, 0.15787924826145172, 0.20916390419006348, 0.015278879553079605, -0.04509161040186882, 0.130940243601799, -0.38483044505119324, 0.12817296385765076, 0.10441216826438904, -0.00626547634601593, -0.19292661547660828, -0.03875131160020828, -0.0808495283126831, 0.32388028502464294, -0.18588778376579285, 0.0030228816904127598, 0.26561039686203003, 0.15198278427124023, 0.18958178162574768, -0.07826206833124161, 0.01681579276919365, -0.5132260322570801, 0.5098344087600708, 0.049432411789894104, -0.2252337634563446, -0.021897241473197937, 0.0614064559340477, -0.23565098643302917, 0.07113506644964218, -0.3809773325920105, -0.12965308129787445, 0.11559267342090607, 0.2986522614955902, 0.021010883152484894, -0.014663532376289368, -0.2925002872943878, 0.11211374402046204, -0.05686290189623833, 0.07733995467424393, -0.30172327160835266, 0.22966374456882477, 0.1323438137769699, 0.06559296697378159, 0.042636796832084656, 0.033909834921360016, 0.1366012990474701, 0.011023923754692078, -0.12822508811950684, 0.36103880405426025, 0.04011201485991478, 0.25753870606422424, 0.0412554107606411, -0.10724793374538422, -0.06008410453796387, -0.19248758256435394, -0.022414078935980797, -0.08207497000694275, 0.2843626141548157, -0.11882190406322479, -0.01870596408843994, 0.049413420259952545, 0.044684212654829025, 0.40757694840431213, -0.09906091541051865, 0.041103556752204895, 0.10671529173851013, -0.03112768568098545, 0.044506773352622986, -0.11020521819591522, 0.0010926015675067902, 0.04537312686443329, 0.07908588647842407, -0.08762241154909134, 0.07587192952632904, -0.05952809005975723, 0.35277003049850464, 0.1528519093990326, -0.13566789031028748, -0.04225713759660721, -0.2403201460838318, 0.0632873922586441, -0.06741858273744583, 0.1263214498758316, 0.41992270946502686, 0.16268891096115112, -0.25756293535232544, -0.20524631440639496, -0.02632729709148407, 0.02179352194070816, 0.38739949464797974, 0.2675889730453491, 0.40915998816490173, 0.09104956686496735, -0.02851453609764576, -0.0623924620449543, 0.03974643349647522, -0.2164425402879715, 0.26760005950927734, 0.09780201315879822, -0.1957419365644455, 0.10335325449705124, -0.3668815791606903, 0.19998601078987122, -0.028099961578845978, -0.4390393793582916, -0.23685571551322937, -0.4396345615386963, -0.11653795838356018, -0.10625746846199036, 0.11598062515258789, 0.16065141558647156, -0.21650242805480957, -0.08216719329357147, -0.04146668687462807, -0.3020504117012024, -0.0633363202214241, -0.35635197162628174, -0.2902113199234009, 0.03568059578537941, 0.14543750882148743, 0.06932573765516281, 0.25681450963020325, -0.30822014808654785, -0.05970895290374756, -0.059335894882678986, -0.14108604192733765, 0.12155304849147797, -0.21636651456356049, 0.3394032120704651, 0.07838302850723267, 0.31258606910705566, -0.06348695605993271, -0.4796454906463623, 0.5192582607269287, -0.012138460762798786, -0.07620733231306076, -0.026033245027065277, 0.12561926245689392, -0.20774301886558533, 0.17374418675899506, -0.2605305016040802, -0.4377225637435913, -0.22727175056934357, -0.15869611501693726, -0.0587785542011261, 0.00977402925491333, 0.2992061376571655, 0.23883895576000214, 0.13098248839378357, -0.11976045370101929, 0.09352046996355057, -0.07190780341625214, -0.41584324836730957, 0.29374682903289795, -0.2859340310096741, -0.21691976487636566, 0.1834629774093628, 0.23575927317142487, 0.24109698832035065, 0.06459507346153259, -0.36960548162460327, -0.11804302036762238, 0.0020994432270526886, 0.09617964923381805, 0.03982825577259064, 0.29441142082214355, 0.1469351202249527, 0.0885295420885086, 0.04217534512281418, -0.20460164546966553, -0.25119295716285706, -0.07284819334745407, -0.0803251788020134, 0.5748789310455322, 0.14947174489498138, 0.2559167146682739, -0.3147687017917633, 0.6954646706581116, 0.32606929540634155, 0.00006203725934028625, 0.1809891164302826, -0.2448100745677948, 0.23083874583244324, -0.23093223571777344, -0.5098941326141357, 0.21655210852622986, 0.01150965690612793, 0.1609974503517151, 0.40212851762771606, -0.056185126304626465, -0.15610499680042267, -0.3914511501789093, -0.0666361004114151, -0.44571542739868164, -0.30857592821121216, -0.024510221555829048, 0.3791723847389221, 0.21266213059425354, 0.008985701948404312, -0.06383238732814789, -0.4248383343219757, -0.21925121545791626, 0.1361091285943985, 0.42455488443374634, -0.2488090991973877, 0.13801543414592743, -0.26506277918815613, -0.22647149860858917, -0.21786734461784363, 0.2305511087179184, 0.0846032127737999, 0.23990187048912048, 0.16223619878292084, 0.10800125449895859, -0.008175112307071686, 0.14751048386096954, 0.48627769947052, -0.1932358592748642, 0.05429741367697716, 0.2996585965156555, 0.16492979228496552, -0.23365184664726257, -0.25680777430534363, -0.06426937878131866, 0.3677104115486145, 0.2520286738872528, 0.0480559840798378, -0.16406972706317902, -0.25760695338249207, 0.06747087836265564, 0.4842403531074524, -0.3237941861152649, -0.2399512380361557, -0.3426917791366577, -0.157888263463974, -0.27823391556739807, -0.598468542098999, -0.1796945035457611, 0.5558480024337769, 0.04802106320858002, 0.13191913068294525, -0.35690397024154663, -0.1760113537311554, 0.1860797256231308, 0.19683484733104706, 0.37241101264953613, 0.20836542546749115, 0.14678052067756653, 0.18246181309223175, 0.14973466098308563, 0.2972790002822876, 0.6599343419075012, 0.05440004914999008, -0.49845534563064575, -0.06407911330461502, 0.09270138293504715, 0.48938167095184326, 0.004817113280296326, -0.23445461690425873, -0.1884659230709076, -0.0068800244480371475, 0.11816322803497314, 0.06058419495820999, 0.19688184559345245, 0.3889077603816986, 0.10527018457651138, -0.37478625774383545, -0.5773130655288696, 0.6049486398696899, 0.1186334639787674, -0.05709207057952881, 0.38416948914527893, 0.287328839302063, -0.36738941073417664, 0.08809401839971542, -0.016834743320941925, 0.7511417269706726, -0.037172868847846985, -0.05132925882935524, 0.15061891078948975, 0.16714097559452057, 0.5651504397392273, 0.020060338079929352, 0.15783371031284332, -0.2375730574131012, -0.1857215166091919, -0.03031674027442932, -0.015289921313524246, 0.22707456350326538, 0.18639490008354187, -0.08168245851993561, 0.44009026885032654, -0.03995119035243988, 0.1871139258146286, 0.01842208206653595, 0.1120414286851883, -0.015062687918543816, -0.19493043422698975, -0.3475910425186157, 0.12321814894676208, 0.01618858426809311, 0.349396288394928, -0.1336735486984253, -0.022385425865650177, -0.15878866612911224, -0.10365036875009537, -0.2655908763408661, 0.04093315452337265, -0.37853488326072693, 0.4121537208557129, -0.018060538917779922, -0.3092395067214966, 0.12730079889297485, 0.6278306841850281, 0.26719266176223755, 0.26569420099258423, -0.29507413506507874, 0.29651740193367004, -0.07448724657297134, -0.3689819276332855, -0.29143214225769043, 0.039517972618341446, 0.10001641511917114, -0.10362124443054199, -0.4345184564590454, 0.2967461347579956, -0.13619083166122437, -0.06474108248949051, 0.17951592803001404, -0.0033983811736106873, 0.30251139402389526, -0.1796722263097763, -0.39427703619003296, 0.047680869698524475, 0.36886635422706604, -0.11781221628189087, 0.13064974546432495, 0.14114642143249512, -0.11348685622215271, 0.11412584036588669, 0.014283500611782074, -0.22417184710502625, -0.012654181569814682, 0.2028750777244568, -0.06703825294971466, -0.09398698061704636, 0.7616826295852661, 0.04455055668950081, 0.0006862655282020569, -0.1292046308517456, 0.25749000906944275, 0.017833949998021126, -0.15278780460357666, -0.15319183468818665, 0.4047706723213196, 0.24982993304729462, 0.11509526520967484, 0.3891364634037018, 0.19793018698692322, -0.12293649464845657, 0.1363481730222702, -0.593527615070343, -0.0758967250585556, 0.1714688241481781, -0.015032000839710236, 0.2014404982328415, -0.10473507642745972, 0.049531884491443634, 0.10774292051792145, -0.016696764156222343, -0.2882113754749298, 0.08653201907873154, -0.11676299571990967, 0.006344109773635864, 0.06970193237066269, 0.13927185535430908, 0.21554668247699738, -0.09497331082820892, 0.1858951598405838, -0.3201778531074524, -0.06945611536502838, -0.21229207515716553, -0.13327562808990479, 0.17726732790470123, 0.009067662060260773, -0.010630369186401367, -0.018680594861507416, -0.2635105848312378, 0.001090914011001587, -0.2290847897529602, 0.24941253662109375, 0.13233953714370728, 0.06731164455413818, 0.03762460872530937, 0.24809487164020538, 0.062456049025058746, -0.26607203483581543, 0.2781783938407898, -0.08941382169723511, 0.20160642266273499, 0.11418789625167847, 0.04573291540145874, 0.06005309894680977, 0.0007531195878982544, 0.18675360083580017, 0.022482961416244507, -0.2468033879995346, 0.008715318515896797, 0.24775120615959167, -0.31758272647857666, 0.23478513956069946, 0.26307517290115356, 0.058320142328739166, 0.49931201338768005, -0.2839150130748749, 0.3272407650947571, 0.3131449818611145, 0.1741950362920761, -0.33500128984451294, -0.23774677515029907, 0.17823344469070435, 0.15253663063049316, 0.02781422808766365, 0.05206770449876785, 0.032520998269319534, -0.250815212726593, -0.2109709233045578, -0.06675070524215698, 0.23015080392360687, 0.059071723371744156, 0.19102369248867035, 0.4239877462387085, 0.0915229469537735, 0.055154938250780106, 0.0016528312116861343, 0.37625783681869507, 0.08911258727312088, 0.20267626643180847, -0.35084211826324463, -0.035226114094257355, -0.07333425432443619, 0.16023588180541992, 0.0074108317494392395, -0.5461677312850952, 0.26542991399765015, -0.08818413317203522, -0.2506747245788574, 0.03237314149737358, -0.19185620546340942, 0.13469059765338898, -0.21552132070064545, 0.2552092969417572, -0.26920488476753235, 0.46989014744758606, -0.032327376306056976, -0.3213339149951935, -0.17355287075042725, -0.16537144780158997, -0.08072999119758606, -0.10816246271133423, 0.08582322299480438, -0.4440498352050781, 0.006996907293796539, 0.10501213371753693, -0.1771358698606491, -0.1621541529893875, 0.07216577231884003, 0.38623759150505066, 0.195025235414505, -0.1969412863254547, 0.18091422319412231, 0.12700136005878448, -0.17211584746837616, 0.2620849311351776, 0.2879147231578827, 0.4772835671901703, 0.34124648571014404, -0.03832884877920151, 0.07661741971969604, 0.10345955193042755, -0.15531963109970093, -0.003197798505425453, 0.04277248680591583, 0.0034674406051635742, 0.07578535377979279, 0.39182132482528687, 0.2273799180984497, -0.14521752297878265, -0.2407308965921402, -0.015039775520563126, 0.21129776537418365, -0.28174111247062683, 0.18746177852153778, -0.10237377882003784, 0.08148796111345291, -0.23125195503234863, 0.20619581639766693, -0.5466786623001099, -0.11359104514122009, 0.39470693469047546, 0.20173379778862, 0.13693669438362122, 0.015580692328512669, 0.08127409219741821, -0.1491156369447708, 0.49813634157180786, 0.28787004947662354, -0.038449764251708984, -0.14528799057006836, -0.17875376343727112, -0.6203943490982056, -0.0834607258439064, -0.1922823041677475, -0.3806682527065277, 0.26143011450767517, -0.04336433857679367, 0.10565552115440369, 0.18338361382484436, 0.1948067545890808, 0.1751808226108551, -0.025341354310512543, 0.05102763697504997, -0.3164636194705963, -0.4029235243797302, 0.04697737097740173, 0.23334211111068726, 0.06648320704698563, -0.2296065390110016, 0.0574420690536499, -0.3506043255329132, 0.005692973732948303, -0.20299576222896576, 0.2015305757522583, 0.20770686864852905, -0.562097430229187, 0.44221943616867065, -0.07833913713693619, 0.5007656216621399, -0.01127891056239605, -0.0984504371881485, -0.3009437024593353, -0.1954440176486969, -0.21398331224918365, 0.4360097348690033, 0.02723982185125351, 0.15925800800323486, -0.3677310347557068, -0.171525776386261, -0.07243821024894714, 0.044496942311525345, 0.09522639214992523, 0.03864496573805809, -0.09087624400854111, -0.051890499889850616, 0.0295102521777153, 0.09661079943180084, 0.3699485957622528, 0.25591787695884705, -0.23560157418251038, 0.1858605444431305, -0.03669266402721405, -0.4080672860145569, 0.5955772399902344, -0.2687828242778778, -0.17701421678066254, -0.08971390873193741, 0.0637713223695755, -0.1075955256819725, 0.29152873158454895, -0.48910993337631226, 0.2416674792766571, 0.5153772830963135, 0.03498968109488487, -0.2697146236896515, 0.10268314182758331, -0.0023329677060246468, 0.0094415582716465, -0.01588374935090542, 0.21979600191116333, -0.1402854025363922, -0.20192110538482666, -0.19920092821121216, -0.08514775335788727 ]
https://github.com/huggingface/datasets/issues/2976
Can't load dataset
Hi, if I want to load the dataset from local file, then how to specify the configuration name?
I'm trying to load a wikitext dataset ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext") ``` ValueError: Config name is missing. Please pick one among the available configs: ['wikitext-103-raw-v1', 'wikitext-2-raw-v1', 'wikitext-103-v1', 'wikitext-2-v1'] Example of usage: `load_dataset('wikitext', 'wikitext-103-raw-v1')`. If I try ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext-2-v1") ``` FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.12.1/datasets/wikitext-2-v1/wikitext-2-v1.py #### Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic (colab) - Python version: 3.7.12 - PyArrow version: 3.0.0
18
Can't load dataset I'm trying to load a wikitext dataset ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext") ``` ValueError: Config name is missing. Please pick one among the available configs: ['wikitext-103-raw-v1', 'wikitext-2-raw-v1', 'wikitext-103-v1', 'wikitext-2-v1'] Example of usage: `load_dataset('wikitext', 'wikitext-103-raw-v1')`. If I try ``` from datasets import load_dataset raw_datasets = load_dataset("wikitext-2-v1") ``` FileNotFoundError: Couldn't find file at https://raw.githubusercontent.com/huggingface/datasets/1.12.1/datasets/wikitext-2-v1/wikitext-2-v1.py #### Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic (colab) - Python version: 3.7.12 - PyArrow version: 3.0.0 Hi, if I want to load the dataset from local file, then how to specify the configuration name?
[ -0.1790257692337036, -0.14016340672969818, -0.03141399472951889, 0.0439901277422905, 0.19588224589824677, 0.3456089496612549, 0.31514009833335876, 0.2401238977909088, 0.26460760831832886, 0.35408836603164673, 0.1479405164718628, 0.3209379315376282, 0.045503921806812286, 0.17291556298732758, 0.18615570664405823, -0.08700564503669739, 0.031504496932029724, 0.22940444946289062, 0.25216615200042725, -0.012005504220724106, -0.2970046103000641, 0.18465429544448853, -0.1309930980205536, 0.27595388889312744, -0.21761156618595123, 0.29783323407173157, 0.02098601497709751, 0.2358623743057251, -0.11908220499753952, -0.4166876971721649, 0.4783937335014343, -0.09134690463542938, 0.21005457639694214, 0.31675583124160767, -0.00011760340566979721, 0.18494267761707306, 0.4055137634277344, -0.22799165546894073, -0.2251514345407486, -0.4156341552734375, -0.47843071818351746, -0.2950551211833954, 0.3423646092414856, -0.2353762984275818, -0.17182359099388123, -0.31720584630966187, 0.3359454572200775, -0.2222452312707901, 0.009264178574085236, 0.17538568377494812, 0.11484766751527786, 0.11075268685817719, 0.12495814263820648, 0.002577311359345913, -0.08367850631475449, -0.08728103339672089, -0.07251260429620743, 0.1714986115694046, 0.2239188402891159, -0.2134082019329071, 0.4866512417793274, -0.054554667323827744, -0.05754917114973068, 0.0006326325237751007, 0.4722762107849121, 0.12984366714954376, -0.03922335058450699, -0.2987325191497803, 0.39256802201271057, 0.468212753534317, 0.6886610984802246, -0.3210509121417999, -0.32198870182037354, -0.13027065992355347, 0.16515055298805237, -0.19598212838172913, 0.38406169414520264, 0.059139005839824677, -0.2988373935222626, 0.2406548410654068, -0.21702741086483002, -0.3556581735610962, -0.1617744266986847, 0.3473007082939148, -0.09770433604717255, 0.5685206651687622, 0.009537535719573498, 0.2652779221534729, -0.08761629462242126, -0.06744948029518127, 0.1541713923215866, -0.2694765627384186, 0.0737890750169754, 0.30440613627433777, -0.355190247297287, 0.3071173131465912, -0.05872907489538193, -0.014960266649723053, -0.07458807528018951, -0.22473187744617462, -0.029945533722639084, -0.1594838798046112, 0.12762852013111115, 0.38340646028518677, 0.11440916359424591, -0.031128892675042152, 0.45667117834091187, 0.13100510835647583, -0.05658362805843353, -0.039840150624513626, 0.03787960484623909, -0.18848678469657898, -0.30194103717803955, -0.3785321116447449, -0.1394292116165161, -0.1719476878643036, 0.07129528373479843, -0.12322200834751129, -0.0368240624666214, -0.0935138463973999, 0.027436017990112305, 0.05596129223704338, 0.18790686130523682, 0.32975634932518005, -0.14534759521484375, 0.23935312032699585, -0.03488051891326904, 0.09218983352184296, -0.022094741463661194, 0.03198887035250664, -0.2254374623298645, 0.049806009978055954, -0.0364840142428875, 0.010251727886497974, -0.013560468330979347, -0.27037113904953003, 0.5426916480064392, -0.09222982823848724, 0.08569347113370895, 0.017298415303230286, -0.20645061135292053, 0.2402109056711197, -0.1608385145664215, 0.42473259568214417, 0.09843643009662628, 0.2792167067527771, 0.2147519737482071, -0.5189277529716492, -0.3000447750091553, 0.08965719491243362, -0.5731366276741028, -0.4135201871395111, -0.2044704258441925, 0.10983395576477051, -0.1899542212486267, -0.16700860857963562, -0.26316311955451965, -0.07585136592388153, 0.12825793027877808, -0.23795060813426971, -0.16381660103797913, -0.101413294672966, -0.07381908595561981, -0.2962189018726349, 0.5168633460998535, 0.2022177278995514, -0.5745839476585388, -0.1633048951625824, -0.10782669484615326, -0.2101982831954956, -0.04095599800348282, -0.1267450898885727, -0.5049468278884888, 0.2801656723022461, -0.13777418434619904, 0.08035430312156677, 0.6450198292732239, -0.5031040906906128, -0.4011228084564209, 0.08308000862598419, -0.08314228057861328, -0.20779334008693695, 0.17791059613227844, -0.0331307016313076, -0.2397398054599762, -0.05951939895749092, 0.2316255420446396, 0.2477169632911682, -0.030787376686930656, -0.03440530225634575, 0.16411815583705902, -0.43677446246147156, 0.022483274340629578, 0.2266332060098648, -0.04573853686451912, -0.08762037009000778, 0.046734489500522614, -0.09535595774650574, 0.33762097358703613, -0.08904768526554108, -0.04844281077384949, 0.3361573815345764, 0.20400789380073547, 0.18933260440826416, -0.06164046749472618, 0.0519169345498085, -0.5186089873313904, 0.4395647943019867, 0.038720861077308655, -0.25679776072502136, -0.08516396582126617, 0.01197996735572815, -0.25209614634513855, 0.12507027387619019, -0.416512131690979, -0.0007117912173271179, 0.012056469917297363, 0.29541417956352234, 0.029537875205278397, -0.09519568085670471, -0.40377333760261536, 0.13405507802963257, -0.1740449219942093, 0.13447731733322144, -0.3172103762626648, 0.08339279145002365, 0.2118890881538391, 0.01456182636320591, -0.07172165811061859, -0.09077338129281998, 0.1086546927690506, -0.01688668131828308, -0.18555015325546265, 0.4453187882900238, 0.11689480394124985, 0.34884822368621826, 0.13940823078155518, -0.05232560634613037, -0.17516227066516876, -0.11881162226200104, 0.001230873167514801, -0.0811881572008133, 0.20719800889492035, -0.021737173199653625, -0.08265521377325058, 0.06680337339639664, 0.06910896301269531, 0.36411553621292114, -0.1927362084388733, 0.011023784056305885, 0.14623892307281494, -0.030004389584064484, -0.02379441261291504, -0.14317408204078674, -0.0018357150256633759, 0.06361927837133408, 0.28354719281196594, -0.012279937043786049, -0.0448259562253952, -0.25613072514533997, 0.365814208984375, 0.11768759787082672, -0.1331499218940735, -0.042461030185222626, -0.19988271594047546, 0.06276673078536987, -0.006927447393536568, 0.12654192745685577, 0.3881967067718506, 0.10021260380744934, -0.22141176462173462, -0.159251406788826, -0.05661047250032425, -0.04579611495137215, 0.2781531810760498, 0.21494044363498688, 0.2938869595527649, 0.12701857089996338, -0.15267902612686157, -0.173741415143013, -0.014219610020518303, -0.1380150467157364, 0.22300106287002563, 0.11562855541706085, -0.19559091329574585, 0.09892823547124863, -0.35095420479774475, 0.1135222390294075, -0.10594157874584198, -0.3698276877403259, -0.31215688586235046, -0.36177054047584534, -0.15099413692951202, -0.08058276772499084, 0.10756056010723114, 0.1559671014547348, -0.24599723517894745, -0.13561438024044037, -0.07332517951726913, -0.6207561492919922, -0.07027096301317215, -0.22635214030742645, -0.2616616189479828, -0.06952348351478577, 0.10052702575922012, 0.0980241671204567, 0.2562132477760315, -0.3939020335674286, -0.10823382437229156, 0.0024950075894594193, -0.02761855348944664, 0.17622560262680054, -0.0516979917883873, 0.47044849395751953, 0.16470380127429962, 0.3979291319847107, -0.18447253108024597, -0.412262886762619, 0.46645602583885193, 0.11140961945056915, -0.07190506160259247, -0.10952679067850113, 0.0667157769203186, -0.1405670940876007, 0.19475390017032623, -0.2728230059146881, -0.4262523353099823, -0.17774632573127747, -0.1128896027803421, -0.016357846558094025, 0.08033031225204468, 0.2894100546836853, 0.13293051719665527, 0.14387694001197815, -0.10037524253129959, 0.09671799093484879, 0.038741882890462875, -0.5646418333053589, 0.34695786237716675, -0.28274887800216675, -0.12806537747383118, 0.10331602394580841, 0.2139717936515808, 0.18607671558856964, 0.08936557173728943, -0.28362947702407837, -0.12587577104568481, 0.015420462004840374, 0.1828237622976303, 0.09326373040676117, 0.3196669816970825, 0.22651754319667816, 0.014382898807525635, 0.15089625120162964, -0.22952771186828613, -0.2604023814201355, 0.08518127351999283, 0.08858925849199295, 0.5214506983757019, 0.37908735871315, 0.25047144293785095, -0.3325671851634979, 0.6841642260551453, 0.23455828428268433, 0.0713401809334755, 0.2677471339702606, -0.346515417098999, 0.1751764714717865, -0.24257498979568481, -0.3823423683643341, 0.2032751739025116, 0.2781628668308258, 0.018864616751670837, 0.4178854823112488, -0.02767011895775795, -0.09997239708900452, -0.4362030029296875, -0.13138717412948608, -0.43383628129959106, -0.29149138927459717, -0.008059855550527573, 0.41182392835617065, 0.23334866762161255, -0.013618389144539833, -0.04811599478125572, -0.3569316267967224, -0.21925953030586243, 0.15360823273658752, 0.6000210046768188, -0.3087816834449768, 0.22830034792423248, -0.3070175349712372, -0.22970764338970184, -0.22780045866966248, 0.14467501640319824, 0.09879077225923538, 0.3710253834724426, 0.11149150133132935, 0.04821467399597168, 0.02706080675125122, 0.16262437403202057, 0.4731541872024536, -0.18610426783561707, 0.10344457626342773, 0.25117334723472595, 0.1406155377626419, -0.16318994760513306, -0.184191033244133, 0.08159871399402618, 0.31106019020080566, 0.1256289929151535, 0.05832955986261368, -0.0654851570725441, -0.368042916059494, 0.03172120824456215, 0.5044386982917786, -0.36934033036231995, -0.28537097573280334, -0.2876361906528473, -0.16607312858104706, -0.1602664291858673, -0.614353358745575, -0.24052777886390686, 0.5316184759140015, 0.27784883975982666, 0.255289763212204, -0.2865651547908783, -0.09769314527511597, 0.205825537443161, 0.20724456012248993, 0.2708563804626465, 0.12440428137779236, 0.08425664901733398, 0.20130105316638947, 0.20867154002189636, 0.29262521862983704, 0.5494728684425354, -0.010079283267259598, -0.4870556592941284, -0.12691545486450195, 0.06426368653774261, 0.5652849078178406, 0.022928349673748016, -0.2504251003265381, -0.18822288513183594, 0.09156154841184616, 0.04231414571404457, 0.07252587378025055, 0.2912616431713104, 0.27755746245384216, 0.02327440306544304, -0.30372345447540283, -0.6306760311126709, 0.6625992655754089, 0.06423585116863251, -0.13111744821071625, 0.4448789954185486, 0.17020246386528015, -0.3886869549751282, 0.08743094652891159, -0.030369460582733154, 0.663597822189331, -0.1302451640367508, -0.027691829949617386, 0.06228417903184891, 0.16479593515396118, 0.40821194648742676, 0.009586896747350693, 0.07332868874073029, -0.2883991599082947, -0.08130409568548203, -0.08090782165527344, -0.0035563893616199493, 0.36039233207702637, 0.25492435693740845, 0.058943312615156174, 0.5108122229576111, -0.012127205729484558, 0.22412900626659393, 0.04448080062866211, 0.10402607917785645, -0.0001813191920518875, -0.25137442350387573, -0.3796047270298004, -0.013319922611117363, -0.09122291207313538, 0.4519633650779724, -0.03489568084478378, -0.020458517596125603, -0.23004885017871857, -0.08569519221782684, -0.1784827709197998, -0.049088526517152786, -0.41582193970680237, 0.24384701251983643, 0.002973373979330063, -0.3600359559059143, -0.05113492161035538, 0.7004879117012024, 0.19710174202919006, 0.3690182566642761, -0.2669347822666168, 0.24236197769641876, -0.0423954576253891, -0.3548419177532196, -0.2156773805618286, 0.14972393214702606, 0.12145574390888214, -0.05227384716272354, -0.3556455969810486, 0.17318633198738098, -0.14940233528614044, -0.1668081283569336, 0.303110808134079, -0.13302184641361237, 0.47181159257888794, -0.129787415266037, -0.5344177484512329, -0.09307250380516052, 0.4240262508392334, -0.02643616311252117, 0.07398111373186111, 0.1256318986415863, -0.12831085920333862, 0.04834556579589844, 0.0399150624871254, -0.29639333486557007, -0.053191523998975754, 0.24460476636886597, -0.142147034406662, -0.16814620792865753, 0.6646053791046143, -0.013596933335065842, 0.06055338680744171, -0.10025575757026672, 0.4143005609512329, 0.11773775517940521, -0.013392671942710876, -0.27397459745407104, 0.5276858806610107, 0.1193474680185318, 0.08958513289690018, 0.3446529507637024, 0.2479517012834549, -0.13542672991752625, 0.03684481605887413, -0.5246529579162598, -0.25046998262405396, 0.11564508080482483, 0.07591031491756439, 0.2615983188152313, 0.04069819301366806, 0.035178299993276596, 0.0923086628317833, -0.17512820661067963, -0.1863652765750885, 0.012073050253093243, -0.1373944878578186, 0.010497145354747772, 0.17118972539901733, 0.3288516104221344, 0.25112491846084595, -0.043770238757133484, 0.13765206933021545, -0.478484570980072, -0.11411568522453308, -0.13195081055164337, -0.2353000044822693, 0.21669764816761017, 0.015267813578248024, 0.053079091012477875, -0.0509490929543972, -0.4472297430038452, -0.06295102834701538, -0.2538013756275177, 0.2793634235858917, 0.14639878273010254, 0.030422907322645187, 0.20801444351673126, 0.348865270614624, 0.005234144628047943, -0.3401321768760681, 0.2915218472480774, -0.07785890996456146, 0.28958117961883545, 0.029358435422182083, 0.05633102357387543, -0.0591263622045517, -0.02428014576435089, 0.13377226889133453, -0.01274319738149643, -0.3169962763786316, 0.06399405002593994, 0.13009479641914368, -0.2399274855852127, 0.23960325121879578, 0.2877422273159027, 0.08019088208675385, 0.46579140424728394, -0.2846159338951111, 0.2787952125072479, 0.455583781003952, 0.07735410332679749, -0.21615725755691528, -0.35847049951553345, 0.3222196400165558, 0.11549494415521622, 0.03762085363268852, 0.13929904997348785, 0.055855926126241684, -0.26094481348991394, -0.20831377804279327, -0.16175100207328796, 0.20095132291316986, 0.1478927582502365, 0.08244749903678894, 0.6088259220123291, 0.1338079571723938, 0.16152320802211761, -0.024865752086043358, 0.5032303929328918, 0.1288796216249466, 0.3438296914100647, -0.26353320479393005, -0.14255496859550476, -0.07281790673732758, 0.17953909933567047, -0.05812215059995651, -0.5376835465431213, 0.2520117163658142, -0.08567704260349274, -0.3349677622318268, 0.08651363849639893, -0.16222956776618958, 0.2163151204586029, -0.1298174113035202, 0.2758239209651947, -0.1972450464963913, 0.3766539990901947, -0.019640237092971802, -0.41939735412597656, -0.2326430380344391, -0.17350098490715027, 0.02892439067363739, -0.02232522703707218, 0.10671138018369675, -0.3629019856452942, 0.005249612033367157, 0.10187516361474991, -0.0067189037799835205, 0.016396205872297287, 0.13247600197792053, 0.2485223114490509, 0.12501436471939087, -0.2308775931596756, 0.16321368515491486, -0.056931957602500916, -0.1190047562122345, 0.24223938584327698, 0.11033690720796585, 0.24485649168491364, 0.34294912219047546, 0.01748787797987461, -0.0402812659740448, 0.12082183361053467, -0.15932057797908783, -0.0510069839656353, -0.10779501497745514, -0.12397769093513489, 0.10644599795341492, 0.4009942412376404, 0.15575221180915833, -0.07121069729328156, -0.25033462047576904, -0.03207335248589516, 0.21138513088226318, -0.21206776797771454, 0.1609964370727539, -0.010664273053407669, 0.02966541051864624, -0.19349129498004913, 0.20294471085071564, -0.5006906986236572, -0.10314270853996277, 0.4217405915260315, 0.25606968998908997, 0.14827504754066467, 0.06678096950054169, 0.007157623767852783, -0.19007769227027893, 0.4763055443763733, 0.2039777785539627, -0.015918642282485962, -0.05772857367992401, -0.2893329858779907, -0.46887636184692383, -0.022650234401226044, -0.05966714397072792, -0.4557436406612396, 0.29747653007507324, -0.0860634446144104, 0.07675857096910477, 0.16807687282562256, 0.11176634579896927, 0.1305333822965622, -0.05828527733683586, 0.20600950717926025, -0.12400753796100616, -0.5191963315010071, -0.032185137271881104, 0.32645732164382935, 0.04593603312969208, -0.2929787337779999, 0.03820285201072693, -0.29838255047798157, -0.06635557115077972, -0.32442694902420044, 0.18366079032421112, 0.3357231914997101, -0.5603229999542236, 0.3831731975078583, -0.20059734582901, 0.4018901288509369, -0.029438989236950874, -0.0071039386093616486, -0.16075970232486725, -0.11042049527168274, -0.2683408856391907, 0.3640601336956024, -0.08915480971336365, 0.20924828946590424, -0.3998584747314453, -0.09373080730438232, -0.1138758584856987, 0.029781533405184746, 0.009890459477901459, 0.024767346680164337, 0.0035203583538532257, -0.1625663936138153, -0.016347814351320267, 0.04890521615743637, 0.3606911301612854, 0.2216695249080658, -0.1482120305299759, 0.1404893398284912, 0.016911543905735016, -0.2952365577220917, 0.6471356153488159, -0.2613033056259155, -0.16839607059955597, -0.037199463695287704, 0.03538472205400467, -0.20706996321678162, 0.23642565310001373, -0.37294790148735046, 0.2713067829608917, 0.48079177737236023, 0.0345415323972702, -0.3098043203353882, 0.09577669203281403, -0.024335861206054688, 0.09172743558883667, 0.011248376220464706, 0.16821402311325073, -0.1261395514011383, -0.18093915283679962, -0.3536892533302307, -0.14864715933799744 ]
https://github.com/huggingface/datasets/issues/2972
OSError: Not enough disk space.
Maybe we can change the disk space calculating API from `shutil.disk_usage` to `os.statvfs` in UNIX-like system, which can provide correct results. ``` statvfs = os.statvfs('path') avail_space_bytes = statvfs.f_frsize * statvfs.f_bavail ```
## Describe the bug I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space. The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available: ``` / /mnt/sda1/path/to/args.dataset_cache_dir ``` ## Steps to reproduce the bug ```python dataset_config = DownloadConfig( cache_dir=os.path.abspath(args.dataset_cache_dir), resume_download=True, ) dataset = load_dataset("natural_questions", download_config=dataset_config) ``` ## Expected results Can download the dataset without an error. ## Actual results The following error raised: ``` OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.9.0 - Platform: Ubuntu 18.04 - Python version: 3.8.10 - PyArrow version:
31
OSError: Not enough disk space. ## Describe the bug I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space. The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available: ``` / /mnt/sda1/path/to/args.dataset_cache_dir ``` ## Steps to reproduce the bug ```python dataset_config = DownloadConfig( cache_dir=os.path.abspath(args.dataset_cache_dir), resume_download=True, ) dataset = load_dataset("natural_questions", download_config=dataset_config) ``` ## Expected results Can download the dataset without an error. ## Actual results The following error raised: ``` OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.9.0 - Platform: Ubuntu 18.04 - Python version: 3.8.10 - PyArrow version: Maybe we can change the disk space calculating API from `shutil.disk_usage` to `os.statvfs` in UNIX-like system, which can provide correct results. ``` statvfs = os.statvfs('path') avail_space_bytes = statvfs.f_frsize * statvfs.f_bavail ```
[ -0.04831197112798691, -0.2650129199028015, -0.1014164388179779, 0.4828662872314453, 0.07751820981502533, 0.12542834877967834, -0.2298763543367386, 0.4518800675868988, 0.30695170164108276, 0.24537411332130432, 0.07815026491880417, -0.3200189769268036, -0.04923137277364731, -0.33118313550949097, 0.06274455785751343, 0.14334242045879364, 0.04436127096414566, -0.012637272477149963, 0.2707398533821106, 0.03786315768957138, -0.2826901078224182, 0.24431553483009338, -0.22589193284511566, -0.32270699739456177, -0.22429712116718292, 0.1010245829820633, -0.2902759313583374, 0.21546491980552673, -0.041123054921627045, -0.31557589769363403, 0.40279442071914673, -0.08417579531669617, 0.08403495699167252, 0.6931696534156799, -0.00012272136518731713, -0.15558269619941711, 0.08624887466430664, -0.16325557231903076, -0.5597650408744812, -0.20083443820476532, 0.1888253390789032, -0.6115399599075317, -0.07504966855049133, -0.3282054364681244, 0.07434746623039246, -0.016043152660131454, 0.06572580337524414, -0.47293031215667725, 0.03752175718545914, 0.27353429794311523, 0.13342885673046112, -0.029497722163796425, 0.19584564864635468, 0.02854650467634201, 0.1346614956855774, 0.23819074034690857, 0.06635422259569168, 0.6081161499023438, 0.22687356173992157, 0.15765832364559174, 0.18576718866825104, 0.12666408717632294, 0.041256390511989594, 0.29060792922973633, 0.32195064425468445, 0.13408784568309784, 0.02253061905503273, -0.25205522775650024, 0.10951441526412964, 0.01551927998661995, 0.5439797639846802, -0.3082554340362549, -0.39405277371406555, -0.4138248562812805, 0.03339508920907974, -0.2799569368362427, 0.31404194235801697, 0.23015205562114716, -0.5507554411888123, 0.022360367700457573, -0.16461943089962006, -0.3364183306694031, -0.05276012420654297, 0.21725834906101227, -0.038770467042922974, 0.13433775305747986, -0.16876132786273956, 0.11599741876125336, 0.2244086116552353, 0.07653038948774338, 0.18906649947166443, -0.2965511083602905, 0.18791377544403076, 0.1297444850206375, -0.44017791748046875, -0.11096829175949097, -0.016848787665367126, 0.14093564450740814, 0.15925520658493042, 0.053314536809921265, -0.24793802201747894, -0.25598248839378357, -0.26167771220207214, -0.08113608509302139, 0.17457978427410126, 0.4847317337989807, -0.3060128688812256, 0.18691296875476837, 0.004968389868736267, 0.14196108281612396, 0.02602710947394371, -0.24617832899093628, 0.14553479850292206, -0.30839669704437256, 0.221354141831398, -0.2205415964126587, 0.2423897534608841, -0.1568434238433838, -0.19781816005706787, 0.08161390572786331, -0.05698477476835251, 0.0895368754863739, 0.15810377895832062, 0.2711420953273773, -0.11240827292203903, 0.23331627249717712, 0.33394116163253784, 0.394367516040802, -0.08162732422351837, 0.14222067594528198, -0.10949738323688507, 0.07538315653800964, 0.005584783852100372, -0.050160348415374756, 0.1430170238018036, 0.00999150238931179, 0.14180150628089905, 0.029467083513736725, 0.1587929129600525, -0.24611973762512207, -0.06722398847341537, -0.4152611494064331, 0.027909688651561737, 0.389647901058197, 0.1615675985813141, 0.1737033724784851, 0.18695466220378876, 0.14756304025650024, -0.1396171897649765, 0.42220601439476013, -0.370859831571579, -0.22547341883182526, -0.14477843046188354, 0.0746019035577774, -0.32825714349746704, -0.09700073301792145, -0.32113203406333923, -0.2398504763841629, 0.33869245648384094, -0.23686231672763824, 0.1199309378862381, -0.06822743266820908, -0.22444812953472137, -0.15328103303909302, 0.19493645429611206, 0.4025301933288574, -0.05042346566915512, 0.22453346848487854, -0.4339044988155365, 0.298155277967453, 0.18735915422439575, 0.3178591728210449, 0.09894335269927979, 0.3977372944355011, -0.6145941019058228, 0.2145385593175888, 0.2425822615623474, -0.3106395900249481, -0.6953368782997131, 0.21758873760700226, -0.05479022115468979, 0.06365793943405151, 0.08321432769298553, 0.24634337425231934, -0.10718748718500137, -0.010976419784128666, -0.069035604596138, 0.11442981660366058, -0.06097853183746338, -0.06387756019830704, -0.4297260642051697, -0.14115580916404724, 0.11255084723234177, 0.1543644219636917, 0.2233881950378418, -0.04372083395719528, 0.012773670256137848, 0.029970701783895493, 0.327656626701355, 0.2048540562391281, 0.20488791167736053, 0.3353889584541321, 0.4992455542087555, -0.06545057892799377, -0.04298067465424538, -0.2636958956718445, -0.3488047420978546, 0.32051560282707214, 0.13134944438934326, -0.0754329115152359, -0.2659981846809387, 0.08857252448797226, -0.36401551961898804, 0.07437194138765335, 0.07844920456409454, -0.03639962151646614, -0.024008184671401978, 0.1717926561832428, 0.135128915309906, -0.1531064659357071, -0.08287730813026428, 0.11655621230602264, -0.18225149810314178, 0.09915796667337418, -0.08478710055351257, 0.35937267541885376, -0.13609595596790314, -0.026885785162448883, -0.24661581218242645, -0.04201880097389221, 0.1175990104675293, 0.04479488730430603, -0.2857837677001953, 0.45979928970336914, 0.098081573843956, -0.2837492823600769, 0.18169847130775452, -0.0013551115989685059, 0.2244536578655243, -0.03087226301431656, 0.153126060962677, 0.2797999083995819, 0.16401320695877075, 0.15227282047271729, -0.2192898690700531, -0.2408362478017807, 0.011415576562285423, 0.09123865514993668, -0.226664736866951, 0.07256411761045456, 0.3409914970397949, -0.0699843019247055, 0.389864444732666, 0.011901192367076874, 0.29744333028793335, -0.1528409868478775, 0.32810014486312866, -0.17780430614948273, 0.41560098528862, -0.0025714486837387085, 0.17228484153747559, 0.01114257425069809, 0.2959088087081909, 0.42369702458381653, 0.056309618055820465, -0.2051934003829956, -0.10299118608236313, 0.31392693519592285, 0.6357458829879761, 0.1418750286102295, 0.1012348160147667, -0.15710730850696564, 0.3621194064617157, -0.1422179490327835, 0.2960793673992157, -0.028650909662246704, -0.17252470552921295, 0.21156567335128784, -0.11894816905260086, -0.0454106479883194, 0.02182341367006302, -0.4014761447906494, 0.1147884950041771, 0.3954370319843292, -0.294167160987854, -0.2452557235956192, -0.09022970497608185, 0.07541713863611221, 0.09766419231891632, -0.08779805898666382, -0.17131797969341278, -0.2449697107076645, -0.06285882741212845, 0.30137020349502563, -0.07067041099071503, -0.19892609119415283, -0.22045660018920898, 0.09968000650405884, 0.25195029377937317, -0.42792633175849915, -0.005724906921386719, 0.20273981988430023, -0.0869455561041832, -0.05792626366019249, 0.18622443079948425, -0.2343982756137848, 0.20641419291496277, -0.21798092126846313, 0.08281087130308151, -0.3807500898838043, -0.003638729453086853, -0.05441914498806, 0.14215564727783203, 0.255133718252182, 0.028526030480861664, 0.46762609481811523, -0.09783673286437988, 0.14905299246311188, 0.009540107101202011, -0.049929410219192505, -0.16113629937171936, 0.047801002860069275, 0.22768571972846985, -0.02347376011312008, -0.35401651263237, -0.1641823947429657, -0.3538466989994049, -0.4644949734210968, -0.06991787254810333, -0.054402485489845276, 0.2067488580942154, 0.19659335911273956, 0.25878986716270447, -0.04225709289312363, 0.12190604954957962, 0.02173810638487339, -0.23719464242458344, -0.4583796262741089, 0.12671081721782684, 0.19985370337963104, -0.03795786574482918, 0.10027121007442474, -0.03305498883128166, -0.08693185448646545, 0.2507910132408142, -0.7376924753189087, -0.2579147517681122, -0.26822429895401, 0.5005319714546204, -0.15733376145362854, 0.1762368232011795, 0.4086500108242035, -0.4275275766849518, 0.046405114233493805, -0.09022538363933563, -0.23748250305652618, -0.20781171321868896, 0.23598060011863708, 0.47370201349258423, 0.07639531046152115, 0.1733408272266388, 0.08040720224380493, 0.44343554973602295, -0.043696265667676926, 0.3275304436683655, 0.5047436356544495, 0.0264634620398283, 0.6254557371139526, -0.06800184398889542, -0.08005612343549728, 0.10047654807567596, 0.20706765353679657, -0.437852680683136, 0.36272531747817993, 0.21043619513511658, 0.16269917786121368, -0.0018118694424629211, -0.19550175964832306, -0.39429259300231934, -0.20115792751312256, 0.2588355541229248, -0.25172024965286255, 0.16566577553749084, -0.007559735327959061, -0.09613090753555298, -0.10620300471782684, -0.1579812467098236, -0.25548186898231506, 0.2279336303472519, 0.2521201968193054, 0.04420890286564827, -0.17090781033039093, -0.004727554507553577, -0.1301071047782898, 0.27922046184539795, -0.0017962384736165404, 0.036969177424907684, -0.17038579285144806, 0.11076872795820236, 0.03319665044546127, 0.0832858458161354, 0.6368327140808105, 0.051562100648880005, 0.21560843288898468, -0.19852755963802338, -0.0027121752500534058, -0.4998669922351837, 0.004329085350036621, 0.12852530181407928, 0.07186304032802582, 0.15892153978347778, 0.5090212225914001, -0.3377815783023834, 0.10937794297933578, -0.28197675943374634, 0.4086593687534332, -0.13538393378257751, -0.368836373090744, -0.07037803530693054, -0.4815615713596344, -0.21786615252494812, 0.09121078997850418, 0.19567252695560455, 0.21490415930747986, 0.4469938278198242, 0.04993974044919014, -0.037809886038303375, -0.16892176866531372, 0.037081629037857056, -0.27846193313598633, 0.5888819694519043, -0.06231634318828583, 0.08563616871833801, 0.06030311807990074, -0.23478630185127258, 0.2622171640396118, 0.4774390757083893, -0.09206640720367432, 0.17408573627471924, 0.3183937668800354, 0.11135263741016388, -0.0280768945813179, 0.23272374272346497, -0.14588333666324615, -0.19237414002418518, 0.12133195996284485, 0.4207555651664734, -0.10622803121805191, 0.0463729202747345, -0.22830738127231598, 0.1695416122674942, 0.23416927456855774, -0.2571067810058594, 0.3293481469154358, 0.024061918258666992, 0.10388609766960144, 0.05969935283064842, 0.17596817016601562, -0.18079417943954468, 0.10313723236322403, -0.1651991605758667, 0.8654060959815979, 0.0658620148897171, -0.023033302277326584, 0.32774239778518677, -0.2098885178565979, 0.3522985279560089, -0.39773935079574585, 0.1217622458934784, -0.03923626244068146, -0.2899872064590454, 0.046266838908195496, -0.06941007077693939, -0.2026306688785553, -0.013272672891616821, -0.08767484128475189, 0.3195587992668152, -0.250895619392395, 0.19513414800167084, 0.10035669803619385, 0.07778377830982208, -0.2944265305995941, -0.1617213934659958, -0.3658435344696045, 0.16986210644245148, -0.2835994362831116, 0.4821454882621765, -0.11260877549648285, 0.12744972109794617, -0.322964608669281, -0.1436934620141983, -0.2876208424568176, -0.04765048250555992, -0.034268006682395935, 0.166705921292305, -0.10124318301677704, -0.04377308487892151, -0.2588791251182556, 0.4842817485332489, 0.0502246655523777, 0.3271511495113373, -0.24088236689567566, 0.13632184267044067, -0.12802371382713318, 0.15629269182682037, 0.3486752510070801, 0.052277445793151855, -0.008310338482260704, -0.10354053229093552, -0.24519303441047668, -0.21236762404441833, -0.2722243368625641, -0.5032943487167358, 0.15338671207427979, 0.11961886286735535, -0.006585940718650818, -0.1512834131717682, -0.5518782734870911, -0.2867548167705536, 0.11445076763629913, -0.07337573170661926, 0.038627516478300095, 0.2638682723045349, -0.23009344935417175, 0.20244339108467102, -0.1681140512228012, -0.41256821155548096, -0.10961933434009552, 0.12263156473636627, 0.1393333077430725, -0.07397665083408356, 0.43487998843193054, -0.2101578563451767, 0.06517721712589264, -0.12864810228347778, 0.032671019434928894, -0.2244277000427246, -0.251948744058609, 0.45541566610336304, -0.09299349039793015, 0.046875759959220886, -0.3670508563518524, -0.46985408663749695, 0.5868710875511169, 0.1128096878528595, -0.04486759006977081, -0.6585410237312317, -0.2265813648700714, 0.04960961267352104, 0.018014203757047653, 0.1488926112651825, -0.1936667263507843, -0.30746492743492126, 0.28257545828819275, -0.32766076922416687, -0.1938677728176117, 0.19028261303901672, -0.1227429211139679, 0.04820629954338074, 0.13525551557540894, -0.08824316412210464, 0.34259334206581116, -0.30904701352119446, -0.029643405228853226, -0.09483189880847931, 0.0026373770087957382, -0.13454167544841766, -0.01998639665544033, 0.1347736269235611, 0.13155215978622437, -0.057689204812049866, 0.08218591660261154, -0.5818271636962891, 0.05691470950841904, -0.2817126214504242, -0.24036121368408203, 0.1778777539730072, -0.033995695412158966, -0.22939251363277435, 0.16687355935573578, 0.09281887114048004, -0.40351545810699463, 0.4266115128993988, -0.06245313584804535, 0.29168105125427246, 0.02548990026116371, 0.20480284094810486, 0.09517372399568558, 0.11993598937988281, -0.34123578667640686, -0.12617552280426025, 0.08208747208118439, -0.06322410702705383, 0.15419597923755646, -0.027293764054775238, 0.07796218991279602, 0.363454133272171, 0.5039762258529663, 0.1214459091424942, -0.1699381172657013, -0.008089369162917137, 0.1316845715045929, 0.16366377472877502, -0.1862405389547348, 0.05884535238146782, 0.06689642369747162, 0.17529913783073425, -0.1237332671880722, 0.30550748109817505, -0.028974005952477455, -0.3955938220024109, 0.07406402379274368, 0.2203948199748993, 0.5564835667610168, 0.04163074865937233, 0.019266560673713684, 0.37602338194847107, -0.12306636571884155, 0.18026092648506165, 0.3516260087490082, -0.10426180064678192, 0.08511412888765335, 0.5179889798164368, -0.259784072637558, 0.18315790593624115, 0.24193733930587769, -0.1122877448797226, -0.28914377093315125, -0.23188398778438568, 0.08835694193840027, 0.2540714740753174, 0.00727110356092453, -0.039215728640556335, -0.1846592128276825, 0.03896770253777504, -0.38202202320098877, -0.08767437189817429, -0.18518801033496857, -0.06383495032787323, -0.3673771917819977, 0.23080603778362274, 0.18679817020893097, -0.05884137004613876, 0.0392843633890152, -0.0924089103937149, 0.10684724152088165, -0.5083126425743103, 0.05861114338040352, 0.1527000367641449, -0.38664740324020386, -0.08521737158298492, 0.009723203256726265, 0.5511574149131775, -0.0749092623591423, -0.4049074053764343, 0.24020105600357056, 0.37086021900177, -0.229170560836792, 0.1033058613538742, 0.3977973461151123, 0.5132105350494385, 0.3508318066596985, -0.1473897248506546, 0.010156050324440002, 0.2588629126548767, 0.029668940231204033, -0.25616690516471863, 0.02151522971689701, 0.04710696265101433, 0.42114752531051636, 0.15899153053760529, 0.14952385425567627, -0.16550616919994354, 0.5278847217559814, 0.06977961957454681, 0.3867054283618927, -0.17339643836021423, 0.03437613695859909, -0.2697329521179199, -0.014885034412145615, -0.16892023384571075, -0.06216958910226822, -0.20489883422851562, -0.31353938579559326, 0.10309585928916931, -0.1371677815914154, 0.14537814259529114, 0.08240504562854767, 0.03228455036878586, -0.2855895459651947, -0.014882747083902359, 0.4927411675453186, -0.41101783514022827, -0.41962626576423645, 0.032449960708618164, -0.7017518877983093, 0.03556375205516815, -0.22783219814300537, -0.33368340134620667, -0.06058080494403839, 0.27977249026298523, -0.1336509883403778, 0.0267765074968338, 0.11296038329601288, 0.08925554901361465, -0.004675643518567085, 0.006544921547174454, -0.3015066087245941, -0.3817577064037323, -0.054805055260658264, 0.10383465141057968, 0.27620595693588257, -0.5052751898765564, -0.007212359458208084, -0.30374059081077576, -0.02813933603465557, 0.2685026526451111, -0.02138075977563858, 0.1372171938419342, 0.18410949409008026, 0.4018891155719757, 0.03194846212863922, 0.3679739832878113, 0.02517792209982872, -0.12276869267225266, -0.18629564344882965, 0.04293547943234444, -0.1658332645893097, 0.05846015363931656, 0.07195782661437988, 0.5951919555664062, -0.510204017162323, 0.00002288818359375, -0.11024881899356842, 0.003995565697550774, 0.12357713282108307, -0.2071523219347, 0.1574782431125641, 0.051084719598293304, -0.12481025606393814, 0.1628292202949524, 0.3674360513687134, -0.0070440880954265594, -0.1795450747013092, 0.2905243933200836, -0.2866477370262146, -0.22700777649879456, 0.27810198068618774, 0.15505126118659973, -0.23152868449687958, -0.010324264876544476, 0.4020593464374542, 0.17543533444404602, -0.16531658172607422, -0.14174515008926392, 0.00803712010383606, 0.4412444233894348, 0.1576640009880066, -0.19551070034503937, 0.040166232734918594, -0.2997497320175171, -0.009221155196428299, 0.3547826409339905, 0.6396321058273315, 0.031159238889813423, -0.28395408391952515, 0.22932389378547668, -0.06786110997200012 ]
https://github.com/huggingface/datasets/issues/2972
OSError: Not enough disk space.
`DownloadConfig` only sets the location to download the files. On the other hand, `cache_dir` sets the location for both downloading and caching the data. You can find more information here: https://huggingface.co/docs/datasets/loading_datasets.html#cache-directory
## Describe the bug I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space. The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available: ``` / /mnt/sda1/path/to/args.dataset_cache_dir ``` ## Steps to reproduce the bug ```python dataset_config = DownloadConfig( cache_dir=os.path.abspath(args.dataset_cache_dir), resume_download=True, ) dataset = load_dataset("natural_questions", download_config=dataset_config) ``` ## Expected results Can download the dataset without an error. ## Actual results The following error raised: ``` OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.9.0 - Platform: Ubuntu 18.04 - Python version: 3.8.10 - PyArrow version:
31
OSError: Not enough disk space. ## Describe the bug I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space. The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available: ``` / /mnt/sda1/path/to/args.dataset_cache_dir ``` ## Steps to reproduce the bug ```python dataset_config = DownloadConfig( cache_dir=os.path.abspath(args.dataset_cache_dir), resume_download=True, ) dataset = load_dataset("natural_questions", download_config=dataset_config) ``` ## Expected results Can download the dataset without an error. ## Actual results The following error raised: ``` OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.9.0 - Platform: Ubuntu 18.04 - Python version: 3.8.10 - PyArrow version: `DownloadConfig` only sets the location to download the files. On the other hand, `cache_dir` sets the location for both downloading and caching the data. You can find more information here: https://huggingface.co/docs/datasets/loading_datasets.html#cache-directory
[ -0.0635232999920845, -0.2830466032028198, -0.08851612359285355, 0.4970603585243225, 0.08797203004360199, 0.18643397092819214, -0.179883673787117, 0.4213721454143524, 0.2735774517059326, 0.233210951089859, 0.04686398059129715, -0.3344707190990448, -0.040360432118177414, -0.30256322026252747, 0.09096087515354156, 0.0889555811882019, 0.04198132082819939, 0.035653434693813324, 0.27709347009658813, 0.07952889800071716, -0.2876852750778198, 0.2624313235282898, -0.2058115452528, -0.2824217677116394, -0.2445371448993683, 0.08743255585432053, -0.28640687465667725, 0.2500258684158325, -0.04780077934265137, -0.31735149025917053, 0.48378539085388184, -0.11427976191043854, 0.11303125321865082, 0.6810322999954224, -0.00012287517893128097, -0.11069236695766449, 0.130017951130867, -0.16631737351417542, -0.5987585783004761, -0.19932501018047333, 0.06720871478319168, -0.5795093178749084, -0.05622349679470062, -0.2680235505104065, 0.06656818836927414, 0.062479857355356216, 0.08903493732213974, -0.41900405287742615, 0.06002979353070259, 0.26042094826698303, 0.12406748533248901, 0.07056663930416107, 0.1978163868188858, 0.0219348706305027, 0.13230443000793457, 0.2642109990119934, 0.017882129177451134, 0.5894096493721008, 0.2349642962217331, 0.19237831234931946, 0.17499980330467224, 0.1309753656387329, 0.013833342120051384, 0.3019687235355377, 0.33258625864982605, 0.11700225621461868, 0.03670427203178406, -0.2519947588443756, 0.11771493405103683, 0.022453222423791885, 0.5822771787643433, -0.35586386919021606, -0.4414694607257843, -0.44372501969337463, 0.0059302570298314095, -0.2740188539028168, 0.35927873849868774, 0.21212056279182434, -0.49137476086616516, 0.07186724990606308, -0.20013584196567535, -0.39717116951942444, -0.05255694314837456, 0.250421404838562, -0.08732248097658157, 0.10871326178312302, -0.19143961369991302, 0.09108671545982361, 0.23666207492351532, 0.10399984568357468, 0.21036039292812347, -0.2841472327709198, 0.17972926795482635, 0.12821972370147705, -0.4327700734138489, -0.050638530403375626, -0.022289469838142395, 0.24595999717712402, 0.17341554164886475, 0.08296144753694534, -0.19229824841022491, -0.23175287246704102, -0.22555290162563324, -0.07011900097131729, 0.19751210510730743, 0.5353707671165466, -0.29562854766845703, 0.15363995730876923, -0.0018687620759010315, 0.15434600412845612, 0.03699169680476189, -0.2411973774433136, 0.1252182573080063, -0.24644483625888824, 0.2199292927980423, -0.2739790976047516, 0.28968578577041626, -0.12575964629650116, -0.20841550827026367, 0.042355574667453766, -0.031869225203990936, 0.05081300437450409, 0.15190812945365906, 0.31328412890434265, -0.08767229318618774, 0.2727208435535431, 0.29217517375946045, 0.45452171564102173, -0.09485267847776413, 0.12523040175437927, -0.1412675529718399, 0.048429474234580994, -0.0014128275215625763, 0.05230873078107834, 0.16221098601818085, -0.03747816011309624, 0.1862364262342453, 0.03968687728047371, 0.2253505438566208, -0.19934333860874176, -0.09069734066724777, -0.3640325367450714, -0.010501869022846222, 0.40117257833480835, 0.12250268459320068, 0.26000645756721497, 0.1426280438899994, 0.08733053505420685, -0.13234713673591614, 0.3872964084148407, -0.3691613972187042, -0.2355872094631195, -0.1481737643480301, 0.05755942314863205, -0.3133731484413147, -0.07062026113271713, -0.38596275448799133, -0.2532053291797638, 0.43360409140586853, -0.235128715634346, 0.16425877809524536, -0.045001983642578125, -0.22032083570957184, -0.16820545494556427, 0.19174359738826752, 0.48264163732528687, -0.04055609554052353, 0.1455831676721573, -0.39124196767807007, 0.3041977882385254, 0.13952217996120453, 0.3218921720981598, 0.027489451691508293, 0.4158931374549866, -0.6230334639549255, 0.16192354261875153, 0.2286597192287445, -0.3694983720779419, -0.7299064993858337, 0.20086751878261566, -0.0774620845913887, 0.11582548171281815, 0.10444740951061249, 0.18814295530319214, -0.15451878309249878, 0.01883617974817753, -0.07764910161495209, 0.11565417796373367, -0.0520380437374115, -0.044589024037122726, -0.40458348393440247, -0.16712114214897156, 0.07548005878925323, 0.15572042763233185, 0.1597130447626114, -0.010454751551151276, -0.08274715393781662, 0.03701472282409668, 0.3118737041950226, 0.17926913499832153, 0.21684087812900543, 0.35944700241088867, 0.38916078209877014, -0.03743254393339157, -0.08423160016536713, -0.19962528347969055, -0.46551191806793213, 0.35535457730293274, 0.10881878435611725, -0.06784498691558838, -0.29299551248550415, 0.10534623265266418, -0.38549894094467163, 0.09365175664424896, 0.011740215122699738, -0.06573541462421417, -0.04983595758676529, 0.22123728692531586, 0.20676366984844208, -0.10317595303058624, -0.1153085008263588, 0.2549060881137848, -0.14136020839214325, 0.12100010365247726, -0.196658194065094, 0.34923872351646423, -0.1703709214925766, -0.03194313496351242, -0.2959097623825073, -0.09749136120080948, 0.0660770833492279, -0.009697200730443, -0.23767679929733276, 0.4450169503688812, 0.05707905441522598, -0.27323204278945923, 0.0839804857969284, 0.0521383136510849, 0.24544855952262878, -0.04853751137852669, 0.15065762400627136, 0.2443731129169464, 0.14747776091098785, 0.11986150592565536, -0.18351733684539795, -0.2291077822446823, 0.05830147862434387, 0.11870814114809036, -0.2436077743768692, 0.026519624516367912, 0.2993578612804413, -0.06556977331638336, 0.33391648530960083, 0.017347589135169983, 0.2688307762145996, -0.18575923144817352, 0.38633161783218384, -0.12707629799842834, 0.376184344291687, 0.026967935264110565, 0.18993347883224487, 0.03651341423392296, 0.2688366174697876, 0.39340662956237793, 0.057695742696523666, -0.20312854647636414, -0.11237774789333344, 0.3540521264076233, 0.6171277761459351, 0.12322292476892471, 0.11104926466941833, -0.14405713975429535, 0.34993740916252136, -0.14384552836418152, 0.2074882984161377, -0.012414254248142242, -0.17299364507198334, 0.16472885012626648, -0.09009743481874466, -0.038208696991205215, 0.05098709464073181, -0.35790175199508667, 0.1176409050822258, 0.361683189868927, -0.31544241309165955, -0.13129568099975586, -0.06720801442861557, 0.0020318925380706787, 0.07738732546567917, -0.06767939031124115, -0.20151931047439575, -0.21302558481693268, -0.08236292749643326, 0.33427926898002625, -0.0011189021170139313, -0.18107768893241882, -0.2875175178050995, 0.12745733559131622, 0.21039171516895294, -0.4946579337120056, -0.07521282136440277, 0.2515455484390259, -0.12514272332191467, -0.07909932732582092, 0.21979570388793945, -0.2577577829360962, 0.14808039367198944, -0.2777005136013031, 0.10491349548101425, -0.3337099552154541, 0.07040173560380936, -0.07028254121541977, 0.17746557295322418, 0.23145326972007751, 0.002106964588165283, 0.5112782120704651, -0.16175971925258636, 0.07345827668905258, 0.06988581269979477, -0.02460663951933384, -0.18115179240703583, 0.016641296446323395, 0.26825323700904846, 0.032746486365795135, -0.294933021068573, -0.1357981264591217, -0.3509218394756317, -0.4543665051460266, -0.00916338711977005, -0.14198385179042816, 0.1832490861415863, 0.21869082748889923, 0.2438652515411377, -0.04415088891983032, 0.03730420395731926, 0.027710285037755966, -0.2316313236951828, -0.5477308630943298, 0.11271455883979797, 0.18704119324684143, -0.03105437383055687, 0.07689248025417328, -0.03674183785915375, 0.010541185736656189, 0.2669087052345276, -0.7017438411712646, -0.23446638882160187, -0.31110355257987976, 0.5713159441947937, -0.17600692808628082, 0.14789527654647827, 0.45068827271461487, -0.37629321217536926, 0.05941406637430191, -0.07618099451065063, -0.27972185611724854, -0.2243179976940155, 0.24439233541488647, 0.4906613230705261, 0.05587641894817352, 0.14756344258785248, -0.003927882760763168, 0.495521605014801, -0.06671695411205292, 0.2920241057872772, 0.548112154006958, 0.04299929738044739, 0.6437493562698364, -0.12480992823839188, -0.11524207144975662, 0.08664032816886902, 0.18954239785671234, -0.4540831446647644, 0.36073219776153564, 0.21782562136650085, 0.12193811684846878, -0.04781581833958626, -0.1367582380771637, -0.3673306703567505, -0.1769752949476242, 0.28211015462875366, -0.20627552270889282, 0.14945052564144135, -0.014050189405679703, -0.05807940289378166, -0.061751171946525574, -0.14196079969406128, -0.2151966094970703, 0.2279779464006424, 0.24402877688407898, 0.09520304203033447, -0.14958256483078003, -0.047709546983242035, -0.19359353184700012, 0.23743516206741333, 0.0683976262807846, 0.0704100951552391, -0.16130495071411133, 0.11275031417608261, 0.043286487460136414, 0.08920694887638092, 0.7158551812171936, 0.043890438973903656, 0.19162704050540924, -0.16871169209480286, -0.012980148196220398, -0.5206157565116882, 0.011965516954660416, 0.1747640073299408, 0.09804785251617432, 0.12645412981510162, 0.4594999849796295, -0.3484446406364441, 0.11786743998527527, -0.3627839684486389, 0.44568631052970886, -0.12484794855117798, -0.33300670981407166, -0.10485608875751495, -0.48608407378196716, -0.20301002264022827, 0.09244775027036667, 0.22478298842906952, 0.18639534711837769, 0.4579351842403412, 0.08139212429523468, -0.029214775189757347, -0.10582031309604645, 0.0015018656849861145, -0.24768178164958954, 0.5448782444000244, -0.060346584767103195, 0.0430002398788929, 0.09807996451854706, -0.23812651634216309, 0.28797996044158936, 0.5223559141159058, -0.14712657034397125, 0.13348379731178284, 0.2608725428581238, 0.18883143365383148, -0.051394976675510406, 0.23333263397216797, -0.10823433101177216, -0.20563694834709167, 0.14649233222007751, 0.3445829153060913, -0.12843678891658783, 0.10545658320188522, -0.212916761636734, 0.1273805946111679, 0.15573731064796448, -0.2978208661079407, 0.3727850019931793, 0.04640001431107521, 0.11808693408966064, 0.12635041773319244, 0.22603864967823029, -0.20142890512943268, 0.07813143730163574, -0.25090497732162476, 0.8570865988731384, -0.011798493564128876, 0.02361413463950157, 0.3388333022594452, -0.24095813930034637, 0.37650740146636963, -0.3816726803779602, 0.1610531508922577, 0.006766419857740402, -0.2884810268878937, 0.02654784359037876, -0.10303431749343872, -0.239068865776062, 0.03870480880141258, -0.10632719099521637, 0.3153071701526642, -0.32397058606147766, 0.17003139853477478, 0.08313168585300446, 0.04339878261089325, -0.2849521040916443, -0.16733099520206451, -0.39681747555732727, 0.1562783420085907, -0.30999457836151123, 0.49754980206489563, -0.12557777762413025, 0.12201675772666931, -0.347718209028244, -0.14682672917842865, -0.3024466037750244, -0.04049738496541977, -0.0772220566868782, 0.10836346447467804, -0.10007396340370178, -0.11727191507816315, -0.221860870718956, 0.45846763253211975, 0.0492347776889801, 0.22840668261051178, -0.27243557572364807, 0.12427288293838501, -0.14291128516197205, 0.13593468070030212, 0.28117692470550537, -0.0020943135023117065, 0.017526935786008835, -0.0647728219628334, -0.2070116400718689, -0.18217960000038147, -0.28590208292007446, -0.46293795108795166, 0.18520912528038025, 0.14340364933013916, -0.025154195725917816, -0.1834619790315628, -0.4924830496311188, -0.31670141220092773, 0.19486789405345917, -0.0950763076543808, 0.032309211790561676, 0.28078824281692505, -0.21584424376487732, 0.1216266080737114, -0.18366290628910065, -0.3860013484954834, -0.09664501249790192, 0.2046535611152649, 0.10542371869087219, -0.1459886133670807, 0.4635205864906311, -0.17853467166423798, 0.0689215138554573, -0.07753420621156693, 0.04992496967315674, -0.14823602139949799, -0.32267269492149353, 0.42323043942451477, -0.09047195315361023, 0.05622214078903198, -0.3806726932525635, -0.40224820375442505, 0.6016492247581482, 0.05757206305861473, -0.0141376331448555, -0.6031715869903564, -0.27920791506767273, 0.06295251846313477, 0.05489160493016243, 0.16401880979537964, -0.16373670101165771, -0.32428139448165894, 0.34746041893959045, -0.3325554132461548, -0.1824982762336731, 0.1417250633239746, -0.19091568887233734, 0.03806435316801071, 0.16182073950767517, -0.0763813778758049, 0.3738998770713806, -0.3092811107635498, -0.046625152230262756, -0.11574183404445648, -0.01822292059659958, -0.13696464896202087, 0.015240930020809174, 0.14066670835018158, 0.1311519742012024, -0.0710851401090622, 0.1359338015317917, -0.5257594585418701, 0.1299775391817093, -0.29496484994888306, -0.1556788980960846, 0.20103979110717773, -0.04078957438468933, -0.23986685276031494, 0.1847904473543167, 0.08180046826601028, -0.3927428722381592, 0.40280938148498535, -0.042844146490097046, 0.25268322229385376, 0.08767751604318619, 0.20806550979614258, 0.09914353489875793, 0.12082971632480621, -0.3013220429420471, -0.12150443345308304, 0.08772741258144379, -0.0710197314620018, 0.09924140572547913, -0.11542750895023346, 0.018444564193487167, 0.3518578112125397, 0.4580651521682739, 0.1293424367904663, -0.18559733033180237, 0.010295769199728966, 0.19319117069244385, 0.15021969377994537, -0.11676166206598282, 0.03607916086912155, 0.09639516472816467, 0.17807015776634216, -0.13450028002262115, 0.3179679214954376, -0.014434203505516052, -0.4471985697746277, 0.05845104902982712, 0.20396950840950012, 0.5425589084625244, 0.07023781538009644, 0.034908395260572433, 0.4077931046485901, -0.11107935011386871, 0.14945392310619354, 0.41364288330078125, -0.015218567103147507, 0.11243241280317307, 0.4614630937576294, -0.23356059193611145, 0.21090587973594666, 0.1886991262435913, -0.021568764001131058, -0.2827500104904175, -0.2770389914512634, 0.030419182032346725, 0.1791800558567047, 0.04427327588200569, -0.030733704566955566, -0.18497800827026367, 0.06443198025226593, -0.34451577067375183, -0.11412353068590164, -0.1738293468952179, -0.06550924479961395, -0.35630834102630615, 0.17289774119853973, 0.2756243050098419, -0.0867743119597435, 0.12345920503139496, -0.07951745390892029, 0.092758908867836, -0.5625338554382324, 0.1814766228199005, 0.10008639097213745, -0.39774757623672485, -0.10140954703092575, 0.0025356709957122803, 0.49844467639923096, -0.14625614881515503, -0.36282479763031006, 0.2884637415409088, 0.3620324730873108, -0.30798444151878357, 0.0652238130569458, 0.3797451853752136, 0.534653902053833, 0.31863871216773987, -0.07612349092960358, 0.029056366533041, 0.20739202201366425, 0.04052617400884628, -0.2935359477996826, 0.06306334584951401, 0.07211016118526459, 0.3480895459651947, 0.14307841658592224, 0.1434149295091629, -0.14328518509864807, 0.4708785116672516, 0.03365921974182129, 0.39203572273254395, -0.21386471390724182, 0.002135559916496277, -0.37444159388542175, -0.02881084382534027, -0.17249637842178345, -0.023325227200984955, -0.20082637667655945, -0.16835565865039825, 0.13520704209804535, -0.14440621435642242, 0.11618798226118088, 0.13171306252479553, 0.01582249253988266, -0.23649796843528748, 0.10318292677402496, 0.5449698567390442, -0.29629307985305786, -0.4275543689727783, -0.010679014027118683, -0.6372302174568176, 0.0607338473200798, -0.2352551519870758, -0.26462140679359436, -0.055529698729515076, 0.2942229211330414, -0.16397124528884888, 0.000435464084148407, 0.08451534807682037, 0.13643835484981537, 0.03553347289562225, 0.024504173547029495, -0.304770827293396, -0.39168858528137207, -0.08281472325325012, 0.10441799461841583, 0.28102874755859375, -0.4515858292579651, -0.011643808335065842, -0.24771571159362793, -0.053731855005025864, 0.2071530967950821, 0.01404879242181778, 0.053917404264211655, 0.15244044363498688, 0.4294743239879608, 0.03867921978235245, 0.33379292488098145, 0.0684884563088417, -0.13951954245567322, -0.24804139137268066, 0.01193671952933073, -0.16018222272396088, 0.028663132339715958, 0.04965585842728615, 0.5609437227249146, -0.5466489791870117, 0.043196387588977814, -0.1626264452934265, 0.07015405595302582, 0.19230686128139496, -0.19080205261707306, 0.20138676464557648, 0.010310014709830284, -0.17881172895431519, 0.11769179254770279, 0.4102165699005127, -0.03326406329870224, -0.1847427785396576, 0.2616910934448242, -0.2734105885028839, -0.21932993829250336, 0.3151746988296509, 0.16266147792339325, -0.22200794517993927, 0.014597187750041485, 0.3784075379371643, 0.13365457952022552, -0.19401191174983978, -0.23545849323272705, 0.048304326832294464, 0.43123048543930054, 0.16367825865745544, -0.22851340472698212, 0.018755368888378143, -0.3143705427646637, 0.011630717664957047, 0.3192298114299774, 0.6582221984863281, 0.003940420225262642, -0.2564666271209717, 0.22177055478096008, -0.07995609939098358 ]
https://github.com/huggingface/datasets/issues/2972
OSError: Not enough disk space.
I had encountered the same error when running a command `ds = load_dataset('food101')` in a docker container. The error I got: `OSError: Not enough disk space. Needed: 9.43 GiB (download: 4.65 GiB, generated: 4.77 GiB, post-processed: Unknown size)` In case anyone encountered the same issue, this was my fix: ```sh # starting the container (mount project directory onto /app, so that the code and data in my project directory are available in the container) docker run -it --rm -v $(pwd):/app my-demo:latest bash ``` ```python # other code ... ds = load_dataset('food101', cache_dir="/app/data") # set cache_dir to the absolute path of a directory (e.g. /app/data) that's mounted from the host (MacOS in my case) into the docker container # this assumes ./data directory exists in your project folder. If not, create it or point it to any other existing directory where you want to store the cache ``` Thanks @albertvillanova for posting the fix above :-)
## Describe the bug I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space. The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available: ``` / /mnt/sda1/path/to/args.dataset_cache_dir ``` ## Steps to reproduce the bug ```python dataset_config = DownloadConfig( cache_dir=os.path.abspath(args.dataset_cache_dir), resume_download=True, ) dataset = load_dataset("natural_questions", download_config=dataset_config) ``` ## Expected results Can download the dataset without an error. ## Actual results The following error raised: ``` OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.9.0 - Platform: Ubuntu 18.04 - Python version: 3.8.10 - PyArrow version:
155
OSError: Not enough disk space. ## Describe the bug I'm trying to download `natural_questions` dataset from the Internet, and I've specified the cache_dir which locates in a mounted disk and has enough disk space. However, even though the space is enough, the disk space checking function still reports the space of root `/` disk having no enough space. The file system structure is like below. The root `/` has `115G` disk space available, and the `sda1` is mounted to `/mnt`, which has `1.2T` disk space available: ``` / /mnt/sda1/path/to/args.dataset_cache_dir ``` ## Steps to reproduce the bug ```python dataset_config = DownloadConfig( cache_dir=os.path.abspath(args.dataset_cache_dir), resume_download=True, ) dataset = load_dataset("natural_questions", download_config=dataset_config) ``` ## Expected results Can download the dataset without an error. ## Actual results The following error raised: ``` OSError: Not enough disk space. Needed: 134.92 GiB (download: 41.97 GiB, generated: 92.95 GiB, post-processed: Unknown size) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.9.0 - Platform: Ubuntu 18.04 - Python version: 3.8.10 - PyArrow version: I had encountered the same error when running a command `ds = load_dataset('food101')` in a docker container. The error I got: `OSError: Not enough disk space. Needed: 9.43 GiB (download: 4.65 GiB, generated: 4.77 GiB, post-processed: Unknown size)` In case anyone encountered the same issue, this was my fix: ```sh # starting the container (mount project directory onto /app, so that the code and data in my project directory are available in the container) docker run -it --rm -v $(pwd):/app my-demo:latest bash ``` ```python # other code ... ds = load_dataset('food101', cache_dir="/app/data") # set cache_dir to the absolute path of a directory (e.g. /app/data) that's mounted from the host (MacOS in my case) into the docker container # this assumes ./data directory exists in your project folder. If not, create it or point it to any other existing directory where you want to store the cache ``` Thanks @albertvillanova for posting the fix above :-)
[ -0.13593098521232605, -0.13086675107479095, -0.10181042551994324, 0.3833238482475281, 0.059037692844867706, 0.11979161947965622, -0.07512463629245758, 0.461299329996109, 0.29575079679489136, 0.28551244735717773, 0.050381094217300415, -0.23164086043834686, -0.010250437073409557, -0.29882627725601196, 0.01698429137468338, 0.14746883511543274, 0.010464020073413849, 0.06810405850410461, 0.24796833097934723, 0.09637823700904846, -0.2714211642742157, 0.20518174767494202, -0.1771097481250763, -0.3300178647041321, -0.216679185628891, 0.11763276904821396, -0.2134198397397995, 0.12183740735054016, -0.08459903299808502, -0.3147691488265991, 0.43380117416381836, -0.047089625149965286, 0.09145060181617737, 0.7871670126914978, -0.0001226925232913345, -0.05400887504220009, 0.12672527134418488, -0.20601089298725128, -0.5794897675514221, -0.2906118631362915, 0.12685534358024597, -0.6322922110557556, -0.041141800582408905, -0.26630857586860657, 0.03944601118564606, -0.03038971498608589, 0.05118933320045471, -0.3636153042316437, 0.11333439499139786, 0.27786579728126526, 0.11648513376712799, 0.05537135899066925, 0.19826386868953705, 0.06550717353820801, 0.18252693116664886, 0.2471473515033722, -0.04291737079620361, 0.5835140943527222, 0.32871681451797485, 0.14933505654335022, 0.15812306106090546, 0.15973547101020813, 0.01206955872476101, 0.34066691994667053, 0.219079852104187, 0.09962769597768784, 0.12652947008609772, -0.2844378650188446, 0.1572170853614807, 0.08935073018074036, 0.6317870020866394, -0.30318713188171387, -0.5118297338485718, -0.45068514347076416, 0.05634159967303276, -0.17764370143413544, 0.29588982462882996, 0.24514704942703247, -0.508407711982727, 0.0503624826669693, -0.17294248938560486, -0.34363964200019836, -0.1349267065525055, 0.1669071614742279, -0.14570006728172302, 0.30965232849121094, -0.2197878360748291, 0.12798425555229187, 0.20026364922523499, 0.03704843297600746, 0.22292472422122955, -0.2238166332244873, 0.16234014928340912, 0.07528351247310638, -0.3355253338813782, -0.06880152225494385, -0.046545542776584625, 0.0015805959701538086, 0.12574848532676697, 0.09465557336807251, -0.13468897342681885, -0.2121473252773285, -0.19747990369796753, -0.005523156374692917, 0.16319458186626434, 0.566738486289978, -0.3193855881690979, 0.21675363183021545, 0.04233432188630104, 0.14837105572223663, 0.026975620537996292, -0.22524228692054749, 0.04119274020195007, -0.16005732119083405, 0.15024487674236298, -0.24884361028671265, 0.27549564838409424, -0.08095115423202515, -0.23650330305099487, 0.031102634966373444, 0.06914210319519043, 0.06696866452693939, 0.1837649643421173, 0.3119414448738098, -0.03644752502441406, 0.3404160439968109, 0.3228028416633606, 0.4268776774406433, -0.03388350456953049, 0.06294115632772446, -0.0831952765583992, 0.0614103302359581, 0.057663965970277786, -0.05053336173295975, 0.16899675130844116, 0.07503977417945862, 0.18530745804309845, -0.002126052975654602, 0.1762167513370514, -0.21485844254493713, -0.02283906750380993, -0.3876743018627167, 0.0010516121983528137, 0.4472459852695465, 0.18883363902568817, 0.1285219043493271, 0.19777950644493103, 0.05510133504867554, -0.13684941828250885, 0.4236886501312256, -0.35437342524528503, -0.20533449947834015, -0.19758620858192444, 0.04447067901492119, -0.30271053314208984, 0.016444751992821693, -0.39116135239601135, -0.17683427035808563, 0.44474396109580994, -0.2750079333782196, 0.09911207854747772, -0.15745733678340912, -0.23794004321098328, -0.13179656863212585, 0.1915387064218521, 0.36746007204055786, -0.09103788435459137, 0.18357308208942413, -0.4091368615627289, 0.35995304584503174, 0.19785699248313904, 0.2627226710319519, 0.025640277191996574, 0.44324803352355957, -0.5476080179214478, 0.15714699029922485, 0.11026643216609955, -0.35054150223731995, -0.6838380694389343, 0.14051306247711182, -0.07555724680423737, 0.143563911318779, 0.10300187021493912, 0.18235453963279724, -0.02293337881565094, 0.014908315613865852, -0.10748206079006195, 0.14330193400382996, -0.07726910710334778, -0.053665317595005035, -0.32081300020217896, -0.1369122862815857, 0.037354592233896255, 0.16654589772224426, 0.19785729050636292, -0.03409024327993393, -0.09408795088529587, 0.0855192318558693, 0.22345808148384094, 0.1162925660610199, 0.23261938989162445, 0.2941615581512451, 0.44210413098335266, -0.08914290368556976, -0.04647354781627655, -0.18010157346725464, -0.4109067916870117, 0.3322741687297821, 0.15098242461681366, -0.002001449465751648, -0.3442334532737732, 0.16216295957565308, -0.3103959858417511, 0.180101215839386, 0.06484527885913849, -0.02694651484489441, -0.019137319177389145, 0.23030808568000793, 0.16884684562683105, -0.12345254421234131, -0.045373011380434036, 0.12341344356536865, -0.16910022497177124, 0.11859585344791412, -0.031229574233293533, 0.3795304596424103, -0.1153654083609581, -0.07874151319265366, -0.20769409835338593, -0.11152300983667374, 0.04223823547363281, -0.012200688011944294, -0.28034400939941406, 0.37826719880104065, 0.057472020387649536, -0.25800514221191406, 0.06304803490638733, 0.06015608459711075, 0.18430428206920624, 0.048907164484262466, 0.13489145040512085, 0.2754751741886139, 0.1380671113729477, 0.10869539529085159, -0.18685713410377502, -0.15259121358394623, 0.029888689517974854, 0.19678182899951935, -0.25041985511779785, 0.05486856400966644, 0.33994248509407043, -0.04012680426239967, 0.269914448261261, 0.046292468905448914, 0.25939440727233887, -0.22518189251422882, 0.3423057198524475, -0.19003145396709442, 0.46051323413848877, 0.06159006059169769, 0.13797251880168915, 0.055224936455488205, 0.2977477014064789, 0.41883885860443115, 0.07806902378797531, -0.23132911324501038, -0.07042314112186432, 0.4140027165412903, 0.6002101302146912, 0.12452412396669388, 0.08097834885120392, -0.23947668075561523, 0.36582186818122864, -0.12396860122680664, 0.17660781741142273, 0.0014211013913154602, -0.01596703752875328, 0.2634951174259186, -0.06274538487195969, -0.08509300649166107, 0.09656881541013718, -0.3673774302005768, 0.08896216005086899, 0.3638196587562561, -0.24350768327713013, -0.08417728543281555, 0.007439235225319862, 0.13620471954345703, 0.14779271185398102, -0.05406009033322334, -0.23037999868392944, -0.2481890171766281, -0.07870582491159439, 0.40363115072250366, -0.07909422367811203, -0.22251057624816895, -0.24043436348438263, 0.10198893398046494, 0.2627101540565491, -0.4100176692008972, -0.0021473951637744904, 0.21433094143867493, -0.09497416764497757, -0.09160605072975159, 0.1705714613199234, -0.3026450574398041, 0.15242715179920197, -0.22064268589019775, 0.11302542686462402, -0.3239131569862366, -0.007335036993026733, -0.02039148658514023, 0.12708434462547302, 0.30599695444107056, -0.018099747598171234, 0.5612548589706421, -0.11789315193891525, 0.10799110680818558, 0.04835371673107147, -0.06489485502243042, -0.11180248111486435, -0.0013548918068408966, 0.1868264079093933, -0.013810058124363422, -0.30627602338790894, -0.1441117227077484, -0.36081013083457947, -0.4622141718864441, 0.0035504959523677826, -0.08609265089035034, 0.2385682463645935, 0.13216134905815125, 0.2995717227458954, -0.00913584791123867, 0.20389166474342346, 0.04549095034599304, -0.18836437165737152, -0.4444182813167572, 0.0951400175690651, 0.18408522009849548, 0.059166885912418365, 0.05089286342263222, -0.011412530206143856, 0.08562840521335602, 0.2572798728942871, -0.6760449409484863, -0.23727354407310486, -0.2593691051006317, 0.4991540312767029, -0.1930541694164276, 0.10960477590560913, 0.39124923944473267, -0.3947833776473999, 0.0580180361866951, -0.10682746767997742, -0.23651090264320374, -0.20220720767974854, 0.22423705458641052, 0.4421476423740387, 0.17798098921775818, 0.11931950598955154, 0.04212590679526329, 0.47835201025009155, -0.20250526070594788, 0.33549797534942627, 0.45805609226226807, 0.06894266605377197, 0.6927741169929504, -0.08804360777139664, -0.07171154022216797, 0.056995246559381485, 0.1670980453491211, -0.48922592401504517, 0.3010730743408203, 0.22300636768341064, 0.14507414400577545, -0.02088078483939171, -0.16258761286735535, -0.29483509063720703, -0.16990089416503906, 0.3682623505592346, -0.23293253779411316, 0.1282934546470642, -0.017293158918619156, -0.054441098123788834, -0.1250099390745163, -0.16512107849121094, -0.3534579277038574, 0.21148857474327087, 0.30191805958747864, 0.0800773948431015, -0.2544247806072235, -0.09092830866575241, -0.2649504840373993, 0.22880931198596954, -0.006140888202935457, 0.11534487456083298, -0.1522965431213379, 0.20201444625854492, -0.005232684314250946, 0.009001198224723339, 0.6422369480133057, 0.01916317269206047, 0.18815256655216217, -0.16026046872138977, -0.0491926334798336, -0.5766264200210571, -0.05504143238067627, 0.10056185722351074, 0.13058924674987793, 0.171347975730896, 0.43081507086753845, -0.3106095790863037, 0.1366000473499298, -0.3729511499404907, 0.40793389081954956, -0.12941128015518188, -0.33726122975349426, -0.11949034035205841, -0.49163392186164856, -0.2666664719581604, 0.09233953058719635, 0.25181230902671814, 0.14769773185253143, 0.3783895671367645, 0.11730355024337769, 0.0030083507299423218, -0.13236558437347412, 0.006456196308135986, -0.2114577740430832, 0.5400946140289307, -0.08723051846027374, 0.018060293048620224, 0.09064395725727081, -0.25408273935317993, 0.3793078660964966, 0.4625079929828644, -0.18061845004558563, 0.13560040295124054, 0.28978458046913147, 0.13144725561141968, -0.08341767638921738, 0.24426785111427307, -0.12949468195438385, -0.2376583218574524, 0.04455340653657913, 0.39175307750701904, -0.12559504806995392, 0.11205875873565674, -0.27896082401275635, 0.15365104377269745, 0.21901661157608032, -0.29088327288627625, 0.31880179047584534, 0.035203009843826294, 0.10747332870960236, 0.14994381368160248, 0.18710121512413025, -0.2353937178850174, 0.2016286998987198, -0.16567355394363403, 0.8055450320243835, -0.032047174870967865, -0.004609245806932449, 0.31202447414398193, -0.1881859004497528, 0.38839593529701233, -0.3831636309623718, 0.2010280042886734, -0.0397355817258358, -0.27093371748924255, 0.0390591099858284, -0.13202454149723053, -0.2440946400165558, 0.04946070909500122, -0.17050667107105255, 0.30288243293762207, -0.35058969259262085, 0.1914699226617813, 0.09600992500782013, 0.1316402554512024, -0.21626116335391998, -0.21304450929164886, -0.30198216438293457, 0.17288674414157867, -0.3945150375366211, 0.458149254322052, -0.07370418310165405, 0.16979679465293884, -0.3530648648738861, -0.14566218852996826, -0.3524472713470459, -0.020472122356295586, -0.013808092102408409, 0.16070319712162018, -0.08553776144981384, -0.0553334578871727, -0.23375080525875092, 0.40206924080848694, -0.08243215084075928, 0.31403833627700806, -0.25417521595954895, 0.1476140171289444, -0.11834711581468582, 0.09453214704990387, 0.2899805009365082, 0.0039151255041360855, 0.02168232761323452, -0.05446929484605789, -0.2156640887260437, -0.2311147153377533, -0.28015008568763733, -0.5457818508148193, 0.18821534514427185, 0.12412057816982269, 0.10364596545696259, -0.12987524271011353, -0.4880375564098358, -0.3333786427974701, 0.06988941133022308, -0.09679962694644928, 0.03547641262412071, 0.2239125669002533, -0.2784580588340759, 0.18434739112854004, -0.12160399556159973, -0.39305850863456726, -0.042339373379945755, 0.1504867672920227, 0.20880427956581116, -0.14891588687896729, 0.5080838799476624, -0.162556454539299, 0.08531108498573303, -0.10040899366140366, 0.07938096672296524, -0.13537605106830597, -0.2289748191833496, 0.47036856412887573, -0.2107863873243332, -0.0009362399578094482, -0.34265366196632385, -0.5355625152587891, 0.6176870465278625, 0.16683903336524963, -0.07119636237621307, -0.6605383157730103, -0.2351376861333847, 0.008785173296928406, 0.06673038005828857, 0.14999867975711823, -0.17551153898239136, -0.3673206567764282, 0.25967535376548767, -0.2400827407836914, -0.18145662546157837, 0.14805659651756287, -0.21064713597297668, 0.04737570881843567, 0.20425856113433838, -0.08539726585149765, 0.3074810802936554, -0.29951387643814087, -0.04971199855208397, -0.08039028197526932, -0.013701831921935081, -0.12210237979888916, 0.008984331041574478, 0.13836467266082764, 0.10014163702726364, -0.07488963752985, 0.051940396428108215, -0.5513213276863098, 0.029753539711236954, -0.33979129791259766, -0.1488502025604248, 0.1737363338470459, -0.10408566892147064, -0.33903634548187256, 0.17172420024871826, 0.1460077166557312, -0.330478310585022, 0.395800918340683, -0.07284761965274811, 0.3498094081878662, 0.08108536899089813, 0.28708407282829285, 0.17528879642486572, 0.16275650262832642, -0.39467111229896545, -0.08460172265768051, -0.005074553191661835, -0.041835054755210876, 0.10771337151527405, -0.11886140704154968, 0.08234620094299316, 0.2689512372016907, 0.4594479203224182, 0.06948194652795792, -0.24444566667079926, -0.030442703515291214, 0.1571386754512787, 0.1472811996936798, -0.07095292210578918, 0.049863457679748535, 0.05621752515435219, 0.19178982079029083, -0.11796167492866516, 0.3725968301296234, 0.06256027519702911, -0.4122740924358368, 0.02163098007440567, 0.22476020455360413, 0.6172115802764893, 0.05199114605784416, 0.04201667755842209, 0.3372131884098053, -0.22504089772701263, 0.1799166351556778, 0.35839805006980896, -0.12530837953090668, 0.07736171782016754, 0.4602411985397339, -0.2148904800415039, 0.19783388078212738, 0.25640669465065, -0.09122033417224884, -0.22853624820709229, -0.1917688399553299, 0.008210018277168274, 0.24082788825035095, 0.03974570333957672, 0.019234206527471542, -0.21903926134109497, -0.04698166996240616, -0.4550480842590332, -0.14882376790046692, -0.19337230920791626, -0.05825361981987953, -0.3718620240688324, 0.21109408140182495, 0.18094263970851898, -0.11522755026817322, 0.09354129433631897, -0.062289685010910034, 0.13513344526290894, -0.5106246471405029, -0.05723278224468231, 0.14927564561367035, -0.43563711643218994, -0.0165561530739069, -0.03626447170972824, 0.4776805341243744, -0.15537357330322266, -0.4008987843990326, 0.28953397274017334, 0.46092694997787476, -0.19732165336608887, 0.09102161228656769, 0.311827152967453, 0.6550396680831909, 0.40327188372612, -0.1058848649263382, -0.018821295350790024, 0.18666082620620728, -0.0004421193152666092, -0.29665687680244446, 0.014300133101642132, 0.061510082334280014, 0.26237162947654724, 0.12736350297927856, 0.15085431933403015, -0.1508236974477768, 0.43572455644607544, 0.10175040364265442, 0.41896241903305054, -0.0732162743806839, -0.001661933958530426, -0.29473599791526794, -0.025060933083295822, -0.15724588930606842, -0.033743418753147125, -0.20059865713119507, -0.12688586115837097, 0.12475185096263885, -0.1556030660867691, 0.13045024871826172, 0.20198339223861694, 0.023440301418304443, -0.3174287676811218, 0.05594080686569214, 0.4660799205303192, -0.43586692214012146, -0.4128389358520508, 0.00806359201669693, -0.578525960445404, 0.04155035316944122, -0.3550218939781189, -0.34980058670043945, -0.0377156101167202, 0.30139389634132385, -0.17539045214653015, 0.018834291025996208, 0.08927619457244873, 0.06401026993989944, -0.018087521195411682, -0.09171424806118011, -0.3970668613910675, -0.46818047761917114, 0.01904315873980522, 0.1655171662569046, 0.2910701334476471, -0.49791836738586426, -0.030487243086099625, -0.1962655633687973, -0.039242517203092575, 0.2015753984451294, 0.03274467587471008, 0.09174138307571411, 0.27052953839302063, 0.3758900761604309, 0.03145551681518555, 0.3815338611602783, 0.0437711700797081, -0.1817871481180191, -0.19873762130737305, -0.007169945631176233, -0.1968735158443451, 0.07916636019945145, 0.06617831438779831, 0.6729477643966675, -0.5408474802970886, -0.05167148634791374, -0.1866724044084549, -0.07810302078723907, 0.09250020980834961, -0.198299840092659, 0.17168037593364716, -0.021395368501544, -0.14097604155540466, 0.15722280740737915, 0.31524187326431274, -0.08499205857515335, -0.11351120471954346, 0.26085904240608215, -0.29643863439559937, -0.14073546230793, 0.3625437319278717, 0.1767696589231491, -0.3269950747489929, 0.0048027681186795235, 0.2860989272594452, 0.04253368079662323, -0.08484829217195511, -0.18129467964172363, 0.061177946627140045, 0.42446374893188477, 0.10816195607185364, -0.2510407567024231, -0.014894828200340271, -0.27936333417892456, 0.013651933521032333, 0.2857676148414612, 0.520919919013977, 0.02468404918909073, -0.36449071764945984, 0.11180610954761505, -0.002873852849006653 ]
https://github.com/huggingface/datasets/issues/2969
medical-dialog error
Hi @smeyerhot, thanks for reporting. You are right: there is an issue with the dataset metadata. I'm fixing it. In the meantime, you can circumvent the issue by passing `ignore_verifications=True`: ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English", ignore_verifications=True) ```
## Describe the bug A clear and concise description of what the bug is. When I attempt to download the huggingface datatset medical_dialog it errors out midway through ## Steps to reproduce the bug ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English") ``` ## Expected results A clear and concise description of the expected results. No error ## Actual results ``` 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits) 72 ] 73 if len(bad_splits) > 0: ---> 74 raise NonMatchingSplitsSizesError(str(bad_splits)) 75 logger.info("All the splits matched successfully.") 76 NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}] ``` Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.21.1 - Platform: colab - Python version: colab 3.7 - PyArrow version: N/A
40
medical-dialog error ## Describe the bug A clear and concise description of what the bug is. When I attempt to download the huggingface datatset medical_dialog it errors out midway through ## Steps to reproduce the bug ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English") ``` ## Expected results A clear and concise description of the expected results. No error ## Actual results ``` 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits) 72 ] 73 if len(bad_splits) > 0: ---> 74 raise NonMatchingSplitsSizesError(str(bad_splits)) 75 logger.info("All the splits matched successfully.") 76 NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}] ``` Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.21.1 - Platform: colab - Python version: colab 3.7 - PyArrow version: N/A Hi @smeyerhot, thanks for reporting. You are right: there is an issue with the dataset metadata. I'm fixing it. In the meantime, you can circumvent the issue by passing `ignore_verifications=True`: ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English", ignore_verifications=True) ```
[ -0.1769694685935974, -0.16794276237487793, 0.13243086636066437, 0.30510199069976807, 0.09877049922943115, 0.17889302968978882, 0.25747257471084595, 0.35723960399627686, -0.18424268066883087, 0.10258910059928894, -0.26510247588157654, 0.1361614614725113, -0.02938687428832054, 0.4398858845233917, -0.1117001622915268, -0.12256461381912231, -0.11737630516290665, 0.12806303799152374, -0.04445333778858185, 0.08451782166957855, -0.27063077688217163, 0.17604359984397888, -0.40150266885757446, 0.12519341707229614, -0.2604568898677826, -0.19206131994724274, -0.050005607306957245, 0.19645026326179504, -0.18736974895000458, -0.3622838854789734, 0.02460167370736599, -0.14203554391860962, -0.1834927350282669, 0.5016122460365295, -0.00012052722740918398, -0.1494739055633545, 0.44380342960357666, -0.031231889501214027, -0.7869769334793091, -0.29640787839889526, -0.2228536605834961, 0.023300739005208015, 0.16536200046539307, -0.06705532968044281, 0.057769447565078735, 0.1188887432217598, -0.029204564169049263, -0.15684020519256592, 0.31947410106658936, 0.4523724913597107, 0.14251300692558289, 0.3699614107608795, -0.034919433295726776, -0.0790768638253212, 0.09678970277309418, 0.11010733246803284, -0.15094394981861115, 0.34997522830963135, 0.2005818635225296, 0.045470066368579865, 0.33810558915138245, 0.39528989791870117, -0.074732206761837, 0.006817705929279327, -0.06480205804109573, 0.13223208487033844, 0.03418625146150589, -0.31731510162353516, 0.14797890186309814, 0.5003924369812012, 0.4976694583892822, -0.3424367308616638, -0.3184410631656647, -0.4580034613609314, 0.006168840453028679, -0.3762103021144867, 0.31864604353904724, 0.29194989800453186, -0.296964555978775, 0.1543128937482834, -0.1780053973197937, -0.1803925633430481, 0.004895977675914764, 0.0972718670964241, -0.11855673789978027, 0.06269711256027222, -0.07307814806699753, 0.1329294741153717, 0.20000863075256348, 0.04861424118280411, 0.14988237619400024, 0.03581412509083748, -0.013676110655069351, 0.17089395225048065, -0.24619604647159576, -0.044902779161930084, -0.18360424041748047, 0.5213913917541504, 0.3509039580821991, -0.05320250988006592, -0.18722403049468994, -0.14767879247665405, -0.28511080145835876, 0.045058440417051315, 0.46131834387779236, -0.10366034507751465, 0.10055279731750488, 0.21307368576526642, 0.15425622463226318, 0.3851320147514343, 0.1553564965724945, 0.015437595546245575, 0.14692293107509613, -0.1992664337158203, 0.06060711666941643, -0.028227519243955612, 0.2863914966583252, -0.2664482295513153, -0.33266329765319824, 0.10813138633966446, -0.3204188346862793, 0.23247244954109192, 0.07001933455467224, 0.10791905224323273, -0.3211483955383301, -0.05913639813661575, 0.19405080378055573, -0.13487344980239868, -0.27682337164878845, -0.25968217849731445, -0.10743708163499832, 0.2144898772239685, -0.2531346082687378, 0.17931149899959564, 0.055874865502119064, -0.2652099132537842, 0.1660882830619812, 0.005608075298368931, 0.3041837215423584, -0.09268859028816223, -0.24175843596458435, -0.21148915588855743, -0.1477477252483368, 0.37445172667503357, 0.000222865492105484, 0.31848594546318054, -0.022183571010828018, -0.3037140965461731, -0.0763859897851944, 0.0821063369512558, -0.20187807083129883, -0.2816460132598877, -0.2584342062473297, 0.12096823006868362, -0.3434649109840393, 0.14323905110359192, -0.39912107586860657, -0.031609419733285904, 0.16110239923000336, -0.29070010781288147, 0.08938196301460266, -0.20292113721370697, -0.28346988558769226, -0.11275460571050644, 0.12120211869478226, 0.7058109045028687, -0.27693143486976624, -0.06076042354106903, -0.2715162932872772, -0.10819864273071289, 0.1147104948759079, 0.3042283356189728, -0.17539307475090027, 0.12136250734329224, -0.486724853515625, 0.368455708026886, -0.01842380315065384, -0.460440456867218, -0.5586310625076294, 0.07512830197811127, -0.1979197859764099, 0.2133277803659439, -0.038981057703495026, -0.1268940418958664, 0.15923446416854858, -0.20461417734622955, 0.15193447470664978, 0.32240813970565796, -0.0467534065246582, 0.08772221207618713, -0.3800097405910492, -0.3064817488193512, 0.02423127368092537, 0.11334456503391266, 0.13428618013858795, -0.010261498391628265, -0.03831534832715988, 0.2593232989311218, 0.5065186619758606, 0.1001935824751854, -0.015610035508871078, 0.0680440291762352, 0.20867127180099487, 0.11406290531158447, 0.03773326054215431, -0.42271313071250916, -0.7257649898529053, 0.1071036234498024, 0.22852376103401184, 0.10550469905138016, -0.426851749420166, -0.21559233963489532, -0.39920979738235474, 0.045804932713508606, -0.16646049916744232, -0.006414901465177536, 0.043759144842624664, 0.21237406134605408, -0.04140390083193779, 0.2569921910762787, -0.0902734249830246, 0.7574388980865479, 0.08821709454059601, 0.41630852222442627, -0.3237500786781311, 0.3413277268409729, -0.0027733128517866135, -0.16688108444213867, 0.09733448922634125, -0.08365849405527115, 0.21625176072120667, -0.07055118680000305, -0.1997118890285492, 0.5262143611907959, 0.2810686528682709, 0.23782673478126526, -0.3514768183231354, -0.036761924624443054, 0.4658612608909607, -0.22156956791877747, -0.16970103979110718, -0.1935657113790512, 0.204734206199646, 0.06924694031476974, -0.060829535126686096, -0.14998777210712433, -0.2671663761138916, 0.11024199426174164, 0.19579501450061798, 0.1823008954524994, -0.0363290049135685, -0.20971956849098206, -0.2261214554309845, -0.2612202763557434, 0.4057547152042389, -0.012469399720430374, 0.09686429798603058, 0.031836386770009995, -0.3492920398712158, 0.2115350365638733, 0.55484938621521, -0.17456355690956116, 0.09345132857561111, 0.04960063844919205, -0.13514503836631775, 0.047382041811943054, -0.06901707500219345, 0.029205884784460068, 0.33768612146377563, 0.13133487105369568, 0.01601509004831314, 0.36641061305999756, -0.03857292979955673, -0.11966224014759064, 0.16830767691135406, 0.18695947527885437, 0.15984569489955902, 0.25090235471725464, -0.0641338899731636, 0.13460643589496613, -0.24105936288833618, -0.048918161541223526, 0.05301589518785477, 0.24555352330207825, -0.5014849305152893, 0.013082729652523994, -0.4143122136592865, -0.143011212348938, -0.3056628704071045, -0.5674596428871155, -0.14276520907878876, -0.2658528685569763, 0.0028018485754728317, 0.23387904465198517, -0.011007210239768028, 0.11096710711717606, 0.05865525081753731, 0.14005181193351746, -0.010872293263673782, -0.055810242891311646, -0.006746694445610046, -0.08253621309995651, -0.19269123673439026, -0.05125550180673599, 0.22447869181632996, 0.134514719247818, 0.3748650550842285, -0.37900006771087646, -0.2629118859767914, 0.006263557821512222, -0.19308331608772278, 0.33984825015068054, -0.0909418910741806, 0.3690990209579468, 0.21766114234924316, 0.3530425429344177, -0.026527434587478638, -0.04651421308517456, 0.07139551639556885, 0.07437316328287125, -0.1346057951450348, -0.13900920748710632, 0.22763003408908844, 0.12884096801280975, -0.19682569801807404, -0.23067229986190796, -0.22434082627296448, -0.36273351311683655, 0.19296975433826447, -0.35502922534942627, 0.11054359376430511, 0.6773462891578674, -0.010207056067883968, 0.24499991536140442, -0.16390936076641083, 0.18685579299926758, -0.24507048726081848, 0.07953749597072601, 0.14185351133346558, -0.024832405149936676, -0.1745527982711792, -0.12297514081001282, -0.08058041334152222, -0.05223214998841286, 0.10952086746692657, -0.5826975703239441, -0.308006227016449, -0.2354387789964676, 0.007404886186122894, -0.10700695216655731, -0.05155416578054428, 0.44850701093673706, -0.09044158458709717, 0.039497531950473785, -0.18981769680976868, -0.29485782980918884, -0.05977606028318405, -0.014679308980703354, 0.34975919127464294, -0.09303583949804306, 0.3620753884315491, 0.15327924489974976, 0.4296873211860657, 0.18925921618938446, 0.03538553789258003, 0.052816733717918396, -0.16899266839027405, 0.34121713042259216, -0.029579274356365204, -0.4730043113231659, 0.1318253129720688, -0.18456941843032837, -0.3207132816314697, 0.2816580533981323, -0.094899483025074, 0.03610406443476677, -0.36310017108917236, 0.028961393982172012, -0.4780667722225189, -0.5679898262023926, -0.23150856792926788, 0.1382274627685547, 0.01329805701971054, 0.17104463279247284, 0.0887446478009224, 0.1511024683713913, 0.011197986081242561, 0.06573055684566498, 0.42263084650039673, -0.018029943108558655, -0.04649970680475235, 0.2072761207818985, -0.15955610573291779, -0.032515667378902435, 0.15235364437103271, 0.2224075347185135, 0.1659444272518158, -0.15970493853092194, -0.13331864774227142, 0.08712373673915863, 0.038699906319379807, 0.611565113067627, 0.0777929350733757, 0.24416273832321167, -0.23155313730239868, 0.11017072200775146, -0.3248421549797058, -0.16080930829048157, -0.16171406209468842, 0.12174580246210098, 0.40895184874534607, 0.6710761189460754, -0.37366873025894165, 0.03432614356279373, 0.4087642431259155, 0.25625741481781006, -0.006106674671173096, -0.11608357727527618, -0.19147072732448578, -0.41222715377807617, -0.25967469811439514, 0.22186878323554993, 0.2774263620376587, 0.05374529957771301, 0.05150733143091202, -0.02101815864443779, 0.28831619024276733, -0.13187026977539062, 0.08478613197803497, 0.11171971261501312, 0.19156691431999207, 0.07863865792751312, 0.3828139305114746, 0.2432941198348999, 0.4045054018497467, 0.5340047478675842, 0.7357159852981567, -0.05114370957016945, -0.6133358478546143, -0.11066072434186935, -0.16799934208393097, 0.05453095957636833, 0.5504430532455444, -0.001481377985328436, -0.15338808298110962, 0.1256265491247177, 0.33492016792297363, 0.05070785805583, 0.452324241399765, 0.2628979980945587, -0.16398635506629944, -0.4983711838722229, -0.1849476844072342, 0.4792192280292511, 0.13287340104579926, -0.09394591301679611, 0.09177720546722412, 0.4309890866279602, -0.29208916425704956, -0.061524830758571625, -0.09567610174417496, 1.0602631568908691, 0.19234506785869598, 0.015311725437641144, 0.4822874069213867, -0.3443616032600403, 0.48601117730140686, 0.18626302480697632, 0.027439365163445473, -0.21067224442958832, -0.24273650348186493, 0.024289904162287712, -0.13518713414669037, -0.04947713762521744, -0.25550389289855957, -0.38098111748695374, 0.04545138403773308, -0.3563327193260193, 0.0205406341701746, 0.12724937498569489, 0.13393856585025787, -0.19401764869689941, -0.19139088690280914, -0.26345616579055786, 0.06340312212705612, -0.2191539853811264, 0.28558865189552307, -0.04319413751363754, -0.13255298137664795, -0.16137687861919403, -0.13103961944580078, -0.5280687212944031, 0.1618269681930542, -0.4434165060520172, -0.1803032010793686, -0.15166327357292175, -0.001560986042022705, 0.19701987504959106, -0.019791338592767715, 0.2553164064884186, 0.2171282172203064, -0.27264901995658875, 0.13543197512626648, -0.0036657750606536865, -0.18115054070949554, -0.07105831801891327, -0.11900393664836884, 0.6151723861694336, -0.06360489130020142, -0.32951444387435913, -0.013927899301052094, 0.06297817826271057, 0.13345180451869965, 0.02296188473701477, -0.014359809458255768, 0.10210359841585159, -0.3658813238143921, 0.050633423030376434, -0.09968875348567963, 0.3532087206840515, -0.1613040268421173, 0.0763109028339386, 0.0938187688589096, -0.17010672390460968, 0.2272118330001831, -0.017134156078100204, -0.2901849150657654, -0.16402943432331085, 0.4051133990287781, -0.01392819732427597, 0.04522049427032471, 0.46101126074790955, 0.1771654188632965, -0.25815272331237793, -0.21604302525520325, -0.05532785877585411, -0.18568427860736847, -0.4815542995929718, 0.29006215929985046, 0.03329360485076904, 0.24698768556118011, -0.19394294917583466, 0.35345956683158875, 0.2237318754196167, -0.28515496850013733, -0.03393225371837616, -0.5048263669013977, -0.012727133929729462, 0.1993921995162964, -0.15447299182415009, 0.1483490914106369, 0.14695483446121216, 0.519687831401825, 0.12143316864967346, -0.06661626696586609, -0.2545582950115204, 0.2299855351448059, -0.07597550004720688, 0.20444373786449432, 0.40275999903678894, -0.0319862961769104, 0.29171696305274963, -0.1693611592054367, 0.07432353496551514, 0.24127820134162903, -0.026872023940086365, -0.1671079397201538, -0.232231006026268, 0.15122900903224945, 0.15629932284355164, -0.15831169486045837, -0.035060618072748184, -0.16528728604316711, -0.03595854341983795, -0.019264966249465942, 0.2781836688518524, 0.27343684434890747, 0.09719660133123398, 0.09646830707788467, 0.057356443256139755, 0.23296117782592773, 0.16570129990577698, 0.28998780250549316, 0.05076790601015091, 0.2264716774225235, 0.016242951154708862, 0.22728870809078217, -0.2362385094165802, -0.05610229820013046, 0.23313672840595245, 0.07067765295505524, 0.060387901961803436, 0.046538323163986206, 0.18945038318634033, -0.3760555386543274, 0.06470388174057007, 0.07618144154548645, 0.2942519783973694, 0.6104208827018738, -0.11044586449861526, -0.22880449891090393, 0.1398809552192688, 0.11407841742038727, -0.24586749076843262, 0.07932839542627335, 0.34766072034835815, -0.09836367517709732, 0.0749027281999588, 0.34179770946502686, -0.1475873440504074, 0.16291150450706482, -0.16456006467342377, -0.08906731754541397, 0.4398975372314453, 0.38545870780944824, 0.06989261507987976, 0.4690788686275482, -0.36472272872924805, 0.08070778101682663, 0.1397295594215393, 0.09420911967754364, 0.24855315685272217, 0.17766240239143372, -0.1406918466091156, 0.022814175114035606, -0.40121549367904663, 0.016018912196159363, 0.1353360414505005, -0.1622372567653656, 0.11118800938129425, 0.2644503712654114, -0.16774997115135193, -0.025639653205871582, -0.06902900338172913, 0.5003016591072083, -0.34874776005744934, -0.012579858303070068, -0.22516927123069763, 0.12929123640060425, -0.07905376702547073, 0.05755506083369255, 0.10573901236057281, -0.1444375216960907, -0.36845821142196655, 0.08745822310447693, -0.03272460773587227, -0.12841951847076416, 0.21733978390693665, 0.14751271903514862, -0.005879059433937073, -0.22842451930046082, -0.46029648184776306, 0.4374266564846039, 0.048755936324596405, -0.40174591541290283, 0.15535473823547363, 0.030545972287654877, -0.136182501912117, -0.03366518393158913, 0.3059752583503723, 0.3919987082481384, 0.1657617688179016, -0.17787274718284607, -0.22893084585666656, -0.04882894083857536, 0.17416946589946747, 0.09853142499923706, 0.1904127597808838, 0.23898892104625702, 0.11113442480564117, 0.5524638295173645, 0.10517574846744537, -0.18035118281841278, 0.3830310106277466, -0.18384723365306854, -0.08947570621967316, -0.534892201423645, -0.06567486375570297, -0.25055986642837524, 0.09964131563901901, -0.37210091948509216, -0.1482236683368683, -0.3153493106365204, -0.08416134864091873, 0.28791940212249756, -0.0706028938293457, 0.15519925951957703, -0.019313231110572815, 0.04649149626493454, 0.05792022496461868, 0.44749072194099426, 0.7697229385375977, 0.08058934658765793, -0.058205872774124146, -0.04081935063004494, -0.5425558686256409, 0.07327253371477127, -0.18697203695774078, -0.2242099493741989, 0.08169268816709518, 0.022524526342749596, 0.055158376693725586, 0.26315826177597046, 0.2556951642036438, 0.17870835959911346, -0.1316627562046051, 0.053489696234464645, -0.06433743983507156, -0.2772248089313507, -0.0630570501089096, -0.24428430199623108, 0.08351662755012512, -0.33207711577415466, 0.16767030954360962, -0.17257511615753174, -0.06072292849421501, -0.023747600615024567, -0.11349055171012878, 0.03842471167445183, -0.20465737581253052, 0.34368646144866943, 0.1615445911884308, 0.3670707046985626, 0.03620816767215729, -0.39250120520591736, -0.17659007012844086, 0.0015164692886173725, -0.24852170050144196, 0.19840961694717407, 0.22752270102500916, 0.24433645606040955, 0.0007279682904481888, 0.031575895845890045, -0.33853811025619507, 0.2310229390859604, 0.22181259095668793, -0.23122407495975494, -0.14268849790096283, -0.24253664910793304, 0.025543533265590668, 0.06775549799203873, 0.0736740455031395, 0.31794068217277527, -0.38238272070884705, 0.3303288221359253, -0.2959396243095398, -0.49474114179611206, 0.6905474662780762, -0.30860981345176697, -0.21629418432712555, -0.1757376790046692, 0.48085033893585205, 0.1304493248462677, -0.29809895157814026, -0.5472736954689026, -0.005579344928264618, 0.2182300090789795, -0.052857883274555206, -0.29793450236320496, 0.2515188753604889, -0.07772637903690338, 0.036720406264066696, 0.011238891631364822, 0.5912210941314697, 0.23281794786453247, -0.0906597301363945, 0.2685348689556122, -0.0653785765171051 ]
https://github.com/huggingface/datasets/issues/2969
medical-dialog error
Hi @albertvillanova -- I see you made changes to the wikitext dataset a few hours ago. I'm getting an error similar to the one here : https://github.com/huggingface/datasets/issues/215 After your changes. I deleted the original dataset cache after encountering that error and then rerun with the following command : `traindata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='train', ignore_verifications=True, download_mode='force_redownload') testdata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='test', ignore_verifications=True)` But this is currently hanging. Any ideas ? Thanks
## Describe the bug A clear and concise description of what the bug is. When I attempt to download the huggingface datatset medical_dialog it errors out midway through ## Steps to reproduce the bug ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English") ``` ## Expected results A clear and concise description of the expected results. No error ## Actual results ``` 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits) 72 ] 73 if len(bad_splits) > 0: ---> 74 raise NonMatchingSplitsSizesError(str(bad_splits)) 75 logger.info("All the splits matched successfully.") 76 NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}] ``` Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.21.1 - Platform: colab - Python version: colab 3.7 - PyArrow version: N/A
70
medical-dialog error ## Describe the bug A clear and concise description of what the bug is. When I attempt to download the huggingface datatset medical_dialog it errors out midway through ## Steps to reproduce the bug ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English") ``` ## Expected results A clear and concise description of the expected results. No error ## Actual results ``` 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits) 72 ] 73 if len(bad_splits) > 0: ---> 74 raise NonMatchingSplitsSizesError(str(bad_splits)) 75 logger.info("All the splits matched successfully.") 76 NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}] ``` Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.21.1 - Platform: colab - Python version: colab 3.7 - PyArrow version: N/A Hi @albertvillanova -- I see you made changes to the wikitext dataset a few hours ago. I'm getting an error similar to the one here : https://github.com/huggingface/datasets/issues/215 After your changes. I deleted the original dataset cache after encountering that error and then rerun with the following command : `traindata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='train', ignore_verifications=True, download_mode='force_redownload') testdata = load_dataset('wikitext', 'wikitext-2-raw-v1', split='test', ignore_verifications=True)` But this is currently hanging. Any ideas ? Thanks
[ -0.13767629861831665, -0.2538638412952423, 0.13575105369091034, 0.14634007215499878, 0.0982343778014183, 0.20577532052993774, 0.18414387106895447, 0.3999829590320587, -0.06198418140411377, 0.0381765142083168, -0.2858354151248932, 0.12893986701965332, -0.06812027096748352, 0.3922610580921173, -0.0440688319504261, -0.218870609998703, 0.0003257244825363159, 0.116875559091568, -0.15835784375667572, 0.14410582184791565, -0.2481638640165329, 0.24870574474334717, -0.37971794605255127, 0.21959754824638367, -0.2595486044883728, -0.21924182772636414, -0.09440980851650238, 0.15926602482795715, -0.1680336892604828, -0.4238273501396179, 0.15555253624916077, -0.14988736808300018, -0.12855049967765808, 0.42178964614868164, -0.00012238351337146014, -0.06793919205665588, 0.38835209608078003, 0.03247562795877457, -0.6712003350257874, -0.21844469010829926, -0.1884477436542511, -0.14872290194034576, 0.2630188465118408, -0.017322055995464325, 0.07759364694356918, 0.03385097533464432, -0.055335335433483124, -0.21747525036334991, 0.45657801628112793, 0.463142067193985, 0.11887994408607483, 0.4333451986312866, 0.09866723418235779, -0.05919601023197174, 0.07063767313957214, -0.06951898336410522, -0.17440617084503174, 0.15240085124969482, 0.22863538563251495, 0.02464631013572216, 0.19687329232692719, 0.3480421006679535, -0.01856866106390953, -0.06218055263161659, 0.0755443274974823, 0.09589225798845291, -0.06139553338289261, -0.35370349884033203, 0.12340784817934036, 0.4775032699108124, 0.4641985595226288, -0.338041216135025, -0.3630879819393158, -0.590645432472229, 0.004093001130968332, -0.31611281633377075, 0.39308732748031616, 0.07936104387044907, -0.277193546295166, 0.1786593496799469, -0.19835759699344635, -0.20780816674232483, 0.025921814143657684, 0.12566758692264557, -0.007321838289499283, 0.1565515100955963, -0.08115901798009872, 0.15324066579341888, 0.1219065934419632, 0.061831582337617874, 0.14774952828884125, 0.14407217502593994, -0.06295090913772583, 0.22680024802684784, -0.3525208532810211, -0.036811746656894684, -0.10529572516679764, 0.6298710703849792, 0.31263458728790283, -0.09951362013816833, -0.14402620494365692, -0.1688816249370575, -0.18350382149219513, -0.057861946523189545, 0.5130077600479126, 0.11740262806415558, 0.027057968080043793, 0.010652384720742702, -0.002066228538751602, 0.4195725619792938, 0.1472780406475067, -0.0491800457239151, 0.21886581182479858, -0.3297368586063385, -0.01726139709353447, -0.11402953416109085, 0.292264461517334, -0.20436781644821167, -0.20205169916152954, 0.14954784512519836, -0.11748052388429642, 0.22133569419384003, 0.04520755633711815, 0.06476972252130508, -0.2979696989059448, 0.14553463459014893, 0.22410012781620026, -0.039873234927654266, -0.32243213057518005, -0.08640042692422867, -0.11054941266775131, 0.1512821614742279, -0.21139195561408997, 0.130952849984169, 0.002230387181043625, -0.2218378186225891, 0.18206076323986053, 0.07052184641361237, 0.343269407749176, -0.11983168870210648, -0.2978784739971161, -0.04731682687997818, -0.18063384294509888, 0.3299410045146942, -0.06955158710479736, 0.4726436734199524, 0.0721760019659996, -0.2798999547958374, -0.06541483849287033, 0.025990847498178482, -0.2745007574558258, -0.3487791121006012, -0.32918140292167664, 0.11005052924156189, -0.2652057111263275, 0.06819930672645569, -0.31358668208122253, 0.041335489600896835, 0.166286900639534, -0.3304009735584259, 0.11043764650821686, -0.2247002273797989, -0.2603580951690674, -0.07986077666282654, 0.19875000417232513, 0.626644492149353, -0.22997236251831055, -0.13632431626319885, -0.40504705905914307, -0.11731213331222534, -0.0033325105905532837, 0.2948245406150818, -0.19133606553077698, 0.18690979480743408, -0.4227333068847656, 0.40886545181274414, 0.09700332581996918, -0.4131506085395813, -0.6952610015869141, 0.02570340223610401, -0.24148686230182648, 0.29112863540649414, -0.10432963818311691, -0.08500688523054123, 0.08987445384263992, -0.18060649931430817, 0.10272490978240967, 0.158751979470253, -0.08454578369855881, 0.09582530707120895, -0.37443646788597107, -0.41982585191726685, 0.06732643395662308, 0.07569777965545654, 0.16374576091766357, -0.0015610679984092712, -0.0732150450348854, 0.3219431936740875, 0.5472912788391113, 0.016991768032312393, 0.036849506199359894, 0.06865265965461731, 0.1805303990840912, 0.2333313375711441, 0.02884647250175476, -0.4305992126464844, -0.788188099861145, 0.18035268783569336, -0.02841075509786606, 0.06240157410502434, -0.3503498435020447, -0.18765874207019806, -0.47142553329467773, 0.009096907451748848, -0.21354596316814423, -0.164874866604805, 0.031580716371536255, 0.14404506981372833, 0.03881235048174858, 0.35031720995903015, -0.15060487389564514, 0.6705939173698425, 0.07323430478572845, 0.4082850217819214, -0.28440946340560913, 0.30438220500946045, 0.003859465941786766, -0.14076006412506104, 0.056389614939689636, 0.017794687300920486, 0.13759955763816833, -0.08317761868238449, -0.2854011356830597, 0.5288903713226318, 0.10562903434038162, 0.34370681643486023, -0.2647138237953186, -0.1473665088415146, 0.36212146282196045, -0.17299973964691162, -0.17656368017196655, -0.24527670443058014, 0.18299110233783722, 0.08241306990385056, 0.04253707453608513, -0.07794627547264099, -0.2619975209236145, 0.1979208141565323, 0.11453551054000854, 0.199297234416008, -0.107645183801651, -0.1950896829366684, -0.11091887950897217, -0.2478029578924179, 0.3200388252735138, -0.062254685908555984, 0.10066565871238708, -0.07543817907571793, -0.16623729467391968, 0.24070563912391663, 0.5919994115829468, -0.08427954465150833, 0.044052254408597946, 0.13159406185150146, -0.09654577821493149, -0.00838565081357956, -0.07071264088153839, 0.06676214933395386, 0.2853220999240875, 0.06250076740980148, -0.08308129012584686, 0.3606659173965454, -0.011295170523226261, 0.013220924884080887, 0.24553313851356506, 0.20953898131847382, 0.10453782230615616, 0.3212754726409912, -0.05018173158168793, 0.15616758167743683, -0.22712942957878113, 0.10072144865989685, -0.08409199863672256, 0.30734384059906006, -0.43175023794174194, -0.07877573370933533, -0.33309662342071533, -0.04448558762669563, -0.2517330050468445, -0.4446169435977936, -0.18327979743480682, -0.389415979385376, 0.026535820215940475, 0.1415063440799713, -0.023919619619846344, 0.13936012983322144, -0.08337494730949402, 0.1422843635082245, 0.023945676162838936, 0.1416957676410675, -0.1551571935415268, -0.0816909447312355, -0.2539231479167938, -0.03816653788089752, 0.2360556274652481, 0.07245896756649017, 0.3047543466091156, -0.33152464032173157, -0.23679615557193756, -0.07045766711235046, -0.21270331740379333, 0.20861957967281342, -0.1565617173910141, 0.4159516990184784, 0.2300926297903061, 0.44647568464279175, -0.17845533788204193, -0.24776296317577362, 0.15041519701480865, -0.052970945835113525, -0.10247352719306946, -0.19491659104824066, 0.24186156690120697, 0.2612343728542328, -0.07497735321521759, -0.2800053358078003, -0.23113489151000977, -0.3497892916202545, 0.2932516932487488, -0.38476699590682983, 0.03665105998516083, 0.4643356502056122, 0.06430616974830627, 0.28282487392425537, -0.18482562899589539, 0.09905517101287842, -0.1979459822177887, 0.006777409464120865, 0.06778575479984283, -0.036596089601516724, -0.2238389402627945, -0.2112053632736206, -0.0020956583321094513, 0.008547317236661911, 0.023430556058883667, -0.6586369872093201, -0.34323158860206604, -0.28416281938552856, 0.058189135044813156, -0.06987228989601135, 0.012431418523192406, 0.4848441779613495, -0.039609089493751526, 0.029472636058926582, -0.1745392382144928, -0.17601549625396729, -0.07667595893144608, -0.05576124042272568, 0.26454272866249084, -0.07152368873357773, 0.43620145320892334, 0.1062115877866745, 0.5885186195373535, 0.31050989031791687, 0.12176619470119476, 0.14442554116249084, -0.1250825822353363, 0.37275639176368713, -0.1847522258758545, -0.4909575879573822, 0.16987110674381256, -0.19295012950897217, -0.16501523554325104, 0.34396839141845703, -0.06546761840581894, -0.004342222586274147, -0.3497885465621948, 0.0005044527351856232, -0.5691819190979004, -0.5789851546287537, -0.17616191506385803, 0.16598951816558838, -0.012845538556575775, 0.17138671875, 0.04470337927341461, -0.025427106767892838, -0.05865590646862984, 0.11028064787387848, 0.3830406069755554, -0.03319639712572098, -0.03467533737421036, 0.13622723519802094, -0.14263451099395752, -0.23717325925827026, 0.14798307418823242, 0.23622222244739532, 0.22593097388744354, -0.07465063035488129, -0.1743190586566925, 0.09518834203481674, 0.01442781463265419, 0.5066458582878113, -0.013980435207486153, 0.16617512702941895, -0.21116533875465393, 0.12536846101284027, -0.3496167063713074, -0.1428682506084442, -0.1092427670955658, 0.13656270503997803, 0.3739493787288666, 0.475209504365921, -0.30128923058509827, -0.03003235161304474, 0.39418545365333557, 0.3088974058628082, 0.0005508586764335632, 0.031383149325847626, -0.056662216782569885, -0.35915446281433105, -0.30516448616981506, 0.1920681595802307, 0.16646331548690796, 0.10488410294055939, -0.008075506426393986, 0.002043467015028, 0.1478453129529953, -0.11310127377510071, -0.03329522907733917, 0.05280205234885216, 0.16553503274917603, 0.12726189196109772, 0.3098655641078949, 0.3062954246997833, 0.3443107008934021, 0.268819659948349, 0.6437610983848572, -0.07320195436477661, -0.4688066840171814, -0.18032711744308472, -0.030805356800556183, -0.006207205355167389, 0.5633913278579712, -0.007286808453500271, -0.09366842359304428, 0.23078353703022003, 0.42555177211761475, 0.05855817720293999, 0.46391886472702026, 0.46063995361328125, -0.08256258815526962, -0.46386444568634033, -0.1895831823348999, 0.5431419014930725, 0.11093990504741669, -0.11850307881832123, 0.2516654133796692, 0.6074889302253723, -0.26747411489486694, -0.05889284610748291, -0.09704077988862991, 1.0339395999908447, 0.17045193910598755, 0.14068147540092468, 0.5135033130645752, -0.28082823753356934, 0.5835145115852356, 0.18218274414539337, 0.012664257548749447, -0.16209186613559723, -0.14495262503623962, 0.04499009996652603, -0.10599002987146378, -0.07952248305082321, -0.363009512424469, -0.36662212014198303, 0.045853111892938614, -0.31162136793136597, 0.0608644038438797, 0.03557821363210678, 0.07325976341962814, -0.27850204706192017, -0.13815240561962128, -0.25265267491340637, 0.02927336096763611, -0.17086808383464813, 0.357292115688324, -0.062303394079208374, -0.12955805659294128, -0.20218022167682648, -0.1383172571659088, -0.574434757232666, 0.10371626168489456, -0.4699341952800751, -0.07227008789777756, -0.19726921617984772, -0.08404382318258286, 0.2553947865962982, 0.2233262062072754, 0.3510228395462036, 0.12636972963809967, -0.3092429041862488, 0.2027490735054016, -0.15015295147895813, -0.16317118704319, -0.04615439474582672, -0.05102580040693283, 0.5082759261131287, -0.07297609746456146, -0.38740628957748413, 0.0187174454331398, -0.019912466406822205, 0.08134067058563232, -0.022465169429779053, 0.014999780803918839, 0.16960208117961884, -0.49683430790901184, -0.04006233066320419, -0.10869607329368591, 0.3556111752986908, -0.2176431566476822, 0.053458116948604584, 0.07350512593984604, -0.09175549447536469, 0.19448775053024292, -0.01953946426510811, -0.21190756559371948, -0.14181821048259735, 0.41509097814559937, -0.0273306705057621, -0.02495202049612999, 0.6792562007904053, 0.13328348100185394, -0.23503349721431732, -0.13138553500175476, -0.10896994173526764, -0.027640126645565033, -0.6002476811408997, 0.2069370299577713, 0.019161049276590347, 0.24015085399150848, -0.16011960804462433, 0.43100279569625854, 0.21556377410888672, -0.14924296736717224, -0.02274346724152565, -0.43580716848373413, -0.10978060215711594, 0.2496221959590912, -0.05587039515376091, 0.23479795455932617, 0.06939433515071869, 0.45094063878059387, 0.10186628997325897, -0.03726857155561447, -0.2177726924419403, 0.23588962852954865, 0.03934711217880249, 0.1574094295501709, 0.32899585366249084, -0.09345253556966782, 0.35447609424591064, -0.1308377981185913, 0.047915928065776825, 0.2325039654970169, -0.1142997145652771, -0.15105727314949036, -0.2716958224773407, 0.15087266266345978, 0.14324256777763367, -0.2547675371170044, 0.038702405989170074, -0.09705806523561478, 0.11553478240966797, -0.047132980078458786, 0.29417964816093445, 0.150129497051239, 0.0805845558643341, 0.027961254119873047, 0.17823390662670135, 0.10330928862094879, 0.16101762652397156, 0.284210741519928, 0.03388578072190285, 0.1273268759250641, 0.012241585180163383, 0.2179795652627945, -0.14241623878479004, -0.017790257930755615, 0.317874550819397, 0.08732711523771286, 0.07143423706293106, 0.12860387563705444, 0.18634876608848572, -0.3619406819343567, -0.027390524744987488, 0.10600758343935013, 0.30606579780578613, 0.618965208530426, -0.08405844122171402, -0.26461854577064514, 0.2341655194759369, 0.09311556071043015, -0.2284684181213379, 0.040243569761514664, 0.5001572966575623, -0.1466904878616333, 0.05437619611620903, 0.16593477129936218, -0.07387354224920273, -0.04101382941007614, -0.14493101835250854, -0.07787258923053741, 0.3814408779144287, 0.1840704083442688, 0.21482257544994354, 0.5609369874000549, -0.269654780626297, -0.04850367084145546, 0.02551504783332348, 0.06431480497121811, 0.2301633656024933, 0.21281488239765167, -0.22566074132919312, 0.026364780962467194, -0.5698958039283752, 0.1433560997247696, 0.11210786551237106, -0.24091564118862152, 0.2203652709722519, 0.22912397980690002, -0.2938656508922577, 0.05480178818106651, -0.05666327476501465, 0.5066614151000977, -0.29023176431655884, -0.05842076987028122, -0.2081739753484726, 0.2874208390712738, -0.11563045531511307, -0.06135682016611099, 0.20538492500782013, -0.20813891291618347, -0.2517226040363312, 0.0995742678642273, -0.08153361082077026, -0.1360427886247635, 0.1753685027360916, 0.16985967755317688, -0.040914252400398254, -0.2072179764509201, -0.42763036489486694, 0.3475022614002228, 0.24769800901412964, -0.26045554876327515, 0.12349338084459305, 0.1021852120757103, -0.25460535287857056, -0.08733204007148743, 0.43282806873321533, 0.41632702946662903, 0.14913490414619446, -0.23330065608024597, -0.02276260405778885, 0.0762610137462616, 0.21554571390151978, 0.10785296559333801, 0.17169798910617828, 0.18519914150238037, 0.05585358291864395, 0.46959060430526733, 0.09326550364494324, -0.180847629904747, 0.22984647750854492, -0.32015347480773926, -0.01566305384039879, -0.5499457120895386, -0.15913605690002441, -0.24398544430732727, 0.08923051506280899, -0.33907264471054077, -0.06607737392187119, -0.2701496183872223, 0.04223746433854103, 0.14300258457660675, -0.05223322659730911, 0.1298157274723053, -0.06358558684587479, 0.038503631949424744, 0.10021744668483734, 0.47071903944015503, 0.7289170622825623, -0.007217764854431152, -0.009600306861102581, -0.19187164306640625, -0.5655456185340881, 0.04488171637058258, -0.1121511459350586, -0.09312920272350311, 0.20614953339099884, -0.03888057917356491, -0.16402971744537354, 0.13834737241268158, 0.4218316078186035, 0.2464144378900528, -0.20496417582035065, 0.01640082523226738, -0.1580095887184143, -0.23753373324871063, -0.1044219434261322, -0.12913398444652557, 0.14684206247329712, -0.2231118381023407, 0.20799581706523895, -0.09464370459318161, -0.09834606945514679, 0.03237156942486763, 0.03344838321208954, -0.0918932855129242, -0.4195617437362671, 0.3500610291957855, 0.2674056887626648, 0.17849676311016083, 0.06414077430963516, -0.44877758622169495, -0.2997857928276062, -0.08238691091537476, -0.2522481083869934, 0.21544724702835083, 0.13348932564258575, 0.3458223342895508, -0.03240687772631645, -0.11150553822517395, -0.2840701639652252, 0.21182620525360107, 0.33114272356033325, -0.10438895225524902, -0.08964045345783234, -0.2295926809310913, 0.10367225855588913, 0.06100726127624512, 0.28786700963974, 0.4567579925060272, -0.3425067365169525, 0.42746850848197937, -0.26235297322273254, -0.47823527455329895, 0.6660148501396179, -0.38790616393089294, -0.12845313549041748, -0.1251085102558136, 0.4079103469848633, 0.09252135455608368, -0.3268323242664337, -0.5508496761322021, 0.0019098669290542603, 0.24460387229919434, 0.049250416457653046, -0.18680226802825928, 0.2665908932685852, -0.12926742434501648, -0.07713509351015091, 0.051400136202573776, 0.5842050313949585, 0.18864071369171143, -0.0371791273355484, 0.3715019226074219, -0.09205293655395508 ]
https://github.com/huggingface/datasets/issues/2969
medical-dialog error
@ldery, you can find the answer in the corresponding Discussion on the Hub: https://huggingface.co/datasets/wikitext/discussions/9 You need to update the `datasets` library: ```shell pip install -U datasets ```
## Describe the bug A clear and concise description of what the bug is. When I attempt to download the huggingface datatset medical_dialog it errors out midway through ## Steps to reproduce the bug ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English") ``` ## Expected results A clear and concise description of the expected results. No error ## Actual results ``` 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits) 72 ] 73 if len(bad_splits) > 0: ---> 74 raise NonMatchingSplitsSizesError(str(bad_splits)) 75 logger.info("All the splits matched successfully.") 76 NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}] ``` Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.21.1 - Platform: colab - Python version: colab 3.7 - PyArrow version: N/A
27
medical-dialog error ## Describe the bug A clear and concise description of what the bug is. When I attempt to download the huggingface datatset medical_dialog it errors out midway through ## Steps to reproduce the bug ```python raw_datasets = load_dataset("medical_dialog", "en", split="train", download_mode="force_redownload", data_dir="./Medical-Dialogue-Dataset-English") ``` ## Expected results A clear and concise description of the expected results. No error ## Actual results ``` 3 frames /usr/local/lib/python3.7/dist-packages/datasets/utils/info_utils.py in verify_splits(expected_splits, recorded_splits) 72 ] 73 if len(bad_splits) > 0: ---> 74 raise NonMatchingSplitsSizesError(str(bad_splits)) 75 logger.info("All the splits matched successfully.") 76 NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='medical_dialog'), 'recorded': SplitInfo(name='train', num_bytes=295097913, num_examples=229674, dataset_name='medical_dialog')}] ``` Specify the actual results or traceback. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.21.1 - Platform: colab - Python version: colab 3.7 - PyArrow version: N/A @ldery, you can find the answer in the corresponding Discussion on the Hub: https://huggingface.co/datasets/wikitext/discussions/9 You need to update the `datasets` library: ```shell pip install -U datasets ```
[ -0.14542004466056824, -0.3687911033630371, 0.13191333413124084, 0.2803281843662262, 0.08745589852333069, 0.15935540199279785, 0.13505473732948303, 0.3608304262161255, -0.04720678925514221, 0.07731160521507263, -0.2833976447582245, 0.15366435050964355, -0.03796195611357689, 0.4521380066871643, -0.050960756838321686, -0.24205848574638367, -0.034455083310604095, 0.12952814996242523, -0.13014164566993713, 0.10110226273536682, -0.25569605827331543, 0.2607858180999756, -0.41743528842926025, 0.19021740555763245, -0.15764084458351135, -0.19529107213020325, -0.07437649369239807, 0.18386858701705933, -0.16883043944835663, -0.3504440188407898, 0.06208224594593048, -0.24344706535339355, -0.1622021496295929, 0.48742878437042236, -0.0001212797942571342, -0.09299162775278091, 0.41667240858078003, -0.012645093724131584, -0.6538084745407104, -0.31071603298187256, -0.17901137471199036, -0.10802692919969559, 0.24664261937141418, -0.03253989666700363, 0.095856674015522, 0.11447128653526306, -0.01715431548655033, -0.16772973537445068, 0.42389774322509766, 0.4112091660499573, 0.13883525133132935, 0.44429588317871094, 0.08408054709434509, -0.09848544746637344, 0.06629457324743271, -0.010146282613277435, -0.19417443871498108, 0.2511442303657532, 0.23211412131786346, 0.07928682118654251, 0.2812311351299286, 0.36255544424057007, -0.031063441187143326, -0.03514045849442482, 0.007276419550180435, 0.1310231238603592, -0.06628405302762985, -0.35029512643814087, 0.04335197061300278, 0.5288334488868713, 0.40476977825164795, -0.3654475212097168, -0.30935144424438477, -0.49934980273246765, 0.014188642613589764, -0.3010028302669525, 0.33662158250808716, 0.19986529648303986, -0.3396190404891968, 0.189115509390831, -0.1719496101140976, -0.18218615651130676, -0.02624252811074257, 0.1652558147907257, -0.01738680526614189, 0.0630960538983345, -0.128246009349823, 0.18449059128761292, 0.20414695143699646, 0.040782589465379715, 0.035015277564525604, 0.10458678752183914, -0.06405988335609436, 0.18774966895580292, -0.30929768085479736, -0.039690740406513214, -0.14179781079292297, 0.6912588477134705, 0.3618006110191345, -0.13252325356006622, -0.1245759129524231, -0.18395912647247314, -0.21366235613822937, 0.0009869635105133057, 0.5415757298469543, -0.022876165807247162, 0.03896145895123482, 0.09933190792798996, 0.08433958888053894, 0.4545048773288727, 0.1933090090751648, -0.040797919034957886, 0.24228930473327637, -0.27990201115608215, -0.0397937148809433, -0.16328439116477966, 0.25308650732040405, -0.21335124969482422, -0.2981300950050354, 0.13921064138412476, -0.14474618434906006, 0.2874802350997925, 0.09808717668056488, 0.14599590003490448, -0.3042216897010803, 0.06798266619443893, 0.23730747401714325, -0.0750570222735405, -0.35939374566078186, -0.18841062486171722, -0.11186686158180237, 0.15624040365219116, -0.17188845574855804, 0.10891324281692505, 0.0021455101668834686, -0.265320748090744, 0.17281828820705414, 0.07010112702846527, 0.35226380825042725, -0.10980477184057236, -0.32201334834098816, -0.11933790147304535, -0.2153717279434204, 0.3447815775871277, 0.010280109941959381, 0.3717595040798187, 0.03490239754319191, -0.2767837941646576, -0.0526089109480381, 0.04043201357126236, -0.20971742272377014, -0.24888689815998077, -0.33891987800598145, 0.12431095540523529, -0.3027040362358093, 0.1397552490234375, -0.3506491184234619, 0.03386932238936424, 0.12429547309875488, -0.3122067153453827, 0.15939727425575256, -0.18968766927719116, -0.2365875244140625, -0.07377443462610245, 0.18046687543392181, 0.6502560377120972, -0.16653913259506226, -0.10348503291606903, -0.366316020488739, -0.1648653745651245, 0.05064346641302109, 0.25607407093048096, -0.14379754662513733, 0.13115248084068298, -0.4933343827724457, 0.34616196155548096, 0.1151004284620285, -0.4523008465766907, -0.6113725900650024, 0.1237158253788948, -0.2621724605560303, 0.23521681129932404, -0.08352694660425186, -0.026446986943483353, 0.08254031836986542, -0.08729201555252075, 0.12130184471607208, 0.2313714176416397, -0.0637362003326416, 0.0812678411602974, -0.38826507329940796, -0.3355022370815277, 0.027070019394159317, 0.11216595768928528, 0.10687191039323807, -0.05821327120065689, -0.0021597668528556824, 0.27151694893836975, 0.5546472668647766, 0.12127849459648132, 0.026011794805526733, 0.06620095670223236, 0.16095072031021118, 0.2418900728225708, 0.039608828723430634, -0.4950348436832428, -0.7322199940681458, 0.12332826107740402, 0.05267654359340668, 0.0010437294840812683, -0.39362120628356934, -0.19857126474380493, -0.41057783365249634, 0.06541407853364944, -0.1745132952928543, -0.06678201258182526, 0.038453854620456696, 0.13525830209255219, -0.0039039701223373413, 0.32729610800743103, -0.15429705381393433, 0.7299280166625977, 0.11266961693763733, 0.43203580379486084, -0.3581646680831909, 0.2997014820575714, -0.05980964004993439, -0.11843740940093994, 0.04716600477695465, -0.03502024710178375, 0.14450287818908691, -0.06958585977554321, -0.19035929441452026, 0.5613914728164673, 0.17804120481014252, 0.3178555965423584, -0.2962539494037628, -0.19772832095623016, 0.45576924085617065, -0.2845419943332672, -0.2126055657863617, -0.16110867261886597, 0.19579117000102997, 0.08764339238405228, 0.002776365727186203, -0.13085778057575226, -0.267232745885849, 0.1501999944448471, 0.12871867418289185, 0.27807316184043884, -0.12981925904750824, -0.20403999090194702, -0.14714108407497406, -0.2599557638168335, 0.43866926431655884, -0.06112572178244591, 0.06954050064086914, -0.10410360991954803, -0.31927359104156494, 0.17455822229385376, 0.5316150784492493, -0.1338658481836319, 0.12573134899139404, 0.11718877404928207, -0.10912903398275375, 0.053342364728450775, -0.08968590199947357, -0.03110656701028347, 0.2906531095504761, 0.11043944209814072, -0.0481865219771862, 0.328044593334198, -0.02432856336236, -0.054068274796009064, 0.16797181963920593, 0.2178531140089035, 0.03513818234205246, 0.2778213918209076, -0.10849477350711823, 0.07892511785030365, -0.26105815172195435, 0.0241476371884346, -0.07876627892255783, 0.24228042364120483, -0.4616573452949524, -0.06952130049467087, -0.31058815121650696, -0.0887562483549118, -0.25271162390708923, -0.4839867949485779, -0.14855742454528809, -0.28903037309646606, 0.03796496242284775, 0.21250474452972412, -0.027292238548398018, 0.06653256714344025, -0.08851350098848343, 0.07971562445163727, -0.0015803668648004532, 0.056237831711769104, -0.07200063019990921, -0.01821232959628105, -0.23324891924858093, -0.0230379831045866, 0.193150132894516, 0.1417233943939209, 0.3408399224281311, -0.35235396027565, -0.28996938467025757, 0.006180065684020519, -0.1818130761384964, 0.279965877532959, -0.15199530124664307, 0.4356516897678375, 0.2659960985183716, 0.42226672172546387, -0.18521365523338318, -0.1018730103969574, 0.16641107201576233, -0.002755211666226387, -0.14389842748641968, -0.10854901373386383, 0.23635971546173096, 0.20834381878376007, -0.16520725190639496, -0.23722687363624573, -0.21301139891147614, -0.3947611153125763, 0.26785337924957275, -0.37359708547592163, 0.031204096972942352, 0.4706876873970032, 0.11337188631296158, 0.3148411512374878, -0.2110580950975418, 0.1609240025281906, -0.22050531208515167, 0.09737446904182434, 0.09965619444847107, -0.03823111206293106, -0.21562974154949188, -0.1974886804819107, -0.02114168368279934, -0.07960931956768036, 0.03101533092558384, -0.6621390581130981, -0.368427574634552, -0.2588284909725189, 0.017996959388256073, -0.06945095956325531, 0.04134349152445793, 0.45564648509025574, -0.11894895136356354, 0.0423976331949234, -0.17946460843086243, -0.171991765499115, -0.04848750680685043, -0.09634480625391006, 0.26442453265190125, -0.047092974185943604, 0.4069840908050537, 0.1647203117609024, 0.39627331495285034, 0.3584175705909729, 0.1648074984550476, 0.11193441599607468, -0.1870783418416977, 0.4103361666202545, -0.08083681017160416, -0.4537106156349182, 0.15386544167995453, -0.11495986580848694, -0.21501359343528748, 0.3135140538215637, -0.047599151730537415, 0.05135394632816315, -0.4024639129638672, -0.0018627848476171494, -0.481729656457901, -0.5558721423149109, -0.23994310200214386, 0.18123649060726166, -0.01238800585269928, 0.09806419909000397, 0.05703107267618179, 0.14656858146190643, -0.004817097447812557, 0.07577407360076904, 0.39728474617004395, -0.049474604427814484, 0.0007945589022710919, 0.1577984094619751, -0.18158869445323944, -0.11894949525594711, 0.12049726396799088, 0.23421111702919006, 0.18594121932983398, -0.11245231330394745, -0.1749187707901001, 0.10917550325393677, 0.009225978516042233, 0.5580677390098572, 0.0975574254989624, 0.1950131058692932, -0.2655627727508545, 0.12233473360538483, -0.39336156845092773, -0.06545217335224152, -0.14685580134391785, 0.10697394609451294, 0.3251544237136841, 0.5398083329200745, -0.34653621912002563, 0.019983960315585136, 0.41140732169151306, 0.30400368571281433, -0.013518672436475754, -0.08438555151224136, -0.13962198793888092, -0.3885384500026703, -0.28440332412719727, 0.2470586597919464, 0.26798874139785767, 0.09689208120107651, 0.06190551072359085, -0.05893564969301224, 0.25631192326545715, -0.1383833885192871, -0.00654139369726181, 0.1071476936340332, 0.18419313430786133, -0.026361681520938873, 0.3443058431148529, 0.3258074223995209, 0.27579084038734436, 0.31526637077331543, 0.7148966193199158, -0.02919549122452736, -0.5366164445877075, -0.15864607691764832, -0.07321205735206604, 0.024828121066093445, 0.47401538491249084, -0.018865151330828667, -0.12629663944244385, 0.2210967242717743, 0.42629361152648926, 0.06193440407514572, 0.40072011947631836, 0.395131379365921, -0.15052376687526703, -0.4575168490409851, -0.12292978167533875, 0.5147268176078796, 0.0649527758359909, -0.06817540526390076, 0.1604631543159485, 0.5641375780105591, -0.24049577116966248, -0.08300740271806717, -0.20121371746063232, 1.0419992208480835, 0.19472448527812958, 0.10638725757598877, 0.49587827920913696, -0.29016679525375366, 0.5547009706497192, 0.21378250420093536, -0.0013352502137422562, -0.16689853370189667, -0.14924344420433044, 0.028860772028565407, -0.10372692346572876, -0.08778754621744156, -0.3086808919906616, -0.3911995589733124, 0.08368293195962906, -0.327800452709198, 0.06663022935390472, 0.07110017538070679, 0.07852941006422043, -0.24327021837234497, -0.13902652263641357, -0.23427969217300415, 0.05706269294023514, -0.14585411548614502, 0.3218844532966614, -0.016834860667586327, -0.12808629870414734, -0.17070646584033966, -0.19162234663963318, -0.5257952213287354, 0.10758105665445328, -0.49132171273231506, -0.14220459759235382, -0.19313010573387146, -0.07205244898796082, 0.2335740327835083, 0.22009091079235077, 0.23582680523395538, 0.17731624841690063, -0.3052489161491394, 0.1769893914461136, -0.09202732890844345, -0.24367403984069824, -0.06232823431491852, -0.0030634901486337185, 0.45408228039741516, -0.06513921171426773, -0.352489709854126, 0.040909454226493835, 0.06966892629861832, 0.09300407767295837, 0.026644915342330933, 0.059629179537296295, 0.06758683174848557, -0.401378870010376, -0.002287408336997032, -0.12408863008022308, 0.3612203896045685, -0.177850142121315, 0.06652642786502838, 0.12349462509155273, -0.1632973700761795, 0.18174827098846436, 0.00677407905459404, -0.2268979549407959, -0.17445048689842224, 0.395845502614975, -0.045143768191337585, -0.01990477927029133, 0.4854741096496582, 0.2013774961233139, -0.28239983320236206, -0.19175031781196594, -0.08731339871883392, -0.12790349125862122, -0.5490963459014893, 0.25236397981643677, 0.07361584156751633, 0.26441437005996704, -0.1772497445344925, 0.39163967967033386, 0.2238875776529312, -0.2699330747127533, -0.04155240207910538, -0.4363003373146057, -0.06494911760091782, 0.24760273098945618, -0.04759320244193077, 0.18952973186969757, 0.13923189043998718, 0.44447189569473267, 0.12123993039131165, -0.09513241052627563, -0.2325374186038971, 0.23480363190174103, -0.007899938151240349, 0.13557252287864685, 0.35964351892471313, -0.044540226459503174, 0.3564980626106262, -0.0980822741985321, 0.07990419119596481, 0.26361793279647827, -0.04274902865290642, -0.16645848751068115, -0.24463823437690735, 0.1361922174692154, 0.14558610320091248, -0.23496690392494202, -0.021806500852108, -0.13587713241577148, 0.08892686665058136, -0.020641667768359184, 0.31385666131973267, 0.2552329897880554, 0.06810881942510605, 0.05013857036828995, 0.10487499833106995, 0.12628549337387085, 0.15130385756492615, 0.28891944885253906, 0.038079146295785904, 0.23300467431545258, 0.0033219601027667522, 0.20226669311523438, -0.13705138862133026, -0.0408836230635643, 0.27021855115890503, 0.10430283099412918, 0.13763272762298584, 0.0837630182504654, 0.18301212787628174, -0.34874171018600464, 0.016360174864530563, 0.07738949358463287, 0.3506244421005249, 0.616503119468689, -0.10788071900606155, -0.16968441009521484, 0.1530933380126953, 0.12247871607542038, -0.22492681443691254, 0.07957741618156433, 0.3367266058921814, -0.14102795720100403, 0.080510213971138, 0.2209763526916504, -0.13800087571144104, 0.020027168095111847, -0.1665768176317215, -0.07151204347610474, 0.38966143131256104, 0.2722366452217102, 0.12522156536579132, 0.5141307711601257, -0.28615856170654297, -0.03173576667904854, 0.014882543124258518, 0.0415007583796978, 0.3116183280944824, 0.23078405857086182, -0.24725452065467834, -0.04521023482084274, -0.49835237860679626, 0.13575464487075806, 0.1220000833272934, -0.15112712979316711, 0.09834699332714081, 0.27913594245910645, -0.20348218083381653, 0.04451707750558853, -0.09747160971164703, 0.5163566470146179, -0.3644413650035858, 0.002392437541857362, -0.2305934578180313, 0.15979693830013275, -0.06910689175128937, 0.013667955994606018, 0.19283300638198853, -0.18185433745384216, -0.3990240693092346, 0.09444159269332886, -0.014403097331523895, -0.16086560487747192, 0.23064284026622772, 0.1834861934185028, 0.008029699325561523, -0.26036715507507324, -0.44823896884918213, 0.4495041072368622, 0.15658119320869446, -0.3454073369503021, 0.11192261427640915, 0.139915332198143, -0.2023237645626068, -0.08101524412631989, 0.3658660650253296, 0.39164844155311584, 0.10233630985021591, -0.2006319910287857, -0.07620146125555038, 0.010360432788729668, 0.2159297913312912, 0.053712524473667145, 0.17509645223617554, 0.1677222102880478, 0.13302473723888397, 0.5209560394287109, 0.11292380094528198, -0.20372189581394196, 0.29726094007492065, -0.2764023542404175, -0.031093169003725052, -0.5806622505187988, -0.07648324221372604, -0.37075987458229065, 0.12541964650154114, -0.3874867856502533, -0.15896505117416382, -0.370113343000412, 0.012639030814170837, 0.14342623949050903, -0.10872422158718109, 0.1005283072590828, -0.06867261230945587, 0.03557562828063965, 0.10008308291435242, 0.4061179757118225, 0.7439557909965515, 0.09927058219909668, -0.03479877486824989, -0.1847744882106781, -0.4953739643096924, 0.07564955204725266, -0.1521114706993103, -0.13148193061351776, 0.12118068337440491, 0.016048984602093697, -0.1302168369293213, 0.21660256385803223, 0.34753504395484924, 0.2087167352437973, -0.1942138969898224, 0.1000077947974205, -0.005681231617927551, -0.26980432868003845, -0.07751636207103729, -0.14568538963794708, 0.14661169052124023, -0.30775582790374756, 0.16169075667858124, -0.16340017318725586, -0.08454811573028564, -0.009752914309501648, 0.014068603515625, -0.04500288516283035, -0.4203874170780182, 0.3450213372707367, 0.23043446242809296, 0.2217802107334137, 0.04044979810714722, -0.44629260897636414, -0.24280482530593872, -0.0765274316072464, -0.2658768594264984, 0.1683279275894165, 0.13364429771900177, 0.2832200825214386, -0.06768936663866043, -0.10072973370552063, -0.26455560326576233, 0.21931172907352448, 0.2886750102043152, -0.16033166646957397, -0.06699894368648529, -0.2738279700279236, 0.03646140545606613, 0.020781317725777626, 0.184223011136055, 0.41079866886138916, -0.35945579409599304, 0.34026023745536804, -0.22425994277000427, -0.5165045857429504, 0.5885695815086365, -0.3006059527397156, -0.12832994759082794, -0.1381535679101944, 0.4651497006416321, 0.16852010786533356, -0.331453800201416, -0.5762200951576233, 0.02040030062198639, 0.22970253229141235, 0.06543079018592834, -0.18056347966194153, 0.29871588945388794, -0.14822936058044434, -0.07609251886606216, 0.04705386236310005, 0.6324238777160645, 0.2582516670227051, -0.03164026141166687, 0.45535850524902344, -0.07803015410900116 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
This is because you have to specify which split corresponds to what file: ```python data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"} brand_new_dataset_2 = load_dataset("ds", data_files=data_files) ``` Otherwise it tries to concatenate the two splits, and it fails because they don't have the same features. It works with save_to_disk/load_from_disk because it also stores json files that contain the information about which files goes into which split
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
64
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 This is because you have to specify which split corresponds to what file: ```python data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"} brand_new_dataset_2 = load_dataset("ds", data_files=data_files) ``` Otherwise it tries to concatenate the two splits, and it fails because they don't have the same features. It works with save_to_disk/load_from_disk because it also stores json files that contain the information about which files goes into which split
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
I may be mistaken but I think the following doesn't work either: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"} brand_new_dataset_2 = load_dataset("ds", data_files=data_files) ```
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
45
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 I may be mistaken but I think the following doesn't work either: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") data_files = {"train": "train/split.parquet", "validation": "validation/split.parquet"} brand_new_dataset_2 = load_dataset("ds", data_files=data_files) ```
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
It works on my side as soon as the directories named `ds/train` and `ds/validation` exist (otherwise it returns a FileNotFoundError). What error are you getting ?
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
26
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 It works on my side as soon as the directories named `ds/train` and `ds/validation` exist (otherwise it returns a FileNotFoundError). What error are you getting ?
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
Also we may introduce a default mapping for the data files: ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` this way if you name your files according to the splits you won't have to specify the data_files parameter. What do you think ? I moved this discussion to #3027
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
52
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 Also we may introduce a default mapping for the data files: ```python { "train": ["*train*"], "test": ["*test*"], "validation": ["*dev*", "valid"], } ``` this way if you name your files according to the splits you won't have to specify the data_files parameter. What do you think ? I moved this discussion to #3027
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
I'm getting the following error: ``` Downloading and preparing dataset custom_squad/plain_text to /home/lysandre/.cache/huggingface/datasets/lhoestq___custom_squad)/plain_text/1.0.0/397916d1ae99584877e0fb4f5b8b6f01e66fcbbeff4d178afb30c933a8d0d93a... 100%|██████████| 2/2 [00:00<00:00, 7760.04it/s] 100%|██████████| 2/2 [00:00<00:00, 2020.38it/s] 0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last): File "<input>", line 1, in <module> File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 12, in <module> ds = load_dataset("lhoestq/custom_squad") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1207, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 823, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 854, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 924, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` Tried on current master, after updating latest dependencies and obtained the same result
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
237
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 I'm getting the following error: ``` Downloading and preparing dataset custom_squad/plain_text to /home/lysandre/.cache/huggingface/datasets/lhoestq___custom_squad)/plain_text/1.0.0/397916d1ae99584877e0fb4f5b8b6f01e66fcbbeff4d178afb30c933a8d0d93a... 100%|██████████| 2/2 [00:00<00:00, 7760.04it/s] 100%|██████████| 2/2 [00:00<00:00, 2020.38it/s] 0%| | 0/2 [00:00<?, ?it/s]Traceback (most recent call last): File "<input>", line 1, in <module> File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "/opt/pycharm-professional/plugins/python/helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 12, in <module> ds = load_dataset("lhoestq/custom_squad") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1207, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 823, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 854, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 924, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` Tried on current master, after updating latest dependencies and obtained the same result
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
I just tried again on colab by installing `datasets` from source with pyarrow 3.0.0 and didn't get any error. You error seems to happen when doing ```python ds = load_dataset("lhoestq/custom_squad") ``` More specifically it fails when trying to read the arrow file that just got generated. I haven't issues like this before. Can you make sure you have a recent version of `pyarrow` ? Maybe it was an old version that wrote the arrow file and some header was missing.
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
80
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 I just tried again on colab by installing `datasets` from source with pyarrow 3.0.0 and didn't get any error. You error seems to happen when doing ```python ds = load_dataset("lhoestq/custom_squad") ``` More specifically it fails when trying to read the arrow file that just got generated. I haven't issues like this before. Can you make sure you have a recent version of `pyarrow` ? Maybe it was an old version that wrote the arrow file and some header was missing.
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2968
`DatasetDict` cannot be exported to parquet if the splits have different features
Thank you for your pointer! This seems to have been linked to Python 3.9.7: it works flawlessly with Python 3.8.6. This can be closed, thanks a lot for your help.
## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0
30
`DatasetDict` cannot be exported to parquet if the splits have different features ## Describe the bug I'm trying to use parquet as a means of serialization for both `Dataset` and `DatasetDict` objects. Using `to_parquet` alongside `from_parquet` or `load_dataset` for a `Dataset` works perfectly. For `DatasetDict`, I use `to_parquet` on each split to save the parquet files in individual folders representing individual splits. This works too, as long as the splits have identical features. If a split has different features to neighboring splits, then loading the dataset will fail: a single schema is used to load both splits, resulting in a failure to load the second parquet file. ## Steps to reproduce the bug The following works as expected: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` Modifying a single split to add a new feature ends up in a crash: ```python from datasets import load_dataset ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds['train'].to_parquet("./ds/train/split.parquet") ds['validation'].to_parquet("./ds/validation/split.parquet") brand_new_dataset = load_dataset("ds") ``` ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 26, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1151, in load_dataset builder_instance.download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 642, in download_and_prepare self._download_and_prepare( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 732, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 1194, in _prepare_split writer.write_table(table) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in write_table pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_writer.py", line 428, in <listcomp> pa_table = pa.Table.from_arrays([pa_table[name] for name in self._schema.names], schema=self._schema) File "pyarrow/table.pxi", line 1257, in pyarrow.lib.Table.__getitem__ File "pyarrow/table.pxi", line 1833, in pyarrow.lib.Table.column File "pyarrow/table.pxi", line 1808, in pyarrow.lib.Table._ensure_integer_index KeyError: 'Field "identical_answers" does not exist in table schema' ``` It does work, however, to use the `save_to_disk` and `load_from_disk` methods: ```py from datasets import load_from_disk ds = load_dataset("lhoestq/custom_squad") def identical_answers(e): e['identical_answers'] = len(set(e['answers']['text'])) == 1 return e ds['validation'] = ds['validation'].map(identical_answers) ds.save_to_disk("local_path") brand_new_dataset = load_from_disk("local_path") ``` ## Expected results The saving works correctly - but the loading fails. I would expect either an error when saving or an error-less instantiation of the dataset through the parquet files. If it's helpful, I've traced a possible patch to the `write_table` method here: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L424-L425 The writer is built only if the parquet writer is `None`, but I expect we would want to build a new writer as the table schema has changed. Furthermore, it relies on having the property `update_features` set to `True` in order to update the features: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/arrow_writer.py#L254-L255 but the `ArrowWriter` is instantiated without that option in the `_prepare_split` method of the `ArrowBasedBuilder`: https://github.com/huggingface/datasets/blob/26ff41aa3a642e46489db9e95be1e9a8c4e64bea/src/datasets/builder.py#L1190 Updating these two parts to recreate a schema on each split results in an error that is, unfortunately, out of my expertise: ``` File "/home/lysandre/.config/JetBrains/PyCharm2021.2/scratches/datasets/upload_dataset.py", line 27, in <module> brand_new_dataset = load_dataset("ds") File "/home/lysandre/Workspaces/Python/datasets/src/datasets/load.py", line 1163, in load_dataset ds = builder_instance.as_dataset(split=split, ignore_verifications=ignore_verifications, in_memory=keep_in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 819, in as_dataset datasets = utils.map_nested( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 207, in map_nested mapped = [ File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 208, in <listcomp> _single_map_nested((function, obj, types, None, True)) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/utils/py_utils.py", line 143, in _single_map_nested return function(data_struct) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 850, in _build_single_dataset ds = self._as_dataset( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/builder.py", line 920, in _as_dataset dataset_kwargs = ArrowReader(self._cache_dir, self.info).read( File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 217, in read return self.read_files(files=files, original_instructions=instructions, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 238, in read_files pa_table = self._read_files(files, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 173, in _read_files pa_table: Table = self._get_table_from_filename(f_dict, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 308, in _get_table_from_filename table = ArrowReader.read_table(filename, in_memory=in_memory) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/arrow_reader.py", line 327, in read_table return table_cls.from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 458, in from_file table = _memory_mapped_arrow_table_from_file(filename) File "/home/lysandre/Workspaces/Python/datasets/src/datasets/table.py", line 45, in _memory_mapped_arrow_table_from_file pa_table = opened_stream.read_all() File "pyarrow/ipc.pxi", line 563, in pyarrow.lib.RecordBatchReader.read_all File "pyarrow/error.pxi", line 114, in pyarrow.lib.check_status OSError: Header-type of flatbuffer-encoded Message is not RecordBatch. ``` ## Environment info - `datasets` version: 1.12.2.dev0 - Platform: Linux-5.14.7-arch1-1-x86_64-with-glibc2.33 - Python version: 3.9.7 - PyArrow version: 5.0.0 Thank you for your pointer! This seems to have been linked to Python 3.9.7: it works flawlessly with Python 3.8.6. This can be closed, thanks a lot for your help.
[ -0.15334481000900269, -0.008550651371479034, 0.05414239689707756, 0.45907628536224365, 0.09087401628494263, 0.05311182886362076, 0.25642499327659607, 0.20468764007091522, 0.1695539355278015, 0.08044016361236572, 0.25335249304771423, 0.3629653751850128, -0.13072361052036285, 0.45816922187805176, -0.16499216854572296, -0.26058056950569153, 0.18082061409950256, -0.03977644443511963, 0.1971469223499298, 0.039224304258823395, -0.13550680875778198, 0.21226286888122559, 0.0949326753616333, -0.05798603594303131, 0.07642018049955368, 0.08572452515363693, -0.17218567430973053, 0.031395189464092255, -0.040717653930187225, -0.4404962360858917, 0.13080616295337677, 0.11390842497348785, 0.03301902860403061, 0.06383045017719269, -0.00012095509737264365, 0.12636786699295044, 0.10892143845558167, -0.14687488973140717, -0.15534673631191254, -0.2253270000219345, 0.0722789615392685, -0.327614963054657, 0.1342095285654068, -0.2398257553577423, -0.07214058190584183, -0.023064851760864258, -0.1887054145336151, -0.3661789000034332, 0.057595688849687576, 0.08724280446767807, 0.0884058028459549, 0.24359777569770813, 0.25346487760543823, -0.1587027907371521, 0.30935192108154297, 0.24602927267551422, -0.35256463289260864, -0.09579652547836304, 0.2942000925540924, -0.026796074584126472, 0.23720046877861023, -0.01253278274089098, -0.013100373558700085, -0.18662159144878387, -0.010019756853580475, 0.03577636554837227, 0.20167550444602966, -0.04722161591053009, -0.004858296364545822, 0.17083631455898285, 0.3730291724205017, -0.30782923102378845, -0.21397200226783752, -0.4796130955219269, -0.004347622394561768, -0.4512830972671509, 0.12487765401601791, 0.22192175686359406, 0.3061760663986206, 0.07173818349838257, 0.2438838630914688, -0.30511024594306946, -0.01950504630804062, -0.10605515539646149, -0.20551465451717377, -0.0361596941947937, 0.0323045440018177, 0.27563023567199707, -0.26079609990119934, -0.1307297945022583, -0.19529642164707184, -0.039540037512779236, -0.10486064851284027, -0.08720618486404419, -0.28812962770462036, -0.16369777917861938, 0.021832384169101715, -0.5100029706954956, 0.08400996774435043, 0.05210883170366287, 0.12986886501312256, -0.10453764349222183, 0.2107425332069397, 0.0668162927031517, 0.6997102499008179, -0.21175771951675415, 0.06290340423583984, 0.33089348673820496, -0.20216743648052216, 0.35351675748825073, -0.2645009160041809, -0.09226072579622269, 0.2147274762392044, 0.013098620809614658, 0.06608216464519501, -0.06179983913898468, 0.7261019349098206, -0.2778938412666321, -0.2827644348144531, 0.3140605688095093, -0.06903166323900223, -0.018465984612703323, -0.022757910192012787, 0.17253902554512024, 0.274394690990448, 0.11467183381319046, -0.17802689969539642, 0.5176939368247986, -0.1419946402311325, -0.38226285576820374, -0.17942620813846588, 0.00768665224313736, -0.08972018957138062, 0.20876839756965637, -0.04940704256296158, 0.14950568974018097, -0.21621735394001007, 0.47347381711006165, -0.3237040638923645, -0.122493676841259, -0.06735352426767349, -0.3026715815067291, -0.11633584648370743, -0.16838166117668152, 0.009182058274745941, 0.18936052918434143, 0.26577457785606384, -0.20593810081481934, -0.36329737305641174, -0.16375640034675598, -0.41591209173202515, -0.11698833107948303, -0.06637904793024063, 0.12628747522830963, -0.16687171161174774, 0.06062474101781845, -0.3843913674354553, 0.4787820875644684, 0.14062392711639404, -0.3588173985481262, -0.08646313101053238, -0.19400596618652344, -0.29689183831214905, -0.22297614812850952, 0.013574698939919472, 0.42603957653045654, -0.3764190077781677, 0.015170961618423462, 0.20665442943572998, -0.20783665776252747, 0.2506176233291626, 0.354379266500473, -0.28334999084472656, 0.15103977918624878, -0.2686645984649658, 0.08580267429351807, 0.36185479164123535, -0.042014408856630325, -0.1179698258638382, 0.12157099694013596, -0.34125661849975586, 0.3513433337211609, 0.25010183453559875, -0.27396756410598755, 0.701282262802124, -0.08060352504253387, -0.10275821387767792, 0.27332085371017456, -0.1434350162744522, -0.1584819257259369, -0.38880786299705505, -0.10021065175533295, 0.49528372287750244, -0.07385002076625824, 0.034884013235569, -0.13438525795936584, 0.07097435742616653, 0.39456257224082947, 0.18505454063415527, -0.10215122997760773, 0.032404497265815735, 0.03472547605633736, 0.18510842323303223, 0.4772477149963379, -0.03992661088705063, -0.38507023453712463, -0.4081050753593445, 0.30029162764549255, -0.13722971081733704, -0.11156335473060608, -0.012054204940795898, -0.01070813275873661, -0.046552836894989014, 0.03721856325864792, -0.11431446671485901, -0.031157080084085464, 0.06977610290050507, 0.18052582442760468, -0.040180712938308716, 0.13990533351898193, -0.18013665080070496, 0.18316756188869476, -0.06792432069778442, 0.05807776004076004, -0.36558037996292114, 0.5434343814849854, 0.05966714769601822, -0.40793249011039734, 0.06635375320911407, 0.12224902212619781, 0.3252883851528168, -0.2313496470451355, 0.032635435461997986, 0.20402225852012634, 0.34643271565437317, 0.19217276573181152, -0.22245776653289795, -0.126153364777565, 0.041171737015247345, -0.15829135477542877, -0.021744167432188988, 0.2696450650691986, 0.1211622953414917, -0.004949260503053665, -0.3899845480918884, 0.3378594219684601, 0.06668531894683838, 0.3024725019931793, 0.20496495068073273, -0.03448393568396568, 0.15283352136611938, -0.08583728969097137, -0.1044742614030838, -0.28497886657714844, -0.0404023639857769, -0.1805184781551361, -0.2627165913581848, -0.04077976197004318, -0.4981928765773773, 0.19417425990104675, 0.45540478825569153, 0.12752756476402283, 0.1528485268354416, -0.262344092130661, 0.27794384956359863, -0.10937542468309402, -0.0063425712287425995, 0.19217298924922943, 0.40448546409606934, 0.09945205599069595, 0.14812608063220978, 0.0026015955954790115, -0.19428890943527222, 0.060374513268470764, 0.15710553526878357, 0.05713752284646034, 0.0014192941598594189, 0.4877779185771942, 0.2879689037799835, 0.14257866144180298, -0.22364699840545654, -0.08209347724914551, -0.009023454040288925, -0.1301548331975937, -0.3222861886024475, 0.13765612244606018, -0.3830345571041107, 0.37328699231147766, -0.6004141569137573, 0.17812207341194153, -0.20336750149726868, -0.2806483507156372, 0.05960054695606232, 0.31620123982429504, -0.3759005069732666, -0.07663780450820923, -0.26174935698509216, -0.06738124787807465, -0.2911253571510315, -0.33659979701042175, 0.2566409707069397, -0.15138542652130127, -0.07145713269710541, -0.08113755285739899, 0.05212406814098358, 0.30307304859161377, 0.09421863406896591, 0.027975255623459816, -0.17633573710918427, -0.5506230592727661, -0.1967490315437317, 0.26185137033462524, -0.17792576551437378, -0.018554111942648888, 0.17279747128486633, -0.10096731781959534, 0.23374642431735992, -0.4144861400127411, 0.49257829785346985, -0.03580750152468681, -0.006601659581065178, 0.2643788754940033, 0.0900096595287323, -0.08313693106174469, 0.13072030246257782, -0.31131166219711304, -0.2345551997423172, -0.22563433647155762, 0.15922603011131287, -0.040704112499952316, 0.1187283992767334, -0.32007208466529846, -0.05073590949177742, -0.14238907396793365, 0.06484794616699219, 0.023819180205464363, -0.10006525367498398, 0.08296699821949005, 0.048747606575489044, -0.06589365005493164, -0.2630802392959595, 0.04452577605843544, 0.21839016675949097, -0.0337156243622303, 0.29575955867767334, -0.2080758661031723, 0.3681338429450989, -0.08196931332349777, 0.0343024842441082, -0.1908911019563675, -0.13583385944366455, 0.3194732069969177, 0.20938661694526672, 0.07433819025754929, -0.10951990634202957, -0.2680376172065735, 0.09248583763837814, 0.25802746415138245, 0.1739186942577362, -0.37954673171043396, 0.47127851843833923, -0.04657665267586708, 0.6406769752502441, 0.050541605800390244, 0.2284090369939804, 0.6799254417419434, 0.020188434049487114, 0.26974180340766907, -0.1240958496928215, -0.31033578515052795, 0.13715994358062744, -0.19380974769592285, -0.2400679886341095, 0.38375282287597656, -0.3943690061569214, -0.111672542989254, 0.01534777507185936, -0.08409081399440765, 0.10514520853757858, -0.44009360671043396, 0.06558984518051147, -0.008059602230787277, 0.3359188139438629, -0.2210535705089569, -0.0036958344280719757, -0.0292053185403347, 0.2553589940071106, 0.21859385073184967, 0.12577681243419647, 0.05582176893949509, 0.05298260971903801, -0.7201970219612122, -0.03445758670568466, 0.09548918902873993, -0.10333511233329773, -0.10891483724117279, 0.40133923292160034, -0.24801896512508392, -0.27771931886672974, -0.03238797187805176, -0.15125446021556854, 0.6593564748764038, 0.18959543108940125, 0.28624773025512695, 0.2509380877017975, -0.11133789271116257, -0.469577819108963, -0.389313668012619, -0.0800277590751648, 0.1654067039489746, -0.06525683403015137, 0.7223883271217346, -0.34751689434051514, 0.04537545144557953, -0.015752915292978287, 0.4758285880088806, -0.21932201087474823, 0.02093951404094696, -0.34054720401763916, 0.08669299632310867, -0.3715525269508362, 0.28032737970352173, -0.015457697212696075, 0.5063053965568542, -0.11888893693685532, 0.027265477925539017, -0.3385113477706909, -0.28003180027008057, 0.08231611549854279, 0.3493826985359192, 0.441204696893692, -0.39354589581489563, 0.36292117834091187, -0.19754508137702942, 0.2817774713039398, 0.3182268440723419, 0.692078709602356, 0.047178834676742554, -0.8483594655990601, 0.1944691240787506, 0.029489416629076004, 0.16841208934783936, 0.21756207942962646, -0.03636522963643074, 0.04548582062125206, -0.3003482520580292, -0.23473568260669708, -0.29172489047050476, -0.13435807824134827, 0.16399072110652924, -0.34235092997550964, -0.4701465964317322, 0.0008266381919384003, 0.2585703730583191, 0.10666152834892273, -0.012239165604114532, -0.06088288128376007, 0.3875191807746887, -0.36816686391830444, 0.6588236093521118, -0.039565034210681915, 0.603340208530426, -0.043859563767910004, -0.1136559247970581, 0.08714674413204193, -0.5013269782066345, 0.4603491723537445, 0.08405156433582306, 0.05958354100584984, -0.24027913808822632, -0.3446817100048065, 0.16568975150585175, -0.06564159691333771, 0.33511173725128174, 0.20468474924564362, -0.12278777360916138, 0.3637590706348419, -0.05870278924703598, 0.062433868646621704, -0.4719259738922119, 0.40253034234046936, 0.03271961957216263, 0.04533303901553154, -0.4370174705982208, 0.014150474220514297, -0.06974990665912628, -0.12673446536064148, -0.013074113056063652, -0.08185751736164093, -0.20422561466693878, -0.25338518619537354, -0.3095162510871887, 0.18273583054542542, -0.010288482531905174, 0.11235660314559937, 0.01806401088833809, -0.22579701244831085, 0.23930126428604126, 0.1165742576122284, 0.1463499665260315, 0.015500357374548912, -0.05648649483919144, -0.2608703076839447, 0.03212355449795723, -0.054581064730882645, -0.2447013258934021, 0.014551942236721516, 0.24805264174938202, 0.018036022782325745, 0.03416658192873001, 0.046510256826877594, -0.007035025395452976, -0.005403384566307068, -0.13621118664741516, 0.16623598337173462, 0.4568327069282532, -0.4472609758377075, -0.3273690342903137, -0.08819080889225006, 0.2780528664588928, -0.4227038621902466, 0.00786852277815342, 0.0452926829457283, -0.16638623178005219, -0.17972370982170105, -0.4221920967102051, -0.05641820654273033, -0.04795290157198906, 0.10870105773210526, 0.02082955464720726, 0.22484779357910156, 0.3397395610809326, 0.09730522334575653, -0.07436329126358032, -0.09645910561084747, 0.15571600198745728, 0.41701191663742065, -0.423300176858902, 0.25813955068588257, -0.20339806377887726, 0.030010700225830078, -0.0432901531457901, 0.32643309235572815, 0.18191753327846527, -0.06992308050394058, 0.1431487500667572, -0.23456375300884247, 0.12589837610721588, 0.107962965965271, 0.00846041738986969, 0.15654371678829193, 0.16837859153747559, 0.16744746267795563, -0.2721550464630127, 0.13365218043327332, -0.1702156960964203, 0.12599444389343262, -0.07086655497550964, 0.17171043157577515, 0.4038711190223694, 0.012444738298654556, -0.4723609685897827, -0.0910830944776535, 0.07471197098493576, -0.2647305130958557, 0.11185876280069351, 0.0062261223793029785, -0.20109710097312927, 0.18281228840351105, 0.16680192947387695, 0.5147873163223267, -0.31171348690986633, -0.203088641166687, 0.15531238913536072, -0.1377178430557251, 0.2923029363155365, 0.20734313130378723, -0.09319758415222168, 0.02643410488963127, 0.7894743084907532, 0.26735159754753113, -0.4810027480125427, 0.09336568415164948, 0.05013684555888176, -0.046426281332969666, 0.05857079103589058, 0.14616751670837402, -0.1914280503988266, 0.030327752232551575, -0.3817453384399414, 0.14926990866661072, 0.16342103481292725, 0.31521013379096985, 0.06976988166570663, -0.0726768970489502, -0.12862850725650787, 0.41239234805107117, 0.12011325359344482, 0.6619812250137329, -0.08603429049253464, -0.16436904668807983, 0.1312265396118164, 0.10069681704044342, 0.03639492392539978, -0.18095026910305023, 0.3424535095691681, -0.10459453612565994, -0.0039488039910793304, 0.2665272057056427, 0.27496957778930664, 0.007525242865085602, -0.3292086720466614, 0.1403878927230835, 0.4984515905380249, 0.11149445921182632, 0.614255964756012, 0.4708070158958435, -0.06991813331842422, 0.16723431646823883, -0.13117820024490356, 0.0147369634360075, 0.11045369505882263, 0.21865157783031464, -0.12025650590658188, 0.30837416648864746, 0.48288851976394653, -0.09260730445384979, 0.40174147486686707, 0.055494535714387894, -0.11106324195861816, -0.019978389143943787, 0.34781408309936523, 0.07277657091617584, -0.07292875647544861, -0.20643281936645508, -0.3089781105518341, -0.3645288944244385, 0.08019087463617325, 0.15608063340187073, -0.12746793031692505, -0.11779777705669403, 0.1682412475347519, -0.22795552015304565, -0.16771718859672546, 0.08810350298881531, -0.15837052464485168, 0.08557144552469254, 0.11041911691427231, -0.08493335545063019, -0.05931931734085083, -0.24710743129253387, -0.16431480646133423, 0.12446271628141403, 0.18758302927017212, -0.21093663573265076, 0.269209086894989, 0.10938475281000137, -0.37634462118148804, 0.1064988374710083, 0.031889721751213074, 0.2232847362756729, 0.24223540723323822, -0.10246671736240387, -0.04949156939983368, 0.0735805481672287, 0.045265235006809235, 0.0987255647778511, 0.04771120846271515, -0.2535952627658844, 0.21174895763397217, 0.35355377197265625, -0.024102944880723953, -0.03833087533712387, -0.07811197638511658, 0.36565303802490234, 0.04382333904504776, -0.46684497594833374, 0.4262342154979706, -0.15180635452270508, -0.0500592477619648, 0.1556989699602127, 0.09630726277828217, -0.26029685139656067, -0.3794238269329071, 0.031036674976348877, 0.29519644379615784, 0.13511314988136292, 0.18294574320316315, 0.02999502420425415, 0.2657601535320282, 0.21360163390636444, 0.12576952576637268, -0.35835686326026917, -0.22334647178649902, 0.1356859803199768, -0.5371881127357483, 0.4334346652030945, -0.41509461402893066, -0.20523138344287872, 0.3288310468196869, 0.5053151845932007, 0.2963609993457794, 0.17191612720489502, 0.019234828650951385, 0.42006662487983704, -0.20819184184074402, 0.19418901205062866, -0.21254056692123413, -0.16628693044185638, 0.238840252161026, -0.21505706012248993, -0.005132833495736122, -0.15610775351524353, 0.3119557201862335, 0.06302729994058609, -0.09694688767194748, 0.055979859083890915, -0.2578052282333374, -0.09631161391735077, -0.152232825756073, 0.15537238121032715, 0.22344693541526794, 0.11302987486124039, -0.05952483415603638, -0.19619590044021606, -0.3895415961742401, -0.16918325424194336, -0.2769434154033661, 0.5582708716392517, -0.04346776381134987, 0.4906248152256012, -0.17089496552944183, 0.14702172577381134, -0.21050313115119934, 0.043529264628887177, -0.010717835277318954, -0.18800702691078186, -0.1366107165813446, 0.3038186728954315, 0.22463539242744446, 0.018808560445904732, 0.11340941488742828, 0.17234964668750763, -0.009748972952365875, 0.15175025165081024, -0.0514836423099041, -0.3534661829471588, 0.15103603899478912, -0.18508467078208923, -0.5370296239852905, -0.08479299396276474, 0.2987781763076782, 0.21228620409965515, 0.12061678618192673, -0.533339262008667, -0.15698212385177612, 0.3521803915500641, -0.06623772531747818, 0.13153882324695587, -0.10255630314350128, 0.1426089107990265, -0.20795369148254395, 0.10618990659713745, 0.14445218443870544, 0.10873055458068848, -0.13044513761997223, 0.21231374144554138, -0.22144438326358795 ]
https://github.com/huggingface/datasets/issues/2964
Error when calculating Matthews Correlation Coefficient loaded with `load_metric`
After some more tests I've realized that this "issue" is due to the `numpy.float64` to `float` conversion, but when defining a function named `compute_metrics` as it follows: ```python def compute_metrics(eval_preds): metric = load_metric("matthews_correlation") logits, labels = eval_preds predictions = np.argmax(logits, axis=1) return metric.compute(predictions=predictions, references=labels) ``` It fails when the evaluation metrics are computed in the `Trainer` with the same error code `AttributeError: 'float' object has no attribute 'item'` as the output is not a `numpy.float64`... Maybe I'm doing something wrong, not sure!
## Describe the bug After loading the metric named "[Matthews Correlation Coefficient](https://huggingface.co/metrics/matthews_correlation)" from `🤗datasets`, the `.compute` method fails with the following exception `AttributeError: 'float' object has no attribute 'item'` (complete stack trace can be provided if required). ## Steps to reproduce the bug ```python import torch predictions = torch.ones((10,)) references = torch.zeros((10,)) from datasets import load_metric METRIC = load_metric("matthews_correlation") result = METRIC.compute(predictions=predictions, references=references) ``` ## Expected results We should expect a Python `dict` as it follows: ``` { "matthews_correlation": float() } ``` as defined in https://github.com/huggingface/datasets/blob/master/metrics/matthews_correlation/matthews_correlation.py, so the fix will imply removing `.item()`, since the value returned by the `scikit-learn` function is not a `torch.Tensor` but a `float`, which means that the `.item()` will fail. ## Actual results ``` Traceback (most recent call last): File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 59, in main app() File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 214, in __call__ return get_command(self)(*args, **kwargs) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1137, in __call__ return self.main(*args, **kwargs) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1668, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 763, in invoke return __callback(*args, **kwargs) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper return callback(**use_params) # type: ignore File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 43, in train metrics = trainer.evaluate() File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2051, in evaluate output = eval_loop( File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2292, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/home/alvaro.bartolome/XXX/xxx/metrics.py", line 20, in compute_metrics res = METRIC.compute(predictions=predictions, references=eval_preds.label_ids) File "/home/alvaro.bartolome/miniconda3/envs/lang/lib/python3.9/site-packages/datasets/metric.py", line 402, in compute output = self._compute(predictions=predictions, references=references, **kwargs) File "/home/alvaro.bartolome/.cache/huggingface/modules/datasets_modules/metrics/matthews_correlation/0275f1e9a4d318e3ea8cdd87547ee0d58d894966616052e3d18444ac8ddd2357/matthews_correlation.py", line 88, in _compute "matthews_correlation": matthews_corrcoef(references, predictions, sample_weight=sample_weight).item(), AttributeError: 'float' object has no attribute 'item' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.15.0-1113-azure-x86_64-with-glibc2.23 - Python version: 3.9.7 - PyArrow version: 5.0.0
82
Error when calculating Matthews Correlation Coefficient loaded with `load_metric` ## Describe the bug After loading the metric named "[Matthews Correlation Coefficient](https://huggingface.co/metrics/matthews_correlation)" from `🤗datasets`, the `.compute` method fails with the following exception `AttributeError: 'float' object has no attribute 'item'` (complete stack trace can be provided if required). ## Steps to reproduce the bug ```python import torch predictions = torch.ones((10,)) references = torch.zeros((10,)) from datasets import load_metric METRIC = load_metric("matthews_correlation") result = METRIC.compute(predictions=predictions, references=references) ``` ## Expected results We should expect a Python `dict` as it follows: ``` { "matthews_correlation": float() } ``` as defined in https://github.com/huggingface/datasets/blob/master/metrics/matthews_correlation/matthews_correlation.py, so the fix will imply removing `.item()`, since the value returned by the `scikit-learn` function is not a `torch.Tensor` but a `float`, which means that the `.item()` will fail. ## Actual results ``` Traceback (most recent call last): File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 59, in main app() File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 214, in __call__ return get_command(self)(*args, **kwargs) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1137, in __call__ return self.main(*args, **kwargs) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1062, in main rv = self.invoke(ctx) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1668, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/click/core.py", line 763, in invoke return __callback(*args, **kwargs) File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/typer/main.py", line 500, in wrapper return callback(**use_params) # type: ignore File "/home/alvaro.bartolome/XXX/xxx/cli.py", line 43, in train metrics = trainer.evaluate() File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2051, in evaluate output = eval_loop( File "/home/alvaro.bartolome/miniconda3/envs/xxx/lib/python3.9/site-packages/transformers/trainer.py", line 2292, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/home/alvaro.bartolome/XXX/xxx/metrics.py", line 20, in compute_metrics res = METRIC.compute(predictions=predictions, references=eval_preds.label_ids) File "/home/alvaro.bartolome/miniconda3/envs/lang/lib/python3.9/site-packages/datasets/metric.py", line 402, in compute output = self._compute(predictions=predictions, references=references, **kwargs) File "/home/alvaro.bartolome/.cache/huggingface/modules/datasets_modules/metrics/matthews_correlation/0275f1e9a4d318e3ea8cdd87547ee0d58d894966616052e3d18444ac8ddd2357/matthews_correlation.py", line 88, in _compute "matthews_correlation": matthews_corrcoef(references, predictions, sample_weight=sample_weight).item(), AttributeError: 'float' object has no attribute 'item' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-4.15.0-1113-azure-x86_64-with-glibc2.23 - Python version: 3.9.7 - PyArrow version: 5.0.0 After some more tests I've realized that this "issue" is due to the `numpy.float64` to `float` conversion, but when defining a function named `compute_metrics` as it follows: ```python def compute_metrics(eval_preds): metric = load_metric("matthews_correlation") logits, labels = eval_preds predictions = np.argmax(logits, axis=1) return metric.compute(predictions=predictions, references=labels) ``` It fails when the evaluation metrics are computed in the `Trainer` with the same error code `AttributeError: 'float' object has no attribute 'item'` as the output is not a `numpy.float64`... Maybe I'm doing something wrong, not sure!
[ -0.13466307520866394, -0.3452947735786438, 0.07861173152923584, 0.3539235591888428, 0.2162502259016037, 0.048133835196495056, 0.2270004153251648, 0.22813981771469116, 0.16031593084335327, 0.36559462547302246, -0.07641089707612991, 0.5783469676971436, 0.011695577763020992, 0.054774753749370575, -0.20285627245903015, -0.24565839767456055, -0.019286662340164185, 0.1806839108467102, -0.05533201992511749, 0.1620572954416275, -0.06797102093696594, 0.3707423508167267, -0.20875278115272522, -0.030013933777809143, -0.043490879237651825, -0.18767215311527252, 0.16108405590057373, 0.15299548208713531, -0.12073493748903275, -0.13708430528640747, 0.36906808614730835, -0.04797716811299324, -0.08425270766019821, 0.48260366916656494, -0.00011834919860120863, -0.07849667221307755, 0.5682634115219116, -0.08736913651227951, -0.1573248654603958, -0.61451256275177, 0.38218843936920166, -0.06058139353990555, 0.5335689187049866, -0.21955357491970062, -0.08198978006839752, 0.24345411360263824, -0.3503490686416626, -0.2158297300338745, 0.4596739411354065, 0.19926884770393372, 0.14979185163974762, 0.6678838729858398, 0.15224456787109375, -0.2836017906665802, 0.40877658128738403, 0.04983868449926376, -0.03862898424267769, 0.6020990014076233, 0.0675271600484848, -0.22661015391349792, -0.00793910026550293, 0.1865921914577484, -0.0014301184564828873, 0.14720450341701508, 0.3905888795852661, 0.06087164580821991, 0.02387281134724617, -0.117453932762146, 0.18257537484169006, 0.1177005022764206, 0.331285297870636, -0.1309375762939453, -0.06563082337379456, 0.14991453289985657, 0.1480364054441452, -0.20102465152740479, 0.24910518527030945, 0.04188859462738037, -0.23401112854480743, -0.4360601305961609, 0.07118220627307892, 0.13616332411766052, -0.22392886877059937, 0.19577765464782715, -0.1927136331796646, 0.5140112638473511, -0.3415761888027191, 0.1640297770500183, 0.35555240511894226, 0.14476734399795532, 0.22620204091072083, 0.181228905916214, -0.15823906660079956, 0.19215279817581177, -0.4125952422618866, 0.022921115159988403, -0.026871733367443085, -0.02031777799129486, 0.18252503871917725, -0.029710762202739716, 0.43026167154312134, 0.08368605375289917, 0.3610846996307373, 0.32738423347473145, 0.049260079860687256, 0.4633025825023651, -0.09399720281362534, 0.2572135627269745, 0.10838495194911957, 0.5407497882843018, -0.04128436744213104, -0.23375403881072998, 0.05001954734325409, -0.22452260553836823, -0.07113112509250641, 0.010323398746550083, 0.03153591975569725, -0.2133672684431076, -0.5427337288856506, -0.013626608066260815, -0.07031603902578354, 0.19046469032764435, 0.29215550422668457, 0.39125919342041016, -0.07395235449075699, 0.3816756010055542, 0.20891977846622467, 0.18805386126041412, -0.07160729169845581, 0.17862509191036224, -0.21268388628959656, 0.32400768995285034, -0.04261261969804764, 0.028359781950712204, 0.14511741697788239, -0.2120114266872406, 0.4561866819858551, 0.06741543859243393, 0.735268771648407, -0.31001096963882446, 0.048133693635463715, -0.023388125002384186, 0.11616400629281998, 0.3191412389278412, -0.24114036560058594, -0.028044581413269043, 0.2253660410642624, -0.172264963388443, -0.09649023413658142, -0.018093764781951904, -0.6707665920257568, -0.23430342972278595, -0.04000284522771835, 0.11490187793970108, -0.2478632628917694, -0.05549272149801254, -0.18438610434532166, 0.19204135239124298, 0.03497571498155594, -0.08850592374801636, -0.15140819549560547, -0.041507504880428314, -0.5505476593971252, -0.1501431167125702, 0.46646133065223694, 0.2627125382423401, -0.22416390478610992, -0.2059202492237091, 0.035646773874759674, 0.2769384980201721, 0.019411779940128326, -0.19755348563194275, -0.34523969888687134, 0.27071279287338257, -0.13538993895053864, -0.2437266856431961, 0.20006930828094482, -0.5237420201301575, -0.13847099244594574, -0.1423727124929428, -0.12294727563858032, -0.03383296728134155, 0.006978660821914673, -0.13096103072166443, 0.18986161053180695, -0.020882384851574898, 0.2575109601020813, -0.026868492364883423, -0.016863713040947914, -0.047127172350883484, -0.2678298056125641, -0.15091010928153992, 0.41081374883651733, 0.11705571413040161, 0.0910865068435669, -0.0006379559636116028, 0.022100895643234253, 0.0015589697286486626, 0.09460403025150299, -0.053866785019636154, -0.13770408928394318, 0.1160319522023201, -0.07248017191886902, 0.008036337792873383, 0.2567484378814697, -0.06693615019321442, -0.29911527037620544, 0.22530636191368103, -0.439033180475235, 0.28796690702438354, -0.3368983268737793, -0.04910409450531006, -0.49124664068222046, 0.13447368144989014, -0.13975612819194794, -0.17763255536556244, 0.09191809594631195, -0.2390711009502411, 0.14756253361701965, 0.017825160175561905, -0.08542563021183014, 0.05448164790868759, -0.13997142016887665, 0.07954461872577667, -0.28085091710090637, 0.238743856549263, -0.07356906682252884, -0.10429255664348602, 0.2588181495666504, 0.28214868903160095, 0.32053136825561523, -0.15553539991378784, -0.39496049284935, 0.4376567304134369, -0.20536655187606812, 0.13052842020988464, 0.1792733073234558, 0.00960645079612732, 0.1575319766998291, -0.13233767449855804, 0.0002759937196969986, -0.0014346465468406677, 0.427419513463974, -0.13607147336006165, 0.16477546095848083, 0.5870985984802246, 0.03888067230582237, 0.2791694402694702, -0.3235207200050354, 0.05260470509529114, -0.13189782202243805, 0.26529595255851746, 0.013210704550147057, 0.029183045029640198, 0.144666388630867, 0.08730125427246094, -0.036931052803993225, -0.44725939631462097, 0.15184389054775238, -0.16205856204032898, -0.1269606649875641, 0.026934001594781876, -0.13930588960647583, 0.11391487717628479, -0.19719940423965454, -0.06109442934393883, -0.057317063212394714, -0.26195424795150757, 0.6510863900184631, 0.02558557689189911, -0.21325120329856873, -0.00628533773124218, -0.077745221555233, -0.1695219874382019, 0.14575311541557312, 0.4468926191329956, -0.01117559615522623, 0.04808083921670914, 0.571740448474884, 0.04110265150666237, -0.0684935450553894, 0.20977403223514557, -0.06571449339389801, 0.09749126434326172, -0.2907077968120575, 0.40624862909317017, 0.2107156217098236, 0.4068443775177002, -0.03134182468056679, 0.12087320536375046, -0.3450479805469513, -0.4318832457065582, 0.039107345044612885, 0.3303700387477875, -0.025827595964074135, 0.02547738328576088, 0.2210879921913147, 0.365105539560318, 0.24748073518276215, -0.1855095475912094, -0.21613484621047974, -0.33249375224113464, -0.12721705436706543, -0.02063770219683647, -0.057076580822467804, 0.051033854484558105, 0.25891682505607605, -0.08255042135715485, 0.09546153992414474, -0.06337443739175797, -0.5338913202285767, -0.02263927459716797, -0.038858138024806976, 0.3302342891693115, 0.21040260791778564, -0.14155077934265137, -0.21476517617702484, -0.13270336389541626, 0.4183851480484009, -0.44944918155670166, 0.08175981044769287, 0.2543353736400604, -0.07865460216999054, 0.04057897999882698, -0.04048480838537216, -0.1780359447002411, -0.05860751122236252, -0.23442277312278748, -0.05755697190761566, 0.216049924492836, 0.04640069603919983, -0.3639867901802063, -0.010447675362229347, 0.09939099848270416, -0.11610588431358337, 0.240650475025177, -0.32357722520828247, -0.5167628526687622, 0.25621846318244934, -0.23620571196079254, -0.4920794665813446, 0.07563203573226929, 0.004854373633861542, 0.09553024172782898, -0.05765552818775177, -0.23227012157440186, -0.7143226265907288, -0.05040006339550018, 0.09306590259075165, -0.4623413681983948, 0.29282262921333313, 0.19333884119987488, 0.022386066615581512, 0.027930432930588722, -0.2276708483695984, -0.13766971230506897, 0.25108224153518677, -0.0521569550037384, -0.015929661691188812, -0.06733793020248413, -0.06157422810792923, -0.14373409748077393, 0.42345649003982544, 0.2290206253528595, -0.36534014344215393, 0.18408121168613434, -0.05904487520456314, 0.31854957342147827, -0.2130846083164215, -0.15742602944374084, -0.09078341722488403, -0.15222352743148804, 0.23193325102329254, 0.2256568968296051, 0.014684103429317474, -0.0722140520811081, -0.5350519418716431, -0.03735480457544327, -0.11444859951734543, -0.3729572296142578, 0.054663583636283875, -0.34297582507133484, 0.1650591492652893, 0.11767435073852539, 0.15905451774597168, -0.2949039936065674, -0.2711051404476166, 0.3270592987537384, 0.16212165355682373, -0.14145779609680176, -0.03264545276761055, 0.26887014508247375, -0.20268961787223816, -0.5226548314094543, 0.27503150701522827, 0.11130285263061523, 0.2990250885486603, 0.014057982712984085, -0.01549927331507206, 0.04928174242377281, 0.01922290027141571, 0.46024519205093384, 0.017351774498820305, -0.03595387935638428, 0.2832881808280945, 0.03227882832288742, -0.39233168959617615, -0.09105096757411957, -0.3705258369445801, 0.2782420814037323, -0.12168630957603455, 0.43906840682029724, -0.20113569498062134, -0.16644704341888428, 0.07536625862121582, 0.3853012025356293, -0.22628435492515564, -0.3985206186771393, -0.5461329817771912, -0.23261305689811707, -0.035157814621925354, 0.020860686898231506, 0.06191905587911606, 0.48168331384658813, 0.0018771989271044731, -0.019646678119897842, -0.07811553031206131, -0.2019553780555725, 0.04545970633625984, 0.0249931700527668, 0.23199093341827393, -0.10619743913412094, 0.1390923708677292, 0.3522707521915436, 0.22821535170078278, -0.30401140451431274, 0.43225646018981934, 0.028657875955104828, -0.15900200605392456, -0.055226825177669525, 0.057695385068655014, -0.02626737207174301, 0.285879522562027, -0.31902599334716797, 0.06392184644937515, -0.37814584374427795, 0.3154628872871399, -0.16313742101192474, 0.09713815897703171, 0.1484001725912094, 0.1572289913892746, 0.019546695053577423, 0.06512897461652756, 0.5332162976264954, 0.014563120901584625, 0.02583671361207962, 0.2600039839744568, 0.26217901706695557, -0.1007961854338646, 0.3142282962799072, 0.13006287813186646, 1.001237154006958, -0.0043753981590271, -0.055272262543439865, 0.42892658710479736, -0.03458177670836449, 0.6764636635780334, -0.22044022381305695, 0.020704612135887146, -0.22496530413627625, -0.28926804661750793, -0.023036494851112366, -0.19060690701007843, 0.055764272809028625, -0.36883115768432617, -0.23303914070129395, 0.37915846705436707, -0.4173354506492615, 0.36157354712486267, 0.040582723915576935, 0.02421790361404419, -0.029057810083031654, -0.35796886682510376, -0.05266682803630829, 0.08195462822914124, -0.03380490094423294, 0.2551683783531189, -0.07150766253471375, 0.00753621943295002, -0.20722509920597076, -0.4036697745323181, -0.14463794231414795, -0.07404332607984543, -0.5660861730575562, 0.1961374282836914, 0.0625435933470726, -0.44430291652679443, 0.2524817883968353, -0.16834953427314758, 0.32976627349853516, 0.0379868745803833, -0.13864654302597046, 0.2101508229970932, -0.2607600688934326, -0.04531254991889, 0.11296458542346954, 0.10876253992319107, 0.22467079758644104, -0.06204685568809509, -0.15120694041252136, 0.11920943111181259, -0.19354122877120972, 0.15962271392345428, 0.28238406777381897, 0.16202671825885773, 0.12973611056804657, -0.30881962180137634, -0.056817248463630676, -0.19786888360977173, 0.0013261735439300537, -0.17136451601982117, 0.1050267219543457, 0.1416134238243103, -0.27992209792137146, -0.0014879107475280762, 0.07206708192825317, -0.23031681776046753, 0.09156153351068497, 0.39512789249420166, -0.2420838475227356, -0.23714418709278107, 0.17302994430065155, 0.0031825415790081024, -0.08255606144666672, -0.06057659536600113, -0.2192850410938263, 0.04624441638588905, -0.5618137717247009, 0.21889090538024902, 0.10710518807172775, -0.16192792356014252, -0.30793124437332153, 0.5956175923347473, 0.21192842721939087, 0.03321729600429535, 0.0217018760740757, -0.48147904872894287, -0.1915847808122635, 0.03454411029815674, 0.16173891723155975, -0.04347079619765282, 0.03248085826635361, 0.08345122635364532, -0.09731543064117432, 0.07763472199440002, -0.262631356716156, 0.017972014844417572, -0.07730920612812042, 0.1253787875175476, 0.39443230628967285, -0.14949476718902588, 0.4393819272518158, 0.09881807863712311, 0.0207716953009367, 0.430411696434021, -0.09589226543903351, -0.15548890829086304, -0.07504351437091827, 0.09812591224908829, -0.06362612545490265, 0.01107322983443737, -0.20480258762836456, 0.02916596084833145, -0.16842730343341827, -0.24741682410240173, 0.2381729781627655, -0.0027239806950092316, -0.10813009738922119, 0.04039344936609268, -0.04261152073740959, 0.28850728273391724, 0.042403727769851685, 0.2065553367137909, 0.02480337768793106, 0.30736231803894043, -0.1722722202539444, 0.04113999754190445, -0.15541870892047882, -0.08685560524463654, -0.014584199525415897, 0.22183415293693542, -0.2598830461502075, -0.17804831266403198, 0.27576199173927307, -0.02896168828010559, -0.22341288626194, -0.08017940074205399, 0.2625485062599182, 0.3142487704753876, -0.16343650221824646, 0.0443703755736351, 0.07345745712518692, 0.0670318603515625, -0.278331458568573, -0.06703746318817139, -0.2030714899301529, 0.2802698612213135, 0.12270911037921906, 0.20943424105644226, 0.16992352902889252, -0.20487818121910095, -0.2493283897638321, -0.01848112791776657, 0.30340948700904846, -0.21886992454528809, 0.2639795243740082, -0.26772335171699524, 0.2195262759923935, 0.15218402445316315, 0.3016793131828308, 0.03023206815123558, 0.19259464740753174, 0.17323434352874756, -0.10194074362516403, 0.49048930406570435, -0.017350897192955017, 0.14494472742080688, 0.0008683428168296814, -0.13173913955688477, 0.18024076521396637, 0.17297957837581635, 0.31530189514160156, 0.0662027895450592, -0.09269711375236511, 0.9000798463821411, -0.3051968514919281, -0.21176089346408844, -0.24709059298038483, -0.04546505585312843, -0.0003548078238964081, -0.058371588587760925, 0.02291060984134674, -0.3096107542514801, -0.1827908158302307, -0.25017717480659485, 0.24388334155082703, 0.0968930795788765, 0.14252869784832, 0.0992189422249794, -0.10893915593624115, -0.1568099558353424, -0.3317074775695801, 0.436872661113739, 0.3033420443534851, -0.1320568323135376, 0.10429132729768753, 0.3855840563774109, 0.007255956530570984, 0.058200858533382416, -0.00539255328476429, 0.5305773019790649, 0.20795908570289612, -0.2214994728565216, 0.07780975848436356, -0.08382302522659302, -0.13131029903888702, 0.24910613894462585, 0.2225828617811203, 0.13061104714870453, -0.30573713779449463, 0.28420090675354004, 0.11956024169921875, -0.26282694935798645, -0.05419212207198143, 0.014020252972841263, 0.4767847955226898, -0.13135762512683868, 0.2854061424732208, -0.24638211727142334, -0.14555606245994568, -0.39948245882987976, -0.11607720702886581, -0.23890379071235657, 0.39238378405570984, -0.32038068771362305, 0.16893340647220612, 0.06548241525888443, -0.087050661444664, 0.0671101063489914, 0.15235859155654907, 0.3258216977119446, 0.02751970663666725, -0.022510923445224762, -0.3808714747428894, -0.15055257081985474, -0.4308902621269226, 0.2445579171180725, 0.24659785628318787, -0.07679819315671921, 0.11865232139825821, 0.1069020926952362, -0.0033963248133659363, 0.20688579976558685, 0.253098726272583, 0.12401320040225983, 0.4418641924858093, -0.356508731842041, -0.4355396628379822, -0.31546592712402344, -0.42034685611724854, -0.41529789566993713, 0.21108846366405487, -0.15530793368816376, -0.20711611211299896, -0.2625626027584076, 0.07574690133333206, -0.26341110467910767, -0.18273547291755676, -0.35045236349105835, 0.18594563007354736, 0.2816290855407715, 0.16032031178474426, 0.42625322937965393, -0.05784548074007034, 0.18097685277462006, -0.048857953399419785, -0.19941216707229614, -0.07357947528362274, 0.09877054393291473, -0.06597775220870972, 0.10691282153129578, -0.07060914486646652, -0.09592892229557037, -0.3196061849594116, 0.18675582110881805, 0.09433548152446747, -0.376487135887146, -0.7068971395492554, 0.16850624978542328, 0.04801293462514877, 0.14975899457931519, 0.06821773201227188, 0.45535996556282043, 0.0008846893906593323, 0.16592511534690857, -0.1899602711200714, -0.4057556688785553, 0.728453516960144, -0.36271166801452637, -0.32836607098579407, 0.2902156710624695, 0.2461128830909729, 0.0938015729188919, -0.036796458065509796, -0.7591121196746826, 0.30517077445983887, 0.1100468561053276, 0.10914357751607895, -0.10126498341560364, 0.27988770604133606, -0.1631738841533661, 0.15035070478916168, -0.05051533877849579, -0.06614069640636444, 0.1981688141822815, 0.09644124656915665, -0.042498450726270676, -0.1519400179386139 ]
https://github.com/huggingface/datasets/issues/2957
MultiWOZ Dataset NonMatchingChecksumError
Hi Brady! I met the similar issue, it stuck in the downloading stage instead of download anything, maybe it is broken. After I change the downloading from URLs to one url of the [Multiwoz project](https://github.com/budzianowski/multiwoz/archive/44f0f8479f11721831c5591b839ad78827da197b.zip) and use dirs to get separate files, the problems gone.
## Describe the bug The checksums for the downloaded MultiWOZ dataset and source MultiWOZ dataset aren't matching. ## Steps to reproduce the bug Both of the below dataset versions yield the checksum error: ```python from datasets import load_dataset dataset = load_dataset('multi_woz_v22', 'v2.2') dataset = load_dataset('multi_woz_v22', 'v2.2_active_only') ``` ## Expected results For the above calls to `load_dataset` to work. ## Actual results NonMatchingChecksumError. Traceback: > Traceback (most recent call last): File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-15-4e91280e112e>", line 1, in <module> dataset = load_dataset('multi_woz_v22', 'v2.2') File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/load.py", line 847, in load_dataset builder_instance.download_and_prepare( File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 615, in download_and_prepare self._download_and_prepare( File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 675, in _download_and_prepare verify_checksums( File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/utils/info_utils.py", line 40, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/dialog_acts.json', 'https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/test/dialogues_001.json'] ## Environment info - `datasets` version: 1.11.0 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 5.0.0
45
MultiWOZ Dataset NonMatchingChecksumError ## Describe the bug The checksums for the downloaded MultiWOZ dataset and source MultiWOZ dataset aren't matching. ## Steps to reproduce the bug Both of the below dataset versions yield the checksum error: ```python from datasets import load_dataset dataset = load_dataset('multi_woz_v22', 'v2.2') dataset = load_dataset('multi_woz_v22', 'v2.2_active_only') ``` ## Expected results For the above calls to `load_dataset` to work. ## Actual results NonMatchingChecksumError. Traceback: > Traceback (most recent call last): File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/IPython/core/interactiveshell.py", line 3441, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-15-4e91280e112e>", line 1, in <module> dataset = load_dataset('multi_woz_v22', 'v2.2') File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/load.py", line 847, in load_dataset builder_instance.download_and_prepare( File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 615, in download_and_prepare self._download_and_prepare( File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/builder.py", line 675, in _download_and_prepare verify_checksums( File "/Users/brady/anaconda3/envs/elysium/lib/python3.8/site-packages/datasets/utils/info_utils.py", line 40, in verify_checksums raise NonMatchingChecksumError(error_msg + str(bad_urls)) datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/dialog_acts.json', 'https://github.com/budzianowski/multiwoz/raw/master/data/MultiWOZ_2.2/test/dialogues_001.json'] ## Environment info - `datasets` version: 1.11.0 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.10 - PyArrow version: 5.0.0 Hi Brady! I met the similar issue, it stuck in the downloading stage instead of download anything, maybe it is broken. After I change the downloading from URLs to one url of the [Multiwoz project](https://github.com/budzianowski/multiwoz/archive/44f0f8479f11721831c5591b839ad78827da197b.zip) and use dirs to get separate files, the problems gone.
[ -0.18571323156356812, 0.28243494033813477, -0.010363351553678513, 0.22731152176856995, -0.10893940925598145, 0.026602409780025482, 0.42147091031074524, 0.4297234117984772, 0.1776721179485321, 0.09039018303155899, -0.12641167640686035, 0.13561274111270905, 0.09125407040119171, -0.01723489537835121, -0.09927867352962494, 0.23938609659671783, 0.1802411675453186, -0.01726362854242325, -0.3148805797100067, -0.025405481457710266, -0.16095106303691864, 0.22175854444503784, -0.21028253436088562, -0.18249724805355072, -0.04561925679445267, 0.26664724946022034, 0.12237578630447388, 0.18690532445907593, -0.04848586767911911, -0.16605345904827118, 0.44128406047821045, 0.19684794545173645, -0.01331152394413948, 0.4252356290817261, -0.0001183015774586238, 0.11240905523300171, 0.2968032956123352, -0.12964017689228058, -0.2232101410627365, -0.16829092800617218, -0.4560234546661377, -0.4386836588382721, -0.08853188902139664, -0.1898672878742218, 0.17049145698547363, 0.4208548367023468, -0.11685840785503387, -0.08273936808109283, 0.06293033063411713, -0.012696142308413982, 0.15815863013267517, 0.5822010040283203, 0.40309831500053406, 0.12524186074733734, 0.19708950817584991, 0.03932847082614899, -0.11785339564085007, 0.18828140199184418, 0.20408162474632263, -0.031233176589012146, -0.17808780074119568, 0.2824748456478119, -0.30176350474357605, 0.30995047092437744, -0.017837703227996826, -0.05486821383237839, 0.08823881298303604, -0.09818902611732483, 0.0019515231251716614, 0.49385935068130493, 0.10081672668457031, -0.3008318245410919, -0.3892050087451935, -0.20516180992126465, -0.3296728730201721, 0.16352060437202454, 0.3679273724555969, 0.1957934945821762, -0.2742761969566345, -0.18020224571228027, -0.3902157247066498, 0.3427879810333252, 0.06770791113376617, 0.1836717426776886, 0.014303676784038544, 0.26485592126846313, 0.2137291580438614, 0.00374603271484375, -0.05173502489924431, -0.19733266532421112, 0.19359815120697021, -0.4476889669895172, 0.007739998400211334, 0.1180826798081398, -0.5939759016036987, -0.16952015459537506, -0.07543299347162247, 0.3176150619983673, 0.4821322560310364, 0.4230732321739197, 0.2929348647594452, 0.11737080663442612, -0.2319895476102829, 0.1290968954563141, 0.24684707820415497, 0.08627627789974213, 0.0014587193727493286, -0.04128994420170784, 0.05061301961541176, 0.333903044462204, -0.01590956375002861, 0.23678520321846008, 0.16202139854431152, -0.34245288372039795, 0.5505927205085754, 0.18631067872047424, 0.31874769926071167, -0.4685885012149811, -0.2995803654193878, 0.21953457593917847, -0.26891830563545227, -0.24916374683380127, 0.32181480526924133, 0.019647009670734406, -0.21470104157924652, 0.3384557068347931, -0.1812160313129425, 0.3032724857330322, -0.2416974902153015, -0.18441413342952728, -0.1945900321006775, -0.05405396595597267, 0.01407647505402565, 0.06792323291301727, 0.3222479820251465, -0.03008057177066803, 0.4282165765762329, 0.13991941511631012, 0.3867965340614319, -0.12667341530323029, 0.357110857963562, -0.0007344689220190048, -0.04624085873365402, 0.3179154694080353, -0.01022246852517128, 0.11539454013109207, 0.19314637780189514, 0.07210886478424072, -0.05107186362147331, 0.18174715340137482, -0.2787763774394989, -0.29259124398231506, -0.07184028625488281, 0.17011456191539764, -0.47147804498672485, -0.14117580652236938, 0.19037692248821259, -0.539870023727417, 0.492957204580307, -0.4410257637500763, 0.05880674347281456, -0.3429524898529053, -0.08730895817279816, -0.13635040819644928, 0.21870838105678558, 0.20904262363910675, 0.14471913874149323, 0.12177848815917969, -0.12486615031957626, -0.11265832185745239, 0.3954066336154938, 0.1465783566236496, -0.07562300562858582, -0.17305850982666016, -0.21845905482769012, 0.01776309311389923, 0.2371673583984375, -0.34908801317214966, -0.3837650418281555, -0.038504716008901596, 0.05200004577636719, 0.7727558612823486, 0.13393110036849976, 0.09868355840444565, -0.0696793720126152, -0.29221510887145996, 0.19144031405448914, -0.00462825782597065, -0.026708455756306648, 0.16056808829307556, -0.2763487696647644, -0.26531317830085754, 0.3215687870979309, -0.010394062846899033, -0.03005482628941536, -0.1173766478896141, 0.13045759499073029, -0.10908126085996628, 0.48165079951286316, 0.016792774200439453, -0.12238796800374985, -0.01252712681889534, 0.21122382581233978, -0.08423587679862976, 0.04109601676464081, -0.14849893748760223, -0.5830722451210022, 0.3500463664531708, -0.289462149143219, 0.07933710515499115, 0.044191088527441025, -0.01375466026365757, -0.11748611181974411, -0.10518987476825714, -0.3605995178222656, -0.06137118116021156, 0.09311637282371521, 0.25125226378440857, 0.1876756250858307, -0.2360638976097107, 0.09834566712379456, 0.29801228642463684, -0.10052410513162613, 0.09375349432229996, -0.35996323823928833, 0.27599677443504333, -0.1360350400209427, -0.0026741474866867065, -0.044181570410728455, 0.27410948276519775, 0.18014685809612274, 0.03148769214749336, -0.22811731696128845, 0.42338433861732483, 0.25133007764816284, 0.09158910810947418, -0.19608616828918457, 0.24844364821910858, -0.006074011325836182, -0.04423743858933449, 0.1253616362810135, 0.4152408838272095, 0.0781625509262085, -0.11597486585378647, -0.08733741194009781, 0.43830758333206177, -0.15024958550930023, 0.25344517827033997, -0.07059640437364578, 0.18206676840782166, 0.1730346828699112, -0.017039190977811813, -0.2775232791900635, -0.26369214057922363, 0.37455788254737854, -0.010973058640956879, -0.1087723970413208, 0.18911418318748474, -0.07056638598442078, 0.03698364645242691, 0.3300085961818695, -0.04090699553489685, 0.028163369745016098, -0.061486080288887024, 0.1271936148405075, -0.17789793014526367, 0.22422432899475098, 0.5954230427742004, 0.4448838233947754, 0.10702671855688095, 0.17953860759735107, 0.034611769020557404, -0.3235819637775421, -0.05326954647898674, 0.06212962418794632, 0.00457637757062912, 0.1233895868062973, 0.378166139125824, 0.05090320482850075, -0.06329067051410675, -0.1719752848148346, 0.12375926971435547, -0.04449620842933655, 0.0501846969127655, -0.5337990522384644, -0.27006691694259644, -0.3799063265323639, 0.20924770832061768, -0.5469833612442017, -0.33012819290161133, -0.47052013874053955, -0.3462617099285126, 0.009775025770068169, 0.5019387006759644, -0.033674031496047974, 0.33424144983291626, -0.4741784334182739, -0.1968928426504135, -0.1534341275691986, -0.22130060195922852, 0.03755436837673187, 0.07709178328514099, -0.09967393428087234, -0.0007809828966856003, 0.49613893032073975, 0.007137379143387079, 0.2611542046070099, -0.29449042677879333, -0.1273925006389618, -0.364914208650589, -0.31778231263160706, -0.0738707184791565, 0.051911912858486176, 0.014822231605648994, 0.22400809824466705, 0.07100826501846313, 0.22624461352825165, -0.40859416127204895, 0.1947510987520218, 0.044234491884708405, -0.5037089586257935, 0.28945061564445496, -0.056686244904994965, -0.08704685419797897, 0.1449696123600006, -0.18418064713478088, -0.05182260274887085, -0.16976229846477509, -0.18830804526805878, 0.1560913622379303, 0.29673659801483154, 0.1249212920665741, -0.07995391637086868, -0.0694102942943573, -0.0038179014809429646, 0.3887186348438263, -0.2261020988225937, -0.6709479093551636, 0.4218999743461609, -0.01176498830318451, -0.20349746942520142, -0.1712305247783661, -0.08359850943088531, 0.16885292530059814, 0.23460917174816132, -0.29763299226760864, -0.2025557905435562, -0.3522113859653473, 0.02602081373333931, 0.28628844022750854, 0.006528692319989204, 0.34553301334381104, 0.2454902082681656, 0.0034995730966329575, -0.28181353211402893, -0.282711386680603, 0.2768628001213074, -0.018215879797935486, 0.4016956090927124, -0.14095336198806763, 0.118366539478302, -0.030725982040166855, 0.560443103313446, 0.5893759727478027, 0.17020583152770996, 0.16020512580871582, 0.1725814789533615, 0.20316505432128906, -0.1808360517024994, -0.3893720209598541, 0.06446367502212524, -0.06914053857326508, 0.21020939946174622, 0.007202945649623871, -0.07046636939048767, -0.13016283512115479, -0.14096611738204956, 0.06767025589942932, -0.37246131896972656, -0.304514080286026, -0.11321814358234406, -0.306183785200119, 0.17101089656352997, 0.31539228558540344, 0.04120688885450363, -0.3598316013813019, -0.33181479573249817, 0.09285745024681091, 0.082694873213768, -0.2637505531311035, -0.026136169210076332, -0.3665642738342285, 0.08094292134046555, 0.03065260499715805, 0.3461843729019165, 0.34617170691490173, 0.39558538794517517, 0.22311519086360931, -0.3969365060329437, -0.1509189009666443, -0.07228516787290573, 0.4506056308746338, -0.21956759691238403, 0.2514348328113556, -0.03773738816380501, 0.025392435491085052, -0.14093513786792755, -0.32526081800460815, 0.05696358159184456, 0.08985362946987152, 0.2274339646100998, 0.1675039827823639, -0.20323508977890015, -0.12475886940956116, 0.43444132804870605, 0.3967891335487366, -0.10913336277008057, -0.3411252498626709, -0.23850072920322418, 0.06982136517763138, -0.32987532019615173, -0.1739814579486847, -0.19294492900371552, 0.28337883949279785, -0.18196764588356018, -0.20202094316482544, 0.10922054946422577, -0.0003024637699127197, 0.3691166043281555, 0.10498753190040588, 0.17392024397850037, 0.2092401683330536, 0.4498612582683563, -0.08064428716897964, 0.1446898877620697, 0.3527155816555023, 0.6516880393028259, -0.13355004787445068, -0.16232872009277344, -0.25259941816329956, -0.31402716040611267, -0.14289018511772156, 0.03695733845233917, 0.139275461435318, -0.08742520958185196, 0.32722944021224976, -0.2630513906478882, -0.01929616555571556, -0.3511521518230438, 0.17997215688228607, 0.2901465892791748, -0.20714353024959564, -0.18965306878089905, -0.0905056968331337, 0.10131785273551941, -0.10524442046880722, 0.31088516116142273, -0.19357125461101532, 0.07525584846735, -0.1590638905763626, 0.2516234517097473, 0.7967456579208374, 0.10535866767168045, 0.00494660809636116, 0.09369825571775436, -0.30882734060287476, 0.06089048087596893, -0.11603641510009766, -0.0027182642370462418, -0.27198296785354614, -0.26875144243240356, -0.039978403598070145, -0.29234957695007324, 0.12210837751626968, 0.02268201857805252, 0.0027154050767421722, 0.3173474371433258, 0.008903868496418, 0.2098671793937683, 0.042767465114593506, 0.039000727236270905, -0.19551487267017365, -0.03664416819810867, 0.26373055577278137, 0.11893942952156067, -0.09050117433071136, 0.3099161386489868, -0.11999639868736267, -0.06052187830209732, 0.021165620535612106, -0.3837026357650757, -0.4005434513092041, 0.1916457712650299, -0.10593947023153305, 0.250653475522995, 0.38587459921836853, -0.19839271903038025, -0.14214403927326202, 0.27016639709472656, 0.18489599227905273, -0.15909403562545776, -0.17458248138427734, -0.12307733297348022, 0.45861726999282837, 0.3098810613155365, 0.15888050198554993, -0.1441175639629364, 0.4856926202774048, -0.16647779941558838, -0.22812357544898987, -0.10628397017717361, -0.00952223315834999, -0.3277650475502014, 0.1432936191558838, -0.10911928117275238, 0.17177700996398926, -0.2770605683326721, -0.0757845789194107, 0.08702628314495087, 0.1797328144311905, -0.3291821777820587, 0.10892805457115173, 0.17371906340122223, -0.31763240694999695, 0.38492918014526367, -0.17686539888381958, -0.17407257854938507, -0.04037988558411598, 0.5012707710266113, 0.1480393409729004, -0.19240505993366241, 0.4957622289657593, -0.010245490819215775, -0.10046692192554474, -0.11970698833465576, 0.1752380132675171, -0.1269695907831192, -0.39101874828338623, -0.10802311450242996, -0.25761038064956665, 0.05333384871482849, -0.1952262967824936, 0.34539225697517395, 0.370164155960083, 0.43062376976013184, 0.09863263368606567, -0.6032429933547974, -0.07552470266819, -0.025658145546913147, 0.11446221172809601, 0.27731770277023315, -0.3827020823955536, 0.018946614116430283, 0.022432593628764153, 0.012632535770535469, -0.27975329756736755, -0.0846460685133934, -0.1704290807247162, -0.01951080933213234, -0.2416764497756958, -0.03513588011264801, -0.045498739928007126, 0.02701621875166893, 0.16734352707862854, -0.24679617583751678, -0.14744946360588074, -0.16417884826660156, -0.2066180557012558, 0.13673751056194305, -0.039576753973960876, -0.1710549294948578, 0.2653403878211975, -0.09216226637363434, -0.08494003117084503, -0.21933574974536896, -0.1014043390750885, 0.17085689306259155, -0.07290497422218323, 0.10574137419462204, 0.2055054008960724, -0.10215633362531662, -0.2396959364414215, -0.07690224796533585, -0.3959920406341553, -0.21211297810077667, -0.010250869207084179, 0.06790735572576523, -0.044224705547094345, -0.09541339427232742, 0.17950017750263214, 0.17273619771003723, -0.17928440868854523, 0.06162876635789871, 0.1505613923072815, -0.17119643092155457, -0.2509329915046692, 0.29197388887405396, 0.32637664675712585, 0.36622822284698486, -0.0939469188451767, -0.009902129881083965, 0.05706898123025894, 0.1960732638835907, -0.45395541191101074, -0.06971999257802963, 0.3030456602573395, -0.06521905958652496, 0.057413239032030106, 0.17023944854736328, -0.16149631142616272, -0.3581470847129822, 0.6661958694458008, 0.07784175872802734, -0.023289337754249573, -0.35987263917922974, 0.3469237685203552, 0.47159379720687866, -0.0888204276561737, 0.10650225728750229, 0.00869232788681984, -0.27276182174682617, 0.050712645053863525, -0.20728914439678192, -0.11766112595796585, 0.2757953107357025, 0.0029006265103816986, 0.1288505494594574, -0.04680018872022629, -0.41994723677635193, 0.17532756924629211, 0.19073231518268585, 0.011495105922222137, 0.0595555454492569, 0.18048197031021118, 0.26888507604599, -0.1442670077085495, 0.14524757862091064, -0.7264934778213501, 0.02774995192885399, 0.02241232618689537, -0.0031651840545237064, -0.2867995500564575, -0.3836962580680847, -0.0706821158528328, 0.003116864711046219, 0.05656426399946213, 0.19018936157226562, 0.4777626097202301, -0.003309592604637146, -0.21903331577777863, -0.5879956483840942, -0.11182569712400436, -0.04411931335926056, -0.1283273696899414, -0.29495182633399963, 0.26407426595687866, 0.5273922085762024, -0.2947605848312378, 0.08002360910177231, 0.5174980163574219, 0.5161623358726501, 0.46364256739616394, 0.24161218106746674, -0.10748296231031418, 0.030031843110919, -0.0058832839131355286, -0.1470138281583786, 0.4675888121128082, -0.06507344543933868, -0.054769400507211685, 0.38734617829322815, 0.06790033727884293, -0.12929800152778625, -0.013948418200016022, 0.016491252928972244, -0.3627680242061615, -0.2201520949602127, 0.7417112588882446, -0.0006252340972423553, 0.12465497106313705, -0.0051946453750133514, 0.2470247745513916, -0.30428779125213623, -0.3481418192386627, 0.07688943296670914, 0.17271317541599274, 0.08770454674959183, 0.06573990732431412, 0.05940013378858566, -0.013877149671316147, 0.3255424201488495, 0.07258109748363495, -0.009297043085098267, -0.26087284088134766, -0.18437612056732178, -0.7771652936935425, 0.23134183883666992, -0.1949971616268158, 0.19855079054832458, -0.023923654109239578, 0.11534897983074188, 0.10966318845748901, 0.284473717212677, 0.509857714176178, -0.2092876136302948, -0.14401565492153168, 0.08184421062469482, -0.2948187291622162, -0.10372863709926605, 0.3394213318824768, -0.21820567548274994, 0.013127565383911133, -0.27459195256233215, 0.2081199735403061, 0.003460855223238468, 0.07079654186964035, 0.06604913622140884, 0.053411006927490234, 0.08819136023521423, 0.01969258114695549, 0.00731891393661499, 0.2240348756313324, 0.6228119134902954, 0.0038186758756637573, -0.0923827514052391, -0.11381903290748596, 0.034471187740564346, -0.22749018669128418, 0.2879461348056793, -0.13457295298576355, 0.33682981133461, -0.10372057557106018, -0.07343366742134094, -0.16452501714229584, 0.2153746634721756, 0.051485948264598846, -0.20132572948932648, -0.10546824336051941, 0.1137167289853096, -0.07710149884223938, 0.057218823581933975, 0.09361272305250168, 0.002623528242111206, 0.052274033427238464, 0.38453471660614014, -0.1437510997056961, -0.2702412009239197, 0.4730997681617737, -0.06882249563932419, 0.004934143275022507, -0.38863974809646606, 0.22777290642261505, -0.6216645836830139, -0.13706763088703156, -0.6073929071426392, 0.10340029746294022, 0.42722469568252563, 0.11484197527170181, -0.128152534365654, 0.2015848606824875, -0.12238982319831848, 0.11255940794944763, 0.0005701519548892975, 0.1763867735862732, -0.0012598447501659393, -0.2686443626880646, 0.11082062125205994, -0.09736321121454239 ]
https://github.com/huggingface/datasets/issues/2956
Cache problem in the `load_dataset` method for local compressed file(s)
The problem is still present. One solution would be to add the `download_mode="force_redownload"` argument to load_dataset. However, doing so may lead to a `DatasetGenerationError: An error occurred while generating the dataset`. To mitigate, just do: `rm -r ~/.cache/huggingface/datasets/*`
## Describe the bug Cache problem in the `load_dataset` method: when modifying a compressed file in a local folder `load_dataset` doesn't detect the change and load the previous version. ## Steps to reproduce the bug To test it directly, I have prepared a [Google Colaboratory notebook](https://colab.research.google.com/drive/11Em_Amoc-aPGhSBIkSHU2AvEh24nVayy?usp=sharing) that shows this behavior. For this example, I have created a toy dataset at: https://huggingface.co/datasets/SaulLu/toy_struc_dataset This dataset is composed of two versions: - v1 on commit `a6beb46` which has a single example `{'id': 1, 'value': {'tag': 'a', 'value': 1}}` in file `train.jsonl.gz` - v2 on commit `e7935f4` (`main` head) which has a single example `{'attr': 1, 'id': 1, 'value': 'a'}` in file `train.jsonl.gz` With a terminal, we can start to get the v1 version of the dataset ```bash git lfs install git clone https://huggingface.co/datasets/SaulLu/toy_struc_dataset cd toy_struc_dataset git checkout a6beb46 ``` Then we can load it with python and look at the content: ```python from datasets import load_dataset path = "/content/toy_struc_dataset" dataset = load_dataset(path, data_files={"train": "*.jsonl.gz"}) print(dataset["train"][0]) ``` Output ``` {'id': 1, 'value': {'tag': 'a', 'value': 1}} # This is the example in v1 ``` With a terminal, we can now start to get the v1 version of the dataset ```bash git checkout main ``` Then we can load it with python and look at the content: ```python from datasets import load_dataset path = "/content/toy_struc_dataset" dataset = load_dataset(path, data_files={"train": "*.jsonl.gz"}) print(dataset["train"][0]) ``` Output ``` {'id': 1, 'value': {'tag': 'a', 'value': 1}} # This is the example in v1 (not v2) ``` ## Expected results The last output should have been ``` {"id":1, "value": "a", "attr": 1} # This is the example in v2 ``` ## Ideas As discussed offline with Quentin, if the cache hash was ever sensitive to changes in a compressed file we would probably not have the problem anymore. This situation leads me to suggest 2 other features: - to also have an `load_from_cache_file` argument in the "load_dataset" method - to reorganize the cache so that we can delete the caches related to a dataset (cf issue #ToBeFilledSoon) And thanks again for this great library :hugs: ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0
38
Cache problem in the `load_dataset` method for local compressed file(s) ## Describe the bug Cache problem in the `load_dataset` method: when modifying a compressed file in a local folder `load_dataset` doesn't detect the change and load the previous version. ## Steps to reproduce the bug To test it directly, I have prepared a [Google Colaboratory notebook](https://colab.research.google.com/drive/11Em_Amoc-aPGhSBIkSHU2AvEh24nVayy?usp=sharing) that shows this behavior. For this example, I have created a toy dataset at: https://huggingface.co/datasets/SaulLu/toy_struc_dataset This dataset is composed of two versions: - v1 on commit `a6beb46` which has a single example `{'id': 1, 'value': {'tag': 'a', 'value': 1}}` in file `train.jsonl.gz` - v2 on commit `e7935f4` (`main` head) which has a single example `{'attr': 1, 'id': 1, 'value': 'a'}` in file `train.jsonl.gz` With a terminal, we can start to get the v1 version of the dataset ```bash git lfs install git clone https://huggingface.co/datasets/SaulLu/toy_struc_dataset cd toy_struc_dataset git checkout a6beb46 ``` Then we can load it with python and look at the content: ```python from datasets import load_dataset path = "/content/toy_struc_dataset" dataset = load_dataset(path, data_files={"train": "*.jsonl.gz"}) print(dataset["train"][0]) ``` Output ``` {'id': 1, 'value': {'tag': 'a', 'value': 1}} # This is the example in v1 ``` With a terminal, we can now start to get the v1 version of the dataset ```bash git checkout main ``` Then we can load it with python and look at the content: ```python from datasets import load_dataset path = "/content/toy_struc_dataset" dataset = load_dataset(path, data_files={"train": "*.jsonl.gz"}) print(dataset["train"][0]) ``` Output ``` {'id': 1, 'value': {'tag': 'a', 'value': 1}} # This is the example in v1 (not v2) ``` ## Expected results The last output should have been ``` {"id":1, "value": "a", "attr": 1} # This is the example in v2 ``` ## Ideas As discussed offline with Quentin, if the cache hash was ever sensitive to changes in a compressed file we would probably not have the problem anymore. This situation leads me to suggest 2 other features: - to also have an `load_from_cache_file` argument in the "load_dataset" method - to reorganize the cache so that we can delete the caches related to a dataset (cf issue #ToBeFilledSoon) And thanks again for this great library :hugs: ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.104+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.12 - PyArrow version: 3.0.0 The problem is still present. One solution would be to add the `download_mode="force_redownload"` argument to load_dataset. However, doing so may lead to a `DatasetGenerationError: An error occurred while generating the dataset`. To mitigate, just do: `rm -r ~/.cache/huggingface/datasets/*`
[ -0.15919502079486847, 0.32043221592903137, -0.03442421182990074, 0.26399022340774536, 0.01779220439493656, 0.12933111190795898, 0.2549055218696594, 0.43158623576164246, 0.09085986018180847, 0.08766214549541473, 0.15352274477481842, 0.37295663356781006, 0.12291469424962997, -0.34524136781692505, 0.030637778341770172, 0.04750269278883934, 0.06823756545782089, 0.09477654844522476, -0.04426029324531555, -0.08481009304523468, -0.08492369949817657, 0.18562768399715424, -0.0744401067495346, -0.31260204315185547, -0.1267355978488922, 0.01681661047041416, -0.08907995373010635, 0.2640746235847473, 0.13280847668647766, -0.3418804109096527, 0.413319855928421, 0.15694044530391693, 0.06931663304567337, 0.6025643348693848, -0.00011264834756730124, 0.13451050221920013, 0.45146268606185913, -0.01692218706011772, -0.519758403301239, -0.2731630206108093, -0.10081110894680023, -0.37045156955718994, 0.0959964469075203, -0.1948472559452057, -0.21318340301513672, -0.24693886935710907, -0.06584938615560532, -0.7134955525398254, 0.5856207013130188, -0.07622332870960236, 0.20587491989135742, -0.04838433861732483, -0.16026924550533295, 0.09122628718614578, 0.30658039450645447, 0.2147044837474823, -0.05013299733400345, 0.32148477435112, 0.33968472480773926, -0.06394390016794205, -0.1728067696094513, 0.4829409122467041, 0.017782779410481453, -0.010510507971048355, 0.12649841606616974, 0.044428080320358276, -0.1856081187725067, 0.13507342338562012, 0.08592425286769867, -0.14353832602500916, 0.42853763699531555, -0.4453393220901489, -0.4886968731880188, -0.3805737793445587, -0.10856743156909943, -0.23765653371810913, 0.3519851267337799, -0.01632765121757984, -0.15835320949554443, 0.2796768546104431, -0.3435622453689575, -0.33222731947898865, 0.020749256014823914, 0.02954832836985588, 0.18273289501667023, -0.027461804449558258, -0.11531318724155426, 0.04473847523331642, -0.14644554257392883, 0.13609902560710907, 0.22051391005516052, -0.12399020791053772, -0.11458948254585266, 0.3818296194076538, -0.3050084114074707, 0.015354514122009277, 0.18109360337257385, -0.17719274759292603, 0.04864949733018875, -0.050969868898391724, 0.3002532124519348, 0.034638866782188416, 0.06555446982383728, 0.07617566734552383, 0.22656619548797607, 0.42176419496536255, 0.03662516176700592, 0.1621624231338501, 0.13042086362838745, 0.19992858171463013, -0.2327188104391098, 0.03187943622469902, -0.16397379338741302, -0.24363045394420624, 0.3769538998603821, 0.15276318788528442, 0.1694488376379013, -0.17399446666240692, 0.20581082999706268, 0.08885826915502548, -0.09152992069721222, -0.15845134854316711, 0.06096014007925987, 0.0716564804315567, -0.11172135174274445, 0.30418527126312256, 0.001951269805431366, -0.05447649210691452, -0.07252713292837143, 0.0227125845849514, -0.35368889570236206, -0.11140415072441101, -0.08783543109893799, 0.16319236159324646, 0.4516785442829132, -0.5892972946166992, 0.09448965638875961, 0.010174826718866825, -0.3239453434944153, -0.04709349572658539, 0.1188742071390152, -0.1688985824584961, 0.22933584451675415, 0.21159757673740387, -0.30033159255981445, 0.15402370691299438, 0.1515476107597351, -0.2026480734348297, -0.3365807831287384, 0.18114909529685974, -0.3944786489009857, -0.3422703444957733, 0.021727539598941803, 0.13495993614196777, -0.2539949417114258, 0.11100992560386658, -0.04432063549757004, 0.15991893410682678, 0.26044103503227234, -0.19349199533462524, -0.1343824565410614, 0.010047908872365952, -0.5545603036880493, -0.13341814279556274, 0.1648675501346588, 0.6587149500846863, -0.5146076083183289, -0.06534905731678009, -0.34356334805488586, 0.17351050674915314, 0.2190774381160736, 0.24949169158935547, -0.27680912613868713, -0.10304314643144608, -0.15564048290252686, 0.0871804803609848, 0.4271361529827118, -0.5172401666641235, -0.8213095664978027, 0.43636608123779297, -0.1465408354997635, 0.3648117184638977, 0.21439754962921143, -0.10638684779405594, -0.0066594406962394714, -0.32680636644363403, 0.2985532283782959, 0.3682161569595337, 0.026196984574198723, 0.10971047729253769, -0.4935896098613739, -0.33456188440322876, 0.20665358006954193, 0.047678206115961075, -0.18920473754405975, 0.2772771716117859, 0.04882409796118736, -0.07155926525592804, 0.2837519347667694, 0.13750045001506805, 0.21428470313549042, 0.3829494118690491, 0.22907841205596924, -0.1627318263053894, 0.3059241473674774, 0.04114726185798645, -0.5493749380111694, 0.24006491899490356, -0.12720933556556702, -0.24171248078346252, -0.17664863169193268, -0.048971448093652725, -0.31360071897506714, -0.0980408787727356, -0.15833300352096558, -0.16988377273082733, 0.11688822507858276, 0.29728126525878906, 0.31818607449531555, -0.1208568662405014, -0.2006542980670929, 0.5013790726661682, 0.19559767842292786, -0.09175790846347809, -0.37659600377082825, 0.11981986463069916, 0.023608114570379257, -0.11406957358121872, -0.10041217505931854, -0.13556158542633057, 0.1727747619152069, -0.37809640169143677, -0.3630867600440979, 0.38172972202301025, 0.06660308688879013, 0.42910969257354736, 0.07924807816743851, -0.14476336538791656, 0.042013347148895264, 0.20773789286613464, 0.11256411671638489, 0.16900211572647095, 0.16131050884723663, 0.17240187525749207, -0.367809534072876, 0.13599292933940887, 0.008600842207670212, 0.07866844534873962, -0.20281465351581573, -0.4447678029537201, 0.23123541474342346, 0.017746616154909134, -0.06149992346763611, -0.39737653732299805, 0.018801037222146988, 0.16908596456050873, 0.491116464138031, 0.18521717190742493, -0.0880434438586235, 0.10440035909414291, 0.4401305615901947, 0.06471887230873108, -0.22170090675354004, 0.312978059053421, -0.12838146090507507, -0.36104899644851685, 0.22141678631305695, 0.5402945876121521, 0.3635270297527313, 0.1514366716146469, 0.191975936293602, 0.06551186740398407, 0.1235075294971466, -0.1230086162686348, 0.06930417567491531, -0.2575228214263916, 0.16539990901947021, 0.32587382197380066, 0.40416717529296875, 0.3353694677352905, -0.16532912850379944, 0.13194020092487335, 0.16762490570545197, 0.06495718657970428, -0.10340166091918945, 0.2225523442029953, -0.4264458417892456, 0.013243559747934341, -0.18289044499397278, -0.03652678802609444, -0.0899050235748291, -0.08015188574790955, -0.011850714683532715, 0.23501089215278625, -0.06042075902223587, 0.0684419497847557, -0.06869421154260635, 0.34051114320755005, 0.0830237865447998, -0.5283244848251343, -0.40968266129493713, -0.24070510268211365, -0.3923391103744507, -0.03597481921315193, 0.29407963156700134, -0.24162913858890533, 0.016299713402986526, -0.2003864049911499, -0.28849637508392334, 0.031035177409648895, -0.09969598054885864, 0.17544196546077728, 0.05868621543049812, 0.5160508751869202, -0.10899446904659271, -0.010399110615253448, 0.00017061829566955566, -0.10827275365591049, 0.21149790287017822, -0.13106314837932587, -0.2429211586713791, -0.16130459308624268, 0.1644279956817627, 0.2837395668029785, -0.3451148271560669, -0.31849342584609985, -0.14831580221652985, -0.27058517932891846, 0.0957551822066307, -0.06324008852243423, 0.0666022002696991, 0.47391241788864136, 0.0842716321349144, -0.034721314907073975, 0.4218784272670746, 0.19073808193206787, -0.4519535005092621, -0.7318345308303833, 0.21889416873455048, -0.24068433046340942, -0.15727928280830383, -0.3196620047092438, -0.129524827003479, -0.10682183504104614, 0.5424489974975586, -0.46181827783584595, 0.005755837075412273, -0.21335242688655853, 0.08182983100414276, -0.18856729567050934, -0.13394424319267273, 0.3767266869544983, 0.0291903018951416, -0.07427152991294861, -0.2657651901245117, -0.24285048246383667, 0.061342671513557434, 0.21875795722007751, 0.17978624999523163, 0.07752395421266556, 0.17956948280334473, 0.007896970957517624, 0.4909619092941284, -0.05989648029208183, -0.10569138824939728, 0.5176137089729309, 0.18513134121894836, 0.35728174448013306, -0.24280190467834473, -0.119721420109272, -0.017767341807484627, -0.17126885056495667, -0.2913578152656555, 0.02953898161649704, 0.24533164501190186, -0.4270019829273224, -0.19178885221481323, -0.2209627330303192, -0.35570019483566284, -0.28260329365730286, 0.09360896050930023, -0.10515770316123962, 0.21316948533058167, 0.2877252399921417, -0.02729025110602379, -0.19824859499931335, -0.05500815436244011, 0.13025692105293274, 0.1883234679698944, 0.32050636410713196, 0.15340034663677216, 0.0669756680727005, 0.22166477143764496, -0.2481301724910736, 0.07534149289131165, 0.26025763154029846, 0.3624531626701355, -0.04059343412518501, -0.3006509840488434, -0.14990416169166565, -0.2078273743391037, 0.581660807132721, -0.14262913167476654, 0.32955271005630493, 0.3356700837612152, -0.10135723650455475, -0.2274235635995865, -0.1582130789756775, 0.13355445861816406, 0.22195293009281158, -0.03326725587248802, 0.8006604313850403, 0.06654144078493118, -0.24126936495304108, -0.2396545112133026, 0.3986612856388092, -0.08502635359764099, -0.20482230186462402, -0.1992616206407547, 0.021531760692596436, -0.1198003739118576, -0.19182318449020386, -0.22315523028373718, 0.15615664422512054, -0.06280016154050827, -0.05304429307579994, -0.15555787086486816, -0.08561137318611145, -0.24989666044712067, 0.0912354588508606, 0.4037460684776306, 0.04665544629096985, 0.2491552233695984, 0.16426695883274078, 0.38887694478034973, 0.10190232843160629, 0.424100399017334, 0.0012648217380046844, -0.014524862170219421, 0.11077932268381119, 0.054516371339559555, -0.22066298127174377, 0.28960973024368286, -0.26931968331336975, -0.2778477370738983, 0.04417560249567032, 0.08093811571598053, -0.3824428915977478, 0.2072574496269226, -0.0035454779863357544, -0.05015503242611885, -0.2519058287143707, -0.460588276386261, 0.43347159028053284, 0.14746007323265076, -0.23611921072006226, 0.45572030544281006, -0.4146922826766968, -0.22352217137813568, 0.34371232986450195, -0.05475305765867233, 0.7263850569725037, -0.06893470883369446, 0.041920971125364304, 0.016734309494495392, -0.13277363777160645, 0.3187699317932129, -0.2315230667591095, 0.2591348886489868, -0.06671589612960815, -0.22529059648513794, 0.08129546046257019, -0.04445453733205795, 0.1823553740978241, 0.10291086882352829, -0.15632323920726776, 0.2787476181983948, -0.19127830862998962, -0.2298358678817749, -0.09755360335111618, 0.07094868272542953, -0.05977543443441391, -0.07521507143974304, -0.3699151873588562, 0.19822131097316742, 0.06187222898006439, 0.399948388338089, 0.1164347305893898, 0.003334200941026211, -0.4016678035259247, -0.166001558303833, -0.1473504900932312, 0.07966214418411255, -0.06333459168672562, 0.039768777787685394, 0.10979963839054108, -0.4881404638290405, -0.21211019158363342, 0.10353443026542664, 0.05793099105358124, 0.050490714609622955, -0.12131837010383606, 0.08478522300720215, -0.0973288044333458, 0.45742133259773254, -0.07787249982357025, -0.04617433622479439, 0.46494725346565247, -0.003210023045539856, -0.026291586458683014, -0.2897416353225708, -0.4810510277748108, -0.3190617561340332, 0.2652108669281006, 0.07264405488967896, -0.014596305787563324, 0.14072957634925842, -0.12593260407447815, 0.053158462047576904, 0.16390956938266754, -0.07631136476993561, 0.1675146520137787, 0.0051600635051727295, -0.007805477827787399, -0.08513695746660233, -0.3430008888244629, -0.2596204876899719, -0.014534227550029755, 0.4946325719356537, 0.06971024721860886, -0.04465879872441292, 0.4484017789363861, -0.14818896353244781, 0.1179363876581192, -0.1471768468618393, -0.22253012657165527, 0.203509122133255, -0.09246620535850525, 0.0018386570736765862, -0.26144689321517944, -0.043645791709423065, 0.0955403670668602, 0.08753778785467148, 0.21376271545886993, 0.15006737411022186, -0.03474736213684082, -0.34478726983070374, -0.43050670623779297, -0.19279460608959198, 0.023817095905542374, -0.0058377087116241455, 0.22474882006645203, -0.00804811716079712, 0.06107695400714874, 0.22086264193058014, -0.3003784418106079, 0.1870308369398117, -0.03985249251127243, 0.09634671360254288, -0.07758592814207077, 0.14231251180171967, 0.1810915619134903, -0.20765884220600128, 0.12171505391597748, 0.037756867706775665, -0.2517586350440979, -0.27931058406829834, -0.2524658739566803, 0.06868714839220047, -0.11045735329389572, 0.00928440410643816, -0.2442394495010376, 0.024120714515447617, 0.1434359848499298, -0.18255747854709625, 0.11799705028533936, 0.006563909351825714, 0.006734170019626617, 0.20427852869033813, 0.29743969440460205, 0.17424249649047852, 0.11100898683071136, 0.15683750808238983, -0.13675573468208313, 0.2000015676021576, -0.07811309397220612, 0.3091367483139038, -0.04514332115650177, 0.08540020883083344, -0.3259061276912689, -0.19919529557228088, -0.08480806648731232, 0.20568329095840454, 0.2104479968547821, -0.17014318704605103, -0.020131321623921394, 0.26739510893821716, 0.3997286558151245, 0.14793606102466583, -0.0521552748978138, -0.1934337615966797, 0.1871679127216339, 0.247449591755867, -0.09143383800983429, -0.31156647205352783, 0.12472154200077057, 0.044635772705078125, -0.038813889026641846, 0.001028314232826233, 0.1718967705965042, 0.05065105855464935, 0.0038974210619926453, 0.07348033040761948, 0.6514286994934082, -0.027557577937841415, 0.2584332525730133, 0.1985318809747696, 0.10488314926624298, 0.1446332037448883, -0.05924384295940399, 0.10071143507957458, 0.12494252622127533, 0.13742494583129883, 0.1058419942855835, -0.025369038805365562, 0.23586943745613098, 0.35011646151542664, -0.35341423749923706, -0.5694719552993774, 0.342542439699173, 0.4990829825401306, -0.024754434823989868, 0.3792273998260498, 0.044761236757040024, 0.43843021988868713, 0.10897350311279297, -0.10765228420495987, 0.1689358800649643, 0.1963983178138733, 0.02743946574628353, -0.25870177149772644, 0.11352618038654327, -0.11964894086122513, -0.13139936327934265, 0.08560214936733246, -0.03414173051714897, 0.1487322747707367, 0.2731485962867737, 0.21786700189113617, -0.09917326271533966, -0.14490672945976257, -0.14476820826530457, 0.02690189890563488, 0.30697423219680786, -0.16943001747131348, 0.3578825294971466, 0.07765074819326401, -0.24439039826393127, 0.027064025402069092, 0.12003809213638306, 0.2546144425868988, 0.42925727367401123, 0.08607552945613861, 0.015354763716459274, 0.06866629421710968, -0.005915762856602669, -0.32228177785873413, 0.2223030924797058, -0.10279794037342072, -0.30155232548713684, 0.15067912638187408, 0.16324301064014435, -0.07516363263130188, 0.38221633434295654, -0.14004895091056824, 0.23133639991283417, -0.3659517765045166, 0.1645352840423584, -0.17371560633182526, -0.04681877791881561, 0.039594393223524094, 0.03420259431004524, -0.1921634078025818, 0.1129278838634491, 0.3542165756225586, 0.020396612584590912, 0.30889347195625305, -0.03702094033360481, 0.11713680624961853, 0.1077752411365509, 0.4492952227592468, 0.2380811721086502, -0.20329302549362183, 0.027111582458019257, -0.2993706464767456, -0.6549670696258545, 0.2423059046268463, 0.003748837858438492, 0.11602279543876648, 0.07175072282552719, 0.20584118366241455, -0.09493740648031235, 0.1761762648820877, -0.20828525722026825, -0.00851514283567667, -0.03628775477409363, 0.1239398792386055, -0.4367487132549286, -0.1255100667476654, -0.05753731727600098, -0.07298847287893295, 0.12296941876411438, -0.5161147713661194, 0.03703606128692627, -0.11960798501968384, 0.10262133926153183, -0.12324650585651398, -0.162662535905838, 0.11249332129955292, 0.22873660922050476, 0.5022515058517456, 0.2240692675113678, -0.16677549481391907, -0.03386244922876358, -0.18598373234272003, -0.4704194664955139, 0.02330128662288189, -0.20921769738197327, -0.10019796341657639, -0.1533261239528656, 0.18720422685146332, -0.450735867023468, 0.05145534873008728, -0.30617445707321167, 0.14935319125652313, 0.05068339407444, -0.1063741073012352, -0.0734703466296196, -0.233177050948143, -0.1121373325586319, -0.08432619273662567, 0.13034945726394653, 0.38761967420578003, 0.03847375512123108, 0.332121878862381, -0.4364246726036072, -0.13736288249492645, 0.46206650137901306, -0.41878819465637207, -0.15341584384441376, 0.09918585419654846, 0.0695536732673645, 0.052824392914772034, -0.23436880111694336, -0.12232545763254166, 0.21893846988677979, 0.381210058927536, 0.06343352794647217, -0.027357712388038635, 0.10301715135574341, 0.04476515203714371, 0.19442881643772125, -0.013430511578917503, 0.29253122210502625, 0.2662549912929535, -0.06441856175661087, -0.034422338008880615, -0.17089921236038208 ]
https://github.com/huggingface/datasets/issues/2953
Trying to get in touch regarding a security issue
Hi @JamieSlome, Thanks for reaching out. Yes, you are right: I'm opening a PR to add the `SECURITY.md` file and a contact method. In the meantime, please feel free to report the security issue to: feedback@huggingface.co
Hey there! I'd like to report a security issue but cannot find contact instructions on your repository. If not a hassle, might you kindly add a `SECURITY.md` file with an email, or another contact method? GitHub [recommends](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository) this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future. Thank you for your consideration, and I look forward to hearing from you! (cc @huntr-helper)
36
Trying to get in touch regarding a security issue Hey there! I'd like to report a security issue but cannot find contact instructions on your repository. If not a hassle, might you kindly add a `SECURITY.md` file with an email, or another contact method? GitHub [recommends](https://docs.github.com/en/code-security/getting-started/adding-a-security-policy-to-your-repository) this best practice to ensure security issues are responsibly disclosed, and it would serve as a simple instruction for security researchers in the future. Thank you for your consideration, and I look forward to hearing from you! (cc @huntr-helper) Hi @JamieSlome, Thanks for reaching out. Yes, you are right: I'm opening a PR to add the `SECURITY.md` file and a contact method. In the meantime, please feel free to report the security issue to: feedback@huggingface.co
[ 0.21865390241146088, -0.16296058893203735, -0.14250686764717102, -0.10043318569660187, 0.18516075611114502, -0.10311402380466461, 0.3181801736354828, -0.10126663744449615, -0.13137084245681763, 0.42270761728286743, 0.22706159949302673, 0.057159774005413055, -0.012172465212643147, 0.21703405678272247, 0.10857032239437103, 0.2790279984474182, -0.12402745336294174, -0.23738723993301392, 0.31566816568374634, 0.05823656916618347, 0.17699985206127167, 0.08102340996265411, 0.0039011910557746887, 0.04466043785214424, 0.009896410629153252, 0.09300734102725983, -0.12462753057479858, 0.44969573616981506, 0.10820367932319641, -0.2701454162597656, 0.38503870368003845, 0.04913700371980667, -0.11821532994508743, 0.12548217177391052, -0.00009659961506258696, 0.03969327360391617, 0.3298991918563843, 0.02683773823082447, 0.00011765491217374802, 0.08231812715530396, 0.1790403425693512, -0.6113682985305786, -0.027816927060484886, 0.07838984578847885, -0.18682855367660522, 0.4804750680923462, 0.2070447951555252, 0.023416608572006226, 0.5059353709220886, 0.15757279098033905, 0.33446261286735535, 0.058749303221702576, 0.5902057886123657, -0.043904390186071396, 0.1273013949394226, -0.04821936786174774, -0.05007721111178398, 0.28504887223243713, 0.25332844257354736, 0.2744080424308777, 0.2047336846590042, 0.08535884320735931, 0.18785034120082855, -0.11368989944458008, 0.06002197414636612, 0.06114885210990906, 0.2654816806316376, -0.25437816977500916, 0.02758433297276497, -0.08430314809083939, 0.17131465673446655, -0.021231062710285187, -0.22104652225971222, -0.1931808888912201, 0.13174445927143097, -0.25738802552223206, 0.4460543990135193, 0.2202800065279007, -0.28615322709083557, 0.19266864657402039, -0.2557121515274048, -0.27088454365730286, -0.034283220767974854, 0.005990356206893921, 0.0811089277267456, -0.13365016877651215, -0.19818447530269623, -0.15562504529953003, -0.04420144483447075, -0.36434924602508545, -0.20632116496562958, 0.33823198080062866, -0.08374263346195221, 0.15434108674526215, 0.07048774510622025, -0.2927001714706421, 0.36418774724006653, 0.06822522729635239, 0.26505047082901, 0.39839786291122437, -0.002788395620882511, 0.17736023664474487, -0.3701789379119873, -0.03723748028278351, 0.11428514122962952, -0.004144145175814629, -0.09330040961503983, 0.19876262545585632, 0.5097894668579102, 0.2794700264930725, 0.41293415427207947, 0.1565457135438919, -0.09701904654502869, 0.0075629595667123795, -0.02588752843439579, 0.02975406125187874, 0.33246105909347534, -0.405447781085968, -0.06625471264123917, 0.26572591066360474, -0.2179051637649536, -0.09288565069437027, -0.10600368678569794, 0.20742389559745789, 0.25510597229003906, -0.23668235540390015, 0.12714512646198273, -0.44564563035964966, 0.07149577140808105, 0.061276573687791824, -0.19955496490001678, -0.0707409679889679, -0.3747985064983368, 0.2753649353981018, -0.022518392652273178, -0.07816682755947113, -0.019948482513427734, 0.170040100812912, 0.21988752484321594, 0.0030299946665763855, -0.1372494101524353, 0.42145273089408875, -0.08050904422998428, 0.4741142690181732, -0.07316069304943085, -0.31557679176330566, -0.08104981482028961, -0.2570365369319916, -0.03026605024933815, -0.06829304248094559, -0.32039281725883484, -0.054054535925388336, -0.23759649693965912, 0.2839239537715912, -0.026659347116947174, 0.21319690346717834, 0.11766940355300903, -0.08051387965679169, -0.2998150885105133, 0.08166095614433289, 0.31312188506126404, 0.34266048669815063, 0.25362715125083923, -0.1591523438692093, 0.138936385512352, 0.3485185503959656, 0.24205204844474792, -0.17650701105594635, -0.0470200851559639, -0.08386024832725525, 0.4095529317855835, 0.20579613745212555, -0.1720518171787262, -0.26247769594192505, -0.3719705045223236, 0.051056817173957825, 0.00675201416015625, -0.3616030216217041, -0.20913086831569672, 0.024377580732107162, -0.7009598016738892, -0.17232981324195862, 0.04655581712722778, -0.06519078463315964, -0.11462888866662979, -0.12784361839294434, 0.012601695954799652, -0.14674536883831024, -0.28601256012916565, 0.20740529894828796, -0.2274107038974762, -0.15615805983543396, -0.18696516752243042, -0.04150991141796112, -0.15707209706306458, 0.08590966463088989, 0.23668113350868225, -0.1140158623456955, 0.2389257848262787, -0.08500605821609497, -0.2952871322631836, 0.16203948855400085, 0.3350212872028351, 0.3262414336204529, -0.30321240425109863, 0.17878741025924683, 0.10102951526641846, 0.004296325147151947, 0.140896737575531, 0.3541581928730011, -0.0627840906381607, -0.25905370712280273, -0.02843501605093479, -0.11437978595495224, 0.03042725659906864, -0.33942583203315735, 0.30559059977531433, 0.23941580951213837, -0.012158926576375961, -0.1518167108297348, 0.01800110563635826, 0.5105560421943665, -0.3734745681285858, 0.23418393731117249, -0.10484172403812408, 0.17720644176006317, -0.19145998358726501, -0.251512348651886, 0.12023647129535675, 0.2091030776500702, 0.2587938606739044, 0.09129990637302399, 0.21380165219306946, 0.21264514327049255, -0.19640588760375977, -0.1337646245956421, 0.2960142195224762, 0.41277432441711426, 0.2689933180809021, -0.019846215844154358, 0.06150362640619278, -0.017689958214759827, -0.1563456952571869, 0.3779200315475464, -0.05810452252626419, 0.22456103563308716, 0.13281717896461487, -0.30836838483810425, -0.06050708144903183, 0.22743350267410278, 0.1826450675725937, -0.12042593955993652, -0.21564140915870667, -0.01922065019607544, 0.00759148970246315, 0.013462373986840248, 0.04405508562922478, -0.3674941658973694, -0.40679049491882324, 0.17307832837104797, 0.16493628919124603, -0.12027715146541595, 0.00430157408118248, 0.20587080717086792, 0.24990716576576233, 0.0619489923119545, 0.2164052426815033, 0.028418604284524918, -0.021560832858085632, 0.18863622844219208, -0.12940289080142975, 0.15684151649475098, -0.045926302671432495, -0.16098661720752716, -0.04494593292474747, -0.19721956551074982, -0.11583609879016876, -0.2535041868686676, 0.4214956760406494, 0.03819769248366356, 0.008743289858102798, -0.10692206025123596, -0.2781149446964264, -0.04788558930158615, -0.36848318576812744, -0.184696227312088, -0.026906127110123634, -0.06841297447681427, -0.11637723445892334, 0.12818455696105957, -0.1842905580997467, 0.0011453153565526009, -0.041902028024196625, -0.2139052450656891, -0.16514869034290314, -0.0937362015247345, -0.15776367485523224, 0.36058396100997925, -0.11107627302408218, 0.5761528015136719, 0.05208509415388107, 0.16296637058258057, -0.1208503320813179, 0.24955889582633972, -0.021066125482320786, -0.298373818397522, 0.5696051120758057, -0.29099124670028687, 0.07402892410755157, -0.471295565366745, -0.4845917224884033, 0.24856388568878174, -0.026247963309288025, -0.1499003767967224, 0.10364925861358643, 0.03761833906173706, 0.16639964282512665, -0.17243021726608276, 0.06732872873544693, 0.180249884724617, -0.2771221697330475, -0.09809120744466782, 0.09674925357103348, 0.1341659277677536, -0.38275718688964844, -0.1321304440498352, -0.15253297984600067, -0.12593425810337067, 0.3682902455329895, -0.0027659013867378235, 0.1859063059091568, 0.2089608609676361, -0.2205524742603302, 0.13545078039169312, -0.22702822089195251, 0.035007648169994354, -0.19086810946464539, -0.611155092716217, 0.21544763445854187, -0.26314017176628113, -0.22904019057750702, 0.20073318481445312, 0.09678751975297928, -0.19730103015899658, -0.2840695381164551, -0.4267011880874634, -0.32281985878944397, -0.04942759871482849, 0.19947582483291626, 0.17427922785282135, 0.07904036343097687, 0.45971786975860596, 0.034148208796978, -0.34321972727775574, -0.01735997200012207, -0.43259942531585693, -0.06521078199148178, -0.15993890166282654, 0.1804700493812561, -0.0005131848156452179, 0.10999206453561783, -0.12687350809574127, 0.44695156812667847, -0.08193423599004745, -0.04163424298167229, -0.027382172644138336, 0.09613226354122162, 0.26692384481430054, 0.4730263650417328, 0.039569973945617676, 0.10525798052549362, 0.22803884744644165, -0.20859107375144958, 0.09463212639093399, 0.17112869024276733, -0.18482235074043274, -0.14889776706695557, -0.2643124461174011, -0.13827776908874512, -0.37366196513175964, -0.25158029794692993, 0.052916090935468674, 0.17895320057868958, -0.25108930468559265, 0.02564200758934021, 0.009810315445065498, 0.0016511324793100357, 0.16862355172634125, 0.4445834159851074, 0.08678995072841644, -0.14653629064559937, -0.32595348358154297, -0.24575790762901306, -0.038363173604011536, 0.28016209602355957, -0.18973597884178162, 0.14415878057479858, -0.3059670627117157, -0.13310395181179047, 0.0008639246225357056, -0.18117977678775787, 0.000703662633895874, 0.02340688742697239, 0.3399397134780884, 0.1119612455368042, -0.19506686925888062, 0.8236110806465149, -0.3054351806640625, -0.027399685233831406, 0.43504366278648376, 0.24043476581573486, 0.09390419721603394, -0.24993637204170227, -0.06063693389296532, 0.20526739954948425, -0.6152307987213135, -0.10517853498458862, 0.3249836564064026, -0.01337331160902977, -0.2499188482761383, -0.22052808105945587, 0.26604393124580383, -0.00592072494328022, -0.07189816981554031, -0.09146220237016678, -0.046910978853702545, 0.47291961312294006, 0.1628355085849762, 0.07193552702665329, -0.07993343472480774, -0.10562761127948761, 0.4437415599822998, -0.07299013435840607, 0.2613080143928528, 0.16427859663963318, 0.17068469524383545, 0.41735419631004333, 0.2967343032360077, -0.27587994933128357, 0.27331411838531494, -0.29157084226608276, -0.09259206801652908, 0.5473393201828003, 0.16983143985271454, -0.002931147813796997, 0.060997381806373596, 0.3516988754272461, -0.15554013848304749, -0.29629412293434143, 0.0992821529507637, 0.09401334822177887, 0.10905932635068893, 0.041288867592811584, -0.1242738738656044, 0.024610932916402817, -0.15974362194538116, 0.04115826264023781, 0.428571879863739, -0.09627234935760498, -0.23227940499782562, 0.17441990971565247, 1.0093371868133545, -0.06480216979980469, 0.007254905998706818, -0.09506954997777939, -0.4359745383262634, 0.15617676079273224, -0.4165942072868347, 0.08476972579956055, -0.10037465393543243, 0.1383616030216217, 0.09307722002267838, -0.16634652018547058, 0.16194012761116028, -0.34536445140838623, -0.021849434822797775, 0.17104339599609375, -0.34543126821517944, -0.05250660702586174, 0.063618004322052, -0.005784977227449417, 0.14436206221580505, 0.16591554880142212, -0.3953205943107605, 0.3238760828971863, 0.04916422814130783, 0.14393210411071777, 0.008523989468812943, -0.2730148434638977, -0.08842800557613373, -0.1838378757238388, -0.686366617679596, 0.08093411475419998, -0.11291521042585373, -0.48648130893707275, 0.05284867435693741, -0.14076176285743713, 0.09341546893119812, -0.08547958731651306, 0.48723769187927246, 0.39598020911216736, -0.37070029973983765, -0.026702027767896652, 0.07634380459785461, -0.1096508800983429, -0.17440003156661987, 0.2930794954299927, 0.2313646376132965, -0.27276358008384705, -0.07245715707540512, 0.29929229617118835, -0.08224692940711975, -0.295365571975708, -0.3546423316001892, 0.17992228269577026, 0.03519502282142639, 0.0021808361634612083, 0.551041305065155, -0.03682950884103775, 0.20318107306957245, -0.119779571890831, 0.24613870680332184, 0.36026531457901, -0.1079445332288742, -0.5562224984169006, 0.417739599943161, 0.07323725521564484, -0.009385526180267334, 0.09755751490592957, 0.02985992096364498, -0.1073933094739914, -0.0817842110991478, 0.17723962664604187, -0.14869415760040283, -0.10043726116418839, -0.2670181691646576, -0.02843484655022621, -0.08543115109205246, -0.08472420275211334, -0.17731301486492157, -0.12004850059747696, -0.19497241079807281, 0.19959941506385803, -0.06786046177148819, 0.07124050706624985, -0.03739829361438751, -0.09094494581222534, -0.28027427196502686, -0.0033081769943237305, -0.28179654479026794, -0.08427061140537262, -0.13154861330986023, 0.11144508421421051, -0.0031412728130817413, -0.246047705411911, -0.5008066296577454, 0.08344373852014542, -0.5018215179443359, -0.21789291501045227, 0.22825434803962708, -0.028020575642585754, 0.10663458704948425, -0.15393157303333282, 0.21095803380012512, -0.16751256585121155, -0.17404738068580627, -0.24799397587776184, 0.20082518458366394, 0.054761096835136414, -0.26701992750167847, -0.11336277425289154, 0.09811069816350937, -0.10873457789421082, 0.1848759651184082, 0.25485044717788696, 0.28423261642456055, 0.02757588028907776, 0.3145660161972046, -0.15927192568778992, 0.09142698347568512, 0.15952564775943756, 0.028654783964157104, -0.049153588712215424, 0.14896923303604126, 0.3743271231651306, -0.1976449191570282, -0.1548629254102707, -0.37210243940353394, -0.08883420377969742, -0.026639817282557487, 0.2718202471733093, 0.1496506929397583, 0.33245906233787537, 0.19401711225509644, 0.020554054528474808, -0.1843072474002838, 0.31144842505455017, -0.19438084959983826, -0.2286721169948578, -0.4241292178630829, 0.06197277456521988, -0.07612504065036774, 0.30466994643211365, 0.010324779897928238, -0.043952569365501404, -0.13232289254665375, -0.13549016416072845, -0.08634275197982788, 0.19114336371421814, 0.11992479860782623, -0.007640339434146881, 0.18702977895736694, 0.37940770387649536, 0.11104028671979904, 0.18808981776237488, -0.1797962337732315, 0.08193260431289673, -0.37657877802848816, 0.08374026417732239, 0.24699389934539795, -0.23350176215171814, -0.11585428565740585, -0.2662501931190491, -0.006432197988033295, 0.11589062958955765, 0.28067636489868164, -0.08304938673973083, 0.07994953542947769, -0.11136387288570404, 0.18503831326961517, -0.14937856793403625, 0.2577168345451355, -0.3148232698440552, 0.07140585780143738, 0.08026298880577087, 0.38148632645606995, -0.05119314417243004, 0.0020326022058725357, 0.07925233989953995, -0.15369731187820435, 0.22389021515846252, 0.20882867276668549, -0.20757067203521729, -0.3101864457130432, -0.01809021830558777, -0.03982580825686455, 0.015688490122556686, 0.414904922246933, -0.28178155422210693, -0.13291466236114502, -0.012864191085100174, 0.0779501274228096, -0.05683956295251846, 0.29777297377586365, -0.12558779120445251, 0.22030946612358093, 0.03929542005062103, -0.21038511395454407, 0.16544285416603088, 0.11157738417387009, 0.5257514119148254, -0.10617578029632568, 0.2063583880662918, 0.05253906175494194, 0.28436970710754395, -0.15203838050365448, 0.07614941149950027, 0.2195584774017334, 0.11672435700893402, 0.18219336867332458, -0.25730031728744507, 0.2552283704280853, -0.20677970349788666, 0.27353277802467346, -0.06758977472782135, 0.01825697347521782, -0.1999085247516632, 0.4167134761810303, -0.24238714575767517, -0.12436175346374512, -0.3561336100101471, 0.08673571050167084, 0.04633840173482895, 0.04010928422212601, -0.08348366618156433, 0.2297852337360382, -0.16067540645599365, -0.3521694242954254, 0.18205340206623077, 0.14109833538532257, 0.10452981293201447, 0.3073956072330475, -0.023309782147407532, 0.15122699737548828, -0.14499710500240326, -0.14774423837661743, 0.4242323040962219, -0.06770168244838715, -0.4407135248184204, 0.010518183931708336, -0.007685955613851547, 0.3722381293773651, 0.12004204839468002, 0.12505291402339935, -0.5177443027496338, -0.035725247114896774, 0.07817897200584412, -0.2781878411769867, 0.15676170587539673, 0.052232690155506134, -0.10344923287630081, 0.13574616611003876, 0.027249746024608612, 0.2795707583427429, -0.010483017191290855, 0.22662198543548584, 0.20937521755695343, 0.21056106686592102, -0.06936034560203552, -0.062096238136291504, 0.23542670905590057, 0.036898478865623474, 0.2666351795196533, -0.12201883643865585, -0.45347699522972107, -0.16949482262134552, 0.08642281591892242, 0.09687095135450363, 0.09865982830524445, -0.10759389400482178, 0.08395668119192123, 0.09559088200330734, -0.3090413212776184, -0.3122071623802185, 0.11559972167015076, -0.08898016810417175, 0.2913855314254761, -0.09862059354782104, 0.11317119747400284, 0.04762161523103714, -0.2126757949590683, 0.05735449865460396, -0.17517107725143433, 0.08520370721817017, -0.12341566383838654, -0.10573317855596542, -0.19056883454322815, 0.46525949239730835, -0.23886071145534515, 0.11390236020088196, -0.07965318858623505, 0.31525927782058716, 0.019962329417467117, -0.21296550333499908, -0.4591408967971802, 0.16339704394340515, 0.022253476083278656, 0.0008101481944322586, -0.43543705344200134, 0.12042838335037231, -0.07600942254066467, -0.11811372637748718, 0.04263687506318092, 0.11483696103096008, 0.0005918964743614197, 0.08057501912117004, -0.041941799223423004, -0.13537266850471497 ]
https://github.com/huggingface/datasets/issues/2945
Protect master branch
@lhoestq now the 2 are implemented. Please note that for the the second protection, finally I have chosen to protect the master branch only from **merge commits** (see update comment above), so no need to disable/re-enable the protection on each release (direct commits, different from merge commits, can be pushed to the remote master branch; and eventually reverted without messing up the repo history).
After accidental merge commit (91c55355b634d0dc73350a7ddee1a6776dbbdd69) into `datasets` master branch, all commits present in the feature branch were permanently added to `datasets` master branch history, as e.g.: - 00cc036fea7c7745cfe722360036ed306796a3f2 - 13ae8c98602bbad8197de3b9b425f4c78f582af1 - ... I propose to protect our master branch, so that we avoid we can accidentally make this kind of mistakes in the future: - [x] For Pull Requests using GitHub, allow only squash merging, so that only a single commit per Pull Request is merged into the master branch - Currently, simple merge commits are already disabled - I propose to disable rebase merging as well - ~~Protect the master branch from direct pushes (to avoid accidentally pushing of merge commits)~~ - ~~This protection would reject direct pushes to master branch~~ - ~~If so, for each release (when we need to commit directly to the master branch), we should previously disable the protection and re-enable it again after the release~~ - [x] Protect the master branch only from direct pushing of **merge commits** - GitHub offers the possibility to protect the master branch only from merge commits (which are the ones that introduce all the commits from the feature branch into the master branch). - No need to disable/re-enable this protection on each release This purpose of this Issue is to open a discussion about this problem and to agree in a solution.
64
Protect master branch After accidental merge commit (91c55355b634d0dc73350a7ddee1a6776dbbdd69) into `datasets` master branch, all commits present in the feature branch were permanently added to `datasets` master branch history, as e.g.: - 00cc036fea7c7745cfe722360036ed306796a3f2 - 13ae8c98602bbad8197de3b9b425f4c78f582af1 - ... I propose to protect our master branch, so that we avoid we can accidentally make this kind of mistakes in the future: - [x] For Pull Requests using GitHub, allow only squash merging, so that only a single commit per Pull Request is merged into the master branch - Currently, simple merge commits are already disabled - I propose to disable rebase merging as well - ~~Protect the master branch from direct pushes (to avoid accidentally pushing of merge commits)~~ - ~~This protection would reject direct pushes to master branch~~ - ~~If so, for each release (when we need to commit directly to the master branch), we should previously disable the protection and re-enable it again after the release~~ - [x] Protect the master branch only from direct pushing of **merge commits** - GitHub offers the possibility to protect the master branch only from merge commits (which are the ones that introduce all the commits from the feature branch into the master branch). - No need to disable/re-enable this protection on each release This purpose of this Issue is to open a discussion about this problem and to agree in a solution. @lhoestq now the 2 are implemented. Please note that for the the second protection, finally I have chosen to protect the master branch only from **merge commits** (see update comment above), so no need to disable/re-enable the protection on each release (direct commits, different from merge commits, can be pushed to the remote master branch; and eventually reverted without messing up the repo history).
[ -0.15531960129737854, -0.1002306193113327, -0.07032108306884766, -0.07981747388839722, -0.1042538732290268, -0.18798749148845673, 0.010403595864772797, 0.2728641629219055, -0.009848839603364468, -0.08413971960544586, 0.2926150858402252, -0.07787492871284485, -0.13245706260204315, 0.2158903330564499, -0.056228913366794586, 0.1705455183982849, 0.2003231942653656, -0.04079797863960266, -0.09233313798904419, 0.027923516929149628, 0.022608451545238495, -0.06870276480913162, 0.08319981396198273, 0.0436304546892643, -0.1837822049856186, 0.005401181057095528, -0.014811726287007332, 0.15649628639221191, -0.43976640701293945, -0.4695701003074646, 0.1452467292547226, 0.2322402149438858, 0.025106512010097504, 0.570534884929657, -0.00010436369484523311, -0.0003456100821495056, 0.16948667168617249, -0.040600672364234924, -0.14010260999202728, -0.21546383202075958, -0.49010711908340454, -0.4447956085205078, -0.07006323337554932, -0.008353948593139648, 0.12880674004554749, 0.0528678335249424, -0.13249993324279785, 0.02384573221206665, 0.3848448395729065, 0.10555253177881241, 0.23861077427864075, -0.1028517633676529, 0.18124021589756012, 0.013769363984465599, 0.39200884103775024, 0.5474525094032288, -0.06663461029529572, 0.30319973826408386, 0.054018013179302216, 0.0006758915260434151, 0.06110619753599167, 0.1741085648536682, -0.08237266540527344, -0.2866700291633606, 0.22701948881149292, -0.17799124121665955, 0.5181742906570435, -0.42435333132743835, -0.24158412218093872, -0.08311731368303299, 0.05237947776913643, -0.17814645171165466, -0.4089040458202362, -0.241936594247818, -0.14994749426841736, 0.007634168490767479, 0.06778046488761902, 0.24686436355113983, 0.0397396944463253, 0.0036496631801128387, -0.3773651421070099, -0.2718087434768677, -0.004407621920108795, 0.04920436441898346, 0.14194096624851227, -0.1626293957233429, 0.06642630696296692, -0.12703865766525269, 0.29422298073768616, -0.047328121960163116, -0.14698323607444763, -0.36763444542884827, -0.2413337528705597, -0.01258768979460001, -0.10261337459087372, -0.1957472860813141, -0.24620693922042847, -0.3248273730278015, 0.4251306354999542, 0.3889687657356262, -0.3832724690437317, 0.013739610090851784, -0.030489057302474976, -0.08101653307676315, 0.2071853131055832, 0.11785784363746643, -0.010490216314792633, 0.05848895013332367, 0.5307136178016663, 0.31444063782691956, 0.00515829399228096, 0.3255860507488251, 0.30157023668289185, 0.003047204576432705, 0.03444608673453331, 0.5741185545921326, 0.42894458770751953, -0.2629203796386719, 0.12764762341976166, 0.19597309827804565, -0.34120047092437744, -0.3845079839229584, 0.07113129645586014, -0.0861724391579628, 0.11032599955797195, 0.02713387832045555, -0.11471155285835266, 0.06680162250995636, 0.04519098252058029, -0.03808633238077164, -0.30790281295776367, -0.14148549735546112, -0.3744004964828491, -0.06853040307760239, 0.18604043126106262, -0.45710524916648865, 0.1491677612066269, 0.43252435326576233, -0.06803706288337708, -0.19928455352783203, 0.044552356004714966, 0.12922565639019012, 0.055587299168109894, 0.2961197793483734, -0.15379801392555237, -0.45262861251831055, 0.22359666228294373, 0.1313333809375763, -0.06689989566802979, 0.19400417804718018, -0.15989947319030762, -0.2616221308708191, -0.1049756109714508, 0.29776570200920105, -0.1482718288898468, 0.30715620517730713, -0.523766815662384, 0.03637322410941124, -0.004483729600906372, 0.3506704866886139, 0.4910378158092499, 0.3025481104850769, 0.3280786871910095, -0.16859367489814758, 0.06175646930932999, 0.1903456151485443, 0.32351168990135193, -0.05168633535504341, 0.062304262071847916, -0.2877362370491028, 0.10950355976819992, 0.14507333934307098, -0.3121602535247803, 0.017555944621562958, -0.0052360715344548225, -0.13128229975700378, 0.01077597588300705, -0.07140690088272095, -0.1119876578450203, -0.09892955422401428, -0.36668556928634644, 0.06940273195505142, -0.04073723405599594, -0.1007770374417305, 0.20795734226703644, -0.3201755881309509, -0.09479410946369171, 0.20508161187171936, -0.1481233835220337, 0.020898515358567238, -0.29198724031448364, -0.6061387062072754, -0.16365575790405273, -0.063438780605793, 0.12491442263126373, 0.2275642454624176, 0.36076924204826355, -0.00503103993833065, -0.02836192399263382, -0.171402707695961, -0.009397310204803944, 0.11250682175159454, 0.3421364724636078, -0.14967799186706543, -0.24154220521450043, 0.1322464942932129, -0.3545883297920227, 0.09114084392786026, -0.07851182669401169, -0.009774789214134216, 0.034448638558387756, -0.3157881498336792, 0.34128010272979736, -0.04405263811349869, -0.12080162763595581, -0.1141509860754013, 0.24151718616485596, 0.09595184028148651, -0.17473360896110535, -0.2039213478565216, -0.20740681886672974, 0.26019102334976196, -0.24083030223846436, 0.30186569690704346, 0.1300138384103775, 0.1026373878121376, -0.14118079841136932, -0.03645312041044235, -0.02509629726409912, 0.3619362711906433, 0.23630431294441223, -0.0899176225066185, -0.05915830284357071, 0.16876082122325897, -0.049062974750995636, 0.2035702019929886, 0.22469499707221985, 0.4252423048019409, 0.3736150860786438, -0.10268159210681915, 0.06260118633508682, -0.09179262816905975, -0.07872471958398819, 0.024594746530056, -0.32912731170654297, 0.3280373215675354, 0.07369445264339447, -0.13946452736854553, -0.17403237521648407, -0.10333283245563507, -0.1740739941596985, -0.220269113779068, -0.17077240347862244, -0.012951336801052094, -0.1690981388092041, 0.19436517357826233, -0.33659178018569946, 0.22236941754817963, -0.2772079408168793, 0.1485791951417923, 0.015052340924739838, -0.2516065537929535, -0.10240072757005692, 0.06829805672168732, -0.005967482924461365, -0.1327151358127594, 0.12417091429233551, 0.3773830533027649, 0.12787453830242157, 0.1700998991727829, 0.004274476319551468, 0.02015136554837227, 0.25728267431259155, -0.11643590033054352, 0.3533259928226471, 0.14430716633796692, -0.10544545203447342, 0.05406435206532478, 0.33645570278167725, 0.18121884763240814, 0.06433196365833282, 0.34691908955574036, -0.0033244099467992783, 0.03525811433792114, -0.20840676128864288, -0.045984651893377304, -0.2602103650569916, -0.5283414125442505, 0.21923783421516418, -0.11063811182975769, -0.35521674156188965, -0.008504029363393784, -0.045366086065769196, 0.04741820693016052, -0.5248720049858093, 0.1360299289226532, 0.18358078598976135, 0.2905261516571045, -0.31780314445495605, -0.11997828632593155, 0.12631550431251526, -0.02259511686861515, 0.012344064190983772, 0.12856003642082214, 0.3631601929664612, -0.2266809493303299, 0.45945093035697937, 0.23898093402385712, -0.169556125998497, -0.4726402759552002, -0.34341302514076233, 0.019130069762468338, -0.20393626391887665, -0.11797498166561127, 0.009819157421588898, -0.09893098473548889, 0.09215348958969116, -0.35854023694992065, -0.3257127106189728, -0.01877407543361187, -0.37300458550453186, -0.16009561717510223, 0.06959571689367294, 0.06288614124059677, -0.23461773991584778, -0.11404003947973251, -0.38658976554870605, -0.2821527123451233, 0.47935569286346436, -0.01643333211541176, 0.11565901339054108, -0.0431731678545475, -0.2923770546913147, -0.04591769352555275, 0.08748281747102737, 0.13663917779922485, -0.00004489859566092491, -0.36093226075172424, 0.03256693109869957, -0.040660206228494644, -0.029346849769353867, 0.3526098132133484, 0.18549081683158875, -0.43024054169654846, 0.07125162333250046, -0.3217606544494629, -0.15581896901130676, -0.05208442360162735, 0.486444354057312, 0.31412044167518616, -0.09737367928028107, 0.07107996940612793, 0.10355079919099808, -0.19190019369125366, 0.055089496076107025, -0.18161199986934662, 0.14722348749637604, 0.345488041639328, 0.2857186496257782, 0.03789950907230377, 0.14586752653121948, 0.025497030466794968, 0.7140874266624451, 0.3778496980667114, -0.05965729430317879, 0.2103370577096939, 0.3106975555419922, -0.027717728167772293, 0.003990530967712402, -0.2601568102836609, 0.06504696607589722, -0.10124319791793823, -0.000020869076251983643, 0.08670416474342346, -0.12957829236984253, -0.12296528369188309, -0.011210665106773376, -0.4777141809463501, 0.009155958890914917, -0.41467610001564026, -0.2396630495786667, -0.3181839883327484, 0.18425007164478302, -0.02252567932009697, -0.4854884445667267, 0.131380096077919, 0.05377083644270897, 0.23057642579078674, 0.21597129106521606, 0.21420618891716003, 0.1812158226966858, -0.020258845761418343, -0.05108445882797241, -0.12007347494363785, -0.06772629916667938, -0.004331177566200495, 0.1452508270740509, 0.09057986736297607, -0.1670408546924591, 0.03180568665266037, 0.06955047696828842, 0.3299912214279175, -0.014868861064314842, 0.14029131829738617, -0.17080751061439514, -0.509485125541687, 0.608630895614624, -0.3185942769050598, 0.1394028216600418, 0.2990989685058594, 0.5112242102622986, 0.439763605594635, -0.2954539954662323, -0.19531647861003876, 0.20712246000766754, 0.032556332647800446, 0.19783663749694824, 0.17735028266906738, 0.1449771374464035, 0.27830764651298523, -0.4903808832168579, 0.2887740135192871, 0.15483301877975464, -0.2504817247390747, -0.1551758199930191, -0.00390562042593956, -0.027050474658608437, 0.1264624297618866, -0.026303157210350037, -0.24539802968502045, 0.009127547033131123, -0.10943740606307983, 0.17344585061073303, 0.13292039930820465, 0.06982778012752533, 0.4152195453643799, 0.594658613204956, 0.13493385910987854, -0.38919880986213684, -0.048201434314250946, -0.1750735640525818, -0.07428327947854996, 0.3271437883377075, 0.19835083186626434, 0.24822789430618286, 0.020348424091935158, 0.17768612504005432, -0.12347228080034256, -0.26623857021331787, -0.20336675643920898, -0.03849105164408684, -0.07674301415681839, 0.0075890012085437775, 0.08732891082763672, -0.0458979494869709, -0.09099192172288895, 0.013048846274614334, 0.13999825716018677, -0.36610016226768494, 0.16378498077392578, 0.6180499196052551, 0.9825437664985657, 0.39756739139556885, 0.08903378248214722, -0.2546568512916565, -0.3273828625679016, 0.32599079608917236, -0.34010791778564453, -0.16645097732543945, -0.24701710045337677, -0.1235882043838501, -0.18424610793590546, -0.340311735868454, -0.03869468718767166, -0.4898468852043152, -0.35285577178001404, 0.13511264324188232, -0.21805500984191895, 0.5279190540313721, 0.008177699521183968, 0.12338617444038391, 0.19101890921592712, -0.12231472134590149, 0.25515109300613403, 0.1982705295085907, 0.061811529099941254, 0.10409486293792725, -0.004027350805699825, -0.4687907099723816, -0.002232838422060013, 0.02053874358534813, -0.3772696852684021, 0.08914731442928314, -0.34377774596214294, 0.03884683921933174, -0.20635312795639038, -0.3160521388053894, 0.11582736670970917, -0.0870480090379715, 0.6059408187866211, 0.16663047671318054, -0.07945167273283005, -0.044620756059885025, 0.2913888990879059, 0.46452462673187256, -0.2288515418767929, -0.21953052282333374, 0.5223726630210876, -0.21336379647254944, -0.13021710515022278, -0.20476171374320984, -0.08033435046672821, -0.23709268867969513, -0.2609478533267975, -0.1280430406332016, -0.3282321095466614, 0.07950181514024734, 0.04171447083353996, 0.2636534571647644, -0.09106945991516113, -0.16760604083538055, 0.18599312007427216, 0.1154857650399208, -0.10757312923669815, -0.11858520656824112, -0.1695202887058258, -0.2610396146774292, -0.06781578063964844, 0.20160076022148132, 0.16160550713539124, -0.12060718983411789, -0.07676426321268082, 0.09965743124485016, -0.24433642625808716, -0.22078964114189148, -0.20729219913482666, 0.10598786175251007, -0.13946881890296936, 0.09298151731491089, -0.5486778616905212, -0.3299342095851898, 0.05174681916832924, 0.2461930513381958, 0.27941569685935974, 0.33049818873405457, 0.11800016462802887, -0.09977070242166519, -0.22444948554039001, 0.2186434119939804, -0.32792654633522034, 0.16864904761314392, 0.02358414977788925, 0.1588115394115448, -0.02600979059934616, 0.040430162101984024, -0.3905957341194153, 0.16031521558761597, -0.1254802793264389, -0.021126411855220795, -0.2255207896232605, -0.10175354033708572, -0.0006300269160419703, -0.30818676948547363, 0.03248737007379532, 0.023433048278093338, -0.19575677812099457, -0.28301504254341125, 0.09266875684261322, 0.06569558382034302, 0.06478920578956604, -0.05701340734958649, -0.05746100842952728, -0.10815787315368652, 0.08275307714939117, 0.2720320522785187, 0.2396920919418335, -0.1584915816783905, 0.10971306264400482, -0.032224830240011215, 0.17108818888664246, 0.1105850338935852, -0.024772360920906067, 0.08924159407615662, 0.014632225036621094, -0.26580148935317993, -0.035374660044908524, 0.26715999841690063, -0.18174606561660767, -0.21714401245117188, -0.2685396075248718, 0.18883578479290009, 0.10563346743583679, 0.5840904712677002, 0.20287999510765076, 0.14421731233596802, -0.40508225560188293, 0.17540916800498962, -0.053197454661130905, -0.0036357268691062927, -0.1692354828119278, -0.09694027155637741, -0.0849621519446373, 0.2793600559234619, -0.08671899139881134, -0.30359721183776855, 0.27138394117355347, 0.18818168342113495, 0.0007486306130886078, 0.1049710139632225, 0.5280758738517761, 0.12962080538272858, -0.1896521896123886, 0.422135591506958, 0.2712433636188507, -0.0876757800579071, 0.49489980936050415, 0.4702334403991699, -0.11318205296993256, -0.020324934273958206, -0.0827358290553093, 0.1166144609451294, 0.23068729043006897, -0.2540963888168335, 0.1284717172384262, 0.2962188720703125, 0.6462966799736023, -0.16888459026813507, 0.39355477690696716, -0.033096250146627426, 0.34373947978019714, 0.19799299538135529, 0.05874068662524223, -0.24604949355125427, 0.39270922541618347, 0.21170765161514282, 0.3301510214805603, -0.6189893484115601, 0.13637316226959229, 0.49140289425849915, 0.0492829754948616, 0.19958175718784332, -0.40010565519332886, -0.04923245683312416, -0.05847602337598801, -0.048312995582818985, -0.07818271219730377, 0.1634952872991562, 0.12373755872249603, 0.2829664349555969, 0.006584294140338898, -0.08837837725877762, -0.04344046115875244, 0.18504831194877625, 0.24156159162521362, -0.11699803173542023, -0.18117332458496094, 0.357754647731781, -0.27619755268096924, 0.06649397313594818, 0.2154599279165268, 0.13506822288036346, -0.07471633702516556, -0.0686337798833847, 0.18023425340652466, 0.4503944516181946, -0.1699342429637909, 0.022511102259159088, 0.055749256163835526, -0.1625678837299347, 0.15771770477294922, 0.08014734089374542, 0.25803232192993164, -0.05334077402949333, 0.11280247569084167, 0.03542713820934296, -0.41529783606529236, -0.025322189554572105, 0.43308109045028687, 0.5564647912979126, -0.33773043751716614, 0.4601392149925232, 0.11926835030317307, 0.2847006022930145, -0.03268478065729141, 0.4374352693557739, -0.047126155346632004, 0.11639190465211868, -0.005153692327439785, 0.1430787444114685, 0.028090059757232666, 0.25758832693099976, 0.14149969816207886, -0.03334551304578781, -0.15928880870342255, 0.03010663390159607, -0.12154114246368408, 0.12743577361106873, 0.2968396842479706, 0.17307031154632568, 0.41988885402679443, -0.29471397399902344, 0.12756891548633575, 0.12823469936847687, -0.08756928145885468, -0.34139639139175415, 0.009521734900772572, 0.09408475458621979, -0.3605291545391083, 0.004247557371854782, 0.22248141467571259, -0.06943947821855545, -0.024194110184907913, 0.11893392354249954, 0.40947771072387695, 0.19279053807258606, 0.1120925173163414, 0.1051306501030922, -0.04934776574373245, 0.3209429085254669, -0.3918461799621582, 0.22496198117733002, 0.18922297656536102, -0.10292969644069672, -0.22188833355903625, -0.051098741590976715, 0.007365815341472626, 0.021280519664287567, -0.4355091154575348, -0.14018017053604126, -0.16222631931304932, 0.4209836423397064, -0.1355971395969391, 0.0682978481054306, -0.37221813201904297, 0.06876721233129501, -0.03713434189558029, 0.26835596561431885, -0.3000989556312561, 0.0864085853099823, 0.05254735052585602, 0.017337752506136894, 0.08837057650089264, 0.13057991862297058, 0.06843437254428864, 0.2528507113456726, -0.35231536626815796, -0.12488927692174911, 0.35866206884384155, -0.019470766186714172, 0.09103627502918243, -0.217268705368042, 0.4182039797306061, 0.4654456675052643, -0.14808142185211182, -0.332115113735199, -0.26351821422576904, -0.011156533844769001, -0.27983397245407104, -0.54208904504776, 0.2986375689506531, 0.13786819577217102, 0.19743852317333221, -0.10587102174758911, 0.0366067960858345, -0.07432646304368973, -0.15276344120502472, 0.06117190793156624, -0.19878576695919037 ]
https://github.com/huggingface/datasets/issues/2944
Add `remove_columns` to `IterableDataset `
Hi ! Good idea :) If you are interested in contributing, feel free to give it a try and open a Pull Request. Also let me know if I can help you with this or if you have questions
**Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. ```python from datasets import load_dataset dataset = load_dataset("c4", 'realnewslike', streaming =True, split='train') dataset = dataset.remove_columns('url') ``` ``` AttributeError: 'IterableDataset' object has no attribute 'remove_columns' ``` **Describe the solution you'd like** It would be nice to have `.remove_columns()` to match the `Datasets` api. **Describe alternatives you've considered** This can be done with a single call to `.map()`, I can try to help add this. 🤗
39
Add `remove_columns` to `IterableDataset ` **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. ```python from datasets import load_dataset dataset = load_dataset("c4", 'realnewslike', streaming =True, split='train') dataset = dataset.remove_columns('url') ``` ``` AttributeError: 'IterableDataset' object has no attribute 'remove_columns' ``` **Describe the solution you'd like** It would be nice to have `.remove_columns()` to match the `Datasets` api. **Describe alternatives you've considered** This can be done with a single call to `.map()`, I can try to help add this. 🤗 Hi ! Good idea :) If you are interested in contributing, feel free to give it a try and open a Pull Request. Also let me know if I can help you with this or if you have questions
[ 0.030971039086580276, 0.06693252921104431, -0.14841969311237335, -0.026566237211227417, 0.3402366042137146, 0.37640854716300964, 0.4748355448246002, 0.4397598206996918, 0.13304489850997925, 0.16649067401885986, -0.17116034030914307, 0.3257799446582794, -0.3537244200706482, 0.30008649826049805, -0.16107141971588135, -0.32236918807029724, 0.00524766743183136, 0.19792470335960388, -0.17839482426643372, 0.0018863752484321594, -0.2809411883354187, 0.0037270672619342804, -0.25891637802124023, -0.22675295174121857, 0.14328722655773163, -0.16849876940250397, -0.186357319355011, -0.09111989289522171, 0.11502283811569214, -0.33915266394615173, 0.011462127789855003, 0.24478892982006073, 0.1089547798037529, 0.18486809730529785, -0.00010726568143581972, -0.14071941375732422, -0.05236278474330902, -0.003669390454888344, -0.21193969249725342, 0.07544030249118805, -0.32714831829071045, 0.08768609911203384, 0.1565283238887787, -0.3273727297782898, -0.09550580382347107, -0.3379867970943451, -0.30666354298591614, -0.22884710133075714, 0.23495091497898102, 0.5939163565635681, 0.2583121955394745, -0.049661893397569656, -0.3442913889884949, 0.1904856413602829, 0.05838710069656372, -0.013024330139160156, -0.23952613770961761, -0.010644055902957916, 0.025932341814041138, -0.18341973423957825, 0.2285938560962677, 0.41359955072402954, -0.2800794541835785, -0.07720568776130676, 0.0675944983959198, 0.04766480624675751, -0.062264688313007355, -0.31693553924560547, 0.23259466886520386, 0.16606464982032776, 0.5263826251029968, -0.4305729269981384, -0.08832958340644836, -0.2818664312362671, 0.16461695730686188, -0.5959458947181702, -0.038642823696136475, -0.07375499606132507, 0.15683503448963165, 0.25708630681037903, -0.4255930185317993, -0.1042766347527504, -0.13898590207099915, 0.2842647433280945, 0.201656311750412, 0.19634239375591278, 0.1099691241979599, 0.13662052154541016, 0.16115468740463257, 0.16963587701320648, 0.3128258287906647, -0.20631229877471924, 0.1911718249320984, 0.4252467751502991, -0.3988772928714752, -0.35188743472099304, -0.004329495131969452, -0.09448003023862839, -0.11250082403421402, 0.27358362078666687, 0.15413519740104675, -0.05672433227300644, 0.02358822524547577, 0.09954209625720978, 0.35116440057754517, 0.20171953737735748, -0.199966162443161, 0.24922682344913483, 0.15839985013008118, 0.2856101393699646, -0.006820898503065109, -0.09801243990659714, 0.232622429728508, 0.053603820502758026, 0.42717522382736206, 0.07005686312913895, 0.3394533395767212, 0.012302424758672714, -0.33164331316947937, 0.004500091541558504, -0.37088659405708313, -0.0801500529050827, 0.09896167367696762, 0.07708169519901276, 0.005167522467672825, 0.30214646458625793, -0.12629076838493347, 0.18433019518852234, 0.07141833007335663, -0.022595468908548355, -0.2456740438938141, 0.25467467308044434, 0.07141315937042236, 0.1038704589009285, 0.21009720861911774, -0.027189210057258606, 0.170864075422287, -0.01662755012512207, -0.24849216639995575, -0.008625056594610214, 0.0474453940987587, -0.23276890814304352, 0.3155222237110138, 0.21544292569160461, -0.14799092710018158, 0.12423022836446762, 0.12949702143669128, -0.3355679512023926, -0.3081946074962616, 0.21711465716362, -0.10776668041944504, -0.3205939829349518, -0.17463861405849457, 0.26338815689086914, -0.07955767214298248, -0.2523925304412842, -0.2041928470134735, 0.153363898396492, -0.04121548682451248, 0.06176343187689781, 0.28388115763664246, -0.09463024139404297, -0.04341704398393631, -0.07741367071866989, 0.026163605973124504, 0.3239145278930664, -0.2348889857530594, -0.09686341136693954, -0.2570094168186188, -0.07520419359207153, 0.2514667809009552, 0.057573139667510986, -0.10884909331798553, 0.2581726312637329, -0.09004709869623184, -0.02401392161846161, 0.2616029381752014, -0.014890879392623901, -0.28527379035949707, 0.3908601701259613, 0.04606063663959503, 0.4699413776397705, -0.13333389163017273, 0.2280532419681549, 0.1130862757563591, 0.03729208558797836, 0.09873487055301666, 0.09436734765768051, -0.023776108399033546, 0.05544982850551605, -0.05367496982216835, -0.20912323892116547, 0.21282483637332916, 0.19651515781879425, 0.036511220037937164, 0.33211344480514526, -0.02279733121395111, -0.2796962857246399, 0.5073032975196838, -0.08410131931304932, 0.041616447269916534, 0.31562620401382446, 0.4772370755672455, -0.010904736816883087, 0.06660792976617813, -0.47211018204689026, -0.48800569772720337, -0.012817293405532837, 0.44170650839805603, -0.07296653091907501, -0.06298142671585083, -0.45407766103744507, -0.2885434329509735, 0.03962065279483795, -0.26136910915374756, 0.0005182772874832153, 0.1669473648071289, -0.2535005211830139, -0.09152065217494965, -0.23258255422115326, -0.5889037251472473, 0.1153055801987648, -0.44260305166244507, -0.011864669620990753, -0.21612994372844696, 0.22209544479846954, 0.10008402168750763, -0.0013350453227758408, 0.16204306483268738, 0.3697952628135681, 0.2247544825077057, -0.04570842906832695, -0.1814185082912445, 0.368824303150177, -0.07066098600625992, 0.16880753636360168, -0.05416721850633621, 0.6884852647781372, 0.17368362843990326, 0.015681754797697067, -0.046991437673568726, 0.34133386611938477, 0.10748135298490524, 0.06885015219449997, -0.07756993919610977, 0.2534857392311096, -0.2518089711666107, 0.3723262548446655, 0.07918007671833038, 0.02442467026412487, 0.305664598941803, -0.10432516783475876, -0.2258979082107544, -0.3435172140598297, -0.16617198288440704, -0.04301770403981209, -0.0820000022649765, -0.11515460908412933, -0.17936193943023682, 0.11011649668216705, 0.4129932224750519, 0.08012835681438446, -0.09358572214841843, 0.1888105571269989, -0.2560786306858063, -0.1638001799583435, 0.23020710051059723, 0.33377137780189514, 0.4676188826560974, 0.16270659863948822, 0.04954471066594124, 0.4539244771003723, 0.3030141592025757, -0.03443343937397003, 0.2897386848926544, 0.335627019405365, 0.19140899181365967, 0.12568822503089905, 0.16847790777683258, 0.1424122005701065, -0.5074314475059509, -0.495187371969223, -0.06350483000278473, 0.512393593788147, -0.13636761903762817, 0.041893333196640015, -0.17733609676361084, -0.04685001075267792, 0.11920583248138428, -0.24905215203762054, 0.014511581510305405, -0.22221216559410095, 0.19779230654239655, 0.3383946418762207, -0.4850509464740753, 0.3431349992752075, -0.430984228849411, 0.4935791492462158, 0.16323889791965485, -0.14837394654750824, -0.10087801516056061, -0.29970309138298035, 0.19530612230300903, 0.1882835328578949, -0.10324427485466003, -0.33091843128204346, 0.2989961504936218, 0.0934395045042038, 0.014470525085926056, -0.2717897891998291, -0.15466207265853882, 0.08447063714265823, -0.16145607829093933, -0.06255819648504257, 0.17809653282165527, 0.3104633092880249, 0.1776784062385559, -0.2218572199344635, 0.0810222253203392, -0.12998120486736298, 0.16754776239395142, 0.02129584550857544, 0.0956358090043068, 0.015771469101309776, 0.012825943529605865, -0.40243005752563477, 0.04527539759874344, -0.3172719180583954, 0.16057619452476501, -0.04476260766386986, 0.335058331489563, 0.25860685110092163, 0.03885507211089134, 0.014433025382459164, 0.31036609411239624, -0.111772820353508, -0.2561284303665161, -0.18621745705604553, 0.18900591135025024, -0.1910829246044159, -0.12690594792366028, 0.10564498603343964, -0.06914426386356354, 0.11358882486820221, 0.09026776999235153, -0.35536515712738037, -0.3323920667171478, -0.28886833786964417, 0.00435381755232811, -0.17375001311302185, -0.08411905914545059, 0.4157605469226837, 0.3240595757961273, -0.1051519513130188, 0.06461519002914429, -0.08125363290309906, -0.06419342011213303, 0.3970058858394623, -0.1454314887523651, 0.1416158676147461, 0.5284864902496338, -0.005553733557462692, 0.3980299234390259, 0.20459888875484467, 0.07284019887447357, 0.38103342056274414, -0.2488236427307129, 0.15612877905368805, -0.16011929512023926, -0.5307507514953613, -0.025965562090277672, -0.05591735243797302, -0.10495954006910324, 0.423902690410614, -0.14129561185836792, -0.45437127351760864, -0.05679260566830635, 0.21835611760616302, -0.09070895612239838, -0.2332729548215866, 0.16753682494163513, -0.16619673371315002, 0.2990472912788391, -0.009145839139819145, 0.014957748353481293, -0.13745352625846863, -0.30555853247642517, 0.20710605382919312, -0.11077874898910522, 0.17742373049259186, -0.5070869326591492, -0.4012402296066284, -0.294312059879303, -0.40422436594963074, 0.3996860980987549, 0.0737234577536583, 0.1537655144929886, 0.02403901144862175, -0.2728310227394104, 0.12695904076099396, 0.22485268115997314, 0.5311208963394165, -0.41790446639060974, -0.3895115256309509, 0.005241891369223595, 0.08415435254573822, -0.2514854371547699, -0.06404010951519012, -0.1820310354232788, 0.1683024764060974, -0.07062377035617828, 0.6183818578720093, 0.056309737265110016, -0.22257521748542786, 0.3934072256088257, 0.2408415973186493, -0.1093757301568985, -0.1049860343337059, -0.09491626918315887, -0.2905727028846741, -0.2814675569534302, 0.00011885911226272583, 0.2010195106267929, 0.2788867950439453, -0.0802515521645546, -0.25070029497146606, 0.06475367397069931, -0.2881167531013489, 0.12974214553833008, 0.12689949572086334, 0.0951114222407341, 0.22190114855766296, 0.16233447194099426, 0.10539771616458893, 0.04072384536266327, -0.23476827144622803, 0.3156428337097168, -0.16324341297149658, -0.24879425764083862, -0.11902027577161789, -0.221480131149292, 0.4256476163864136, 0.2334451973438263, 0.0554739385843277, 0.23581019043922424, 0.004251128062605858, 0.3425483703613281, -0.29205432534217834, -0.0917094349861145, 0.25366824865341187, -0.15953102707862854, -0.1138320341706276, -0.6538038849830627, 0.4140252470970154, -0.039994753897190094, -0.10519586503505707, 0.6590245962142944, 0.23709291219711304, -0.2728252112865448, 0.291080117225647, -0.11219782382249832, 0.9685648083686829, 0.08769189566373825, -0.14306023716926575, 0.07881495356559753, -0.07034340500831604, 0.06229992210865021, -0.2936420440673828, 0.3499724864959717, -0.1844036877155304, -0.29306069016456604, -0.1753208190202713, 0.18634794652462006, 0.23878416419029236, 0.24527782201766968, 0.0872521847486496, 0.18170884251594543, -0.08076212555170059, 0.47728458046913147, 0.010769329033792019, -0.05367429926991463, -0.06144771724939346, -0.20045770704746246, -0.38762667775154114, 0.1523546427488327, -0.054158829152584076, -0.09822054207324982, 0.011113235726952553, 0.22526748478412628, 0.27638745307922363, -0.12530440092086792, 0.03519752621650696, -0.01414023619145155, -0.11973053961992264, 0.16647489368915558, -0.22207292914390564, -0.29261279106140137, -0.2091953605413437, 0.27382683753967285, 0.08565524965524673, -0.22583334147930145, -0.18288202583789825, 0.2416382133960724, 0.1496691107749939, 0.16757668554782867, -0.22701577842235565, 0.2707241177558899, -0.050380125641822815, -0.22387784719467163, -0.2993551790714264, 0.30330750346183777, 0.03895100578665733, -0.5449906587600708, -0.07753616571426392, -0.07332219183444977, 0.37387311458587646, -0.3930521607398987, -0.31075823307037354, 0.005314454436302185, 0.015191823244094849, -0.34716472029685974, 0.16525159776210785, -0.1207733154296875, -0.08333685994148254, 0.2393055260181427, -0.012451939284801483, -0.2432803362607956, -0.08716267347335815, 0.27615785598754883, 0.21296602487564087, 0.19136269390583038, 0.6586563587188721, -0.12530109286308289, -0.2661910951137543, -0.35331299901008606, -0.1717764437198639, 0.14267641305923462, -0.1525728404521942, 0.08912034332752228, -0.10897788405418396, 0.12885351479053497, -0.18864527344703674, 0.2436620593070984, -0.34939372539520264, 0.20923545956611633, -0.0706687718629837, -0.24678903818130493, -0.2311258614063263, 0.1803707480430603, 0.25834763050079346, 0.3577607274055481, -0.21648713946342468, -0.1301846206188202, -0.21167190372943878, -0.14699198305606842, -0.4042176902294159, -0.127803772687912, -0.11787009984254837, 0.11856524646282196, 0.4153863787651062, 0.15474653244018555, 0.18035098910331726, -0.14131058752536774, 0.2651544511318207, -0.11768162250518799, 0.17886455357074738, -0.337555855512619, -0.231745645403862, 0.12138490378856659, 0.07820024341344833, -0.121246837079525, -0.0698632299900055, -0.037966467440128326, -0.4096592664718628, -0.32799649238586426, 0.2658945620059967, -0.02638070099055767, 0.17472422122955322, 0.4860360026359558, -0.013904716819524765, -0.3087754249572754, -0.24351821839809418, -0.2414020597934723, -0.1391807496547699, 0.10317644476890564, 0.2541327178478241, -0.1109364926815033, -0.13784459233283997, -0.007038213312625885, 0.0046125599183142185, 0.08742150664329529, 0.14395400881767273, 0.05089040845632553, 0.3788726031780243, -0.03433021157979965, 0.040961045771837234, 0.340381383895874, 0.33890387415885925, 0.09581257402896881, -0.3911645710468292, -0.1242554560303688, 0.10911758244037628, 0.2855178713798523, -0.46846210956573486, 0.07144982367753983, 0.14713820815086365, 0.04715178534388542, 0.1886959969997406, 0.22931016981601715, -0.0002551563084125519, 0.06095275282859802, 0.07958145439624786, -0.011342103593051434, 0.34095826745033264, -0.50108402967453, 0.18666993081569672, 0.3288848102092743, 0.0642152726650238, -0.08156150579452515, 0.028536414727568626, 0.07623912394046783, 0.05437498539686203, 0.2826480269432068, -0.19283270835876465, 0.07050705701112747, 0.287187397480011, 0.10918688029050827, 0.013425149023532867, -0.2835516333580017, 0.06714217364788055, -0.012406960129737854, -0.2082202136516571, 0.1049744039773941, 0.34167593717575073, -0.1271144151687622, 0.05016221106052399, -0.099623903632164, -0.09558311104774475, 0.18239757418632507, 0.1941734254360199, 0.019671300426125526, 0.017273779958486557, -0.14741522073745728, -0.1212918609380722, -0.08960860222578049, 0.06186063587665558, -0.2617270350456238, 0.4913389980792999, -0.07944746315479279, -0.006396830081939697, -0.4144424796104431, 0.16371116042137146, -0.03685750067234039, 0.5906624794006348, -0.20395292341709137, -0.29655900597572327, 0.11176782846450806, 0.10473155230283737, -0.1698339432477951, -0.014091478660702705, -0.17214667797088623, 0.08620717376470566, 0.010952870361506939, 0.23830600082874298, -0.08824868500232697, -0.204954594373703, 0.14798758924007416, 0.2458418309688568, 0.12703531980514526, 0.11114123463630676, -0.01601366139948368, 0.15759356319904327, -0.1344052404165268, 0.3311038315296173, 0.21750430762767792, 0.3344915211200714, -0.49840936064720154, 0.45078811049461365, 0.2666019797325134, -0.365677148103714, -0.16488270461559296, -0.31033605337142944, 0.008511669933795929, -0.3138420283794403, 0.22721971571445465, -0.20107917487621307, 0.15599504113197327, -0.14626236259937286, 0.1236467957496643, -0.09250685572624207, 0.06733816862106323, 0.21079021692276, -0.16572657227516174, -0.3549312949180603, -0.14975735545158386, -0.4826751947402954, -0.14522254467010498, -0.16294364631175995, -0.004362780600786209, 0.357159286737442, 0.1580052673816681, 0.01719251275062561, 0.08981385827064514, 0.02504226565361023, -0.23957319557666779, -0.0005872193723917007, 0.09291796386241913, -0.27413231134414673, -0.12545637786388397, -0.13961654901504517, 0.15830183029174805, 0.015715718269348145, -0.2846032977104187, -0.004335898905992508, 0.004617177881300449, 0.08218450099229813, -0.04127994924783707, -0.055588819086551666, -0.042020056396722794, -0.09798876941204071, 0.5436413288116455, -0.03982158750295639, 0.08685542643070221, -0.17212843894958496, 0.06104660779237747, -0.12829914689064026, -0.2129785567522049, -0.11852675676345825, 0.21736159920692444, 0.07761998474597931, 0.1629391759634018, 0.00969756580889225, -0.011176932603120804, -0.1368575543165207, 0.3391355872154236, 0.034381620585918427, -0.13317111134529114, -0.2932908236980438, 0.08296354860067368, 0.07937595993280411, 0.4176411032676697, -0.10226555168628693, 0.06965674459934235, -0.06915020942687988, 0.20948994159698486, -0.12284007668495178, -0.34888508915901184, 0.6161847114562988, -0.5011864900588989, -0.5192927718162537, 0.2083800733089447, 0.34805890917778015, 0.1349041759967804, -0.09637841582298279, -0.3988139033317566, 0.014272399246692657, 0.43348228931427, -0.2329551875591278, 0.003531128168106079, 0.4715978503227234, -0.0700298398733139, 0.1912340521812439, 0.14993079006671906, 0.31797435879707336, 0.09809906780719757, 0.06928569823503494, -0.03571620583534241, -0.29018205404281616 ]
https://github.com/huggingface/datasets/issues/2943
Backwards compatibility broken for cached datasets that use `.filter()`
Hi ! I guess the caching mechanism should have considered the new `filter` to be different from the old one, and don't use cached results from the old `filter`. To avoid other users from having this issue we could make the caching differentiate the two, what do you think ?
## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0
50
Backwards compatibility broken for cached datasets that use `.filter()` ## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0 Hi ! I guess the caching mechanism should have considered the new `filter` to be different from the old one, and don't use cached results from the old `filter`. To avoid other users from having this issue we could make the caching differentiate the two, what do you think ?
[ -0.3049955666065216, 0.1243882030248642, -0.04655851051211357, 0.23689685761928558, 0.1517292559146881, -0.0666595846414566, -0.00694115087389946, 0.32853949069976807, 0.1737385392189026, 0.029381684958934784, -0.23138606548309326, 0.35819289088249207, -0.1503302901983261, 0.2527369558811188, -0.29778674244880676, -0.1378115564584732, 0.044469159096479416, 0.032124631106853485, -0.06149552762508392, 0.16641275584697723, -0.12391747534275055, 0.4988582730293274, -0.19577644765377045, 0.0070792436599731445, 0.22216543555259705, 0.05132089555263519, 0.10912394523620605, 0.13856595754623413, 0.07986250519752502, -0.33926934003829956, 0.598117470741272, 0.10640698671340942, -0.03486895188689232, 0.49809613823890686, -0.00012130981485825032, 0.09986808896064758, 0.43980634212493896, -0.10739731043577194, -0.4579499065876007, -0.36868816614151, -0.19285404682159424, 0.13199374079704285, 0.21311333775520325, 0.08116332441568375, -0.071512371301651, 0.11434212327003479, -0.3034936785697937, -0.34604716300964355, 0.2488764226436615, 0.19893291592597961, 0.2267286777496338, 0.21361370384693146, 0.26574209332466125, 0.06658682227134705, 0.17017896473407745, 0.08265256136655807, 0.025971779599785805, -0.049086738377809525, 0.2940283417701721, 0.01426115445792675, 0.043685976415872574, 0.4806106686592102, -0.3283523619174957, -0.21464666724205017, 0.3046185076236725, -0.29825350642204285, 0.10307089984416962, -0.39570385217666626, 0.2999309301376343, 0.0781370997428894, 0.14626477658748627, -0.25551819801330566, -0.5773369669914246, -0.3483262360095978, -0.5121467113494873, -0.28682878613471985, 0.4164733290672302, -0.21635904908180237, -0.20099687576293945, 0.22008326649665833, -0.3342648148536682, -0.027003414928913116, 0.09349799156188965, 0.05350974202156067, -0.05848219245672226, 0.2941837012767792, -0.13183195888996124, -0.004862859845161438, 0.014982771128416061, -0.13290083408355713, 0.19240900874137878, -0.2750045657157898, -0.19687505066394806, 0.17257985472679138, -0.015559401363134384, -0.05461297556757927, 0.09542220830917358, 0.3323274850845337, 0.14057055115699768, 0.03562842309474945, 0.01921023055911064, 0.08454005420207977, -0.04096415266394615, 0.05367739498615265, 0.13732720911502838, 0.47537851333618164, 0.4901198744773865, 0.24679051339626312, 0.2727876305580139, 0.28548866510391235, -0.007884956896305084, -0.0013801045715808868, 0.5281851887702942, -0.16664160788059235, 0.07470716536045074, 0.15173086524009705, 0.196695476770401, -0.40486863255500793, -0.36021363735198975, 0.1689625233411789, -0.07699939608573914, -0.12504003942012787, 0.22072634100914001, 0.05349403992295265, 0.10056488960981369, 0.2142350971698761, 0.13208170235157013, 0.033856939524412155, -0.19647201895713806, 0.06123479828238487, -0.17250967025756836, -0.173945814371109, 0.001161321997642517, -0.11129888147115707, -0.04730532690882683, -0.8997769355773926, 0.17476999759674072, 0.048260271549224854, 0.006348900496959686, 0.10580955445766449, -0.06977374106645584, 0.2074347287416458, 0.17301657795906067, 0.5229285359382629, -0.22135894000530243, 0.08390010893344879, 0.1671905219554901, -0.5483275651931763, -0.13868655264377594, 0.012528203427791595, -0.2415379285812378, -0.11120634526014328, 0.20858770608901978, 0.1735861599445343, -0.3296716809272766, 0.012651350349187851, -0.1702989637851715, 0.45154333114624023, 0.259213924407959, -0.5466868877410889, -0.07795732468366623, -0.21338051557540894, -0.43823468685150146, -0.19971425831317902, 0.09719087183475494, 0.4131373167037964, -0.5942549109458923, -0.3216671049594879, 0.021686848253011703, 0.031907182186841965, 0.03991600498557091, -0.12293428182601929, -0.0634395107626915, -0.2444726824760437, -0.10776863992214203, -0.1384180784225464, 0.36065438389778137, -0.31955432891845703, -0.7338933944702148, 0.15372563898563385, 0.2360212355852127, 0.5342663526535034, -0.07095896452665329, -0.13748407363891602, 0.28139474987983704, -0.25782933831214905, 0.14599227905273438, 0.08484482020139694, -0.16490359604358673, -0.007994184270501137, -0.34096914529800415, -0.23469430208206177, 0.22387005388736725, -0.1502912938594818, 0.09041728079319, 0.334858775138855, 0.0790058821439743, -0.25422054529190063, 0.05029153823852539, 0.03504994884133339, 0.10492383688688278, 0.1990928053855896, 0.24532367289066315, 0.22376562654972076, 0.2863060534000397, -0.4365183115005493, -0.2801407277584076, 0.2506181001663208, 0.2141302525997162, -0.06000105291604996, -0.15240685641765594, -0.19822737574577332, -0.2678266167640686, -0.08841834962368011, -0.15897734463214874, -0.3044098913669586, 0.07887419313192368, 0.022576723247766495, 0.3843640089035034, -0.03850390017032623, -0.11452622711658478, 0.6218652725219727, 0.308453768491745, 0.09448041766881943, -0.5049411058425903, 0.22964169085025787, -0.0548514649271965, 0.0051686763763427734, -0.05918539687991142, 0.037782713770866394, 0.29395949840545654, -0.06852512806653976, -0.28957581520080566, 0.4078750014305115, 0.03925931081175804, 0.08416794240474701, -0.02763332426548004, 0.19374601542949677, 0.1773461103439331, 0.21058344841003418, 0.06393395364284515, 0.27418252825737, -0.014883683063089848, 0.20872125029563904, -0.19545668363571167, 0.5572488307952881, 0.029374944046139717, 0.32405054569244385, 0.12083487212657928, 0.14875595271587372, 0.3702491223812103, 0.13056343793869019, -0.21899515390396118, -0.13707873225212097, 0.32044902443885803, -0.45872339606285095, 0.06266702711582184, 0.012339675799012184, -0.12979331612586975, 0.37762629985809326, 0.07168209552764893, 0.07551214098930359, -0.03345271944999695, 0.31192120909690857, -0.1593659222126007, -0.042191144078969955, 0.18136239051818848, 0.40248578786849976, 0.4014511704444885, 0.20883212983608246, 0.050717227160930634, 0.075881727039814, -0.16153937578201294, -0.024877334013581276, 0.2082495391368866, 0.12934580445289612, -0.1696399450302124, 0.15357521176338196, 0.3034212589263916, 0.27320435643196106, -0.3061971962451935, 0.09339267015457153, -0.23562417924404144, 0.1195332258939743, -0.2705812454223633, 0.361636757850647, -0.28101035952568054, -0.22808676958084106, 0.07614203542470932, -0.167832151055336, -0.26151400804519653, -0.3875218331813812, 0.08989928662776947, 0.393439382314682, -0.08621899783611298, 0.2567746341228485, 0.014716386795043945, 0.24454139173030853, 0.1361677199602127, -0.19968213140964508, -0.4005720913410187, -0.2078813910484314, -0.3476482331752777, 0.005397818982601166, 0.20513233542442322, -0.15684886276721954, 0.2970355153083801, -0.07630934566259384, -0.20662498474121094, -0.3902941644191742, -0.9079101085662842, -0.04862922430038452, -0.12396498024463654, 0.6180297136306763, 0.3176228702068329, -0.09162577986717224, -0.13527193665504456, -0.2327558994293213, 0.1665794402360916, -0.04131476581096649, -0.43108269572257996, 0.1568385362625122, 0.06662258505821228, 0.1682220846414566, -0.20038524270057678, -0.22702813148498535, -0.11354107409715652, -0.14581933617591858, 0.007940150797367096, -0.12769019603729248, 0.0849655270576477, 0.3094041049480438, 0.11235357820987701, -0.31651583313941956, -0.08720120042562485, 0.13308581709861755, -0.3335398733615875, -0.07733731716871262, 0.07394207268953323, -0.05416223034262657, -0.23024354875087738, -0.034139491617679596, -0.03198090195655823, 0.08318918943405151, 0.37366342544555664, -0.4069591164588928, -0.37917718291282654, -0.27137330174446106, -0.00487411767244339, 0.23117733001708984, 0.0683608278632164, 0.2319663017988205, 0.18999481201171875, 0.039103299379348755, -0.2794680893421173, -0.4342860281467438, -0.08862080425024033, -0.2365957796573639, 0.10954897850751877, 0.14822490513324738, 0.6309941411018372, 0.03456403687596321, 0.47642678022384644, 0.2947268486022949, 0.04896096885204315, 0.13982582092285156, 0.18155524134635925, 0.4972688853740692, -0.3258461654186249, -0.40956518054008484, -0.04670906066894531, -0.046193867921829224, 0.050512611865997314, -0.15319155156612396, 0.17958185076713562, -0.11206098645925522, -0.34878870844841003, 0.00008940137922763824, -0.25156351923942566, -0.24981024861335754, -0.23862729966640472, -0.013644170016050339, 0.26900535821914673, 0.39062169194221497, 0.14077100157737732, -0.3225957751274109, -0.1763848066329956, -0.008137527853250504, 0.40074795484542847, 0.10357769578695297, 0.2502199709415436, -0.18154194951057434, -0.0471423901617527, -0.4509257674217224, 0.49255943298339844, 0.21514573693275452, 0.26489266753196716, -0.11775423586368561, -0.16296622157096863, -0.3294484615325928, -0.049241162836551666, 0.5928118824958801, -0.3631772994995117, 0.04434850066900253, 0.1019546389579773, -0.20818333327770233, -0.3828819990158081, 0.05112932249903679, 0.00766296312212944, 0.36491167545318604, 0.05435469001531601, 0.350807785987854, -0.08211509883403778, -0.07301574945449829, -0.08691591024398804, 0.2223753184080124, -0.12459434568881989, 0.019601501524448395, -0.274361252784729, -0.2049434781074524, -0.14330832660198212, 0.03141964599490166, -0.15288974344730377, 0.16506721079349518, -0.18000759184360504, -0.0685376450419426, -0.11314313113689423, -0.05639283359050751, 0.11538079380989075, 0.13470356166362762, 0.29450318217277527, -0.10000622272491455, 0.11873944103717804, 0.1441810429096222, 0.24052873253822327, 0.042370229959487915, 0.4583916664123535, -0.2755981385707855, -0.2780960500240326, -0.06707122176885605, 0.12080436944961548, -0.11463991552591324, 0.34373825788497925, -0.20401668548583984, -0.01734047383069992, -0.0444573238492012, -0.10204264521598816, -0.021239914000034332, -0.14110353589057922, -0.0019392669200897217, 0.37030282616615295, -0.2049255669116974, -0.2889374792575836, 0.2329639494419098, 0.2390514463186264, -0.2043490707874298, 0.43677592277526855, 0.34225577116012573, -0.2809351682662964, 0.16878943145275116, -0.19995945692062378, 0.7136854529380798, 0.15216901898384094, -0.029853757470846176, 0.0877995491027832, -0.169517382979393, 0.4524548649787903, 0.31254589557647705, 0.15597787499427795, -0.06676796823740005, -0.23704853653907776, -0.0655062198638916, -0.03474751114845276, 0.15802280604839325, -0.11106154322624207, -0.20363399386405945, 0.5631490349769592, -0.05921913683414459, -0.035386960953474045, 0.17558737099170685, -0.11732890456914902, -0.20230720937252045, 0.01908847875893116, -0.4372624158859253, 0.09912523627281189, -0.021323099732398987, 0.2521650493144989, 0.0010582786053419113, -0.07672233134508133, 0.055220652371644974, -0.3087654113769531, -0.2637816369533539, -0.05239184945821762, -0.39920729398727417, -0.06592784821987152, 0.208124041557312, -0.43328046798706055, 0.008973846212029457, 0.05262650176882744, 0.2566783130168915, -0.008180618286132812, -0.0373007208108902, -0.007537469267845154, 0.07026839256286621, 0.4977721571922302, 0.2345929890871048, 0.02503284439444542, 0.2863309979438782, 0.08909439295530319, 0.1867842674255371, 0.019598539918661118, -0.14201106131076813, -0.36083948612213135, -0.018653422594070435, 0.003810204565525055, 0.1180327832698822, -0.15886655449867249, 0.02882286161184311, -0.24285566806793213, 0.02130715921521187, -0.3648616373538971, 0.06509377807378769, -0.08983364701271057, -0.009838825091719627, 0.09432168304920197, -0.016562361270189285, -0.22681796550750732, -0.0053530000150203705, 0.6357885003089905, -0.1438155174255371, -0.43675312399864197, 0.12772014737129211, -0.005566123872995377, -0.22358466684818268, 0.03535874933004379, -0.204441636800766, 0.02741972729563713, -0.2750842571258545, 0.29787763953208923, -0.25112536549568176, -0.107127845287323, 0.2691297233104706, 0.32279181480407715, 0.1886078119277954, 0.21461209654808044, -0.15166741609573364, -0.39456847310066223, -0.13708220422267914, 0.28545793890953064, 0.04427440091967583, 0.054980725049972534, -0.03114905208349228, -0.3236713409423828, -0.14442157745361328, -0.20666439831256866, -0.22578884661197662, 0.008752362802624702, 0.33131512999534607, 0.07120877504348755, 0.1904871165752411, 0.2205633819103241, 0.15489670634269714, -0.19956499338150024, -0.013411452062427998, 0.07258681952953339, -0.20382048189640045, -0.10209295898675919, -0.09334562718868256, 0.09354175627231598, -0.09116014093160629, -0.26489871740341187, -0.1546197384595871, -0.005754454061388969, 0.061403557658195496, -0.16469311714172363, 0.41826796531677246, 0.3214157223701477, -0.11824986338615417, -0.05369057133793831, -0.03277824446558952, 0.04722516983747482, 0.3035393953323364, 0.13831248879432678, 0.018565475940704346, 0.032671503722667694, 0.042704951018095016, 0.19944879412651062, -0.18758191168308258, 0.014096468687057495, 0.08201581984758377, 0.04239632934331894, -0.2510477900505066, 0.027090217918157578, 0.3569350242614746, -0.2952967882156372, -0.021639620885252953, 0.5987744927406311, 0.3562680184841156, 0.2437596172094345, -0.13980664312839508, 0.11383070051670074, -0.07773953676223755, 0.15335720777511597, -0.27390462160110474, -0.3326781094074249, 0.2057783156633377, 0.27322593331336975, 0.06095762178301811, 0.18608224391937256, -0.0021068118512630463, 0.0291595458984375, 0.6171161532402039, 0.217648446559906, 0.44781675934791565, -0.12531597912311554, 0.350808709859848, 0.5271655917167664, 0.23262877762317657, 0.18437641859054565, 0.24171997606754303, 0.07372555136680603, 0.01609259843826294, 0.5080392956733704, -0.06600876897573471, 0.25868886709213257, 0.2197474241256714, 0.12876975536346436, -0.03551868349313736, -0.466274619102478, -0.16567479074001312, 0.02832207828760147, -0.07974855601787567, 0.25067588686943054, 0.16615810990333557, 0.08566006273031235, -0.22328464686870575, -0.334598571062088, 0.011488454416394234, 0.02489762008190155, -0.1936262845993042, -0.2161095291376114, 0.14464008808135986, -0.3639175593852997, -0.05714934691786766, 0.013486538082361221, -0.12084418535232544, 0.07039989531040192, 0.4529310166835785, -0.24694906175136566, -0.12836262583732605, -0.47319045662879944, -0.37937745451927185, 0.050045352429151535, 0.17476388812065125, -0.014010488986968994, 0.40476322174072266, 0.25878068804740906, -0.2298550009727478, 0.22198833525180817, 0.2503443658351898, 0.4856501519680023, 0.24682407081127167, 0.027692589908838272, 0.013346917927265167, -0.14204977452754974, -0.05400672182440758, -0.09072286635637283, 0.3356417715549469, -0.08708341419696808, 0.030568387359380722, 0.18793480098247528, 0.11341007053852081, 0.0007339436560869217, 0.20539040863513947, -0.04085387662053108, 0.39894017577171326, -0.46618154644966125, 0.08953413367271423, -0.23695218563079834, 0.2848791480064392, 0.01501500979065895, 0.10001401603221893, -0.24902549386024475, -0.11811555922031403, 0.17121534049510956, 0.23181122541427612, 0.20390257239341736, -0.10648512840270996, 0.07481089234352112, 0.13485461473464966, 0.0739085003733635, 0.4687882959842682, -0.09301268309354782, -0.08924596011638641, -0.14648893475532532, -0.6535091996192932, -0.055862121284008026, 0.14230065047740936, 0.12806756794452667, -0.0635148137807846, 0.03753015398979187, 0.04901515319943428, 0.18468625843524933, 0.043473586440086365, -0.1836019605398178, 0.10545863956212997, -0.2515144944190979, -0.20000146329402924, -0.17594653367996216, 0.23011986911296844, -0.24214833974838257, 0.05484843999147415, -0.265910267829895, 0.06277230381965637, -0.04169246181845665, 0.02695348858833313, -0.00592796690762043, -0.06288402527570724, 0.06751453876495361, 0.34733420610427856, -0.13707345724105835, 0.3493897318840027, 0.266316682100296, 0.03349345922470093, -0.003447543829679489, -0.27829837799072266, -0.19313544034957886, -0.26831403374671936, 0.07008500397205353, -0.29212409257888794, 0.49186065793037415, -0.40185967087745667, -0.30196383595466614, -0.18042171001434326, 0.27247393131256104, 0.12337823212146759, -0.1268286257982254, -0.47677889466285706, 0.16585813462734222, -0.05875716358423233, 0.08381257951259613, 0.004437834955751896, 0.5087332725524902, 0.0599871501326561, 0.33795082569122314, -0.2266310751438141, -0.34122195839881897, 0.5358168482780457, -0.4137625992298126, -0.2617655396461487, -0.1319272667169571, -0.06397373974323273, 0.6073157787322998, -0.48364487290382385, -0.304373174905777, -0.20376715064048767, 0.2719915211200714, -0.12000513821840286, -0.14902491867542267, 0.15557260811328888, -0.26529815793037415, 0.17455552518367767, -0.18920202553272247, -0.08706064522266388, 0.4393818974494934, -0.08826789259910583, 0.2773536145687103, -0.12994228303432465 ]
https://github.com/huggingface/datasets/issues/2943
Backwards compatibility broken for cached datasets that use `.filter()`
If it's easy enough to implement, then yes please 😄 But this issue can be low-priority, since I've only encountered it in a couple of `transformers` CI tests.
## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0
28
Backwards compatibility broken for cached datasets that use `.filter()` ## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0 If it's easy enough to implement, then yes please 😄 But this issue can be low-priority, since I've only encountered it in a couple of `transformers` CI tests.
[ -0.3049955666065216, 0.1243882030248642, -0.04655851051211357, 0.23689685761928558, 0.1517292559146881, -0.0666595846414566, -0.00694115087389946, 0.32853949069976807, 0.1737385392189026, 0.029381684958934784, -0.23138606548309326, 0.35819289088249207, -0.1503302901983261, 0.2527369558811188, -0.29778674244880676, -0.1378115564584732, 0.044469159096479416, 0.032124631106853485, -0.06149552762508392, 0.16641275584697723, -0.12391747534275055, 0.4988582730293274, -0.19577644765377045, 0.0070792436599731445, 0.22216543555259705, 0.05132089555263519, 0.10912394523620605, 0.13856595754623413, 0.07986250519752502, -0.33926934003829956, 0.598117470741272, 0.10640698671340942, -0.03486895188689232, 0.49809613823890686, -0.00012130981485825032, 0.09986808896064758, 0.43980634212493896, -0.10739731043577194, -0.4579499065876007, -0.36868816614151, -0.19285404682159424, 0.13199374079704285, 0.21311333775520325, 0.08116332441568375, -0.071512371301651, 0.11434212327003479, -0.3034936785697937, -0.34604716300964355, 0.2488764226436615, 0.19893291592597961, 0.2267286777496338, 0.21361370384693146, 0.26574209332466125, 0.06658682227134705, 0.17017896473407745, 0.08265256136655807, 0.025971779599785805, -0.049086738377809525, 0.2940283417701721, 0.01426115445792675, 0.043685976415872574, 0.4806106686592102, -0.3283523619174957, -0.21464666724205017, 0.3046185076236725, -0.29825350642204285, 0.10307089984416962, -0.39570385217666626, 0.2999309301376343, 0.0781370997428894, 0.14626477658748627, -0.25551819801330566, -0.5773369669914246, -0.3483262360095978, -0.5121467113494873, -0.28682878613471985, 0.4164733290672302, -0.21635904908180237, -0.20099687576293945, 0.22008326649665833, -0.3342648148536682, -0.027003414928913116, 0.09349799156188965, 0.05350974202156067, -0.05848219245672226, 0.2941837012767792, -0.13183195888996124, -0.004862859845161438, 0.014982771128416061, -0.13290083408355713, 0.19240900874137878, -0.2750045657157898, -0.19687505066394806, 0.17257985472679138, -0.015559401363134384, -0.05461297556757927, 0.09542220830917358, 0.3323274850845337, 0.14057055115699768, 0.03562842309474945, 0.01921023055911064, 0.08454005420207977, -0.04096415266394615, 0.05367739498615265, 0.13732720911502838, 0.47537851333618164, 0.4901198744773865, 0.24679051339626312, 0.2727876305580139, 0.28548866510391235, -0.007884956896305084, -0.0013801045715808868, 0.5281851887702942, -0.16664160788059235, 0.07470716536045074, 0.15173086524009705, 0.196695476770401, -0.40486863255500793, -0.36021363735198975, 0.1689625233411789, -0.07699939608573914, -0.12504003942012787, 0.22072634100914001, 0.05349403992295265, 0.10056488960981369, 0.2142350971698761, 0.13208170235157013, 0.033856939524412155, -0.19647201895713806, 0.06123479828238487, -0.17250967025756836, -0.173945814371109, 0.001161321997642517, -0.11129888147115707, -0.04730532690882683, -0.8997769355773926, 0.17476999759674072, 0.048260271549224854, 0.006348900496959686, 0.10580955445766449, -0.06977374106645584, 0.2074347287416458, 0.17301657795906067, 0.5229285359382629, -0.22135894000530243, 0.08390010893344879, 0.1671905219554901, -0.5483275651931763, -0.13868655264377594, 0.012528203427791595, -0.2415379285812378, -0.11120634526014328, 0.20858770608901978, 0.1735861599445343, -0.3296716809272766, 0.012651350349187851, -0.1702989637851715, 0.45154333114624023, 0.259213924407959, -0.5466868877410889, -0.07795732468366623, -0.21338051557540894, -0.43823468685150146, -0.19971425831317902, 0.09719087183475494, 0.4131373167037964, -0.5942549109458923, -0.3216671049594879, 0.021686848253011703, 0.031907182186841965, 0.03991600498557091, -0.12293428182601929, -0.0634395107626915, -0.2444726824760437, -0.10776863992214203, -0.1384180784225464, 0.36065438389778137, -0.31955432891845703, -0.7338933944702148, 0.15372563898563385, 0.2360212355852127, 0.5342663526535034, -0.07095896452665329, -0.13748407363891602, 0.28139474987983704, -0.25782933831214905, 0.14599227905273438, 0.08484482020139694, -0.16490359604358673, -0.007994184270501137, -0.34096914529800415, -0.23469430208206177, 0.22387005388736725, -0.1502912938594818, 0.09041728079319, 0.334858775138855, 0.0790058821439743, -0.25422054529190063, 0.05029153823852539, 0.03504994884133339, 0.10492383688688278, 0.1990928053855896, 0.24532367289066315, 0.22376562654972076, 0.2863060534000397, -0.4365183115005493, -0.2801407277584076, 0.2506181001663208, 0.2141302525997162, -0.06000105291604996, -0.15240685641765594, -0.19822737574577332, -0.2678266167640686, -0.08841834962368011, -0.15897734463214874, -0.3044098913669586, 0.07887419313192368, 0.022576723247766495, 0.3843640089035034, -0.03850390017032623, -0.11452622711658478, 0.6218652725219727, 0.308453768491745, 0.09448041766881943, -0.5049411058425903, 0.22964169085025787, -0.0548514649271965, 0.0051686763763427734, -0.05918539687991142, 0.037782713770866394, 0.29395949840545654, -0.06852512806653976, -0.28957581520080566, 0.4078750014305115, 0.03925931081175804, 0.08416794240474701, -0.02763332426548004, 0.19374601542949677, 0.1773461103439331, 0.21058344841003418, 0.06393395364284515, 0.27418252825737, -0.014883683063089848, 0.20872125029563904, -0.19545668363571167, 0.5572488307952881, 0.029374944046139717, 0.32405054569244385, 0.12083487212657928, 0.14875595271587372, 0.3702491223812103, 0.13056343793869019, -0.21899515390396118, -0.13707873225212097, 0.32044902443885803, -0.45872339606285095, 0.06266702711582184, 0.012339675799012184, -0.12979331612586975, 0.37762629985809326, 0.07168209552764893, 0.07551214098930359, -0.03345271944999695, 0.31192120909690857, -0.1593659222126007, -0.042191144078969955, 0.18136239051818848, 0.40248578786849976, 0.4014511704444885, 0.20883212983608246, 0.050717227160930634, 0.075881727039814, -0.16153937578201294, -0.024877334013581276, 0.2082495391368866, 0.12934580445289612, -0.1696399450302124, 0.15357521176338196, 0.3034212589263916, 0.27320435643196106, -0.3061971962451935, 0.09339267015457153, -0.23562417924404144, 0.1195332258939743, -0.2705812454223633, 0.361636757850647, -0.28101035952568054, -0.22808676958084106, 0.07614203542470932, -0.167832151055336, -0.26151400804519653, -0.3875218331813812, 0.08989928662776947, 0.393439382314682, -0.08621899783611298, 0.2567746341228485, 0.014716386795043945, 0.24454139173030853, 0.1361677199602127, -0.19968213140964508, -0.4005720913410187, -0.2078813910484314, -0.3476482331752777, 0.005397818982601166, 0.20513233542442322, -0.15684886276721954, 0.2970355153083801, -0.07630934566259384, -0.20662498474121094, -0.3902941644191742, -0.9079101085662842, -0.04862922430038452, -0.12396498024463654, 0.6180297136306763, 0.3176228702068329, -0.09162577986717224, -0.13527193665504456, -0.2327558994293213, 0.1665794402360916, -0.04131476581096649, -0.43108269572257996, 0.1568385362625122, 0.06662258505821228, 0.1682220846414566, -0.20038524270057678, -0.22702813148498535, -0.11354107409715652, -0.14581933617591858, 0.007940150797367096, -0.12769019603729248, 0.0849655270576477, 0.3094041049480438, 0.11235357820987701, -0.31651583313941956, -0.08720120042562485, 0.13308581709861755, -0.3335398733615875, -0.07733731716871262, 0.07394207268953323, -0.05416223034262657, -0.23024354875087738, -0.034139491617679596, -0.03198090195655823, 0.08318918943405151, 0.37366342544555664, -0.4069591164588928, -0.37917718291282654, -0.27137330174446106, -0.00487411767244339, 0.23117733001708984, 0.0683608278632164, 0.2319663017988205, 0.18999481201171875, 0.039103299379348755, -0.2794680893421173, -0.4342860281467438, -0.08862080425024033, -0.2365957796573639, 0.10954897850751877, 0.14822490513324738, 0.6309941411018372, 0.03456403687596321, 0.47642678022384644, 0.2947268486022949, 0.04896096885204315, 0.13982582092285156, 0.18155524134635925, 0.4972688853740692, -0.3258461654186249, -0.40956518054008484, -0.04670906066894531, -0.046193867921829224, 0.050512611865997314, -0.15319155156612396, 0.17958185076713562, -0.11206098645925522, -0.34878870844841003, 0.00008940137922763824, -0.25156351923942566, -0.24981024861335754, -0.23862729966640472, -0.013644170016050339, 0.26900535821914673, 0.39062169194221497, 0.14077100157737732, -0.3225957751274109, -0.1763848066329956, -0.008137527853250504, 0.40074795484542847, 0.10357769578695297, 0.2502199709415436, -0.18154194951057434, -0.0471423901617527, -0.4509257674217224, 0.49255943298339844, 0.21514573693275452, 0.26489266753196716, -0.11775423586368561, -0.16296622157096863, -0.3294484615325928, -0.049241162836551666, 0.5928118824958801, -0.3631772994995117, 0.04434850066900253, 0.1019546389579773, -0.20818333327770233, -0.3828819990158081, 0.05112932249903679, 0.00766296312212944, 0.36491167545318604, 0.05435469001531601, 0.350807785987854, -0.08211509883403778, -0.07301574945449829, -0.08691591024398804, 0.2223753184080124, -0.12459434568881989, 0.019601501524448395, -0.274361252784729, -0.2049434781074524, -0.14330832660198212, 0.03141964599490166, -0.15288974344730377, 0.16506721079349518, -0.18000759184360504, -0.0685376450419426, -0.11314313113689423, -0.05639283359050751, 0.11538079380989075, 0.13470356166362762, 0.29450318217277527, -0.10000622272491455, 0.11873944103717804, 0.1441810429096222, 0.24052873253822327, 0.042370229959487915, 0.4583916664123535, -0.2755981385707855, -0.2780960500240326, -0.06707122176885605, 0.12080436944961548, -0.11463991552591324, 0.34373825788497925, -0.20401668548583984, -0.01734047383069992, -0.0444573238492012, -0.10204264521598816, -0.021239914000034332, -0.14110353589057922, -0.0019392669200897217, 0.37030282616615295, -0.2049255669116974, -0.2889374792575836, 0.2329639494419098, 0.2390514463186264, -0.2043490707874298, 0.43677592277526855, 0.34225577116012573, -0.2809351682662964, 0.16878943145275116, -0.19995945692062378, 0.7136854529380798, 0.15216901898384094, -0.029853757470846176, 0.0877995491027832, -0.169517382979393, 0.4524548649787903, 0.31254589557647705, 0.15597787499427795, -0.06676796823740005, -0.23704853653907776, -0.0655062198638916, -0.03474751114845276, 0.15802280604839325, -0.11106154322624207, -0.20363399386405945, 0.5631490349769592, -0.05921913683414459, -0.035386960953474045, 0.17558737099170685, -0.11732890456914902, -0.20230720937252045, 0.01908847875893116, -0.4372624158859253, 0.09912523627281189, -0.021323099732398987, 0.2521650493144989, 0.0010582786053419113, -0.07672233134508133, 0.055220652371644974, -0.3087654113769531, -0.2637816369533539, -0.05239184945821762, -0.39920729398727417, -0.06592784821987152, 0.208124041557312, -0.43328046798706055, 0.008973846212029457, 0.05262650176882744, 0.2566783130168915, -0.008180618286132812, -0.0373007208108902, -0.007537469267845154, 0.07026839256286621, 0.4977721571922302, 0.2345929890871048, 0.02503284439444542, 0.2863309979438782, 0.08909439295530319, 0.1867842674255371, 0.019598539918661118, -0.14201106131076813, -0.36083948612213135, -0.018653422594070435, 0.003810204565525055, 0.1180327832698822, -0.15886655449867249, 0.02882286161184311, -0.24285566806793213, 0.02130715921521187, -0.3648616373538971, 0.06509377807378769, -0.08983364701271057, -0.009838825091719627, 0.09432168304920197, -0.016562361270189285, -0.22681796550750732, -0.0053530000150203705, 0.6357885003089905, -0.1438155174255371, -0.43675312399864197, 0.12772014737129211, -0.005566123872995377, -0.22358466684818268, 0.03535874933004379, -0.204441636800766, 0.02741972729563713, -0.2750842571258545, 0.29787763953208923, -0.25112536549568176, -0.107127845287323, 0.2691297233104706, 0.32279181480407715, 0.1886078119277954, 0.21461209654808044, -0.15166741609573364, -0.39456847310066223, -0.13708220422267914, 0.28545793890953064, 0.04427440091967583, 0.054980725049972534, -0.03114905208349228, -0.3236713409423828, -0.14442157745361328, -0.20666439831256866, -0.22578884661197662, 0.008752362802624702, 0.33131512999534607, 0.07120877504348755, 0.1904871165752411, 0.2205633819103241, 0.15489670634269714, -0.19956499338150024, -0.013411452062427998, 0.07258681952953339, -0.20382048189640045, -0.10209295898675919, -0.09334562718868256, 0.09354175627231598, -0.09116014093160629, -0.26489871740341187, -0.1546197384595871, -0.005754454061388969, 0.061403557658195496, -0.16469311714172363, 0.41826796531677246, 0.3214157223701477, -0.11824986338615417, -0.05369057133793831, -0.03277824446558952, 0.04722516983747482, 0.3035393953323364, 0.13831248879432678, 0.018565475940704346, 0.032671503722667694, 0.042704951018095016, 0.19944879412651062, -0.18758191168308258, 0.014096468687057495, 0.08201581984758377, 0.04239632934331894, -0.2510477900505066, 0.027090217918157578, 0.3569350242614746, -0.2952967882156372, -0.021639620885252953, 0.5987744927406311, 0.3562680184841156, 0.2437596172094345, -0.13980664312839508, 0.11383070051670074, -0.07773953676223755, 0.15335720777511597, -0.27390462160110474, -0.3326781094074249, 0.2057783156633377, 0.27322593331336975, 0.06095762178301811, 0.18608224391937256, -0.0021068118512630463, 0.0291595458984375, 0.6171161532402039, 0.217648446559906, 0.44781675934791565, -0.12531597912311554, 0.350808709859848, 0.5271655917167664, 0.23262877762317657, 0.18437641859054565, 0.24171997606754303, 0.07372555136680603, 0.01609259843826294, 0.5080392956733704, -0.06600876897573471, 0.25868886709213257, 0.2197474241256714, 0.12876975536346436, -0.03551868349313736, -0.466274619102478, -0.16567479074001312, 0.02832207828760147, -0.07974855601787567, 0.25067588686943054, 0.16615810990333557, 0.08566006273031235, -0.22328464686870575, -0.334598571062088, 0.011488454416394234, 0.02489762008190155, -0.1936262845993042, -0.2161095291376114, 0.14464008808135986, -0.3639175593852997, -0.05714934691786766, 0.013486538082361221, -0.12084418535232544, 0.07039989531040192, 0.4529310166835785, -0.24694906175136566, -0.12836262583732605, -0.47319045662879944, -0.37937745451927185, 0.050045352429151535, 0.17476388812065125, -0.014010488986968994, 0.40476322174072266, 0.25878068804740906, -0.2298550009727478, 0.22198833525180817, 0.2503443658351898, 0.4856501519680023, 0.24682407081127167, 0.027692589908838272, 0.013346917927265167, -0.14204977452754974, -0.05400672182440758, -0.09072286635637283, 0.3356417715549469, -0.08708341419696808, 0.030568387359380722, 0.18793480098247528, 0.11341007053852081, 0.0007339436560869217, 0.20539040863513947, -0.04085387662053108, 0.39894017577171326, -0.46618154644966125, 0.08953413367271423, -0.23695218563079834, 0.2848791480064392, 0.01501500979065895, 0.10001401603221893, -0.24902549386024475, -0.11811555922031403, 0.17121534049510956, 0.23181122541427612, 0.20390257239341736, -0.10648512840270996, 0.07481089234352112, 0.13485461473464966, 0.0739085003733635, 0.4687882959842682, -0.09301268309354782, -0.08924596011638641, -0.14648893475532532, -0.6535091996192932, -0.055862121284008026, 0.14230065047740936, 0.12806756794452667, -0.0635148137807846, 0.03753015398979187, 0.04901515319943428, 0.18468625843524933, 0.043473586440086365, -0.1836019605398178, 0.10545863956212997, -0.2515144944190979, -0.20000146329402924, -0.17594653367996216, 0.23011986911296844, -0.24214833974838257, 0.05484843999147415, -0.265910267829895, 0.06277230381965637, -0.04169246181845665, 0.02695348858833313, -0.00592796690762043, -0.06288402527570724, 0.06751453876495361, 0.34733420610427856, -0.13707345724105835, 0.3493897318840027, 0.266316682100296, 0.03349345922470093, -0.003447543829679489, -0.27829837799072266, -0.19313544034957886, -0.26831403374671936, 0.07008500397205353, -0.29212409257888794, 0.49186065793037415, -0.40185967087745667, -0.30196383595466614, -0.18042171001434326, 0.27247393131256104, 0.12337823212146759, -0.1268286257982254, -0.47677889466285706, 0.16585813462734222, -0.05875716358423233, 0.08381257951259613, 0.004437834955751896, 0.5087332725524902, 0.0599871501326561, 0.33795082569122314, -0.2266310751438141, -0.34122195839881897, 0.5358168482780457, -0.4137625992298126, -0.2617655396461487, -0.1319272667169571, -0.06397373974323273, 0.6073157787322998, -0.48364487290382385, -0.304373174905777, -0.20376715064048767, 0.2719915211200714, -0.12000513821840286, -0.14902491867542267, 0.15557260811328888, -0.26529815793037415, 0.17455552518367767, -0.18920202553272247, -0.08706064522266388, 0.4393818974494934, -0.08826789259910583, 0.2773536145687103, -0.12994228303432465 ]
https://github.com/huggingface/datasets/issues/2943
Backwards compatibility broken for cached datasets that use `.filter()`
Well it can cause issue with anyone that updates `datasets` and re-run some code that uses filter, so I'm creating a PR
## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0
22
Backwards compatibility broken for cached datasets that use `.filter()` ## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0 Well it can cause issue with anyone that updates `datasets` and re-run some code that uses filter, so I'm creating a PR
[ -0.3049955666065216, 0.1243882030248642, -0.04655851051211357, 0.23689685761928558, 0.1517292559146881, -0.0666595846414566, -0.00694115087389946, 0.32853949069976807, 0.1737385392189026, 0.029381684958934784, -0.23138606548309326, 0.35819289088249207, -0.1503302901983261, 0.2527369558811188, -0.29778674244880676, -0.1378115564584732, 0.044469159096479416, 0.032124631106853485, -0.06149552762508392, 0.16641275584697723, -0.12391747534275055, 0.4988582730293274, -0.19577644765377045, 0.0070792436599731445, 0.22216543555259705, 0.05132089555263519, 0.10912394523620605, 0.13856595754623413, 0.07986250519752502, -0.33926934003829956, 0.598117470741272, 0.10640698671340942, -0.03486895188689232, 0.49809613823890686, -0.00012130981485825032, 0.09986808896064758, 0.43980634212493896, -0.10739731043577194, -0.4579499065876007, -0.36868816614151, -0.19285404682159424, 0.13199374079704285, 0.21311333775520325, 0.08116332441568375, -0.071512371301651, 0.11434212327003479, -0.3034936785697937, -0.34604716300964355, 0.2488764226436615, 0.19893291592597961, 0.2267286777496338, 0.21361370384693146, 0.26574209332466125, 0.06658682227134705, 0.17017896473407745, 0.08265256136655807, 0.025971779599785805, -0.049086738377809525, 0.2940283417701721, 0.01426115445792675, 0.043685976415872574, 0.4806106686592102, -0.3283523619174957, -0.21464666724205017, 0.3046185076236725, -0.29825350642204285, 0.10307089984416962, -0.39570385217666626, 0.2999309301376343, 0.0781370997428894, 0.14626477658748627, -0.25551819801330566, -0.5773369669914246, -0.3483262360095978, -0.5121467113494873, -0.28682878613471985, 0.4164733290672302, -0.21635904908180237, -0.20099687576293945, 0.22008326649665833, -0.3342648148536682, -0.027003414928913116, 0.09349799156188965, 0.05350974202156067, -0.05848219245672226, 0.2941837012767792, -0.13183195888996124, -0.004862859845161438, 0.014982771128416061, -0.13290083408355713, 0.19240900874137878, -0.2750045657157898, -0.19687505066394806, 0.17257985472679138, -0.015559401363134384, -0.05461297556757927, 0.09542220830917358, 0.3323274850845337, 0.14057055115699768, 0.03562842309474945, 0.01921023055911064, 0.08454005420207977, -0.04096415266394615, 0.05367739498615265, 0.13732720911502838, 0.47537851333618164, 0.4901198744773865, 0.24679051339626312, 0.2727876305580139, 0.28548866510391235, -0.007884956896305084, -0.0013801045715808868, 0.5281851887702942, -0.16664160788059235, 0.07470716536045074, 0.15173086524009705, 0.196695476770401, -0.40486863255500793, -0.36021363735198975, 0.1689625233411789, -0.07699939608573914, -0.12504003942012787, 0.22072634100914001, 0.05349403992295265, 0.10056488960981369, 0.2142350971698761, 0.13208170235157013, 0.033856939524412155, -0.19647201895713806, 0.06123479828238487, -0.17250967025756836, -0.173945814371109, 0.001161321997642517, -0.11129888147115707, -0.04730532690882683, -0.8997769355773926, 0.17476999759674072, 0.048260271549224854, 0.006348900496959686, 0.10580955445766449, -0.06977374106645584, 0.2074347287416458, 0.17301657795906067, 0.5229285359382629, -0.22135894000530243, 0.08390010893344879, 0.1671905219554901, -0.5483275651931763, -0.13868655264377594, 0.012528203427791595, -0.2415379285812378, -0.11120634526014328, 0.20858770608901978, 0.1735861599445343, -0.3296716809272766, 0.012651350349187851, -0.1702989637851715, 0.45154333114624023, 0.259213924407959, -0.5466868877410889, -0.07795732468366623, -0.21338051557540894, -0.43823468685150146, -0.19971425831317902, 0.09719087183475494, 0.4131373167037964, -0.5942549109458923, -0.3216671049594879, 0.021686848253011703, 0.031907182186841965, 0.03991600498557091, -0.12293428182601929, -0.0634395107626915, -0.2444726824760437, -0.10776863992214203, -0.1384180784225464, 0.36065438389778137, -0.31955432891845703, -0.7338933944702148, 0.15372563898563385, 0.2360212355852127, 0.5342663526535034, -0.07095896452665329, -0.13748407363891602, 0.28139474987983704, -0.25782933831214905, 0.14599227905273438, 0.08484482020139694, -0.16490359604358673, -0.007994184270501137, -0.34096914529800415, -0.23469430208206177, 0.22387005388736725, -0.1502912938594818, 0.09041728079319, 0.334858775138855, 0.0790058821439743, -0.25422054529190063, 0.05029153823852539, 0.03504994884133339, 0.10492383688688278, 0.1990928053855896, 0.24532367289066315, 0.22376562654972076, 0.2863060534000397, -0.4365183115005493, -0.2801407277584076, 0.2506181001663208, 0.2141302525997162, -0.06000105291604996, -0.15240685641765594, -0.19822737574577332, -0.2678266167640686, -0.08841834962368011, -0.15897734463214874, -0.3044098913669586, 0.07887419313192368, 0.022576723247766495, 0.3843640089035034, -0.03850390017032623, -0.11452622711658478, 0.6218652725219727, 0.308453768491745, 0.09448041766881943, -0.5049411058425903, 0.22964169085025787, -0.0548514649271965, 0.0051686763763427734, -0.05918539687991142, 0.037782713770866394, 0.29395949840545654, -0.06852512806653976, -0.28957581520080566, 0.4078750014305115, 0.03925931081175804, 0.08416794240474701, -0.02763332426548004, 0.19374601542949677, 0.1773461103439331, 0.21058344841003418, 0.06393395364284515, 0.27418252825737, -0.014883683063089848, 0.20872125029563904, -0.19545668363571167, 0.5572488307952881, 0.029374944046139717, 0.32405054569244385, 0.12083487212657928, 0.14875595271587372, 0.3702491223812103, 0.13056343793869019, -0.21899515390396118, -0.13707873225212097, 0.32044902443885803, -0.45872339606285095, 0.06266702711582184, 0.012339675799012184, -0.12979331612586975, 0.37762629985809326, 0.07168209552764893, 0.07551214098930359, -0.03345271944999695, 0.31192120909690857, -0.1593659222126007, -0.042191144078969955, 0.18136239051818848, 0.40248578786849976, 0.4014511704444885, 0.20883212983608246, 0.050717227160930634, 0.075881727039814, -0.16153937578201294, -0.024877334013581276, 0.2082495391368866, 0.12934580445289612, -0.1696399450302124, 0.15357521176338196, 0.3034212589263916, 0.27320435643196106, -0.3061971962451935, 0.09339267015457153, -0.23562417924404144, 0.1195332258939743, -0.2705812454223633, 0.361636757850647, -0.28101035952568054, -0.22808676958084106, 0.07614203542470932, -0.167832151055336, -0.26151400804519653, -0.3875218331813812, 0.08989928662776947, 0.393439382314682, -0.08621899783611298, 0.2567746341228485, 0.014716386795043945, 0.24454139173030853, 0.1361677199602127, -0.19968213140964508, -0.4005720913410187, -0.2078813910484314, -0.3476482331752777, 0.005397818982601166, 0.20513233542442322, -0.15684886276721954, 0.2970355153083801, -0.07630934566259384, -0.20662498474121094, -0.3902941644191742, -0.9079101085662842, -0.04862922430038452, -0.12396498024463654, 0.6180297136306763, 0.3176228702068329, -0.09162577986717224, -0.13527193665504456, -0.2327558994293213, 0.1665794402360916, -0.04131476581096649, -0.43108269572257996, 0.1568385362625122, 0.06662258505821228, 0.1682220846414566, -0.20038524270057678, -0.22702813148498535, -0.11354107409715652, -0.14581933617591858, 0.007940150797367096, -0.12769019603729248, 0.0849655270576477, 0.3094041049480438, 0.11235357820987701, -0.31651583313941956, -0.08720120042562485, 0.13308581709861755, -0.3335398733615875, -0.07733731716871262, 0.07394207268953323, -0.05416223034262657, -0.23024354875087738, -0.034139491617679596, -0.03198090195655823, 0.08318918943405151, 0.37366342544555664, -0.4069591164588928, -0.37917718291282654, -0.27137330174446106, -0.00487411767244339, 0.23117733001708984, 0.0683608278632164, 0.2319663017988205, 0.18999481201171875, 0.039103299379348755, -0.2794680893421173, -0.4342860281467438, -0.08862080425024033, -0.2365957796573639, 0.10954897850751877, 0.14822490513324738, 0.6309941411018372, 0.03456403687596321, 0.47642678022384644, 0.2947268486022949, 0.04896096885204315, 0.13982582092285156, 0.18155524134635925, 0.4972688853740692, -0.3258461654186249, -0.40956518054008484, -0.04670906066894531, -0.046193867921829224, 0.050512611865997314, -0.15319155156612396, 0.17958185076713562, -0.11206098645925522, -0.34878870844841003, 0.00008940137922763824, -0.25156351923942566, -0.24981024861335754, -0.23862729966640472, -0.013644170016050339, 0.26900535821914673, 0.39062169194221497, 0.14077100157737732, -0.3225957751274109, -0.1763848066329956, -0.008137527853250504, 0.40074795484542847, 0.10357769578695297, 0.2502199709415436, -0.18154194951057434, -0.0471423901617527, -0.4509257674217224, 0.49255943298339844, 0.21514573693275452, 0.26489266753196716, -0.11775423586368561, -0.16296622157096863, -0.3294484615325928, -0.049241162836551666, 0.5928118824958801, -0.3631772994995117, 0.04434850066900253, 0.1019546389579773, -0.20818333327770233, -0.3828819990158081, 0.05112932249903679, 0.00766296312212944, 0.36491167545318604, 0.05435469001531601, 0.350807785987854, -0.08211509883403778, -0.07301574945449829, -0.08691591024398804, 0.2223753184080124, -0.12459434568881989, 0.019601501524448395, -0.274361252784729, -0.2049434781074524, -0.14330832660198212, 0.03141964599490166, -0.15288974344730377, 0.16506721079349518, -0.18000759184360504, -0.0685376450419426, -0.11314313113689423, -0.05639283359050751, 0.11538079380989075, 0.13470356166362762, 0.29450318217277527, -0.10000622272491455, 0.11873944103717804, 0.1441810429096222, 0.24052873253822327, 0.042370229959487915, 0.4583916664123535, -0.2755981385707855, -0.2780960500240326, -0.06707122176885605, 0.12080436944961548, -0.11463991552591324, 0.34373825788497925, -0.20401668548583984, -0.01734047383069992, -0.0444573238492012, -0.10204264521598816, -0.021239914000034332, -0.14110353589057922, -0.0019392669200897217, 0.37030282616615295, -0.2049255669116974, -0.2889374792575836, 0.2329639494419098, 0.2390514463186264, -0.2043490707874298, 0.43677592277526855, 0.34225577116012573, -0.2809351682662964, 0.16878943145275116, -0.19995945692062378, 0.7136854529380798, 0.15216901898384094, -0.029853757470846176, 0.0877995491027832, -0.169517382979393, 0.4524548649787903, 0.31254589557647705, 0.15597787499427795, -0.06676796823740005, -0.23704853653907776, -0.0655062198638916, -0.03474751114845276, 0.15802280604839325, -0.11106154322624207, -0.20363399386405945, 0.5631490349769592, -0.05921913683414459, -0.035386960953474045, 0.17558737099170685, -0.11732890456914902, -0.20230720937252045, 0.01908847875893116, -0.4372624158859253, 0.09912523627281189, -0.021323099732398987, 0.2521650493144989, 0.0010582786053419113, -0.07672233134508133, 0.055220652371644974, -0.3087654113769531, -0.2637816369533539, -0.05239184945821762, -0.39920729398727417, -0.06592784821987152, 0.208124041557312, -0.43328046798706055, 0.008973846212029457, 0.05262650176882744, 0.2566783130168915, -0.008180618286132812, -0.0373007208108902, -0.007537469267845154, 0.07026839256286621, 0.4977721571922302, 0.2345929890871048, 0.02503284439444542, 0.2863309979438782, 0.08909439295530319, 0.1867842674255371, 0.019598539918661118, -0.14201106131076813, -0.36083948612213135, -0.018653422594070435, 0.003810204565525055, 0.1180327832698822, -0.15886655449867249, 0.02882286161184311, -0.24285566806793213, 0.02130715921521187, -0.3648616373538971, 0.06509377807378769, -0.08983364701271057, -0.009838825091719627, 0.09432168304920197, -0.016562361270189285, -0.22681796550750732, -0.0053530000150203705, 0.6357885003089905, -0.1438155174255371, -0.43675312399864197, 0.12772014737129211, -0.005566123872995377, -0.22358466684818268, 0.03535874933004379, -0.204441636800766, 0.02741972729563713, -0.2750842571258545, 0.29787763953208923, -0.25112536549568176, -0.107127845287323, 0.2691297233104706, 0.32279181480407715, 0.1886078119277954, 0.21461209654808044, -0.15166741609573364, -0.39456847310066223, -0.13708220422267914, 0.28545793890953064, 0.04427440091967583, 0.054980725049972534, -0.03114905208349228, -0.3236713409423828, -0.14442157745361328, -0.20666439831256866, -0.22578884661197662, 0.008752362802624702, 0.33131512999534607, 0.07120877504348755, 0.1904871165752411, 0.2205633819103241, 0.15489670634269714, -0.19956499338150024, -0.013411452062427998, 0.07258681952953339, -0.20382048189640045, -0.10209295898675919, -0.09334562718868256, 0.09354175627231598, -0.09116014093160629, -0.26489871740341187, -0.1546197384595871, -0.005754454061388969, 0.061403557658195496, -0.16469311714172363, 0.41826796531677246, 0.3214157223701477, -0.11824986338615417, -0.05369057133793831, -0.03277824446558952, 0.04722516983747482, 0.3035393953323364, 0.13831248879432678, 0.018565475940704346, 0.032671503722667694, 0.042704951018095016, 0.19944879412651062, -0.18758191168308258, 0.014096468687057495, 0.08201581984758377, 0.04239632934331894, -0.2510477900505066, 0.027090217918157578, 0.3569350242614746, -0.2952967882156372, -0.021639620885252953, 0.5987744927406311, 0.3562680184841156, 0.2437596172094345, -0.13980664312839508, 0.11383070051670074, -0.07773953676223755, 0.15335720777511597, -0.27390462160110474, -0.3326781094074249, 0.2057783156633377, 0.27322593331336975, 0.06095762178301811, 0.18608224391937256, -0.0021068118512630463, 0.0291595458984375, 0.6171161532402039, 0.217648446559906, 0.44781675934791565, -0.12531597912311554, 0.350808709859848, 0.5271655917167664, 0.23262877762317657, 0.18437641859054565, 0.24171997606754303, 0.07372555136680603, 0.01609259843826294, 0.5080392956733704, -0.06600876897573471, 0.25868886709213257, 0.2197474241256714, 0.12876975536346436, -0.03551868349313736, -0.466274619102478, -0.16567479074001312, 0.02832207828760147, -0.07974855601787567, 0.25067588686943054, 0.16615810990333557, 0.08566006273031235, -0.22328464686870575, -0.334598571062088, 0.011488454416394234, 0.02489762008190155, -0.1936262845993042, -0.2161095291376114, 0.14464008808135986, -0.3639175593852997, -0.05714934691786766, 0.013486538082361221, -0.12084418535232544, 0.07039989531040192, 0.4529310166835785, -0.24694906175136566, -0.12836262583732605, -0.47319045662879944, -0.37937745451927185, 0.050045352429151535, 0.17476388812065125, -0.014010488986968994, 0.40476322174072266, 0.25878068804740906, -0.2298550009727478, 0.22198833525180817, 0.2503443658351898, 0.4856501519680023, 0.24682407081127167, 0.027692589908838272, 0.013346917927265167, -0.14204977452754974, -0.05400672182440758, -0.09072286635637283, 0.3356417715549469, -0.08708341419696808, 0.030568387359380722, 0.18793480098247528, 0.11341007053852081, 0.0007339436560869217, 0.20539040863513947, -0.04085387662053108, 0.39894017577171326, -0.46618154644966125, 0.08953413367271423, -0.23695218563079834, 0.2848791480064392, 0.01501500979065895, 0.10001401603221893, -0.24902549386024475, -0.11811555922031403, 0.17121534049510956, 0.23181122541427612, 0.20390257239341736, -0.10648512840270996, 0.07481089234352112, 0.13485461473464966, 0.0739085003733635, 0.4687882959842682, -0.09301268309354782, -0.08924596011638641, -0.14648893475532532, -0.6535091996192932, -0.055862121284008026, 0.14230065047740936, 0.12806756794452667, -0.0635148137807846, 0.03753015398979187, 0.04901515319943428, 0.18468625843524933, 0.043473586440086365, -0.1836019605398178, 0.10545863956212997, -0.2515144944190979, -0.20000146329402924, -0.17594653367996216, 0.23011986911296844, -0.24214833974838257, 0.05484843999147415, -0.265910267829895, 0.06277230381965637, -0.04169246181845665, 0.02695348858833313, -0.00592796690762043, -0.06288402527570724, 0.06751453876495361, 0.34733420610427856, -0.13707345724105835, 0.3493897318840027, 0.266316682100296, 0.03349345922470093, -0.003447543829679489, -0.27829837799072266, -0.19313544034957886, -0.26831403374671936, 0.07008500397205353, -0.29212409257888794, 0.49186065793037415, -0.40185967087745667, -0.30196383595466614, -0.18042171001434326, 0.27247393131256104, 0.12337823212146759, -0.1268286257982254, -0.47677889466285706, 0.16585813462734222, -0.05875716358423233, 0.08381257951259613, 0.004437834955751896, 0.5087332725524902, 0.0599871501326561, 0.33795082569122314, -0.2266310751438141, -0.34122195839881897, 0.5358168482780457, -0.4137625992298126, -0.2617655396461487, -0.1319272667169571, -0.06397373974323273, 0.6073157787322998, -0.48364487290382385, -0.304373174905777, -0.20376715064048767, 0.2719915211200714, -0.12000513821840286, -0.14902491867542267, 0.15557260811328888, -0.26529815793037415, 0.17455552518367767, -0.18920202553272247, -0.08706064522266388, 0.4393818974494934, -0.08826789259910583, 0.2773536145687103, -0.12994228303432465 ]
https://github.com/huggingface/datasets/issues/2943
Backwards compatibility broken for cached datasets that use `.filter()`
I just merged a fix, let me know if you're still having this kind of issues :) We'll do a release soon to make this fix available
## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0
27
Backwards compatibility broken for cached datasets that use `.filter()` ## Describe the bug After upgrading to datasets `1.12.0`, some cached `.filter()` steps from `1.11.0` started failing with `ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)}` Related feature: https://github.com/huggingface/datasets/pull/2836 :question: This is probably a `wontfix` bug, since it can be solved by simply cleaning the related cache dirs, but the workaround could be useful for someone googling the error :) ## Workaround Remove the cache for the given dataset, e.g. `rm -rf ~/.cache/huggingface/datasets/librispeech_asr`. ## Steps to reproduce the bug 1. Delete `~/.cache/huggingface/datasets/librispeech_asr` if it exists. 2. `pip install datasets==1.11.0` and run the following snippet: ```python from datasets import load_dataset ids = ["1272-141231-0000"] ds = load_dataset("patrickvonplaten/librispeech_asr_dummy", "clean", split="validation") ds = ds.filter(lambda x: x["id"] in ids) ``` 3. `pip install datasets==1.12.1` and re-run the code again ## Expected results Same result as with the previous `datasets` version. ## Actual results ```bash Reusing dataset librispeech_asr (./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1) Loading cached processed dataset at ./.cache/huggingface/datasets/librispeech_asr/clean/2.1.0/468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1/cache-cd1c29844fdbc87a.arrow Traceback (most recent call last): File "./repos/transformers/src/transformers/models/wav2vec2/try_dataset.py", line 5, in <module> ds = ds.filter(lambda x: x["id"] in ids) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 2169, in filter indices = self.map( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1686, in map return self._map_single( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 185, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/fingerprint.py", line 398, in wrapper out = func(self, *args, **kwargs) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1896, in _map_single return Dataset.from_file(cache_file_name, info=info, split=self.split) File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 343, in from_file return cls( File "./envs/transformers/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 282, in __init__ self.info.features = self.info.features.reorder_fields_as(inferred_features) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1151, in reorder_fields_as return Features(recursive_reorder(self, other)) File "./envs/transformers/lib/python3.8/site-packages/datasets/features.py", line 1140, in recursive_reorder raise ValueError(f"Keys mismatch: between {source} and {target}" + stack_position) ValueError: Keys mismatch: between {'indices': Value(dtype='uint64', id=None)} and {'file': Value(dtype='string', id=None), 'text': Value(dtype='string', id=None), 'speaker_id': Value(dtype='int64', id=None), 'chapter_id': Value(dtype='int64', id=None), 'id': Value(dtype='string', id=None)} Process finished with exit code 1 ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-34-generic-x86_64-with-glibc2.17 - Python version: 3.8.10 - PyArrow version: 5.0.0 I just merged a fix, let me know if you're still having this kind of issues :) We'll do a release soon to make this fix available
[ -0.3049955666065216, 0.1243882030248642, -0.04655851051211357, 0.23689685761928558, 0.1517292559146881, -0.0666595846414566, -0.00694115087389946, 0.32853949069976807, 0.1737385392189026, 0.029381684958934784, -0.23138606548309326, 0.35819289088249207, -0.1503302901983261, 0.2527369558811188, -0.29778674244880676, -0.1378115564584732, 0.044469159096479416, 0.032124631106853485, -0.06149552762508392, 0.16641275584697723, -0.12391747534275055, 0.4988582730293274, -0.19577644765377045, 0.0070792436599731445, 0.22216543555259705, 0.05132089555263519, 0.10912394523620605, 0.13856595754623413, 0.07986250519752502, -0.33926934003829956, 0.598117470741272, 0.10640698671340942, -0.03486895188689232, 0.49809613823890686, -0.00012130981485825032, 0.09986808896064758, 0.43980634212493896, -0.10739731043577194, -0.4579499065876007, -0.36868816614151, -0.19285404682159424, 0.13199374079704285, 0.21311333775520325, 0.08116332441568375, -0.071512371301651, 0.11434212327003479, -0.3034936785697937, -0.34604716300964355, 0.2488764226436615, 0.19893291592597961, 0.2267286777496338, 0.21361370384693146, 0.26574209332466125, 0.06658682227134705, 0.17017896473407745, 0.08265256136655807, 0.025971779599785805, -0.049086738377809525, 0.2940283417701721, 0.01426115445792675, 0.043685976415872574, 0.4806106686592102, -0.3283523619174957, -0.21464666724205017, 0.3046185076236725, -0.29825350642204285, 0.10307089984416962, -0.39570385217666626, 0.2999309301376343, 0.0781370997428894, 0.14626477658748627, -0.25551819801330566, -0.5773369669914246, -0.3483262360095978, -0.5121467113494873, -0.28682878613471985, 0.4164733290672302, -0.21635904908180237, -0.20099687576293945, 0.22008326649665833, -0.3342648148536682, -0.027003414928913116, 0.09349799156188965, 0.05350974202156067, -0.05848219245672226, 0.2941837012767792, -0.13183195888996124, -0.004862859845161438, 0.014982771128416061, -0.13290083408355713, 0.19240900874137878, -0.2750045657157898, -0.19687505066394806, 0.17257985472679138, -0.015559401363134384, -0.05461297556757927, 0.09542220830917358, 0.3323274850845337, 0.14057055115699768, 0.03562842309474945, 0.01921023055911064, 0.08454005420207977, -0.04096415266394615, 0.05367739498615265, 0.13732720911502838, 0.47537851333618164, 0.4901198744773865, 0.24679051339626312, 0.2727876305580139, 0.28548866510391235, -0.007884956896305084, -0.0013801045715808868, 0.5281851887702942, -0.16664160788059235, 0.07470716536045074, 0.15173086524009705, 0.196695476770401, -0.40486863255500793, -0.36021363735198975, 0.1689625233411789, -0.07699939608573914, -0.12504003942012787, 0.22072634100914001, 0.05349403992295265, 0.10056488960981369, 0.2142350971698761, 0.13208170235157013, 0.033856939524412155, -0.19647201895713806, 0.06123479828238487, -0.17250967025756836, -0.173945814371109, 0.001161321997642517, -0.11129888147115707, -0.04730532690882683, -0.8997769355773926, 0.17476999759674072, 0.048260271549224854, 0.006348900496959686, 0.10580955445766449, -0.06977374106645584, 0.2074347287416458, 0.17301657795906067, 0.5229285359382629, -0.22135894000530243, 0.08390010893344879, 0.1671905219554901, -0.5483275651931763, -0.13868655264377594, 0.012528203427791595, -0.2415379285812378, -0.11120634526014328, 0.20858770608901978, 0.1735861599445343, -0.3296716809272766, 0.012651350349187851, -0.1702989637851715, 0.45154333114624023, 0.259213924407959, -0.5466868877410889, -0.07795732468366623, -0.21338051557540894, -0.43823468685150146, -0.19971425831317902, 0.09719087183475494, 0.4131373167037964, -0.5942549109458923, -0.3216671049594879, 0.021686848253011703, 0.031907182186841965, 0.03991600498557091, -0.12293428182601929, -0.0634395107626915, -0.2444726824760437, -0.10776863992214203, -0.1384180784225464, 0.36065438389778137, -0.31955432891845703, -0.7338933944702148, 0.15372563898563385, 0.2360212355852127, 0.5342663526535034, -0.07095896452665329, -0.13748407363891602, 0.28139474987983704, -0.25782933831214905, 0.14599227905273438, 0.08484482020139694, -0.16490359604358673, -0.007994184270501137, -0.34096914529800415, -0.23469430208206177, 0.22387005388736725, -0.1502912938594818, 0.09041728079319, 0.334858775138855, 0.0790058821439743, -0.25422054529190063, 0.05029153823852539, 0.03504994884133339, 0.10492383688688278, 0.1990928053855896, 0.24532367289066315, 0.22376562654972076, 0.2863060534000397, -0.4365183115005493, -0.2801407277584076, 0.2506181001663208, 0.2141302525997162, -0.06000105291604996, -0.15240685641765594, -0.19822737574577332, -0.2678266167640686, -0.08841834962368011, -0.15897734463214874, -0.3044098913669586, 0.07887419313192368, 0.022576723247766495, 0.3843640089035034, -0.03850390017032623, -0.11452622711658478, 0.6218652725219727, 0.308453768491745, 0.09448041766881943, -0.5049411058425903, 0.22964169085025787, -0.0548514649271965, 0.0051686763763427734, -0.05918539687991142, 0.037782713770866394, 0.29395949840545654, -0.06852512806653976, -0.28957581520080566, 0.4078750014305115, 0.03925931081175804, 0.08416794240474701, -0.02763332426548004, 0.19374601542949677, 0.1773461103439331, 0.21058344841003418, 0.06393395364284515, 0.27418252825737, -0.014883683063089848, 0.20872125029563904, -0.19545668363571167, 0.5572488307952881, 0.029374944046139717, 0.32405054569244385, 0.12083487212657928, 0.14875595271587372, 0.3702491223812103, 0.13056343793869019, -0.21899515390396118, -0.13707873225212097, 0.32044902443885803, -0.45872339606285095, 0.06266702711582184, 0.012339675799012184, -0.12979331612586975, 0.37762629985809326, 0.07168209552764893, 0.07551214098930359, -0.03345271944999695, 0.31192120909690857, -0.1593659222126007, -0.042191144078969955, 0.18136239051818848, 0.40248578786849976, 0.4014511704444885, 0.20883212983608246, 0.050717227160930634, 0.075881727039814, -0.16153937578201294, -0.024877334013581276, 0.2082495391368866, 0.12934580445289612, -0.1696399450302124, 0.15357521176338196, 0.3034212589263916, 0.27320435643196106, -0.3061971962451935, 0.09339267015457153, -0.23562417924404144, 0.1195332258939743, -0.2705812454223633, 0.361636757850647, -0.28101035952568054, -0.22808676958084106, 0.07614203542470932, -0.167832151055336, -0.26151400804519653, -0.3875218331813812, 0.08989928662776947, 0.393439382314682, -0.08621899783611298, 0.2567746341228485, 0.014716386795043945, 0.24454139173030853, 0.1361677199602127, -0.19968213140964508, -0.4005720913410187, -0.2078813910484314, -0.3476482331752777, 0.005397818982601166, 0.20513233542442322, -0.15684886276721954, 0.2970355153083801, -0.07630934566259384, -0.20662498474121094, -0.3902941644191742, -0.9079101085662842, -0.04862922430038452, -0.12396498024463654, 0.6180297136306763, 0.3176228702068329, -0.09162577986717224, -0.13527193665504456, -0.2327558994293213, 0.1665794402360916, -0.04131476581096649, -0.43108269572257996, 0.1568385362625122, 0.06662258505821228, 0.1682220846414566, -0.20038524270057678, -0.22702813148498535, -0.11354107409715652, -0.14581933617591858, 0.007940150797367096, -0.12769019603729248, 0.0849655270576477, 0.3094041049480438, 0.11235357820987701, -0.31651583313941956, -0.08720120042562485, 0.13308581709861755, -0.3335398733615875, -0.07733731716871262, 0.07394207268953323, -0.05416223034262657, -0.23024354875087738, -0.034139491617679596, -0.03198090195655823, 0.08318918943405151, 0.37366342544555664, -0.4069591164588928, -0.37917718291282654, -0.27137330174446106, -0.00487411767244339, 0.23117733001708984, 0.0683608278632164, 0.2319663017988205, 0.18999481201171875, 0.039103299379348755, -0.2794680893421173, -0.4342860281467438, -0.08862080425024033, -0.2365957796573639, 0.10954897850751877, 0.14822490513324738, 0.6309941411018372, 0.03456403687596321, 0.47642678022384644, 0.2947268486022949, 0.04896096885204315, 0.13982582092285156, 0.18155524134635925, 0.4972688853740692, -0.3258461654186249, -0.40956518054008484, -0.04670906066894531, -0.046193867921829224, 0.050512611865997314, -0.15319155156612396, 0.17958185076713562, -0.11206098645925522, -0.34878870844841003, 0.00008940137922763824, -0.25156351923942566, -0.24981024861335754, -0.23862729966640472, -0.013644170016050339, 0.26900535821914673, 0.39062169194221497, 0.14077100157737732, -0.3225957751274109, -0.1763848066329956, -0.008137527853250504, 0.40074795484542847, 0.10357769578695297, 0.2502199709415436, -0.18154194951057434, -0.0471423901617527, -0.4509257674217224, 0.49255943298339844, 0.21514573693275452, 0.26489266753196716, -0.11775423586368561, -0.16296622157096863, -0.3294484615325928, -0.049241162836551666, 0.5928118824958801, -0.3631772994995117, 0.04434850066900253, 0.1019546389579773, -0.20818333327770233, -0.3828819990158081, 0.05112932249903679, 0.00766296312212944, 0.36491167545318604, 0.05435469001531601, 0.350807785987854, -0.08211509883403778, -0.07301574945449829, -0.08691591024398804, 0.2223753184080124, -0.12459434568881989, 0.019601501524448395, -0.274361252784729, -0.2049434781074524, -0.14330832660198212, 0.03141964599490166, -0.15288974344730377, 0.16506721079349518, -0.18000759184360504, -0.0685376450419426, -0.11314313113689423, -0.05639283359050751, 0.11538079380989075, 0.13470356166362762, 0.29450318217277527, -0.10000622272491455, 0.11873944103717804, 0.1441810429096222, 0.24052873253822327, 0.042370229959487915, 0.4583916664123535, -0.2755981385707855, -0.2780960500240326, -0.06707122176885605, 0.12080436944961548, -0.11463991552591324, 0.34373825788497925, -0.20401668548583984, -0.01734047383069992, -0.0444573238492012, -0.10204264521598816, -0.021239914000034332, -0.14110353589057922, -0.0019392669200897217, 0.37030282616615295, -0.2049255669116974, -0.2889374792575836, 0.2329639494419098, 0.2390514463186264, -0.2043490707874298, 0.43677592277526855, 0.34225577116012573, -0.2809351682662964, 0.16878943145275116, -0.19995945692062378, 0.7136854529380798, 0.15216901898384094, -0.029853757470846176, 0.0877995491027832, -0.169517382979393, 0.4524548649787903, 0.31254589557647705, 0.15597787499427795, -0.06676796823740005, -0.23704853653907776, -0.0655062198638916, -0.03474751114845276, 0.15802280604839325, -0.11106154322624207, -0.20363399386405945, 0.5631490349769592, -0.05921913683414459, -0.035386960953474045, 0.17558737099170685, -0.11732890456914902, -0.20230720937252045, 0.01908847875893116, -0.4372624158859253, 0.09912523627281189, -0.021323099732398987, 0.2521650493144989, 0.0010582786053419113, -0.07672233134508133, 0.055220652371644974, -0.3087654113769531, -0.2637816369533539, -0.05239184945821762, -0.39920729398727417, -0.06592784821987152, 0.208124041557312, -0.43328046798706055, 0.008973846212029457, 0.05262650176882744, 0.2566783130168915, -0.008180618286132812, -0.0373007208108902, -0.007537469267845154, 0.07026839256286621, 0.4977721571922302, 0.2345929890871048, 0.02503284439444542, 0.2863309979438782, 0.08909439295530319, 0.1867842674255371, 0.019598539918661118, -0.14201106131076813, -0.36083948612213135, -0.018653422594070435, 0.003810204565525055, 0.1180327832698822, -0.15886655449867249, 0.02882286161184311, -0.24285566806793213, 0.02130715921521187, -0.3648616373538971, 0.06509377807378769, -0.08983364701271057, -0.009838825091719627, 0.09432168304920197, -0.016562361270189285, -0.22681796550750732, -0.0053530000150203705, 0.6357885003089905, -0.1438155174255371, -0.43675312399864197, 0.12772014737129211, -0.005566123872995377, -0.22358466684818268, 0.03535874933004379, -0.204441636800766, 0.02741972729563713, -0.2750842571258545, 0.29787763953208923, -0.25112536549568176, -0.107127845287323, 0.2691297233104706, 0.32279181480407715, 0.1886078119277954, 0.21461209654808044, -0.15166741609573364, -0.39456847310066223, -0.13708220422267914, 0.28545793890953064, 0.04427440091967583, 0.054980725049972534, -0.03114905208349228, -0.3236713409423828, -0.14442157745361328, -0.20666439831256866, -0.22578884661197662, 0.008752362802624702, 0.33131512999534607, 0.07120877504348755, 0.1904871165752411, 0.2205633819103241, 0.15489670634269714, -0.19956499338150024, -0.013411452062427998, 0.07258681952953339, -0.20382048189640045, -0.10209295898675919, -0.09334562718868256, 0.09354175627231598, -0.09116014093160629, -0.26489871740341187, -0.1546197384595871, -0.005754454061388969, 0.061403557658195496, -0.16469311714172363, 0.41826796531677246, 0.3214157223701477, -0.11824986338615417, -0.05369057133793831, -0.03277824446558952, 0.04722516983747482, 0.3035393953323364, 0.13831248879432678, 0.018565475940704346, 0.032671503722667694, 0.042704951018095016, 0.19944879412651062, -0.18758191168308258, 0.014096468687057495, 0.08201581984758377, 0.04239632934331894, -0.2510477900505066, 0.027090217918157578, 0.3569350242614746, -0.2952967882156372, -0.021639620885252953, 0.5987744927406311, 0.3562680184841156, 0.2437596172094345, -0.13980664312839508, 0.11383070051670074, -0.07773953676223755, 0.15335720777511597, -0.27390462160110474, -0.3326781094074249, 0.2057783156633377, 0.27322593331336975, 0.06095762178301811, 0.18608224391937256, -0.0021068118512630463, 0.0291595458984375, 0.6171161532402039, 0.217648446559906, 0.44781675934791565, -0.12531597912311554, 0.350808709859848, 0.5271655917167664, 0.23262877762317657, 0.18437641859054565, 0.24171997606754303, 0.07372555136680603, 0.01609259843826294, 0.5080392956733704, -0.06600876897573471, 0.25868886709213257, 0.2197474241256714, 0.12876975536346436, -0.03551868349313736, -0.466274619102478, -0.16567479074001312, 0.02832207828760147, -0.07974855601787567, 0.25067588686943054, 0.16615810990333557, 0.08566006273031235, -0.22328464686870575, -0.334598571062088, 0.011488454416394234, 0.02489762008190155, -0.1936262845993042, -0.2161095291376114, 0.14464008808135986, -0.3639175593852997, -0.05714934691786766, 0.013486538082361221, -0.12084418535232544, 0.07039989531040192, 0.4529310166835785, -0.24694906175136566, -0.12836262583732605, -0.47319045662879944, -0.37937745451927185, 0.050045352429151535, 0.17476388812065125, -0.014010488986968994, 0.40476322174072266, 0.25878068804740906, -0.2298550009727478, 0.22198833525180817, 0.2503443658351898, 0.4856501519680023, 0.24682407081127167, 0.027692589908838272, 0.013346917927265167, -0.14204977452754974, -0.05400672182440758, -0.09072286635637283, 0.3356417715549469, -0.08708341419696808, 0.030568387359380722, 0.18793480098247528, 0.11341007053852081, 0.0007339436560869217, 0.20539040863513947, -0.04085387662053108, 0.39894017577171326, -0.46618154644966125, 0.08953413367271423, -0.23695218563079834, 0.2848791480064392, 0.01501500979065895, 0.10001401603221893, -0.24902549386024475, -0.11811555922031403, 0.17121534049510956, 0.23181122541427612, 0.20390257239341736, -0.10648512840270996, 0.07481089234352112, 0.13485461473464966, 0.0739085003733635, 0.4687882959842682, -0.09301268309354782, -0.08924596011638641, -0.14648893475532532, -0.6535091996192932, -0.055862121284008026, 0.14230065047740936, 0.12806756794452667, -0.0635148137807846, 0.03753015398979187, 0.04901515319943428, 0.18468625843524933, 0.043473586440086365, -0.1836019605398178, 0.10545863956212997, -0.2515144944190979, -0.20000146329402924, -0.17594653367996216, 0.23011986911296844, -0.24214833974838257, 0.05484843999147415, -0.265910267829895, 0.06277230381965637, -0.04169246181845665, 0.02695348858833313, -0.00592796690762043, -0.06288402527570724, 0.06751453876495361, 0.34733420610427856, -0.13707345724105835, 0.3493897318840027, 0.266316682100296, 0.03349345922470093, -0.003447543829679489, -0.27829837799072266, -0.19313544034957886, -0.26831403374671936, 0.07008500397205353, -0.29212409257888794, 0.49186065793037415, -0.40185967087745667, -0.30196383595466614, -0.18042171001434326, 0.27247393131256104, 0.12337823212146759, -0.1268286257982254, -0.47677889466285706, 0.16585813462734222, -0.05875716358423233, 0.08381257951259613, 0.004437834955751896, 0.5087332725524902, 0.0599871501326561, 0.33795082569122314, -0.2266310751438141, -0.34122195839881897, 0.5358168482780457, -0.4137625992298126, -0.2617655396461487, -0.1319272667169571, -0.06397373974323273, 0.6073157787322998, -0.48364487290382385, -0.304373174905777, -0.20376715064048767, 0.2719915211200714, -0.12000513821840286, -0.14902491867542267, 0.15557260811328888, -0.26529815793037415, 0.17455552518367767, -0.18920202553272247, -0.08706064522266388, 0.4393818974494934, -0.08826789259910583, 0.2773536145687103, -0.12994228303432465 ]
https://github.com/huggingface/datasets/issues/2937
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
Hi @daqieq, thanks for reporting. Unfortunately, I was not able to reproduce this bug: ```ipython In [1]: from datasets import load_dataset ...: ds = load_dataset('wiki_bio') Downloading: 7.58kB [00:00, 26.3kB/s] Downloading: 2.71kB [00:00, ?B/s] Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\ 1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Downloading: 334MB [01:17, 4.32MB/s] Dataset wiki_bio downloaded and prepared to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9. Subsequent calls will reuse thi s data. ``` This kind of error messages usually happen because: - Your running Python script hasn't write access to that directory - You have another program (the File Explorer?) already browsing inside that directory
## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0
109
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied ## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0 Hi @daqieq, thanks for reporting. Unfortunately, I was not able to reproduce this bug: ```ipython In [1]: from datasets import load_dataset ...: ds = load_dataset('wiki_bio') Downloading: 7.58kB [00:00, 26.3kB/s] Downloading: 2.71kB [00:00, ?B/s] Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\ 1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Downloading: 334MB [01:17, 4.32MB/s] Dataset wiki_bio downloaded and prepared to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9. Subsequent calls will reuse thi s data. ``` This kind of error messages usually happen because: - Your running Python script hasn't write access to that directory - You have another program (the File Explorer?) already browsing inside that directory
[ -0.22893042862415314, 0.3834537863731384, 0.040345486253499985, 0.25503987073898315, -0.012111440300941467, 0.2622569799423218, 0.5036681294441223, 0.13295289874076843, 0.3442821502685547, 0.13571703433990479, -0.10897432267665863, 0.07728347182273865, 0.07315025478601456, -0.005698841065168381, -0.12562274932861328, 0.07892870903015137, 0.036444827914237976, -0.005388572812080383, 0.21495001018047333, 0.1039552390575409, -0.4238837957382202, 0.10729515552520752, -0.17285525798797607, 0.18611568212509155, 0.026095353066921234, -0.1363418847322464, 0.12126043438911438, 0.36072999238967896, -0.03078889660537243, -0.3922068774700165, 0.35302361845970154, 0.06345345079898834, 0.46391868591308594, 0.25824612379074097, -0.00011924602586077526, -0.013706982135772705, 0.23068350553512573, 0.12449978291988373, -0.07372744381427765, 0.0871000736951828, -0.18398547172546387, -0.1409674435853958, 0.16523012518882751, -0.09768609702587128, 0.1767442226409912, 0.3634921908378601, -0.10213734209537506, -0.20092955231666565, -0.01304171234369278, 0.3790340721607208, 0.15730012953281403, -0.03818552941083908, -0.11867921054363251, -0.07520386576652527, 0.49333617091178894, -0.1592983454465866, -0.13317985832691193, 0.2798383831977844, 0.07902549207210541, -0.1145709827542305, -0.09899193793535233, 0.19957299530506134, -0.16214939951896667, 0.1471576690673828, 0.018658198416233063, 0.031129412353038788, 0.21623170375823975, -0.4581091105937958, 0.35214126110076904, 0.15125800669193268, 0.9656510353088379, -0.19557353854179382, -0.19140426814556122, -0.08874918520450592, 0.013303476385772228, -0.0330025851726532, 0.4326038360595703, 0.42862293124198914, -0.3245686888694763, 0.2523709237575531, 0.06596922129392624, 0.08356527239084244, -0.08255112916231155, -0.0019085630774497986, 0.07128562033176422, 0.1486518234014511, -0.050470396876335144, 0.11955664306879044, -0.11473101377487183, -0.08340054005384445, 0.38633546233177185, -0.21382707357406616, -0.25460198521614075, 0.19166678190231323, -0.3394373059272766, 0.2898705005645752, 0.053453415632247925, 0.7778061628341675, 0.15787780284881592, 0.3155304193496704, 0.12502440810203552, -0.05405194312334061, 0.21362410485744476, 0.06519006937742233, 0.008593093603849411, 0.32148951292037964, -0.11223850399255753, -0.016923444345593452, 0.4271059036254883, 0.11744208633899689, -0.08161628246307373, -0.008990056812763214, -0.020045679062604904, -0.42947474122047424, 0.3538788855075836, 0.10540692508220673, 0.4081186056137085, -0.2856418788433075, -0.12170104682445526, -0.00029484089463949203, 0.15813148021697998, -0.023971129208803177, 0.058883123099803925, 0.5011532306671143, -0.27177080512046814, 0.04268378019332886, 0.06825167685747147, 0.17944511771202087, 0.018610628321766853, 0.09776042401790619, -0.08779972046613693, -0.08900287747383118, -0.26671841740608215, -0.05143827944993973, 0.4086472988128662, -0.3225748538970947, 0.0955643430352211, 0.25667712092399597, 0.02704816311597824, -0.17929475009441376, 0.19183194637298584, -0.04149730131030083, -0.032857172191143036, 0.35768646001815796, 0.39729535579681396, 0.33763429522514343, 0.17493285238742828, -0.21229684352874756, -0.034995343536138535, 0.18631118535995483, -0.4872901439666748, -0.4025035500526428, -0.03366319090127945, 0.12132740765810013, -0.08332448452711105, 0.06320483237504959, -0.1980368196964264, -0.04825741425156593, 0.3823125958442688, -0.30085498094558716, -0.061836011707782745, -0.013725977391004562, -0.22062011063098907, -0.5042766332626343, 0.04070699214935303, 0.40128886699676514, -0.3596992790699005, 0.13036717474460602, -0.09155377745628357, -0.26408690214157104, 0.15043187141418457, 0.005637414753437042, 0.0056341164745390415, 0.36168164014816284, -0.2812199592590332, 0.015607461333274841, 0.277458131313324, -0.3938944339752197, -1.0015970468521118, -0.021002821624279022, 0.0730997771024704, 0.1660424917936325, 0.24440622329711914, 0.11913693696260452, 0.3659380376338959, -0.03034600242972374, 0.1704770028591156, 0.3187129497528076, 0.13007500767707825, 0.1119738295674324, -0.06299638003110886, -0.20385542511940002, 0.2796615958213806, 0.13392695784568787, 0.08833920955657959, 0.3009032905101776, 0.3125999867916107, -0.056934162974357605, 0.2510957717895508, -0.1872614324092865, 0.11680471897125244, 0.19251592457294464, 0.01149553433060646, -0.03513624519109726, 0.13751451671123505, -0.12773767113685608, -0.42040905356407166, 0.3514483869075775, -0.008116722106933594, 0.08516694605350494, 0.075979083776474, -0.20274290442466736, -0.31846433877944946, 0.09134054183959961, -0.5447554588317871, -0.28899702429771423, 0.08510629087686539, 0.2938991189002991, 0.2124246507883072, 0.023681923747062683, 0.1891639530658722, 0.3374146521091461, -0.2082270085811615, 0.12719596922397614, -0.18114034831523895, 0.03860597312450409, -0.18833743035793304, -0.13644948601722717, -0.21224816143512726, 0.04691556841135025, 0.20012804865837097, 0.25274837017059326, -0.21343287825584412, 0.19610163569450378, 0.1512133628129959, 0.03749862313270569, -0.3785575032234192, -0.05955632030963898, -0.022377638146281242, 0.12172973155975342, 0.15684841573238373, 0.1381784975528717, 0.14832304418087006, -0.04439461603760719, -0.1922191083431244, 0.13775421679019928, -0.15963515639305115, 0.14373160898685455, -0.32665109634399414, 0.24303650856018066, 0.24470606446266174, 0.0900503396987915, 0.08569684624671936, 0.03445308655500412, 0.30547091364860535, 0.024117661640048027, 0.07459592819213867, -0.2858043313026428, 0.10126152634620667, -0.07780804485082626, 0.059302087873220444, 0.0225471593439579, 0.08128213882446289, 0.24975380301475525, -0.17460131645202637, 0.01688607782125473, 0.2869936525821686, 0.3496788442134857, 0.5377134084701538, -0.040986742824316025, 0.05154988542199135, 0.06679697334766388, 0.04791206121444702, 0.08966945111751556, 0.11925159394741058, 0.08577128499746323, -0.07022725045681, 0.2634487748146057, 0.1284337341785431, 0.22416622936725616, -0.06479744613170624, -0.11386145651340485, -0.10754147917032242, 0.4194302558898926, -0.48751428723335266, -0.08438777178525925, 0.10005532205104828, 0.07483997941017151, 0.18120169639587402, -0.24284721910953522, -0.08878229558467865, -0.1460990011692047, -0.24304603040218353, 0.31163647770881653, 0.09407058358192444, 0.0835372805595398, -0.5119581818580627, 0.16444166004657745, 0.007537709549069405, -0.20180644094944, -0.11375728249549866, 0.1238795593380928, -0.16583386063575745, -0.014107516035437584, 0.18624527752399445, -0.1799401193857193, 0.18738730251789093, -0.2951585054397583, 0.24375171959400177, -0.3901757001876831, -0.19543251395225525, 0.015110209584236145, 0.05788587033748627, 0.4098413586616516, 0.12543120980262756, 0.1551070660352707, 0.18641051650047302, -0.3417649269104004, 0.056602563709020615, -0.10751935094594955, -0.15106096863746643, 0.23337113857269287, -0.055026665329933167, 0.09385576099157333, 0.03419673070311546, -0.249374657869339, -0.5408245921134949, -0.25017857551574707, -0.00957556813955307, 0.38589027523994446, 0.09830093383789062, -0.0028514228761196136, -0.11265327781438828, 0.003343871794641018, 0.2670292854309082, 0.39376771450042725, -0.21082794666290283, -0.24920246005058289, 0.21024979650974274, -0.20926764607429504, -0.3346993923187256, 0.08194930851459503, -0.1042306199669838, 0.04457090049982071, 0.25238364934921265, -0.4788491725921631, -0.0906343013048172, -0.3600653409957886, 0.4096079468727112, -0.23261553049087524, 0.09382765740156174, 0.3463048040866852, 0.08929306268692017, 0.1463991403579712, -0.0417487770318985, -0.2757161259651184, -0.06513547152280807, -0.29464131593704224, -0.0682322308421135, 0.3381975591182709, 0.42744916677474976, -0.057569991797208786, 0.3770322799682617, 0.30022749304771423, 0.36044949293136597, 0.33447107672691345, 0.04584140330553055, 0.371113657951355, 0.05426141619682312, -0.2594739496707916, 0.10877574235200882, -0.19434651732444763, -0.14016076922416687, 0.3007429242134094, 0.08898266404867172, -0.1952640563249588, -0.052531491965055466, -0.38045263290405273, -0.280789315700531, -0.28528615832328796, -0.09924236685037613, -0.24633261561393738, 0.25375616550445557, 0.11914055049419403, 0.11004268378019333, -0.4462446868419647, -0.36911460757255554, 0.028843987733125687, 0.5546334385871887, -0.3098391890525818, 0.11157575994729996, -0.350803405046463, 0.13669921457767487, -0.6549719572067261, 0.2522459030151367, 0.034024856984615326, 0.4958058297634125, -0.17412425577640533, 0.12669691443443298, -0.0015084370970726013, -0.10742916166782379, 0.5570681095123291, -0.6522982120513916, 0.46183013916015625, 0.05812274292111397, 0.1157311499118805, 0.010197015479207039, -0.22434502840042114, -0.09225604683160782, 0.2416801154613495, 0.13694199919700623, 0.2145550400018692, 0.16392216086387634, 0.04404201731085777, 0.07620921730995178, 0.16659307479858398, -0.20013239979743958, -0.2790575623512268, -0.22713439166545868, -0.34188783168792725, -0.39038488268852234, 0.12800584733486176, 0.04219932109117508, 0.18547001481056213, -0.15174317359924316, 0.11716218292713165, -0.40468835830688477, 0.2369781732559204, 0.1301804780960083, 0.160282164812088, 0.187791645526886, 0.06457535177469254, 0.21815890073776245, -0.04804542660713196, 0.07534842193126678, -0.12915657460689545, 0.5240868330001831, -0.28047680854797363, -0.3283793032169342, -0.05249030888080597, -0.19998571276664734, -0.11711684614419937, 0.11224175989627838, -0.32655754685401917, -0.05009148269891739, -0.1384821981191635, -0.1327374130487442, -0.3143307566642761, 0.1170748621225357, 0.04260369390249252, -0.13543428480625153, -0.37768346071243286, -0.320193886756897, 0.3641435503959656, 0.21170027554035187, -0.44672805070877075, 0.34047412872314453, 0.11984778940677643, -0.42806288599967957, 0.18246892094612122, 0.051759663969278336, 0.7466567754745483, 0.07988948374986649, 0.2780211567878723, 0.09727701544761658, -0.11229541897773743, 0.20011739432811737, 0.11617845296859741, 0.056556906551122665, -0.372886598110199, -0.4541019797325134, -0.09887197613716125, -0.22054257988929749, -0.13453733921051025, -0.024940617382526398, -0.23379352688789368, 0.281745046377182, -0.11297810077667236, 0.31880542635917664, 0.27431026101112366, 0.04803723841905594, -0.3741956949234009, -0.37649932503700256, -0.12099416553974152, 0.1251862794160843, -0.19382448494434357, 0.13586857914924622, -0.22749009728431702, 0.09111526608467102, 0.08490447700023651, -0.16739481687545776, -0.4391220808029175, 0.19678986072540283, -0.41144582629203796, 0.13811704516410828, -0.29741814732551575, -0.3836832046508789, 0.08780047297477722, 0.5960643887519836, 0.2849668264389038, 0.3604592978954315, -0.15430286526679993, 0.06006678193807602, 0.07938911765813828, 0.11794479191303253, 0.02495839074254036, 0.007455416955053806, 0.19626376032829285, -0.080693319439888, -0.29818806052207947, -0.015169195830821991, -0.27812689542770386, -0.3215309977531433, -0.10555393993854523, 0.2862679362297058, 0.40390491485595703, -0.3201117515563965, -0.2076886147260666, -0.3106454610824585, 0.08497433364391327, -0.2798956036567688, 0.09370274841785431, 0.047042571008205414, -0.07560024410486221, 0.37954017519950867, -0.3368885815143585, -0.4257124960422516, -0.14751766622066498, 0.5242763161659241, -0.07907752692699432, -0.13375744223594666, 0.5711383819580078, -0.04850265011191368, -0.17853912711143494, -0.013032030314207077, 0.1454923450946808, -0.10098370164632797, -0.4624593257904053, -0.10034424066543579, -0.12253681570291519, 0.1078285276889801, -0.029106486588716507, 0.16985037922859192, 0.2787976861000061, -0.09631041437387466, 0.05340420827269554, -0.7581392526626587, -0.2621000111103058, -0.11298464238643646, -0.23114393651485443, 0.171635240316391, 0.1831110119819641, -0.44054147601127625, -0.135305255651474, -0.2840811610221863, -0.20300281047821045, 0.04410097002983093, -0.2147330343723297, -0.12944158911705017, 0.2779013216495514, 0.1545570194721222, -0.0013404092751443386, 0.12451376020908356, -0.0026245079934597015, 0.09265835583209991, 0.12275496870279312, -0.17136958241462708, -0.12370997667312622, 0.14752410352230072, 0.10378193110227585, -0.09179982542991638, 0.026753902435302734, -0.32842516899108887, -0.07359696924686432, -0.09842605143785477, 0.3940441608428955, 0.25930821895599365, -0.028157971799373627, 0.06791676580905914, -0.12768371403217316, 0.2894710302352905, -0.2827053368091583, 0.41511914134025574, -0.3472839891910553, -0.025129690766334534, -0.013372590765357018, 0.33476942777633667, -0.1413165181875229, 0.054126664996147156, -0.11745355278253555, -0.08249422162771225, 0.15325413644313812, 0.06789731234312057, 0.064606212079525, -0.3769119381904602, 0.08502596616744995, 0.1787574738264084, 0.05933383107185364, 0.0623643659055233, -0.2331833392381668, 0.014841334894299507, 0.24504989385604858, 0.15899191796779633, -0.09227006137371063, -0.12948721647262573, -0.012007245793938637, -0.32347726821899414, -0.17904430627822876, 0.30041563510894775, 0.16395725309848785, -0.3836260437965393, 0.13599160313606262, -0.03240535035729408, 0.5581645369529724, -0.22469477355480194, -0.057720523327589035, 0.4813494086265564, -0.21740099787712097, 0.27380865812301636, 0.2185857594013214, 0.2596442699432373, -0.08437968045473099, 0.5514782071113586, 0.18204262852668762, 0.13673798739910126, -0.005868319422006607, -0.17204801738262177, -0.10305269807577133, -0.6628074049949646, 0.28002867102622986, 0.0652533769607544, -0.07369038462638855, 0.05094379186630249, -0.029616892337799072, -0.008635953068733215, -0.30411455035209656, -0.00215360289439559, -0.4382818043231964, -0.2168949395418167, -0.1808832287788391, -0.28365954756736755, 0.06843509525060654, -0.233843594789505, 0.17253901064395905, 0.09277638792991638, -0.17077679932117462, -0.14519715309143066, -0.06997746229171753, -0.04275158792734146, -0.3035752773284912, -0.2684684693813324, 0.11163272708654404, 0.4133675694465637, -0.2662930488586426, -0.19269168376922607, 0.08904934674501419, 0.006442457437515259, 0.23958121240139008, 0.08864283561706543, 0.09613583981990814, 0.7200042605400085, 0.36966121196746826, -0.18670643866062164, -0.08271200954914093, 0.2043791264295578, 0.08498018980026245, -0.1013350859284401, 0.30956223607063293, 0.19926652312278748, 0.17723266780376434, 0.34535670280456543, 0.11968459188938141, -0.1244664266705513, 0.037458837032318115, 0.03806012123823166, -0.008947744965553284, -0.08347967267036438, 0.18735921382904053, -0.17643412947654724, -0.1684231460094452, 0.14056681096553802, 0.19802354276180267, -0.07277745753526688, 0.170026496052742, 0.2323683798313141, 0.06273786723613739, 0.19450870156288147, -0.19005322456359863, 0.020061571151018143, 0.14878025650978088, 0.3155462145805359, 0.3503624498844147, 0.09807030856609344, -0.23355361819267273, -0.06835883110761642, -0.5775803327560425, 0.2545947730541229, -0.01822507008910179, -0.38001543283462524, -0.0322347916662693, -0.1324879229068756, -0.33680033683776855, 0.10613558441400528, 0.1619228571653366, -0.10909657180309296, 0.055557720363140106, 0.26689612865448, -0.15676052868366241, -0.2936110198497772, 0.3894385099411011, -0.037768736481666565, -0.07810088247060776, -0.6786629557609558, 0.03660116717219353, -0.0887598916888237, 0.032007575035095215, -0.1506992131471634, -0.16663861274719238, 0.03414980322122574, -0.02607390284538269, 0.5437766909599304, 0.264413058757782, 0.45556026697158813, 0.007838010787963867, 0.09181289374828339, -0.5622057914733887, -0.06879816204309464, -0.14528967440128326, -0.03369449824094772, -0.07782617211341858, 0.2713480293750763, -0.22750447690486908, 0.04143668711185455, -0.12419246137142181, 0.16709394752979279, 0.2662990093231201, 0.37954163551330566, -0.005456537939608097, 0.22790490090847015, 0.1809433102607727, 0.1571902483701706, 0.34784379601478577, 0.06997198611497879, -0.0961792916059494, 0.44603681564331055, -0.24093373119831085, -0.3420475125312805, 0.21094875037670135, -0.3941512107849121, -0.3340471684932709, -0.019207322970032692, 0.32515743374824524, -0.2549188733100891, -0.15313325822353363, -0.23796388506889343, 0.20610827207565308, 0.24783992767333984, -0.14348027110099792, -0.3868972957134247, 0.14134538173675537, -0.15703505277633667, 0.14029169082641602, -0.022751886397600174, 0.03422359377145767, 0.01013527624309063, -0.22539043426513672, 0.17086787521839142, -0.2374371886253357 ]
https://github.com/huggingface/datasets/issues/2937
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
Thanks @albertvillanova for looking at it! I tried on my personal Windows machine and it downloaded just fine. Running on my work machine and on a colleague's machine it is consistently hitting this error. It's not a write access issue because the `.incomplete` directory is written just fine. It just won't rename and then it deletes the directory in the `finally` step. Also the zip file is written and extracted fine in the downloads directory. That leaves another program that might be interfering, and there are plenty of those in my work machine ... (full antivirus, data loss prevention, etc.). So the question remains, why not extend the `try` block to allow catching the error and circle back to the rename after the unknown program is finished doing its 'stuff'. This is the approach that I read about in the linked repo (see my comments above). If it's not high priority, that's fine. However, if someone were to write an PR that solved this issue in our environment in an `except` clause, would it be reviewed for inclusion in a future release? Just wondering whether I should spend any more time on this issue.
## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0
194
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied ## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0 Thanks @albertvillanova for looking at it! I tried on my personal Windows machine and it downloaded just fine. Running on my work machine and on a colleague's machine it is consistently hitting this error. It's not a write access issue because the `.incomplete` directory is written just fine. It just won't rename and then it deletes the directory in the `finally` step. Also the zip file is written and extracted fine in the downloads directory. That leaves another program that might be interfering, and there are plenty of those in my work machine ... (full antivirus, data loss prevention, etc.). So the question remains, why not extend the `try` block to allow catching the error and circle back to the rename after the unknown program is finished doing its 'stuff'. This is the approach that I read about in the linked repo (see my comments above). If it's not high priority, that's fine. However, if someone were to write an PR that solved this issue in our environment in an `except` clause, would it be reviewed for inclusion in a future release? Just wondering whether I should spend any more time on this issue.
[ -0.22893042862415314, 0.3834537863731384, 0.040345486253499985, 0.25503987073898315, -0.012111440300941467, 0.2622569799423218, 0.5036681294441223, 0.13295289874076843, 0.3442821502685547, 0.13571703433990479, -0.10897432267665863, 0.07728347182273865, 0.07315025478601456, -0.005698841065168381, -0.12562274932861328, 0.07892870903015137, 0.036444827914237976, -0.005388572812080383, 0.21495001018047333, 0.1039552390575409, -0.4238837957382202, 0.10729515552520752, -0.17285525798797607, 0.18611568212509155, 0.026095353066921234, -0.1363418847322464, 0.12126043438911438, 0.36072999238967896, -0.03078889660537243, -0.3922068774700165, 0.35302361845970154, 0.06345345079898834, 0.46391868591308594, 0.25824612379074097, -0.00011924602586077526, -0.013706982135772705, 0.23068350553512573, 0.12449978291988373, -0.07372744381427765, 0.0871000736951828, -0.18398547172546387, -0.1409674435853958, 0.16523012518882751, -0.09768609702587128, 0.1767442226409912, 0.3634921908378601, -0.10213734209537506, -0.20092955231666565, -0.01304171234369278, 0.3790340721607208, 0.15730012953281403, -0.03818552941083908, -0.11867921054363251, -0.07520386576652527, 0.49333617091178894, -0.1592983454465866, -0.13317985832691193, 0.2798383831977844, 0.07902549207210541, -0.1145709827542305, -0.09899193793535233, 0.19957299530506134, -0.16214939951896667, 0.1471576690673828, 0.018658198416233063, 0.031129412353038788, 0.21623170375823975, -0.4581091105937958, 0.35214126110076904, 0.15125800669193268, 0.9656510353088379, -0.19557353854179382, -0.19140426814556122, -0.08874918520450592, 0.013303476385772228, -0.0330025851726532, 0.4326038360595703, 0.42862293124198914, -0.3245686888694763, 0.2523709237575531, 0.06596922129392624, 0.08356527239084244, -0.08255112916231155, -0.0019085630774497986, 0.07128562033176422, 0.1486518234014511, -0.050470396876335144, 0.11955664306879044, -0.11473101377487183, -0.08340054005384445, 0.38633546233177185, -0.21382707357406616, -0.25460198521614075, 0.19166678190231323, -0.3394373059272766, 0.2898705005645752, 0.053453415632247925, 0.7778061628341675, 0.15787780284881592, 0.3155304193496704, 0.12502440810203552, -0.05405194312334061, 0.21362410485744476, 0.06519006937742233, 0.008593093603849411, 0.32148951292037964, -0.11223850399255753, -0.016923444345593452, 0.4271059036254883, 0.11744208633899689, -0.08161628246307373, -0.008990056812763214, -0.020045679062604904, -0.42947474122047424, 0.3538788855075836, 0.10540692508220673, 0.4081186056137085, -0.2856418788433075, -0.12170104682445526, -0.00029484089463949203, 0.15813148021697998, -0.023971129208803177, 0.058883123099803925, 0.5011532306671143, -0.27177080512046814, 0.04268378019332886, 0.06825167685747147, 0.17944511771202087, 0.018610628321766853, 0.09776042401790619, -0.08779972046613693, -0.08900287747383118, -0.26671841740608215, -0.05143827944993973, 0.4086472988128662, -0.3225748538970947, 0.0955643430352211, 0.25667712092399597, 0.02704816311597824, -0.17929475009441376, 0.19183194637298584, -0.04149730131030083, -0.032857172191143036, 0.35768646001815796, 0.39729535579681396, 0.33763429522514343, 0.17493285238742828, -0.21229684352874756, -0.034995343536138535, 0.18631118535995483, -0.4872901439666748, -0.4025035500526428, -0.03366319090127945, 0.12132740765810013, -0.08332448452711105, 0.06320483237504959, -0.1980368196964264, -0.04825741425156593, 0.3823125958442688, -0.30085498094558716, -0.061836011707782745, -0.013725977391004562, -0.22062011063098907, -0.5042766332626343, 0.04070699214935303, 0.40128886699676514, -0.3596992790699005, 0.13036717474460602, -0.09155377745628357, -0.26408690214157104, 0.15043187141418457, 0.005637414753437042, 0.0056341164745390415, 0.36168164014816284, -0.2812199592590332, 0.015607461333274841, 0.277458131313324, -0.3938944339752197, -1.0015970468521118, -0.021002821624279022, 0.0730997771024704, 0.1660424917936325, 0.24440622329711914, 0.11913693696260452, 0.3659380376338959, -0.03034600242972374, 0.1704770028591156, 0.3187129497528076, 0.13007500767707825, 0.1119738295674324, -0.06299638003110886, -0.20385542511940002, 0.2796615958213806, 0.13392695784568787, 0.08833920955657959, 0.3009032905101776, 0.3125999867916107, -0.056934162974357605, 0.2510957717895508, -0.1872614324092865, 0.11680471897125244, 0.19251592457294464, 0.01149553433060646, -0.03513624519109726, 0.13751451671123505, -0.12773767113685608, -0.42040905356407166, 0.3514483869075775, -0.008116722106933594, 0.08516694605350494, 0.075979083776474, -0.20274290442466736, -0.31846433877944946, 0.09134054183959961, -0.5447554588317871, -0.28899702429771423, 0.08510629087686539, 0.2938991189002991, 0.2124246507883072, 0.023681923747062683, 0.1891639530658722, 0.3374146521091461, -0.2082270085811615, 0.12719596922397614, -0.18114034831523895, 0.03860597312450409, -0.18833743035793304, -0.13644948601722717, -0.21224816143512726, 0.04691556841135025, 0.20012804865837097, 0.25274837017059326, -0.21343287825584412, 0.19610163569450378, 0.1512133628129959, 0.03749862313270569, -0.3785575032234192, -0.05955632030963898, -0.022377638146281242, 0.12172973155975342, 0.15684841573238373, 0.1381784975528717, 0.14832304418087006, -0.04439461603760719, -0.1922191083431244, 0.13775421679019928, -0.15963515639305115, 0.14373160898685455, -0.32665109634399414, 0.24303650856018066, 0.24470606446266174, 0.0900503396987915, 0.08569684624671936, 0.03445308655500412, 0.30547091364860535, 0.024117661640048027, 0.07459592819213867, -0.2858043313026428, 0.10126152634620667, -0.07780804485082626, 0.059302087873220444, 0.0225471593439579, 0.08128213882446289, 0.24975380301475525, -0.17460131645202637, 0.01688607782125473, 0.2869936525821686, 0.3496788442134857, 0.5377134084701538, -0.040986742824316025, 0.05154988542199135, 0.06679697334766388, 0.04791206121444702, 0.08966945111751556, 0.11925159394741058, 0.08577128499746323, -0.07022725045681, 0.2634487748146057, 0.1284337341785431, 0.22416622936725616, -0.06479744613170624, -0.11386145651340485, -0.10754147917032242, 0.4194302558898926, -0.48751428723335266, -0.08438777178525925, 0.10005532205104828, 0.07483997941017151, 0.18120169639587402, -0.24284721910953522, -0.08878229558467865, -0.1460990011692047, -0.24304603040218353, 0.31163647770881653, 0.09407058358192444, 0.0835372805595398, -0.5119581818580627, 0.16444166004657745, 0.007537709549069405, -0.20180644094944, -0.11375728249549866, 0.1238795593380928, -0.16583386063575745, -0.014107516035437584, 0.18624527752399445, -0.1799401193857193, 0.18738730251789093, -0.2951585054397583, 0.24375171959400177, -0.3901757001876831, -0.19543251395225525, 0.015110209584236145, 0.05788587033748627, 0.4098413586616516, 0.12543120980262756, 0.1551070660352707, 0.18641051650047302, -0.3417649269104004, 0.056602563709020615, -0.10751935094594955, -0.15106096863746643, 0.23337113857269287, -0.055026665329933167, 0.09385576099157333, 0.03419673070311546, -0.249374657869339, -0.5408245921134949, -0.25017857551574707, -0.00957556813955307, 0.38589027523994446, 0.09830093383789062, -0.0028514228761196136, -0.11265327781438828, 0.003343871794641018, 0.2670292854309082, 0.39376771450042725, -0.21082794666290283, -0.24920246005058289, 0.21024979650974274, -0.20926764607429504, -0.3346993923187256, 0.08194930851459503, -0.1042306199669838, 0.04457090049982071, 0.25238364934921265, -0.4788491725921631, -0.0906343013048172, -0.3600653409957886, 0.4096079468727112, -0.23261553049087524, 0.09382765740156174, 0.3463048040866852, 0.08929306268692017, 0.1463991403579712, -0.0417487770318985, -0.2757161259651184, -0.06513547152280807, -0.29464131593704224, -0.0682322308421135, 0.3381975591182709, 0.42744916677474976, -0.057569991797208786, 0.3770322799682617, 0.30022749304771423, 0.36044949293136597, 0.33447107672691345, 0.04584140330553055, 0.371113657951355, 0.05426141619682312, -0.2594739496707916, 0.10877574235200882, -0.19434651732444763, -0.14016076922416687, 0.3007429242134094, 0.08898266404867172, -0.1952640563249588, -0.052531491965055466, -0.38045263290405273, -0.280789315700531, -0.28528615832328796, -0.09924236685037613, -0.24633261561393738, 0.25375616550445557, 0.11914055049419403, 0.11004268378019333, -0.4462446868419647, -0.36911460757255554, 0.028843987733125687, 0.5546334385871887, -0.3098391890525818, 0.11157575994729996, -0.350803405046463, 0.13669921457767487, -0.6549719572067261, 0.2522459030151367, 0.034024856984615326, 0.4958058297634125, -0.17412425577640533, 0.12669691443443298, -0.0015084370970726013, -0.10742916166782379, 0.5570681095123291, -0.6522982120513916, 0.46183013916015625, 0.05812274292111397, 0.1157311499118805, 0.010197015479207039, -0.22434502840042114, -0.09225604683160782, 0.2416801154613495, 0.13694199919700623, 0.2145550400018692, 0.16392216086387634, 0.04404201731085777, 0.07620921730995178, 0.16659307479858398, -0.20013239979743958, -0.2790575623512268, -0.22713439166545868, -0.34188783168792725, -0.39038488268852234, 0.12800584733486176, 0.04219932109117508, 0.18547001481056213, -0.15174317359924316, 0.11716218292713165, -0.40468835830688477, 0.2369781732559204, 0.1301804780960083, 0.160282164812088, 0.187791645526886, 0.06457535177469254, 0.21815890073776245, -0.04804542660713196, 0.07534842193126678, -0.12915657460689545, 0.5240868330001831, -0.28047680854797363, -0.3283793032169342, -0.05249030888080597, -0.19998571276664734, -0.11711684614419937, 0.11224175989627838, -0.32655754685401917, -0.05009148269891739, -0.1384821981191635, -0.1327374130487442, -0.3143307566642761, 0.1170748621225357, 0.04260369390249252, -0.13543428480625153, -0.37768346071243286, -0.320193886756897, 0.3641435503959656, 0.21170027554035187, -0.44672805070877075, 0.34047412872314453, 0.11984778940677643, -0.42806288599967957, 0.18246892094612122, 0.051759663969278336, 0.7466567754745483, 0.07988948374986649, 0.2780211567878723, 0.09727701544761658, -0.11229541897773743, 0.20011739432811737, 0.11617845296859741, 0.056556906551122665, -0.372886598110199, -0.4541019797325134, -0.09887197613716125, -0.22054257988929749, -0.13453733921051025, -0.024940617382526398, -0.23379352688789368, 0.281745046377182, -0.11297810077667236, 0.31880542635917664, 0.27431026101112366, 0.04803723841905594, -0.3741956949234009, -0.37649932503700256, -0.12099416553974152, 0.1251862794160843, -0.19382448494434357, 0.13586857914924622, -0.22749009728431702, 0.09111526608467102, 0.08490447700023651, -0.16739481687545776, -0.4391220808029175, 0.19678986072540283, -0.41144582629203796, 0.13811704516410828, -0.29741814732551575, -0.3836832046508789, 0.08780047297477722, 0.5960643887519836, 0.2849668264389038, 0.3604592978954315, -0.15430286526679993, 0.06006678193807602, 0.07938911765813828, 0.11794479191303253, 0.02495839074254036, 0.007455416955053806, 0.19626376032829285, -0.080693319439888, -0.29818806052207947, -0.015169195830821991, -0.27812689542770386, -0.3215309977531433, -0.10555393993854523, 0.2862679362297058, 0.40390491485595703, -0.3201117515563965, -0.2076886147260666, -0.3106454610824585, 0.08497433364391327, -0.2798956036567688, 0.09370274841785431, 0.047042571008205414, -0.07560024410486221, 0.37954017519950867, -0.3368885815143585, -0.4257124960422516, -0.14751766622066498, 0.5242763161659241, -0.07907752692699432, -0.13375744223594666, 0.5711383819580078, -0.04850265011191368, -0.17853912711143494, -0.013032030314207077, 0.1454923450946808, -0.10098370164632797, -0.4624593257904053, -0.10034424066543579, -0.12253681570291519, 0.1078285276889801, -0.029106486588716507, 0.16985037922859192, 0.2787976861000061, -0.09631041437387466, 0.05340420827269554, -0.7581392526626587, -0.2621000111103058, -0.11298464238643646, -0.23114393651485443, 0.171635240316391, 0.1831110119819641, -0.44054147601127625, -0.135305255651474, -0.2840811610221863, -0.20300281047821045, 0.04410097002983093, -0.2147330343723297, -0.12944158911705017, 0.2779013216495514, 0.1545570194721222, -0.0013404092751443386, 0.12451376020908356, -0.0026245079934597015, 0.09265835583209991, 0.12275496870279312, -0.17136958241462708, -0.12370997667312622, 0.14752410352230072, 0.10378193110227585, -0.09179982542991638, 0.026753902435302734, -0.32842516899108887, -0.07359696924686432, -0.09842605143785477, 0.3940441608428955, 0.25930821895599365, -0.028157971799373627, 0.06791676580905914, -0.12768371403217316, 0.2894710302352905, -0.2827053368091583, 0.41511914134025574, -0.3472839891910553, -0.025129690766334534, -0.013372590765357018, 0.33476942777633667, -0.1413165181875229, 0.054126664996147156, -0.11745355278253555, -0.08249422162771225, 0.15325413644313812, 0.06789731234312057, 0.064606212079525, -0.3769119381904602, 0.08502596616744995, 0.1787574738264084, 0.05933383107185364, 0.0623643659055233, -0.2331833392381668, 0.014841334894299507, 0.24504989385604858, 0.15899191796779633, -0.09227006137371063, -0.12948721647262573, -0.012007245793938637, -0.32347726821899414, -0.17904430627822876, 0.30041563510894775, 0.16395725309848785, -0.3836260437965393, 0.13599160313606262, -0.03240535035729408, 0.5581645369529724, -0.22469477355480194, -0.057720523327589035, 0.4813494086265564, -0.21740099787712097, 0.27380865812301636, 0.2185857594013214, 0.2596442699432373, -0.08437968045473099, 0.5514782071113586, 0.18204262852668762, 0.13673798739910126, -0.005868319422006607, -0.17204801738262177, -0.10305269807577133, -0.6628074049949646, 0.28002867102622986, 0.0652533769607544, -0.07369038462638855, 0.05094379186630249, -0.029616892337799072, -0.008635953068733215, -0.30411455035209656, -0.00215360289439559, -0.4382818043231964, -0.2168949395418167, -0.1808832287788391, -0.28365954756736755, 0.06843509525060654, -0.233843594789505, 0.17253901064395905, 0.09277638792991638, -0.17077679932117462, -0.14519715309143066, -0.06997746229171753, -0.04275158792734146, -0.3035752773284912, -0.2684684693813324, 0.11163272708654404, 0.4133675694465637, -0.2662930488586426, -0.19269168376922607, 0.08904934674501419, 0.006442457437515259, 0.23958121240139008, 0.08864283561706543, 0.09613583981990814, 0.7200042605400085, 0.36966121196746826, -0.18670643866062164, -0.08271200954914093, 0.2043791264295578, 0.08498018980026245, -0.1013350859284401, 0.30956223607063293, 0.19926652312278748, 0.17723266780376434, 0.34535670280456543, 0.11968459188938141, -0.1244664266705513, 0.037458837032318115, 0.03806012123823166, -0.008947744965553284, -0.08347967267036438, 0.18735921382904053, -0.17643412947654724, -0.1684231460094452, 0.14056681096553802, 0.19802354276180267, -0.07277745753526688, 0.170026496052742, 0.2323683798313141, 0.06273786723613739, 0.19450870156288147, -0.19005322456359863, 0.020061571151018143, 0.14878025650978088, 0.3155462145805359, 0.3503624498844147, 0.09807030856609344, -0.23355361819267273, -0.06835883110761642, -0.5775803327560425, 0.2545947730541229, -0.01822507008910179, -0.38001543283462524, -0.0322347916662693, -0.1324879229068756, -0.33680033683776855, 0.10613558441400528, 0.1619228571653366, -0.10909657180309296, 0.055557720363140106, 0.26689612865448, -0.15676052868366241, -0.2936110198497772, 0.3894385099411011, -0.037768736481666565, -0.07810088247060776, -0.6786629557609558, 0.03660116717219353, -0.0887598916888237, 0.032007575035095215, -0.1506992131471634, -0.16663861274719238, 0.03414980322122574, -0.02607390284538269, 0.5437766909599304, 0.264413058757782, 0.45556026697158813, 0.007838010787963867, 0.09181289374828339, -0.5622057914733887, -0.06879816204309464, -0.14528967440128326, -0.03369449824094772, -0.07782617211341858, 0.2713480293750763, -0.22750447690486908, 0.04143668711185455, -0.12419246137142181, 0.16709394752979279, 0.2662990093231201, 0.37954163551330566, -0.005456537939608097, 0.22790490090847015, 0.1809433102607727, 0.1571902483701706, 0.34784379601478577, 0.06997198611497879, -0.0961792916059494, 0.44603681564331055, -0.24093373119831085, -0.3420475125312805, 0.21094875037670135, -0.3941512107849121, -0.3340471684932709, -0.019207322970032692, 0.32515743374824524, -0.2549188733100891, -0.15313325822353363, -0.23796388506889343, 0.20610827207565308, 0.24783992767333984, -0.14348027110099792, -0.3868972957134247, 0.14134538173675537, -0.15703505277633667, 0.14029169082641602, -0.022751886397600174, 0.03422359377145767, 0.01013527624309063, -0.22539043426513672, 0.17086787521839142, -0.2374371886253357 ]
https://github.com/huggingface/datasets/issues/2937
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
Hi @albertvillanova, even I am facing the same issue on my work machine: `Downloading and preparing dataset json/c4-en-html-with-metadata to C:\Users\......\.cache\huggingface\datasets\json\c4-en-html-with-metadata-4635c2fd9249f62d\0.0.0\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde... 100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 983.42it/s] 100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 209.01it/s] Traceback (most recent call last): File "bsmetadata/preprocessing_utils.py", line 710, in <module> ds = load_dataset( File "C:\Users\.......\AppData\Roaming\Python\Python38\site-packages\datasets\load.py", line 1694, in load_dataset builder_instance.download_and_prepare( File "C:\Users\........\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 603, in download_and_prepare self._save_info() File "C:\Users\..........\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\.....\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 557, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\.........\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde.incomplete' -> 'C:\\Users\\I355109\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde'`
## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0
80
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied ## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0 Hi @albertvillanova, even I am facing the same issue on my work machine: `Downloading and preparing dataset json/c4-en-html-with-metadata to C:\Users\......\.cache\huggingface\datasets\json\c4-en-html-with-metadata-4635c2fd9249f62d\0.0.0\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde... 100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 983.42it/s] 100%|███████████████████████████████████████████████████████████████████████████████████| 1/1 [00:00<00:00, 209.01it/s] Traceback (most recent call last): File "bsmetadata/preprocessing_utils.py", line 710, in <module> ds = load_dataset( File "C:\Users\.......\AppData\Roaming\Python\Python38\site-packages\datasets\load.py", line 1694, in load_dataset builder_instance.download_and_prepare( File "C:\Users\........\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 603, in download_and_prepare self._save_info() File "C:\Users\..........\AppData\Local\Programs\Python\Python38\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\.....\AppData\Roaming\Python\Python38\site-packages\datasets\builder.py", line 557, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\.........\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde.incomplete' -> 'C:\\Users\\I355109\\.cache\\huggingface\\datasets\\json\\c4-en-html-with-metadata-4635c2fd9249f62d\\0.0.0\\c90812beea906fcffe0d5e3bb9eba909a80a998b5f88e9f8acbd320aa91acfde'`
[ -0.22893042862415314, 0.3834537863731384, 0.040345486253499985, 0.25503987073898315, -0.012111440300941467, 0.2622569799423218, 0.5036681294441223, 0.13295289874076843, 0.3442821502685547, 0.13571703433990479, -0.10897432267665863, 0.07728347182273865, 0.07315025478601456, -0.005698841065168381, -0.12562274932861328, 0.07892870903015137, 0.036444827914237976, -0.005388572812080383, 0.21495001018047333, 0.1039552390575409, -0.4238837957382202, 0.10729515552520752, -0.17285525798797607, 0.18611568212509155, 0.026095353066921234, -0.1363418847322464, 0.12126043438911438, 0.36072999238967896, -0.03078889660537243, -0.3922068774700165, 0.35302361845970154, 0.06345345079898834, 0.46391868591308594, 0.25824612379074097, -0.00011924602586077526, -0.013706982135772705, 0.23068350553512573, 0.12449978291988373, -0.07372744381427765, 0.0871000736951828, -0.18398547172546387, -0.1409674435853958, 0.16523012518882751, -0.09768609702587128, 0.1767442226409912, 0.3634921908378601, -0.10213734209537506, -0.20092955231666565, -0.01304171234369278, 0.3790340721607208, 0.15730012953281403, -0.03818552941083908, -0.11867921054363251, -0.07520386576652527, 0.49333617091178894, -0.1592983454465866, -0.13317985832691193, 0.2798383831977844, 0.07902549207210541, -0.1145709827542305, -0.09899193793535233, 0.19957299530506134, -0.16214939951896667, 0.1471576690673828, 0.018658198416233063, 0.031129412353038788, 0.21623170375823975, -0.4581091105937958, 0.35214126110076904, 0.15125800669193268, 0.9656510353088379, -0.19557353854179382, -0.19140426814556122, -0.08874918520450592, 0.013303476385772228, -0.0330025851726532, 0.4326038360595703, 0.42862293124198914, -0.3245686888694763, 0.2523709237575531, 0.06596922129392624, 0.08356527239084244, -0.08255112916231155, -0.0019085630774497986, 0.07128562033176422, 0.1486518234014511, -0.050470396876335144, 0.11955664306879044, -0.11473101377487183, -0.08340054005384445, 0.38633546233177185, -0.21382707357406616, -0.25460198521614075, 0.19166678190231323, -0.3394373059272766, 0.2898705005645752, 0.053453415632247925, 0.7778061628341675, 0.15787780284881592, 0.3155304193496704, 0.12502440810203552, -0.05405194312334061, 0.21362410485744476, 0.06519006937742233, 0.008593093603849411, 0.32148951292037964, -0.11223850399255753, -0.016923444345593452, 0.4271059036254883, 0.11744208633899689, -0.08161628246307373, -0.008990056812763214, -0.020045679062604904, -0.42947474122047424, 0.3538788855075836, 0.10540692508220673, 0.4081186056137085, -0.2856418788433075, -0.12170104682445526, -0.00029484089463949203, 0.15813148021697998, -0.023971129208803177, 0.058883123099803925, 0.5011532306671143, -0.27177080512046814, 0.04268378019332886, 0.06825167685747147, 0.17944511771202087, 0.018610628321766853, 0.09776042401790619, -0.08779972046613693, -0.08900287747383118, -0.26671841740608215, -0.05143827944993973, 0.4086472988128662, -0.3225748538970947, 0.0955643430352211, 0.25667712092399597, 0.02704816311597824, -0.17929475009441376, 0.19183194637298584, -0.04149730131030083, -0.032857172191143036, 0.35768646001815796, 0.39729535579681396, 0.33763429522514343, 0.17493285238742828, -0.21229684352874756, -0.034995343536138535, 0.18631118535995483, -0.4872901439666748, -0.4025035500526428, -0.03366319090127945, 0.12132740765810013, -0.08332448452711105, 0.06320483237504959, -0.1980368196964264, -0.04825741425156593, 0.3823125958442688, -0.30085498094558716, -0.061836011707782745, -0.013725977391004562, -0.22062011063098907, -0.5042766332626343, 0.04070699214935303, 0.40128886699676514, -0.3596992790699005, 0.13036717474460602, -0.09155377745628357, -0.26408690214157104, 0.15043187141418457, 0.005637414753437042, 0.0056341164745390415, 0.36168164014816284, -0.2812199592590332, 0.015607461333274841, 0.277458131313324, -0.3938944339752197, -1.0015970468521118, -0.021002821624279022, 0.0730997771024704, 0.1660424917936325, 0.24440622329711914, 0.11913693696260452, 0.3659380376338959, -0.03034600242972374, 0.1704770028591156, 0.3187129497528076, 0.13007500767707825, 0.1119738295674324, -0.06299638003110886, -0.20385542511940002, 0.2796615958213806, 0.13392695784568787, 0.08833920955657959, 0.3009032905101776, 0.3125999867916107, -0.056934162974357605, 0.2510957717895508, -0.1872614324092865, 0.11680471897125244, 0.19251592457294464, 0.01149553433060646, -0.03513624519109726, 0.13751451671123505, -0.12773767113685608, -0.42040905356407166, 0.3514483869075775, -0.008116722106933594, 0.08516694605350494, 0.075979083776474, -0.20274290442466736, -0.31846433877944946, 0.09134054183959961, -0.5447554588317871, -0.28899702429771423, 0.08510629087686539, 0.2938991189002991, 0.2124246507883072, 0.023681923747062683, 0.1891639530658722, 0.3374146521091461, -0.2082270085811615, 0.12719596922397614, -0.18114034831523895, 0.03860597312450409, -0.18833743035793304, -0.13644948601722717, -0.21224816143512726, 0.04691556841135025, 0.20012804865837097, 0.25274837017059326, -0.21343287825584412, 0.19610163569450378, 0.1512133628129959, 0.03749862313270569, -0.3785575032234192, -0.05955632030963898, -0.022377638146281242, 0.12172973155975342, 0.15684841573238373, 0.1381784975528717, 0.14832304418087006, -0.04439461603760719, -0.1922191083431244, 0.13775421679019928, -0.15963515639305115, 0.14373160898685455, -0.32665109634399414, 0.24303650856018066, 0.24470606446266174, 0.0900503396987915, 0.08569684624671936, 0.03445308655500412, 0.30547091364860535, 0.024117661640048027, 0.07459592819213867, -0.2858043313026428, 0.10126152634620667, -0.07780804485082626, 0.059302087873220444, 0.0225471593439579, 0.08128213882446289, 0.24975380301475525, -0.17460131645202637, 0.01688607782125473, 0.2869936525821686, 0.3496788442134857, 0.5377134084701538, -0.040986742824316025, 0.05154988542199135, 0.06679697334766388, 0.04791206121444702, 0.08966945111751556, 0.11925159394741058, 0.08577128499746323, -0.07022725045681, 0.2634487748146057, 0.1284337341785431, 0.22416622936725616, -0.06479744613170624, -0.11386145651340485, -0.10754147917032242, 0.4194302558898926, -0.48751428723335266, -0.08438777178525925, 0.10005532205104828, 0.07483997941017151, 0.18120169639587402, -0.24284721910953522, -0.08878229558467865, -0.1460990011692047, -0.24304603040218353, 0.31163647770881653, 0.09407058358192444, 0.0835372805595398, -0.5119581818580627, 0.16444166004657745, 0.007537709549069405, -0.20180644094944, -0.11375728249549866, 0.1238795593380928, -0.16583386063575745, -0.014107516035437584, 0.18624527752399445, -0.1799401193857193, 0.18738730251789093, -0.2951585054397583, 0.24375171959400177, -0.3901757001876831, -0.19543251395225525, 0.015110209584236145, 0.05788587033748627, 0.4098413586616516, 0.12543120980262756, 0.1551070660352707, 0.18641051650047302, -0.3417649269104004, 0.056602563709020615, -0.10751935094594955, -0.15106096863746643, 0.23337113857269287, -0.055026665329933167, 0.09385576099157333, 0.03419673070311546, -0.249374657869339, -0.5408245921134949, -0.25017857551574707, -0.00957556813955307, 0.38589027523994446, 0.09830093383789062, -0.0028514228761196136, -0.11265327781438828, 0.003343871794641018, 0.2670292854309082, 0.39376771450042725, -0.21082794666290283, -0.24920246005058289, 0.21024979650974274, -0.20926764607429504, -0.3346993923187256, 0.08194930851459503, -0.1042306199669838, 0.04457090049982071, 0.25238364934921265, -0.4788491725921631, -0.0906343013048172, -0.3600653409957886, 0.4096079468727112, -0.23261553049087524, 0.09382765740156174, 0.3463048040866852, 0.08929306268692017, 0.1463991403579712, -0.0417487770318985, -0.2757161259651184, -0.06513547152280807, -0.29464131593704224, -0.0682322308421135, 0.3381975591182709, 0.42744916677474976, -0.057569991797208786, 0.3770322799682617, 0.30022749304771423, 0.36044949293136597, 0.33447107672691345, 0.04584140330553055, 0.371113657951355, 0.05426141619682312, -0.2594739496707916, 0.10877574235200882, -0.19434651732444763, -0.14016076922416687, 0.3007429242134094, 0.08898266404867172, -0.1952640563249588, -0.052531491965055466, -0.38045263290405273, -0.280789315700531, -0.28528615832328796, -0.09924236685037613, -0.24633261561393738, 0.25375616550445557, 0.11914055049419403, 0.11004268378019333, -0.4462446868419647, -0.36911460757255554, 0.028843987733125687, 0.5546334385871887, -0.3098391890525818, 0.11157575994729996, -0.350803405046463, 0.13669921457767487, -0.6549719572067261, 0.2522459030151367, 0.034024856984615326, 0.4958058297634125, -0.17412425577640533, 0.12669691443443298, -0.0015084370970726013, -0.10742916166782379, 0.5570681095123291, -0.6522982120513916, 0.46183013916015625, 0.05812274292111397, 0.1157311499118805, 0.010197015479207039, -0.22434502840042114, -0.09225604683160782, 0.2416801154613495, 0.13694199919700623, 0.2145550400018692, 0.16392216086387634, 0.04404201731085777, 0.07620921730995178, 0.16659307479858398, -0.20013239979743958, -0.2790575623512268, -0.22713439166545868, -0.34188783168792725, -0.39038488268852234, 0.12800584733486176, 0.04219932109117508, 0.18547001481056213, -0.15174317359924316, 0.11716218292713165, -0.40468835830688477, 0.2369781732559204, 0.1301804780960083, 0.160282164812088, 0.187791645526886, 0.06457535177469254, 0.21815890073776245, -0.04804542660713196, 0.07534842193126678, -0.12915657460689545, 0.5240868330001831, -0.28047680854797363, -0.3283793032169342, -0.05249030888080597, -0.19998571276664734, -0.11711684614419937, 0.11224175989627838, -0.32655754685401917, -0.05009148269891739, -0.1384821981191635, -0.1327374130487442, -0.3143307566642761, 0.1170748621225357, 0.04260369390249252, -0.13543428480625153, -0.37768346071243286, -0.320193886756897, 0.3641435503959656, 0.21170027554035187, -0.44672805070877075, 0.34047412872314453, 0.11984778940677643, -0.42806288599967957, 0.18246892094612122, 0.051759663969278336, 0.7466567754745483, 0.07988948374986649, 0.2780211567878723, 0.09727701544761658, -0.11229541897773743, 0.20011739432811737, 0.11617845296859741, 0.056556906551122665, -0.372886598110199, -0.4541019797325134, -0.09887197613716125, -0.22054257988929749, -0.13453733921051025, -0.024940617382526398, -0.23379352688789368, 0.281745046377182, -0.11297810077667236, 0.31880542635917664, 0.27431026101112366, 0.04803723841905594, -0.3741956949234009, -0.37649932503700256, -0.12099416553974152, 0.1251862794160843, -0.19382448494434357, 0.13586857914924622, -0.22749009728431702, 0.09111526608467102, 0.08490447700023651, -0.16739481687545776, -0.4391220808029175, 0.19678986072540283, -0.41144582629203796, 0.13811704516410828, -0.29741814732551575, -0.3836832046508789, 0.08780047297477722, 0.5960643887519836, 0.2849668264389038, 0.3604592978954315, -0.15430286526679993, 0.06006678193807602, 0.07938911765813828, 0.11794479191303253, 0.02495839074254036, 0.007455416955053806, 0.19626376032829285, -0.080693319439888, -0.29818806052207947, -0.015169195830821991, -0.27812689542770386, -0.3215309977531433, -0.10555393993854523, 0.2862679362297058, 0.40390491485595703, -0.3201117515563965, -0.2076886147260666, -0.3106454610824585, 0.08497433364391327, -0.2798956036567688, 0.09370274841785431, 0.047042571008205414, -0.07560024410486221, 0.37954017519950867, -0.3368885815143585, -0.4257124960422516, -0.14751766622066498, 0.5242763161659241, -0.07907752692699432, -0.13375744223594666, 0.5711383819580078, -0.04850265011191368, -0.17853912711143494, -0.013032030314207077, 0.1454923450946808, -0.10098370164632797, -0.4624593257904053, -0.10034424066543579, -0.12253681570291519, 0.1078285276889801, -0.029106486588716507, 0.16985037922859192, 0.2787976861000061, -0.09631041437387466, 0.05340420827269554, -0.7581392526626587, -0.2621000111103058, -0.11298464238643646, -0.23114393651485443, 0.171635240316391, 0.1831110119819641, -0.44054147601127625, -0.135305255651474, -0.2840811610221863, -0.20300281047821045, 0.04410097002983093, -0.2147330343723297, -0.12944158911705017, 0.2779013216495514, 0.1545570194721222, -0.0013404092751443386, 0.12451376020908356, -0.0026245079934597015, 0.09265835583209991, 0.12275496870279312, -0.17136958241462708, -0.12370997667312622, 0.14752410352230072, 0.10378193110227585, -0.09179982542991638, 0.026753902435302734, -0.32842516899108887, -0.07359696924686432, -0.09842605143785477, 0.3940441608428955, 0.25930821895599365, -0.028157971799373627, 0.06791676580905914, -0.12768371403217316, 0.2894710302352905, -0.2827053368091583, 0.41511914134025574, -0.3472839891910553, -0.025129690766334534, -0.013372590765357018, 0.33476942777633667, -0.1413165181875229, 0.054126664996147156, -0.11745355278253555, -0.08249422162771225, 0.15325413644313812, 0.06789731234312057, 0.064606212079525, -0.3769119381904602, 0.08502596616744995, 0.1787574738264084, 0.05933383107185364, 0.0623643659055233, -0.2331833392381668, 0.014841334894299507, 0.24504989385604858, 0.15899191796779633, -0.09227006137371063, -0.12948721647262573, -0.012007245793938637, -0.32347726821899414, -0.17904430627822876, 0.30041563510894775, 0.16395725309848785, -0.3836260437965393, 0.13599160313606262, -0.03240535035729408, 0.5581645369529724, -0.22469477355480194, -0.057720523327589035, 0.4813494086265564, -0.21740099787712097, 0.27380865812301636, 0.2185857594013214, 0.2596442699432373, -0.08437968045473099, 0.5514782071113586, 0.18204262852668762, 0.13673798739910126, -0.005868319422006607, -0.17204801738262177, -0.10305269807577133, -0.6628074049949646, 0.28002867102622986, 0.0652533769607544, -0.07369038462638855, 0.05094379186630249, -0.029616892337799072, -0.008635953068733215, -0.30411455035209656, -0.00215360289439559, -0.4382818043231964, -0.2168949395418167, -0.1808832287788391, -0.28365954756736755, 0.06843509525060654, -0.233843594789505, 0.17253901064395905, 0.09277638792991638, -0.17077679932117462, -0.14519715309143066, -0.06997746229171753, -0.04275158792734146, -0.3035752773284912, -0.2684684693813324, 0.11163272708654404, 0.4133675694465637, -0.2662930488586426, -0.19269168376922607, 0.08904934674501419, 0.006442457437515259, 0.23958121240139008, 0.08864283561706543, 0.09613583981990814, 0.7200042605400085, 0.36966121196746826, -0.18670643866062164, -0.08271200954914093, 0.2043791264295578, 0.08498018980026245, -0.1013350859284401, 0.30956223607063293, 0.19926652312278748, 0.17723266780376434, 0.34535670280456543, 0.11968459188938141, -0.1244664266705513, 0.037458837032318115, 0.03806012123823166, -0.008947744965553284, -0.08347967267036438, 0.18735921382904053, -0.17643412947654724, -0.1684231460094452, 0.14056681096553802, 0.19802354276180267, -0.07277745753526688, 0.170026496052742, 0.2323683798313141, 0.06273786723613739, 0.19450870156288147, -0.19005322456359863, 0.020061571151018143, 0.14878025650978088, 0.3155462145805359, 0.3503624498844147, 0.09807030856609344, -0.23355361819267273, -0.06835883110761642, -0.5775803327560425, 0.2545947730541229, -0.01822507008910179, -0.38001543283462524, -0.0322347916662693, -0.1324879229068756, -0.33680033683776855, 0.10613558441400528, 0.1619228571653366, -0.10909657180309296, 0.055557720363140106, 0.26689612865448, -0.15676052868366241, -0.2936110198497772, 0.3894385099411011, -0.037768736481666565, -0.07810088247060776, -0.6786629557609558, 0.03660116717219353, -0.0887598916888237, 0.032007575035095215, -0.1506992131471634, -0.16663861274719238, 0.03414980322122574, -0.02607390284538269, 0.5437766909599304, 0.264413058757782, 0.45556026697158813, 0.007838010787963867, 0.09181289374828339, -0.5622057914733887, -0.06879816204309464, -0.14528967440128326, -0.03369449824094772, -0.07782617211341858, 0.2713480293750763, -0.22750447690486908, 0.04143668711185455, -0.12419246137142181, 0.16709394752979279, 0.2662990093231201, 0.37954163551330566, -0.005456537939608097, 0.22790490090847015, 0.1809433102607727, 0.1571902483701706, 0.34784379601478577, 0.06997198611497879, -0.0961792916059494, 0.44603681564331055, -0.24093373119831085, -0.3420475125312805, 0.21094875037670135, -0.3941512107849121, -0.3340471684932709, -0.019207322970032692, 0.32515743374824524, -0.2549188733100891, -0.15313325822353363, -0.23796388506889343, 0.20610827207565308, 0.24783992767333984, -0.14348027110099792, -0.3868972957134247, 0.14134538173675537, -0.15703505277633667, 0.14029169082641602, -0.022751886397600174, 0.03422359377145767, 0.01013527624309063, -0.22539043426513672, 0.17086787521839142, -0.2374371886253357 ]
https://github.com/huggingface/datasets/issues/2937
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied
I'm facing the same issue. ## System Information - OS Edition: Windows 10 21H1 - OS build: 19043.1826 - Python version: 3.10.6 (installed using `choco install python`) - datasets: 2.4.0 - PyArrow: 6.0.1 ## Troubleshooting steps - Restart the computer, unfortunately doesn't work! 🌚 - Checked the permissions of `~./cache/...`, looks fine. - Tested with a simple file operation using the `open()` function and writing a hello_world.txt, it works fine. - Tested with a different `cache_dir` value on the `load_dataset()`, e.g. "./data" - Tested different datasets: `conll2003`, `squad_v2`, and `wiki_bio`. - Downgraded datasets from `2.4.0` to `2.1.0`, issue persists. - Tested it on WSL (Ubuntu 20.04), and it works! - Python reinstallation, in the first time downloading `conll2003` works fine, but `squad` or `squad_v2` raises Access Denied. - After the system or VSCode restart, the issue comes back. ## Resolution I fixed it by changing the following command: https://github.com/huggingface/datasets/blob/68cffe30917a9abed68d28caf54b40c10f977602/src/datasets/builder.py#L666 for ```python shutil.move(tmp_dir, dirname) ```
## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0
154
load_dataset using default cache on Windows causes PermissionError: [WinError 5] Access is denied ## Describe the bug Standard process to download and load the wiki_bio dataset causes PermissionError in Windows 10 and 11. ## Steps to reproduce the bug ```python from datasets import load_dataset ds = load_dataset('wiki_bio') ``` ## Expected results It is expected that the dataset downloads without any errors. ## Actual results PermissionError see trace below: ``` Using custom data configuration default Downloading and preparing dataset wiki_bio/default (download: 318.53 MiB, generated: 736.94 MiB, post-processed: Unknown size, total: 1.03 GiB) to C:\Users\username\.cache\huggingface\datasets\wiki_bio\default\1.1.0\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9... Traceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 644, in download_and_prepare self._save_info() File "C:\Users\username\.conda\envs\hf\lib\contextlib.py", line 120, in __exit__ next(self.gen) File "C:\Users\username\.conda\envs\hf\lib\site-packages\datasets\builder.py", line 598, in incomplete_dir os.rename(tmp_dir, dirname) PermissionError: [WinError 5] Access is denied: 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9.incomplete' -> 'C:\\Users\\username\\.cache\\huggingface\\datasets\\wiki_bio\\default\\1.1.0\\5293ce565954ba965dada626f1e79684e98172d950371d266bf3caaf87e911c9' ``` By commenting out the os.rename() [L604](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L604) and the shutil.rmtree() [L607](https://github.com/huggingface/datasets/blob/master/src/datasets/builder.py#L607) lines, in my virtual environment, I was able to get the load process to complete, rename the directory manually and then rerun the `load_dataset('wiki_bio')` to get what I needed. It seems that os.rename() in the `incomplete_dir` content manager is the culprit. Here's another project [Conan](https://github.com/conan-io/conan/issues/6560) with similar issue with os.rename() if it helps debug this issue. ## Environment info - `datasets` version: 1.12.1 - Platform: Windows-10-10.0.22449-SP0 - Python version: 3.8.12 - PyArrow version: 5.0.0 I'm facing the same issue. ## System Information - OS Edition: Windows 10 21H1 - OS build: 19043.1826 - Python version: 3.10.6 (installed using `choco install python`) - datasets: 2.4.0 - PyArrow: 6.0.1 ## Troubleshooting steps - Restart the computer, unfortunately doesn't work! 🌚 - Checked the permissions of `~./cache/...`, looks fine. - Tested with a simple file operation using the `open()` function and writing a hello_world.txt, it works fine. - Tested with a different `cache_dir` value on the `load_dataset()`, e.g. "./data" - Tested different datasets: `conll2003`, `squad_v2`, and `wiki_bio`. - Downgraded datasets from `2.4.0` to `2.1.0`, issue persists. - Tested it on WSL (Ubuntu 20.04), and it works! - Python reinstallation, in the first time downloading `conll2003` works fine, but `squad` or `squad_v2` raises Access Denied. - After the system or VSCode restart, the issue comes back. ## Resolution I fixed it by changing the following command: https://github.com/huggingface/datasets/blob/68cffe30917a9abed68d28caf54b40c10f977602/src/datasets/builder.py#L666 for ```python shutil.move(tmp_dir, dirname) ```
[ -0.22893042862415314, 0.3834537863731384, 0.040345486253499985, 0.25503987073898315, -0.012111440300941467, 0.2622569799423218, 0.5036681294441223, 0.13295289874076843, 0.3442821502685547, 0.13571703433990479, -0.10897432267665863, 0.07728347182273865, 0.07315025478601456, -0.005698841065168381, -0.12562274932861328, 0.07892870903015137, 0.036444827914237976, -0.005388572812080383, 0.21495001018047333, 0.1039552390575409, -0.4238837957382202, 0.10729515552520752, -0.17285525798797607, 0.18611568212509155, 0.026095353066921234, -0.1363418847322464, 0.12126043438911438, 0.36072999238967896, -0.03078889660537243, -0.3922068774700165, 0.35302361845970154, 0.06345345079898834, 0.46391868591308594, 0.25824612379074097, -0.00011924602586077526, -0.013706982135772705, 0.23068350553512573, 0.12449978291988373, -0.07372744381427765, 0.0871000736951828, -0.18398547172546387, -0.1409674435853958, 0.16523012518882751, -0.09768609702587128, 0.1767442226409912, 0.3634921908378601, -0.10213734209537506, -0.20092955231666565, -0.01304171234369278, 0.3790340721607208, 0.15730012953281403, -0.03818552941083908, -0.11867921054363251, -0.07520386576652527, 0.49333617091178894, -0.1592983454465866, -0.13317985832691193, 0.2798383831977844, 0.07902549207210541, -0.1145709827542305, -0.09899193793535233, 0.19957299530506134, -0.16214939951896667, 0.1471576690673828, 0.018658198416233063, 0.031129412353038788, 0.21623170375823975, -0.4581091105937958, 0.35214126110076904, 0.15125800669193268, 0.9656510353088379, -0.19557353854179382, -0.19140426814556122, -0.08874918520450592, 0.013303476385772228, -0.0330025851726532, 0.4326038360595703, 0.42862293124198914, -0.3245686888694763, 0.2523709237575531, 0.06596922129392624, 0.08356527239084244, -0.08255112916231155, -0.0019085630774497986, 0.07128562033176422, 0.1486518234014511, -0.050470396876335144, 0.11955664306879044, -0.11473101377487183, -0.08340054005384445, 0.38633546233177185, -0.21382707357406616, -0.25460198521614075, 0.19166678190231323, -0.3394373059272766, 0.2898705005645752, 0.053453415632247925, 0.7778061628341675, 0.15787780284881592, 0.3155304193496704, 0.12502440810203552, -0.05405194312334061, 0.21362410485744476, 0.06519006937742233, 0.008593093603849411, 0.32148951292037964, -0.11223850399255753, -0.016923444345593452, 0.4271059036254883, 0.11744208633899689, -0.08161628246307373, -0.008990056812763214, -0.020045679062604904, -0.42947474122047424, 0.3538788855075836, 0.10540692508220673, 0.4081186056137085, -0.2856418788433075, -0.12170104682445526, -0.00029484089463949203, 0.15813148021697998, -0.023971129208803177, 0.058883123099803925, 0.5011532306671143, -0.27177080512046814, 0.04268378019332886, 0.06825167685747147, 0.17944511771202087, 0.018610628321766853, 0.09776042401790619, -0.08779972046613693, -0.08900287747383118, -0.26671841740608215, -0.05143827944993973, 0.4086472988128662, -0.3225748538970947, 0.0955643430352211, 0.25667712092399597, 0.02704816311597824, -0.17929475009441376, 0.19183194637298584, -0.04149730131030083, -0.032857172191143036, 0.35768646001815796, 0.39729535579681396, 0.33763429522514343, 0.17493285238742828, -0.21229684352874756, -0.034995343536138535, 0.18631118535995483, -0.4872901439666748, -0.4025035500526428, -0.03366319090127945, 0.12132740765810013, -0.08332448452711105, 0.06320483237504959, -0.1980368196964264, -0.04825741425156593, 0.3823125958442688, -0.30085498094558716, -0.061836011707782745, -0.013725977391004562, -0.22062011063098907, -0.5042766332626343, 0.04070699214935303, 0.40128886699676514, -0.3596992790699005, 0.13036717474460602, -0.09155377745628357, -0.26408690214157104, 0.15043187141418457, 0.005637414753437042, 0.0056341164745390415, 0.36168164014816284, -0.2812199592590332, 0.015607461333274841, 0.277458131313324, -0.3938944339752197, -1.0015970468521118, -0.021002821624279022, 0.0730997771024704, 0.1660424917936325, 0.24440622329711914, 0.11913693696260452, 0.3659380376338959, -0.03034600242972374, 0.1704770028591156, 0.3187129497528076, 0.13007500767707825, 0.1119738295674324, -0.06299638003110886, -0.20385542511940002, 0.2796615958213806, 0.13392695784568787, 0.08833920955657959, 0.3009032905101776, 0.3125999867916107, -0.056934162974357605, 0.2510957717895508, -0.1872614324092865, 0.11680471897125244, 0.19251592457294464, 0.01149553433060646, -0.03513624519109726, 0.13751451671123505, -0.12773767113685608, -0.42040905356407166, 0.3514483869075775, -0.008116722106933594, 0.08516694605350494, 0.075979083776474, -0.20274290442466736, -0.31846433877944946, 0.09134054183959961, -0.5447554588317871, -0.28899702429771423, 0.08510629087686539, 0.2938991189002991, 0.2124246507883072, 0.023681923747062683, 0.1891639530658722, 0.3374146521091461, -0.2082270085811615, 0.12719596922397614, -0.18114034831523895, 0.03860597312450409, -0.18833743035793304, -0.13644948601722717, -0.21224816143512726, 0.04691556841135025, 0.20012804865837097, 0.25274837017059326, -0.21343287825584412, 0.19610163569450378, 0.1512133628129959, 0.03749862313270569, -0.3785575032234192, -0.05955632030963898, -0.022377638146281242, 0.12172973155975342, 0.15684841573238373, 0.1381784975528717, 0.14832304418087006, -0.04439461603760719, -0.1922191083431244, 0.13775421679019928, -0.15963515639305115, 0.14373160898685455, -0.32665109634399414, 0.24303650856018066, 0.24470606446266174, 0.0900503396987915, 0.08569684624671936, 0.03445308655500412, 0.30547091364860535, 0.024117661640048027, 0.07459592819213867, -0.2858043313026428, 0.10126152634620667, -0.07780804485082626, 0.059302087873220444, 0.0225471593439579, 0.08128213882446289, 0.24975380301475525, -0.17460131645202637, 0.01688607782125473, 0.2869936525821686, 0.3496788442134857, 0.5377134084701538, -0.040986742824316025, 0.05154988542199135, 0.06679697334766388, 0.04791206121444702, 0.08966945111751556, 0.11925159394741058, 0.08577128499746323, -0.07022725045681, 0.2634487748146057, 0.1284337341785431, 0.22416622936725616, -0.06479744613170624, -0.11386145651340485, -0.10754147917032242, 0.4194302558898926, -0.48751428723335266, -0.08438777178525925, 0.10005532205104828, 0.07483997941017151, 0.18120169639587402, -0.24284721910953522, -0.08878229558467865, -0.1460990011692047, -0.24304603040218353, 0.31163647770881653, 0.09407058358192444, 0.0835372805595398, -0.5119581818580627, 0.16444166004657745, 0.007537709549069405, -0.20180644094944, -0.11375728249549866, 0.1238795593380928, -0.16583386063575745, -0.014107516035437584, 0.18624527752399445, -0.1799401193857193, 0.18738730251789093, -0.2951585054397583, 0.24375171959400177, -0.3901757001876831, -0.19543251395225525, 0.015110209584236145, 0.05788587033748627, 0.4098413586616516, 0.12543120980262756, 0.1551070660352707, 0.18641051650047302, -0.3417649269104004, 0.056602563709020615, -0.10751935094594955, -0.15106096863746643, 0.23337113857269287, -0.055026665329933167, 0.09385576099157333, 0.03419673070311546, -0.249374657869339, -0.5408245921134949, -0.25017857551574707, -0.00957556813955307, 0.38589027523994446, 0.09830093383789062, -0.0028514228761196136, -0.11265327781438828, 0.003343871794641018, 0.2670292854309082, 0.39376771450042725, -0.21082794666290283, -0.24920246005058289, 0.21024979650974274, -0.20926764607429504, -0.3346993923187256, 0.08194930851459503, -0.1042306199669838, 0.04457090049982071, 0.25238364934921265, -0.4788491725921631, -0.0906343013048172, -0.3600653409957886, 0.4096079468727112, -0.23261553049087524, 0.09382765740156174, 0.3463048040866852, 0.08929306268692017, 0.1463991403579712, -0.0417487770318985, -0.2757161259651184, -0.06513547152280807, -0.29464131593704224, -0.0682322308421135, 0.3381975591182709, 0.42744916677474976, -0.057569991797208786, 0.3770322799682617, 0.30022749304771423, 0.36044949293136597, 0.33447107672691345, 0.04584140330553055, 0.371113657951355, 0.05426141619682312, -0.2594739496707916, 0.10877574235200882, -0.19434651732444763, -0.14016076922416687, 0.3007429242134094, 0.08898266404867172, -0.1952640563249588, -0.052531491965055466, -0.38045263290405273, -0.280789315700531, -0.28528615832328796, -0.09924236685037613, -0.24633261561393738, 0.25375616550445557, 0.11914055049419403, 0.11004268378019333, -0.4462446868419647, -0.36911460757255554, 0.028843987733125687, 0.5546334385871887, -0.3098391890525818, 0.11157575994729996, -0.350803405046463, 0.13669921457767487, -0.6549719572067261, 0.2522459030151367, 0.034024856984615326, 0.4958058297634125, -0.17412425577640533, 0.12669691443443298, -0.0015084370970726013, -0.10742916166782379, 0.5570681095123291, -0.6522982120513916, 0.46183013916015625, 0.05812274292111397, 0.1157311499118805, 0.010197015479207039, -0.22434502840042114, -0.09225604683160782, 0.2416801154613495, 0.13694199919700623, 0.2145550400018692, 0.16392216086387634, 0.04404201731085777, 0.07620921730995178, 0.16659307479858398, -0.20013239979743958, -0.2790575623512268, -0.22713439166545868, -0.34188783168792725, -0.39038488268852234, 0.12800584733486176, 0.04219932109117508, 0.18547001481056213, -0.15174317359924316, 0.11716218292713165, -0.40468835830688477, 0.2369781732559204, 0.1301804780960083, 0.160282164812088, 0.187791645526886, 0.06457535177469254, 0.21815890073776245, -0.04804542660713196, 0.07534842193126678, -0.12915657460689545, 0.5240868330001831, -0.28047680854797363, -0.3283793032169342, -0.05249030888080597, -0.19998571276664734, -0.11711684614419937, 0.11224175989627838, -0.32655754685401917, -0.05009148269891739, -0.1384821981191635, -0.1327374130487442, -0.3143307566642761, 0.1170748621225357, 0.04260369390249252, -0.13543428480625153, -0.37768346071243286, -0.320193886756897, 0.3641435503959656, 0.21170027554035187, -0.44672805070877075, 0.34047412872314453, 0.11984778940677643, -0.42806288599967957, 0.18246892094612122, 0.051759663969278336, 0.7466567754745483, 0.07988948374986649, 0.2780211567878723, 0.09727701544761658, -0.11229541897773743, 0.20011739432811737, 0.11617845296859741, 0.056556906551122665, -0.372886598110199, -0.4541019797325134, -0.09887197613716125, -0.22054257988929749, -0.13453733921051025, -0.024940617382526398, -0.23379352688789368, 0.281745046377182, -0.11297810077667236, 0.31880542635917664, 0.27431026101112366, 0.04803723841905594, -0.3741956949234009, -0.37649932503700256, -0.12099416553974152, 0.1251862794160843, -0.19382448494434357, 0.13586857914924622, -0.22749009728431702, 0.09111526608467102, 0.08490447700023651, -0.16739481687545776, -0.4391220808029175, 0.19678986072540283, -0.41144582629203796, 0.13811704516410828, -0.29741814732551575, -0.3836832046508789, 0.08780047297477722, 0.5960643887519836, 0.2849668264389038, 0.3604592978954315, -0.15430286526679993, 0.06006678193807602, 0.07938911765813828, 0.11794479191303253, 0.02495839074254036, 0.007455416955053806, 0.19626376032829285, -0.080693319439888, -0.29818806052207947, -0.015169195830821991, -0.27812689542770386, -0.3215309977531433, -0.10555393993854523, 0.2862679362297058, 0.40390491485595703, -0.3201117515563965, -0.2076886147260666, -0.3106454610824585, 0.08497433364391327, -0.2798956036567688, 0.09370274841785431, 0.047042571008205414, -0.07560024410486221, 0.37954017519950867, -0.3368885815143585, -0.4257124960422516, -0.14751766622066498, 0.5242763161659241, -0.07907752692699432, -0.13375744223594666, 0.5711383819580078, -0.04850265011191368, -0.17853912711143494, -0.013032030314207077, 0.1454923450946808, -0.10098370164632797, -0.4624593257904053, -0.10034424066543579, -0.12253681570291519, 0.1078285276889801, -0.029106486588716507, 0.16985037922859192, 0.2787976861000061, -0.09631041437387466, 0.05340420827269554, -0.7581392526626587, -0.2621000111103058, -0.11298464238643646, -0.23114393651485443, 0.171635240316391, 0.1831110119819641, -0.44054147601127625, -0.135305255651474, -0.2840811610221863, -0.20300281047821045, 0.04410097002983093, -0.2147330343723297, -0.12944158911705017, 0.2779013216495514, 0.1545570194721222, -0.0013404092751443386, 0.12451376020908356, -0.0026245079934597015, 0.09265835583209991, 0.12275496870279312, -0.17136958241462708, -0.12370997667312622, 0.14752410352230072, 0.10378193110227585, -0.09179982542991638, 0.026753902435302734, -0.32842516899108887, -0.07359696924686432, -0.09842605143785477, 0.3940441608428955, 0.25930821895599365, -0.028157971799373627, 0.06791676580905914, -0.12768371403217316, 0.2894710302352905, -0.2827053368091583, 0.41511914134025574, -0.3472839891910553, -0.025129690766334534, -0.013372590765357018, 0.33476942777633667, -0.1413165181875229, 0.054126664996147156, -0.11745355278253555, -0.08249422162771225, 0.15325413644313812, 0.06789731234312057, 0.064606212079525, -0.3769119381904602, 0.08502596616744995, 0.1787574738264084, 0.05933383107185364, 0.0623643659055233, -0.2331833392381668, 0.014841334894299507, 0.24504989385604858, 0.15899191796779633, -0.09227006137371063, -0.12948721647262573, -0.012007245793938637, -0.32347726821899414, -0.17904430627822876, 0.30041563510894775, 0.16395725309848785, -0.3836260437965393, 0.13599160313606262, -0.03240535035729408, 0.5581645369529724, -0.22469477355480194, -0.057720523327589035, 0.4813494086265564, -0.21740099787712097, 0.27380865812301636, 0.2185857594013214, 0.2596442699432373, -0.08437968045473099, 0.5514782071113586, 0.18204262852668762, 0.13673798739910126, -0.005868319422006607, -0.17204801738262177, -0.10305269807577133, -0.6628074049949646, 0.28002867102622986, 0.0652533769607544, -0.07369038462638855, 0.05094379186630249, -0.029616892337799072, -0.008635953068733215, -0.30411455035209656, -0.00215360289439559, -0.4382818043231964, -0.2168949395418167, -0.1808832287788391, -0.28365954756736755, 0.06843509525060654, -0.233843594789505, 0.17253901064395905, 0.09277638792991638, -0.17077679932117462, -0.14519715309143066, -0.06997746229171753, -0.04275158792734146, -0.3035752773284912, -0.2684684693813324, 0.11163272708654404, 0.4133675694465637, -0.2662930488586426, -0.19269168376922607, 0.08904934674501419, 0.006442457437515259, 0.23958121240139008, 0.08864283561706543, 0.09613583981990814, 0.7200042605400085, 0.36966121196746826, -0.18670643866062164, -0.08271200954914093, 0.2043791264295578, 0.08498018980026245, -0.1013350859284401, 0.30956223607063293, 0.19926652312278748, 0.17723266780376434, 0.34535670280456543, 0.11968459188938141, -0.1244664266705513, 0.037458837032318115, 0.03806012123823166, -0.008947744965553284, -0.08347967267036438, 0.18735921382904053, -0.17643412947654724, -0.1684231460094452, 0.14056681096553802, 0.19802354276180267, -0.07277745753526688, 0.170026496052742, 0.2323683798313141, 0.06273786723613739, 0.19450870156288147, -0.19005322456359863, 0.020061571151018143, 0.14878025650978088, 0.3155462145805359, 0.3503624498844147, 0.09807030856609344, -0.23355361819267273, -0.06835883110761642, -0.5775803327560425, 0.2545947730541229, -0.01822507008910179, -0.38001543283462524, -0.0322347916662693, -0.1324879229068756, -0.33680033683776855, 0.10613558441400528, 0.1619228571653366, -0.10909657180309296, 0.055557720363140106, 0.26689612865448, -0.15676052868366241, -0.2936110198497772, 0.3894385099411011, -0.037768736481666565, -0.07810088247060776, -0.6786629557609558, 0.03660116717219353, -0.0887598916888237, 0.032007575035095215, -0.1506992131471634, -0.16663861274719238, 0.03414980322122574, -0.02607390284538269, 0.5437766909599304, 0.264413058757782, 0.45556026697158813, 0.007838010787963867, 0.09181289374828339, -0.5622057914733887, -0.06879816204309464, -0.14528967440128326, -0.03369449824094772, -0.07782617211341858, 0.2713480293750763, -0.22750447690486908, 0.04143668711185455, -0.12419246137142181, 0.16709394752979279, 0.2662990093231201, 0.37954163551330566, -0.005456537939608097, 0.22790490090847015, 0.1809433102607727, 0.1571902483701706, 0.34784379601478577, 0.06997198611497879, -0.0961792916059494, 0.44603681564331055, -0.24093373119831085, -0.3420475125312805, 0.21094875037670135, -0.3941512107849121, -0.3340471684932709, -0.019207322970032692, 0.32515743374824524, -0.2549188733100891, -0.15313325822353363, -0.23796388506889343, 0.20610827207565308, 0.24783992767333984, -0.14348027110099792, -0.3868972957134247, 0.14134538173675537, -0.15703505277633667, 0.14029169082641602, -0.022751886397600174, 0.03422359377145767, 0.01013527624309063, -0.22539043426513672, 0.17086787521839142, -0.2374371886253357 ]
https://github.com/huggingface/datasets/issues/2934
to_tf_dataset keeps a reference to the open data somewhere, causing issues on windows
I did some investigation and, as it seems, the bug stems from [this line](https://github.com/huggingface/datasets/blob/8004d7c3e1d74b29c3e5b0d1660331cd26758363/src/datasets/arrow_dataset.py#L325). The lifecycle of the dataset from the linked line is bound to one of the returned `tf.data.Dataset`. So my (hacky) solution involves wrapping the linked dataset with `weakref.proxy` and adding a custom `__del__` to `tf.python.data.ops.dataset_ops.TensorSliceDataset` (this is the type of a dataset that is returned by `tf.data.Dataset.from_tensor_slices`; this works for TF 2.x, but I'm not sure `tf.python.data.ops.dataset_ops` is a valid path for TF 1.x) that deletes the linked dataset, which is assigned to the dataset object as a property. Will open a draft PR soon!
To reproduce: ```python import datasets as ds import weakref import gc d = ds.load_dataset("mnist", split="train") ref = weakref.ref(d._data.table) tfd = d.to_tf_dataset("image", batch_size=1, shuffle=False, label_cols="label") del tfd, d gc.collect() assert ref() is None, "Error: there is at least one reference left" ``` This causes issues because the table holds a reference to an open arrow file that should be closed. So on windows it's not possible to delete or move the arrow file afterwards. Moreover the CI test of the `to_tf_dataset` method isn't able to clean up the temporary arrow files because of this. cc @Rocketknight1
99
to_tf_dataset keeps a reference to the open data somewhere, causing issues on windows To reproduce: ```python import datasets as ds import weakref import gc d = ds.load_dataset("mnist", split="train") ref = weakref.ref(d._data.table) tfd = d.to_tf_dataset("image", batch_size=1, shuffle=False, label_cols="label") del tfd, d gc.collect() assert ref() is None, "Error: there is at least one reference left" ``` This causes issues because the table holds a reference to an open arrow file that should be closed. So on windows it's not possible to delete or move the arrow file afterwards. Moreover the CI test of the `to_tf_dataset` method isn't able to clean up the temporary arrow files because of this. cc @Rocketknight1 I did some investigation and, as it seems, the bug stems from [this line](https://github.com/huggingface/datasets/blob/8004d7c3e1d74b29c3e5b0d1660331cd26758363/src/datasets/arrow_dataset.py#L325). The lifecycle of the dataset from the linked line is bound to one of the returned `tf.data.Dataset`. So my (hacky) solution involves wrapping the linked dataset with `weakref.proxy` and adding a custom `__del__` to `tf.python.data.ops.dataset_ops.TensorSliceDataset` (this is the type of a dataset that is returned by `tf.data.Dataset.from_tensor_slices`; this works for TF 2.x, but I'm not sure `tf.python.data.ops.dataset_ops` is a valid path for TF 1.x) that deletes the linked dataset, which is assigned to the dataset object as a property. Will open a draft PR soon!
[ 0.04569091275334358, 0.33450809121131897, 0.11488884687423706, 0.08045078068971634, 0.23043057322502136, 0.11888771504163742, 0.39888474345207214, 0.2548753619194031, -0.10991697013378143, 0.26743873953819275, -0.33538541197776794, 0.404072105884552, -0.16448120772838593, -0.10746286064386368, -0.034266743808984756, -0.10664322972297668, 0.05111084505915642, 0.14516469836235046, -0.16666406393051147, -0.12261222302913666, -0.21033620834350586, 0.035191044211387634, -0.12747600674629211, 0.07211571931838989, -0.13876262307167053, -0.2811448276042938, 0.010589012876152992, 0.10064372420310974, 0.2441076934337616, -0.018354909494519234, 0.06827910989522934, 0.021176373586058617, -0.17779593169689178, 0.47976216673851013, -0.00011666517821140587, 0.4142075181007385, -0.006127938628196716, 0.13015389442443848, -0.23558080196380615, 0.05651111900806427, -0.06903126835823059, 0.1760491281747818, 0.12455835938453674, -0.05997278913855553, 0.1349683701992035, -0.2177765816450119, -0.025572320446372032, 0.08327388763427734, 0.28249549865722656, 0.4290580451488495, 0.1738770455121994, 0.6678112745285034, 0.04905002936720848, -0.007073943503201008, 0.38278406858444214, 0.06389688700437546, -0.27425888180732727, 0.11617027223110199, -0.23700964450836182, -0.19351458549499512, 0.06556056439876556, 0.5781881809234619, 0.01738264225423336, -0.07479862868785858, -0.13468679785728455, 0.07937807589769363, -0.24748528003692627, -0.21320953965187073, 0.0991555005311966, 0.3864622414112091, 0.2942145764827728, -0.31772905588150024, -0.07044260948896408, -0.12868431210517883, -0.06478443741798401, -0.14543485641479492, 0.19134777784347534, -0.046207495033741, 0.017387021332979202, 0.13484977185726166, 0.058215610682964325, -0.16226662695407867, -0.26150667667388916, -0.006172671914100647, -0.28108882904052734, -0.10722003877162933, 0.08574391156435013, 0.08013837784528732, 0.41410642862319946, -0.027151700109243393, -0.06863794475793839, 0.04162919521331787, 0.02016398310661316, 0.13079199194908142, -0.2023015171289444, -0.18202057480812073, -0.039258576929569244, -0.17703071236610413, -0.028179090470075607, -0.0708622857928276, 0.2392520308494568, -0.15704429149627686, -0.2443448305130005, 0.06773989647626877, 0.16441954672336578, -0.07058902084827423, -0.665533185005188, 0.14519964158535004, 0.26805055141448975, -0.19333405792713165, -0.1119193434715271, -0.028671152889728546, 0.002709748223423958, -0.4981432259082794, 0.2861165702342987, -0.21079224348068237, 0.4638057351112366, 0.01741347834467888, -0.5834482312202454, 0.17033573985099792, -0.19436052441596985, 0.40779322385787964, -0.03926629573106766, 0.3421227037906647, -0.009724577888846397, 0.27936896681785583, 0.3236464858055115, -0.0036116279661655426, -0.49707040190696716, -0.01620139181613922, -0.054667770862579346, -0.03966280445456505, -0.29956015944480896, -0.3319229185581207, 0.1675925999879837, 0.04395352303981781, -0.047849543392658234, 0.17280694842338562, 0.061083175241947174, 0.10257735848426819, 0.2539457380771637, -0.2808152735233307, 0.5246316194534302, 0.48127245903015137, -0.07509812712669373, 0.24509482085704803, 0.09495814144611359, -0.2507020831108093, -0.12922228872776031, 0.35341718792915344, -0.2710707187652588, -0.15856517851352692, -0.260364830493927, 0.12456443160772324, -0.12023279815912247, -0.15524698793888092, -0.22380220890045166, 0.04500439763069153, 0.03431270271539688, -0.059547074139118195, 0.08629190921783447, -0.13709203898906708, -0.5523480176925659, -0.26465556025505066, 0.010904205963015556, 0.36509132385253906, -0.1991523802280426, 0.17955131828784943, -0.02543901838362217, -0.3931907117366791, -0.15941154956817627, 0.2656008005142212, 0.06460478156805038, 0.31538262963294983, -0.4097914397716522, -0.1304863840341568, 0.4838196933269501, -0.23206807672977448, -0.4512844383716583, 0.23500604927539825, -0.20899447798728943, 0.21425212919712067, -0.35181745886802673, 0.13031689822673798, 0.2125169187784195, -0.20666594803333282, 0.012362539768218994, -0.0070453546941280365, -0.062310174107551575, -0.009127501398324966, -0.32360926270484924, -0.010815131478011608, -0.06801870465278625, -0.19527077674865723, -0.015727553516626358, -0.012415915727615356, 0.1318649798631668, -0.04939570277929306, 0.3902636468410492, 0.21969206631183624, 0.19332611560821533, 0.14174821972846985, 0.37566038966178894, -0.17291364073753357, -0.079088494181633, 0.043289028108119965, -0.3775178790092468, 0.1395241916179657, 0.40567952394485474, 0.07770325243473053, -0.12490467727184296, -0.14793606102466583, -0.014969429932534695, 0.19853711128234863, -0.19194944202899933, 0.02008064091205597, 0.0784439817070961, -0.11942513287067413, -0.3427841365337372, 0.20975680649280548, -0.008773796260356903, -0.17803479731082916, -0.2768910527229309, 0.08200880885124207, 0.10280264914035797, 0.46872466802597046, 0.26876410841941833, -0.00557342916727066, -0.24481326341629028, 0.19433823227882385, -0.14946511387825012, -0.03006243146955967, -0.2719019055366516, 0.42693981528282166, 0.17477180063724518, 0.3178131580352783, -0.15419745445251465, 0.5814440250396729, 0.10668488591909409, -0.598135232925415, -0.2948668301105499, 0.34568044543266296, 0.1319475620985031, -0.02862359955906868, -0.017955318093299866, 0.14569851756095886, -0.20072215795516968, 0.17132486402988434, 0.05376896262168884, 0.23926407098770142, 0.040827326476573944, 0.021464046090841293, -0.036397356539964676, -0.34101611375808716, -0.04838133975863457, 0.3614160418510437, -0.31462952494621277, 0.2986149191856384, -0.6084030866622925, 0.1965302675962448, 0.3866645097732544, 0.031106866896152496, -0.16892504692077637, 0.23583051562309265, -0.16949433088302612, 0.06172947585582733, 0.07153793424367905, 0.3181353509426117, 0.4760545492172241, 0.022362101823091507, 0.17279061675071716, 0.13679835200309753, -0.19373972713947296, -0.09025230258703232, 0.23736393451690674, 0.08871345221996307, 0.31243228912353516, 0.20392057299613953, 0.25704532861709595, 0.1931038200855255, -0.30240359902381897, 0.0330183319747448, 0.1302039474248886, 0.1728961020708084, -0.45257866382598877, 0.17472194135189056, -0.18073856830596924, -0.03884640708565712, -0.30748918652534485, 0.011746367439627647, 0.03772164508700371, -0.13480018079280853, 0.31545984745025635, 0.39676523208618164, -0.4561232924461365, 0.1539228856563568, -0.32894155383110046, 0.1290331482887268, 0.022768734022974968, -0.29593196511268616, 0.1803022176027298, -0.16917873919010162, -0.27148371934890747, 0.03444269672036171, 0.36438629031181335, -0.24427784979343414, 0.4180337190628052, -0.0013578012585639954, -0.07474957406520844, -0.15285301208496094, -0.2631630301475525, 0.08977950364351273, -0.09495364129543304, 0.19322770833969116, 0.2937163710594177, 0.3368105888366699, -0.12326715141534805, -0.1301765888929367, 0.14623402059078217, -0.4851281940937042, -0.17861314117908478, 0.1372673064470291, -0.12271749973297119, 0.20901139080524445, 0.020397618412971497, -0.1520882546901703, 0.0741766095161438, -0.3432301878929138, 0.0670824944972992, -0.19137974083423615, 0.1277279257774353, 0.6203324794769287, 0.15204112231731415, -0.08000171929597855, 0.37897157669067383, 0.10767961293458939, -0.17360016703605652, -0.112734854221344, 0.20091381669044495, -0.2037230283021927, -0.42963358759880066, 0.2909044623374939, 0.03388889878988266, 0.13257957994937897, 0.29555845260620117, -0.643415629863739, -0.16894201934337616, -0.04373551160097122, 0.17766393721103668, -0.10888707637786865, -0.04700721055269241, 0.16657420992851257, 0.11643660068511963, -0.11971449851989746, -0.3432471752166748, 0.08278638124465942, 0.38212600350379944, -0.22708046436309814, -0.04858016222715378, 0.04227038472890854, 0.08824500441551208, 0.313571035861969, 0.6243578791618347, 0.05083232745528221, -0.34294384717941284, 0.020803332328796387, -0.29825201630592346, 0.5073609352111816, -0.15909045934677124, -0.2795751392841339, 0.015800777822732925, 0.042031556367874146, -0.1327364444732666, 0.24627339839935303, -0.07957753539085388, -0.21037936210632324, 0.057862281799316406, 0.21673306822776794, -0.037592098116874695, -0.529026210308075, 0.13690219819545746, -0.3965076208114624, 0.19836536049842834, 0.15099841356277466, -0.04255449026823044, -0.15817756950855255, -0.4451107382774353, 0.22895997762680054, 0.20402085781097412, 0.0930260643362999, -0.13661667704582214, -0.19878919422626495, -0.28238770365715027, -0.34255361557006836, 0.06804727017879486, 0.1306474208831787, 0.5035334229469299, 0.09213568270206451, -0.29871976375579834, 0.13605041801929474, 0.2798965871334076, 0.7769172787666321, -0.030115926638245583, -0.09927551448345184, 0.27733275294303894, 0.32240942120552063, -0.40419527888298035, 0.055564235895872116, -0.1050163209438324, -0.004629011265933514, 0.028162997215986252, 0.24169453978538513, 0.07723573595285416, -0.3887940049171448, 0.21294985711574554, 0.1766907423734665, -0.24771830439567566, 0.21103942394256592, -0.3918555676937103, -0.3986020088195801, 0.10136803984642029, 0.08784640580415726, 0.26049429178237915, 0.04975630342960358, -0.10872016102075577, -0.11151237785816193, -0.30123621225357056, -0.24823349714279175, 0.088144451379776, -0.015627244487404823, 0.32837116718292236, 0.3708721697330475, 0.39753368496894836, 0.05334097892045975, 0.5702847242355347, 0.39387014508247375, 0.4075010418891907, -0.5431134700775146, 0.02142823487520218, 0.0755058228969574, 0.1911335289478302, 0.1251918524503708, 0.44203999638557434, -0.186685711145401, 0.05314148962497711, -0.4151878356933594, 0.00027870386838912964, -0.39237263798713684, 0.5302589535713196, 0.13951118290424347, -0.2031344473361969, -0.0013099376810714602, -0.09223035722970963, 0.1333690881729126, -0.010362004861235619, -0.1489020138978958, 0.6897456645965576, 0.21658262610435486, -0.18774855136871338, 0.2651527523994446, 0.15821367502212524, 1.108040690422058, -0.09356825053691864, 0.233468696475029, 0.5235845446586609, -0.2643696069717407, 0.21265478432178497, -0.05538104847073555, 0.13531342148780823, -0.06322561949491501, -0.5360183715820312, 0.020139118656516075, -0.012507438659667969, -0.3608242869377136, -0.20056097209453583, 0.18932731449604034, 0.002370328875258565, 0.15720660984516144, 0.41068515181541443, 0.2291460931301117, 0.07762355357408524, 0.2959440350532532, -0.2186192274093628, 0.03965690732002258, 0.022471971809864044, 0.4466593265533447, -0.12662078440189362, -0.20260676741600037, -0.12232260406017303, 0.1659471094608307, 0.02712331712245941, -0.03446449339389801, -0.009640762582421303, -0.7225636839866638, 0.2756161689758301, 0.042248278856277466, -0.09043893963098526, -0.024059634655714035, 0.4012314975261688, 0.3712238073348999, -0.09887667000293732, -0.15234796702861786, 0.2883426249027252, 0.37736281752586365, 0.29301220178604126, 0.09380728751420975, -0.016786083579063416, 0.47509533166885376, 0.03830251842737198, -0.08036329597234726, 0.16763311624526978, -0.05447190999984741, -0.05252298712730408, -0.0370945930480957, -0.12258225679397583, 0.038293808698654175, -0.12055636942386627, 0.044584911316633224, -0.09958483278751373, -0.24590615928173065, -0.05795760080218315, 0.10357736051082611, -0.18048729002475739, -0.10702674835920334, 0.2344726026058197, -0.1927337348461151, -0.4316692352294922, 0.23925679922103882, 0.392255038022995, -0.12051267176866531, 0.17103469371795654, 0.3036816120147705, -0.07610469311475754, -0.07312783598899841, -0.25623849034309387, 0.3445349633693695, 0.037831105291843414, -0.5670924186706543, 0.2645982801914215, -0.1810760647058487, 0.3202282786369324, -0.10798824578523636, 0.5147186517715454, -0.1970299929380417, 0.020940810441970825, 0.02216007187962532, -0.13972258567810059, -0.39777132868766785, 0.23617428541183472, 0.0018205493688583374, 0.41241106390953064, -0.25371965765953064, 0.47479915618896484, -0.1287533938884735, -0.2527931034564972, -0.29979798197746277, 0.23436778783798218, -0.02811378799378872, 0.07879044115543365, -0.10588613152503967, 0.057650741189718246, 0.31811216473579407, -0.27795130014419556, 0.05769594758749008, 0.10732140392065048, -0.13811145722866058, -0.1384906768798828, -0.1637141853570938, 0.16327738761901855, 0.02801835909485817, -0.3234007954597473, -0.012980293482542038, -0.17387190461158752, 0.07629167288541794, -0.11138048022985458, 0.32819393277168274, 0.0700531005859375, -0.3296964764595032, 0.027098264545202255, -0.2136467844247818, 0.130941241979599, 0.13924726843833923, 0.007743792608380318, -0.030592113733291626, 0.375868558883667, 0.0896957516670227, 0.09814845025539398, -0.23660925030708313, -0.23252591490745544, -0.030385572463274002, 0.28426679968833923, -0.035638436675071716, -0.3600647449493408, 0.03771302103996277, -0.05584809184074402, -0.2938880920410156, -0.059905678033828735, 0.37663009762763977, 0.17997583746910095, -0.46346205472946167, -0.13622383773326874, 0.2592976689338684, 0.2242169976234436, -0.24042129516601562, 0.1624511033296585, -0.12176789343357086, 0.01986423134803772, 0.03851180151104927, 0.16629675030708313, 0.18402716517448425, -0.14655499160289764, -0.14287789165973663, 0.17723140120506287, -0.20080380141735077, -0.2036251276731491, 0.03101579286158085, 0.5156294107437134, -0.03253573179244995, 0.23732323944568634, -0.14765414595603943, 0.10366404056549072, 0.12641704082489014, 0.24815714359283447, -0.07817850261926651, 0.4826434254646301, 0.1981104016304016, -0.06543824076652527, -0.035468630492687225, -0.31345248222351074, -0.055521946400403976, 0.16418983042240143, -0.12381692230701447, 0.2421867549419403, -0.036149539053440094, 0.22170934081077576, 0.15493150055408478, -0.42458274960517883, -0.011748663149774075, 0.23249214887619019, -0.08597962558269501, -0.36718806624412537, -0.3900309205055237, -0.2080552875995636, -0.2723347544670105, 0.031124424189329147, -0.005528002977371216, -0.08657369017601013, 0.009404018521308899, 0.10601401329040527, -0.0662820041179657, -0.2825775444507599, -0.11982198804616928, 0.33307743072509766, 0.27780672907829285, -0.23256690800189972, 0.06561250239610672, -0.024809449911117554, -0.06567810475826263, -0.002108149230480194, 0.20820125937461853, 0.08352842926979065, 0.02842116355895996, -0.1759398728609085, 0.011499634012579918, -0.034653857350349426, 0.09226401150226593, -0.04009262099862099, 0.21443825960159302, -0.0489172488451004, -0.14051979780197144, 0.21579736471176147, -0.04918338358402252, -0.07002514600753784, 0.1828448325395584, 0.0519716702401638, 0.09766735136508942, -0.4182259440422058, 0.1498894840478897, -0.0033790841698646545, -0.10168062895536423, -0.22876274585723877, -0.005118072032928467, 0.05086731165647507, -0.10867945849895477, 0.4808010160923004, -0.46020615100860596, 0.36447763442993164, -0.0873914286494255, 0.06821879744529724, -0.009531565010547638, 0.22197917103767395, 0.1271093189716339, 0.32923954725265503, -0.2891249358654022, -0.38428181409835815, -0.5309659242630005, 0.2625989317893982, -0.04950709268450737, -0.050644904375076294, 0.21181802451610565, 0.031771980226039886, -0.08889832347631454, -0.06646036356687546, 0.027404867112636566, -0.18654654920101166, 0.1133226677775383, 0.26725444197654724, -0.2658277153968811, -0.03609580919146538, -0.4830036759376526, 0.09843241423368454, 0.01990320533514023, -0.5478612780570984, -0.18008144199848175, -0.17627058923244476, 0.03750992566347122, -0.08184562623500824, -0.02155182510614395, -0.016611091792583466, 0.5460248589515686, 0.5247315764427185, 0.1254572868347168, 0.0754961296916008, 0.11956692487001419, -0.10256167501211166, -0.26742348074913025, -0.17949940264225006, -0.3766336143016815, -0.18374714255332947, 0.007053684443235397, -0.023796476423740387, -0.05294401943683624, 0.197137713432312, 0.013704868964850903, -0.297771155834198, 0.1801946759223938, 0.36539727449417114, -0.4400824308395386, 0.19560566544532776, -0.20590335130691528, 0.3725324869155884, 0.26284584403038025, 0.42349305748939514, -0.12966090440750122, 0.21667805314064026, -0.39988505840301514, -0.3820689618587494, 0.4928815960884094, -0.5328620672225952, -0.09300661087036133, -0.02459760382771492, 0.38428592681884766, -0.09380287677049637, 0.036287061870098114, -0.5819957852363586, -0.17655569314956665, 0.38981595635414124, -0.083492711186409, -0.5030673742294312, 0.17061176896095276, 0.13014693558216095, 0.13843460381031036, 0.1181672215461731, 0.5913182497024536, 0.1401757448911667, -0.19336341321468353, 0.03649751469492912, -0.28621381521224976 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
Hi, the filename here is less than 255 ```python >>> len("_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock") 154 ``` so not sure why it's considered too long for your filesystem. (also note that the lock files we use always have smaller filenames than 255) https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
39
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 Hi, the filename here is less than 255 ```python >>> len("_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock") 154 ``` so not sure why it's considered too long for your filesystem. (also note that the lock files we use always have smaller filenames than 255) https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
Yes, you're right! I need to get you more info here. Either there's something going with the name itself that the file system doesn't like (an encoding that blows up the name length??) or perhaps there's something with the path that's causing the entire string to be used as a name. I haven't seen this on any system before and the Internet's not forthcoming with any info.
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
67
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 Yes, you're right! I need to get you more info here. Either there's something going with the name itself that the file system doesn't like (an encoding that blows up the name length??) or perhaps there's something with the path that's causing the entire string to be used as a name. I haven't seen this on any system before and the Internet's not forthcoming with any info.
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
Snap, encountered when trying to run [this example from PyTorch Lightning Flash](https://lightning-flash.readthedocs.io/en/latest/reference/speech_recognition.html): ```py import torch import flash from flash.audio import SpeechRecognition, SpeechRecognitionData from flash.core.data.utils import download_data # 1. Create the DataModule download_data("https://pl-flash-data.s3.amazonaws.com/timit_data.zip", "./data") datamodule = SpeechRecognitionData.from_json( input_fields="file", target_fields="text", train_file="data/timit/train.json", test_file="data/timit/test.json", ) ``` Gave this traceback: ```py Traceback (most recent call last): File "lf_ft.py", line 10, in <module> datamodule = SpeechRecognitionData.from_json( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 1005, in from_json return cls.from_data_source( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 571, in from_data_source train_dataset, val_dataset, test_dataset, predict_dataset = data_source.to_datasets( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 307, in to_datasets train_dataset = self.generate_dataset(train_data, RunningStage.TRAINING) File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 344, in generate_dataset data = load_data(data, mock_dataset) File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/audio/speech_recognition/data.py", line 103, in load_data dataset_dict = load_dataset(self.filetype, data_files={stage: str(file)}) File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1599, in load_dataset builder_instance = load_dataset_builder( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1457, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/builder.py", line 285, in __init__ with FileLock(lock_path): File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '/home/louis/.cache/huggingface/datasets/_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock' ``` My home directory is encrypted, therefore the maximum length is 143 ([source 1](https://github.com/ray-project/ray/issues/1463#issuecomment-425674521), [source 2](https://stackoverflow.com/a/6571568/2668831)) From what I've read I think the error is in reference to the file name (just the final part of the path) which is 145 chars long: ```py >>> len("_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock") 145 ``` I also have a file in this directory (i.e. whose length is not a problem): ```py >>> len("_home_louis_.cache_huggingface_datasets_librispeech_asr_clean_2.1.0_468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1.lock") 137 ```
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
238
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 Snap, encountered when trying to run [this example from PyTorch Lightning Flash](https://lightning-flash.readthedocs.io/en/latest/reference/speech_recognition.html): ```py import torch import flash from flash.audio import SpeechRecognition, SpeechRecognitionData from flash.core.data.utils import download_data # 1. Create the DataModule download_data("https://pl-flash-data.s3.amazonaws.com/timit_data.zip", "./data") datamodule = SpeechRecognitionData.from_json( input_fields="file", target_fields="text", train_file="data/timit/train.json", test_file="data/timit/test.json", ) ``` Gave this traceback: ```py Traceback (most recent call last): File "lf_ft.py", line 10, in <module> datamodule = SpeechRecognitionData.from_json( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 1005, in from_json return cls.from_data_source( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_module.py", line 571, in from_data_source train_dataset, val_dataset, test_dataset, predict_dataset = data_source.to_datasets( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 307, in to_datasets train_dataset = self.generate_dataset(train_data, RunningStage.TRAINING) File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/core/data/data_source.py", line 344, in generate_dataset data = load_data(data, mock_dataset) File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/flash/audio/speech_recognition/data.py", line 103, in load_data dataset_dict = load_dataset(self.filetype, data_files={stage: str(file)}) File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1599, in load_dataset builder_instance = load_dataset_builder( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/load.py", line 1457, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/builder.py", line 285, in __init__ with FileLock(lock_path): File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "/home/louis/miniconda3/envs/w2vlf/lib/python3.8/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '/home/louis/.cache/huggingface/datasets/_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock' ``` My home directory is encrypted, therefore the maximum length is 143 ([source 1](https://github.com/ray-project/ray/issues/1463#issuecomment-425674521), [source 2](https://stackoverflow.com/a/6571568/2668831)) From what I've read I think the error is in reference to the file name (just the final part of the path) which is 145 chars long: ```py >>> len("_home_louis_.cache_huggingface_datasets_json_default-98e6813a547f72fa_0.0.0_c2d554c3377ea79c7664b93dc65d0803b45e3279000f993c7bfd18937fd7f426.lock") 145 ``` I also have a file in this directory (i.e. whose length is not a problem): ```py >>> len("_home_louis_.cache_huggingface_datasets_librispeech_asr_clean_2.1.0_468ec03677f46a8714ac6b5b64dba02d246a228d92cbbad7f3dc190fa039eab1.lock") 137 ```
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
Perhaps this could be exposed as a config setting so you could change it manually? https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135 Rather than hard-code 255, default it to 255, and allow it to be changed, the same way is done for `datasets.config.IN_MEMORY_MAX_SIZE`: https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L171-L173 In fact there already appears to be an existing variable to do so: https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L187 It's used here: https://github.com/huggingface/datasets/blob/efe89edd36e4ffa562fc3eebaf07a5fec26e6dac/src/datasets/builder.py#L163-L165 Perhaps it could be set based on a test (trying to create a 255 char length named lock file and seeing if it fails)
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
80
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 Perhaps this could be exposed as a config setting so you could change it manually? https://github.com/huggingface/datasets/blob/5d1a9f1e3c6c495dc0610b459e39d2eb8893f152/src/datasets/utils/filelock.py#L135-L135 Rather than hard-code 255, default it to 255, and allow it to be changed, the same way is done for `datasets.config.IN_MEMORY_MAX_SIZE`: https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L171-L173 In fact there already appears to be an existing variable to do so: https://github.com/huggingface/datasets/blob/12b7e13bc568b9f92705f64b249e148f3bc9a9ea/src/datasets/config.py#L187 It's used here: https://github.com/huggingface/datasets/blob/efe89edd36e4ffa562fc3eebaf07a5fec26e6dac/src/datasets/builder.py#L163-L165 Perhaps it could be set based on a test (trying to create a 255 char length named lock file and seeing if it fails)
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
Hi @lmmx @gar1t , it would be helpful if you could run the following code and copy-paste the output here: ```python import datasets import os os.statvfs(datasets.config.HF_DATASETS_CACHE) ```
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
27
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 Hi @lmmx @gar1t , it would be helpful if you could run the following code and copy-paste the output here: ```python import datasets import os os.statvfs(datasets.config.HF_DATASETS_CACHE) ```
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
Hi @lmmx, Thanks for providing the result of the command. I've opened a PR, and it would be great if you could verify that the fix works on your system. To install the version of the datasets with the fix, please run the following command: ``` pip install git+https://github.com/huggingface/datasets.git@fix-2924 ``` Btw, I saw your PR, and I appreciate your effort. However, my approach is a bit simpler for the end-user, so that's why I decided to fix the issue myself.
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
80
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 Hi @lmmx, Thanks for providing the result of the command. I've opened a PR, and it would be great if you could verify that the fix works on your system. To install the version of the datasets with the fix, please run the following command: ``` pip install git+https://github.com/huggingface/datasets.git@fix-2924 ``` Btw, I saw your PR, and I appreciate your effort. However, my approach is a bit simpler for the end-user, so that's why I decided to fix the issue myself.
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
No problem Mario I didn't know that was where that value was recorded so I learnt something :smiley: I just wanted to get a local version working, of course you should implement whatever fix is best for HF. Yes can confirm this fixes it too. Thanks!
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
46
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 No problem Mario I didn't know that was where that value was recorded so I learnt something :smiley: I just wanted to get a local version working, of course you should implement whatever fix is best for HF. Yes can confirm this fixes it too. Thanks!
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2924
"File name too long" error for file locks
It looks like the issue is back with #6445 since the `MAX_FILENAME_LENGTH` is explicitly set to be 255 there https://github.com/huggingface/datasets/blob/dd9044cdaabc1f9abce02c1b71bdb48fd3525d4e/src/datasets/utils/_filelock.py#L28 @mariosasko Could you please take a look
## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0
27
"File name too long" error for file locks ## Describe the bug Getting the following error when calling `load_dataset("gar1t/test")`: ``` OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Steps to reproduce the bug Where the user cache dir (e.g. `~/.cache`) is on a file system that limits filenames to 255 chars (e.g. ext4): ```python from datasets import load_dataset load_dataset("gar1t/test") ``` ## Expected results Expect the function to return without an error. ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<python_venv>/lib/python3.9/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 644, in download_and_prepare self._save_info() File "<python_venv>/lib/python3.9/site-packages/datasets/builder.py", line 765, in _save_info with FileLock(lock_path): File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 323, in __enter__ self.acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 272, in acquire self._acquire() File "<python_venv>/lib/python3.9/site-packages/datasets/utils/filelock.py", line 403, in _acquire fd = os.open(self._lock_file, open_mode) OSError: [Errno 36] File name too long: '<user>/.cache/huggingface/datasets/_home_garrett_.cache_huggingface_datasets_csv_test-7c856aea083a7043_0.0.0_9144e0a4e8435090117cea53e6c7537173ef2304525df4a077c435d8ee7828ff.incomplete.lock' ``` ## Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.11.0-27-generic-x86_64-with-glibc2.31 - Python version: 3.9.7 - PyArrow version: 5.0.0 It looks like the issue is back with #6445 since the `MAX_FILENAME_LENGTH` is explicitly set to be 255 there https://github.com/huggingface/datasets/blob/dd9044cdaabc1f9abce02c1b71bdb48fd3525d4e/src/datasets/utils/_filelock.py#L28 @mariosasko Could you please take a look
[ 0.04933904483914375, 0.09200125932693481, -0.07149413228034973, 0.4018481969833374, 0.41516780853271484, 0.23589468002319336, 0.6366618275642395, 0.24350309371948242, 0.23645830154418945, 0.23132917284965515, 0.018569104373455048, 0.007743639871478081, -0.14426860213279724, -0.31003689765930176, -0.20153586566448212, -0.24431443214416504, -0.1581088900566101, -0.041621580719947815, -0.17707842588424683, 0.21771849691867828, -0.1549791395664215, 0.3787364065647125, 0.024638168513774872, 0.15708395838737488, -0.5360065698623657, 0.09007877856492996, -0.1295965015888214, 0.38867470622062683, -0.021506914868950844, -0.3729912042617798, 0.051118604838848114, -0.04671696946024895, 0.06881445646286011, 0.8113580346107483, -0.00012206860992591828, -0.33344167470932007, 0.3542340397834778, -0.05629929155111313, -0.32718929648399353, -0.2243082970380783, -0.16858163475990295, -0.5117114186286926, -0.03458486497402191, -0.4988025426864624, 0.1872130036354065, -0.09511879086494446, -0.03319013863801956, -0.8021565675735474, 0.04105231165885925, 0.3733058571815491, 0.12687458097934723, -0.07834723591804504, 0.09102435410022736, -0.2579200267791748, 0.33231157064437866, -0.27798891067504883, 0.004084503278136253, 0.35640254616737366, 0.3556978106498718, -0.09886779636144638, -0.15465164184570312, 0.20321786403656006, -0.03689756244421005, 0.027325008064508438, 0.24715840816497803, 0.07953760027885437, -0.08748296648263931, -0.32616478204727173, 0.29580560326576233, 0.42739439010620117, 0.4714377224445343, -0.09306206554174423, -0.2793126702308655, -0.4676971435546875, 0.14249782264232635, -0.1251053661108017, 0.4885309934616089, -0.07624023407697678, -0.22207452356815338, 0.15148843824863434, -0.17041966319084167, -0.019620724022388458, -0.12359730899333954, -0.11023858189582825, -0.10197585821151733, 0.06506168842315674, 0.04050839692354202, 0.0362793430685997, 0.3111128807067871, -0.34831488132476807, 0.23959575593471527, 0.004836319014430046, 0.07427383214235306, 0.26946038007736206, -0.6542130708694458, 0.14691245555877686, 0.0842684805393219, 0.38549262285232544, 0.2534897029399872, 0.057643480598926544, -0.2659725844860077, -0.14830774068832397, 0.19474855065345764, -0.010466240346431732, -0.06495501101016998, 0.3742065727710724, 0.1944444179534912, 0.16128115355968475, 0.30124256014823914, 0.07794651389122009, -0.3367469310760498, -0.10693477839231491, -0.0764867290854454, -0.553463339805603, 0.4451378285884857, 0.13359114527702332, 0.07416310161352158, -0.3437122106552124, 0.15045784413814545, 0.5705774426460266, 0.10570482164621353, -0.0104905404150486, 0.22870251536369324, 0.27337953448295593, 0.00543534941971302, 0.11076681315898895, 0.08307420462369919, -0.0899365171790123, -0.08896084874868393, 0.1008349284529686, -0.14731237292289734, -0.11073043942451477, -0.227020725607872, 0.11241000145673752, 0.08920550346374512, -0.3083953261375427, 0.2792798578739166, -0.22746478021144867, 0.31524011492729187, -0.12495778501033783, -0.08296892791986465, -0.23774290084838867, -0.06673232465982437, 0.1559666097164154, -0.05910708010196686, 0.07391398400068283, 0.24521313607692719, -0.2607337236404419, -0.1920614093542099, -0.07711150497198105, -0.3397490382194519, -0.2851877212524414, -0.06172148883342743, 0.09470277279615402, -0.16549450159072876, 0.2159019261598587, 0.24155494570732117, -0.26719433069229126, 0.6555527448654175, -0.07981933653354645, 0.01279749721288681, -0.2747654318809509, -0.14180970191955566, 0.0071926424279809, 0.040824636816978455, 0.5534657835960388, 0.13252408802509308, -0.017562344670295715, -0.0687895268201828, 0.12828214466571808, 0.008665516972541809, 0.3722589910030365, 0.18064527213573456, -0.05359659343957901, -0.4219525456428528, 0.31249386072158813, 0.2268712967634201, -0.24028092622756958, -0.4869857430458069, 0.32153889536857605, -0.3943079113960266, 0.09949327260255814, 0.32291126251220703, 0.022883230820298195, 0.05171051621437073, -0.024582460522651672, 0.2853388488292694, 0.18221373856067657, -0.026095794513821602, 0.023495232686400414, -0.20252422988414764, -0.10733041912317276, -0.04063083976507187, 0.16919532418251038, 0.010954629629850388, 0.06700114160776138, 0.07961948215961456, -0.17519164085388184, 0.27156904339790344, 0.03146366775035858, -0.20404423773288727, 0.37368011474609375, 0.13824240863323212, 0.32671862840652466, 0.18608242273330688, -0.10632741451263428, -0.5937504768371582, 0.2637209892272949, -0.12184765934944153, -0.17873169481754303, -0.21759261190891266, -0.186804860830307, -0.17498892545700073, -0.007290197536349297, 0.003460220992565155, 0.1351376473903656, -0.020408565178513527, 0.28324955701828003, 0.1417788863182068, -0.13176371157169342, 0.09344011545181274, 0.5883798003196716, -0.1702440083026886, 0.01759737730026245, -0.47811758518218994, -0.17112673819065094, -0.11785361915826797, -0.11254020035266876, 0.03150726109743118, 0.0016393810510635376, 0.3693966269493103, -0.10896770656108856, -0.34435081481933594, 0.4480755627155304, 0.3332770764827728, 0.09753289073705673, -0.1789245307445526, -0.004430681467056274, -0.05686414986848831, 0.22077563405036926, 0.07267015427350998, 0.03981196880340576, 0.0077852848917245865, 0.014291509985923767, -0.21357595920562744, 0.30001625418663025, -0.14081615209579468, 0.27127689123153687, 0.02861402928829193, 0.16824114322662354, 0.24617862701416016, -0.13181419670581818, 0.06434507668018341, -0.1761225163936615, 0.6458845734596252, -0.21635282039642334, 0.3048403263092041, 0.05478017032146454, 0.045231401920318604, -0.14486277103424072, 0.645819902420044, 0.045392658561468124, -0.00017742067575454712, 0.1977422535419464, 0.1562013179063797, -0.040815506130456924, -0.01937270350754261, 0.30648893117904663, 0.5111445188522339, 0.19205868244171143, -0.030123118311166763, -0.2065057009458542, 0.3941575586795807, -0.22383418679237366, 0.2563185691833496, 0.015908539295196533, -0.0027934068348258734, 0.36570295691490173, 0.049618277698755264, -0.12908774614334106, 0.0514841228723526, -0.8095094561576843, -0.05044229328632355, 0.22369757294654846, -0.3198091685771942, 0.1480822116136551, -0.13932561874389648, -0.04320453107357025, -0.02379957213997841, 0.0004905331879854202, -0.08039876818656921, -0.41628170013427734, -0.18889373540878296, 0.27850618958473206, -0.141836479306221, 0.21453334391117096, -0.11883582174777985, -0.0032404959201812744, 0.2712830603122711, -0.014538807794451714, -0.2950279116630554, -0.001612368505448103, 0.08034414052963257, -0.08376025408506393, 0.272072970867157, -0.5375036001205444, 0.08380360901355743, -0.1256641000509262, -0.0631067156791687, -0.5083526372909546, -0.2498803436756134, 0.11166788637638092, -0.16848105192184448, 0.2935641407966614, 0.341365784406662, 0.20785751938819885, 0.16666218638420105, 0.0588972344994545, 0.0049608550034463406, -0.26227912306785583, 0.023669688031077385, 0.23266363143920898, 0.1779005527496338, -0.022818034514784813, -0.19179947674274445, -0.02345486730337143, -0.34637340903282166, -0.4160328805446625, 0.32078462839126587, 0.03030308708548546, 0.2279280126094818, 0.34118932485580444, -0.07087332010269165, 0.29781296849250793, -0.017972882837057114, 0.2472921460866928, -0.08790676295757294, -0.446370005607605, 0.4170609414577484, -0.1525217592716217, -0.29905885457992554, -0.4318082630634308, 0.29801350831985474, -0.035509731620550156, 0.10551922023296356, -0.4223637580871582, -0.1790710836648941, -0.4012604057788849, 0.3389854431152344, -0.3357197940349579, 0.0054090190678834915, 0.1970205307006836, -0.08520086854696274, -0.05634872615337372, -0.10693833231925964, 0.08490239083766937, 0.23251214623451233, 0.011036349460482597, -0.009520359337329865, 0.09298137575387955, 0.29516640305519104, -0.11607788503170013, 0.4532132148742676, 0.36166563630104065, 0.07534810900688171, 0.19537945091724396, -0.13766925036907196, 0.18435725569725037, -0.259032666683197, -0.12694573402404785, 0.023938069120049477, 0.17447112500667572, -0.2215844839811325, 0.1342053860425949, -0.08539082854986191, 0.014082832261919975, -0.1333201825618744, -0.057791568338871, 0.10780782252550125, -0.29602962732315063, 0.007316752336919308, 0.04858613759279251, 0.05249008536338806, 0.031080547720193863, 0.14569440484046936, -0.19488658010959625, -0.13091057538986206, -0.024088969454169273, 0.3084787130355835, 0.054078906774520874, -0.02335628867149353, -0.2468728870153427, 0.09151093661785126, -0.33714139461517334, 0.4440094232559204, 0.18309174478054047, 0.21379803121089935, -0.06936010718345642, -0.16017484664916992, -0.08004863560199738, 0.046006955206394196, 0.6831167936325073, 0.09912950545549393, 0.31609290838241577, 0.15549586713314056, 0.25470346212387085, -0.12308726459741592, 0.039172444492578506, 0.07955290377140045, 0.37018847465515137, 0.1390410214662552, 0.40793368220329285, -0.23080995678901672, 0.03760886564850807, -0.18331661820411682, 0.18554262816905975, -0.11663281917572021, -0.4492168724536896, -0.02628575637936592, 0.008796494454145432, -0.2636854946613312, 0.1616201102733612, 0.03360526263713837, 0.24422864615917206, 0.061671748757362366, 0.004913344979286194, -0.06017688661813736, -0.07477875053882599, 0.16015586256980896, 0.17483553290367126, 0.2812635600566864, -0.4468778371810913, 0.2643653154373169, -0.027559898793697357, -0.15952979028224945, 0.23041264712810516, 0.563972532749176, -0.44398224353790283, -0.24784249067306519, 0.41447320580482483, -0.35655948519706726, 0.07643907517194748, 0.4287090599536896, -0.3107660412788391, -0.15842434763908386, 0.35820651054382324, 0.6321597695350647, 0.1236557736992836, 0.025781860575079918, 0.03256874531507492, 0.13087408244609833, -0.15302163362503052, -0.3346104919910431, 0.21633118391036987, 0.24309520423412323, -0.01783529669046402, 0.5360287427902222, 0.024251587688922882, -0.3025451600551605, 0.2613932490348816, -0.20595437288284302, 1.0209481716156006, -0.18544873595237732, 0.1871502548456192, -0.01908031478524208, 0.12876740097999573, 0.4992983639240265, 0.009290341287851334, -0.08422491699457169, -0.4268140196800232, -0.482785701751709, 0.14020225405693054, -0.14980435371398926, 0.23977264761924744, -0.03667788952589035, -0.13019980490207672, 0.3139282464981079, -0.2595102787017822, 0.01776156760752201, -0.17453143000602722, 0.45279398560523987, -0.6466596722602844, -0.2542136311531067, -0.2503230571746826, 0.047983407974243164, -0.0439814031124115, 0.11015057563781738, 0.0617118775844574, 0.16868600249290466, -0.3292626738548279, -0.27816712856292725, -0.22720614075660706, 0.037031665444374084, -0.41576331853866577, 0.08352924883365631, -0.24390211701393127, -0.282207727432251, -0.09024207293987274, 0.2852124869823456, -0.03205025941133499, 0.4013366401195526, -0.20359563827514648, 0.09235087037086487, 0.08282200992107391, 0.09687259048223495, 0.0730002373456955, -0.06324439495801926, 0.31769537925720215, 0.01689751446247101, 0.07435362786054611, -0.28570425510406494, 0.0053972722962498665, -0.1422330141067505, 0.032482266426086426, -0.02342720329761505, 0.15041375160217285, -0.23083007335662842, -0.32375624775886536, -0.3392716646194458, -0.20386242866516113, -0.15043550729751587, 0.052160367369651794, 0.3335697054862976, -0.2387237697839737, -0.008876778185367584, -0.28575655817985535, -0.4090471565723419, -0.009664423763751984, 0.3055087924003601, -0.1481093466281891, -0.047204624861478806, 0.43272703886032104, 0.3000046908855438, -0.21020978689193726, -0.1779172420501709, -0.019017096608877182, -0.17999643087387085, -0.6621258854866028, 0.08230819553136826, 0.0360398106276989, -0.04271112382411957, -0.2416069358587265, -0.2668299674987793, 0.2053607702255249, 0.12652993202209473, 0.11139844357967377, -0.4697989821434021, -0.4082913398742676, -0.23299647867679596, -0.2976684868335724, 0.2016148865222931, -0.05662471428513527, -0.3551492989063263, -0.2588418424129486, 0.03277335688471794, -0.21220985054969788, 0.05999365448951721, -0.14237342774868011, -0.061836495995521545, 0.46335071325302124, -0.14185023307800293, 0.22446048259735107, -0.13970378041267395, 0.04635544866323471, 0.40120917558670044, 0.0694132074713707, -0.18165147304534912, -0.3011111617088318, 0.1451774686574936, 0.041162051260471344, 0.058584846556186676, -0.06729105859994888, -0.3786495327949524, -0.05275147780776024, -0.2798324227333069, 0.13260331749916077, 0.3364623486995697, 0.24244534969329834, 0.07561815530061722, 0.09433037042617798, 0.09865330159664154, -0.03252927213907242, 0.33068498969078064, -0.1649502068758011, -0.13839879631996155, 0.009523622691631317, 0.2725929021835327, -0.2107255756855011, 0.1175260841846466, -0.32124823331832886, 0.15366065502166748, -0.009539231657981873, -0.036181770265102386, 0.07528041303157806, -0.02653677761554718, -0.10968144237995148, 0.5564426183700562, 0.23271849751472473, 0.2920384109020233, -0.27229252457618713, -0.23025235533714294, 0.2756310701370239, 0.13391277194023132, 0.016583386808633804, -0.20511576533317566, 0.1073664128780365, -0.12861238420009613, -0.09958530217409134, 0.3734353482723236, -0.07063368707895279, -0.1355883777141571, -0.18993757665157318, -0.1248224675655365, 0.5824741721153259, 0.09355577081441879, -0.06966701149940491, 0.2455470860004425, -0.013626255095005035, 0.0776757150888443, 0.46137022972106934, 0.2502683699131012, 0.016934610903263092, 0.5474851727485657, -0.31308814883232117, 0.02988804504275322, -0.16279378533363342, -0.006218168884515762, -0.2004128098487854, -0.4473772943019867, 0.13166196644306183, 0.31078076362609863, -0.07245664298534393, 0.18736635148525238, -0.14681854844093323, 0.3045750558376312, -0.25019702315330505, 0.18190120160579681, 0.054366983473300934, 0.049220047891139984, -0.10957296937704086, -0.014269668608903885, 0.34951308369636536, -0.025010112673044205, -0.2757629156112671, -0.00466199591755867, -0.11504675447940826, 0.14665576815605164, 0.37960246205329895, 0.27335113286972046, 0.1335938572883606, -0.17536146938800812, 0.004142686724662781, 0.21335801482200623, 0.16631418466567993, -0.48223015666007996, 0.14352257549762726, 0.39095979928970337, -0.08867770433425903, 0.26229578256607056, -0.0017312262207269669, 0.5537606477737427, 0.13979500532150269, 0.09830757975578308, -0.0007231608033180237, -0.1064625084400177, -0.011388315819203854, -0.1354411244392395, 0.4446231424808502, -0.030879303812980652, -0.10251326858997345, 0.3387673795223236, 0.02803504653275013, -0.15769344568252563, 0.11466215550899506, 0.19288426637649536, 0.12371605634689331, -0.17515285313129425, 0.20125794410705566, 0.015890194103121758, -0.2077663242816925, -0.178632453083992, 0.14498046040534973, -0.3786621689796448, -0.16338393092155457, 0.25169089436531067, 0.04038405418395996, 0.26245826482772827, -0.13559399545192719, 0.04898008704185486, -0.11941146850585938, 0.14834386110305786, 0.38399240374565125, 0.2433496117591858, -0.2853369116783142, -0.040562231093645096, -0.6024459004402161, 0.22462791204452515, -0.048773158341646194, -0.17107391357421875, 0.04515988379716873, -0.11297546327114105, -0.04711202532052994, -0.1518048346042633, 0.38789862394332886, -0.015927754342556, 0.11153421550989151, 0.26701241731643677, -0.47526034712791443, -0.22400538623332977, 0.1703018844127655, -0.06630105525255203, 0.22723492980003357, -0.3988766670227051, 0.1303192526102066, -0.266743540763855, -0.013735104352235794, -0.1426668018102646, -0.19620224833488464, 0.12866811454296112, 0.3134686052799225, 0.35463425517082214, 0.11241421848535538, 0.29801738262176514, 0.060897909104824066, -0.2498639076948166, -0.32302722334861755, 0.11824806034564972, -0.13211624324321747, 0.015651721507310867, 0.21996571123600006, 0.2973279654979706, -0.40388256311416626, -0.43292078375816345, -0.37707364559173584, 0.520078182220459, -0.1345878541469574, 0.07144701480865479, -0.124405637383461, -0.04934128373861313, -0.030626239255070686, 0.2739890515804291, 0.2633117139339447, 0.23375648260116577, 0.07063747197389603, 0.4157322645187378, -0.19068920612335205, -0.29982930421829224, 0.6595063209533691, -0.1065886840224266, -0.4276300072669983, 0.09819772094488144, 0.40865275263786316, 0.07209647446870804, -0.16144819557666779, -0.47127148509025574, 0.15473836660385132, 0.32443711161613464, 0.07843317091464996, -0.2918294370174408, 0.23153650760650635, -0.28303879499435425, 0.12893308699131012, -0.10400509834289551, 0.25166136026382446, 0.26928216218948364, -0.20871376991271973, -0.059159763157367706, -0.1967330127954483 ]
https://github.com/huggingface/datasets/issues/2918
`Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming
Hi @SBrandeis, thanks for reporting! ^^ I think this is an issue with `fsspec`: https://github.com/intake/filesystem_spec/issues/389 I will ask them if they are planning to fix it...
## Describe the bug Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`: ```python ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` cc @lhoestq ## Steps to reproduce the bug ```python from datasets import load_dataset iter_dset = iter( load_dataset("scitldr", name="FullText", split="test", streaming=True) ) next(iter_dset) ``` ## Expected results Returns the first sample of the dataset ## Actual results Calling `__next__` crashes with the following Traceback: ```python ----> 1 next(dset_iter) ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 339 340 def __iter__(self): --> 341 for key, example in self._iter(): 342 if self.features: 343 # we encode the example for ClassLabel feature types for example ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self) 336 else: 337 ex_iterable = self._ex_iterable --> 338 yield from ex_iterable 339 340 def __iter__(self): ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 76 77 def __iter__(self): ---> 78 for key, example in self.generate_examples_fn(**self.kwargs): 79 yield key, example 80 ~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split) 162 163 with open(filepath, encoding="utf-8") as f: --> 164 for id_, row in enumerate(f): 165 data = json.loads(row) 166 if self.config.name == "AIC": ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length) 496 else: 497 length = min(self.size - self.loc, length) --> 498 return super().read(length) 499 500 async def async_fetch_all(self): ~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length) 1481 # don't even bother calling fetch 1482 return b"" -> 1483 out = self.cache._fetch(self.loc, self.loc + length) 1484 self.loc += len(out) 1485 return out ~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end) 378 elif start < self.start: 379 if self.end - end > self.blocksize: --> 380 self.cache = self.fetcher(start, bend) 381 self.start = start 382 else: ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs) 86 def wrapper(*args, **kwargs): 87 self = obj or args[0] ---> 88 return sync(self.loop, func, *args, **kwargs) 89 90 return wrapper ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs) 67 raise FSTimeoutError 68 if isinstance(result[0], BaseException): ---> 69 raise result[0] 70 return result[0] 71 ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout) 23 coro = asyncio.wait_for(coro, timeout=timeout) 24 try: ---> 25 result[0] = await coro 26 except Exception as ex: 27 result[0] = ex ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end) 538 if r.status == 206: 539 # partial content, as expected --> 540 out = await r.read() 541 elif "Content-Length" in r.headers: 542 cl = int(r.headers["Content-Length"]) ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self) 1030 if self._body is None: 1031 try: -> 1032 self._body = await self.content.read() 1033 for trace in self._traces: 1034 await trace.send_response_chunk_received( ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n) 342 async def read(self, n: int = -1) -> bytes: 343 if self._exception is not None: --> 344 raise self._exception 345 346 # migration problem; with DataQueue you have to catch ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` ## Environment info - `datasets` version: 1.12.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.8.5 - PyArrow version: 2.0.0 - aiohttp version: 3.7.4.post0
26
`Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming ## Describe the bug Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`: ```python ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` cc @lhoestq ## Steps to reproduce the bug ```python from datasets import load_dataset iter_dset = iter( load_dataset("scitldr", name="FullText", split="test", streaming=True) ) next(iter_dset) ``` ## Expected results Returns the first sample of the dataset ## Actual results Calling `__next__` crashes with the following Traceback: ```python ----> 1 next(dset_iter) ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 339 340 def __iter__(self): --> 341 for key, example in self._iter(): 342 if self.features: 343 # we encode the example for ClassLabel feature types for example ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self) 336 else: 337 ex_iterable = self._ex_iterable --> 338 yield from ex_iterable 339 340 def __iter__(self): ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 76 77 def __iter__(self): ---> 78 for key, example in self.generate_examples_fn(**self.kwargs): 79 yield key, example 80 ~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split) 162 163 with open(filepath, encoding="utf-8") as f: --> 164 for id_, row in enumerate(f): 165 data = json.loads(row) 166 if self.config.name == "AIC": ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length) 496 else: 497 length = min(self.size - self.loc, length) --> 498 return super().read(length) 499 500 async def async_fetch_all(self): ~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length) 1481 # don't even bother calling fetch 1482 return b"" -> 1483 out = self.cache._fetch(self.loc, self.loc + length) 1484 self.loc += len(out) 1485 return out ~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end) 378 elif start < self.start: 379 if self.end - end > self.blocksize: --> 380 self.cache = self.fetcher(start, bend) 381 self.start = start 382 else: ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs) 86 def wrapper(*args, **kwargs): 87 self = obj or args[0] ---> 88 return sync(self.loop, func, *args, **kwargs) 89 90 return wrapper ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs) 67 raise FSTimeoutError 68 if isinstance(result[0], BaseException): ---> 69 raise result[0] 70 return result[0] 71 ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout) 23 coro = asyncio.wait_for(coro, timeout=timeout) 24 try: ---> 25 result[0] = await coro 26 except Exception as ex: 27 result[0] = ex ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end) 538 if r.status == 206: 539 # partial content, as expected --> 540 out = await r.read() 541 elif "Content-Length" in r.headers: 542 cl = int(r.headers["Content-Length"]) ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self) 1030 if self._body is None: 1031 try: -> 1032 self._body = await self.content.read() 1033 for trace in self._traces: 1034 await trace.send_response_chunk_received( ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n) 342 async def read(self, n: int = -1) -> bytes: 343 if self._exception is not None: --> 344 raise self._exception 345 346 # migration problem; with DataQueue you have to catch ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` ## Environment info - `datasets` version: 1.12.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.8.5 - PyArrow version: 2.0.0 - aiohttp version: 3.7.4.post0 Hi @SBrandeis, thanks for reporting! ^^ I think this is an issue with `fsspec`: https://github.com/intake/filesystem_spec/issues/389 I will ask them if they are planning to fix it...
[ -0.3864649534225464, -0.22049540281295776, 0.08948153257369995, 0.4387415051460266, 0.2157084345817566, 0.12292302399873734, -0.0369098074734211, 0.30938810110092163, 0.24227720499038696, 0.0955025777220726, -0.22643113136291504, 0.4261535704135895, -0.06417552381753922, 0.3035326898097992, -0.00946552399545908, -0.2584784924983978, -0.004506170749664307, 0.23376597464084625, -0.10492481291294098, 0.12687598168849945, -0.0005550794303417206, 0.1941259652376175, -0.2469930648803711, -0.03042364865541458, 0.052228983491659164, -0.10810428112745285, 0.012406637892127037, 0.280525267124176, -0.05958303064107895, -0.44623610377311707, 0.12590476870536804, -0.061548326164484024, 0.4121145009994507, 0.33757418394088745, -0.00011450323654571548, 0.27344828844070435, 0.47214245796203613, -0.1227840930223465, -0.48534393310546875, -0.21211440861225128, -0.21866577863693237, 0.09612700343132019, 0.04283459484577179, -0.15663421154022217, -0.00913434661924839, 0.07111337035894394, -0.04000459611415863, -0.7192991375923157, 0.31784993410110474, 0.34563586115837097, 0.17784994840621948, 0.04260048270225525, -0.048948679119348526, 0.02682267501950264, 0.06883852928876877, -0.29866504669189453, -0.09200660139322281, 0.12181685864925385, 0.2367275506258011, 0.2287401556968689, -0.35957324504852295, 0.3845903277397156, -0.06588814407587051, 0.06018424779176712, 0.09441491961479187, 0.09672396630048752, -0.1749502718448639, -0.4655053913593292, -0.007394663989543915, 0.18841400742530823, 0.6776790618896484, -0.25551655888557434, -0.4161980450153351, -0.23198845982551575, -0.0021710293367505074, -0.6144571304321289, 0.14653131365776062, 0.1489272266626358, -0.4673650860786438, 0.12805995345115662, 0.24596300721168518, -0.008753029629588127, -0.3279944956302643, -0.04587315022945404, -0.24679912626743317, 0.38822218775749207, -0.07678596675395966, -0.023727111518383026, 0.027294164523482323, -0.08662908524274826, 0.46277421712875366, -0.21103499829769135, -0.2845938801765442, -0.06397900730371475, -0.43975502252578735, -0.04206537455320358, -0.0765121802687645, -0.09410928934812546, 0.1681465208530426, 0.21539050340652466, 0.29532063007354736, 0.08825269341468811, 0.15436427295207977, 0.09264431893825531, 0.35552701354026794, 0.3608671724796295, 0.05983173847198486, 0.18537695705890656, 0.13118094205856323, 0.09943137317895889, 0.13662376999855042, -0.18189206719398499, -0.1464887410402298, -0.0372806191444397, 0.02816305309534073, -0.013114355504512787, 0.26285892724990845, -0.1912376880645752, -0.41384774446487427, 0.02979171648621559, -0.30572131276130676, -0.07946721464395523, 0.005590464919805527, 0.28171634674072266, 0.09583377838134766, 0.4187804162502289, 0.019458401948213577, 0.11786722391843796, -0.23968330025672913, -0.45739421248435974, -0.08781105279922485, -0.12471838295459747, -0.0010084174573421478, 0.12334661930799484, 0.015335123986005783, -0.18868327140808105, 0.15157343447208405, -0.04653758555650711, 0.162101149559021, -0.0012182258069515228, -0.020856356248259544, -0.11005949974060059, 0.021629437804222107, 0.2049841731786728, 0.2180561125278473, 0.1640355885028839, 0.17951463162899017, -0.19978544116020203, -0.13068224489688873, 0.08862236887216568, -0.14163297414779663, -0.16712749004364014, -0.17883777618408203, 0.2166469693183899, -0.009402569383382797, -0.35062626004219055, -0.09378883987665176, 0.28146880865097046, 0.14095912873744965, -0.20379026234149933, -0.14107006788253784, -0.039146557450294495, -0.12413199245929718, -0.08651576191186905, 0.1792776882648468, 0.5796180367469788, -0.18559154868125916, -0.13802120089530945, -0.1521388292312622, 0.000893840566277504, 0.5833051204681396, 0.3344023525714874, -0.0607914961874485, 0.08979672938585281, -0.17072251439094543, 0.1476539969444275, 0.5017136335372925, -0.14365838468074799, -0.5796042680740356, 0.5436663031578064, -0.0396081805229187, 0.5637281537055969, 0.27070313692092896, 0.022536810487508774, 0.17423443496227264, 0.04311961680650711, 0.3135296106338501, 0.3299025893211365, -0.14845937490463257, 0.0074819717556238174, -0.333467036485672, -0.03998386859893799, 0.4416949152946472, 0.19122862815856934, 0.06742913275957108, 0.2502861022949219, -0.028873905539512634, -0.06266804039478302, 0.3689776659011841, -0.0752563327550888, 0.07634543627500534, 0.04100775346159935, 0.14688827097415924, 0.012037388980388641, 0.13793839514255524, -0.20907670259475708, -0.310683012008667, 0.297230988740921, 0.0749308168888092, 0.012709897011518478, -0.3174341917037964, 0.20317262411117554, -0.19064539670944214, 0.0017469227313995361, -0.26289284229278564, -0.25904056429862976, 0.12431712448596954, 0.3170804977416992, 0.07562041282653809, 0.050589803606271744, -0.30847644805908203, 0.7747218608856201, -0.07825516909360886, -0.013134648092091084, -0.45491471886634827, 0.2024928778409958, -0.07077667117118835, -0.20145732164382935, 0.01644042134284973, -0.1265653669834137, 0.06725554913282394, -0.016191694885492325, -0.2579915523529053, 0.3313200771808624, -0.23661406338214874, 0.26407158374786377, -0.19543758034706116, -0.1731971949338913, 0.2897450625896454, -0.3644792437553406, -0.08668423444032669, 0.2706030607223511, 0.10750376433134079, 0.12520980834960938, -0.01769862323999405, 0.14808404445648193, 0.20709142088890076, 0.23613369464874268, 0.04344848543405533, 0.11434876173734665, 0.19616757333278656, -0.08167485892772675, -0.06868363171815872, -0.08500906080007553, 0.3240485191345215, -0.3548791706562042, 0.04675019159913063, -0.19892308115959167, -0.27229925990104675, 0.08236339688301086, 0.358678936958313, -0.14038300514221191, -0.049274228513240814, 0.33032456040382385, -0.2885322868824005, -0.1639079451560974, 0.31456053256988525, 0.1940097063779831, 0.47233545780181885, 0.0815221518278122, 0.2573348879814148, -0.045588232576847076, -0.18864789605140686, -0.07350586354732513, 0.3051696717739105, 0.13748390972614288, 0.03146366402506828, 0.24641117453575134, 0.030006850138306618, 0.16357460618019104, -0.3229157328605652, -0.34971681237220764, -0.05663222819566727, 0.11234153062105179, -0.32018759846687317, 0.30630168318748474, -0.38826844096183777, -0.46517446637153625, 0.046351149678230286, 0.15600867569446564, 0.06890520453453064, -0.3235584795475006, -0.18175466358661652, 0.23250553011894226, -0.0038820933550596237, 0.16368424892425537, -0.26820650696754456, 0.08954861760139465, 0.2671772539615631, -0.013469008728861809, -0.3418700397014618, -0.18084727227687836, -0.27296265959739685, 0.05919777974486351, 0.17499525845050812, -0.4228041172027588, 0.17691931128501892, 0.0074259694665670395, -0.11605264991521835, -0.14017333090305328, -0.07642340660095215, 0.3197818696498871, -0.15549996495246887, 0.15689581632614136, -0.27748650312423706, 0.14939141273498535, 0.2213628739118576, -0.2503492534160614, 0.12194833159446716, 0.09083358943462372, -0.1187843307852745, 0.28012481331825256, 0.09408971667289734, -0.024161208420991898, -0.030583398416638374, -0.3010803759098053, -0.3024667501449585, -0.6177493929862976, 0.05496852844953537, 0.04542603716254234, 0.2135513722896576, 0.16430486738681793, 0.017034966498613358, 0.09682448953390121, 0.3292069733142853, 0.09916023910045624, -0.11421191692352295, -0.4199436604976654, 0.3747454583644867, -0.16701453924179077, -0.2868407368659973, -0.32483670115470886, -0.06815987825393677, 0.19728989899158478, 0.25892674922943115, -0.5295240879058838, 0.29501691460609436, -0.40810367465019226, 0.08489276468753815, -0.38345134258270264, -0.09745572507381439, -0.02615155279636383, 0.07628879696130753, -0.034989435225725174, -0.18785789608955383, 0.07074569165706635, -0.11695138365030289, 0.09900779277086258, 0.2066112458705902, 0.10863088071346283, 0.36987119913101196, 0.1008496880531311, 0.3327505588531494, 0.4812106490135193, -0.019549798220396042, 0.34075531363487244, 0.08289137482643127, 0.15380090475082397, -0.100433848798275, -0.06278840452432632, -0.09556198120117188, -0.2280798852443695, -0.02611975185573101, 0.09819918125867844, -0.09621231257915497, -0.5762303471565247, -0.28405165672302246, 0.054914962500333786, -0.06923677027225494, -0.23831042647361755, 0.05288369953632355, -0.5117747187614441, 0.042048320174217224, -0.1872568577528, 0.15833967924118042, 0.08079695701599121, 0.052001044154167175, 0.08604565262794495, 0.1772526204586029, 0.12616479396820068, 0.17211951315402985, -0.18502114713191986, -0.06390539556741714, -0.488190233707428, 0.18258610367774963, 0.10512654483318329, 0.4215748906135559, -0.16781045496463776, -0.13271674513816833, 0.07911515235900879, -0.06520675867795944, 0.34870362281799316, -0.27541670203208923, 0.0035672448575496674, 0.2673945724964142, 0.14213557541370392, -0.14155219495296478, 0.09176725149154663, -0.32094606757164, 0.13682883977890015, 0.2359541803598404, 0.09742001444101334, -0.17182360589504242, 0.033340174704790115, -0.0884198397397995, -0.0724964365363121, -0.12530268728733063, -0.016399193555116653, -0.17049618065357208, -0.24923765659332275, -0.15200984477996826, -0.13424289226531982, 0.2032727748155594, 0.12568366527557373, -0.012460273690521717, -0.056792546063661575, -0.046081654727458954, -0.03962451592087746, 0.241859570145607, 0.22132545709609985, 0.1399095356464386, -0.07228003442287445, 0.2290114462375641, 0.06719925254583359, 0.2844448685646057, 0.22921665012836456, 0.8364320993423462, 0.11819469928741455, -0.5624253749847412, 0.23508229851722717, 0.23395636677742004, 0.16609922051429749, 0.13053923845291138, -0.1482325941324234, -0.008516907691955566, -0.04038508981466293, 0.2698211371898651, -0.30247342586517334, 0.21465498208999634, 0.21123261749744415, -0.0507209487259388, -0.514930248260498, -0.43575388193130493, 0.5883389711380005, -0.0393681675195694, -0.07619062066078186, 0.7872931957244873, -0.16650481522083282, -0.31715595722198486, 0.47754156589508057, 0.023434899747371674, 0.7585883736610413, 0.09439562261104584, 0.21686869859695435, 0.24074801802635193, -0.3207281231880188, 0.5003331899642944, -0.23206883668899536, 0.3346683979034424, -0.1206098422408104, -0.3350295424461365, -0.08310911059379578, -0.10410943627357483, 0.17090269923210144, -0.14760397374629974, -0.6302539110183716, 0.1709609031677246, -0.05964428558945656, -0.25280535221099854, 0.3353525996208191, 0.27422669529914856, -0.6082690954208374, -0.3062928318977356, -0.06754990667104721, 0.13888241350650787, -0.2213597446680069, 0.32396167516708374, 0.13824477791786194, -0.2202337682247162, -0.05157339945435524, -0.08431044220924377, -0.4702361226081848, 0.4758628308773041, -0.2765564024448395, 0.16241367161273956, -0.2390308380126953, -0.4760984182357788, 0.15131299197673798, 0.26640236377716064, -0.14213301241397858, -0.22578595578670502, -0.15825100243091583, 0.23504389822483063, 0.18605434894561768, 0.1280241757631302, 0.09930721670389175, 0.15145832300186157, 0.38835883140563965, 0.05327735096216202, -0.016812533140182495, 0.18844234943389893, -0.008979842998087406, -0.16062889993190765, -0.06378110498189926, 0.05545757710933685, 0.31831395626068115, -0.2681805193424225, 0.23685790598392487, -0.1058511734008789, 0.042925287038087845, -0.18425258994102478, 0.08697222173213959, -0.0188315287232399, -0.17405414581298828, -0.07388795167207718, -0.0812971293926239, -0.21967631578445435, -0.08474434912204742, 0.3771200180053711, 0.1454576849937439, 0.31797170639038086, 0.49941885471343994, 0.028116773813962936, -0.17788065969944, -0.10367142409086227, -0.05515051633119583, -0.2931397259235382, -0.25261208415031433, 0.06935974210500717, -0.24147652089595795, -0.16102805733680725, -0.2706698179244995, 0.0038264207541942596, 0.04483713582158089, -0.10355471819639206, -0.11373870074748993, -0.299366295337677, -0.19063697755336761, -0.026614569127559662, -0.12424391508102417, 0.2199304699897766, -0.17221993207931519, 0.022204013541340828, 0.0031203124672174454, 0.12908558547496796, -0.27068382501602173, -0.12285945564508438, -0.0753689631819725, 0.023118171840906143, 0.26721012592315674, 0.029267719015479088, 0.25923383235931396, 0.1096690446138382, 0.14762236177921295, 0.3139050006866455, -0.027674600481987, -0.16095402836799622, -0.1787949800491333, 0.1384895145893097, 0.016531234607100487, -0.34805166721343994, -0.15489406883716583, -0.05662021040916443, 0.012690621428191662, -0.12513615190982819, 0.35031431913375854, 0.18123027682304382, 0.03809691220521927, 0.270601361989975, 0.12401356548070908, 0.05633610486984253, -0.23264747858047485, 0.15423661470413208, -0.2642729878425598, 0.24013137817382812, 0.08111178129911423, 0.09284060448408127, -0.07553984969854355, -0.011868879199028015, -0.3646133542060852, 0.06226964294910431, 0.10179466009140015, -0.028017103672027588, 0.5909273028373718, -0.42418015003204346, 0.17204515635967255, -0.04977470636367798, 0.06602971255779266, 0.40452295541763306, -0.22961939871311188, -0.20896193385124207, 0.08508474379777908, 0.20005127787590027, -0.04320323467254639, -0.21262110769748688, -0.40104785561561584, -0.10164066404104233, 0.011238370090723038, 0.14595960080623627, -0.1068897694349289, -0.27218377590179443, 0.09996352344751358, -0.21030846238136292, 0.48598334193229675, 0.3358432650566101, 0.26706647872924805, 0.483639121055603, -0.18112842738628387, 0.02284707874059677, -0.22602495551109314, 0.020458970218896866, 0.199906587600708, 0.29704275727272034, 0.003551490604877472, -0.007870232686400414, -0.16136541962623596, 0.21781931817531586, -0.1859748363494873, -0.48219573497772217, -0.07974787056446075, 0.1024474948644638, -0.16475480794906616, 0.3901937007904053, 0.14890994131565094, 0.15216052532196045, -0.2779354155063629, -0.05192176625132561, -0.04584163427352905, -0.0661264955997467, -0.014279812574386597, -0.0960800051689148, 0.10687629878520966, -0.012855932116508484, -0.3279229402542114, 0.09760874509811401, 0.012399598956108093, 0.06336858868598938, -0.019864141941070557, 0.28080570697784424, -0.2884630560874939, -0.11850142478942871, -0.08222761750221252, 0.1043175682425499, 0.2999255359172821, -0.35441532731056213, 0.44406944513320923, 0.36619049310684204, -0.15686127543449402, 0.028251085430383682, 0.07000209391117096, 0.48160719871520996, 0.2853379249572754, -0.1766507476568222, 0.09465008974075317, 0.33741676807403564, -0.04363708943128586, -0.04022128880023956, 0.04425443708896637, 0.283094584941864, 0.17932011187076569, 0.4566895067691803, 0.088739313185215, -0.14854204654693604, 0.10457168519496918, 0.08143505454063416, 0.253889262676239, -0.27993902564048767, 0.46231982111930847, -0.11950623989105225, 0.036692291498184204, 0.027242282405495644, -0.33657196164131165, -0.5624160170555115, -0.028204847127199173, 0.03489581495523453, -0.22850023210048676, 0.07452354580163956, -0.008112382143735886, 0.06287819892168045, 0.11395452916622162, 0.49266818165779114, 0.3248406648635864, -0.0188458114862442, -0.22450947761535645, -0.1508786976337433, -0.23558348417282104, 0.23320209980010986, -0.06747959554195404, -0.12314828485250473, 0.1752849817276001, 0.22192315757274628, -0.004841417074203491, 0.1680493950843811, -0.15844453871250153, 0.02045489475131035, -0.26728400588035583, 0.14057248830795288, -0.3995799124240875, -0.3515672981739044, 0.19196365773677826, 0.17357923090457916, -0.048311538994312286, -0.5764798521995544, 0.1881391555070877, -0.15023839473724365, 0.16081759333610535, 0.09261343628168106, -0.24184846878051758, 0.1011454313993454, -0.27565833926200867, 0.5297338962554932, 0.23311077058315277, 0.3792003095149994, -0.1842953860759735, -0.4119568169116974, -0.09924691915512085, -0.37623080611228943, -0.27491459250450134, -0.015584476292133331, 0.10833348333835602, 0.5696324110031128, -0.14933432638645172, -0.2373838871717453, -0.35747089982032776, 0.32626235485076904, 0.0608893483877182, -0.2656732201576233, -0.27353864908218384, 0.1733701378107071, -0.11945998668670654, 0.21312618255615234, 0.3050508201122284, 0.380344957113266, -0.02871309220790863, 0.1639946699142456, -0.2235153764486313, -0.43332141637802124, 0.5773110389709473, -0.34610649943351746, -0.26596707105636597, 0.2418414205312729, 0.063814178109169, 0.3264976739883423, 0.24101999402046204, -0.45966631174087524, 0.08936508744955063, 0.35565489530563354, -0.23541313409805298, -0.15118557214736938, 0.1421463042497635, 0.22597043216228485, -0.06072034686803818, -0.08504001796245575, 0.4553109407424927, 0.24239638447761536, -0.24920397996902466, 0.17508167028427124, -0.17863863706588745 ]
https://github.com/huggingface/datasets/issues/2918
`Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming
Code to reproduce the bug: `ClientPayloadError: 400, message='Can not decode content-encoding: gzip'` ```python In [1]: import fsspec In [2]: import json In [3]: with fsspec.open('https://raw.githubusercontent.com/allenai/scitldr/master/SciTLDR-Data/SciTLDR-FullText/test.jsonl', encoding="utf-8") as f: ...: for row in f: ...: data = json.loads(row) ...: --------------------------------------------------------------------------- ClientPayloadError Traceback (most recent call last) ```
## Describe the bug Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`: ```python ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` cc @lhoestq ## Steps to reproduce the bug ```python from datasets import load_dataset iter_dset = iter( load_dataset("scitldr", name="FullText", split="test", streaming=True) ) next(iter_dset) ``` ## Expected results Returns the first sample of the dataset ## Actual results Calling `__next__` crashes with the following Traceback: ```python ----> 1 next(dset_iter) ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 339 340 def __iter__(self): --> 341 for key, example in self._iter(): 342 if self.features: 343 # we encode the example for ClassLabel feature types for example ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self) 336 else: 337 ex_iterable = self._ex_iterable --> 338 yield from ex_iterable 339 340 def __iter__(self): ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 76 77 def __iter__(self): ---> 78 for key, example in self.generate_examples_fn(**self.kwargs): 79 yield key, example 80 ~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split) 162 163 with open(filepath, encoding="utf-8") as f: --> 164 for id_, row in enumerate(f): 165 data = json.loads(row) 166 if self.config.name == "AIC": ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length) 496 else: 497 length = min(self.size - self.loc, length) --> 498 return super().read(length) 499 500 async def async_fetch_all(self): ~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length) 1481 # don't even bother calling fetch 1482 return b"" -> 1483 out = self.cache._fetch(self.loc, self.loc + length) 1484 self.loc += len(out) 1485 return out ~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end) 378 elif start < self.start: 379 if self.end - end > self.blocksize: --> 380 self.cache = self.fetcher(start, bend) 381 self.start = start 382 else: ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs) 86 def wrapper(*args, **kwargs): 87 self = obj or args[0] ---> 88 return sync(self.loop, func, *args, **kwargs) 89 90 return wrapper ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs) 67 raise FSTimeoutError 68 if isinstance(result[0], BaseException): ---> 69 raise result[0] 70 return result[0] 71 ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout) 23 coro = asyncio.wait_for(coro, timeout=timeout) 24 try: ---> 25 result[0] = await coro 26 except Exception as ex: 27 result[0] = ex ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end) 538 if r.status == 206: 539 # partial content, as expected --> 540 out = await r.read() 541 elif "Content-Length" in r.headers: 542 cl = int(r.headers["Content-Length"]) ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self) 1030 if self._body is None: 1031 try: -> 1032 self._body = await self.content.read() 1033 for trace in self._traces: 1034 await trace.send_response_chunk_received( ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n) 342 async def read(self, n: int = -1) -> bytes: 343 if self._exception is not None: --> 344 raise self._exception 345 346 # migration problem; with DataQueue you have to catch ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` ## Environment info - `datasets` version: 1.12.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.8.5 - PyArrow version: 2.0.0 - aiohttp version: 3.7.4.post0
46
`Can not decode content-encoding: gzip` when loading `scitldr` dataset with streaming ## Describe the bug Trying to load the `"FullText"` config of the `"scitldr"` dataset with `streaming=True` raises an error from `aiohttp`: ```python ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` cc @lhoestq ## Steps to reproduce the bug ```python from datasets import load_dataset iter_dset = iter( load_dataset("scitldr", name="FullText", split="test", streaming=True) ) next(iter_dset) ``` ## Expected results Returns the first sample of the dataset ## Actual results Calling `__next__` crashes with the following Traceback: ```python ----> 1 next(dset_iter) ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 339 340 def __iter__(self): --> 341 for key, example in self._iter(): 342 if self.features: 343 # we encode the example for ClassLabel feature types for example ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in _iter(self) 336 else: 337 ex_iterable = self._ex_iterable --> 338 yield from ex_iterable 339 340 def __iter__(self): ~\miniconda3\envs\datasets\lib\site-packages\datasets\iterable_dataset.py in __iter__(self) 76 77 def __iter__(self): ---> 78 for key, example in self.generate_examples_fn(**self.kwargs): 79 yield key, example 80 ~\.cache\huggingface\modules\datasets_modules\datasets\scitldr\72d6e2195786c57e1d343066fb2cc4f93ea39c5e381e53e6ae7c44bbfd1f05ef\scitldr.py in _generate_examples(self, filepath, split) 162 163 with open(filepath, encoding="utf-8") as f: --> 164 for id_, row in enumerate(f): 165 data = json.loads(row) 166 if self.config.name == "AIC": ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in read(self, length) 496 else: 497 length = min(self.size - self.loc, length) --> 498 return super().read(length) 499 500 async def async_fetch_all(self): ~\miniconda3\envs\datasets\lib\site-packages\fsspec\spec.py in read(self, length) 1481 # don't even bother calling fetch 1482 return b"" -> 1483 out = self.cache._fetch(self.loc, self.loc + length) 1484 self.loc += len(out) 1485 return out ~\miniconda3\envs\datasets\lib\site-packages\fsspec\caching.py in _fetch(self, start, end) 378 elif start < self.start: 379 if self.end - end > self.blocksize: --> 380 self.cache = self.fetcher(start, bend) 381 self.start = start 382 else: ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in wrapper(*args, **kwargs) 86 def wrapper(*args, **kwargs): 87 self = obj or args[0] ---> 88 return sync(self.loop, func, *args, **kwargs) 89 90 return wrapper ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in sync(loop, func, timeout, *args, **kwargs) 67 raise FSTimeoutError 68 if isinstance(result[0], BaseException): ---> 69 raise result[0] 70 return result[0] 71 ~\miniconda3\envs\datasets\lib\site-packages\fsspec\asyn.py in _runner(event, coro, result, timeout) 23 coro = asyncio.wait_for(coro, timeout=timeout) 24 try: ---> 25 result[0] = await coro 26 except Exception as ex: 27 result[0] = ex ~\miniconda3\envs\datasets\lib\site-packages\fsspec\implementations\http.py in async_fetch_range(self, start, end) 538 if r.status == 206: 539 # partial content, as expected --> 540 out = await r.read() 541 elif "Content-Length" in r.headers: 542 cl = int(r.headers["Content-Length"]) ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\client_reqrep.py in read(self) 1030 if self._body is None: 1031 try: -> 1032 self._body = await self.content.read() 1033 for trace in self._traces: 1034 await trace.send_response_chunk_received( ~\miniconda3\envs\datasets\lib\site-packages\aiohttp\streams.py in read(self, n) 342 async def read(self, n: int = -1) -> bytes: 343 if self._exception is not None: --> 344 raise self._exception 345 346 # migration problem; with DataQueue you have to catch ClientPayloadError: 400, message='Can not decode content-encoding: gzip' ``` ## Environment info - `datasets` version: 1.12.0 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.8.5 - PyArrow version: 2.0.0 - aiohttp version: 3.7.4.post0 Code to reproduce the bug: `ClientPayloadError: 400, message='Can not decode content-encoding: gzip'` ```python In [1]: import fsspec In [2]: import json In [3]: with fsspec.open('https://raw.githubusercontent.com/allenai/scitldr/master/SciTLDR-Data/SciTLDR-FullText/test.jsonl', encoding="utf-8") as f: ...: for row in f: ...: data = json.loads(row) ...: --------------------------------------------------------------------------- ClientPayloadError Traceback (most recent call last) ```
[ -0.3864649534225464, -0.22049540281295776, 0.08948153257369995, 0.4387415051460266, 0.2157084345817566, 0.12292302399873734, -0.0369098074734211, 0.30938810110092163, 0.24227720499038696, 0.0955025777220726, -0.22643113136291504, 0.4261535704135895, -0.06417552381753922, 0.3035326898097992, -0.00946552399545908, -0.2584784924983978, -0.004506170749664307, 0.23376597464084625, -0.10492481291294098, 0.12687598168849945, -0.0005550794303417206, 0.1941259652376175, -0.2469930648803711, -0.03042364865541458, 0.052228983491659164, -0.10810428112745285, 0.012406637892127037, 0.280525267124176, -0.05958303064107895, -0.44623610377311707, 0.12590476870536804, -0.061548326164484024, 0.4121145009994507, 0.33757418394088745, -0.00011450323654571548, 0.27344828844070435, 0.47214245796203613, -0.1227840930223465, -0.48534393310546875, -0.21211440861225128, -0.21866577863693237, 0.09612700343132019, 0.04283459484577179, -0.15663421154022217, -0.00913434661924839, 0.07111337035894394, -0.04000459611415863, -0.7192991375923157, 0.31784993410110474, 0.34563586115837097, 0.17784994840621948, 0.04260048270225525, -0.048948679119348526, 0.02682267501950264, 0.06883852928876877, -0.29866504669189453, -0.09200660139322281, 0.12181685864925385, 0.2367275506258011, 0.2287401556968689, -0.35957324504852295, 0.3845903277397156, -0.06588814407587051, 0.06018424779176712, 0.09441491961479187, 0.09672396630048752, -0.1749502718448639, -0.4655053913593292, -0.007394663989543915, 0.18841400742530823, 0.6776790618896484, -0.25551655888557434, -0.4161980450153351, -0.23198845982551575, -0.0021710293367505074, -0.6144571304321289, 0.14653131365776062, 0.1489272266626358, -0.4673650860786438, 0.12805995345115662, 0.24596300721168518, -0.008753029629588127, -0.3279944956302643, -0.04587315022945404, -0.24679912626743317, 0.38822218775749207, -0.07678596675395966, -0.023727111518383026, 0.027294164523482323, -0.08662908524274826, 0.46277421712875366, -0.21103499829769135, -0.2845938801765442, -0.06397900730371475, -0.43975502252578735, -0.04206537455320358, -0.0765121802687645, -0.09410928934812546, 0.1681465208530426, 0.21539050340652466, 0.29532063007354736, 0.08825269341468811, 0.15436427295207977, 0.09264431893825531, 0.35552701354026794, 0.3608671724796295, 0.05983173847198486, 0.18537695705890656, 0.13118094205856323, 0.09943137317895889, 0.13662376999855042, -0.18189206719398499, -0.1464887410402298, -0.0372806191444397, 0.02816305309534073, -0.013114355504512787, 0.26285892724990845, -0.1912376880645752, -0.41384774446487427, 0.02979171648621559, -0.30572131276130676, -0.07946721464395523, 0.005590464919805527, 0.28171634674072266, 0.09583377838134766, 0.4187804162502289, 0.019458401948213577, 0.11786722391843796, -0.23968330025672913, -0.45739421248435974, -0.08781105279922485, -0.12471838295459747, -0.0010084174573421478, 0.12334661930799484, 0.015335123986005783, -0.18868327140808105, 0.15157343447208405, -0.04653758555650711, 0.162101149559021, -0.0012182258069515228, -0.020856356248259544, -0.11005949974060059, 0.021629437804222107, 0.2049841731786728, 0.2180561125278473, 0.1640355885028839, 0.17951463162899017, -0.19978544116020203, -0.13068224489688873, 0.08862236887216568, -0.14163297414779663, -0.16712749004364014, -0.17883777618408203, 0.2166469693183899, -0.009402569383382797, -0.35062626004219055, -0.09378883987665176, 0.28146880865097046, 0.14095912873744965, -0.20379026234149933, -0.14107006788253784, -0.039146557450294495, -0.12413199245929718, -0.08651576191186905, 0.1792776882648468, 0.5796180367469788, -0.18559154868125916, -0.13802120089530945, -0.1521388292312622, 0.000893840566277504, 0.5833051204681396, 0.3344023525714874, -0.0607914961874485, 0.08979672938585281, -0.17072251439094543, 0.1476539969444275, 0.5017136335372925, -0.14365838468074799, -0.5796042680740356, 0.5436663031578064, -0.0396081805229187, 0.5637281537055969, 0.27070313692092896, 0.022536810487508774, 0.17423443496227264, 0.04311961680650711, 0.3135296106338501, 0.3299025893211365, -0.14845937490463257, 0.0074819717556238174, -0.333467036485672, -0.03998386859893799, 0.4416949152946472, 0.19122862815856934, 0.06742913275957108, 0.2502861022949219, -0.028873905539512634, -0.06266804039478302, 0.3689776659011841, -0.0752563327550888, 0.07634543627500534, 0.04100775346159935, 0.14688827097415924, 0.012037388980388641, 0.13793839514255524, -0.20907670259475708, -0.310683012008667, 0.297230988740921, 0.0749308168888092, 0.012709897011518478, -0.3174341917037964, 0.20317262411117554, -0.19064539670944214, 0.0017469227313995361, -0.26289284229278564, -0.25904056429862976, 0.12431712448596954, 0.3170804977416992, 0.07562041282653809, 0.050589803606271744, -0.30847644805908203, 0.7747218608856201, -0.07825516909360886, -0.013134648092091084, -0.45491471886634827, 0.2024928778409958, -0.07077667117118835, -0.20145732164382935, 0.01644042134284973, -0.1265653669834137, 0.06725554913282394, -0.016191694885492325, -0.2579915523529053, 0.3313200771808624, -0.23661406338214874, 0.26407158374786377, -0.19543758034706116, -0.1731971949338913, 0.2897450625896454, -0.3644792437553406, -0.08668423444032669, 0.2706030607223511, 0.10750376433134079, 0.12520980834960938, -0.01769862323999405, 0.14808404445648193, 0.20709142088890076, 0.23613369464874268, 0.04344848543405533, 0.11434876173734665, 0.19616757333278656, -0.08167485892772675, -0.06868363171815872, -0.08500906080007553, 0.3240485191345215, -0.3548791706562042, 0.04675019159913063, -0.19892308115959167, -0.27229925990104675, 0.08236339688301086, 0.358678936958313, -0.14038300514221191, -0.049274228513240814, 0.33032456040382385, -0.2885322868824005, -0.1639079451560974, 0.31456053256988525, 0.1940097063779831, 0.47233545780181885, 0.0815221518278122, 0.2573348879814148, -0.045588232576847076, -0.18864789605140686, -0.07350586354732513, 0.3051696717739105, 0.13748390972614288, 0.03146366402506828, 0.24641117453575134, 0.030006850138306618, 0.16357460618019104, -0.3229157328605652, -0.34971681237220764, -0.05663222819566727, 0.11234153062105179, -0.32018759846687317, 0.30630168318748474, -0.38826844096183777, -0.46517446637153625, 0.046351149678230286, 0.15600867569446564, 0.06890520453453064, -0.3235584795475006, -0.18175466358661652, 0.23250553011894226, -0.0038820933550596237, 0.16368424892425537, -0.26820650696754456, 0.08954861760139465, 0.2671772539615631, -0.013469008728861809, -0.3418700397014618, -0.18084727227687836, -0.27296265959739685, 0.05919777974486351, 0.17499525845050812, -0.4228041172027588, 0.17691931128501892, 0.0074259694665670395, -0.11605264991521835, -0.14017333090305328, -0.07642340660095215, 0.3197818696498871, -0.15549996495246887, 0.15689581632614136, -0.27748650312423706, 0.14939141273498535, 0.2213628739118576, -0.2503492534160614, 0.12194833159446716, 0.09083358943462372, -0.1187843307852745, 0.28012481331825256, 0.09408971667289734, -0.024161208420991898, -0.030583398416638374, -0.3010803759098053, -0.3024667501449585, -0.6177493929862976, 0.05496852844953537, 0.04542603716254234, 0.2135513722896576, 0.16430486738681793, 0.017034966498613358, 0.09682448953390121, 0.3292069733142853, 0.09916023910045624, -0.11421191692352295, -0.4199436604976654, 0.3747454583644867, -0.16701453924179077, -0.2868407368659973, -0.32483670115470886, -0.06815987825393677, 0.19728989899158478, 0.25892674922943115, -0.5295240879058838, 0.29501691460609436, -0.40810367465019226, 0.08489276468753815, -0.38345134258270264, -0.09745572507381439, -0.02615155279636383, 0.07628879696130753, -0.034989435225725174, -0.18785789608955383, 0.07074569165706635, -0.11695138365030289, 0.09900779277086258, 0.2066112458705902, 0.10863088071346283, 0.36987119913101196, 0.1008496880531311, 0.3327505588531494, 0.4812106490135193, -0.019549798220396042, 0.34075531363487244, 0.08289137482643127, 0.15380090475082397, -0.100433848798275, -0.06278840452432632, -0.09556198120117188, -0.2280798852443695, -0.02611975185573101, 0.09819918125867844, -0.09621231257915497, -0.5762303471565247, -0.28405165672302246, 0.054914962500333786, -0.06923677027225494, -0.23831042647361755, 0.05288369953632355, -0.5117747187614441, 0.042048320174217224, -0.1872568577528, 0.15833967924118042, 0.08079695701599121, 0.052001044154167175, 0.08604565262794495, 0.1772526204586029, 0.12616479396820068, 0.17211951315402985, -0.18502114713191986, -0.06390539556741714, -0.488190233707428, 0.18258610367774963, 0.10512654483318329, 0.4215748906135559, -0.16781045496463776, -0.13271674513816833, 0.07911515235900879, -0.06520675867795944, 0.34870362281799316, -0.27541670203208923, 0.0035672448575496674, 0.2673945724964142, 0.14213557541370392, -0.14155219495296478, 0.09176725149154663, -0.32094606757164, 0.13682883977890015, 0.2359541803598404, 0.09742001444101334, -0.17182360589504242, 0.033340174704790115, -0.0884198397397995, -0.0724964365363121, -0.12530268728733063, -0.016399193555116653, -0.17049618065357208, -0.24923765659332275, -0.15200984477996826, -0.13424289226531982, 0.2032727748155594, 0.12568366527557373, -0.012460273690521717, -0.056792546063661575, -0.046081654727458954, -0.03962451592087746, 0.241859570145607, 0.22132545709609985, 0.1399095356464386, -0.07228003442287445, 0.2290114462375641, 0.06719925254583359, 0.2844448685646057, 0.22921665012836456, 0.8364320993423462, 0.11819469928741455, -0.5624253749847412, 0.23508229851722717, 0.23395636677742004, 0.16609922051429749, 0.13053923845291138, -0.1482325941324234, -0.008516907691955566, -0.04038508981466293, 0.2698211371898651, -0.30247342586517334, 0.21465498208999634, 0.21123261749744415, -0.0507209487259388, -0.514930248260498, -0.43575388193130493, 0.5883389711380005, -0.0393681675195694, -0.07619062066078186, 0.7872931957244873, -0.16650481522083282, -0.31715595722198486, 0.47754156589508057, 0.023434899747371674, 0.7585883736610413, 0.09439562261104584, 0.21686869859695435, 0.24074801802635193, -0.3207281231880188, 0.5003331899642944, -0.23206883668899536, 0.3346683979034424, -0.1206098422408104, -0.3350295424461365, -0.08310911059379578, -0.10410943627357483, 0.17090269923210144, -0.14760397374629974, -0.6302539110183716, 0.1709609031677246, -0.05964428558945656, -0.25280535221099854, 0.3353525996208191, 0.27422669529914856, -0.6082690954208374, -0.3062928318977356, -0.06754990667104721, 0.13888241350650787, -0.2213597446680069, 0.32396167516708374, 0.13824477791786194, -0.2202337682247162, -0.05157339945435524, -0.08431044220924377, -0.4702361226081848, 0.4758628308773041, -0.2765564024448395, 0.16241367161273956, -0.2390308380126953, -0.4760984182357788, 0.15131299197673798, 0.26640236377716064, -0.14213301241397858, -0.22578595578670502, -0.15825100243091583, 0.23504389822483063, 0.18605434894561768, 0.1280241757631302, 0.09930721670389175, 0.15145832300186157, 0.38835883140563965, 0.05327735096216202, -0.016812533140182495, 0.18844234943389893, -0.008979842998087406, -0.16062889993190765, -0.06378110498189926, 0.05545757710933685, 0.31831395626068115, -0.2681805193424225, 0.23685790598392487, -0.1058511734008789, 0.042925287038087845, -0.18425258994102478, 0.08697222173213959, -0.0188315287232399, -0.17405414581298828, -0.07388795167207718, -0.0812971293926239, -0.21967631578445435, -0.08474434912204742, 0.3771200180053711, 0.1454576849937439, 0.31797170639038086, 0.49941885471343994, 0.028116773813962936, -0.17788065969944, -0.10367142409086227, -0.05515051633119583, -0.2931397259235382, -0.25261208415031433, 0.06935974210500717, -0.24147652089595795, -0.16102805733680725, -0.2706698179244995, 0.0038264207541942596, 0.04483713582158089, -0.10355471819639206, -0.11373870074748993, -0.299366295337677, -0.19063697755336761, -0.026614569127559662, -0.12424391508102417, 0.2199304699897766, -0.17221993207931519, 0.022204013541340828, 0.0031203124672174454, 0.12908558547496796, -0.27068382501602173, -0.12285945564508438, -0.0753689631819725, 0.023118171840906143, 0.26721012592315674, 0.029267719015479088, 0.25923383235931396, 0.1096690446138382, 0.14762236177921295, 0.3139050006866455, -0.027674600481987, -0.16095402836799622, -0.1787949800491333, 0.1384895145893097, 0.016531234607100487, -0.34805166721343994, -0.15489406883716583, -0.05662021040916443, 0.012690621428191662, -0.12513615190982819, 0.35031431913375854, 0.18123027682304382, 0.03809691220521927, 0.270601361989975, 0.12401356548070908, 0.05633610486984253, -0.23264747858047485, 0.15423661470413208, -0.2642729878425598, 0.24013137817382812, 0.08111178129911423, 0.09284060448408127, -0.07553984969854355, -0.011868879199028015, -0.3646133542060852, 0.06226964294910431, 0.10179466009140015, -0.028017103672027588, 0.5909273028373718, -0.42418015003204346, 0.17204515635967255, -0.04977470636367798, 0.06602971255779266, 0.40452295541763306, -0.22961939871311188, -0.20896193385124207, 0.08508474379777908, 0.20005127787590027, -0.04320323467254639, -0.21262110769748688, -0.40104785561561584, -0.10164066404104233, 0.011238370090723038, 0.14595960080623627, -0.1068897694349289, -0.27218377590179443, 0.09996352344751358, -0.21030846238136292, 0.48598334193229675, 0.3358432650566101, 0.26706647872924805, 0.483639121055603, -0.18112842738628387, 0.02284707874059677, -0.22602495551109314, 0.020458970218896866, 0.199906587600708, 0.29704275727272034, 0.003551490604877472, -0.007870232686400414, -0.16136541962623596, 0.21781931817531586, -0.1859748363494873, -0.48219573497772217, -0.07974787056446075, 0.1024474948644638, -0.16475480794906616, 0.3901937007904053, 0.14890994131565094, 0.15216052532196045, -0.2779354155063629, -0.05192176625132561, -0.04584163427352905, -0.0661264955997467, -0.014279812574386597, -0.0960800051689148, 0.10687629878520966, -0.012855932116508484, -0.3279229402542114, 0.09760874509811401, 0.012399598956108093, 0.06336858868598938, -0.019864141941070557, 0.28080570697784424, -0.2884630560874939, -0.11850142478942871, -0.08222761750221252, 0.1043175682425499, 0.2999255359172821, -0.35441532731056213, 0.44406944513320923, 0.36619049310684204, -0.15686127543449402, 0.028251085430383682, 0.07000209391117096, 0.48160719871520996, 0.2853379249572754, -0.1766507476568222, 0.09465008974075317, 0.33741676807403564, -0.04363708943128586, -0.04022128880023956, 0.04425443708896637, 0.283094584941864, 0.17932011187076569, 0.4566895067691803, 0.088739313185215, -0.14854204654693604, 0.10457168519496918, 0.08143505454063416, 0.253889262676239, -0.27993902564048767, 0.46231982111930847, -0.11950623989105225, 0.036692291498184204, 0.027242282405495644, -0.33657196164131165, -0.5624160170555115, -0.028204847127199173, 0.03489581495523453, -0.22850023210048676, 0.07452354580163956, -0.008112382143735886, 0.06287819892168045, 0.11395452916622162, 0.49266818165779114, 0.3248406648635864, -0.0188458114862442, -0.22450947761535645, -0.1508786976337433, -0.23558348417282104, 0.23320209980010986, -0.06747959554195404, -0.12314828485250473, 0.1752849817276001, 0.22192315757274628, -0.004841417074203491, 0.1680493950843811, -0.15844453871250153, 0.02045489475131035, -0.26728400588035583, 0.14057248830795288, -0.3995799124240875, -0.3515672981739044, 0.19196365773677826, 0.17357923090457916, -0.048311538994312286, -0.5764798521995544, 0.1881391555070877, -0.15023839473724365, 0.16081759333610535, 0.09261343628168106, -0.24184846878051758, 0.1011454313993454, -0.27565833926200867, 0.5297338962554932, 0.23311077058315277, 0.3792003095149994, -0.1842953860759735, -0.4119568169116974, -0.09924691915512085, -0.37623080611228943, -0.27491459250450134, -0.015584476292133331, 0.10833348333835602, 0.5696324110031128, -0.14933432638645172, -0.2373838871717453, -0.35747089982032776, 0.32626235485076904, 0.0608893483877182, -0.2656732201576233, -0.27353864908218384, 0.1733701378107071, -0.11945998668670654, 0.21312618255615234, 0.3050508201122284, 0.380344957113266, -0.02871309220790863, 0.1639946699142456, -0.2235153764486313, -0.43332141637802124, 0.5773110389709473, -0.34610649943351746, -0.26596707105636597, 0.2418414205312729, 0.063814178109169, 0.3264976739883423, 0.24101999402046204, -0.45966631174087524, 0.08936508744955063, 0.35565489530563354, -0.23541313409805298, -0.15118557214736938, 0.1421463042497635, 0.22597043216228485, -0.06072034686803818, -0.08504001796245575, 0.4553109407424927, 0.24239638447761536, -0.24920397996902466, 0.17508167028427124, -0.17863863706588745 ]
https://github.com/huggingface/datasets/issues/2917
windows download abnormal
Hi ! Is there some kind of proxy that is configured in your browser that gives you access to internet ? If it's the case it could explain why it doesn't work in the code, since the proxy wouldn't be used
## Describe the bug The script clearly exists (accessible from the browser), but the script download fails on windows. Then I tried it again and it can be downloaded normally on linux. why?? ## Steps to reproduce the bug ```python3.7 + windows ![image](https://user-images.githubusercontent.com/52347799/133436174-4303f847-55d5-434f-a749-08da3bb9b654.png) # Sample code to reproduce the bug ``` ## Expected results It can be downloaded normally. ## Actual results it cann't ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.11.0 - Platform:windows - Python version:3.7 - PyArrow version:
41
windows download abnormal ## Describe the bug The script clearly exists (accessible from the browser), but the script download fails on windows. Then I tried it again and it can be downloaded normally on linux. why?? ## Steps to reproduce the bug ```python3.7 + windows ![image](https://user-images.githubusercontent.com/52347799/133436174-4303f847-55d5-434f-a749-08da3bb9b654.png) # Sample code to reproduce the bug ``` ## Expected results It can be downloaded normally. ## Actual results it cann't ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version:1.11.0 - Platform:windows - Python version:3.7 - PyArrow version: Hi ! Is there some kind of proxy that is configured in your browser that gives you access to internet ? If it's the case it could explain why it doesn't work in the code, since the proxy wouldn't be used
[ -0.12404900789260864, -0.20182494819164276, -0.07033970952033997, 0.18945927917957306, 0.21477347612380981, -0.11205017566680908, 0.027667324990034103, 0.07187370955944061, 0.2805812954902649, 0.08505608141422272, 0.1648733764886856, 0.11740712076425552, 0.1554812490940094, 0.10220398753881454, 0.15884718298912048, -0.2615039348602295, 0.030185557901859283, 0.03931036591529846, -0.16915158927440643, 0.008864611387252808, -0.3215380012989044, 0.08592835068702698, -0.30666911602020264, -0.11271406710147858, 0.16355864703655243, 0.032440029084682465, -0.28869643807411194, 0.3004709780216217, -0.2546002268791199, -0.16940465569496155, 0.09936968982219696, -0.07090851664543152, 0.18506620824337006, 0.35194993019104004, -0.00010874313011299819, 0.0813254863023758, 0.3922838568687439, 0.023531196638941765, 0.017427677288651466, -0.0581744909286499, -0.2938912510871887, -0.14136849343776703, -0.19119465351104736, -0.31517162919044495, 0.09970618039369583, 0.2347300797700882, 0.04543757438659668, -0.11122868955135345, 0.2443624883890152, 0.44914430379867554, 0.30608224868774414, 0.480937123298645, -0.1150028258562088, 0.05172691494226456, 0.45546290278434753, 0.05056522786617279, -0.18167667090892792, 0.24919924139976501, 0.30634936690330505, -0.14193780720233917, 0.25700220465660095, -0.05941108986735344, -0.12101145833730698, 0.011558514088392258, 0.031003765761852264, 0.12063539028167725, -0.049464643001556396, -0.5093157291412354, 0.12343184649944305, 0.17437463998794556, 0.31266194581985474, -0.15310907363891602, -0.1585402637720108, 0.11584737151861191, -0.14939965307712555, -0.1856970340013504, 0.27338749170303345, 0.27625957131385803, -0.13931673765182495, 0.18718221783638, -0.2805488705635071, 0.17438729107379913, -0.20568008720874786, 0.25969308614730835, -0.11910787969827652, 0.3299073874950409, -0.07595030218362808, 0.18944653868675232, -0.17101429402828217, 0.31671762466430664, 0.037710607051849365, -0.32725492119789124, -0.015677183866500854, -0.003989594057202339, 0.08568980544805527, 0.10570737719535828, 0.04935581237077713, 0.5118294358253479, 0.0573042631149292, 0.26434600353240967, 0.03348841145634651, -0.05601898580789566, 0.24108999967575073, 0.07001873105764389, 0.09027288854122162, 0.09497982263565063, -0.29586634039878845, 0.06604386866092682, 0.3817822337150574, 0.3139163851737976, -0.006579563021659851, -0.026200078427791595, -0.033049676567316055, -0.3155066967010498, 0.29651162028312683, -0.00539197213947773, 0.4860350489616394, -0.047427497804164886, -0.5569112300872803, 0.002634923905134201, 0.014628704637289047, 0.09089198708534241, -0.0023528235033154488, 0.25268614292144775, -0.3218323290348053, -0.02258072793483734, 0.12337014079093933, 0.3000146746635437, -0.12404515594244003, 0.1943565160036087, 0.004063232336193323, 0.18068140745162964, -0.2520693838596344, -0.22607307136058807, 0.34758344292640686, -0.06712910532951355, 0.12012495845556259, 0.1935616284608841, -0.09145879745483398, -0.042873576283454895, 0.013201229274272919, -0.08051557838916779, 0.02718307077884674, 0.4316020905971527, 0.1952558308839798, 0.37025389075279236, -0.009459570050239563, 0.07807862758636475, -0.07072699069976807, 0.20629316568374634, -0.1463155448436737, -0.02497047185897827, 0.021134357899427414, 0.260801762342453, -0.3265891671180725, -0.18856006860733032, 0.03979390487074852, -0.26646602153778076, -0.04091107100248337, -0.02938809245824814, 0.24959829449653625, -0.19647979736328125, -0.2891483008861542, -0.3841312825679779, 0.09299231320619583, 0.5247911810874939, -0.3482268154621124, 0.20685112476348877, 0.06146353855729103, -0.2714432179927826, 0.4014216959476471, 0.05860985070466995, 0.13095688819885254, 0.16051018238067627, -0.4302995204925537, 0.041505180299282074, 0.11713152378797531, -0.35013213753700256, -0.49704256653785706, 0.3584984540939331, -0.18995298445224762, 0.32069098949432373, 0.17838121950626373, 0.09198381751775742, 0.29391032457351685, -0.08338140696287155, -0.01203792542219162, 0.3098943829536438, -0.02248307503759861, 0.05824340134859085, -0.12457810342311859, -0.12976238131523132, 0.12999996542930603, 0.10852181911468506, 0.1208593100309372, 0.14329580962657928, 0.29323065280914307, -0.13603967428207397, 0.31640270352363586, 0.17881959676742554, 0.09648951143026352, 0.23754580318927765, 0.25501778721809387, 0.2680896818637848, 0.12365499138832092, -0.2269858717918396, 0.0015698075294494629, 0.2861068546772003, -0.08041796833276749, -0.1590326726436615, -0.24103297293186188, -0.221806600689888, -0.5582576990127563, 0.022449379786849022, -0.1886618584394455, -0.2219812572002411, 0.16530144214630127, 0.13726040720939636, 0.24955272674560547, 0.042693521827459335, 0.07544657588005066, 0.17933709919452667, -0.0071863047778606415, -0.06845944374799728, 0.07519038766622543, 0.360204815864563, -0.34395018219947815, -0.050523541867733, -0.09659592807292938, -0.07217582315206528, 0.22991716861724854, -0.05668551102280617, -0.015228340402245522, 0.19726824760437012, 0.0202613677829504, -0.04262919723987579, 0.03620932996273041, 0.048660069704055786, 0.016718078404664993, -0.18056084215641022, 0.27166616916656494, 0.5724841356277466, 0.2685573101043701, -0.09678363800048828, -0.03223009407520294, 0.005361646413803101, -0.07502549886703491, 0.017755985260009766, -0.022257735952734947, 0.14869721233844757, 0.1936410814523697, -0.18895964324474335, -0.10111125558614731, 0.002101019024848938, 0.36380013823509216, 0.061304979026317596, -0.09914259612560272, -0.16853362321853638, -0.16799350082874298, 0.1670813113451004, 0.5450260639190674, -0.2752332389354706, 0.30147916078567505, 0.07062169909477234, -0.0966641828417778, 0.20947295427322388, -0.18009081482887268, 0.10591842234134674, 0.6080446243286133, 0.03329680860042572, 0.11296123266220093, 0.3711540102958679, 0.008862924762070179, -0.14360599219799042, 0.21492882072925568, 0.1461232304573059, -0.298970490694046, 0.17300449311733246, -0.052078425884246826, 0.1769188791513443, -0.20951500535011292, -0.23760220408439636, -0.057157233357429504, 0.05267729610204697, -0.34522294998168945, 0.24298898875713348, -0.16144408285617828, -0.1740005910396576, -0.3291527330875397, -0.08695714175701141, -0.07667021453380585, -0.06329414248466492, 0.02469160594046116, 0.2807944118976593, -0.1450745016336441, -0.18183471262454987, -0.43709033727645874, 0.09259049594402313, 0.21191143989562988, -0.35901960730552673, -0.001514282077550888, 0.19920237362384796, -0.28637799620628357, 0.13335870206356049, 0.15175551176071167, -0.09841344505548477, 0.54853755235672, -0.5067274570465088, 0.05792117118835449, -0.36675989627838135, -0.10093607008457184, -0.06549402326345444, 0.055307865142822266, 0.3579995036125183, 0.18263933062553406, 0.18574996292591095, 0.054813675582408905, 0.10315616428852081, 0.20812447369098663, -0.23898038268089294, -0.17951545119285583, 0.15971535444259644, 0.056489430367946625, -0.39853692054748535, -0.2559880018234253, -0.24914640188217163, -0.2066611349582672, -0.3509722650051117, 0.016134753823280334, 0.11001028120517731, 0.12698742747306824, -0.10306894034147263, 0.00807675439864397, 0.03724571689963341, 0.07318678498268127, 0.22466936707496643, -0.08302631974220276, 0.026349905878305435, 0.38674813508987427, -0.042350172996520996, -0.6439449787139893, 0.24056023359298706, -0.0189744271337986, -0.35784000158309937, 0.3052424192428589, -0.5030601620674133, -0.1323918253183365, -0.2873797118663788, 0.2506050169467926, 0.08922718465328217, 0.2778797149658203, 0.3353273272514343, -0.27772778272628784, -0.024596471339464188, -0.3039756417274475, -0.06590718030929565, -0.29018598794937134, -0.10967361181974411, 0.24289649724960327, 0.18268552422523499, 0.3031283915042877, -0.02893793024122715, 0.28554582595825195, 0.22061151266098022, 0.1294393688440323, 0.43787091970443726, -0.3864389955997467, 0.47416216135025024, 0.0013005658984184265, -0.1765860617160797, 0.035116713494062424, -0.2722175717353821, 0.018008045852184296, 0.23765763640403748, 0.02238822728395462, -0.0049435291439294815, -0.23122906684875488, -0.1656050682067871, -0.2313094437122345, -0.24787135422229767, 0.1438777595758438, 0.1106838583946228, 0.040782682597637177, 0.12417009472846985, 0.22418904304504395, 0.10284054279327393, -0.15573453903198242, 0.1141643226146698, 0.5970376133918762, -0.2615623474121094, 0.14396676421165466, 0.02278134599328041, -0.16407807171344757, -0.4693880081176758, 0.07167482376098633, 0.10276420414447784, 0.44884222745895386, -0.03016716055572033, 0.04434242844581604, 0.21561986207962036, -0.1619967520236969, 0.7495211362838745, -0.21511909365653992, 0.3322595953941345, 0.20321230590343475, -0.006715703755617142, -0.37803593277931213, -0.258353054523468, -0.5120758414268494, 0.12309879809617996, 0.08177568018436432, -0.052924275398254395, -0.05552458018064499, 0.18523308634757996, 0.11505795270204544, 0.24686111509799957, -0.14289045333862305, -0.3871605098247528, -0.3885154724121094, -0.6134722828865051, -0.2445399910211563, 0.08509067445993423, 0.40387454628944397, -0.04350907355546951, -0.37968626618385315, -0.16640374064445496, -0.06428057700395584, 0.15337666869163513, -0.07251162827014923, -0.027729637920856476, 0.07959570735692978, -0.017775166779756546, 0.1780824512243271, -0.25067421793937683, 0.28624916076660156, -0.1739080846309662, 0.659617006778717, 0.10549145936965942, -0.14962266385555267, 0.16205886006355286, -0.26835712790489197, -0.2014201283454895, 0.20519766211509705, -0.16493450105190277, -0.2201997935771942, -0.07972124963998795, 0.049250658601522446, -0.329847127199173, -0.07996252924203873, 0.5729669332504272, -0.10168386250734329, -0.005418863147497177, -0.2596147656440735, 0.17877879738807678, 0.013897139579057693, -0.15584911406040192, 0.267474502325058, 0.03488553315401077, -0.09249892830848694, -0.10834091156721115, -0.28907185792922974, 0.651114284992218, 0.21450956165790558, 0.23586606979370117, 0.25903066992759705, -0.5253790020942688, 0.041985899209976196, 0.21368508040905, 0.07386608421802521, -0.2070637345314026, -0.2838789224624634, -0.03738340735435486, -0.13326212763786316, 0.08258624374866486, -0.034150317311286926, -0.2779368460178375, 0.22078780829906464, -0.08658202737569809, 0.17475739121437073, 0.274415522813797, -0.15815939009189606, -0.31310638785362244, 0.10845619440078735, -0.03281570225954056, 0.1951170712709427, 0.23858937621116638, 0.6629052758216858, -0.26621848344802856, 0.018496321514248848, -0.17159941792488098, -0.27796655893325806, -0.39651286602020264, 0.2550303339958191, -0.1340842843055725, 0.0074540916830301285, -0.15991593897342682, 0.13963425159454346, 0.02254987135529518, -0.014737393707036972, 0.0021663904190063477, 0.15718546509742737, -0.22981148958206177, 0.08573878556489944, 0.134160578250885, -0.08223630487918854, 0.2630041241645813, -0.09940259903669357, 0.11807365715503693, -0.24470728635787964, -0.4229421019554138, -0.07276066392660141, 0.021439753472805023, -0.0027241110801696777, -0.027712024748325348, 0.26394176483154297, 0.21877069771289825, -0.18823368847370148, -0.1784810870885849, -0.39208096265792847, 0.08386245369911194, -0.07089446485042572, 0.21751555800437927, 0.04904633015394211, 0.08854319900274277, 0.5029728412628174, -0.28613200783729553, -0.23590320348739624, -0.15548983216285706, 0.39320579171180725, -0.16737079620361328, -0.0755683034658432, 0.1102360263466835, 0.0948682427406311, -0.30697357654571533, -0.252346009016037, 0.013136208057403564, -0.3942268490791321, -0.2205287516117096, 0.05400700867176056, -0.05436970666050911, 0.2869073748588562, -0.14717631042003632, 0.009006056934595108, 0.1335749328136444, -0.05786917358636856, -0.01518450677394867, -0.6815165877342224, 0.1296806037425995, -0.2197965532541275, 0.412201464176178, 0.04664439707994461, 0.026245951652526855, -0.15720723569393158, 0.46316930651664734, -0.5489163398742676, -0.3702112138271332, -0.0008693793788552284, 0.049504682421684265, -0.12905795872211456, 0.17799796164035797, 0.13027729094028473, 0.19987152516841888, 0.011894430965185165, 0.12122809886932373, 0.0002451203763484955, -0.06618479639291763, -0.2484520673751831, -0.16501758992671967, 0.10459981113672256, -0.054088786244392395, -0.2632080912590027, 0.19007298350334167, -0.45111674070358276, 0.00914075504988432, 0.18899044394493103, 0.14730505645275116, 0.30437639355659485, -0.09577314555644989, 0.03665802255272865, 0.09566263854503632, 0.11463672667741776, -0.23988741636276245, 0.24710193276405334, -0.493673175573349, 0.5263617038726807, 0.005651501473039389, 0.1713125854730606, 0.22471922636032104, 0.006555184721946716, -0.0548018254339695, -0.28134962916374207, 0.06270475685596466, 0.18262004852294922, 0.3916453719139099, -0.11679688096046448, 0.26065465807914734, -0.0006226617842912674, 0.283252090215683, 0.5525354743003845, -0.3527147173881531, -0.08935075253248215, 0.14336279034614563, 0.2758113145828247, -0.2590067386627197, -0.03468522056937218, 0.08422885835170746, 0.10917233675718307, 0.057628754526376724, 0.1179925799369812, 0.055523741990327835, -0.2826644778251648, -0.09124846756458282, -0.0500900037586689, 0.43350303173065186, 0.3670791983604431, -0.18083800375461578, 0.39471399784088135, 0.006517406553030014, 0.14764954149723053, -0.05766952782869339, -0.021751482039690018, -0.048602260649204254, 0.42343610525131226, 0.04098034277558327, 0.06926584988832474, -0.10912560671567917, 0.025174569338560104, -0.1315763294696808, -0.20524565875530243, 0.07668435573577881, -0.20125696063041687, 0.025451019406318665, 0.09771039336919785, 0.07705165445804596, -0.15404793620109558, -0.27487510442733765, 0.21779774129390717, -0.3454124629497528, -0.06783759593963623, 0.06947236508131027, -0.012507375329732895, -0.30367565155029297, -0.07215086370706558, -0.1196657344698906, 0.02526727318763733, 0.1473330408334732, -0.005412951111793518, 0.25994205474853516, 0.07452714443206787, -0.23696686327457428, -0.3160703182220459, 0.012623520568013191, -0.20480337738990784, 0.11341197788715363, -0.2885006368160248, 0.0778895765542984, 0.365839421749115, 0.16743363440036774, 0.10783874988555908, 0.11485131084918976, 0.5545538663864136, 0.3852179944515228, -0.10724712908267975, -0.06110486760735512, 0.07846110314130783, -0.13316290080547333, -0.32581454515457153, 0.43635571002960205, 0.07163272053003311, 0.19309401512145996, 0.2363515943288803, 0.21840615570545197, -0.2301049828529358, 0.258409321308136, -0.030818458646535873, -0.0795634388923645, -0.058946385979652405, 0.17917460203170776, -0.25059646368026733, 0.09379593282938004, -0.38978931307792664, -0.10139281302690506, -0.4083535373210907, -0.0985802561044693, 0.1772201508283615, -0.08799585700035095, 0.16670379042625427, -0.3462209403514862, 0.10359330475330353, 0.03753010556101799, 0.21810032427310944, 0.3795774281024933, 0.31967228651046753, -0.08816644549369812, -0.05732316896319389, -0.5226142406463623, 0.34191450476646423, -0.2258431613445282, -0.5296081304550171, -0.0877917930483818, 0.044727399945259094, -0.6105855107307434, 0.07223610579967499, 0.34155380725860596, 0.26796194911003113, -0.0636080950498581, 0.3222125768661499, -0.13524244725704193, -0.3121241629123688, 0.033587198704481125, 0.1525716930627823, 0.07591844350099564, -0.5940468311309814, 0.29182058572769165, -0.4170547127723694, 0.16973567008972168, -0.2700897455215454, -0.1863706111907959, -0.011328808963298798, -0.00885600596666336, 0.5608648061752319, 0.1507779359817505, 0.5199137926101685, -0.19121915102005005, -0.1256827861070633, -0.4629920721054077, 0.07810165733098984, -0.11269555985927582, 0.2469523549079895, 0.11667592823505402, -0.1811445653438568, 0.019152553752064705, -0.2678033113479614, -0.060016416013240814, 0.3138541877269745, -0.03684137016534805, 0.09058056771755219, -0.05712326616048813, -0.07280772924423218, -0.18309286236763, 0.1488179862499237, 0.08115143328905106, 0.1466134637594223, -0.37879347801208496, -0.10185210406780243, -0.03377469629049301, -0.5434588193893433, 0.2741715610027313, -0.2698805332183838, -0.3332619071006775, -0.2687215507030487, 0.23119136691093445, -0.4032001495361328, 0.07304015755653381, -0.022186312824487686, 0.1500968635082245, 0.1658334732055664, -0.06748402118682861, 0.03998851403594017, 0.2936095893383026, -0.37484633922576904, 0.04060592129826546, 0.2576873004436493, 0.41791513562202454, -0.06966294348239899, -0.17129041254520416, 0.30699968338012695, -0.21486057341098785 ]
https://github.com/huggingface/datasets/issues/2913
timit_asr dataset only includes one text phrase
Hi @margotwagner, This bug was fixed in #1995. Upgrading the datasets should work (min v1.8.0 ideally)
## Describe the bug The dataset 'timit_asr' only includes one text phrase. It only includes the transcription "Would such an act of refusal be useful?" multiple times rather than different phrases. ## Steps to reproduce the bug Note: I am following the tutorial https://huggingface.co/blog/fine-tune-wav2vec2-english 1. Install the dataset and other packages ```python !pip install datasets>=1.5.0 !pip install transformers==4.4.0 !pip install soundfile !pip install jiwer ``` 2. Load the dataset ```python from datasets import load_dataset, load_metric timit = load_dataset("timit_asr") ``` 3. Remove columns that we don't want ```python timit = timit.remove_columns(["phonetic_detail", "word_detail", "dialect_region", "id", "sentence_type", "speaker_id"]) ``` 4. Write a short function to display some random samples of the dataset. ```python from datasets import ClassLabel import random import pandas as pd from IPython.display import display, HTML def show_random_elements(dataset, num_examples=10): assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset." picks = [] for _ in range(num_examples): pick = random.randint(0, len(dataset)-1) while pick in picks: pick = random.randint(0, len(dataset)-1) picks.append(pick) df = pd.DataFrame(dataset[picks]) display(HTML(df.to_html())) show_random_elements(timit["train"].remove_columns(["file"])) ``` ## Expected results 10 random different transcription phrases. ## Actual results 10 of the same transcription phrase "Would such an act of refusal be useful?" ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.4.1 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.5 - PyArrow version: not listed
16
timit_asr dataset only includes one text phrase ## Describe the bug The dataset 'timit_asr' only includes one text phrase. It only includes the transcription "Would such an act of refusal be useful?" multiple times rather than different phrases. ## Steps to reproduce the bug Note: I am following the tutorial https://huggingface.co/blog/fine-tune-wav2vec2-english 1. Install the dataset and other packages ```python !pip install datasets>=1.5.0 !pip install transformers==4.4.0 !pip install soundfile !pip install jiwer ``` 2. Load the dataset ```python from datasets import load_dataset, load_metric timit = load_dataset("timit_asr") ``` 3. Remove columns that we don't want ```python timit = timit.remove_columns(["phonetic_detail", "word_detail", "dialect_region", "id", "sentence_type", "speaker_id"]) ``` 4. Write a short function to display some random samples of the dataset. ```python from datasets import ClassLabel import random import pandas as pd from IPython.display import display, HTML def show_random_elements(dataset, num_examples=10): assert num_examples <= len(dataset), "Can't pick more elements than there are in the dataset." picks = [] for _ in range(num_examples): pick = random.randint(0, len(dataset)-1) while pick in picks: pick = random.randint(0, len(dataset)-1) picks.append(pick) df = pd.DataFrame(dataset[picks]) display(HTML(df.to_html())) show_random_elements(timit["train"].remove_columns(["file"])) ``` ## Expected results 10 random different transcription phrases. ## Actual results 10 of the same transcription phrase "Would such an act of refusal be useful?" ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 1.4.1 - Platform: macOS-10.15.7-x86_64-i386-64bit - Python version: 3.8.5 - PyArrow version: not listed Hi @margotwagner, This bug was fixed in #1995. Upgrading the datasets should work (min v1.8.0 ideally)
[ 0.16129040718078613, -0.13805419206619263, -0.020553534850478172, 0.22738602757453918, 0.11762408167123795, -0.15759752690792084, 0.2670057415962219, 0.2965661883354187, -0.5154975056648254, 0.28040811419487, 0.14544206857681274, 0.450861394405365, -0.09352809190750122, -0.18102112412452698, 0.06429950892925262, -0.057575419545173645, 0.12214259803295135, 0.24844612181186676, -0.0715341567993164, -0.2342919111251831, 0.13333429396152496, 0.3007955551147461, -0.25745582580566406, -0.06466187536716461, -0.2737525701522827, 0.08476117998361588, -0.07667000591754913, -0.2693382501602173, -0.05328650027513504, -0.4953397214412689, 0.15393958985805511, 0.011122141033411026, 0.10494488477706909, 0.3338853120803833, -0.0001155143982032314, -0.08517588675022125, 0.036936793476343155, 0.0938125029206276, -0.23824211955070496, -0.15776263177394867, -0.09692822396755219, 0.08862244337797165, -0.06983934342861176, -0.02705702930688858, -0.08341066539287567, 0.193747878074646, 0.05293452367186546, -0.098161980509758, 0.5147066712379456, 0.29158371686935425, 0.14006781578063965, -0.01024375855922699, -0.2521199584007263, -0.06595326960086823, 0.3198690712451935, 0.03130768984556198, 0.08507529646158218, -0.17802101373672485, 0.2137245237827301, 0.03147922456264496, -0.051667846739292145, 0.6180678009986877, -0.2813330292701721, 0.39801836013793945, -0.23591464757919312, 0.12423078715801239, -0.37117815017700195, -0.5308330059051514, 0.2668367624282837, 0.21616506576538086, 0.6465564966201782, -0.22962409257888794, -0.20446689426898956, -0.2378614842891693, 0.31990861892700195, -0.15606509149074554, -0.04217001050710678, -0.016178498044610023, -0.2728017270565033, 0.23506256937980652, -0.009495029225945473, 0.04764797165989876, -0.2204020619392395, 0.1288800686597824, 0.05581086128950119, -0.10741975903511047, -0.07313618808984756, 0.13855713605880737, -0.1771000772714615, 0.09940987080335617, -0.08586424589157104, 0.2703585922718048, -0.14426156878471375, 0.03412536159157753, -0.1497623771429062, -0.06749004125595093, 0.1925162523984909, -0.30494198203086853, 0.29171818494796753, -0.060220010578632355, 0.38555794954299927, 0.03743790462613106, -0.18567153811454773, -0.0881003811955452, 0.32392922043800354, 0.01980830356478691, -0.023367807269096375, 0.14967697858810425, 0.2298974245786667, -0.23406854271888733, -0.2531854808330536, 0.07371558248996735, -0.01441801805049181, 0.21627406775951385, 0.3318793773651123, -0.26502999663352966, 0.28292471170425415, -0.36764487624168396, -0.5658833980560303, 0.06424994021654129, -0.4400377869606018, -0.10303855687379837, -0.2528015673160553, 0.18167418241500854, 0.1693309098482132, 0.30092692375183105, 0.14492511749267578, 0.22267645597457886, 0.06933964788913727, -0.562832236289978, -0.18186217546463013, 0.02679801918566227, 0.20986038446426392, 0.030840901657938957, 0.2113288789987564, -0.32370662689208984, 0.3398512005805969, 0.34173399209976196, 0.19545277953147888, -0.4315994083881378, -0.2874119281768799, -0.13017693161964417, 0.025561153888702393, 0.009186122566461563, -0.026490546762943268, 0.3916679918766022, 0.07382063567638397, -0.01829003170132637, 0.007235616445541382, 0.06100674718618393, -0.10655616968870163, 0.00686437264084816, 0.21340124309062958, 0.13641028106212616, -0.0805877298116684, -0.1671144962310791, 0.12324858456850052, 0.36058756709098816, 0.07794483006000519, -0.30086997151374817, 0.0030108317732810974, -0.18274199962615967, -0.3919641673564911, -0.03865909203886986, 0.0773313120007515, 0.30246129631996155, -0.3355483412742615, 0.09542745351791382, 0.1785343438386917, 0.42139890789985657, 0.39447540044784546, 0.24845431745052338, -0.046510256826877594, 0.37343814969062805, -0.1168166771531105, 0.30014467239379883, 0.2041979283094406, -0.4621305465698242, -0.39205482602119446, 0.21123498678207397, -0.0496036633849144, 0.24641431868076324, 0.15489068627357483, -0.16278362274169922, 0.302733838558197, 0.1427076756954193, 0.37593555450439453, 0.1534782201051712, 0.14573611319065094, 0.033479250967502594, -0.24468885362148285, -0.057892605662345886, 0.08683107793331146, -0.013140768744051456, 0.00215352326631546, 0.09558341652154922, 0.03703850507736206, 0.23297055065631866, 0.5271511673927307, 0.07458406686782837, 0.09245140105485916, 0.10296748578548431, 0.16596494615077972, -0.10123170912265778, 0.2239779382944107, -0.2631007134914398, 0.2564857006072998, -0.04889781400561333, 0.20682726800441742, 0.2837989330291748, 0.15403105318546295, 0.07936736196279526, -0.3015449345111847, -0.21888816356658936, -0.29918837547302246, -0.3250727653503418, 0.11458151042461395, 0.32573723793029785, -0.014431608840823174, 0.042046260088682175, -0.18985795974731445, 0.3409906029701233, -0.2203269600868225, -0.07418577373027802, 0.023305905982851982, 0.09916513413190842, 0.06385665386915207, -0.24470725655555725, 0.5248856544494629, 0.25290000438690186, 0.1851496696472168, 0.20168443024158478, -0.1669408082962036, 0.22355175018310547, -0.014767616987228394, 0.02196783572435379, -0.2637169361114502, -0.32889288663864136, 0.10994820296764374, -0.5017576813697815, -0.11139505356550217, 0.2344704568386078, 0.3181719481945038, -0.004500221461057663, -0.303676038980484, -0.18347083032131195, 0.139008030295372, 0.2569389343261719, -0.05544401705265045, -0.06511898338794708, 0.3011586368083954, 0.0662531852722168, -0.35379910469055176, -0.32469770312309265, 0.2526901662349701, -0.2349805384874344, 0.26622170209884644, 0.020284689962863922, -0.34177690744400024, 0.15859916806221008, 0.39289480447769165, 0.2245115041732788, 0.08520885556936264, 0.29438844323158264, -0.24683237075805664, -0.02701757475733757, -0.12272897362709045, 0.09491206705570221, 0.29076534509658813, 0.2881048917770386, 0.054302167147397995, -0.3764551877975464, -0.12874890863895416, -0.11323214322328568, 0.13933582603931427, -0.13075658679008484, -0.35562944412231445, 0.43511703610420227, 0.3585452735424042, 0.08638758212327957, -0.44938355684280396, -0.13412897288799286, -0.1424044370651245, 0.47036778926849365, -0.3349605202674866, -0.23163245618343353, -0.43560534715652466, -0.12055200338363647, -0.10900525748729706, 0.06629138439893723, 0.07970404624938965, 0.22555088996887207, 0.2190563678741455, -0.012712355703115463, 0.005457010120153427, 0.1367986500263214, 0.1719905138015747, 0.2340623289346695, 0.07120516151189804, 0.11179853230714798, 0.08630456030368805, 0.31914034485816956, -0.3069572448730469, -0.024270150810480118, 0.025972291827201843, 0.2716125249862671, 0.10742898285388947, -0.14224685728549957, -0.16390204429626465, -0.40679657459259033, 0.05901802331209183, 0.2675642967224121, -0.3301687240600586, 0.5113489627838135, 0.11336365342140198, 0.16024896502494812, -0.2251662313938141, -0.313081294298172, 0.002672326285392046, -0.02688709832727909, -0.16868644952774048, 0.35556861758232117, 0.082943394780159, -0.005614028312265873, -0.048256270587444305, -0.6989744305610657, 0.0993930995464325, -0.25000885128974915, 0.23594297468662262, -0.03286723792552948, 0.21037855744361877, 0.3641354441642761, 0.06060750409960747, 0.08127029240131378, -0.0587117038667202, 0.20536991953849792, -0.4102103114128113, -0.25459301471710205, 0.35611042380332947, 0.2606045603752136, -0.33486929535865784, -0.34056973457336426, 0.05095828324556351, 0.26529502868652344, -0.032229144126176834, -0.4001086950302124, 0.1003541573882103, -0.26746565103530884, 0.14534835517406464, -0.2972603440284729, 0.282619446516037, 0.385467529296875, 0.012993866577744484, -0.14950484037399292, -0.16922158002853394, -0.10783369839191437, 0.26583537459373474, 0.3553732931613922, 0.005884326994419098, 0.10114691406488419, 0.06991356611251831, -0.059326253831386566, 0.3506980538368225, 0.6459598541259766, 0.20251601934432983, 0.26000672578811646, -0.17655399441719055, 0.09423504769802094, -0.03249376267194748, -0.39957985281944275, 0.02707977592945099, -0.11732494831085205, -0.06256751716136932, 0.49811989068984985, -0.08999563753604889, 0.053631387650966644, -0.1695878952741623, -0.05727722495794296, -0.32906273007392883, -0.1686403602361679, 0.06749211996793747, -0.235939621925354, 0.18397383391857147, 0.17477542161941528, 0.05282885581254959, 0.16195186972618103, 0.034735094755887985, -0.2861669361591339, -0.29883813858032227, 0.285173624753952, -0.14997239410877228, -0.08203001320362091, -0.28361135721206665, -0.3772887587547302, -0.12410123646259308, 0.1385834813117981, 0.5095544457435608, -0.2117001861333847, -0.03752101957798004, 0.3600183129310608, 0.29147815704345703, 0.38102829456329346, -0.3069942593574524, 0.09087716788053513, 0.010390406474471092, 0.22879090905189514, 0.005507877096533775, 0.005461286753416061, -0.520500898361206, -0.1967586725950241, -0.04750075563788414, -0.04303229600191116, -0.16689300537109375, -0.00801798515021801, 0.10895930975675583, 0.3927445113658905, -0.009747225791215897, -0.2408113330602646, -0.255769282579422, -0.07579314708709717, -0.33014175295829773, 0.1615658402442932, 0.3422311842441559, 0.044393375515937805, -0.1651332974433899, -0.12032507359981537, 0.16039864718914032, -0.0627516657114029, 0.5332369804382324, 0.0798596441745758, 0.3751767575740814, 0.0739651694893837, 0.30117475986480713, 0.2748411297798157, -0.35777994990348816, -0.2591431736946106, 0.3608153760433197, 0.10096929967403412, -0.1420256644487381, -0.003674490377306938, -0.346861869096756, 0.32895758748054504, 0.49315693974494934, -0.2231910079717636, 0.24192962050437927, -0.2970616817474365, 0.2568938136100769, -0.1529487669467926, 0.09574605524539948, 0.31952816247940063, -0.07498351484537125, -0.0751819834113121, -0.41028639674186707, 0.3822800815105438, -0.03649444505572319, -0.1979486346244812, 0.3445512652397156, 0.0909186452627182, -0.31038233637809753, 0.47125160694122314, -0.25788414478302, 0.8118338584899902, 0.22640737891197205, 0.36663031578063965, 0.3155016005039215, 0.1381518840789795, 0.32616421580314636, -0.19601014256477356, 0.09023313969373703, -0.022017668932676315, -0.001816936768591404, -0.021560396999120712, 0.05834298953413963, -0.07785672694444656, -0.04175978899002075, -0.5769283771514893, 0.1775287687778473, 0.06471621990203857, 0.02887110970914364, 0.18680255115032196, -0.01185259222984314, -0.1294962614774704, -0.10640734434127808, 0.12529945373535156, 0.032571181654930115, -0.38393884897232056, 0.30747324228286743, 0.3099324107170105, -0.024295736104249954, 0.031404297798871994, -0.5837310552597046, -0.8224819302558899, -0.03016814962029457, -0.08251767605543137, -0.22594097256660461, -0.19967980682849884, -0.3336215019226074, 0.3681985139846802, 0.2585996091365814, 0.1915540248155594, 0.3256590664386749, -0.13796798884868622, -0.08526448905467987, 0.36824333667755127, 0.27765169739723206, -0.2679564952850342, -0.025592196732759476, 0.14451852440834045, -0.08603119850158691, -0.388332337141037, 0.17660397291183472, 0.05515795946121216, 0.09896321594715118, -0.3880655765533447, 0.2538316249847412, -0.11468073725700378, -0.2331586480140686, 0.08573752641677856, 0.4289044439792633, 0.14151719212532043, -0.5119704604148865, 0.10320733487606049, 0.12417227029800415, -0.4588640332221985, 0.32868486642837524, 0.17258378863334656, -0.4755201041698456, -0.0637625902891159, 0.25933998823165894, 0.12836048007011414, 0.0002505891025066376, 0.664664626121521, -0.041482601314783096, 0.048388123512268066, -0.37047576904296875, 0.04069714993238449, -0.02092830277979374, -0.26419562101364136, 0.179112508893013, 0.05866285040974617, 0.17396260797977448, -0.22652727365493774, 0.25354957580566406, 0.026513995602726936, 0.2048027217388153, -0.2814754247665405, -0.3617311120033264, -0.06197728216648102, -0.03145415335893631, 0.12343582510948181, 0.05523992329835892, -0.29119670391082764, 0.11818553507328033, 0.06881625205278397, 0.31860893964767456, -0.2981918454170227, 0.005974660161882639, -0.051794420927762985, 0.21732042729854584, -0.08404315263032913, 0.08132041245698929, -0.037809208035469055, 0.08517305552959442, 0.20004016160964966, 0.31851547956466675, 0.06729203462600708, -0.15987008810043335, -0.306214302778244, 0.18384449183940887, 0.041743963956832886, 0.15626463294029236, -0.04076860100030899, 0.10010574758052826, 0.14923910796642303, -0.1337078958749771, -0.10101073980331421, 0.33458268642425537, 0.12536221742630005, 0.21837805211544037, -0.029632698744535446, 0.03707193583250046, 0.18515704572200775, -0.15986455976963043, -0.18397736549377441, -0.17245875298976898, 0.3399854600429535, 0.18061381578445435, 0.04874370992183685, -0.04819592833518982, 0.1186252161860466, 0.03992398828268051, -0.1340523064136505, 0.11869542300701141, -0.07783428579568863, -0.26557666063308716, 0.13337014615535736, 0.28768593072891235, -0.11947973072528839, 0.3786884844303131, -0.3459940552711487, -0.1118994653224945, 0.09119503200054169, 0.23514385521411896, -0.2654985785484314, -0.12371119856834412, -0.3232499957084656, -0.10655058920383453, -0.058308955281972885, 0.27840477228164673, -0.05983111634850502, -0.4723801016807556, 0.12146708369255066, -0.06493814289569855, 0.33602017164230347, -0.536003053188324, -0.07342144846916199, 0.3985144793987274, 0.014974195510149002, -0.3611198365688324, -0.19334129989147186, -0.015196502208709717, 0.020801611244678497, 0.5450989603996277, -0.36754387617111206, 0.1373579055070877, -0.3386062979698181, 0.02638833224773407, 0.1915486603975296, 0.025604452937841415, -0.03821948543190956, 0.40564218163490295, -0.3271886706352234, -0.0489630401134491, -0.07162469625473022, 0.30504733324050903, -0.11767295747995377, 0.03344578668475151, -0.12804807722568512, -0.051415059715509415, -0.12391949445009232, -0.12486191093921661, -0.338039368391037, -0.273428738117218, -0.23037610948085785, 0.006181858479976654, 0.09754195809364319, -0.01255529373884201, 0.1405138224363327, 0.19162198901176453, -0.26688438653945923, -0.5332418084144592, -0.19809386134147644, -0.03778368979692459, 0.17207664251327515, -0.390032559633255, 0.3403875231742859, 0.3084276020526886, -0.22177016735076904, 0.2584381401538849, 0.24336440861225128, 0.5199829339981079, 0.07158125936985016, 0.033447571098804474, 0.10651902854442596, -0.5706881284713745, -0.09190269559621811, -0.05172247812151909, 0.32976803183555603, -0.12424217164516449, 0.05875594913959503, 0.02186352014541626, 0.015872811898589134, -0.09563975036144257, 0.029347749426960945, 0.22854650020599365, -0.07562534511089325, -0.5632564425468445, 0.21907760202884674, -0.14116238057613373, 0.11173263937234879, 0.04065875709056854, 0.07498455047607422, -0.4736691117286682, 0.4417385458946228, 0.3421674966812134, 0.05759601294994354, -0.010626617819070816, 0.0021903477609157562, 0.0813886970281601, -0.12637415528297424, -0.11261306703090668, 0.26730480790138245, 0.15798690915107727, -0.2770342528820038, -0.15913550555706024, -0.6735779047012329, -0.07148288935422897, -0.04880526289343834, -0.004952635616064072, 0.0006291810423135757, 0.11898086965084076, 0.15868382155895233, 0.13626036047935486, 0.0692654401063919, -0.026040734723210335, -0.5322327017784119, 0.3291487991809845, -0.2154628485441208, -0.005381695926189423, -0.08778773248195648, 0.43666040897369385, 0.04148934781551361, -0.1064983457326889, 0.010835293680429459, 0.09469132870435715, 0.0340188667178154, 0.0655478909611702, 0.005946248769760132, 0.01756247878074646, -0.1206626296043396, 0.15823855996131897, 0.14234516024589539, 0.17081458866596222, -0.23485395312309265, 0.1895662397146225, -0.28325873613357544, 0.029292887076735497, -0.19824352860450745, 0.15615609288215637, 0.26981502771377563, 0.5158419609069824, -0.18345123529434204, -0.06868460774421692, -0.06360121816396713, 0.16536138951778412, 0.11124449968338013, -0.0649595633149147, -0.1914122849702835, 0.08976966142654419, -0.00869976356625557, 0.2714969217777252, -0.262226402759552, 0.1059424877166748, 0.003829430788755417, 0.002638351172208786, -0.49203944206237793, -0.7109150290489197, 0.45224592089653015, -0.40331485867500305, -0.5287758111953735, -0.07965654134750366, 0.5906733274459839, 0.2403547763824463, -0.032153576612472534, -0.7086960077285767, -0.03598963841795921, 0.3959989547729492, 0.24434900283813477, -0.30217087268829346, 0.21298587322235107, 0.12193979322910309, 0.008530773222446442, 0.014424681663513184, 0.6226136684417725, 0.31052452325820923, -0.23275426030158997, 0.26797157526016235, -0.4604579210281372 ]