html_url
stringlengths
51
51
title
stringlengths
6
280
comments
stringlengths
67
24.7k
body
stringlengths
51
36.2k
__index_level_0__
int64
1
1.17k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/4502
Logic bug in arrow_writer?
Great thanks for the response! So I'll just add that regression test and remove the current if-statement.
https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L475-L488 I got some error, and I found it's caused by `batch_examples` being `{}`. I wonder if the code should be as follows: ``` - if batch_examples and len(next(iter(batch_examples.values()))) == 0: + if not batch_examples or len(next(iter(batch_examples.values()))) == 0: return ``` @lhoestq
711
17
Logic bug in arrow_writer? https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L475-L488 I got some error, and I found it's caused by `batch_examples` being `{}`. I wonder if the code should be as follows: ``` - if batch_examples and len(next(iter(batch_examples.values()))) == 0: + if not batch_examples or len(next(iter(batch_examples.values()))) == 0: return ``` @lhoestq Great thanks for the response! So I'll just add that regression test and remove the current if-statement.
[ -1.2798582315444946, -0.8299263119697571, -0.7560417056083679, 1.6194308996200562, -0.0418599396944046, -1.2782090902328491, 0.16613104939460754, -0.9718484282493591, 1.6396671533584595, -0.823158860206604, 0.40606850385665894, -1.6151156425476074, 0.02449883334338665, -0.6042858362197876, -0.753452718257904, -0.8854254484176636, -0.32979530096054077, -0.7611119151115417, 1.1244295835494995, 2.5640041828155518, 1.2080527544021606, -1.4179128408432007, 2.8018863201141357, 0.597669780254364, -0.2734062671661377, -1.0617467164993286, 0.5276846885681152, 0.0017895624041557312, -1.1950174570083618, -0.4481874108314514, -0.9873123168945312, 0.008502846583724022, -0.5298137664794922, -0.5176702737808228, 0.07144347578287125, 0.4206976294517517, -0.23972029983997345, -0.40871766209602356, -0.4881450831890106, -0.8215472102165222, 0.47462400794029236, -0.3118354380130768, 0.8614321947097778, -0.3447846472263336, 1.7956606149673462, -0.531154453754425, 0.3613598346710205, 0.6126723289489746, 1.5596295595169067, 0.17108745872974396, -0.1098843589425087, 0.42066559195518494, 0.3266145586967468, 0.03422607481479645, 0.4739343523979187, 1.211084008216858, 0.5429812073707581, 0.5038811564445496, 0.6762114763259888, -2.2748897075653076, 1.3561909198760986, -1.0848637819290161, 0.1752924919128418, 1.2650586366653442, -1.1366233825683594, 0.24107900261878967, -1.7733163833618164, -0.10139501839876175, 0.43596866726875305, -2.320213794708252, 0.2860732972621918, -1.266681432723999, -0.4581722021102905, 1.0021684169769287, 0.36464759707450867, -1.2690808773040771, 0.06413280218839645, -0.39207643270492554, 1.0174596309661865, 0.3909136950969696, 1.056936502456665, -1.763284683227539, 0.015532251447439194, -0.3866732716560364, 0.02780596725642681, -1.3598486185073853, -1.5693690776824951, 0.5281434059143066, 0.6300097107887268, 0.6308707594871521, -0.054740048944950104, 0.9734281301498413, -0.9897885918617249, 0.7847478985786438, -0.8947345614433289, -1.6401569843292236, -1.4594806432724, -2.297334671020508, -2.2199740409851074, 0.7014173269271851, -0.48482564091682434, -0.5906691551208496, 2.0335488319396973, -1.0437136888504028, -1.7158735990524292, 1.1396186351776123, 0.24467159807682037, -0.07484176009893417, 2.3252601623535156, 0.24201877415180206, -0.7569477558135986, 0.42062070965766907, -0.8042538166046143, 0.8290764689445496, -0.33526116609573364, 1.441607117652893, 0.5331223011016846, -0.9556059837341309, 1.626065731048584, -0.3176265060901642, 0.474164217710495, -0.638472855091095, -0.5110746026039124, -0.8749643564224243, 0.41557252407073975, 2.0666050910949707, -0.3154585659503937, 1.5792126655578613, -0.3201746940612793, -1.4934046268463135, -1.4521461725234985, 0.9617607593536377, 0.5520491600036621, -0.7137641310691833, 0.19477619230747223, -0.5215246677398682, 0.18969754874706268, 0.03131112456321716, 1.1542168855667114, 1.297516107559204, 0.6185386776924133, -0.2739907205104828, -0.9638726711273193, 0.2948001027107239, -0.039949364960193634, -0.5686995387077332, -1.8217110633850098, -0.3765629231929779, 0.13703744113445282, 0.6578994989395142, -1.147535800933838, 1.7414662837982178, 0.8730878829956055, 1.8292940855026245, 1.0254151821136475, -0.17305904626846313, 1.4720040559768677, -0.03912776708602905, 1.9189300537109375, -0.45016801357269287, 0.6897505521774292, -0.34085556864738464, -1.1558150053024292, 0.8067352175712585, -0.4909708499908447, -2.0347695350646973, -0.792575478553772, -0.9219422936439514, -0.139912948012352, -0.8238325119018555, 1.0297322273254395, -0.4085584878921509, -1.4607583284378052, 0.21430516242980957, -0.6784223318099976, 0.19408099353313446, -1.3073593378067017, 0.36493587493896484, 0.7445542812347412, -0.6709503531455994, 0.05946721136569977, -0.26479867100715637, -1.277988076210022, -0.49436429142951965, 0.26243171095848083, 2.036705493927002, -0.7110683917999268, 0.9670226573944092, 0.9977361559867859, -0.7744483947753906, 0.014700226485729218, 0.33543023467063904, -0.38626915216445923, 0.9444403648376465, -1.0859010219573975, -0.31269821524620056, 1.2315152883529663, -0.1966398060321808, -0.6104363799095154, 1.4717727899551392, 0.8685590028762817, -0.9824993014335632, -0.23010428249835968, -0.18131130933761597, -0.8186840415000916, 0.15937285125255585, -1.5699172019958496, -0.22385753691196442, 0.4048807621002197, -1.461554765701294, -0.5706251263618469, -0.15602338314056396, 1.3421084880828857, -0.2020970582962036, 1.3956694602966309, -0.2651892602443695, -0.17707698047161102, -0.3334929645061493, -0.38297799229621887, 0.12662270665168762, -0.08424077183008194, -0.6061619520187378, 0.31113436818122864, -0.7725843787193298, 0.36379560828208923, 1.4491398334503174, 0.4064949154853821, 0.09348560869693756, 0.6039995551109314, 1.0837303400039673, 0.3334544599056244, -0.10056281834840775, -0.8826437592506409, -1.6595717668533325, 2.0605721473693848, -1.4279155731201172, 1.97615385055542, 0.787065327167511, -0.05896469205617905, -1.6756784915924072, -1.7947676181793213, 1.4000946283340454, 1.2046183347702026, 2.3067972660064697, 0.5573343634605408, 0.3964292109012604, -0.7777597904205322, -0.6907744407653809, 0.36474406719207764, -1.0415782928466797, -0.7871344089508057, 0.15919092297554016, 2.37449049949646, 1.7383695840835571, -0.45098406076431274, -0.1873389184474945, -1.0108304023742676, 1.1897028684616089, -0.21569402515888214, 0.25321000814437866, 1.8189845085144043, -0.2792821526527405, -1.2110962867736816, 1.124070644378662, -2.327929973602295, 0.11378169059753418, 2.120971202850342, 0.3454277813434601, 0.06454218178987503, -1.4000362157821655, -0.6247086524963379, -0.19323116540908813, -0.4164535701274872, -1.2102952003479004, 0.6250028610229492, -0.27802082896232605, -0.8589252233505249, -1.3556137084960938, 0.20977462828159332, -1.1722389459609985, -1.6972196102142334, 0.3451853394508362, 1.8845785856246948, 2.0650007724761963, -0.7847588658332825, 1.551188588142395, -0.25488942861557007, 0.33674156665802, 1.2077438831329346, 1.257904291152954, 3.1135311126708984, 1.8285421133041382, -1.2583606243133545, 0.7123249173164368, -0.12319439649581909, -0.6154749393463135, 1.332499623298645, -1.1972287893295288, 1.2281467914581299, -0.07723799347877502, -1.1631107330322266, -1.288695216178894, 0.8610421419143677, 0.4893112778663635, -0.046756915748119354, -0.4570394456386566, 1.1177220344543457, 0.07051730155944824, 1.221835970878601, 0.536780834197998, -0.2695860266685486, 0.5659281611442566, -0.5004073977470398, -0.4381098449230194, 1.57278573513031, 0.1847563534975052, -1.4217066764831543, -2.2992100715637207, -0.15638382732868195, -0.7504415512084961, 0.03026200272142887, -0.6613965630531311, -1.038233995437622, 1.568043828010559, 0.3324742019176483, -1.1500691175460815, -0.2659837305545807, -0.3625009059906006, -0.6428348422050476, 2.5466392040252686, -1.3050761222839355, -0.24326948821544647, -0.9589828848838806, -0.6571215391159058, 1.6020948886871338, -1.196408987045288, -0.2294543981552124, -0.9783176183700562, -0.5636863708496094, -1.2952628135681152, -0.5018360018730164, -0.061375558376312256, -0.850797176361084, 0.6167749166488647, 0.15425844490528107, -1.1566070318222046, -0.3321748673915863, -0.8628041744232178, 0.8966347575187683, -0.17677649855613708, 0.19845427572727203, 1.7816579341888428, 0.40704670548439026, -0.40023788809776306, 0.7936816811561584, 1.2314789295196533, 0.5119299292564392, -0.5603776574134827, 0.25788336992263794, -0.6280548572540283, 0.1917400360107422, -1.400313138961792, 0.36201658844947815, -2.8779983520507812, 0.6390049457550049, -0.0958961546421051, -0.10881755501031876, -0.04607846587896347, -1.3333699703216553, 1.2067927122116089, 2.5715057849884033, -1.2489944696426392, 0.5668368935585022, 0.3192531168460846, 1.190223217010498, -1.5595226287841797, 0.25736311078071594, -0.4540365934371948, 2.2047171592712402, 0.2205575853586197, 1.279710292816162, -0.5310928225517273, -2.193725824356079, 0.6294358968734741, -1.2421261072158813, -1.141421914100647, 0.7129777669906616, -0.8741269707679749, 0.14468148350715637, -1.3067642450332642, -0.2861297130584717, -0.91741943359375, -1.1544592380523682, 0.7484544515609741, 0.08012571930885315, 0.4149060845375061, -0.6077542304992676, 0.3462565541267395, -2.1702630519866943, -1.3570351600646973, -0.1149323508143425, -1.0516453981399536, 0.42879629135131836, -0.3583087921142578, 0.607525110244751, -0.1502496600151062, 0.07173381000757217, 0.3694901764392853, 1.5174839496612549, 3.4720993041992188, 0.16394048929214478, 0.3832668960094452, -0.13534650206565857, -0.8583056330680847, 1.5483310222625732, 0.9642118215560913, -0.1577727198600769, -0.551045835018158, -1.090396523475647, 1.372266411781311, 1.8436777591705322, 1.0231590270996094, 0.052399300038814545, -0.8050934076309204, -0.7231958508491516, -0.07167498767375946, 0.11301158368587494, 0.48975759744644165, 0.9239532947540283, 0.11082887649536133, 0.013232214376330376, 1.2991901636123657, 1.129103422164917, -0.5476545691490173, 0.4352371394634247, -0.9207934737205505, -0.3495178818702698, 0.3960835933685303, 0.22120250761508942, -0.06886161863803864, 0.39672961831092834, -0.9183025360107422, -0.29833993315696716, -0.2544308304786682, -0.9501091241836548, -0.7215850353240967, -0.4946728050708771, -0.3119993805885315, 1.7181925773620605, 0.04718899726867676, -0.5367878079414368, -0.15757626295089722, -0.8595820069313049, -0.17307153344154358, -1.100440502166748, 0.15451228618621826, -0.10223587602376938, -0.14624963700771332, -0.1608879119157791, 1.7164019346237183, -0.9670747518539429, -2.251743793487549, 0.2703388035297394, 0.21009860932826996, -0.3746270537376404, 0.14511971175670624, 1.6660397052764893, 0.4785517752170563, 1.3957709074020386, 1.3375991582870483, 1.001265287399292, -0.593338131904602, -1.2169972658157349, 0.7025514245033264, 0.8390255570411682, -1.4005225896835327, 0.8629806041717529, -0.04130701720714569, -0.49378177523612976, 0.654167652130127, 1.245002031326294, 0.5346463322639465, -1.9151936769485474, 0.8082264065742493, -0.8866899013519287, 0.803014874458313, 0.6800820231437683, 0.74503493309021, 0.24602998793125153, 0.9263748526573181, -1.1616437435150146, -1.2012521028518677, -0.754502534866333, -0.7721526026725769, 2.015429973602295, -0.2416611611843109, 0.5286402106285095, -0.2134721279144287, -1.2218832969665527, -0.1162300631403923, 0.7162572741508484, 0.2517201900482178, -0.4240395426750183, 0.8588333129882812, -0.7185220122337341, -1.1383328437805176, -1.4639915227890015, -0.5006014108657837, -1.0021188259124756, -0.9907338619232178, 0.9831961989402771, 0.6644806861877441, 0.33557412028312683, 1.9274057149887085, 0.6748002767562866, 0.2248464822769165, -2.512349843978882, 0.85901939868927, 0.3708035945892334, 0.01728823594748974, 0.8787029385566711, 0.24987424910068512, 1.158408761024475, -0.054112307727336884, 0.521099865436554, -2.256732940673828, 2.2179481983184814, -0.26505333185195923, 0.6851436495780945, -0.07457999140024185, -0.22271886467933655, 1.1373344659805298, 0.5361036062240601, 0.614374041557312, -1.2092671394348145, 0.7653344869613647, -0.6914535760879517, 1.1774260997772217, 0.9552416801452637, -0.8862380385398865, 0.009161129593849182, 1.4080212116241455, 0.3864583373069763, -0.5293996930122375, -0.9384023547172546, -0.8785632848739624, 1.0241379737854004, 1.6148804426193237, -0.017235923558473587, 0.008747562766075134, 0.7925163507461548, 0.669898509979248, -1.2155855894088745, 0.045190826058387756, -0.7191911339759827, -0.8047191500663757, 1.7891013622283936, 2.098625421524048, -0.10946649312973022, -0.27469709515571594, -0.7356293201446533, -1.2249749898910522, 0.8175991177558899, -0.020133066922426224, 0.05215980112552643, 0.6622317433357239, -0.5975240468978882, 1.132919430732727, 0.8817446827888489, 1.001720666885376, 0.0999584048986435, 0.19854885339736938, 0.4008229970932007, -0.2177388221025467, -1.1377029418945312, -0.34706491231918335, -1.1711679697036743, -2.6235132217407227, 0.4603251516819, -0.35147449374198914, -1.3450253009796143, 0.1415015012025833, -0.9857335686683655, 0.9230648875236511, -0.6185990571975708, -1.008431077003479, -1.4399266242980957, 0.12241948395967484, -0.1685272604227066, 0.8399975299835205, -1.6834739446640015, -0.11433682590723038, 1.3078277111053467, 0.9449659585952759, -0.639326274394989, 1.0589265823364258, 0.2119164913892746, 1.0685850381851196, 0.8595072627067566, -0.45286089181900024, 0.5175921320915222, 0.08191881328821182, -1.3316060304641724, 0.5426990389823914, 1.2284568548202515, 0.17140425741672516, 1.5738986730575562, -0.3482328951358795, -0.058453917503356934, 0.4759259819984436, -0.5611675381660461, -0.4715924859046936, -0.6461615562438965, 0.7609890103340149, 0.019668590277433395, -0.9068493247032166, 0.008855698630213737, -0.04756157845258713, -0.1730937510728836, 0.17747357487678528, -1.6170787811279297, -0.19542300701141357, -0.3178040385246277, -0.5975713729858398, -1.3254872560501099, -0.09070839732885361, 1.353550672531128, -0.8580887913703918, -0.20054228603839874, 0.4237591028213501, 0.4285380244255066, 0.46932023763656616, 0.6418843269348145, -0.732443630695343, -0.3346598148345947, -0.29550519585609436, -0.364700585603714, 0.3691388666629791, 1.152327299118042, -0.11163289844989777, -0.9424773454666138, 0.6494372487068176, -0.1703905314207077, 0.09045736491680145, 1.82712721824646, -0.03996030241250992, -0.7878036499023438, 0.26409149169921875, -0.6782103776931763, 1.9958992004394531, 1.5711112022399902, 1.316956639289856, -0.14658506214618683, -0.8589476346969604, 0.6554498076438904, -0.2722461223602295, -0.3529403507709503, 0.8417397141456604, 0.45044925808906555, -0.12990902364253998, -1.444897174835205, 0.6393576264381409, 1.278026819229126, -0.8806185722351074, -0.7903733253479004, -0.02659541741013527, -0.8037724494934082, 1.1288268566131592, 0.6574501991271973, 0.2989251911640167, 0.2872626781463623, 1.6900957822799683, 0.6412537097930908, -0.4567447602748871, 0.5125156044960022, 0.5091219544410706, -0.11345135420560837, -2.1714210510253906, -1.1132423877716064, 0.31187868118286133, -0.4346928596496582, -1.4883606433868408, 1.3317224979400635, -1.083526372909546, -0.9634876251220703, 0.6154643893241882, 0.14138031005859375, 1.5227593183517456, 0.2689438462257385, 1.6975253820419312, 1.9987874031066895, 0.8108100891113281, 0.35249871015548706, 1.2236799001693726, -0.11805642396211624, -0.3843025863170624, 1.783077359199524, -0.44363853335380554, 0.4905898869037628, 1.0556318759918213, -0.3511030673980713, -1.104416847229004, -0.8881290555000305, -1.2836048603057861, -0.7180370688438416, 1.0988737344741821, 0.01467505656182766, -1.2322373390197754, 0.1616857349872589, 1.5586957931518555, 0.16502365469932556, -0.1745111048221588, 0.6221937537193298, 0.4608944058418274, -0.7198349833488464, 0.0003661634400486946, -0.9270870685577393, 0.5588209629058838, -0.21431605517864227, -0.3901042938232422, 0.2948615849018097, 0.5034399628639221, 1.2183042764663696, -0.07098948955535889, 0.09702121466398239, 1.2614256143569946, -1.431451678276062, 1.4307453632354736, -0.6424804925918579, 0.24022306501865387, -2.3555514812469482, 1.4594084024429321, -0.9349002838134766, 1.9484421014785767, -2.705186367034912, 0.5135007500648499, -0.5795261859893799, -0.507550835609436, 0.3772045075893402, -0.4063745141029358, 0.13298732042312622, -0.1775965839624405, -1.0110392570495605, -0.172794908285141, -0.6642353534698486, 0.5484407544136047, 1.2038415670394897, 1.2519423961639404, -0.9863898158073425, -0.19674456119537354, -1.777542233467102, -0.10165704041719437, -0.5077118277549744, 0.2321704775094986, -2.038419008255005, -0.16391590237617493, -2.019338607788086, -2.3187882900238037, -1.2578718662261963, -0.7774947881698608, 1.0906455516815186, 0.1752876490354538, -0.7790810465812683, 1.1491576433181763, -0.3375949263572693, -1.680646538734436, 1.0505666732788086, -2.120968818664551 ]
https://github.com/huggingface/datasets/issues/4502
Logic bug in arrow_writer?
Hi @lhoestq , Thanks for your explanation. Now I get it that `{}` means the columns are different. But wouldn't it be nice if the code can ignore it, like it ignores `{"a": []}`? --- BTW, > There's a check later in the code that makes sure that the columns are the right ones, so I don't think we need to check for {} here I remember the error happens around here: https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L506-L507 The error says something like `arrays` and `schema` doesn't have the same length. And it's not very clear I passed a `{}`. edit: actual error message ``` File "site-packages/datasets/arrow_writer.py", line 595, in write_batch pa_table = pa.Table.from_arrays(arrays, schema=schema) File "pyarrow/table.pxi", line 3557, in pyarrow.lib.Table.from_arrays File "pyarrow/table.pxi", line 1401, in pyarrow.lib._sanitize_arrays ValueError: Schema and number of arrays unequal ```
https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L475-L488 I got some error, and I found it's caused by `batch_examples` being `{}`. I wonder if the code should be as follows: ``` - if batch_examples and len(next(iter(batch_examples.values()))) == 0: + if not batch_examples or len(next(iter(batch_examples.values()))) == 0: return ``` @lhoestq
711
130
Logic bug in arrow_writer? https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L475-L488 I got some error, and I found it's caused by `batch_examples` being `{}`. I wonder if the code should be as follows: ``` - if batch_examples and len(next(iter(batch_examples.values()))) == 0: + if not batch_examples or len(next(iter(batch_examples.values()))) == 0: return ``` @lhoestq Hi @lhoestq , Thanks for your explanation. Now I get it that `{}` means the columns are different. But wouldn't it be nice if the code can ignore it, like it ignores `{"a": []}`? --- BTW, > There's a check later in the code that makes sure that the columns are the right ones, so I don't think we need to check for {} here I remember the error happens around here: https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L506-L507 The error says something like `arrays` and `schema` doesn't have the same length. And it's not very clear I passed a `{}`. edit: actual error message ``` File "site-packages/datasets/arrow_writer.py", line 595, in write_batch pa_table = pa.Table.from_arrays(arrays, schema=schema) File "pyarrow/table.pxi", line 3557, in pyarrow.lib.Table.from_arrays File "pyarrow/table.pxi", line 1401, in pyarrow.lib._sanitize_arrays ValueError: Schema and number of arrays unequal ```
[ -1.213097095489502, -0.8448194861412048, -0.7004644274711609, 1.4571455717086792, -0.07593798637390137, -1.2719929218292236, 0.1512313038110733, -1.1133854389190674, 1.7003965377807617, -0.7664570808410645, 0.2993125021457672, -1.644561529159546, 0.04307735711336136, -0.5708096623420715, -0.7972399592399597, -0.8412755131721497, -0.3605349361896515, -0.8365755677223206, 1.0354630947113037, 2.5407021045684814, 1.1983275413513184, -1.4380536079406738, 2.7723865509033203, 0.6686476469039917, -0.2636439800262451, -0.9925392866134644, 0.4917862117290497, -0.050185248255729675, -1.2357999086380005, -0.4564923644065857, -0.96164870262146, -0.02149304375052452, -0.537513792514801, -0.5551105737686157, 0.07793370634317398, 0.41286420822143555, -0.24535983800888062, -0.39057743549346924, -0.574869692325592, -0.7703195214271545, 0.49792858958244324, -0.33834218978881836, 0.9714822173118591, -0.3009144961833954, 1.7816002368927002, -0.5083852410316467, 0.4218432307243347, 0.6748540997505188, 1.4441534280776978, 0.22207798063755035, -0.01932186633348465, 0.28813663125038147, 0.3572964668273926, 0.0018845535814762115, 0.5117913484573364, 1.1810808181762695, 0.6466465592384338, 0.48422157764434814, 0.7351199984550476, -2.2472195625305176, 1.3021312952041626, -1.0095893144607544, 0.19731105864048004, 1.2750513553619385, -0.9888387322425842, 0.29648101329803467, -1.8412758111953735, -0.03794848918914795, 0.5189030766487122, -2.2785325050354004, 0.2700115144252777, -1.327917218208313, -0.4716789722442627, 1.0013364553451538, 0.28393298387527466, -1.2279337644577026, 0.12629687786102295, -0.3945412039756775, 1.0296697616577148, 0.4496747851371765, 1.0930479764938354, -1.741208791732788, -0.014165842905640602, -0.31517019867897034, 0.15956442058086395, -1.2733869552612305, -1.5727026462554932, 0.5467510223388672, 0.640051543712616, 0.5657071471214294, -0.09080339223146439, 1.0377998352050781, -1.0686657428741455, 0.7642954587936401, -0.938636839389801, -1.628968358039856, -1.3661924600601196, -2.2675576210021973, -2.2909014225006104, 0.7332322597503662, -0.5537562966346741, -0.4905945658683777, 2.0659053325653076, -1.014999508857727, -1.6772245168685913, 1.0557401180267334, 0.2737484276294708, -0.037808604538440704, 2.3282766342163086, 0.2302057296037674, -0.7581155896186829, 0.4339052438735962, -0.7757308483123779, 0.7801687121391296, -0.37075281143188477, 1.3699792623519897, 0.4833715558052063, -0.9493260979652405, 1.5959692001342773, -0.41725918650627136, 0.5075335502624512, -0.669671893119812, -0.507880449295044, -0.7948416471481323, 0.378945916891098, 2.0002682209014893, -0.35512036085128784, 1.5551042556762695, -0.3283259868621826, -1.5667270421981812, -1.5195835828781128, 0.9090638160705566, 0.5572085976600647, -0.7808261513710022, 0.1247144564986229, -0.4565592110157013, 0.18577145040035248, -0.05934647470712662, 1.0952463150024414, 1.332006812095642, 0.7778688073158264, -0.2938966751098633, -0.9151877164840698, 0.2059733271598816, -0.10874591767787933, -0.6811441779136658, -1.7886347770690918, -0.3665761649608612, 0.17318058013916016, 0.614791989326477, -1.2279469966888428, 1.7891285419464111, 0.8466773629188538, 1.9081275463104248, 0.9663752317428589, -0.30640438199043274, 1.5531730651855469, 0.10760913044214249, 1.913413166999817, -0.46169188618659973, 0.6392016410827637, -0.3958800137042999, -1.2127964496612549, 0.8497435450553894, -0.36989277601242065, -1.989306926727295, -0.680831253528595, -0.8018043041229248, -0.1901966631412506, -0.7966417670249939, 0.8791712522506714, -0.30372169613838196, -1.4586035013198853, 0.2391214817762375, -0.6470775604248047, 0.1561221480369568, -1.2926030158996582, 0.33607155084609985, 0.7206555008888245, -0.6976532936096191, 0.08000664412975311, -0.26684391498565674, -1.2698659896850586, -0.48778459429740906, 0.23225925862789154, 1.964207410812378, -0.7189499139785767, 0.945947527885437, 1.1020188331604004, -0.6623932719230652, -0.005391271784901619, 0.3348775804042816, -0.36285918951034546, 0.8100722432136536, -1.1662477254867554, -0.375579833984375, 1.171221375465393, -0.17480093240737915, -0.5518860816955566, 1.342642903327942, 0.8107843995094299, -1.0448215007781982, -0.24373465776443481, -0.13946887850761414, -0.7848310470581055, 0.11463560163974762, -1.5384026765823364, -0.1580057442188263, 0.3958677351474762, -1.5031976699829102, -0.5170719623565674, -0.18330197036266327, 1.3106111288070679, -0.19121544063091278, 1.4027085304260254, -0.3091271221637726, -0.12287421524524689, -0.31138160824775696, -0.3903732895851135, 0.11779627948999405, -0.16987492144107819, -0.5936368107795715, 0.22126412391662598, -0.7820760607719421, 0.32984659075737, 1.4546173810958862, 0.3551292419433594, 0.061083629727363586, 0.4866044223308563, 1.1233305931091309, 0.3752732276916504, -0.006350439041852951, -0.8903554081916809, -1.5657800436019897, 2.0534250736236572, -1.5039913654327393, 2.001847505569458, 0.8366754651069641, -0.0172615647315979, -1.7124444246292114, -1.7977781295776367, 1.3211694955825806, 1.0952764749526978, 2.3564820289611816, 0.5572861433029175, 0.4312630891799927, -0.7956231236457825, -0.6068886518478394, 0.4035799205303192, -0.9823544025421143, -0.7373836636543274, 0.2161179929971695, 2.39803147315979, 1.6743026971817017, -0.4619993269443512, -0.26468634605407715, -0.9204847812652588, 1.2614728212356567, -0.19647525250911713, 0.27829721570014954, 1.923295021057129, -0.2437720000743866, -1.1528135538101196, 1.1843739748001099, -2.3973004817962646, 0.17053304612636566, 2.0639145374298096, 0.2772221267223358, 0.09687184542417526, -1.3965377807617188, -0.6933433413505554, -0.21802882850170135, -0.4620615541934967, -1.2306538820266724, 0.5601209402084351, -0.2936049997806549, -0.8359980583190918, -1.4545449018478394, 0.16368666291236877, -1.1944143772125244, -1.7519230842590332, 0.22222396731376648, 1.9684139490127563, 2.040736436843872, -0.8325807452201843, 1.5179370641708374, -0.29978907108306885, 0.19641752541065216, 1.2077549695968628, 1.2433834075927734, 3.1261963844299316, 1.817533016204834, -1.3126280307769775, 0.6887688040733337, -0.19945788383483887, -0.5207222104072571, 1.20090913772583, -1.141756534576416, 1.1866880655288696, -0.0922139436006546, -1.2033734321594238, -1.2112857103347778, 0.8937365412712097, 0.5125532150268555, -0.027914199978113174, -0.40867486596107483, 1.162888765335083, 0.1270071268081665, 1.322672724723816, 0.5802661180496216, -0.3320271074771881, 0.6175450682640076, -0.33698785305023193, -0.5166577100753784, 1.592604160308838, 0.15266016125679016, -1.3952339887619019, -2.3312463760375977, -0.22351394593715668, -0.8458563089370728, 0.0008341176435351372, -0.6618689894676208, -1.0617170333862305, 1.5906801223754883, 0.3574100136756897, -1.1725181341171265, -0.2708169221878052, -0.3516990840435028, -0.5799656510353088, 2.5970206260681152, -1.338599443435669, -0.21578674018383026, -0.920375406742096, -0.6445050835609436, 1.5782437324523926, -1.1869957447052002, -0.2313545197248459, -1.0515803098678589, -0.537735641002655, -1.29095458984375, -0.5705919861793518, -0.06011369824409485, -0.8048844337463379, 0.6660603284835815, 0.3245541453361511, -1.1338121891021729, -0.3421080410480499, -0.868017315864563, 0.9053478240966797, -0.13348056375980377, 0.1979016661643982, 1.8559366464614868, 0.41220641136169434, -0.41419970989227295, 0.724820613861084, 1.1479849815368652, 0.5473930835723877, -0.5638245940208435, 0.1747709959745407, -0.6899013519287109, 0.27053147554397583, -1.3941439390182495, 0.28084665536880493, -2.8590247631073, 0.6553002595901489, -0.11360087245702744, -0.056098297238349915, -0.04051557183265686, -1.317029356956482, 1.0945532321929932, 2.6277058124542236, -1.1174190044403076, 0.5404021739959717, 0.38711798191070557, 1.2224406003952026, -1.617762804031372, 0.2660926878452301, -0.3698604702949524, 2.1671199798583984, 0.2068173736333847, 1.249704360961914, -0.5158122777938843, -2.3350112438201904, 0.5643050074577332, -1.2421609163284302, -1.173972725868225, 0.7831113934516907, -0.8604860901832581, 0.08665537089109421, -1.381363034248352, -0.23238737881183624, -0.8880224227905273, -1.2016828060150146, 0.7438831329345703, 0.05490720272064209, 0.4866046607494354, -0.6736456155776978, 0.3906587064266205, -2.1629130840301514, -1.3460583686828613, -0.14563556015491486, -0.992300271987915, 0.45814749598503113, -0.34223541617393494, 0.6845938563346863, -0.16355270147323608, 0.010041408240795135, 0.38424375653266907, 1.5121731758117676, 3.4428486824035645, 0.20837591588497162, 0.35500428080558777, -0.2051560878753662, -0.9082387089729309, 1.4506113529205322, 0.9201981425285339, -0.22236280143260956, -0.5687841176986694, -1.0748172998428345, 1.2711567878723145, 1.9710623025894165, 1.0218501091003418, 0.03031907044351101, -0.8060207366943359, -0.7554640173912048, -0.0021626781672239304, 0.12464190274477005, 0.4343414306640625, 0.9368369579315186, 0.07483264803886414, 0.004806420765817165, 1.3729006052017212, 1.1599531173706055, -0.5127403736114502, 0.3763270080089569, -0.8655532002449036, -0.4298589527606964, 0.4438777267932892, 0.26445481181144714, -0.01880705915391445, 0.3640707731246948, -0.969621479511261, -0.24322615563869476, -0.33303433656692505, -0.9235087633132935, -0.7177390456199646, -0.4546963572502136, -0.27738121151924133, 1.7001385688781738, 0.08584573864936829, -0.5064881443977356, -0.025322163477540016, -0.8023515939712524, -0.1166515052318573, -1.1328492164611816, 0.14774419367313385, -0.1155041977763176, -0.07269507646560669, -0.0961325466632843, 1.7221808433532715, -0.9009177088737488, -2.0950331687927246, 0.18070434033870697, 0.2206447422504425, -0.35191336274147034, 0.232008159160614, 1.7835512161254883, 0.5141118168830872, 1.423307180404663, 1.3411777019500732, 0.9629872441291809, -0.6511688828468323, -1.2550766468048096, 0.7138598561286926, 0.8801877498626709, -1.389938235282898, 0.8444735407829285, -0.05629480630159378, -0.465036004781723, 0.6494989991188049, 1.2859888076782227, 0.46839264035224915, -2.0379128456115723, 0.8641398549079895, -0.9235700964927673, 0.7417038679122925, 0.691247820854187, 0.7543695569038391, 0.185280442237854, 0.8429813385009766, -1.1644400358200073, -1.1952946186065674, -0.7275905013084412, -0.7150300145149231, 1.978371262550354, -0.29659581184387207, 0.5494552850723267, -0.23076823353767395, -1.2991576194763184, -0.11618810147047043, 0.7206409573554993, 0.3310478627681732, -0.44847193360328674, 0.7917434573173523, -0.7183775305747986, -1.1135163307189941, -1.4012917280197144, -0.4924091696739197, -1.0238656997680664, -0.9536842703819275, 0.9805319905281067, 0.7255280017852783, 0.3926922380924225, 1.9147895574569702, 0.7056969404220581, 0.2380768358707428, -2.595358371734619, 0.8679941296577454, 0.3732191026210785, -0.07437856495380402, 0.9247845411300659, 0.31406334042549133, 1.103767991065979, -0.02562038227915764, 0.5686252117156982, -2.3908183574676514, 2.2380313873291016, -0.21659718453884125, 0.7278083562850952, -0.01685839146375656, -0.3119920790195465, 1.0876446962356567, 0.567839503288269, 0.543908417224884, -1.191335678100586, 0.6762905120849609, -0.6704720854759216, 1.1452504396438599, 0.897795557975769, -0.8948045372962952, 0.0313631072640419, 1.3541830778121948, 0.4012748897075653, -0.5194477438926697, -0.9732705354690552, -0.9216145277023315, 0.9449787735939026, 1.688217282295227, -0.07428742200136185, 0.02449863590300083, 0.8212484121322632, 0.6789195537567139, -1.2613619565963745, 0.07163961231708527, -0.7834779620170593, -0.8511898517608643, 1.7531839609146118, 2.063513994216919, -0.11491426825523376, -0.24186444282531738, -0.7035187482833862, -1.2802820205688477, 0.8276663422584534, -0.07027863711118698, 0.10695299506187439, 0.584803581237793, -0.6338603496551514, 1.14472234249115, 0.8313137888908386, 1.0087730884552002, 0.1543581485748291, 0.2772911489009857, 0.366330623626709, -0.3622379004955292, -1.084560513496399, -0.29516974091529846, -1.144506812095642, -2.5451431274414062, 0.49873629212379456, -0.23203304409980774, -1.4926717281341553, 0.07047481089830399, -0.932640552520752, 0.9061132669448853, -0.5632787346839905, -1.048230528831482, -1.4243814945220947, 0.23668289184570312, -0.14725711941719055, 0.9178022146224976, -1.6313689947128296, -0.14748825132846832, 1.2900772094726562, 0.9764608144760132, -0.6148931980133057, 0.984677255153656, 0.21673522889614105, 1.0464303493499756, 0.893794596195221, -0.39697936177253723, 0.5543436408042908, 0.08077841252088547, -1.3092950582504272, 0.4464675188064575, 1.2327697277069092, 0.18098482489585876, 1.5631742477416992, -0.41866207122802734, 0.041895218193531036, 0.41784635186195374, -0.5653567910194397, -0.4583760201931, -0.5594155192375183, 0.7155928015708923, -0.0037181535735726357, -0.8730024695396423, 0.005803282372653484, -0.05944819003343582, -0.16734397411346436, 0.13057850301265717, -1.4779309034347534, -0.2048177570104599, -0.35475480556488037, -0.5507504343986511, -1.2897011041641235, -0.061630330979824066, 1.3115507364273071, -0.7952478528022766, -0.21509864926338196, 0.44121843576431274, 0.4477934241294861, 0.4696502685546875, 0.6047844886779785, -0.7469025254249573, -0.3855655789375305, -0.29401662945747375, -0.4442855417728424, 0.33671265840530396, 1.2608720064163208, -0.042287759482860565, -0.9492517113685608, 0.631905198097229, -0.27810752391815186, 0.07432323694229126, 1.8485981225967407, 0.027608850970864296, -0.7536650896072388, 0.29193636775016785, -0.6793285012245178, 1.905491828918457, 1.7215430736541748, 1.2827121019363403, -0.16223368048667908, -0.9128822684288025, 0.6524339318275452, -0.38720083236694336, -0.36802390217781067, 0.9337222576141357, 0.4422154724597931, -0.15430907905101776, -1.481927514076233, 0.6306353211402893, 1.2801896333694458, -0.8344161510467529, -0.7453599572181702, 0.022588448598980904, -0.7358170747756958, 1.1709052324295044, 0.6667801737785339, 0.32868117094039917, 0.2685108184814453, 1.6914252042770386, 0.7573360204696655, -0.5044680833816528, 0.6041860580444336, 0.4971162974834442, -0.14566273987293243, -2.1892735958099365, -1.1409978866577148, 0.2889062166213989, -0.3812735676765442, -1.4989805221557617, 1.41654634475708, -1.079748272895813, -0.9989961981773376, 0.5411863923072815, 0.11255665868520737, 1.389169692993164, 0.32625752687454224, 1.6360340118408203, 2.100839614868164, 0.8493320345878601, 0.335517942905426, 1.2016390562057495, -0.1193874180316925, -0.4537675380706787, 1.7991087436676025, -0.49169662594795227, 0.5133046507835388, 1.072160005569458, -0.34855929017066956, -1.05881929397583, -0.8868827223777771, -1.2737419605255127, -0.7200460433959961, 1.1400675773620605, 0.017512502148747444, -1.1679400205612183, 0.27141958475112915, 1.685597538948059, 0.06250576674938202, -0.29747819900512695, 0.724452555179596, 0.43740883469581604, -0.763725996017456, -0.07961301505565643, -0.8558617830276489, 0.5166979432106018, -0.2154887467622757, -0.35426920652389526, 0.3388144373893738, 0.5179725289344788, 1.2845064401626587, -0.03370385989546776, 0.07496901601552963, 1.1961082220077515, -1.4473973512649536, 1.475878119468689, -0.6942151784896851, 0.3072414696216583, -2.3412411212921143, 1.4261186122894287, -0.8574327230453491, 1.9706645011901855, -2.59956955909729, 0.462110698223114, -0.5050689578056335, -0.4962535798549652, 0.29060623049736023, -0.41432198882102966, 0.1320750117301941, -0.10872142761945724, -1.042945146560669, -0.10012499243021011, -0.6757388114929199, 0.6431287527084351, 1.0921385288238525, 1.3550519943237305, -1.0285451412200928, -0.20019440352916718, -1.7127749919891357, -0.1454608142375946, -0.5620676875114441, 0.2060087025165558, -1.9267303943634033, -0.1853378415107727, -2.0652639865875244, -2.302940607070923, -1.3640198707580566, -0.8074641823768616, 1.060908555984497, 0.14643698930740356, -0.8656402826309204, 1.1628303527832031, -0.35459253191947937, -1.7998449802398682, 1.112522006034851, -2.136337995529175 ]
https://github.com/huggingface/datasets/issues/4502
Logic bug in arrow_writer?
> But wouldn't it be nice if the code can ignore it, like it ignores {"a": []}? I think it would make things confusing because it doesn't follow our definition of a batch: "the columns of a batch = the keys of the dict". It would probably break certain behaviors as well. For example if you remove all the columns of a dataset (using `.remove_colums(...)` or `.map(..., remove_columns=...)`), the writer has to write 0 columns, and currently the only way to tell the writer to do so using `write_batch` is to pass `{}`. > The error says something like arrays and schema doesn't have the same length. And it's not very clear I passed a {}. Yea the message can actually be improved indeed, it's definitely not clear. Maybe we can add a line right before the call `pa.Table.from_arrays` to make sure the keys of the batch match the field names of the schema
https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L475-L488 I got some error, and I found it's caused by `batch_examples` being `{}`. I wonder if the code should be as follows: ``` - if batch_examples and len(next(iter(batch_examples.values()))) == 0: + if not batch_examples or len(next(iter(batch_examples.values()))) == 0: return ``` @lhoestq
711
154
Logic bug in arrow_writer? https://github.com/huggingface/datasets/blob/88a902d6474fae8d793542d57a4f3b0d187f3c5b/src/datasets/arrow_writer.py#L475-L488 I got some error, and I found it's caused by `batch_examples` being `{}`. I wonder if the code should be as follows: ``` - if batch_examples and len(next(iter(batch_examples.values()))) == 0: + if not batch_examples or len(next(iter(batch_examples.values()))) == 0: return ``` @lhoestq > But wouldn't it be nice if the code can ignore it, like it ignores {"a": []}? I think it would make things confusing because it doesn't follow our definition of a batch: "the columns of a batch = the keys of the dict". It would probably break certain behaviors as well. For example if you remove all the columns of a dataset (using `.remove_colums(...)` or `.map(..., remove_columns=...)`), the writer has to write 0 columns, and currently the only way to tell the writer to do so using `write_batch` is to pass `{}`. > The error says something like arrays and schema doesn't have the same length. And it's not very clear I passed a {}. Yea the message can actually be improved indeed, it's definitely not clear. Maybe we can add a line right before the call `pa.Table.from_arrays` to make sure the keys of the batch match the field names of the schema
[ -1.1960030794143677, -0.9031552076339722, -0.7867310047149658, 1.5786449909210205, -0.08193223178386688, -1.2517402172088623, 0.1482325941324234, -1.0204709768295288, 1.7450873851776123, -0.7893421649932861, 0.3261573314666748, -1.6382675170898438, 0.12667705118656158, -0.5790365934371948, -0.8151842355728149, -0.8546457886695862, -0.4206702709197998, -0.7713597416877747, 1.0187535285949707, 2.556737184524536, 1.1824606657028198, -1.463474154472351, 2.6979641914367676, 0.6297022104263306, -0.1453072726726532, -1.011904239654541, 0.47101372480392456, -0.043902553617954254, -1.2481670379638672, -0.4575929045677185, -0.9301847219467163, 0.026366660371422768, -0.5579382181167603, -0.5891616344451904, 0.026750968769192696, 0.39661887288093567, -0.2936706840991974, -0.45599111914634705, -0.5276063680648804, -0.8543566465377808, 0.4536997079849243, -0.3559916913509369, 0.9210245013237, -0.32333046197891235, 1.8143784999847412, -0.49762433767318726, 0.41480717062950134, 0.680660605430603, 1.4587196111679077, 0.27421998977661133, -0.07112473994493484, 0.3486238121986389, 0.39691460132598877, 0.008779730647802353, 0.482144832611084, 1.1724753379821777, 0.6405696272850037, 0.5106057524681091, 0.7400006055831909, -2.264120578765869, 1.4011437892913818, -1.1268631219863892, 0.21021553874015808, 1.2460527420043945, -0.9931012988090515, 0.2626456618309021, -1.8055644035339355, -0.0729723572731018, 0.5183734893798828, -2.299962282180786, 0.23472367227077484, -1.3530360460281372, -0.41929471492767334, 1.0616943836212158, 0.34764695167541504, -1.20231294631958, 0.10649330914020538, -0.3760581314563751, 1.0111093521118164, 0.43991827964782715, 1.1029536724090576, -1.7867577075958252, -0.05199898034334183, -0.32458221912384033, 0.19661295413970947, -1.269487977027893, -1.5677173137664795, 0.5154244899749756, 0.6898341774940491, 0.5176172852516174, -0.0839679017663002, 1.0295056104660034, -0.9884687066078186, 0.7883277535438538, -0.9470927119255066, -1.681437373161316, -1.410064697265625, -2.182650566101074, -2.322054862976074, 0.7262434363365173, -0.50724196434021, -0.4910689890384674, 2.057953119277954, -1.0177321434020996, -1.6586061716079712, 1.1395337581634521, 0.22778521478176117, -0.06914154440164566, 2.3408870697021484, 0.15684160590171814, -0.7495999932289124, 0.4362570345401764, -0.7599123120307922, 0.8053097128868103, -0.33088237047195435, 1.361265778541565, 0.48265138268470764, -1.0011602640151978, 1.614780068397522, -0.40233364701271057, 0.45004963874816895, -0.6510844230651855, -0.4988039433956146, -0.7577974200248718, 0.4112178683280945, 1.9917465448379517, -0.34967750310897827, 1.6082336902618408, -0.34245049953460693, -1.513254165649414, -1.5663316249847412, 0.9725781679153442, 0.4990085959434509, -0.7739537358283997, 0.11151935160160065, -0.41040223836898804, 0.19536548852920532, -0.01866770163178444, 1.130720615386963, 1.3426889181137085, 0.7350949645042419, -0.3011619746685028, -0.9118704199790955, 0.20588178932666779, -0.09869162738323212, -0.6335192322731018, -1.7413907051086426, -0.38144728541374207, 0.13566060364246368, 0.6377241015434265, -1.1741219758987427, 1.7645719051361084, 0.8487834334373474, 1.8670265674591064, 1.049146056175232, -0.296404093503952, 1.533470869064331, 0.1221342384815216, 1.9269963502883911, -0.4964442253112793, 0.662403404712677, -0.4154601991176605, -1.1590889692306519, 0.8273427486419678, -0.34883877635002136, -1.988531231880188, -0.7173528075218201, -0.848876416683197, -0.17223945260047913, -0.7695473432540894, 0.9144182205200195, -0.29863789677619934, -1.425358533859253, 0.26598575711250305, -0.6938702464103699, 0.07721316814422607, -1.270922064781189, 0.35825154185295105, 0.7817509174346924, -0.7390656471252441, 0.17479978501796722, -0.2395821362733841, -1.2926955223083496, -0.4836585819721222, 0.2833110988140106, 1.9687776565551758, -0.7490912675857544, 0.9216753244400024, 1.0619064569473267, -0.6925057172775269, -0.04152059555053711, 0.35482048988342285, -0.3156118392944336, 0.8923333287239075, -1.0855003595352173, -0.3998591899871826, 1.2107535600662231, -0.21271921694278717, -0.5642656087875366, 1.4195228815078735, 0.7063120603561401, -0.9825668334960938, -0.20386916399002075, -0.10919737070798874, -0.8005188703536987, 0.11645076423883438, -1.5760968923568726, -0.1597258597612381, 0.37315985560417175, -1.5449162721633911, -0.5746344923973083, -0.17102624475955963, 1.2887535095214844, -0.21009650826454163, 1.434912085533142, -0.35488778352737427, -0.1387963742017746, -0.3733997642993927, -0.30825942754745483, 0.12166856229305267, -0.16428154706954956, -0.6182405352592468, 0.2534153461456299, -0.803951621055603, 0.34324491024017334, 1.4503179788589478, 0.40486374497413635, 0.06483960151672363, 0.49986690282821655, 1.1337296962738037, 0.4133472740650177, -0.03368333354592323, -0.8803577423095703, -1.5503586530685425, 2.102973699569702, -1.4219176769256592, 2.0204474925994873, 0.7996335029602051, -0.02521977759897709, -1.7082949876785278, -1.7965067625045776, 1.3487046957015991, 1.0907392501831055, 2.356523275375366, 0.5701543688774109, 0.3900839686393738, -0.7971354722976685, -0.5526305437088013, 0.4231879711151123, -1.026525855064392, -0.831386387348175, 0.2034754753112793, 2.3620622158050537, 1.6627241373062134, -0.41219574213027954, -0.2133205533027649, -1.017906904220581, 1.3154398202896118, -0.16229738295078278, 0.22456347942352295, 1.8645645380020142, -0.1568201780319214, -1.1851651668548584, 1.2003099918365479, -2.319338321685791, 0.12081612646579742, 2.0727412700653076, 0.3140369951725006, 0.06503999978303909, -1.4318782091140747, -0.6531071662902832, -0.19242680072784424, -0.405107706785202, -1.2320034503936768, 0.5385384559631348, -0.3419058620929718, -0.8161948323249817, -1.4452191591262817, 0.20345604419708252, -1.1196421384811401, -1.6851489543914795, 0.17269402742385864, 1.9114110469818115, 1.9985331296920776, -0.7220948934555054, 1.571154236793518, -0.245728999376297, 0.23217883706092834, 1.1986737251281738, 1.1815818548202515, 3.1544015407562256, 1.9023852348327637, -1.2743945121765137, 0.6223452687263489, -0.152063250541687, -0.5112760663032532, 1.2526445388793945, -1.2438888549804688, 1.2726852893829346, -0.1316508948802948, -1.2319961786270142, -1.2252700328826904, 0.9319959878921509, 0.48067694902420044, -0.008293801918625832, -0.45380279421806335, 1.1359777450561523, 0.03902029991149902, 1.295249104499817, 0.5491597652435303, -0.3229289650917053, 0.6355387568473816, -0.4545656442642212, -0.5381507873535156, 1.5627673864364624, 0.1887124925851822, -1.3833476305007935, -2.251647710800171, -0.15188691020011902, -0.7966179251670837, 0.04859846830368042, -0.6269129514694214, -1.005968451499939, 1.6417343616485596, 0.34850969910621643, -1.2327882051467896, -0.3009994328022003, -0.43297022581100464, -0.6817043423652649, 2.6130316257476807, -1.3739659786224365, -0.24963533878326416, -0.9869687557220459, -0.7062291502952576, 1.6072564125061035, -1.243055820465088, -0.21636946499347687, -1.0004973411560059, -0.5536762475967407, -1.2872463464736938, -0.5899094939231873, -0.10646285116672516, -0.7905632257461548, 0.732275128364563, 0.24317149817943573, -1.1496185064315796, -0.36780616641044617, -0.8337032794952393, 0.7688450813293457, -0.13600072264671326, 0.21075741946697235, 1.914690613746643, 0.4234636723995209, -0.37838807702064514, 0.7379347681999207, 1.1231036186218262, 0.552287757396698, -0.4956994354724884, 0.28272661566734314, -0.5983428955078125, 0.20812271535396576, -1.3178035020828247, 0.359724223613739, -2.8084826469421387, 0.6091750860214233, -0.03486505150794983, -0.05198588967323303, -0.029027648270130157, -1.2580193281173706, 1.1199451684951782, 2.6269097328186035, -1.1747082471847534, 0.5508490800857544, 0.33357885479927063, 1.1965287923812866, -1.6302930116653442, 0.29828065633773804, -0.3372563123703003, 2.1875381469726562, 0.2539702355861664, 1.2247589826583862, -0.5001499652862549, -2.297355890274048, 0.6135662794113159, -1.2382456064224243, -1.1874903440475464, 0.7497791647911072, -0.8679233193397522, -0.01921899802982807, -1.3287959098815918, -0.2914513349533081, -0.8242946863174438, -1.1886365413665771, 0.7856138348579407, 0.039262376725673676, 0.5006835460662842, -0.5872111916542053, 0.37979772686958313, -2.21567702293396, -1.3306983709335327, -0.18643225729465485, -1.059565544128418, 0.41052863001823425, -0.3401087522506714, 0.6660327315330505, -0.19759616255760193, -0.008269749581813812, 0.39180538058280945, 1.4404466152191162, 3.4919540882110596, 0.2701849043369293, 0.39354169368743896, -0.19360503554344177, -0.8926625847816467, 1.452174425125122, 0.952092707157135, -0.2654436528682709, -0.5513414740562439, -1.095080018043518, 1.3110637664794922, 1.9482886791229248, 0.9545879364013672, 0.04242333769798279, -0.7924434542655945, -0.7693053483963013, -0.03225281462073326, 0.14897960424423218, 0.47039657831192017, 0.9191517233848572, 0.15561138093471527, 0.05072830617427826, 1.3901132345199585, 1.2042829990386963, -0.4898456335067749, 0.4068523049354553, -0.8134788274765015, -0.42419230937957764, 0.4499599039554596, 0.3045216500759125, -0.0628412738442421, 0.3573414385318756, -0.9597082734107971, -0.22187931835651398, -0.4215361475944519, -0.9675888419151306, -0.682444155216217, -0.45911407470703125, -0.276322603225708, 1.6955193281173706, 0.14454038441181183, -0.5462226867675781, -0.13502268493175507, -0.8789584040641785, -0.15305525064468384, -1.0457826852798462, 0.23804062604904175, -0.07530081272125244, -0.15906596183776855, -0.09312693774700165, 1.7677640914916992, -0.8916400074958801, -2.150519847869873, 0.24129153788089752, 0.11431866139173508, -0.40415945649147034, 0.24885733425617218, 1.6609357595443726, 0.45464882254600525, 1.3986046314239502, 1.3853298425674438, 0.9120664000511169, -0.6321999430656433, -1.2802891731262207, 0.6520066857337952, 0.8514322638511658, -1.4378174543380737, 0.7990784645080566, -0.007575265131890774, -0.4091489911079407, 0.6540068984031677, 1.2318555116653442, 0.5172346830368042, -1.9888559579849243, 0.8003348112106323, -0.8768773078918457, 0.7822631597518921, 0.6741461753845215, 0.6487839818000793, 0.16685904562473297, 0.8101764917373657, -1.2035043239593506, -1.156558632850647, -0.7039976716041565, -0.7523340582847595, 1.9646236896514893, -0.24257245659828186, 0.5578693747520447, -0.1908998340368271, -1.3462047576904297, -0.136199489235878, 0.69101881980896, 0.3588531017303467, -0.5060806274414062, 0.7903696298599243, -0.6757137775421143, -1.1929266452789307, -1.4465078115463257, -0.5593925714492798, -1.0145189762115479, -0.9798873066902161, 0.9945877194404602, 0.724483072757721, 0.24008440971374512, 1.8858288526535034, 0.6578438878059387, 0.19432002305984497, -2.6270008087158203, 0.8434638977050781, 0.3791379928588867, -0.04630051553249359, 0.9095223546028137, 0.32087385654449463, 0.9798478484153748, -0.06657148152589798, 0.5473328828811646, -2.382981300354004, 2.327247142791748, -0.2864101529121399, 0.8074613809585571, -0.006430933251976967, -0.27867573499679565, 1.0819437503814697, 0.5727546811103821, 0.5981618762016296, -1.1928290128707886, 0.7097110152244568, -0.6772992014884949, 1.2023990154266357, 0.8817294239997864, -0.8393102884292603, -0.0678865909576416, 1.3511593341827393, 0.38998016715049744, -0.5446041226387024, -0.9395321607589722, -1.0131052732467651, 0.9467843770980835, 1.7051845788955688, -0.047368697822093964, 0.040712870657444, 0.8532894253730774, 0.6498740911483765, -1.2349203824996948, 0.09367185831069946, -0.8137475252151489, -0.8570773005485535, 1.6725176572799683, 2.081688165664673, -0.1028604805469513, -0.2878105640411377, -0.68785560131073, -1.2910070419311523, 0.7537484169006348, 0.020236272364854813, 0.11194486916065216, 0.6049889922142029, -0.6051612496376038, 1.1466455459594727, 0.9354556798934937, 0.9894406795501709, 0.19563205540180206, 0.27875983715057373, 0.3975681960582733, -0.3406856060028076, -1.118836760520935, -0.2940030097961426, -1.1513736248016357, -2.4850118160247803, 0.49554961919784546, -0.23410312831401825, -1.4363031387329102, 0.10588636249303818, -0.9192167520523071, 0.8603237867355347, -0.5784710645675659, -1.0872529745101929, -1.4049336910247803, 0.15031005442142487, -0.1344873458147049, 0.9184018969535828, -1.6597177982330322, -0.1262415051460266, 1.2680190801620483, 0.9630572199821472, -0.6541303992271423, 0.9918692708015442, 0.1858789175748825, 1.0896989107131958, 0.928205668926239, -0.4255217909812927, 0.48303017020225525, 0.09409232437610626, -1.3195664882659912, 0.46315744519233704, 1.1588904857635498, 0.16190671920776367, 1.5892566442489624, -0.4555320739746094, -0.025113988667726517, 0.37526702880859375, -0.5313237309455872, -0.4246647357940674, -0.6464220285415649, 0.724042534828186, -0.0419488400220871, -0.827336311340332, 0.07739828526973724, -0.02816564217209816, -0.10521426051855087, 0.12636691331863403, -1.5341349840164185, -0.1492156982421875, -0.30370816588401794, -0.5985344648361206, -1.2023651599884033, -0.13533727824687958, 1.3870623111724854, -0.8531886339187622, -0.18255166709423065, 0.4624362587928772, 0.48286113142967224, 0.4620445966720581, 0.5932862758636475, -0.6551694869995117, -0.4196479022502899, -0.23440344631671906, -0.3776201903820038, 0.3781754672527313, 1.265467882156372, -0.105772964656353, -0.953186571598053, 0.725693941116333, -0.2855081856250763, 0.03754359483718872, 1.8181416988372803, 0.030339820310473442, -0.760854959487915, 0.2637084126472473, -0.6566832065582275, 1.9796745777130127, 1.7437021732330322, 1.3099305629730225, -0.15124480426311493, -0.9685099124908447, 0.6546768546104431, -0.38563698530197144, -0.38004985451698303, 0.8409338593482971, 0.4381258189678192, -0.1542627066373825, -1.4174093008041382, 0.6176373362541199, 1.2201021909713745, -0.9094261527061462, -0.7894328236579895, -0.023931346833705902, -0.7364576458930969, 1.0757465362548828, 0.6862666606903076, 0.36238399147987366, 0.21417692303657532, 1.7219345569610596, 0.7079081535339355, -0.44860321283340454, 0.5854600071907043, 0.5200169086456299, -0.18960876762866974, -2.2131850719451904, -1.1946485042572021, 0.29937487840652466, -0.4503074288368225, -1.5299023389816284, 1.3912070989608765, -1.060775637626648, -0.969128429889679, 0.5515887141227722, 0.06418381631374359, 1.4740976095199585, 0.24653752148151398, 1.6115471124649048, 2.111708879470825, 0.8595569133758545, 0.3439117670059204, 1.2497506141662598, -0.1265607327222824, -0.4775983989238739, 1.8113211393356323, -0.43353089690208435, 0.48601192235946655, 1.0844191312789917, -0.32191240787506104, -1.048018217086792, -0.7987951040267944, -1.3027828931808472, -0.7365509867668152, 1.1141390800476074, 0.013587761670351028, -1.125240445137024, 0.2331777811050415, 1.6079075336456299, 0.12237082421779633, -0.2661118507385254, 0.5846605896949768, 0.4939737915992737, -0.7329660654067993, -0.05378388613462448, -0.8514745235443115, 0.5556656122207642, -0.2568632662296295, -0.4025473892688751, 0.36298418045043945, 0.34405243396759033, 1.2687954902648926, -0.023729808628559113, 0.09877127408981323, 1.2419140338897705, -1.4249873161315918, 1.5251986980438232, -0.6732850670814514, 0.2711927890777588, -2.345196008682251, 1.3766570091247559, -0.8573058843612671, 1.9344912767410278, -2.65096378326416, 0.4841349720954895, -0.5902422666549683, -0.4545782804489136, 0.38675981760025024, -0.38372132182121277, 0.11361439526081085, -0.16007542610168457, -1.0724215507507324, -0.17911601066589355, -0.6375617384910583, 0.5526853799819946, 1.1055576801300049, 1.351246953010559, -1.0092839002609253, -0.21411986649036407, -1.7589023113250732, -0.0995558574795723, -0.5577552318572998, 0.2868005633354187, -1.9116686582565308, -0.15393909811973572, -2.0110421180725098, -2.338183641433716, -1.3225232362747192, -0.7467422485351562, 1.0174407958984375, 0.11966140568256378, -0.8118267059326172, 1.1799925565719604, -0.34462234377861023, -1.7842084169387817, 1.0730257034301758, -2.111255645751953 ]
https://github.com/huggingface/datasets/issues/4498
WER and CER > 1
WER can have values bigger than 1.0, this is expected when there are too many insertions From [wikipedia](https://en.wikipedia.org/wiki/Word_error_rate): > Note that since N is the number of words in the reference, the word error rate can be larger than 1.0
## Describe the bug It seems that in some cases in which the `prediction` is longer than the `reference` we may have word/character error rate higher than 1 which is a bit odd. If it's a real bug I think I can solve it with a PR changing [this](https://github.com/huggingface/datasets/blob/master/metrics/wer/wer.py#L105) line to ```python return min(incorrect / total, 1.0) ``` ## Steps to reproduce the bug ```python from datasets import load_metric wer = load_metric("wer") wer_value = wer.compute(predictions=["Hi World vka"], references=["Hello"]) print(wer_value) ``` ## Expected results ``` 1.0 ``` ## Actual results ``` 3.0 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.3.0 - Platform: Linux-5.4.188+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.13 - PyArrow version: 6.0.1 - Pandas version: 1.3.5
712
40
WER and CER > 1 ## Describe the bug It seems that in some cases in which the `prediction` is longer than the `reference` we may have word/character error rate higher than 1 which is a bit odd. If it's a real bug I think I can solve it with a PR changing [this](https://github.com/huggingface/datasets/blob/master/metrics/wer/wer.py#L105) line to ```python return min(incorrect / total, 1.0) ``` ## Steps to reproduce the bug ```python from datasets import load_metric wer = load_metric("wer") wer_value = wer.compute(predictions=["Hi World vka"], references=["Hello"]) print(wer_value) ``` ## Expected results ``` 1.0 ``` ## Actual results ``` 3.0 ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.3.0 - Platform: Linux-5.4.188+-x86_64-with-Ubuntu-18.04-bionic - Python version: 3.7.13 - PyArrow version: 6.0.1 - Pandas version: 1.3.5 WER can have values bigger than 1.0, this is expected when there are too many insertions From [wikipedia](https://en.wikipedia.org/wiki/Word_error_rate): > Note that since N is the number of words in the reference, the word error rate can be larger than 1.0
[ -1.126644253730774, -0.8571447134017944, -0.753822386264801, 1.501531720161438, -0.07604732364416122, -1.2513377666473389, 0.16555975377559662, -0.9978092312812805, 1.7285288572311401, -0.7646906971931458, 0.41187167167663574, -1.6671760082244873, 0.018715595826506615, -0.573199450969696, -0.807906985282898, -0.806881844997406, -0.2786175012588501, -0.6668654680252075, 1.0547032356262207, 2.4901480674743652, 1.2706067562103271, -1.3392114639282227, 2.6620075702667236, 0.6212357878684998, -0.3008602261543274, -0.9816510677337646, 0.4935901165008545, -0.0626048892736435, -1.3607597351074219, -0.4183502495288849, -0.8694042563438416, -0.02636256441473961, -0.5720611214637756, -0.6052270531654358, 0.07933767884969711, 0.4089564383029938, -0.3523748517036438, -0.47539982199668884, -0.4415538012981415, -0.8296126127243042, 0.3821367621421814, -0.30943843722343445, 0.8906669020652771, -0.2899676263332367, 1.764283537864685, -0.6303555965423584, 0.4758950173854828, 0.6830179691314697, 1.3067286014556885, 0.24417991936206818, 0.02305496670305729, 0.35754039883613586, 0.3985541760921478, -0.04782348871231079, 0.5480047464370728, 1.2054710388183594, 0.5723183155059814, 0.5016220808029175, 0.7600839734077454, -2.2165021896362305, 1.3299612998962402, -0.977033257484436, 0.29038205742836, 1.2767480611801147, -0.9457575678825378, 0.23421089351177216, -1.7042338848114014, -0.07439770549535751, 0.5023192167282104, -2.3098719120025635, 0.2766238749027252, -1.3804962635040283, -0.49348294734954834, 0.9813715815544128, 0.34958890080451965, -1.3027420043945312, 0.06731819361448288, -0.3347570598125458, 0.94368976354599, 0.42038100957870483, 1.0877776145935059, -1.646318793296814, -0.12916475534439087, -0.2757592499256134, 0.145096555352211, -1.2404237985610962, -1.532788872718811, 0.5059378147125244, 0.6689079403877258, 0.5646612048149109, -0.1704627424478531, 1.0452653169631958, -0.9417772889137268, 0.7337986826896667, -0.943056046962738, -1.8235373497009277, -1.467729926109314, -2.28019118309021, -2.21728253364563, 0.7711344957351685, -0.4524436295032501, -0.4794890582561493, 2.085683584213257, -1.045505166053772, -1.849042534828186, 1.1368407011032104, 0.38311225175857544, -0.07580225169658661, 2.3416099548339844, 0.24495448172092438, -0.7388599514961243, 0.4304122030735016, -0.8138774633407593, 0.732596755027771, -0.3864056468009949, 1.2710453271865845, 0.42356249690055847, -1.0911469459533691, 1.555121660232544, -0.3633025586605072, 0.6023189425468445, -0.7648506164550781, -0.4008055031299591, -0.7232393026351929, 0.28194937109947205, 1.8992432355880737, -0.35570022463798523, 1.4552757740020752, -0.26716768741607666, -1.482816219329834, -1.578550934791565, 0.8090484142303467, 0.47884616255760193, -0.6879095435142517, 0.14837993681430817, -0.26632994413375854, 0.18392445147037506, -0.010000921785831451, 1.147473692893982, 1.263330101966858, 0.7405460476875305, -0.2742144465446472, -0.9170636534690857, 0.24413521587848663, -0.031120220199227333, -0.7052486538887024, -1.7551729679107666, -0.4212605655193329, 0.18839366734027863, 0.6233946084976196, -1.2148642539978027, 1.7852221727371216, 0.838559091091156, 2.015387535095215, 0.9449101686477661, -0.37756210565567017, 1.5573344230651855, 0.10129674524068832, 1.8853040933609009, -0.39158859848976135, 0.6424092650413513, -0.4697352945804596, -1.1975598335266113, 0.8373149633407593, -0.33573439717292786, -1.9569923877716064, -0.654876172542572, -0.9373757839202881, -0.158247172832489, -0.7908154129981995, 0.9423854947090149, -0.23828674852848053, -1.3774813413619995, 0.2310548722743988, -0.7712846398353577, 0.12140540778636932, -1.299504280090332, 0.2960220277309418, 0.7535561919212341, -0.6263904571533203, 0.09004155546426773, -0.2646210193634033, -1.2630637884140015, -0.5292972922325134, 0.3388400375843048, 1.7610994577407837, -0.713274359703064, 1.0082640647888184, 1.0130747556686401, -0.7159169316291809, -0.035009682178497314, 0.38512319326400757, -0.3455013036727905, 0.9507083892822266, -1.0085774660110474, -0.35216769576072693, 1.1576192378997803, -0.15336580574512482, -0.6929557919502258, 1.4275251626968384, 0.7779959440231323, -0.9530283212661743, -0.14673100411891937, -0.138567253947258, -0.7671268582344055, 0.12028060853481293, -1.6377129554748535, -0.0766817033290863, 0.4000260531902313, -1.510872483253479, -0.4859215319156647, -0.10901949554681778, 1.3269051313400269, -0.1791202574968338, 1.4352189302444458, -0.27944236993789673, -0.14987178146839142, -0.47199878096580505, -0.41323843598365784, 0.08625911921262741, -0.25583046674728394, -0.6587810516357422, 0.32338643074035645, -0.6719329953193665, 0.32251185178756714, 1.4156687259674072, 0.2991745173931122, 0.07554067671298981, 0.48750877380371094, 1.1823209524154663, 0.36131033301353455, -0.09232275933027267, -0.9553260803222656, -1.5959999561309814, 2.094954252243042, -1.4205986261367798, 2.016406297683716, 0.7934572100639343, -0.011620999313890934, -1.690900206565857, -1.9900130033493042, 1.43927800655365, 1.1219650506973267, 2.3801820278167725, 0.5581303834915161, 0.47645509243011475, -0.7628543972969055, -0.6459357142448425, 0.2872372567653656, -1.0231202840805054, -0.7752853631973267, 0.11151160299777985, 2.4304845333099365, 1.7626200914382935, -0.39247068762779236, -0.18529300391674042, -1.093748927116394, 1.415497064590454, -0.15231727063655853, 0.17092052102088928, 1.9265937805175781, -0.19967983663082123, -1.092612385749817, 1.2563291788101196, -2.2595341205596924, 0.17194132506847382, 2.0275678634643555, 0.20825396478176117, 0.12343758344650269, -1.3715037107467651, -0.6338207721710205, -0.27672773599624634, -0.4007421135902405, -1.2156002521514893, 0.48975810408592224, -0.16036581993103027, -0.7571868300437927, -1.4161993265151978, 0.18064367771148682, -1.1309939622879028, -1.7622736692428589, 0.15546905994415283, 1.943988561630249, 1.9868513345718384, -0.7541584372520447, 1.527721643447876, -0.26302558183670044, 0.1401894986629486, 1.2659759521484375, 1.1938297748565674, 3.2000515460968018, 1.9839560985565186, -1.3199023008346558, 0.7056704759597778, -0.09702093154191971, -0.5364171266555786, 1.2681981325149536, -1.1715569496154785, 1.2558008432388306, -0.17974251508712769, -1.2671382427215576, -1.238459825515747, 0.8994131684303284, 0.48120760917663574, -0.021676115691661835, -0.5584304332733154, 1.1498212814331055, 0.12771984934806824, 1.3194786310195923, 0.5673346519470215, -0.2562699615955353, 0.699865460395813, -0.3185940384864807, -0.3992643654346466, 1.5447686910629272, 0.21403828263282776, -1.3515067100524902, -2.4152395725250244, -0.17938725650310516, -0.9142242074012756, 0.06698393821716309, -0.6938797235488892, -1.016447901725769, 1.629321575164795, 0.4457518756389618, -1.1854217052459717, -0.2418334037065506, -0.3619539141654968, -0.6722729802131653, 2.687072992324829, -1.3919185400009155, -0.24464575946331024, -1.0964981317520142, -0.5869557857513428, 1.553762435913086, -1.231824517250061, -0.21137747168540955, -1.041443109512329, -0.4860619902610779, -1.2277318239212036, -0.5586497187614441, -0.029014289379119873, -0.8657370209693909, 0.7468793988227844, 0.09657862037420273, -1.3130559921264648, -0.3485601544380188, -0.9415673613548279, 0.819223165512085, -0.12282481044530869, 0.1571010947227478, 1.8544012308120728, 0.4234323799610138, -0.3939509093761444, 0.7056446075439453, 1.1225067377090454, 0.6160480976104736, -0.6032091975212097, 0.3999384343624115, -0.6792298555374146, 0.29975584149360657, -1.3481464385986328, 0.3149968683719635, -2.804349184036255, 0.5804423689842224, -0.08190558105707169, -0.0545935332775116, -0.07674802094697952, -1.300982117652893, 1.104933500289917, 2.545776128768921, -1.114842414855957, 0.5436944365501404, 0.23834821581840515, 1.2456835508346558, -1.6504353284835815, 0.22509127855300903, -0.4382576048374176, 2.1829707622528076, 0.1400878131389618, 1.172788381576538, -0.4327751696109772, -2.2827603816986084, 0.5578041076660156, -1.265641212463379, -1.056380033493042, 0.8285853266716003, -0.7597845196723938, 0.035108767449855804, -1.2860393524169922, -0.20339414477348328, -0.7603352665901184, -1.1742466688156128, 0.6931124925613403, 0.020077716559171677, 0.5743472576141357, -0.679166853427887, 0.3828123211860657, -2.147339105606079, -1.3784749507904053, -0.2045912891626358, -0.9454434514045715, 0.4367603659629822, -0.3477170467376709, 0.7197878956794739, -0.2304702252149582, -0.07251491397619247, 0.3244580924510956, 1.4282938241958618, 3.3290464878082275, 0.22328980267047882, 0.43424639105796814, -0.20330704748630524, -0.8932731747627258, 1.4162192344665527, 0.9244270920753479, -0.20724934339523315, -0.5417198538780212, -1.0290879011154175, 1.3061484098434448, 1.937741756439209, 0.9970886707305908, 0.06694620847702026, -0.8706343173980713, -0.8960116505622864, -0.05000323802232742, 0.11905252933502197, 0.44110244512557983, 0.8652491569519043, 0.20502644777297974, 0.0977555513381958, 1.3263154029846191, 1.1446254253387451, -0.40195879340171814, 0.40807920694351196, -0.8895828723907471, -0.47967228293418884, 0.5192174911499023, 0.38735613226890564, -0.010728241875767708, 0.3092338442802429, -1.0002237558364868, -0.29064449667930603, -0.37417685985565186, -0.8428541421890259, -0.7738562226295471, -0.4507489502429962, -0.35578060150146484, 1.7423168420791626, -0.08748894929885864, -0.4868377149105072, -0.001068590208888054, -0.7849241495132446, 0.03016943298280239, -1.0247211456298828, 0.26070812344551086, -0.1364692598581314, -0.04617069661617279, -0.04278538376092911, 1.6569252014160156, -0.950377881526947, -2.0710055828094482, 0.24984554946422577, 0.2103203386068344, -0.43834155797958374, 0.16362470388412476, 1.7262346744537354, 0.5851085186004639, 1.4293086528778076, 1.4094644784927368, 1.0005335807800293, -0.69985032081604, -1.3409942388534546, 0.6495184898376465, 0.9404803514480591, -1.4452308416366577, 0.8674736618995667, 0.041643328964710236, -0.49032190442085266, 0.5447002053260803, 1.2435791492462158, 0.4503040611743927, -2.0284485816955566, 0.7024673223495483, -0.8849289417266846, 0.8132169842720032, 0.786479651927948, 0.733611524105072, 0.2019166350364685, 0.7263962626457214, -1.2344242334365845, -1.099822998046875, -0.6589102745056152, -0.6764455437660217, 1.8814709186553955, -0.28066951036453247, 0.5080548524856567, -0.20821146667003632, -1.3945645093917847, -0.12487540394067764, 0.5949712991714478, 0.3809587359428406, -0.5193499326705933, 0.7811211943626404, -0.6369647979736328, -1.123517394065857, -1.4078583717346191, -0.5066787600517273, -1.0677075386047363, -0.9865449666976929, 0.9924910068511963, 0.8176809549331665, 0.35773661732673645, 1.832938313484192, 0.6636799573898315, 0.2257871776819229, -2.5868420600891113, 0.9369551539421082, 0.34654462337493896, -0.08161986619234085, 0.7785792946815491, 0.3319396376609802, 1.116579294204712, -0.11317292600870132, 0.5842875242233276, -2.4301869869232178, 2.3518829345703125, -0.20615217089653015, 0.6035921573638916, 0.05621396005153656, -0.21108053624629974, 1.0316108465194702, 0.4695950150489807, 0.5463647246360779, -1.1084372997283936, 0.7474889755249023, -0.6946539878845215, 1.252582311630249, 0.791479229927063, -0.871695876121521, -0.004755954258143902, 1.3430968523025513, 0.46909430623054504, -0.5237933397293091, -0.9277915954589844, -0.9991207122802734, 0.9343132972717285, 1.6884791851043701, 0.00969029776751995, 0.035087719559669495, 0.9133396148681641, 0.7385955452919006, -1.352044701576233, 0.12398579716682434, -0.6754357218742371, -0.7639567255973816, 1.6244579553604126, 2.0685248374938965, -0.15734601020812988, -0.26501157879829407, -0.802819013595581, -1.2156773805618286, 0.7052942514419556, 0.071527399122715, 0.08379610627889633, 0.7016478180885315, -0.6358386278152466, 1.1209259033203125, 0.851397693157196, 0.9011915922164917, 0.22294241189956665, 0.22397197782993317, 0.2548655569553375, -0.34264010190963745, -1.2295160293579102, -0.24483847618103027, -1.042966365814209, -2.6078782081604004, 0.48947444558143616, -0.20043504238128662, -1.378955364227295, 0.018546363338828087, -1.0666844844818115, 0.8111392855644226, -0.6340799331665039, -1.0734643936157227, -1.447278380393982, 0.19023750722408295, -0.16787205636501312, 0.8456313610076904, -1.6418044567108154, -0.08356750756502151, 1.2666466236114502, 0.9533026814460754, -0.6497645974159241, 1.0097863674163818, 0.1895175725221634, 1.0394539833068848, 1.0510609149932861, -0.38300782442092896, 0.518713653087616, 0.15762443840503693, -1.3604639768600464, 0.41029730439186096, 1.1824735403060913, 0.2256140559911728, 1.5304113626480103, -0.6582179665565491, 0.05931320786476135, 0.4081423580646515, -0.2947779893875122, -0.5240734815597534, -0.6770296692848206, 0.7669012546539307, 0.04464387893676758, -0.9772921204566956, 0.0877249464392662, -0.029744630679488182, -0.10496357828378677, 0.18088102340698242, -1.5535448789596558, -0.12458831071853638, -0.2528474032878876, -0.6944324970245361, -1.2614731788635254, -0.10431932657957077, 1.3405691385269165, -0.7664262056350708, -0.1595945656299591, 0.4561461806297302, 0.24305568635463715, 0.5228915810585022, 0.675135612487793, -0.6487221121788025, -0.3838537335395813, -0.19524581730365753, -0.38050928711891174, 0.43287599086761475, 1.3610073328018188, -0.08879335969686508, -0.9420404434204102, 0.5750682950019836, -0.39713943004608154, 0.08639948815107346, 2.014450788497925, 0.0011952118948101997, -0.8510472178459167, 0.32865890860557556, -0.6584058403968811, 1.957619547843933, 1.7287116050720215, 1.3277724981307983, -0.08029332756996155, -1.0723847150802612, 0.6864452362060547, -0.31806814670562744, -0.4205400347709656, 0.9323018193244934, 0.39733296632766724, -0.24208037555217743, -1.3730570077896118, 0.6425241827964783, 1.3366975784301758, -0.8868640065193176, -0.9091014266014099, 0.12347047030925751, -0.7983853220939636, 1.0564165115356445, 0.706415593624115, 0.2670527398586273, 0.30305978655815125, 1.5765403509140015, 0.8682786822319031, -0.47591471672058105, 0.6111864447593689, 0.4344360828399658, -0.13237757980823517, -2.065927028656006, -1.142958641052246, 0.3375431299209595, -0.4528772234916687, -1.5930496454238892, 1.382508635520935, -1.224435567855835, -0.9683228135108948, 0.6143216490745544, 0.12905175983905792, 1.4648350477218628, 0.3079751431941986, 1.6343410015106201, 2.0308597087860107, 0.8702292442321777, 0.3061835765838623, 1.2077724933624268, -0.20624001324176788, -0.43862372636795044, 1.712012767791748, -0.49165770411491394, 0.5132695436477661, 1.0337765216827393, -0.37762975692749023, -1.1446621417999268, -0.8081620335578918, -1.251451849937439, -0.7723572850227356, 1.1919021606445312, 0.15889422595500946, -1.150848150253296, 0.3596649169921875, 1.5870988368988037, -0.011407481506466866, -0.23321159183979034, 0.6538839936256409, 0.46167072653770447, -0.6956417560577393, -0.030008669942617416, -0.9363692998886108, 0.5544281601905823, -0.11728095263242722, -0.32339200377464294, 0.37698858976364136, 0.47526195645332336, 1.2796669006347656, 0.15180058777332306, 0.09316498786211014, 1.1918952465057373, -1.4255696535110474, 1.488484263420105, -0.7589085102081299, 0.30221131443977356, -2.3545539379119873, 1.499497413635254, -0.9513775706291199, 1.9330347776412964, -2.585451126098633, 0.45126619935035706, -0.5412015318870544, -0.4734625816345215, 0.2665930688381195, -0.30829286575317383, 0.17614825069904327, -0.17185337841510773, -1.1907719373703003, -0.12794575095176697, -0.8359377384185791, 0.5965729355812073, 1.1074048280715942, 1.3316007852554321, -1.0764391422271729, -0.30148136615753174, -1.7246122360229492, -0.0865282192826271, -0.5899986624717712, 0.3425133228302002, -1.9232919216156006, -0.21220989525318146, -1.9225172996520996, -2.365692138671875, -1.300256371498108, -0.8440439701080322, 1.0384913682937622, 0.1944425255060196, -0.7989606261253357, 1.128451943397522, -0.32807835936546326, -1.8309617042541504, 1.0676698684692383, -2.160222053527832 ]
https://github.com/huggingface/datasets/issues/4491
Dataset Viewer issue for Pavithree/test
This issue can be resolved according to this post https://stackoverflow.com/questions/70566660/parquet-with-null-columns-on-pyarrow. It looks like first data entry in the json file must not have any null values as pyarrow uses this first file to infer schema for entire dataset.
### Link https://huggingface.co/datasets/Pavithree/test ### Description I have extracted the subset of original eli5 dataset found at hugging face. However, while loading the dataset It throws ArrowNotImplementedError: Unsupported cast from string to null using function cast_null error. Is there anything missing from my end? Kindly help. ### Owner _No response_
713
38
Dataset Viewer issue for Pavithree/test ### Link https://huggingface.co/datasets/Pavithree/test ### Description I have extracted the subset of original eli5 dataset found at hugging face. However, while loading the dataset It throws ArrowNotImplementedError: Unsupported cast from string to null using function cast_null error. Is there anything missing from my end? Kindly help. ### Owner _No response_ This issue can be resolved according to this post https://stackoverflow.com/questions/70566660/parquet-with-null-columns-on-pyarrow. It looks like first data entry in the json file must not have any null values as pyarrow uses this first file to infer schema for entire dataset.
[ -1.1163567304611206, -0.8811220526695251, -0.826689600944519, 1.556506633758545, -0.13841474056243896, -1.3058148622512817, 0.00797364953905344, -0.9908121228218079, 1.6537331342697144, -0.8501465916633606, 0.268789142370224, -1.6711020469665527, 0.0808093324303627, -0.5354843735694885, -0.6235677003860474, -0.9465362429618835, -0.3224159777164459, -0.7669996023178101, 1.0193291902542114, 2.5118045806884766, 1.1945775747299194, -1.3400839567184448, 2.7778987884521484, 0.6539531946182251, -0.36870208382606506, -1.0331875085830688, 0.5183670520782471, 0.21873199939727783, -1.185459852218628, -0.44109708070755005, -0.884902834892273, -0.02297377586364746, -0.47189247608184814, -0.46562135219573975, 0.04438333585858345, 0.48195743560791016, -0.19925673305988312, -0.2905772626399994, -0.5094632506370544, -0.7389118075370789, 0.4718210995197296, -0.42293766140937805, 0.8568364977836609, -0.45447367429733276, 1.7483166456222534, -0.5590536594390869, 0.2786853015422821, 0.6807341575622559, 1.3731601238250732, 0.13895884156227112, -0.06341767311096191, 0.17647573351860046, 0.34886157512664795, -0.06258294731378555, 0.3789006471633911, 1.1025302410125732, 0.6010767817497253, 0.5842640399932861, 0.590949535369873, -2.126595973968506, 1.4006179571151733, -0.8838040828704834, 0.2645610272884369, 1.3538161516189575, -1.0760077238082886, 0.48935824632644653, -1.7022249698638916, -0.18360590934753418, 0.4203696548938751, -2.276501417160034, 0.18206629157066345, -1.2234044075012207, -0.575587272644043, 0.869854211807251, 0.2601411044597626, -1.2202136516571045, 0.058510225266218185, -0.5658270716667175, 1.0390384197235107, 0.5015187859535217, 1.1156501770019531, -1.5805282592773438, 0.0915197804570198, -0.30958399176597595, -0.011734584346413612, -1.441565990447998, -1.531255841255188, 0.4890432357788086, 0.7237958312034607, 0.7767342329025269, 0.015234787948429585, 0.848895251750946, -1.0012891292572021, 0.818913996219635, -0.8333970308303833, -1.5870511531829834, -1.2636905908584595, -2.3978066444396973, -2.275442361831665, 0.9321670532226562, -0.4517529606819153, -0.5609667897224426, 2.0241572856903076, -1.0159255266189575, -1.8291512727737427, 1.1957117319107056, 0.19381624460220337, 0.05281636118888855, 2.5086703300476074, 0.3240896463394165, -0.7129220962524414, 0.3844367563724518, -0.6528406739234924, 0.8445461988449097, -0.54060298204422, 1.3606009483337402, 0.551724910736084, -1.0852755308151245, 1.6417180299758911, -0.3892818093299866, 0.5431771278381348, -0.6686022877693176, -0.5075039267539978, -0.8453974723815918, 0.30207452178001404, 1.9036411046981812, -0.3780820667743683, 1.5769909620285034, -0.3718036115169525, -1.573644995689392, -1.5729297399520874, 0.7713441848754883, 0.4853544533252716, -0.7407615780830383, 0.18817974627017975, -0.3757355213165283, 0.009326974861323833, 0.006577604450285435, 1.0493048429489136, 1.1956700086593628, 0.6433122754096985, -0.3461364805698395, -0.8088890910148621, 0.3318609297275543, -0.020063716918230057, -0.5536065101623535, -1.924842357635498, -0.3051479458808899, 0.18757197260856628, 0.6505584716796875, -1.223751425743103, 1.6269725561141968, 0.9439745545387268, 2.018911838531494, 0.9296011328697205, -0.3281673192977905, 1.4412052631378174, -0.058213990181684494, 1.8263602256774902, -0.5040509104728699, 0.6939038634300232, -0.3612838685512543, -1.1458030939102173, 0.7775076627731323, -0.31766417622566223, -1.9624830484390259, -0.7771815657615662, -0.8826744556427002, -0.19927020370960236, -0.7872498035430908, 1.0008704662322998, -0.3116495609283447, -1.3670896291732788, 0.16584362089633942, -0.6363006830215454, 0.14448586106300354, -1.3346729278564453, 0.25128045678138733, 0.7726398706436157, -0.653095543384552, -0.03302185982465744, -0.3578990399837494, -1.3294421434402466, -0.5107544660568237, 0.3735615313053131, 1.9060747623443604, -0.7728031873703003, 0.9667154550552368, 0.9436856508255005, -0.7622118592262268, 0.08473607897758484, 0.3395353853702545, -0.3356967270374298, 0.8245026469230652, -1.107120394706726, -0.3530099093914032, 1.2179417610168457, -0.26527488231658936, -0.6297906041145325, 1.4233287572860718, 0.8296893239021301, -1.005948781967163, -0.24402570724487305, -0.24611586332321167, -0.8234159350395203, -0.054287221282720566, -1.6049113273620605, -0.15618205070495605, 0.17292089760303497, -1.3722281455993652, -0.3882714807987213, -0.2674556374549866, 1.3023303747177124, -0.21737052500247955, 1.3559502363204956, -0.2576330900192261, -0.3281075060367584, -0.3612135946750641, -0.4882543385028839, 0.17510373890399933, -0.22790251672267914, -0.6099734306335449, 0.3023974299430847, -0.845498263835907, 0.20232413709163666, 1.425157904624939, 0.4486813545227051, 0.13747580349445343, 0.6537991762161255, 0.9586519002914429, 0.33621710538864136, -0.19681307673454285, -0.8593315482139587, -1.5321002006530762, 1.9619710445404053, -1.4536041021347046, 1.9674715995788574, 0.9322711229324341, -0.12176790088415146, -1.8655954599380493, -1.8735146522521973, 1.354327917098999, 1.2069742679595947, 2.3408358097076416, 0.5662352442741394, 0.358873188495636, -0.8375565409660339, -0.7892460823059082, 0.2886955738067627, -1.228179693222046, -0.7711746692657471, 0.11751651763916016, 2.220660924911499, 1.7605668306350708, -0.5223262310028076, -0.18305560946464539, -1.036760687828064, 1.150786280632019, -0.008511185646057129, 0.18485359847545624, 2.085706949234009, -0.34466812014579773, -0.9068164229393005, 1.127135992050171, -2.318060874938965, 0.2603054642677307, 1.9459781646728516, 0.30410778522491455, 0.08450637757778168, -1.5275135040283203, -0.7047732472419739, -0.2553640604019165, -0.24871252477169037, -1.2633159160614014, 0.6619911789894104, -0.3337429165840149, -0.7964915037155151, -1.4928287267684937, 0.16822148859500885, -1.0641165971755981, -1.6880093812942505, 0.4119857847690582, 1.8850206136703491, 2.0992355346679688, -0.7524809837341309, 1.4187918901443481, -0.1598254144191742, 0.14958858489990234, 1.3000684976577759, 1.1825917959213257, 3.0433201789855957, 1.8862178325653076, -1.269944429397583, 0.6787706613540649, 0.014907251112163067, -0.4587950110435486, 1.1617377996444702, -1.0746440887451172, 1.2188048362731934, -0.20114456117153168, -1.2564109563827515, -1.3034900426864624, 0.9735672473907471, 0.44818806648254395, -0.0010191453620791435, -0.4802192449569702, 1.3869187831878662, 0.043208591639995575, 1.3549413681030273, 0.5312955379486084, -0.3514150083065033, 0.5841841697692871, -0.33383092284202576, -0.4997808337211609, 1.52535080909729, 0.19653870165348053, -1.575496792793274, -2.2683212757110596, -0.2329917550086975, -0.7930029630661011, -0.1682562679052353, -0.6411963105201721, -1.0670524835586548, 1.6000605821609497, 0.5206143260002136, -1.2138619422912598, -0.3233948349952698, -0.33777281641960144, -0.6885843276977539, 2.648076057434082, -1.411306619644165, -0.19333043694496155, -0.938866376876831, -0.47984743118286133, 1.680577039718628, -1.221245288848877, -0.10280010849237442, -1.0369274616241455, -0.7029666900634766, -1.3887083530426025, -0.5810981392860413, -0.012180965393781662, -0.9040530920028687, 0.7879104614257812, 0.11365724354982376, -1.0269466638565063, -0.30404481291770935, -0.8134860396385193, 0.8378304243087769, -0.10730712860822678, 0.3694460093975067, 1.9184147119522095, 0.4542793929576874, -0.3912346363067627, 0.7365338206291199, 1.1236705780029297, 0.5348009467124939, -0.7001243829727173, 0.16531500220298767, -0.6533679366111755, 0.2710295021533966, -1.2948623895645142, 0.28435301780700684, -3.0126097202301025, 0.7417996525764465, -0.14198900759220123, -0.09561103582382202, -0.08304399251937866, -1.2601295709609985, 1.0499368906021118, 2.6077215671539307, -1.1673154830932617, 0.5039476752281189, 0.3898561894893646, 1.1869065761566162, -1.554210901260376, 0.3699316382408142, -0.378153920173645, 2.181457281112671, 0.1292094588279724, 1.2791473865509033, -0.5615448951721191, -2.113168478012085, 0.6579421162605286, -1.2599929571151733, -0.9773030877113342, 0.8042722940444946, -0.8590952754020691, 0.07794978469610214, -1.481542706489563, -0.08745618909597397, -0.8147968053817749, -1.3818995952606201, 0.7778215408325195, 0.07168059051036835, 0.47557759284973145, -0.5294382572174072, 0.27210891246795654, -2.1461029052734375, -1.3284660577774048, -0.28668779134750366, -0.9628440141677856, 0.4261918365955353, -0.3634861409664154, 0.6601079106330872, -0.1666301190853119, 0.07459986954927444, 0.2755982279777527, 1.3104643821716309, 3.351624011993408, 0.17319437861442566, 0.3762906789779663, -0.1562490314245224, -0.9793047904968262, 1.4262279272079468, 1.033681035041809, -0.07011779397726059, -0.48451074957847595, -0.9320251941680908, 1.2842662334442139, 1.947759747505188, 1.0659477710723877, 0.10581459105014801, -0.8542275428771973, -0.7526933550834656, 0.02834838628768921, 0.1419183611869812, 0.5241837501525879, 0.8795309066772461, -0.08417489379644394, 0.10101468861103058, 1.5045346021652222, 1.3073437213897705, -0.5366195440292358, 0.42610985040664673, -0.9369031190872192, -0.38306039571762085, 0.4441911280155182, 0.32669007778167725, -0.006502982694655657, 0.3539901673793793, -0.9863074421882629, -0.2998891770839691, -0.19081144034862518, -0.9915465116500854, -0.7586468458175659, -0.4537124037742615, -0.45390862226486206, 1.6418370008468628, 0.12242434918880463, -0.5273519158363342, 0.03448859229683876, -0.7574644684791565, -0.24222332239151, -1.0667803287506104, 0.3067202568054199, -0.13955508172512054, -0.08468744903802872, -0.0372319296002388, 1.9415669441223145, -1.1020203828811646, -2.318394899368286, 0.3455701470375061, 0.2706218957901001, -0.3548337519168854, 0.09840530157089233, 1.7102659940719604, 0.47945329546928406, 1.4650644063949585, 1.3237758874893188, 1.0045822858810425, -0.7449039220809937, -1.2691360712051392, 0.7104567885398865, 0.9804866909980774, -1.5209918022155762, 0.7960303425788879, -0.16279833018779755, -0.48322737216949463, 0.7142038345336914, 1.3055883646011353, 0.5459264516830444, -1.9048398733139038, 0.8490898013114929, -0.8513208031654358, 0.7516692876815796, 0.7809995412826538, 0.7885658740997314, 0.22771808505058289, 0.7903043031692505, -1.2341296672821045, -1.1236363649368286, -0.890933632850647, -0.5499460697174072, 1.8284536600112915, -0.21312092244625092, 0.5109626650810242, -0.11348449438810349, -1.3532111644744873, -0.021487070247530937, 0.7075222730636597, 0.31548845767974854, -0.3536129593849182, 0.8171688914299011, -0.6651585102081299, -1.0596091747283936, -1.433759093284607, -0.4837055504322052, -0.9872583150863647, -0.9532907009124756, 1.0138436555862427, 0.864793598651886, 0.263729065656662, 1.9034266471862793, 0.6043457984924316, 0.29268625378608704, -2.6417996883392334, 0.9778533577919006, 0.253341943025589, 0.08592450618743896, 0.8966797590255737, 0.25570616126060486, 1.0836243629455566, 0.029058996587991714, 0.42365598678588867, -2.3893213272094727, 2.265690565109253, -0.23324589431285858, 0.6713975071907043, 0.06320961564779282, -0.22719791531562805, 1.1995011568069458, 0.5330033302307129, 0.5978348255157471, -1.1182034015655518, 0.7851871252059937, -0.5700002908706665, 1.226000189781189, 1.0020705461502075, -0.7723135352134705, 0.03262518346309662, 1.3379175662994385, 0.5090374946594238, -0.4712432622909546, -0.8534842133522034, -0.8866948485374451, 0.9630467891693115, 1.7276016473770142, -0.031359732151031494, 0.015926148742437363, 0.849896252155304, 0.5323771238327026, -1.2069495916366577, 0.03861195594072342, -0.7104781866073608, -0.6193456649780273, 1.6437718868255615, 1.9436709880828857, -0.08962129801511765, -0.12139428406953812, -0.7662216424942017, -1.0942920446395874, 0.7390075325965881, -0.02389129251241684, 0.02852751314640045, 0.7484133839607239, -0.6790400743484497, 1.1423091888427734, 0.7494144439697266, 0.921027660369873, 0.0566951222717762, 0.4350569546222687, 0.3625250458717346, -0.27730441093444824, -1.197702407836914, -0.368986576795578, -1.242437720298767, -2.46523118019104, 0.4287973940372467, -0.3809640407562256, -1.3711940050125122, 0.03497185558080673, -1.1426740884780884, 0.9564914107322693, -0.567571759223938, -1.0952281951904297, -1.5531126260757446, 0.19900256395339966, -0.3101280927658081, 0.9755076169967651, -1.5454930067062378, -0.11143895983695984, 1.3027323484420776, 0.9176928997039795, -0.6684853434562683, 1.0636804103851318, 0.22201873362064362, 1.1870142221450806, 0.7660086154937744, -0.40559905767440796, 0.5017526149749756, 0.1434558928012848, -1.3191161155700684, 0.5465449690818787, 1.1001334190368652, 0.23985973000526428, 1.3818581104278564, -0.46815070509910583, 0.05092690512537956, 0.5220456719398499, -0.5597580671310425, -0.5662966370582581, -0.5012917518615723, 0.8597500920295715, 0.019277434796094894, -0.9362172484397888, 0.11084028333425522, -0.1440735161304474, -0.23636052012443542, 0.23069195449352264, -1.5866508483886719, -0.3426564633846283, -0.3132898807525635, -0.6219792366027832, -1.333442211151123, 0.07817638665437698, 1.3568516969680786, -0.7991430759429932, -0.2385014295578003, 0.43925002217292786, 0.4201449453830719, 0.5422882437705994, 0.6433032751083374, -0.799196183681488, -0.3023239076137543, -0.22431465983390808, -0.28454411029815674, 0.36415329575538635, 1.2800567150115967, -0.12172461301088333, -1.0436232089996338, 0.7432079315185547, -0.43525928258895874, 0.09552571177482605, 2.0087168216705322, 0.09568105638027191, -0.9003478288650513, 0.33155739307403564, -0.6696441173553467, 1.9559988975524902, 1.667611837387085, 1.3310495615005493, -0.0694323182106018, -0.8802427649497986, 0.6188412308692932, -0.11125773191452026, -0.2850487530231476, 0.9451623558998108, 0.5189540386199951, -0.17198458313941956, -1.4506566524505615, 0.5393701195716858, 1.2398462295532227, -0.8734647631645203, -0.8340569138526917, 0.09946423023939133, -0.821662962436676, 1.0522828102111816, 0.7906325459480286, 0.429629385471344, 0.26049503684043884, 1.5694191455841064, 0.7059867978096008, -0.49745261669158936, 0.467623770236969, 0.43464231491088867, -0.11421173065900803, -2.0399091243743896, -0.9236793518066406, 0.3510667383670807, -0.4298609793186188, -1.4853440523147583, 1.4322928190231323, -1.1499789953231812, -0.8903946280479431, 0.5144186019897461, 0.1452857404947281, 1.4150398969650269, 0.22176924347877502, 1.6074650287628174, 1.9473917484283447, 0.9640353322029114, 0.1907012015581131, 1.359587550163269, -0.2544041872024536, -0.508612871170044, 1.772289752960205, -0.5085858106613159, 0.4769009053707123, 1.0809215307235718, -0.43787336349487305, -1.0679852962493896, -0.6944631934165955, -1.0138516426086426, -0.6131420731544495, 1.1768306493759155, 0.18643657863140106, -1.150429368019104, 0.13583140075206757, 1.519515872001648, 0.18201905488967896, -0.2985994517803192, 0.5662151575088501, 0.5176052451133728, -0.7642069458961487, -0.07773642241954803, -0.8582645058631897, 0.5211553573608398, -0.2408805936574936, -0.2983642518520355, 0.30470162630081177, 0.40854665637016296, 1.198188304901123, -0.04955845698714256, 0.17875327169895172, 1.1700321435928345, -1.34067702293396, 1.4054473638534546, -0.5864179134368896, 0.23265749216079712, -2.4699692726135254, 1.5148292779922485, -0.7676414251327515, 1.9143198728561401, -2.666828155517578, 0.48392099142074585, -0.6253020763397217, -0.4172479808330536, 0.2488122284412384, -0.40952393412590027, 0.12739035487174988, -0.1577824503183365, -1.054710030555725, -0.0330553874373436, -0.8069038987159729, 0.594666600227356, 1.3415672779083252, 1.2160784006118774, -1.0732086896896362, -0.2247626930475235, -1.736958384513855, -0.187888503074646, -0.790045976638794, 0.25767508149147034, -2.0826754570007324, -0.13645942509174347, -1.887343168258667, -2.3441898822784424, -1.4589024782180786, -0.8492123484611511, 1.0607510805130005, 0.2776948809623718, -0.9826520681381226, 1.1002256870269775, -0.3201390206813812, -1.8048003911972046, 1.1593854427337646, -2.190952777862549 ]
https://github.com/huggingface/datasets/issues/4490
Use `torch.nested_tensor` for arrays of varying length in torch formatter
Currently, we return a list of Torch tensors if their shapes don't match. If they do, we consolidate them into a single Torch tensor.
Use `torch.nested_tensor` for arrays of varying length in `TorchFormatter`. The PyTorch API of nested tensors is in the prototype stage, so wait for it to become more mature.
714
24
Use `torch.nested_tensor` for arrays of varying length in torch formatter Use `torch.nested_tensor` for arrays of varying length in `TorchFormatter`. The PyTorch API of nested tensors is in the prototype stage, so wait for it to become more mature. Currently, we return a list of Torch tensors if their shapes don't match. If they do, we consolidate them into a single Torch tensor.
[ -1.369017243385315, -0.8328054547309875, -0.7207700610160828, 1.2886748313903809, -0.2162240892648697, -1.263288140296936, 0.14423006772994995, -1.086323618888855, 1.7564018964767456, -0.8976894021034241, 0.21445563435554504, -1.6572134494781494, 0.0014691539108753204, -0.5708473324775696, -0.6913985013961792, -0.9168804883956909, -0.5540984272956848, -0.6594448685646057, 0.974669873714447, 2.4468414783477783, 1.245543360710144, -1.4931505918502808, 2.5117745399475098, 0.8489782810211182, -0.23579707741737366, -1.1287639141082764, 0.5578340888023376, 0.16183418035507202, -1.2162600755691528, -0.6756151914596558, -1.104416012763977, -0.025242168456315994, -0.49082791805267334, -0.5992638468742371, -0.17639586329460144, 0.2854434549808502, -0.13088800013065338, -0.4137917757034302, -0.3024071753025055, -0.6846112012863159, 0.23634396493434906, -0.3627907335758209, 1.0464781522750854, -0.42226478457450867, 1.6892837285995483, -0.39893025159835815, 0.4519743025302887, 0.7467076182365417, 1.4656145572662354, 0.21890006959438324, -0.2384244203567505, 0.021857520565390587, 0.45178747177124023, -0.2230076789855957, 0.4732072055339813, 1.0552034378051758, 0.6953890323638916, 0.5591192245483398, 0.5873510241508484, -2.1587910652160645, 1.415099024772644, -1.1515403985977173, 0.2531783878803253, 1.4748966693878174, -1.0223321914672852, 0.3692077398300171, -1.7941347360610962, -0.09897168725728989, 0.4523380696773529, -2.1755764484405518, 0.39695510268211365, -1.3505101203918457, -0.6739640831947327, 0.966690182685852, 0.33349794149398804, -1.3420674800872803, 0.1016535684466362, -0.28376495838165283, 0.9542813301086426, 0.5238737463951111, 1.0584003925323486, -1.6193923950195312, 0.11523383855819702, -0.5709100365638733, 0.1080133467912674, -1.1798744201660156, -1.3093641996383667, 0.637614905834198, 0.7408605813980103, 0.49062004685401917, 0.047120340168476105, 1.0065786838531494, -1.0992034673690796, 1.0028084516525269, -1.0271111726760864, -1.7081466913223267, -1.4558569192886353, -2.1389338970184326, -2.408771514892578, 0.895064651966095, -0.3953235149383545, -0.5290235877037048, 2.1137685775756836, -1.0325400829315186, -1.7836191654205322, 1.1308929920196533, 0.0969977080821991, -0.07216903567314148, 2.4160616397857666, 0.1023649051785469, -0.6192321181297302, 0.24216316640377045, -0.7729209065437317, 0.80830979347229, -0.6235215067863464, 1.4089020490646362, 0.39697277545928955, -1.0849528312683105, 1.7886536121368408, -0.4844721555709839, 0.5541622638702393, -0.7241549491882324, -0.7172598242759705, -0.698835015296936, 0.436073362827301, 1.879630446434021, -0.3162057101726532, 1.3810920715332031, -0.6209782958030701, -1.5790797472000122, -1.6007623672485352, 0.9386383295059204, 0.26214471459388733, -0.7690211534500122, 0.18313464522361755, -0.2143181562423706, -0.03582113981246948, 0.029705608263611794, 1.0507969856262207, 1.4235855340957642, 0.7556902170181274, -0.17126834392547607, -0.7911295294761658, 0.1354028731584549, -0.057191863656044006, -0.7502525448799133, -1.7927480936050415, -0.3960769772529602, -0.05546905845403671, 0.7425991892814636, -1.16866934299469, 1.9272798299789429, 0.9379363059997559, 1.9559673070907593, 0.9531616568565369, -0.4211485981941223, 1.4528555870056152, 0.0200087521225214, 1.8447914123535156, -0.4031842350959778, 0.7211650609970093, -0.37980061769485474, -1.1694196462631226, 1.048393964767456, -0.2597558796405792, -1.9135273694992065, -0.6308987736701965, -0.8824177384376526, -0.22999508678913116, -0.7221872806549072, 1.0161058902740479, -0.18684467673301697, -1.2140171527862549, 0.2977124750614166, -0.5629119873046875, 0.23787963390350342, -1.2130138874053955, 0.35195040702819824, 0.7533261179924011, -0.5370644927024841, 0.08395828306674957, -0.3367368280887604, -1.2691904306411743, -0.4171546697616577, 0.28344058990478516, 2.0051817893981934, -0.8080649375915527, 0.8245317339897156, 1.017981767654419, -0.6820913553237915, -0.032246850430965424, 0.3452300429344177, -0.11104884743690491, 0.7752615213394165, -1.2011065483093262, -0.39237186312675476, 1.2973287105560303, -0.1216021329164505, -0.46980902552604675, 1.5069632530212402, 0.6473989486694336, -0.981208086013794, -0.07547902315855026, -0.2867794334888458, -0.7812045216560364, 0.08241203427314758, -1.5424034595489502, -0.26488208770751953, 0.3800429701805115, -1.5264637470245361, -0.36855077743530273, -0.13908958435058594, 1.324137568473816, -0.12368811666965485, 1.526451587677002, -0.33958113193511963, -0.18564680218696594, -0.38323840498924255, -0.3035128116607666, 0.08379814028739929, -0.2858007252216339, -0.5119555592536926, 0.20117828249931335, -0.8370988965034485, 0.3365381062030792, 1.3963286876678467, 0.22823934257030487, 0.01199132576584816, 0.5463516116142273, 0.9522063136100769, 0.2766593396663666, -0.005187018774449825, -0.9777646660804749, -1.3982434272766113, 2.070167064666748, -1.4614955186843872, 1.953294277191162, 0.7537872195243835, -0.05310659855604172, -1.8369722366333008, -1.8172338008880615, 1.2648335695266724, 1.3210992813110352, 2.1238973140716553, 0.6735277771949768, 0.32716846466064453, -0.9394806623458862, -0.510880172252655, 0.40123772621154785, -1.0696979761123657, -0.7016586065292358, 0.17911922931671143, 2.3323724269866943, 1.7922741174697876, -0.5668143630027771, -0.19617365300655365, -1.1587620973587036, 1.4481369256973267, -0.16089443862438202, 0.09359980374574661, 1.9941047430038452, -0.4222643971443176, -1.132273554801941, 1.2047209739685059, -2.423025608062744, 0.1888878345489502, 2.0843803882598877, 0.28322920203208923, 0.13934753835201263, -1.5326098203659058, -0.6390368938446045, -0.09318863600492477, -0.3935346007347107, -1.1965041160583496, 0.6140296459197998, -0.3153098523616791, -0.6388344168663025, -1.6319588422775269, 0.40979528427124023, -1.1052489280700684, -1.6466253995895386, 0.39041173458099365, 1.866334319114685, 1.9549020528793335, -0.7473613023757935, 1.6321293115615845, -0.1635960042476654, 0.019098691642284393, 1.2660326957702637, 1.0270493030548096, 2.974513053894043, 2.051403284072876, -0.9913644790649414, 0.6606088280677795, -0.19434772431850433, -0.4769779145717621, 1.1269793510437012, -1.2654961347579956, 1.3202793598175049, -0.20051977038383484, -1.028212308883667, -1.3054120540618896, 0.9369450807571411, 0.32055509090423584, 0.16884513199329376, -0.6888261437416077, 1.2747284173965454, 0.12103458493947983, 1.230667233467102, 0.4417542815208435, -0.35563528537750244, 0.614017903804779, -0.4934426546096802, -0.3225753605365753, 1.3874880075454712, 0.3706223666667938, -1.3753329515457153, -2.2728474140167236, -0.06461247056722641, -0.762732982635498, -0.1401357203722, -0.6306931972503662, -0.9240740537643433, 1.6758289337158203, 0.5567113161087036, -1.142511248588562, -0.34970149397850037, -0.411040335893631, -0.6672966480255127, 2.765718936920166, -1.4379421472549438, -0.16983291506767273, -1.0357874631881714, -0.5289120674133301, 1.8237203359603882, -1.3124784231185913, -0.008198213763535023, -0.8906413912773132, -0.7189693450927734, -1.3467190265655518, -0.6107991933822632, -0.08940758556127548, -0.8775210976600647, 0.7477144002914429, 0.385614275932312, -1.090773105621338, -0.48957568407058716, -0.6766037344932556, 0.7510953545570374, -0.0034572724252939224, 0.3043028712272644, 2.0021376609802246, 0.21477645635604858, -0.2861630916595459, 0.5897638201713562, 1.0775710344314575, 0.45604681968688965, -0.40756040811538696, 0.18571637570858002, -0.7015277147293091, 0.4925623834133148, -1.243991732597351, 0.361177533864975, -2.928642749786377, 0.4851296842098236, -0.09384696930646896, -0.03753979876637459, -0.15955622494220734, -1.3952007293701172, 1.2264095544815063, 2.47051739692688, -1.2553410530090332, 0.4770098328590393, 0.16912201046943665, 1.1396976709365845, -1.248053789138794, 0.43461379408836365, -0.4117400348186493, 2.032877206802368, 0.1741188019514084, 1.1656142473220825, -0.45231688022613525, -2.295381784439087, 0.628325343132019, -1.1458476781845093, -1.2363570928573608, 0.6246034502983093, -0.8150115013122559, -0.18909373879432678, -1.366536259651184, -0.22937938570976257, -0.8619222640991211, -1.281674861907959, 1.0747941732406616, 0.2397223562002182, 0.44160130620002747, -0.7342929244041443, 0.5055722594261169, -2.274083375930786, -1.3404982089996338, -0.3425622582435608, -0.9104866981506348, 0.3443632125854492, -0.23965883255004883, 0.463128000497818, -0.1388179063796997, 0.12348904460668564, 0.18051157891750336, 1.3453996181488037, 3.353978157043457, 0.07507599890232086, 0.5338329672813416, -0.2582736015319824, -0.9861962199211121, 1.401721477508545, 1.007086992263794, -0.03179086744785309, -0.6124608516693115, -0.917120635509491, 1.4033385515213013, 1.8388276100158691, 0.8077812790870667, 0.056311242282390594, -0.9244784712791443, -0.5140727162361145, -0.10564292967319489, 0.3464653491973877, 0.40973755717277527, 0.9266918897628784, 0.13669352233409882, 0.028792330995202065, 1.387960433959961, 1.3136574029922485, -0.48632505536079407, 0.15054085850715637, -0.9989541172981262, -0.3089594542980194, 0.4715971350669861, 0.4595015048980713, -0.04336388409137726, 0.23020677268505096, -0.8387443423271179, -0.2765844762325287, -0.2918564975261688, -0.9770230650901794, -0.8068659901618958, -0.29525476694107056, -0.31306639313697815, 1.6636134386062622, 0.05639027804136276, -0.5733718276023865, -0.12313483655452728, -0.9033772945404053, -0.11981947720050812, -0.9969088435173035, 0.2067485749721527, 0.13245341181755066, -0.05912601202726364, -0.20409485697746277, 1.8680981397628784, -0.9929787516593933, -1.9329705238342285, 0.3158153295516968, 0.1594376266002655, -0.2533864676952362, 0.29207757115364075, 1.5541412830352783, 0.5078712701797485, 1.521359920501709, 1.2188524007797241, 0.9595862030982971, -0.5151058435440063, -1.37008535861969, 0.5121492147445679, 1.0423794984817505, -1.61500883102417, 0.7886840105056763, 0.25096336007118225, -0.40461620688438416, 0.7803353071212769, 1.0579091310501099, 0.43719884753227234, -2.0303351879119873, 0.7430196404457092, -0.9177476763725281, 0.8988779783248901, 0.5882872343063354, 0.8534825444221497, 0.25038039684295654, 0.7500308156013489, -1.1401948928833008, -1.2690320014953613, -0.7398748397827148, -0.6543247699737549, 2.0262339115142822, -0.5009749531745911, 0.7510632276535034, -0.20885825157165527, -1.3592923879623413, -0.2801460325717926, 0.7161937355995178, 0.417898952960968, -0.4473259449005127, 0.6982972621917725, -0.5689473152160645, -1.1670055389404297, -1.5161617994308472, -0.5588486790657043, -0.8663371801376343, -0.9553128480911255, 1.148801565170288, 0.9174704551696777, 0.1751137226819992, 2.045163869857788, 0.38209572434425354, 0.2548002302646637, -2.6085329055786133, 0.9173111915588379, 0.22670114040374756, -0.15432599186897278, 0.9130885004997253, 0.3722892999649048, 0.8265377879142761, -0.05593593418598175, 0.42613208293914795, -2.4665253162384033, 2.333604335784912, -0.18140453100204468, 0.7230033278465271, -0.0009785639122128487, 0.010410098358988762, 1.15785551071167, 0.592144250869751, 0.6551958322525024, -1.1447843313217163, 0.6534920930862427, -0.5627956986427307, 1.3944282531738281, 0.887987494468689, -0.5742159485816956, -0.16723260283470154, 1.3616687059402466, 0.44566330313682556, -0.5204472541809082, -0.8601027131080627, -1.0607417821884155, 0.8160566687583923, 1.729431390762329, 0.013973761349916458, -0.012712877243757248, 0.713670015335083, 0.52821946144104, -1.194999098777771, 0.11596866697072983, -0.8066740036010742, -0.6356431841850281, 1.4666283130645752, 1.9901469945907593, -0.2735040485858917, -0.1418171375989914, -0.7336335778236389, -1.110916018486023, 0.7317206859588623, 0.004437524825334549, 0.0921129360795021, 0.6802493929862976, -0.6293678879737854, 1.2560855150222778, 0.9634902477264404, 0.9276215434074402, 0.16806502640247345, 0.4824976325035095, 0.38364848494529724, -0.19431255757808685, -1.1799447536468506, -0.16025614738464355, -0.9129320383071899, -2.7607622146606445, 0.4193132221698761, -0.3766320049762726, -1.3624742031097412, -0.09781212359666824, -1.0631351470947266, 0.7945655584335327, -0.5633270740509033, -1.1751477718353271, -1.444079875946045, 0.016476383432745934, 0.047006987035274506, 1.0029618740081787, -1.6050301790237427, -0.060486868023872375, 1.4420037269592285, 1.0873689651489258, -0.740984320640564, 1.1285630464553833, 0.2855142652988434, 1.1707475185394287, 0.7379357814788818, -0.38060811161994934, 0.4666747748851776, -0.05094723403453827, -1.2895293235778809, 0.41912841796875, 1.122339129447937, 0.06610425561666489, 1.4079545736312866, -0.7410668134689331, -0.02269045263528824, 0.5123187899589539, -0.47823402285575867, -0.5555217266082764, -0.4827229380607605, 0.7720088958740234, 0.08294419944286346, -0.7310532927513123, 0.08853937685489655, -0.3738182783126831, -0.10409387201070786, 0.1944853514432907, -1.5124802589416504, -0.40278199315071106, -0.4220106601715088, -0.36730480194091797, -1.2657378911972046, -0.03597024828195572, 1.3036075830459595, -0.6130320429801941, -0.05755230039358139, 0.5883277058601379, 0.6514143347740173, 0.4640704095363617, 0.5781599879264832, -0.5229668617248535, -0.5004896521568298, -0.1861560046672821, -0.2642589509487152, 0.5591612458229065, 1.388245940208435, -0.2787904143333435, -1.0047478675842285, 0.7616996169090271, -0.4709230065345764, -0.08596133440732956, 1.965427041053772, 0.08654096722602844, -0.9298509359359741, 0.4344128370285034, -0.6330710053443909, 2.0100438594818115, 1.5204095840454102, 1.1771305799484253, -0.07141754031181335, -0.8796741962432861, 0.7411414980888367, -0.3573504686355591, -0.4331856966018677, 0.650587797164917, 0.5604145526885986, -0.3709885776042938, -1.310476303100586, 0.4776480793952942, 1.1124542951583862, -0.8361343741416931, -0.8303083777427673, -0.04214997589588165, -0.6748396158218384, 0.8718394637107849, 0.8895002603530884, 0.40336596965789795, 0.33477577567100525, 1.6382367610931396, 0.7228333353996277, -0.4684365689754486, 0.6154432892799377, 0.41076478362083435, -0.0047749863006174564, -2.038748025894165, -0.9997278451919556, 0.1611173450946808, -0.6601108908653259, -1.7315348386764526, 1.3368293046951294, -1.120287299156189, -1.1037421226501465, 0.4691758453845978, 0.2096327692270279, 1.58003568649292, 0.3854699730873108, 1.4166396856307983, 1.9184513092041016, 0.9762739539146423, 0.28618094325065613, 1.3994605541229248, -0.22399580478668213, -0.377341091632843, 1.9541038274765015, -0.37636178731918335, 0.46986934542655945, 1.2253828048706055, -0.21411746740341187, -0.9612569808959961, -0.7999817132949829, -1.4651505947113037, -0.5952998399734497, 1.2582679986953735, 0.10114402323961258, -1.0377702713012695, 0.287310391664505, 1.3903547525405884, 0.14424565434455872, -0.280684232711792, 0.3743740916252136, 0.4193938672542572, -0.8667287826538086, -0.07013363391160965, -0.864908754825592, 0.5278319120407104, -0.08664724230766296, -0.5984770059585571, 0.4339807331562042, 0.31942543387413025, 1.4598371982574463, 0.089706189930439, 0.2361917495727539, 1.0795292854309082, -1.5382776260375977, 1.647526502609253, -0.8027050495147705, 0.08045411854982376, -2.3060805797576904, 1.4090722799301147, -0.6871614456176758, 1.978714942932129, -2.896477222442627, 0.37630483508110046, -0.46082860231399536, -0.34930166602134705, 0.4532310962677002, -0.288030743598938, 0.12809962034225464, -0.22440367937088013, -1.1345924139022827, -0.04602404683828354, -0.5857201814651489, 0.5061090588569641, 0.8665518760681152, 1.2553696632385254, -1.1085050106048584, -0.3472243845462799, -1.7407277822494507, 0.05826014280319214, -0.6579163670539856, 0.4523724615573883, -2.1011486053466797, -0.031151942908763885, -1.9849005937576294, -2.2766177654266357, -1.440251111984253, -0.6868388652801514, 1.025769829750061, 0.00221311766654253, -0.8524245619773865, 1.0593478679656982, -0.3074474036693573, -1.8086137771606445, 0.9589846134185791, -1.9472171068191528 ]
https://github.com/huggingface/datasets/issues/4483
Dataset.map throws pyarrow.lib.ArrowNotImplementedError when converting from list of empty lists
Hi @sanderland ! Thanks for reporting :) This is a bug, I opened a PR to fix it. We'll do a new release soon In the meantime you can fix it by specifying in advance that the "label" are integers: ```python import numpy as np ds = Dataset.from_dict( { "text": ["the lazy dog jumps over the quick fox", "another sentence"], "label": [[], []], } ) # explicitly say that the "label" type is int64, even though it contains only null values ds = ds.cast_column("label", Sequence(Value("int64"))) def mapper(features): features['label'] = [ [0,0,0] for l in features['label'] ] return features ds_mapped = ds.map(mapper,batched=True) ```
## Describe the bug Dataset.map throws pyarrow.lib.ArrowNotImplementedError: Unsupported cast from int64 to null using function cast_null when converting from a type of 'empty lists' to 'lists with some type'. This appears to be due to the interaction of arrow internals and some assumptions made by datasets. The bug appeared when binarizing some labels, and then adding a dataset which had all these labels absent (to force the model to not label empty strings such with anything) Particularly the fact that this only happens in batched mode is strange. ## Steps to reproduce the bug ```python import numpy as np ds = Dataset.from_dict( { "text": ["the lazy dog jumps over the quick fox", "another sentence"], "label": [[], []], } ) def mapper(features): features['label'] = [ [0,0,0] for l in features['label'] ] return features ds_mapped = ds.map(mapper,batched=True) ``` ## Expected results Not crashing ## Actual results ``` ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2346: in map return self._map_single( ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:532: in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:499: in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/fingerprint.py:458: in wrapper out = func(self, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2751: in _map_single writer.write_batch(batch) ../.venv/lib/python3.8/site-packages/datasets/arrow_writer.py:503: in write_batch arrays.append(pa.array(typed_sequence)) pyarrow/array.pxi:230: in pyarrow.lib.array ??? pyarrow/array.pxi:110: in pyarrow.lib._handle_arrow_array_protocol ??? ../.venv/lib/python3.8/site-packages/datasets/arrow_writer.py:198: in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) ../.venv/lib/python3.8/site-packages/datasets/table.py:1675: in wrapper return func(array, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/table.py:1812: in cast_array_to_feature casted_values = _c(array.values, feature.feature) ../.venv/lib/python3.8/site-packages/datasets/table.py:1675: in wrapper return func(array, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/table.py:1843: in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ../.venv/lib/python3.8/site-packages/datasets/table.py:1675: in wrapper return func(array, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/table.py:1752: in array_cast return array.cast(pa_type) pyarrow/array.pxi:915: in pyarrow.lib.Array.cast ??? ../.venv/lib/python3.8/site-packages/pyarrow/compute.py:376: in cast return call_function("cast", [arr], options) pyarrow/_compute.pyx:542: in pyarrow._compute.call_function ??? pyarrow/_compute.pyx:341: in pyarrow._compute.Function.call ??? pyarrow/error.pxi:144: in pyarrow.lib.pyarrow_internal_check_status ??? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E pyarrow.lib.ArrowNotImplementedError: Unsupported cast from int64 to null using function cast_null pyarrow/error.pxi:121: ArrowNotImplementedError ``` ## Workarounds * Not using batched=True * Using an np.array([],dtype=float) or similar instead of [] in the input * Naming the output column differently from the input column ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Ubuntu - Python version: 3.8 - PyArrow version: 8.0.0
715
102
Dataset.map throws pyarrow.lib.ArrowNotImplementedError when converting from list of empty lists ## Describe the bug Dataset.map throws pyarrow.lib.ArrowNotImplementedError: Unsupported cast from int64 to null using function cast_null when converting from a type of 'empty lists' to 'lists with some type'. This appears to be due to the interaction of arrow internals and some assumptions made by datasets. The bug appeared when binarizing some labels, and then adding a dataset which had all these labels absent (to force the model to not label empty strings such with anything) Particularly the fact that this only happens in batched mode is strange. ## Steps to reproduce the bug ```python import numpy as np ds = Dataset.from_dict( { "text": ["the lazy dog jumps over the quick fox", "another sentence"], "label": [[], []], } ) def mapper(features): features['label'] = [ [0,0,0] for l in features['label'] ] return features ds_mapped = ds.map(mapper,batched=True) ``` ## Expected results Not crashing ## Actual results ``` ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2346: in map return self._map_single( ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:532: in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:499: in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/fingerprint.py:458: in wrapper out = func(self, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/arrow_dataset.py:2751: in _map_single writer.write_batch(batch) ../.venv/lib/python3.8/site-packages/datasets/arrow_writer.py:503: in write_batch arrays.append(pa.array(typed_sequence)) pyarrow/array.pxi:230: in pyarrow.lib.array ??? pyarrow/array.pxi:110: in pyarrow.lib._handle_arrow_array_protocol ??? ../.venv/lib/python3.8/site-packages/datasets/arrow_writer.py:198: in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) ../.venv/lib/python3.8/site-packages/datasets/table.py:1675: in wrapper return func(array, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/table.py:1812: in cast_array_to_feature casted_values = _c(array.values, feature.feature) ../.venv/lib/python3.8/site-packages/datasets/table.py:1675: in wrapper return func(array, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/table.py:1843: in cast_array_to_feature return array_cast(array, feature(), allow_number_to_str=allow_number_to_str) ../.venv/lib/python3.8/site-packages/datasets/table.py:1675: in wrapper return func(array, *args, **kwargs) ../.venv/lib/python3.8/site-packages/datasets/table.py:1752: in array_cast return array.cast(pa_type) pyarrow/array.pxi:915: in pyarrow.lib.Array.cast ??? ../.venv/lib/python3.8/site-packages/pyarrow/compute.py:376: in cast return call_function("cast", [arr], options) pyarrow/_compute.pyx:542: in pyarrow._compute.call_function ??? pyarrow/_compute.pyx:341: in pyarrow._compute.Function.call ??? pyarrow/error.pxi:144: in pyarrow.lib.pyarrow_internal_check_status ??? _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ > ??? E pyarrow.lib.ArrowNotImplementedError: Unsupported cast from int64 to null using function cast_null pyarrow/error.pxi:121: ArrowNotImplementedError ``` ## Workarounds * Not using batched=True * Using an np.array([],dtype=float) or similar instead of [] in the input * Naming the output column differently from the input column ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Ubuntu - Python version: 3.8 - PyArrow version: 8.0.0 Hi @sanderland ! Thanks for reporting :) This is a bug, I opened a PR to fix it. We'll do a new release soon In the meantime you can fix it by specifying in advance that the "label" are integers: ```python import numpy as np ds = Dataset.from_dict( { "text": ["the lazy dog jumps over the quick fox", "another sentence"], "label": [[], []], } ) # explicitly say that the "label" type is int64, even though it contains only null values ds = ds.cast_column("label", Sequence(Value("int64"))) def mapper(features): features['label'] = [ [0,0,0] for l in features['label'] ] return features ds_mapped = ds.map(mapper,batched=True) ```
[ -1.1943937540054321, -0.9145780205726624, -0.7229092121124268, 1.3953567743301392, -0.2194194495677948, -1.19682776927948, 0.12828786671161652, -1.1302915811538696, 1.657986044883728, -0.7743900418281555, 0.20166124403476715, -1.6585952043533325, 0.0017617521807551384, -0.5092151761054993, -0.7342768311500549, -0.9050726294517517, -0.4060879349708557, -0.7732810378074646, 1.0527756214141846, 2.548915147781372, 1.1969410181045532, -1.338693618774414, 2.7251622676849365, 0.7541667819023132, -0.1835610568523407, -1.0308462381362915, 0.6083353757858276, 0.10427890717983246, -1.3467044830322266, -0.3627113997936249, -0.9869996905326843, -0.08529032766819, -0.5088804364204407, -0.46375852823257446, 0.06867045164108276, 0.37954553961753845, -0.2679452896118164, -0.42744478583335876, -0.6259155869483948, -0.7789202332496643, 0.4615669548511505, -0.3733901381492615, 0.9646187424659729, -0.3149653673171997, 1.7967952489852905, -0.584683358669281, 0.39789897203445435, 0.7357422709465027, 1.302934169769287, 0.15450157225131989, 0.010045506060123444, 0.33576563000679016, 0.37867674231529236, 0.019281640648841858, 0.48202309012413025, 1.1995878219604492, 0.6718491315841675, 0.4436473846435547, 0.7743128538131714, -2.215496063232422, 1.3147331476211548, -0.9593434929847717, 0.3624632954597473, 1.332258701324463, -0.8702868819236755, 0.41041556000709534, -1.7688716650009155, -0.0402245968580246, 0.62422776222229, -2.2486069202423096, 0.25204160809516907, -1.3127198219299316, -0.5649229884147644, 0.8875988721847534, 0.31269845366477966, -1.1498972177505493, 0.2505457103252411, -0.530225932598114, 1.0206637382507324, 0.4363987445831299, 1.1150765419006348, -1.6755702495574951, -0.029910990968346596, -0.2556750178337097, 0.07886384427547455, -1.2738070487976074, -1.6164343357086182, 0.5739715099334717, 0.6325269341468811, 0.6130305528640747, -0.10826955735683441, 0.9500259160995483, -1.015698790550232, 0.7568129897117615, -0.9811810255050659, -1.7337030172348022, -1.4010605812072754, -2.274648666381836, -2.210146188735962, 0.7971009612083435, -0.45161134004592896, -0.5225963592529297, 1.9801911115646362, -0.9611442685127258, -1.7771779298782349, 1.1149585247039795, 0.28996583819389343, 0.054226141422986984, 2.360969066619873, 0.17104275524616241, -0.6791622638702393, 0.45207929611206055, -0.7512208223342896, 0.7864655256271362, -0.33528831601142883, 1.3383643627166748, 0.47384271025657654, -0.9129490256309509, 1.6349070072174072, -0.4237711429595947, 0.529752790927887, -0.662999153137207, -0.4751325249671936, -0.802732527256012, 0.26122379302978516, 1.8843201398849487, -0.34281125664711, 1.534461259841919, -0.305691123008728, -1.5765963792800903, -1.5523933172225952, 0.7981403470039368, 0.5621654987335205, -0.7782537937164307, 0.01807868666946888, -0.39526697993278503, 0.08519703149795532, -0.07038851082324982, 1.177926778793335, 1.217971920967102, 0.719463586807251, -0.337812215089798, -0.8953943848609924, 0.18730579316616058, -0.11430348455905914, -0.762856125831604, -1.8693299293518066, -0.31300997734069824, 0.18698571622371674, 0.6980913281440735, -1.2889128923416138, 1.6848491430282593, 0.9236734509468079, 1.9672261476516724, 1.059080958366394, -0.4794912338256836, 1.4782449007034302, 0.054174285382032394, 1.8322649002075195, -0.5670557618141174, 0.7180169820785522, -0.3843801021575928, -1.1518268585205078, 0.8457385897636414, -0.31004801392555237, -2.0637781620025635, -0.8080216646194458, -0.8270866274833679, -0.19683706760406494, -0.7252561450004578, 0.9017830491065979, -0.40182146430015564, -1.4300040006637573, 0.1456979662179947, -0.7603734135627747, 0.06919264793395996, -1.2057298421859741, 0.19877028465270996, 0.7053062915802002, -0.5636329650878906, 0.04752252995967865, -0.2756351828575134, -1.3744710683822632, -0.48145759105682373, 0.28481847047805786, 1.8455544710159302, -0.7278273701667786, 0.9004325866699219, 0.9962039589881897, -0.742138683795929, 0.05567188188433647, 0.24364440143108368, -0.2959749400615692, 0.8452839255332947, -1.110342025756836, -0.49526992440223694, 1.148150086402893, -0.0744057297706604, -0.6380451917648315, 1.457920789718628, 0.7414975166320801, -0.9683327674865723, -0.3187374770641327, -0.13627038896083832, -0.8573571443557739, 0.04090258479118347, -1.5788923501968384, -0.19407276809215546, 0.34825795888900757, -1.598846673965454, -0.4392300248146057, -0.25966858863830566, 1.3204834461212158, -0.234536275267601, 1.4207253456115723, -0.2867469787597656, -0.23327025771141052, -0.31084102392196655, -0.4207785725593567, 0.18079611659049988, -0.23794831335544586, -0.6393779516220093, 0.2626853883266449, -0.8541446328163147, 0.35260680317878723, 1.4635164737701416, 0.4270400106906891, 0.08417144417762756, 0.5938312411308289, 1.0216166973114014, 0.3840288519859314, -0.07074636965990067, -0.8882120847702026, -1.6263444423675537, 1.974166989326477, -1.4897515773773193, 1.92109215259552, 0.7469902634620667, -0.029713967815041542, -1.8476052284240723, -1.846360445022583, 1.2898871898651123, 1.1220654249191284, 2.287670850753784, 0.5742045640945435, 0.41393163800239563, -0.7491800785064697, -0.6997818946838379, 0.25239861011505127, -1.0221590995788574, -0.7010334134101868, 0.19380533695220947, 2.3496923446655273, 1.7938069105148315, -0.5376761555671692, -0.22046661376953125, -0.9411078691482544, 1.433455228805542, -0.18434016406536102, 0.23767083883285522, 2.0217361450195312, -0.2270016372203827, -1.031826376914978, 1.31479811668396, -2.3524320125579834, 0.22051706910133362, 1.9403085708618164, 0.25935664772987366, 0.12918145954608917, -1.3549963235855103, -0.7060934901237488, -0.3616044521331787, -0.4488812983036041, -1.2235593795776367, 0.5175541639328003, -0.2044433057308197, -0.818365752696991, -1.5011831521987915, 0.140705406665802, -1.1402630805969238, -1.7017641067504883, 0.25940069556236267, 1.9391740560531616, 2.06998348236084, -0.7441416382789612, 1.5029942989349365, -0.31124818325042725, 0.1428002566099167, 1.2152425050735474, 1.2180284261703491, 3.028933525085449, 1.9292560815811157, -1.241828441619873, 0.7120050191879272, -0.13379508256912231, -0.44048237800598145, 1.1132349967956543, -1.1898469924926758, 1.1955311298370361, -0.13965332508087158, -1.1620936393737793, -1.1276557445526123, 1.0410629510879517, 0.47839441895484924, 0.05881936475634575, -0.47551196813583374, 1.2276570796966553, -0.02431625872850418, 1.3870644569396973, 0.6382129788398743, -0.3941061496734619, 0.5767899751663208, -0.3570701479911804, -0.48858726024627686, 1.6135663986206055, 0.15679089725017548, -1.44350004196167, -2.3752496242523193, -0.2554838955402374, -0.8239806294441223, -0.009737717919051647, -0.5555182099342346, -1.039562702178955, 1.710255742073059, 0.4031621217727661, -1.1826523542404175, -0.22020035982131958, -0.314737468957901, -0.5467172861099243, 2.627657175064087, -1.3386882543563843, -0.18504133820533752, -0.9842727184295654, -0.575715184211731, 1.5981085300445557, -1.160727858543396, -0.155466690659523, -1.0185027122497559, -0.5486564040184021, -1.3237836360931396, -0.5456228256225586, 0.05863190069794655, -0.9818053245544434, 0.8259389996528625, 0.14131620526313782, -1.0876438617706299, -0.33494651317596436, -0.907169759273529, 0.9757431745529175, -0.060976821929216385, 0.17960454523563385, 2.0003719329833984, 0.4446905255317688, -0.3356150686740875, 0.695385217666626, 1.2424372434616089, 0.6751723885536194, -0.7125532031059265, 0.13386324048042297, -0.7307909727096558, 0.299873024225235, -1.3775804042816162, 0.2490513175725937, -2.8590078353881836, 0.7188713550567627, -0.054932601749897, -0.047722380608320236, 0.04414201155304909, -1.2692795991897583, 1.1042702198028564, 2.6475987434387207, -1.1594347953796387, 0.46746936440467834, 0.3669346868991852, 1.2047231197357178, -1.523817777633667, 0.36248835921287537, -0.4307170510292053, 2.0654971599578857, 0.25953760743141174, 1.1962701082229614, -0.4661310315132141, -2.2449584007263184, 0.6541647911071777, -1.2598906755447388, -1.2003401517868042, 0.7409886717796326, -0.872349739074707, 0.20046822726726532, -1.5392663478851318, -0.1460697203874588, -0.8917821645736694, -1.2094225883483887, 0.673462986946106, 0.08750574290752411, 0.36280810832977295, -0.5776432752609253, 0.34755802154541016, -2.1956536769866943, -1.398069977760315, -0.2186759114265442, -0.9527983069419861, 0.6058375835418701, -0.3040614128112793, 0.7188482880592346, -0.06098220869898796, 0.0326082743704319, 0.28272780776023865, 1.4189742803573608, 3.4155588150024414, 0.17502181231975555, 0.2531163990497589, -0.10362240672111511, -1.019038438796997, 1.407840609550476, 0.9826908111572266, -0.08302183449268341, -0.5435897707939148, -1.0615825653076172, 1.2069708108901978, 2.0038626194000244, 1.0648212432861328, 0.037954483181238174, -0.8110410571098328, -0.7367069125175476, 0.0887613296508789, 0.22551077604293823, 0.42999565601348877, 0.9065486192703247, 0.057360317558050156, 0.07874079048633575, 1.5009751319885254, 1.2683382034301758, -0.39567553997039795, 0.36940091848373413, -0.882392168045044, -0.4402991533279419, 0.5032320022583008, 0.2823115587234497, -0.011714275926351547, 0.4514303505420685, -1.1195369958877563, -0.2373570054769516, -0.3820768892765045, -0.9308074116706848, -0.6844428777694702, -0.37215790152549744, -0.3939041495323181, 1.5954315662384033, 0.1252356320619583, -0.5274981260299683, -0.05052904039621353, -0.6947770714759827, -0.07308857142925262, -1.0852999687194824, 0.32765993475914, -0.16783925890922546, -0.09513132274150848, -0.1616126149892807, 1.8109838962554932, -0.8838062286376953, -2.0111868381500244, 0.1856273114681244, 0.3077760338783264, -0.3853888213634491, 0.21939317882061005, 1.6475298404693604, 0.5672653913497925, 1.3797333240509033, 1.3230135440826416, 0.9428949356079102, -0.5782908797264099, -1.306683897972107, 0.6347877979278564, 0.9991512894630432, -1.3445247411727905, 0.7985264658927917, -0.05071498081088066, -0.5694950819015503, 0.6334995031356812, 1.3389866352081299, 0.39585375785827637, -2.0560379028320312, 0.8578285574913025, -0.909455418586731, 0.7197912335395813, 0.7283565402030945, 0.7376476526260376, 0.19206850230693817, 0.7829949259757996, -1.303299903869629, -1.16094172000885, -0.8186110854148865, -0.5709142684936523, 1.9127978086471558, -0.26637932658195496, 0.5993573069572449, -0.15852679312229156, -1.26487135887146, -0.10115882754325867, 0.6871213912963867, 0.38319462537765503, -0.49281224608421326, 0.8747522234916687, -0.6369526982307434, -1.1035091876983643, -1.3145513534545898, -0.43955203890800476, -1.0034726858139038, -0.8608560562133789, 1.0387033224105835, 0.8559485673904419, 0.3974490761756897, 1.9438577890396118, 0.6014718413352966, 0.1946564018726349, -2.682281970977783, 0.833814799785614, 0.2812287509441376, -0.035549573600292206, 0.8499068021774292, 0.2911469638347626, 1.037474513053894, -0.04151592403650284, 0.5405915379524231, -2.349442720413208, 2.2386975288391113, -0.148784801363945, 0.7205194234848022, 0.025317061692476273, -0.1120675653219223, 1.1027470827102661, 0.582716166973114, 0.6220969557762146, -1.02919602394104, 0.6065424084663391, -0.5889290571212769, 1.2345784902572632, 0.9101569652557373, -0.7903476357460022, -0.04768580198287964, 1.379205584526062, 0.5811403393745422, -0.5022258758544922, -0.9214352965354919, -0.917519748210907, 0.9312819838523865, 1.787367582321167, -0.11667183041572571, -0.005852821283042431, 0.8437153100967407, 0.5946686267852783, -1.3350282907485962, -0.019604723900556564, -0.7878957986831665, -0.6531800031661987, 1.65278160572052, 2.102787733078003, -0.20896613597869873, -0.15209728479385376, -0.6832131743431091, -1.2679721117019653, 0.7412617802619934, -0.10158631205558777, 0.16280682384967804, 0.7506868243217468, -0.6282690167427063, 1.0754528045654297, 0.7425058484077454, 0.9529145359992981, 0.16377858817577362, 0.3460204005241394, 0.284315288066864, -0.3742288053035736, -1.1628096103668213, -0.23973585665225983, -1.059301495552063, -2.510270595550537, 0.45145830512046814, -0.22776415944099426, -1.4404997825622559, 0.026616781949996948, -1.0420416593551636, 0.9989644885063171, -0.5448827147483826, -1.0897858142852783, -1.4697154760360718, 0.2749429941177368, -0.058897264301776886, 0.9573545455932617, -1.5720311403274536, -0.11939135193824768, 1.2320126295089722, 0.9306371808052063, -0.6346799731254578, 1.0335454940795898, 0.27939894795417786, 0.9989413619041443, 0.820697546005249, -0.35377681255340576, 0.4629193842411041, -0.015949811786413193, -1.2833452224731445, 0.49052008986473083, 1.1627867221832275, 0.16457299888134003, 1.3909366130828857, -0.5368533730506897, 0.05661952868103981, 0.4582304060459137, -0.5777735710144043, -0.39413097500801086, -0.4738926589488983, 0.6734241247177124, 0.0598672516644001, -0.9710637927055359, -0.12657856941223145, -0.053377747535705566, -0.2623455822467804, 0.18476839363574982, -1.4269076585769653, -0.24331806600093842, -0.3922278583049774, -0.592656135559082, -1.237831950187683, -0.008251463063061237, 1.3660955429077148, -0.8569114208221436, -0.1805024892091751, 0.4540932774543762, 0.3628135025501251, 0.5678366422653198, 0.6671347618103027, -0.7286438345909119, -0.3824079632759094, -0.25243300199508667, -0.3615989089012146, 0.2587811350822449, 1.39389169216156, -0.1654549092054367, -0.9986931085586548, 0.6553130745887756, -0.3071221709251404, 0.045516856014728546, 1.9911141395568848, 0.08636303246021271, -0.7730223536491394, 0.26314428448677063, -0.7154792547225952, 1.8862882852554321, 1.7146601676940918, 1.2914860248565674, -0.20171722769737244, -0.8648362755775452, 0.49567845463752747, -0.31155234575271606, -0.36570993065834045, 0.8641154766082764, 0.41946086287498474, -0.16213303804397583, -1.3831597566604614, 0.6541567444801331, 1.3345237970352173, -0.9121776819229126, -0.7612592577934265, 0.17781177163124084, -0.8697112202644348, 1.1923279762268066, 0.6437498927116394, 0.37537407875061035, 0.2927456498146057, 1.5538601875305176, 0.7424436807632446, -0.514487087726593, 0.48472586274147034, 0.5564326047897339, -0.10126733779907227, -2.1385300159454346, -1.079258918762207, 0.31084656715393066, -0.44008705019950867, -1.667697548866272, 1.3913159370422363, -1.206992506980896, -0.9365878105163574, 0.5124115347862244, 0.152940034866333, 1.357474684715271, 0.35455867648124695, 1.6089766025543213, 2.0819735527038574, 0.8930995464324951, 0.3099480867385864, 1.3265119791030884, -0.04862556606531143, -0.47638970613479614, 1.7824004888534546, -0.4176645874977112, 0.519725501537323, 1.057030200958252, -0.3540544807910919, -1.0727428197860718, -0.7267670631408691, -1.217453122138977, -0.6481228470802307, 1.1796537637710571, 0.07961529493331909, -1.125977635383606, 0.21905332803726196, 1.5402390956878662, 0.08758187294006348, -0.3277588486671448, 0.6601964235305786, 0.4011712372303009, -0.7875742316246033, -0.1423780918121338, -0.9818263649940491, 0.48404431343078613, -0.17042216658592224, -0.3353017568588257, 0.30337268114089966, 0.47444283962249756, 1.324784517288208, -0.04100249707698822, 0.15226039290428162, 1.1677348613739014, -1.3698357343673706, 1.495490312576294, -0.7075371146202087, 0.2849932909011841, -2.442744493484497, 1.4472872018814087, -0.7409481406211853, 1.946801781654358, -2.6532394886016846, 0.42031311988830566, -0.5507124662399292, -0.4078502655029297, 0.18997623026371002, -0.3045642077922821, 0.11213864386081696, -0.10168710350990295, -1.0853573083877563, -0.044015299528837204, -0.7611194849014282, 0.5457935333251953, 1.1359646320343018, 1.361308217048645, -1.1937183141708374, -0.2639424204826355, -1.7493107318878174, -0.20117716491222382, -0.8035937547683716, 0.33901548385620117, -1.9542967081069946, -0.21916237473487854, -1.8604803085327148, -2.383721351623535, -1.395899772644043, -0.8311507105827332, 1.0835500955581665, 0.09011459350585938, -0.9227927327156067, 1.144336462020874, -0.3840137720108032, -1.9038738012313843, 1.165144920349121, -2.248471736907959 ]
https://github.com/huggingface/datasets/issues/4480
Bigbench tensorflow GPU dependency
Thanks for reporting ! :) cc @andersjohanandreassen can you take a look at this ? Also @cceyda feel free to open an issue at [BIG-Bench](https://github.com/google/BIG-bench) as well regarding the `AttributeError`
## Describe the bug Loading bigbech ```py from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` tries to use gpu and fails with OOM with the following error ``` Downloading and preparing dataset bigbench/swedish_to_german_proverbs (download: Unknown size, generated: 68.92 KiB, post-processed: Unknown size, total: 68.92 KiB) to /home/ceyda/.cache/huggingface/datasets/bigbench/swedish_to_german_proverbs/1.0.0/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0... Generating default split: 0%| | 0/72 [00:00<?, ? examples/s]2022-06-13 14:11:04.154469: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-13 14:11:05.133600: F tensorflow/core/platform/statusor.cc:33] Attempting to fetch value instead of handling error INTERNAL: failed initializing StreamExecutor for CUDA device ordinal 3: INTERNAL: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 25396838400 Aborted (core dumped) ``` I think this is because bigbench dependency (below) installs tensorflow (GPU version) and dataloading tries to use GPU as default. `pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` while just doing 'pip install bigbench' results in following error ``` File "/home/ceyda/.local/lib/python3.7/site-packages/datasets/load.py", line 109, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 118, in <module> class Bigbench(datasets.GeneratorBasedBuilder): File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 127, in Bigbench BigBenchConfig(name=name, version=datasets.Version("1.0.0")) for name in bb_utils.get_all_json_task_names() AttributeError: module 'bigbench.api.util' has no attribute 'get_all_json_task_names' ``` ## Steps to avoid the bug Not ideal but can solve with (since I don't really use tensorflow elsewhere) `pip uninstall tensorflow` `pip install tensorflow-cpu` ## Environment info - datasets @ master - Python version: 3.7
716
30
Bigbench tensorflow GPU dependency ## Describe the bug Loading bigbech ```py from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` tries to use gpu and fails with OOM with the following error ``` Downloading and preparing dataset bigbench/swedish_to_german_proverbs (download: Unknown size, generated: 68.92 KiB, post-processed: Unknown size, total: 68.92 KiB) to /home/ceyda/.cache/huggingface/datasets/bigbench/swedish_to_german_proverbs/1.0.0/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0... Generating default split: 0%| | 0/72 [00:00<?, ? examples/s]2022-06-13 14:11:04.154469: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-13 14:11:05.133600: F tensorflow/core/platform/statusor.cc:33] Attempting to fetch value instead of handling error INTERNAL: failed initializing StreamExecutor for CUDA device ordinal 3: INTERNAL: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 25396838400 Aborted (core dumped) ``` I think this is because bigbench dependency (below) installs tensorflow (GPU version) and dataloading tries to use GPU as default. `pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` while just doing 'pip install bigbench' results in following error ``` File "/home/ceyda/.local/lib/python3.7/site-packages/datasets/load.py", line 109, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 118, in <module> class Bigbench(datasets.GeneratorBasedBuilder): File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 127, in Bigbench BigBenchConfig(name=name, version=datasets.Version("1.0.0")) for name in bb_utils.get_all_json_task_names() AttributeError: module 'bigbench.api.util' has no attribute 'get_all_json_task_names' ``` ## Steps to avoid the bug Not ideal but can solve with (since I don't really use tensorflow elsewhere) `pip uninstall tensorflow` `pip install tensorflow-cpu` ## Environment info - datasets @ master - Python version: 3.7 Thanks for reporting ! :) cc @andersjohanandreassen can you take a look at this ? Also @cceyda feel free to open an issue at [BIG-Bench](https://github.com/google/BIG-bench) as well regarding the `AttributeError`
[ -1.2032077312469482, -0.9201056361198425, -0.8241819739341736, 1.467660665512085, -0.13401123881340027, -1.2303836345672607, 0.14834332466125488, -1.0224395990371704, 1.6082500219345093, -0.7276047468185425, 0.297403484582901, -1.6038767099380493, 0.005016409792006016, -0.5210126042366028, -0.7752813696861267, -0.7692354917526245, -0.4628104269504547, -0.8306950926780701, 1.0262808799743652, 2.538252115249634, 1.2559787034988403, -1.3998546600341797, 2.703399419784546, 0.7502493262290955, -0.278358519077301, -1.010737657546997, 0.46083107590675354, 0.01514586340636015, -1.3006095886230469, -0.4758721888065338, -0.8646098971366882, -0.007191079668700695, -0.5392616391181946, -0.5043202042579651, 0.052605465054512024, 0.37991654872894287, -0.24359726905822754, -0.41561079025268555, -0.5136937499046326, -0.7203843593597412, 0.47824835777282715, -0.33706894516944885, 0.9192613959312439, -0.2541545331478119, 1.6973592042922974, -0.565234899520874, 0.41505005955696106, 0.7419469356536865, 1.3048045635223389, 0.13911212980747223, 0.033998001366853714, 0.3335248827934265, 0.38772356510162354, -0.019237440079450607, 0.46947401762008667, 1.2816076278686523, 0.6312572360038757, 0.39636242389678955, 0.7491216063499451, -2.185223340988159, 1.324557900428772, -0.9913491010665894, 0.30263373255729675, 1.3444594144821167, -0.9278745651245117, 0.3055684268474579, -1.8083091974258423, -0.09046190977096558, 0.5242212414741516, -2.2291531562805176, 0.32053932547569275, -1.284623622894287, -0.5584965348243713, 0.9910187721252441, 0.28655150532722473, -1.2269771099090576, 0.1793321818113327, -0.49828311800956726, 0.9974678754806519, 0.4558376371860504, 1.1798069477081299, -1.7035003900527954, -0.033346083015203476, -0.2187722772359848, 0.053602270781993866, -1.3078900575637817, -1.5132697820663452, 0.4879189133644104, 0.615102231502533, 0.6052577495574951, -0.06209716573357582, 1.0141929388046265, -1.0252327919006348, 0.8716583251953125, -0.9817924499511719, -1.627864956855774, -1.3726600408554077, -2.3691582679748535, -2.257277727127075, 0.7277441620826721, -0.4714297950267792, -0.4852781593799591, 2.054025173187256, -1.0569357872009277, -1.7476847171783447, 1.132009744644165, 0.3471728563308716, 0.009705259464681149, 2.3155441284179688, 0.2558002173900604, -0.7800155878067017, 0.41877251863479614, -0.7259470224380493, 0.8180185556411743, -0.38851168751716614, 1.3662432432174683, 0.5334737300872803, -0.9552222490310669, 1.5605921745300293, -0.3612404465675354, 0.5467891097068787, -0.6968295574188232, -0.5410314202308655, -0.7247757315635681, 0.32123318314552307, 1.8604137897491455, -0.37200313806533813, 1.5740410089492798, -0.40433287620544434, -1.5876951217651367, -1.5283583402633667, 0.8729033470153809, 0.517815887928009, -0.7275316119194031, 0.1541471630334854, -0.47860655188560486, 0.14542825520038605, -0.05947726219892502, 1.0614402294158936, 1.2514950037002563, 0.6992582678794861, -0.3741733431816101, -0.9375860691070557, 0.21378402411937714, -0.0430222786962986, -0.7016111612319946, -1.8146584033966064, -0.2884422242641449, 0.15654926002025604, 0.6205719113349915, -1.2666985988616943, 1.6968467235565186, 0.846662163734436, 1.9599300622940063, 0.9414360523223877, -0.33726200461387634, 1.4953004121780396, -0.03885509818792343, 1.826499581336975, -0.5022348165512085, 0.5900201201438904, -0.3578930199146271, -1.116992473602295, 0.9424397945404053, -0.31331637501716614, -2.0750904083251953, -0.7359824776649475, -0.7949547171592712, -0.2947666645050049, -0.7959781289100647, 0.9321630001068115, -0.25670355558395386, -1.438202977180481, 0.17246311902999878, -0.7179214954376221, 0.10858046263456345, -1.1937273740768433, 0.2973887622356415, 0.7173920273780823, -0.5877088904380798, -0.016771448776125908, -0.17873714864253998, -1.2657397985458374, -0.40628582239151, 0.3092993199825287, 1.8492621183395386, -0.7366807460784912, 1.0297731161117554, 1.1218386888504028, -0.6797970533370972, 0.15832212567329407, 0.309474915266037, -0.3563394248485565, 0.8465628027915955, -1.0700393915176392, -0.39385759830474854, 1.129155158996582, -0.13120701909065247, -0.6061717867851257, 1.4718964099884033, 0.7766987085342407, -1.0191789865493774, -0.2541082203388214, -0.06657618284225464, -0.8232247829437256, 0.08262298256158829, -1.6395248174667358, -0.17052075266838074, 0.37585943937301636, -1.4964661598205566, -0.4645829498767853, -0.22752590477466583, 1.3241828680038452, -0.2106797695159912, 1.51699960231781, -0.32344821095466614, -0.08184951543807983, -0.32619380950927734, -0.35792186856269836, 0.1119927242398262, -0.16365475952625275, -0.5679425597190857, 0.2727501094341278, -0.8736442923545837, 0.32119327783584595, 1.4903972148895264, 0.3469947278499603, 0.04080123081803322, 0.45620420575141907, 1.0765279531478882, 0.3673153817653656, -0.017927834764122963, -0.857609748840332, -1.586431860923767, 2.0175726413726807, -1.4564605951309204, 2.0528745651245117, 0.8692668676376343, -0.0335184670984745, -1.7497283220291138, -1.9056912660598755, 1.3699604272842407, 1.1127721071243286, 2.396153211593628, 0.5199050903320312, 0.4132823944091797, -0.7966192364692688, -0.7089059352874756, 0.3996986746788025, -1.0934784412384033, -0.7008622884750366, 0.0665268748998642, 2.4608242511749268, 1.7256711721420288, -0.4613979458808899, -0.25144803524017334, -0.971075713634491, 1.306183099746704, -0.1274803727865219, 0.23310597240924835, 2.019279956817627, -0.25870874524116516, -1.009957194328308, 1.2597514390945435, -2.357196092605591, 0.208417147397995, 2.0467450618743896, 0.31824153661727905, 0.09670040011405945, -1.4220259189605713, -0.549039363861084, -0.2985873818397522, -0.4705100953578949, -1.1436867713928223, 0.6045225262641907, -0.2561366856098175, -0.904768705368042, -1.392305850982666, 0.1610364019870758, -1.161340355873108, -1.7037005424499512, 0.356955349445343, 1.8538881540298462, 2.092026710510254, -0.8214793801307678, 1.4385144710540771, -0.3013302981853485, 0.06294845044612885, 1.1736609935760498, 1.2677569389343262, 3.090437650680542, 1.7879995107650757, -1.3531991243362427, 0.6621565222740173, -0.15781553089618683, -0.5117402076721191, 1.148421049118042, -1.2164745330810547, 1.164716124534607, -0.17954525351524353, -1.1710437536239624, -1.2042155265808105, 1.0404185056686401, 0.550237774848938, 0.07279222458600998, -0.5175001621246338, 1.1351375579833984, 0.12555696070194244, 1.2517884969711304, 0.5902012586593628, -0.28715237975120544, 0.6197226047515869, -0.39823806285858154, -0.49001163244247437, 1.5039151906967163, 0.19467860460281372, -1.3826985359191895, -2.3040850162506104, -0.2097843885421753, -0.8791898488998413, 0.025225471705198288, -0.6080001592636108, -0.9783397316932678, 1.6579002141952515, 0.41365355253219604, -1.2842832803726196, -0.2457701712846756, -0.3223254084587097, -0.584570586681366, 2.628035306930542, -1.4004826545715332, -0.16944092512130737, -0.9905068278312683, -0.5368046164512634, 1.6671333312988281, -1.1689037084579468, -0.27179259061813354, -1.0627962350845337, -0.6097376942634583, -1.267650842666626, -0.5975795388221741, 0.04790028557181358, -0.8774163722991943, 0.7860099077224731, 0.13259656727313995, -1.1374293565750122, -0.2273964136838913, -0.8450984358787537, 0.9582204222679138, -0.11923156678676605, 0.2414407730102539, 1.806589126586914, 0.46458700299263, -0.34332653880119324, 0.724812924861908, 1.1783114671707153, 0.6395159363746643, -0.6673892140388489, 0.16671784222126007, -0.6514497399330139, 0.29528138041496277, -1.3800666332244873, 0.35983285307884216, -2.813636541366577, 0.6600558757781982, -0.010436221025884151, -0.04574374109506607, -0.054115284234285355, -1.325911521911621, 1.1573216915130615, 2.63763689994812, -1.2406367063522339, 0.5144332051277161, 0.3866288959980011, 1.1077276468276978, -1.54795503616333, 0.2876814007759094, -0.46158936619758606, 2.202960968017578, 0.21917571127414703, 1.2662848234176636, -0.5293635725975037, -2.242396593093872, 0.6585742831230164, -1.2525787353515625, -1.1049562692642212, 0.7480039000511169, -0.8745762705802917, 0.10547962039709091, -1.472998023033142, -0.28131598234176636, -0.9479436278343201, -1.2442049980163574, 0.7008176445960999, 0.14447249472141266, 0.45664146542549133, -0.6555058360099792, 0.31876951456069946, -2.208530902862549, -1.3105911016464233, -0.18920449912548065, -0.972680389881134, 0.5237227082252502, -0.3794652819633484, 0.6179312467575073, -0.12050198018550873, 0.012363369576632977, 0.30946511030197144, 1.309094786643982, 3.434276819229126, 0.2255653738975525, 0.2775489389896393, -0.15967553853988647, -0.9486132860183716, 1.4384998083114624, 0.9545161128044128, -0.060033250600099564, -0.6625696420669556, -1.0509413480758667, 1.2299797534942627, 2.0308778285980225, 1.0560342073440552, 0.015054081566631794, -0.8434111475944519, -0.7832330465316772, 0.017542745918035507, 0.23203134536743164, 0.5177996158599854, 0.9348502159118652, -0.048472363501787186, 0.04055134952068329, 1.3961244821548462, 1.1912249326705933, -0.4254278242588043, 0.37002500891685486, -0.8772278428077698, -0.39034226536750793, 0.43030232191085815, 0.24921715259552002, 0.08640596270561218, 0.433481365442276, -1.026386022567749, -0.3298393487930298, -0.3687441349029541, -0.9268862009048462, -0.7405399680137634, -0.4025549590587616, -0.37179577350616455, 1.5962027311325073, 0.11526534706354141, -0.43878915905952454, -0.03712954744696617, -0.8138545751571655, -0.11920197308063507, -1.1029871702194214, 0.20969116687774658, -0.1495860069990158, -0.09226469695568085, -0.15748527646064758, 1.7704899311065674, -0.9315146803855896, -2.085200071334839, 0.2843148708343506, 0.24979087710380554, -0.4254789352416992, 0.23074547946453094, 1.6968467235565186, 0.6151099801063538, 1.351997971534729, 1.28169584274292, 0.998131275177002, -0.6402034163475037, -1.1725094318389893, 0.6931460499763489, 1.0068978071212769, -1.4414852857589722, 0.765008270740509, -0.05650926008820534, -0.5146540403366089, 0.6889539957046509, 1.3216683864593506, 0.5175948739051819, -2.086897850036621, 0.8212977647781372, -0.9103721976280212, 0.7754989266395569, 0.6503604650497437, 0.8036128282546997, 0.22597672045230865, 0.8212975263595581, -1.2822593450546265, -1.0733578205108643, -0.7308039665222168, -0.6863729953765869, 2.012063503265381, -0.21047872304916382, 0.5671018362045288, -0.13498374819755554, -1.271000862121582, -0.13802383840084076, 0.7647143006324768, 0.30842575430870056, -0.4424861669540405, 0.8311657905578613, -0.6423236727714539, -1.0374013185501099, -1.3114416599273682, -0.4176309108734131, -0.9639071822166443, -0.9152145385742188, 0.9777334928512573, 0.804633378982544, 0.40157055854797363, 1.9634521007537842, 0.6571391224861145, 0.2569781541824341, -2.6234347820281982, 0.9003820419311523, 0.3092924952507019, -0.038207828998565674, 0.8945602178573608, 0.24889835715293884, 1.0838167667388916, 0.01022364292293787, 0.60048508644104, -2.4525482654571533, 2.239100694656372, -0.1874413937330246, 0.6669781804084778, 0.046160876750946045, -0.20678682625293732, 1.1219226121902466, 0.6024457812309265, 0.565480649471283, -1.1547214984893799, 0.7659350037574768, -0.656766951084137, 1.1814788579940796, 0.9051496982574463, -0.8244529962539673, 0.03287814185023308, 1.340448260307312, 0.3244841992855072, -0.4106370806694031, -0.8853771090507507, -0.9095167517662048, 0.9537054300308228, 1.7692962884902954, -0.05751160904765129, 0.0398324579000473, 0.8602349758148193, 0.7040099501609802, -1.2757612466812134, 0.05365900695323944, -0.7314667105674744, -0.7938037514686584, 1.6535264253616333, 2.0813400745391846, -0.17787058651447296, -0.16741560399532318, -0.7288733720779419, -1.1605935096740723, 0.8317263722419739, -0.08330846577882767, 0.14281611144542694, 0.5639311075210571, -0.6432645320892334, 1.1971741914749146, 0.7723512649536133, 0.9498780369758606, -0.018636934459209442, 0.3250916600227356, 0.3628430664539337, -0.2506786286830902, -1.1545861959457397, -0.38679176568984985, -1.1135966777801514, -2.579819917678833, 0.4498680830001831, -0.20034462213516235, -1.3928911685943604, -0.0174336489289999, -1.035784125328064, 0.8472443222999573, -0.6220781803131104, -1.1236003637313843, -1.5280933380126953, 0.22252051532268524, -0.1366550475358963, 0.94700688123703, -1.6756999492645264, -0.16351236402988434, 1.165264368057251, 0.8409405946731567, -0.5726020336151123, 0.9975647926330566, 0.22729001939296722, 0.9509826302528381, 0.8554666638374329, -0.3536340892314911, 0.51591557264328, 0.19745558500289917, -1.387677550315857, 0.40839630365371704, 1.2589844465255737, 0.18134355545043945, 1.4865567684173584, -0.5017092823982239, 0.06289006024599075, 0.44848525524139404, -0.5737323760986328, -0.5402278304100037, -0.5015007257461548, 0.7342356443405151, 0.08124542236328125, -1.0326564311981201, 0.0022809533402323723, -0.13479097187519073, -0.21965889632701874, 0.21434101462364197, -1.5547664165496826, -0.28484976291656494, -0.39508119225502014, -0.5227251648902893, -1.285709261894226, -0.004545914940536022, 1.3533601760864258, -0.8157994151115417, -0.20438946783542633, 0.44153523445129395, 0.3658524751663208, 0.5428634881973267, 0.6089588403701782, -0.5831108093261719, -0.41388192772865295, -0.2892291843891144, -0.31520140171051025, 0.31133797764778137, 1.2331914901733398, -0.0530148446559906, -0.9608542323112488, 0.702635645866394, -0.4660150706768036, 0.13197357952594757, 1.9365848302841187, 0.006043614819645882, -0.7468991875648499, 0.3864073157310486, -0.6193599104881287, 1.8185837268829346, 1.6596145629882812, 1.3475135564804077, -0.1565154641866684, -0.9658699631690979, 0.6238228678703308, -0.3333044946193695, -0.3761312961578369, 0.9207738041877747, 0.4287824332714081, -0.21997356414794922, -1.3991175889968872, 0.5000318884849548, 1.3089447021484375, -0.9371135234832764, -0.8206175565719604, 0.08205664157867432, -0.8936752676963806, 1.0855506658554077, 0.6160843372344971, 0.2859600782394409, 0.27754831314086914, 1.5804649591445923, 0.640627384185791, -0.5039098262786865, 0.5331560969352722, 0.4695693850517273, -0.197955921292305, -2.1233069896698, -1.0522401332855225, 0.32668036222457886, -0.3321390450000763, -1.577479600906372, 1.352126121520996, -1.1788957118988037, -1.0090996026992798, 0.5107294917106628, 0.08786094933748245, 1.409876823425293, 0.3334912061691284, 1.7152996063232422, 2.1737027168273926, 0.8957229852676392, 0.34664222598075867, 1.2904207706451416, -0.13144396245479584, -0.4738656282424927, 1.8607113361358643, -0.5343003869056702, 0.5128389596939087, 1.0678668022155762, -0.39571166038513184, -1.1085525751113892, -0.7790065407752991, -1.2175410985946655, -0.7163081765174866, 1.2967838048934937, 0.07069964706897736, -1.1233398914337158, 0.2889600396156311, 1.704172134399414, 0.11875646561384201, -0.2313459813594818, 0.674891471862793, 0.4308803975582123, -0.8113834857940674, -0.09731825441122055, -0.8836132884025574, 0.5297154188156128, -0.14624221622943878, -0.32849976420402527, 0.26661965250968933, 0.5826292037963867, 1.257027268409729, -0.11403833329677582, 0.02598845213651657, 1.1585073471069336, -1.5143393278121948, 1.6016122102737427, -0.5680526494979858, 0.23503421247005463, -2.4108645915985107, 1.329043984413147, -0.778740644454956, 1.929465651512146, -2.6036665439605713, 0.4254937767982483, -0.5281021595001221, -0.48024189472198486, 0.28551429510116577, -0.33619412779808044, 0.17439229786396027, -0.2106206715106964, -1.0434266328811646, -0.12093300372362137, -0.7058881521224976, 0.6021024584770203, 1.1825944185256958, 1.305385708808899, -1.1069555282592773, -0.29595521092414856, -1.7678992748260498, -0.18508879840373993, -0.7263700366020203, 0.2698098421096802, -2.0180280208587646, -0.15887093544006348, -1.9954183101654053, -2.2611305713653564, -1.3711689710617065, -0.8764526844024658, 0.9931775331497192, 0.10395058244466782, -0.8764880895614624, 1.0628321170806885, -0.40801802277565, -1.7972192764282227, 1.0474807024002075, -2.140747308731079 ]
https://github.com/huggingface/datasets/issues/4480
Bigbench tensorflow GPU dependency
I'm on vacation for the next week, so won't be able to do much debugging at the moment. Sorry for the inconvenience. But I did quickly take a look: **pypi**: I managed to reproduce the above error with the pypi version begin out of date. The version on `https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` should be up to date, but it was my understanding that there was some issue with the pypi upload, so I don't even understand why there is a version [on pypi from April 1](https://pypi.org/project/bigbench/0.0.1/). Perhaps @ethansdyer, who's handling the pypi upload, knows the answer to that? **OOM error**: But, I'm unable to reproduce the OOM error in a google colab with GPU enabled. This is what I ran: ``` !pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz !pip install datasets from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` The `swedish_to_german_proverbs`task is only 72 examples, so I don't understand what could be causing the OOM error. Loading the task has no effect on the RAM for me. @cceyda Can you confirm that this does not occur in a [colab](https://colab.research.google.com/)? If the GPU is somehow causing issues on your system, disabling the GPU from TF might be an option too ``` import os os.environ["CUDA_VISIBLE_DEVICES"] = "-1" ```
## Describe the bug Loading bigbech ```py from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` tries to use gpu and fails with OOM with the following error ``` Downloading and preparing dataset bigbench/swedish_to_german_proverbs (download: Unknown size, generated: 68.92 KiB, post-processed: Unknown size, total: 68.92 KiB) to /home/ceyda/.cache/huggingface/datasets/bigbench/swedish_to_german_proverbs/1.0.0/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0... Generating default split: 0%| | 0/72 [00:00<?, ? examples/s]2022-06-13 14:11:04.154469: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-13 14:11:05.133600: F tensorflow/core/platform/statusor.cc:33] Attempting to fetch value instead of handling error INTERNAL: failed initializing StreamExecutor for CUDA device ordinal 3: INTERNAL: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 25396838400 Aborted (core dumped) ``` I think this is because bigbench dependency (below) installs tensorflow (GPU version) and dataloading tries to use GPU as default. `pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` while just doing 'pip install bigbench' results in following error ``` File "/home/ceyda/.local/lib/python3.7/site-packages/datasets/load.py", line 109, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 118, in <module> class Bigbench(datasets.GeneratorBasedBuilder): File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 127, in Bigbench BigBenchConfig(name=name, version=datasets.Version("1.0.0")) for name in bb_utils.get_all_json_task_names() AttributeError: module 'bigbench.api.util' has no attribute 'get_all_json_task_names' ``` ## Steps to avoid the bug Not ideal but can solve with (since I don't really use tensorflow elsewhere) `pip uninstall tensorflow` `pip install tensorflow-cpu` ## Environment info - datasets @ master - Python version: 3.7
716
199
Bigbench tensorflow GPU dependency ## Describe the bug Loading bigbech ```py from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` tries to use gpu and fails with OOM with the following error ``` Downloading and preparing dataset bigbench/swedish_to_german_proverbs (download: Unknown size, generated: 68.92 KiB, post-processed: Unknown size, total: 68.92 KiB) to /home/ceyda/.cache/huggingface/datasets/bigbench/swedish_to_german_proverbs/1.0.0/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0... Generating default split: 0%| | 0/72 [00:00<?, ? examples/s]2022-06-13 14:11:04.154469: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-13 14:11:05.133600: F tensorflow/core/platform/statusor.cc:33] Attempting to fetch value instead of handling error INTERNAL: failed initializing StreamExecutor for CUDA device ordinal 3: INTERNAL: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 25396838400 Aborted (core dumped) ``` I think this is because bigbench dependency (below) installs tensorflow (GPU version) and dataloading tries to use GPU as default. `pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` while just doing 'pip install bigbench' results in following error ``` File "/home/ceyda/.local/lib/python3.7/site-packages/datasets/load.py", line 109, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 118, in <module> class Bigbench(datasets.GeneratorBasedBuilder): File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 127, in Bigbench BigBenchConfig(name=name, version=datasets.Version("1.0.0")) for name in bb_utils.get_all_json_task_names() AttributeError: module 'bigbench.api.util' has no attribute 'get_all_json_task_names' ``` ## Steps to avoid the bug Not ideal but can solve with (since I don't really use tensorflow elsewhere) `pip uninstall tensorflow` `pip install tensorflow-cpu` ## Environment info - datasets @ master - Python version: 3.7 I'm on vacation for the next week, so won't be able to do much debugging at the moment. Sorry for the inconvenience. But I did quickly take a look: **pypi**: I managed to reproduce the above error with the pypi version begin out of date. The version on `https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` should be up to date, but it was my understanding that there was some issue with the pypi upload, so I don't even understand why there is a version [on pypi from April 1](https://pypi.org/project/bigbench/0.0.1/). Perhaps @ethansdyer, who's handling the pypi upload, knows the answer to that? **OOM error**: But, I'm unable to reproduce the OOM error in a google colab with GPU enabled. This is what I ran: ``` !pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz !pip install datasets from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` The `swedish_to_german_proverbs`task is only 72 examples, so I don't understand what could be causing the OOM error. Loading the task has no effect on the RAM for me. @cceyda Can you confirm that this does not occur in a [colab](https://colab.research.google.com/)? If the GPU is somehow causing issues on your system, disabling the GPU from TF might be an option too ``` import os os.environ["CUDA_VISIBLE_DEVICES"] = "-1" ```
[ -1.2032077312469482, -0.9201056361198425, -0.8241819739341736, 1.467660665512085, -0.13401123881340027, -1.2303836345672607, 0.14834332466125488, -1.0224395990371704, 1.6082500219345093, -0.7276047468185425, 0.297403484582901, -1.6038767099380493, 0.005016409792006016, -0.5210126042366028, -0.7752813696861267, -0.7692354917526245, -0.4628104269504547, -0.8306950926780701, 1.0262808799743652, 2.538252115249634, 1.2559787034988403, -1.3998546600341797, 2.703399419784546, 0.7502493262290955, -0.278358519077301, -1.010737657546997, 0.46083107590675354, 0.01514586340636015, -1.3006095886230469, -0.4758721888065338, -0.8646098971366882, -0.007191079668700695, -0.5392616391181946, -0.5043202042579651, 0.052605465054512024, 0.37991654872894287, -0.24359726905822754, -0.41561079025268555, -0.5136937499046326, -0.7203843593597412, 0.47824835777282715, -0.33706894516944885, 0.9192613959312439, -0.2541545331478119, 1.6973592042922974, -0.565234899520874, 0.41505005955696106, 0.7419469356536865, 1.3048045635223389, 0.13911212980747223, 0.033998001366853714, 0.3335248827934265, 0.38772356510162354, -0.019237440079450607, 0.46947401762008667, 1.2816076278686523, 0.6312572360038757, 0.39636242389678955, 0.7491216063499451, -2.185223340988159, 1.324557900428772, -0.9913491010665894, 0.30263373255729675, 1.3444594144821167, -0.9278745651245117, 0.3055684268474579, -1.8083091974258423, -0.09046190977096558, 0.5242212414741516, -2.2291531562805176, 0.32053932547569275, -1.284623622894287, -0.5584965348243713, 0.9910187721252441, 0.28655150532722473, -1.2269771099090576, 0.1793321818113327, -0.49828311800956726, 0.9974678754806519, 0.4558376371860504, 1.1798069477081299, -1.7035003900527954, -0.033346083015203476, -0.2187722772359848, 0.053602270781993866, -1.3078900575637817, -1.5132697820663452, 0.4879189133644104, 0.615102231502533, 0.6052577495574951, -0.06209716573357582, 1.0141929388046265, -1.0252327919006348, 0.8716583251953125, -0.9817924499511719, -1.627864956855774, -1.3726600408554077, -2.3691582679748535, -2.257277727127075, 0.7277441620826721, -0.4714297950267792, -0.4852781593799591, 2.054025173187256, -1.0569357872009277, -1.7476847171783447, 1.132009744644165, 0.3471728563308716, 0.009705259464681149, 2.3155441284179688, 0.2558002173900604, -0.7800155878067017, 0.41877251863479614, -0.7259470224380493, 0.8180185556411743, -0.38851168751716614, 1.3662432432174683, 0.5334737300872803, -0.9552222490310669, 1.5605921745300293, -0.3612404465675354, 0.5467891097068787, -0.6968295574188232, -0.5410314202308655, -0.7247757315635681, 0.32123318314552307, 1.8604137897491455, -0.37200313806533813, 1.5740410089492798, -0.40433287620544434, -1.5876951217651367, -1.5283583402633667, 0.8729033470153809, 0.517815887928009, -0.7275316119194031, 0.1541471630334854, -0.47860655188560486, 0.14542825520038605, -0.05947726219892502, 1.0614402294158936, 1.2514950037002563, 0.6992582678794861, -0.3741733431816101, -0.9375860691070557, 0.21378402411937714, -0.0430222786962986, -0.7016111612319946, -1.8146584033966064, -0.2884422242641449, 0.15654926002025604, 0.6205719113349915, -1.2666985988616943, 1.6968467235565186, 0.846662163734436, 1.9599300622940063, 0.9414360523223877, -0.33726200461387634, 1.4953004121780396, -0.03885509818792343, 1.826499581336975, -0.5022348165512085, 0.5900201201438904, -0.3578930199146271, -1.116992473602295, 0.9424397945404053, -0.31331637501716614, -2.0750904083251953, -0.7359824776649475, -0.7949547171592712, -0.2947666645050049, -0.7959781289100647, 0.9321630001068115, -0.25670355558395386, -1.438202977180481, 0.17246311902999878, -0.7179214954376221, 0.10858046263456345, -1.1937273740768433, 0.2973887622356415, 0.7173920273780823, -0.5877088904380798, -0.016771448776125908, -0.17873714864253998, -1.2657397985458374, -0.40628582239151, 0.3092993199825287, 1.8492621183395386, -0.7366807460784912, 1.0297731161117554, 1.1218386888504028, -0.6797970533370972, 0.15832212567329407, 0.309474915266037, -0.3563394248485565, 0.8465628027915955, -1.0700393915176392, -0.39385759830474854, 1.129155158996582, -0.13120701909065247, -0.6061717867851257, 1.4718964099884033, 0.7766987085342407, -1.0191789865493774, -0.2541082203388214, -0.06657618284225464, -0.8232247829437256, 0.08262298256158829, -1.6395248174667358, -0.17052075266838074, 0.37585943937301636, -1.4964661598205566, -0.4645829498767853, -0.22752590477466583, 1.3241828680038452, -0.2106797695159912, 1.51699960231781, -0.32344821095466614, -0.08184951543807983, -0.32619380950927734, -0.35792186856269836, 0.1119927242398262, -0.16365475952625275, -0.5679425597190857, 0.2727501094341278, -0.8736442923545837, 0.32119327783584595, 1.4903972148895264, 0.3469947278499603, 0.04080123081803322, 0.45620420575141907, 1.0765279531478882, 0.3673153817653656, -0.017927834764122963, -0.857609748840332, -1.586431860923767, 2.0175726413726807, -1.4564605951309204, 2.0528745651245117, 0.8692668676376343, -0.0335184670984745, -1.7497283220291138, -1.9056912660598755, 1.3699604272842407, 1.1127721071243286, 2.396153211593628, 0.5199050903320312, 0.4132823944091797, -0.7966192364692688, -0.7089059352874756, 0.3996986746788025, -1.0934784412384033, -0.7008622884750366, 0.0665268748998642, 2.4608242511749268, 1.7256711721420288, -0.4613979458808899, -0.25144803524017334, -0.971075713634491, 1.306183099746704, -0.1274803727865219, 0.23310597240924835, 2.019279956817627, -0.25870874524116516, -1.009957194328308, 1.2597514390945435, -2.357196092605591, 0.208417147397995, 2.0467450618743896, 0.31824153661727905, 0.09670040011405945, -1.4220259189605713, -0.549039363861084, -0.2985873818397522, -0.4705100953578949, -1.1436867713928223, 0.6045225262641907, -0.2561366856098175, -0.904768705368042, -1.392305850982666, 0.1610364019870758, -1.161340355873108, -1.7037005424499512, 0.356955349445343, 1.8538881540298462, 2.092026710510254, -0.8214793801307678, 1.4385144710540771, -0.3013302981853485, 0.06294845044612885, 1.1736609935760498, 1.2677569389343262, 3.090437650680542, 1.7879995107650757, -1.3531991243362427, 0.6621565222740173, -0.15781553089618683, -0.5117402076721191, 1.148421049118042, -1.2164745330810547, 1.164716124534607, -0.17954525351524353, -1.1710437536239624, -1.2042155265808105, 1.0404185056686401, 0.550237774848938, 0.07279222458600998, -0.5175001621246338, 1.1351375579833984, 0.12555696070194244, 1.2517884969711304, 0.5902012586593628, -0.28715237975120544, 0.6197226047515869, -0.39823806285858154, -0.49001163244247437, 1.5039151906967163, 0.19467860460281372, -1.3826985359191895, -2.3040850162506104, -0.2097843885421753, -0.8791898488998413, 0.025225471705198288, -0.6080001592636108, -0.9783397316932678, 1.6579002141952515, 0.41365355253219604, -1.2842832803726196, -0.2457701712846756, -0.3223254084587097, -0.584570586681366, 2.628035306930542, -1.4004826545715332, -0.16944092512130737, -0.9905068278312683, -0.5368046164512634, 1.6671333312988281, -1.1689037084579468, -0.27179259061813354, -1.0627962350845337, -0.6097376942634583, -1.267650842666626, -0.5975795388221741, 0.04790028557181358, -0.8774163722991943, 0.7860099077224731, 0.13259656727313995, -1.1374293565750122, -0.2273964136838913, -0.8450984358787537, 0.9582204222679138, -0.11923156678676605, 0.2414407730102539, 1.806589126586914, 0.46458700299263, -0.34332653880119324, 0.724812924861908, 1.1783114671707153, 0.6395159363746643, -0.6673892140388489, 0.16671784222126007, -0.6514497399330139, 0.29528138041496277, -1.3800666332244873, 0.35983285307884216, -2.813636541366577, 0.6600558757781982, -0.010436221025884151, -0.04574374109506607, -0.054115284234285355, -1.325911521911621, 1.1573216915130615, 2.63763689994812, -1.2406367063522339, 0.5144332051277161, 0.3866288959980011, 1.1077276468276978, -1.54795503616333, 0.2876814007759094, -0.46158936619758606, 2.202960968017578, 0.21917571127414703, 1.2662848234176636, -0.5293635725975037, -2.242396593093872, 0.6585742831230164, -1.2525787353515625, -1.1049562692642212, 0.7480039000511169, -0.8745762705802917, 0.10547962039709091, -1.472998023033142, -0.28131598234176636, -0.9479436278343201, -1.2442049980163574, 0.7008176445960999, 0.14447249472141266, 0.45664146542549133, -0.6555058360099792, 0.31876951456069946, -2.208530902862549, -1.3105911016464233, -0.18920449912548065, -0.972680389881134, 0.5237227082252502, -0.3794652819633484, 0.6179312467575073, -0.12050198018550873, 0.012363369576632977, 0.30946511030197144, 1.309094786643982, 3.434276819229126, 0.2255653738975525, 0.2775489389896393, -0.15967553853988647, -0.9486132860183716, 1.4384998083114624, 0.9545161128044128, -0.060033250600099564, -0.6625696420669556, -1.0509413480758667, 1.2299797534942627, 2.0308778285980225, 1.0560342073440552, 0.015054081566631794, -0.8434111475944519, -0.7832330465316772, 0.017542745918035507, 0.23203134536743164, 0.5177996158599854, 0.9348502159118652, -0.048472363501787186, 0.04055134952068329, 1.3961244821548462, 1.1912249326705933, -0.4254278242588043, 0.37002500891685486, -0.8772278428077698, -0.39034226536750793, 0.43030232191085815, 0.24921715259552002, 0.08640596270561218, 0.433481365442276, -1.026386022567749, -0.3298393487930298, -0.3687441349029541, -0.9268862009048462, -0.7405399680137634, -0.4025549590587616, -0.37179577350616455, 1.5962027311325073, 0.11526534706354141, -0.43878915905952454, -0.03712954744696617, -0.8138545751571655, -0.11920197308063507, -1.1029871702194214, 0.20969116687774658, -0.1495860069990158, -0.09226469695568085, -0.15748527646064758, 1.7704899311065674, -0.9315146803855896, -2.085200071334839, 0.2843148708343506, 0.24979087710380554, -0.4254789352416992, 0.23074547946453094, 1.6968467235565186, 0.6151099801063538, 1.351997971534729, 1.28169584274292, 0.998131275177002, -0.6402034163475037, -1.1725094318389893, 0.6931460499763489, 1.0068978071212769, -1.4414852857589722, 0.765008270740509, -0.05650926008820534, -0.5146540403366089, 0.6889539957046509, 1.3216683864593506, 0.5175948739051819, -2.086897850036621, 0.8212977647781372, -0.9103721976280212, 0.7754989266395569, 0.6503604650497437, 0.8036128282546997, 0.22597672045230865, 0.8212975263595581, -1.2822593450546265, -1.0733578205108643, -0.7308039665222168, -0.6863729953765869, 2.012063503265381, -0.21047872304916382, 0.5671018362045288, -0.13498374819755554, -1.271000862121582, -0.13802383840084076, 0.7647143006324768, 0.30842575430870056, -0.4424861669540405, 0.8311657905578613, -0.6423236727714539, -1.0374013185501099, -1.3114416599273682, -0.4176309108734131, -0.9639071822166443, -0.9152145385742188, 0.9777334928512573, 0.804633378982544, 0.40157055854797363, 1.9634521007537842, 0.6571391224861145, 0.2569781541824341, -2.6234347820281982, 0.9003820419311523, 0.3092924952507019, -0.038207828998565674, 0.8945602178573608, 0.24889835715293884, 1.0838167667388916, 0.01022364292293787, 0.60048508644104, -2.4525482654571533, 2.239100694656372, -0.1874413937330246, 0.6669781804084778, 0.046160876750946045, -0.20678682625293732, 1.1219226121902466, 0.6024457812309265, 0.565480649471283, -1.1547214984893799, 0.7659350037574768, -0.656766951084137, 1.1814788579940796, 0.9051496982574463, -0.8244529962539673, 0.03287814185023308, 1.340448260307312, 0.3244841992855072, -0.4106370806694031, -0.8853771090507507, -0.9095167517662048, 0.9537054300308228, 1.7692962884902954, -0.05751160904765129, 0.0398324579000473, 0.8602349758148193, 0.7040099501609802, -1.2757612466812134, 0.05365900695323944, -0.7314667105674744, -0.7938037514686584, 1.6535264253616333, 2.0813400745391846, -0.17787058651447296, -0.16741560399532318, -0.7288733720779419, -1.1605935096740723, 0.8317263722419739, -0.08330846577882767, 0.14281611144542694, 0.5639311075210571, -0.6432645320892334, 1.1971741914749146, 0.7723512649536133, 0.9498780369758606, -0.018636934459209442, 0.3250916600227356, 0.3628430664539337, -0.2506786286830902, -1.1545861959457397, -0.38679176568984985, -1.1135966777801514, -2.579819917678833, 0.4498680830001831, -0.20034462213516235, -1.3928911685943604, -0.0174336489289999, -1.035784125328064, 0.8472443222999573, -0.6220781803131104, -1.1236003637313843, -1.5280933380126953, 0.22252051532268524, -0.1366550475358963, 0.94700688123703, -1.6756999492645264, -0.16351236402988434, 1.165264368057251, 0.8409405946731567, -0.5726020336151123, 0.9975647926330566, 0.22729001939296722, 0.9509826302528381, 0.8554666638374329, -0.3536340892314911, 0.51591557264328, 0.19745558500289917, -1.387677550315857, 0.40839630365371704, 1.2589844465255737, 0.18134355545043945, 1.4865567684173584, -0.5017092823982239, 0.06289006024599075, 0.44848525524139404, -0.5737323760986328, -0.5402278304100037, -0.5015007257461548, 0.7342356443405151, 0.08124542236328125, -1.0326564311981201, 0.0022809533402323723, -0.13479097187519073, -0.21965889632701874, 0.21434101462364197, -1.5547664165496826, -0.28484976291656494, -0.39508119225502014, -0.5227251648902893, -1.285709261894226, -0.004545914940536022, 1.3533601760864258, -0.8157994151115417, -0.20438946783542633, 0.44153523445129395, 0.3658524751663208, 0.5428634881973267, 0.6089588403701782, -0.5831108093261719, -0.41388192772865295, -0.2892291843891144, -0.31520140171051025, 0.31133797764778137, 1.2331914901733398, -0.0530148446559906, -0.9608542323112488, 0.702635645866394, -0.4660150706768036, 0.13197357952594757, 1.9365848302841187, 0.006043614819645882, -0.7468991875648499, 0.3864073157310486, -0.6193599104881287, 1.8185837268829346, 1.6596145629882812, 1.3475135564804077, -0.1565154641866684, -0.9658699631690979, 0.6238228678703308, -0.3333044946193695, -0.3761312961578369, 0.9207738041877747, 0.4287824332714081, -0.21997356414794922, -1.3991175889968872, 0.5000318884849548, 1.3089447021484375, -0.9371135234832764, -0.8206175565719604, 0.08205664157867432, -0.8936752676963806, 1.0855506658554077, 0.6160843372344971, 0.2859600782394409, 0.27754831314086914, 1.5804649591445923, 0.640627384185791, -0.5039098262786865, 0.5331560969352722, 0.4695693850517273, -0.197955921292305, -2.1233069896698, -1.0522401332855225, 0.32668036222457886, -0.3321390450000763, -1.577479600906372, 1.352126121520996, -1.1788957118988037, -1.0090996026992798, 0.5107294917106628, 0.08786094933748245, 1.409876823425293, 0.3334912061691284, 1.7152996063232422, 2.1737027168273926, 0.8957229852676392, 0.34664222598075867, 1.2904207706451416, -0.13144396245479584, -0.4738656282424927, 1.8607113361358643, -0.5343003869056702, 0.5128389596939087, 1.0678668022155762, -0.39571166038513184, -1.1085525751113892, -0.7790065407752991, -1.2175410985946655, -0.7163081765174866, 1.2967838048934937, 0.07069964706897736, -1.1233398914337158, 0.2889600396156311, 1.704172134399414, 0.11875646561384201, -0.2313459813594818, 0.674891471862793, 0.4308803975582123, -0.8113834857940674, -0.09731825441122055, -0.8836132884025574, 0.5297154188156128, -0.14624221622943878, -0.32849976420402527, 0.26661965250968933, 0.5826292037963867, 1.257027268409729, -0.11403833329677582, 0.02598845213651657, 1.1585073471069336, -1.5143393278121948, 1.6016122102737427, -0.5680526494979858, 0.23503421247005463, -2.4108645915985107, 1.329043984413147, -0.778740644454956, 1.929465651512146, -2.6036665439605713, 0.4254937767982483, -0.5281021595001221, -0.48024189472198486, 0.28551429510116577, -0.33619412779808044, 0.17439229786396027, -0.2106206715106964, -1.0434266328811646, -0.12093300372362137, -0.7058881521224976, 0.6021024584770203, 1.1825944185256958, 1.305385708808899, -1.1069555282592773, -0.29595521092414856, -1.7678992748260498, -0.18508879840373993, -0.7263700366020203, 0.2698098421096802, -2.0180280208587646, -0.15887093544006348, -1.9954183101654053, -2.2611305713653564, -1.3711689710617065, -0.8764526844024658, 0.9931775331497192, 0.10395058244466782, -0.8764880895614624, 1.0628321170806885, -0.40801802277565, -1.7972192764282227, 1.0474807024002075, -2.140747308731079 ]
https://github.com/huggingface/datasets/issues/4480
Bigbench tensorflow GPU dependency
Solved. Yes it works on colab, and somehow magically on my machine too now. hmm not sure what was wrong before I had used a fresh venv both times with just the dataloading code, and tried multiple times. (maybe just a wrong tensorflow version got mixed up somehow) The tensorflow call seems to come from the bigbench side anyway. about bigbench pypi version update, I opened an issue over there https://github.com/google/BIG-bench/issues/846 anyway closing this now. If anyone else has the same problem can re-open.
## Describe the bug Loading bigbech ```py from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` tries to use gpu and fails with OOM with the following error ``` Downloading and preparing dataset bigbench/swedish_to_german_proverbs (download: Unknown size, generated: 68.92 KiB, post-processed: Unknown size, total: 68.92 KiB) to /home/ceyda/.cache/huggingface/datasets/bigbench/swedish_to_german_proverbs/1.0.0/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0... Generating default split: 0%| | 0/72 [00:00<?, ? examples/s]2022-06-13 14:11:04.154469: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-13 14:11:05.133600: F tensorflow/core/platform/statusor.cc:33] Attempting to fetch value instead of handling error INTERNAL: failed initializing StreamExecutor for CUDA device ordinal 3: INTERNAL: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 25396838400 Aborted (core dumped) ``` I think this is because bigbench dependency (below) installs tensorflow (GPU version) and dataloading tries to use GPU as default. `pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` while just doing 'pip install bigbench' results in following error ``` File "/home/ceyda/.local/lib/python3.7/site-packages/datasets/load.py", line 109, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 118, in <module> class Bigbench(datasets.GeneratorBasedBuilder): File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 127, in Bigbench BigBenchConfig(name=name, version=datasets.Version("1.0.0")) for name in bb_utils.get_all_json_task_names() AttributeError: module 'bigbench.api.util' has no attribute 'get_all_json_task_names' ``` ## Steps to avoid the bug Not ideal but can solve with (since I don't really use tensorflow elsewhere) `pip uninstall tensorflow` `pip install tensorflow-cpu` ## Environment info - datasets @ master - Python version: 3.7
716
84
Bigbench tensorflow GPU dependency ## Describe the bug Loading bigbech ```py from datasets import load_dataset dataset = load_dataset("bigbench","swedish_to_german_proverbs") ``` tries to use gpu and fails with OOM with the following error ``` Downloading and preparing dataset bigbench/swedish_to_german_proverbs (download: Unknown size, generated: 68.92 KiB, post-processed: Unknown size, total: 68.92 KiB) to /home/ceyda/.cache/huggingface/datasets/bigbench/swedish_to_german_proverbs/1.0.0/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0... Generating default split: 0%| | 0/72 [00:00<?, ? examples/s]2022-06-13 14:11:04.154469: I tensorflow/core/platform/cpu_feature_guard.cc:193] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN) to use the following CPU instructions in performance-critical operations: AVX2 AVX512F FMA To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags. 2022-06-13 14:11:05.133600: F tensorflow/core/platform/statusor.cc:33] Attempting to fetch value instead of handling error INTERNAL: failed initializing StreamExecutor for CUDA device ordinal 3: INTERNAL: failed call to cuDevicePrimaryCtxRetain: CUDA_ERROR_OUT_OF_MEMORY: out of memory; total memory reported: 25396838400 Aborted (core dumped) ``` I think this is because bigbench dependency (below) installs tensorflow (GPU version) and dataloading tries to use GPU as default. `pip install bigbench@https://storage.googleapis.com/public_research_data/bigbench/bigbench-0.0.1.tar.gz` while just doing 'pip install bigbench' results in following error ``` File "/home/ceyda/.local/lib/python3.7/site-packages/datasets/load.py", line 109, in import_main_class module = importlib.import_module(module_path) File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 118, in <module> class Bigbench(datasets.GeneratorBasedBuilder): File "/home/ceyda/.cache/huggingface/modules/datasets_modules/datasets/bigbench/7d2f6e537fa937dfaac8b1c1df782f2055071d3fd8e4f4ae93d28012a354ced0/bigbench.py", line 127, in Bigbench BigBenchConfig(name=name, version=datasets.Version("1.0.0")) for name in bb_utils.get_all_json_task_names() AttributeError: module 'bigbench.api.util' has no attribute 'get_all_json_task_names' ``` ## Steps to avoid the bug Not ideal but can solve with (since I don't really use tensorflow elsewhere) `pip uninstall tensorflow` `pip install tensorflow-cpu` ## Environment info - datasets @ master - Python version: 3.7 Solved. Yes it works on colab, and somehow magically on my machine too now. hmm not sure what was wrong before I had used a fresh venv both times with just the dataloading code, and tried multiple times. (maybe just a wrong tensorflow version got mixed up somehow) The tensorflow call seems to come from the bigbench side anyway. about bigbench pypi version update, I opened an issue over there https://github.com/google/BIG-bench/issues/846 anyway closing this now. If anyone else has the same problem can re-open.
[ -1.2032077312469482, -0.9201056361198425, -0.8241819739341736, 1.467660665512085, -0.13401123881340027, -1.2303836345672607, 0.14834332466125488, -1.0224395990371704, 1.6082500219345093, -0.7276047468185425, 0.297403484582901, -1.6038767099380493, 0.005016409792006016, -0.5210126042366028, -0.7752813696861267, -0.7692354917526245, -0.4628104269504547, -0.8306950926780701, 1.0262808799743652, 2.538252115249634, 1.2559787034988403, -1.3998546600341797, 2.703399419784546, 0.7502493262290955, -0.278358519077301, -1.010737657546997, 0.46083107590675354, 0.01514586340636015, -1.3006095886230469, -0.4758721888065338, -0.8646098971366882, -0.007191079668700695, -0.5392616391181946, -0.5043202042579651, 0.052605465054512024, 0.37991654872894287, -0.24359726905822754, -0.41561079025268555, -0.5136937499046326, -0.7203843593597412, 0.47824835777282715, -0.33706894516944885, 0.9192613959312439, -0.2541545331478119, 1.6973592042922974, -0.565234899520874, 0.41505005955696106, 0.7419469356536865, 1.3048045635223389, 0.13911212980747223, 0.033998001366853714, 0.3335248827934265, 0.38772356510162354, -0.019237440079450607, 0.46947401762008667, 1.2816076278686523, 0.6312572360038757, 0.39636242389678955, 0.7491216063499451, -2.185223340988159, 1.324557900428772, -0.9913491010665894, 0.30263373255729675, 1.3444594144821167, -0.9278745651245117, 0.3055684268474579, -1.8083091974258423, -0.09046190977096558, 0.5242212414741516, -2.2291531562805176, 0.32053932547569275, -1.284623622894287, -0.5584965348243713, 0.9910187721252441, 0.28655150532722473, -1.2269771099090576, 0.1793321818113327, -0.49828311800956726, 0.9974678754806519, 0.4558376371860504, 1.1798069477081299, -1.7035003900527954, -0.033346083015203476, -0.2187722772359848, 0.053602270781993866, -1.3078900575637817, -1.5132697820663452, 0.4879189133644104, 0.615102231502533, 0.6052577495574951, -0.06209716573357582, 1.0141929388046265, -1.0252327919006348, 0.8716583251953125, -0.9817924499511719, -1.627864956855774, -1.3726600408554077, -2.3691582679748535, -2.257277727127075, 0.7277441620826721, -0.4714297950267792, -0.4852781593799591, 2.054025173187256, -1.0569357872009277, -1.7476847171783447, 1.132009744644165, 0.3471728563308716, 0.009705259464681149, 2.3155441284179688, 0.2558002173900604, -0.7800155878067017, 0.41877251863479614, -0.7259470224380493, 0.8180185556411743, -0.38851168751716614, 1.3662432432174683, 0.5334737300872803, -0.9552222490310669, 1.5605921745300293, -0.3612404465675354, 0.5467891097068787, -0.6968295574188232, -0.5410314202308655, -0.7247757315635681, 0.32123318314552307, 1.8604137897491455, -0.37200313806533813, 1.5740410089492798, -0.40433287620544434, -1.5876951217651367, -1.5283583402633667, 0.8729033470153809, 0.517815887928009, -0.7275316119194031, 0.1541471630334854, -0.47860655188560486, 0.14542825520038605, -0.05947726219892502, 1.0614402294158936, 1.2514950037002563, 0.6992582678794861, -0.3741733431816101, -0.9375860691070557, 0.21378402411937714, -0.0430222786962986, -0.7016111612319946, -1.8146584033966064, -0.2884422242641449, 0.15654926002025604, 0.6205719113349915, -1.2666985988616943, 1.6968467235565186, 0.846662163734436, 1.9599300622940063, 0.9414360523223877, -0.33726200461387634, 1.4953004121780396, -0.03885509818792343, 1.826499581336975, -0.5022348165512085, 0.5900201201438904, -0.3578930199146271, -1.116992473602295, 0.9424397945404053, -0.31331637501716614, -2.0750904083251953, -0.7359824776649475, -0.7949547171592712, -0.2947666645050049, -0.7959781289100647, 0.9321630001068115, -0.25670355558395386, -1.438202977180481, 0.17246311902999878, -0.7179214954376221, 0.10858046263456345, -1.1937273740768433, 0.2973887622356415, 0.7173920273780823, -0.5877088904380798, -0.016771448776125908, -0.17873714864253998, -1.2657397985458374, -0.40628582239151, 0.3092993199825287, 1.8492621183395386, -0.7366807460784912, 1.0297731161117554, 1.1218386888504028, -0.6797970533370972, 0.15832212567329407, 0.309474915266037, -0.3563394248485565, 0.8465628027915955, -1.0700393915176392, -0.39385759830474854, 1.129155158996582, -0.13120701909065247, -0.6061717867851257, 1.4718964099884033, 0.7766987085342407, -1.0191789865493774, -0.2541082203388214, -0.06657618284225464, -0.8232247829437256, 0.08262298256158829, -1.6395248174667358, -0.17052075266838074, 0.37585943937301636, -1.4964661598205566, -0.4645829498767853, -0.22752590477466583, 1.3241828680038452, -0.2106797695159912, 1.51699960231781, -0.32344821095466614, -0.08184951543807983, -0.32619380950927734, -0.35792186856269836, 0.1119927242398262, -0.16365475952625275, -0.5679425597190857, 0.2727501094341278, -0.8736442923545837, 0.32119327783584595, 1.4903972148895264, 0.3469947278499603, 0.04080123081803322, 0.45620420575141907, 1.0765279531478882, 0.3673153817653656, -0.017927834764122963, -0.857609748840332, -1.586431860923767, 2.0175726413726807, -1.4564605951309204, 2.0528745651245117, 0.8692668676376343, -0.0335184670984745, -1.7497283220291138, -1.9056912660598755, 1.3699604272842407, 1.1127721071243286, 2.396153211593628, 0.5199050903320312, 0.4132823944091797, -0.7966192364692688, -0.7089059352874756, 0.3996986746788025, -1.0934784412384033, -0.7008622884750366, 0.0665268748998642, 2.4608242511749268, 1.7256711721420288, -0.4613979458808899, -0.25144803524017334, -0.971075713634491, 1.306183099746704, -0.1274803727865219, 0.23310597240924835, 2.019279956817627, -0.25870874524116516, -1.009957194328308, 1.2597514390945435, -2.357196092605591, 0.208417147397995, 2.0467450618743896, 0.31824153661727905, 0.09670040011405945, -1.4220259189605713, -0.549039363861084, -0.2985873818397522, -0.4705100953578949, -1.1436867713928223, 0.6045225262641907, -0.2561366856098175, -0.904768705368042, -1.392305850982666, 0.1610364019870758, -1.161340355873108, -1.7037005424499512, 0.356955349445343, 1.8538881540298462, 2.092026710510254, -0.8214793801307678, 1.4385144710540771, -0.3013302981853485, 0.06294845044612885, 1.1736609935760498, 1.2677569389343262, 3.090437650680542, 1.7879995107650757, -1.3531991243362427, 0.6621565222740173, -0.15781553089618683, -0.5117402076721191, 1.148421049118042, -1.2164745330810547, 1.164716124534607, -0.17954525351524353, -1.1710437536239624, -1.2042155265808105, 1.0404185056686401, 0.550237774848938, 0.07279222458600998, -0.5175001621246338, 1.1351375579833984, 0.12555696070194244, 1.2517884969711304, 0.5902012586593628, -0.28715237975120544, 0.6197226047515869, -0.39823806285858154, -0.49001163244247437, 1.5039151906967163, 0.19467860460281372, -1.3826985359191895, -2.3040850162506104, -0.2097843885421753, -0.8791898488998413, 0.025225471705198288, -0.6080001592636108, -0.9783397316932678, 1.6579002141952515, 0.41365355253219604, -1.2842832803726196, -0.2457701712846756, -0.3223254084587097, -0.584570586681366, 2.628035306930542, -1.4004826545715332, -0.16944092512130737, -0.9905068278312683, -0.5368046164512634, 1.6671333312988281, -1.1689037084579468, -0.27179259061813354, -1.0627962350845337, -0.6097376942634583, -1.267650842666626, -0.5975795388221741, 0.04790028557181358, -0.8774163722991943, 0.7860099077224731, 0.13259656727313995, -1.1374293565750122, -0.2273964136838913, -0.8450984358787537, 0.9582204222679138, -0.11923156678676605, 0.2414407730102539, 1.806589126586914, 0.46458700299263, -0.34332653880119324, 0.724812924861908, 1.1783114671707153, 0.6395159363746643, -0.6673892140388489, 0.16671784222126007, -0.6514497399330139, 0.29528138041496277, -1.3800666332244873, 0.35983285307884216, -2.813636541366577, 0.6600558757781982, -0.010436221025884151, -0.04574374109506607, -0.054115284234285355, -1.325911521911621, 1.1573216915130615, 2.63763689994812, -1.2406367063522339, 0.5144332051277161, 0.3866288959980011, 1.1077276468276978, -1.54795503616333, 0.2876814007759094, -0.46158936619758606, 2.202960968017578, 0.21917571127414703, 1.2662848234176636, -0.5293635725975037, -2.242396593093872, 0.6585742831230164, -1.2525787353515625, -1.1049562692642212, 0.7480039000511169, -0.8745762705802917, 0.10547962039709091, -1.472998023033142, -0.28131598234176636, -0.9479436278343201, -1.2442049980163574, 0.7008176445960999, 0.14447249472141266, 0.45664146542549133, -0.6555058360099792, 0.31876951456069946, -2.208530902862549, -1.3105911016464233, -0.18920449912548065, -0.972680389881134, 0.5237227082252502, -0.3794652819633484, 0.6179312467575073, -0.12050198018550873, 0.012363369576632977, 0.30946511030197144, 1.309094786643982, 3.434276819229126, 0.2255653738975525, 0.2775489389896393, -0.15967553853988647, -0.9486132860183716, 1.4384998083114624, 0.9545161128044128, -0.060033250600099564, -0.6625696420669556, -1.0509413480758667, 1.2299797534942627, 2.0308778285980225, 1.0560342073440552, 0.015054081566631794, -0.8434111475944519, -0.7832330465316772, 0.017542745918035507, 0.23203134536743164, 0.5177996158599854, 0.9348502159118652, -0.048472363501787186, 0.04055134952068329, 1.3961244821548462, 1.1912249326705933, -0.4254278242588043, 0.37002500891685486, -0.8772278428077698, -0.39034226536750793, 0.43030232191085815, 0.24921715259552002, 0.08640596270561218, 0.433481365442276, -1.026386022567749, -0.3298393487930298, -0.3687441349029541, -0.9268862009048462, -0.7405399680137634, -0.4025549590587616, -0.37179577350616455, 1.5962027311325073, 0.11526534706354141, -0.43878915905952454, -0.03712954744696617, -0.8138545751571655, -0.11920197308063507, -1.1029871702194214, 0.20969116687774658, -0.1495860069990158, -0.09226469695568085, -0.15748527646064758, 1.7704899311065674, -0.9315146803855896, -2.085200071334839, 0.2843148708343506, 0.24979087710380554, -0.4254789352416992, 0.23074547946453094, 1.6968467235565186, 0.6151099801063538, 1.351997971534729, 1.28169584274292, 0.998131275177002, -0.6402034163475037, -1.1725094318389893, 0.6931460499763489, 1.0068978071212769, -1.4414852857589722, 0.765008270740509, -0.05650926008820534, -0.5146540403366089, 0.6889539957046509, 1.3216683864593506, 0.5175948739051819, -2.086897850036621, 0.8212977647781372, -0.9103721976280212, 0.7754989266395569, 0.6503604650497437, 0.8036128282546997, 0.22597672045230865, 0.8212975263595581, -1.2822593450546265, -1.0733578205108643, -0.7308039665222168, -0.6863729953765869, 2.012063503265381, -0.21047872304916382, 0.5671018362045288, -0.13498374819755554, -1.271000862121582, -0.13802383840084076, 0.7647143006324768, 0.30842575430870056, -0.4424861669540405, 0.8311657905578613, -0.6423236727714539, -1.0374013185501099, -1.3114416599273682, -0.4176309108734131, -0.9639071822166443, -0.9152145385742188, 0.9777334928512573, 0.804633378982544, 0.40157055854797363, 1.9634521007537842, 0.6571391224861145, 0.2569781541824341, -2.6234347820281982, 0.9003820419311523, 0.3092924952507019, -0.038207828998565674, 0.8945602178573608, 0.24889835715293884, 1.0838167667388916, 0.01022364292293787, 0.60048508644104, -2.4525482654571533, 2.239100694656372, -0.1874413937330246, 0.6669781804084778, 0.046160876750946045, -0.20678682625293732, 1.1219226121902466, 0.6024457812309265, 0.565480649471283, -1.1547214984893799, 0.7659350037574768, -0.656766951084137, 1.1814788579940796, 0.9051496982574463, -0.8244529962539673, 0.03287814185023308, 1.340448260307312, 0.3244841992855072, -0.4106370806694031, -0.8853771090507507, -0.9095167517662048, 0.9537054300308228, 1.7692962884902954, -0.05751160904765129, 0.0398324579000473, 0.8602349758148193, 0.7040099501609802, -1.2757612466812134, 0.05365900695323944, -0.7314667105674744, -0.7938037514686584, 1.6535264253616333, 2.0813400745391846, -0.17787058651447296, -0.16741560399532318, -0.7288733720779419, -1.1605935096740723, 0.8317263722419739, -0.08330846577882767, 0.14281611144542694, 0.5639311075210571, -0.6432645320892334, 1.1971741914749146, 0.7723512649536133, 0.9498780369758606, -0.018636934459209442, 0.3250916600227356, 0.3628430664539337, -0.2506786286830902, -1.1545861959457397, -0.38679176568984985, -1.1135966777801514, -2.579819917678833, 0.4498680830001831, -0.20034462213516235, -1.3928911685943604, -0.0174336489289999, -1.035784125328064, 0.8472443222999573, -0.6220781803131104, -1.1236003637313843, -1.5280933380126953, 0.22252051532268524, -0.1366550475358963, 0.94700688123703, -1.6756999492645264, -0.16351236402988434, 1.165264368057251, 0.8409405946731567, -0.5726020336151123, 0.9975647926330566, 0.22729001939296722, 0.9509826302528381, 0.8554666638374329, -0.3536340892314911, 0.51591557264328, 0.19745558500289917, -1.387677550315857, 0.40839630365371704, 1.2589844465255737, 0.18134355545043945, 1.4865567684173584, -0.5017092823982239, 0.06289006024599075, 0.44848525524139404, -0.5737323760986328, -0.5402278304100037, -0.5015007257461548, 0.7342356443405151, 0.08124542236328125, -1.0326564311981201, 0.0022809533402323723, -0.13479097187519073, -0.21965889632701874, 0.21434101462364197, -1.5547664165496826, -0.28484976291656494, -0.39508119225502014, -0.5227251648902893, -1.285709261894226, -0.004545914940536022, 1.3533601760864258, -0.8157994151115417, -0.20438946783542633, 0.44153523445129395, 0.3658524751663208, 0.5428634881973267, 0.6089588403701782, -0.5831108093261719, -0.41388192772865295, -0.2892291843891144, -0.31520140171051025, 0.31133797764778137, 1.2331914901733398, -0.0530148446559906, -0.9608542323112488, 0.702635645866394, -0.4660150706768036, 0.13197357952594757, 1.9365848302841187, 0.006043614819645882, -0.7468991875648499, 0.3864073157310486, -0.6193599104881287, 1.8185837268829346, 1.6596145629882812, 1.3475135564804077, -0.1565154641866684, -0.9658699631690979, 0.6238228678703308, -0.3333044946193695, -0.3761312961578369, 0.9207738041877747, 0.4287824332714081, -0.21997356414794922, -1.3991175889968872, 0.5000318884849548, 1.3089447021484375, -0.9371135234832764, -0.8206175565719604, 0.08205664157867432, -0.8936752676963806, 1.0855506658554077, 0.6160843372344971, 0.2859600782394409, 0.27754831314086914, 1.5804649591445923, 0.640627384185791, -0.5039098262786865, 0.5331560969352722, 0.4695693850517273, -0.197955921292305, -2.1233069896698, -1.0522401332855225, 0.32668036222457886, -0.3321390450000763, -1.577479600906372, 1.352126121520996, -1.1788957118988037, -1.0090996026992798, 0.5107294917106628, 0.08786094933748245, 1.409876823425293, 0.3334912061691284, 1.7152996063232422, 2.1737027168273926, 0.8957229852676392, 0.34664222598075867, 1.2904207706451416, -0.13144396245479584, -0.4738656282424927, 1.8607113361358643, -0.5343003869056702, 0.5128389596939087, 1.0678668022155762, -0.39571166038513184, -1.1085525751113892, -0.7790065407752991, -1.2175410985946655, -0.7163081765174866, 1.2967838048934937, 0.07069964706897736, -1.1233398914337158, 0.2889600396156311, 1.704172134399414, 0.11875646561384201, -0.2313459813594818, 0.674891471862793, 0.4308803975582123, -0.8113834857940674, -0.09731825441122055, -0.8836132884025574, 0.5297154188156128, -0.14624221622943878, -0.32849976420402527, 0.26661965250968933, 0.5826292037963867, 1.257027268409729, -0.11403833329677582, 0.02598845213651657, 1.1585073471069336, -1.5143393278121948, 1.6016122102737427, -0.5680526494979858, 0.23503421247005463, -2.4108645915985107, 1.329043984413147, -0.778740644454956, 1.929465651512146, -2.6036665439605713, 0.4254937767982483, -0.5281021595001221, -0.48024189472198486, 0.28551429510116577, -0.33619412779808044, 0.17439229786396027, -0.2106206715106964, -1.0434266328811646, -0.12093300372362137, -0.7058881521224976, 0.6021024584770203, 1.1825944185256958, 1.305385708808899, -1.1069555282592773, -0.29595521092414856, -1.7678992748260498, -0.18508879840373993, -0.7263700366020203, 0.2698098421096802, -2.0180280208587646, -0.15887093544006348, -1.9954183101654053, -2.2611305713653564, -1.3711689710617065, -0.8764526844024658, 0.9931775331497192, 0.10395058244466782, -0.8764880895614624, 1.0628321170806885, -0.40801802277565, -1.7972192764282227, 1.0474807024002075, -2.140747308731079 ]
https://github.com/huggingface/datasets/issues/4478
Dataset slow during model training
Hi ! cc @Rocketknight1 maybe you know better ? I'm not too familiar with `tf.data.experimental.save`. Note that `datasets` uses memory mapping, so depending on your hardware and the disk you are using you can expect performance differences with a dataset loaded in RAM
## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB
717
43
Dataset slow during model training ## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB Hi ! cc @Rocketknight1 maybe you know better ? I'm not too familiar with `tf.data.experimental.save`. Note that `datasets` uses memory mapping, so depending on your hardware and the disk you are using you can expect performance differences with a dataset loaded in RAM
[ -1.33140230178833, -1.0034711360931396, -0.6648240685462952, 1.3942846059799194, -0.20022745430469513, -1.249970555305481, 0.15734997391700745, -1.0949218273162842, 1.5684064626693726, -0.8943634629249573, 0.2955647110939026, -1.7059777975082397, -0.025755688548088074, -0.5267432928085327, -0.7018626928329468, -0.9349560141563416, -0.42303866147994995, -0.7409504652023315, 1.1312156915664673, 2.4330594539642334, 1.1856801509857178, -1.315843105316162, 2.777482509613037, 0.6275325417518616, -0.18068723380565643, -1.0337296724319458, 0.5530669689178467, 0.0764383003115654, -1.286331295967102, -0.4052627384662628, -0.9915039539337158, -0.010935642756521702, -0.5678940415382385, -0.5319175720214844, 0.04824023321270943, 0.3996945917606354, -0.3490602970123291, -0.4369416832923889, -0.5868690013885498, -0.7435707449913025, 0.4826068580150604, -0.3583585321903229, 0.9604023694992065, -0.35297104716300964, 1.8037432432174683, -0.6216796636581421, 0.4497317671775818, 0.7496762871742249, 1.2304091453552246, 0.2205081582069397, 0.033298034220933914, 0.34353107213974, 0.3895590603351593, -0.0023463834077119827, 0.476630300283432, 1.1826101541519165, 0.5581126809120178, 0.5316040515899658, 0.7074525356292725, -2.204211473464966, 1.2891325950622559, -1.03062105178833, 0.3223783075809479, 1.4435936212539673, -0.9370455145835876, 0.4092695713043213, -1.6989243030548096, -0.12863130867481232, 0.5580679774284363, -2.2028024196624756, 0.2629257142543793, -1.3254181146621704, -0.5231800675392151, 0.9990862607955933, 0.4205922484397888, -1.118945837020874, 0.18856976926326752, -0.520612359046936, 1.035857081413269, 0.4113476872444153, 1.1620721817016602, -1.6540378332138062, -0.0413307286798954, -0.2573027014732361, 0.14713039994239807, -1.2923719882965088, -1.5828949213027954, 0.6054858565330505, 0.614232063293457, 0.6143751740455627, -0.15199707448482513, 1.0840188264846802, -1.0102488994598389, 0.7678001523017883, -1.0443211793899536, -1.6289311647415161, -1.4456323385238647, -2.2908477783203125, -2.3031351566314697, 0.7350087761878967, -0.46274203062057495, -0.5635320544242859, 2.092731475830078, -1.0805209875106812, -1.7460706233978271, 1.136231541633606, 0.21592186391353607, -0.013517961837351322, 2.38161039352417, 0.2914092242717743, -0.7044700384140015, 0.5587339401245117, -0.7459902167320251, 0.790701687335968, -0.27533820271492004, 1.3209586143493652, 0.45697614550590515, -0.9999330043792725, 1.5634685754776, -0.37301015853881836, 0.6365277767181396, -0.5827455520629883, -0.4881836771965027, -0.8182321190834045, 0.28396493196487427, 1.9078795909881592, -0.30048710107803345, 1.5901509523391724, -0.3117430806159973, -1.62453031539917, -1.640565037727356, 0.8610480427742004, 0.4556571841239929, -0.7759518027305603, 0.06710934638977051, -0.41714373230934143, 0.12207001447677612, 0.03866815194487572, 1.1637989282608032, 1.283877968788147, 0.8030509352684021, -0.3742998540401459, -0.8396161794662476, 0.15928728878498077, -0.02508327178657055, -0.7094135284423828, -1.7608511447906494, -0.31888869404792786, 0.14569571614265442, 0.5915691256523132, -1.1780710220336914, 1.754166603088379, 0.9565467834472656, 1.8777884244918823, 1.0156190395355225, -0.36638084053993225, 1.4047062397003174, 0.12406668066978455, 1.8515894412994385, -0.5017330050468445, 0.6766777038574219, -0.23524491488933563, -1.1623235940933228, 0.8075413703918457, -0.2961716055870056, -2.038367986679077, -0.8379063010215759, -0.7951989769935608, -0.1516704112291336, -0.7842414379119873, 0.9455950856208801, -0.26844361424446106, -1.4844900369644165, 0.2139638066291809, -0.6556153297424316, 0.1606132686138153, -1.1992584466934204, 0.21698226034641266, 0.6862213611602783, -0.6731002330780029, 0.0073857540264725685, -0.20877322554588318, -1.3257834911346436, -0.4087652564048767, 0.29608598351478577, 1.845707654953003, -0.7713230848312378, 1.008842945098877, 1.021352767944336, -0.6869891285896301, 0.03805007040500641, 0.24239540100097656, -0.29460641741752625, 0.8439412713050842, -1.0428353548049927, -0.4680594205856323, 1.2080788612365723, -0.23930728435516357, -0.6358835697174072, 1.5079584121704102, 0.7192259430885315, -1.0134189128875732, -0.19403326511383057, -0.17005124688148499, -0.8489658832550049, -0.03986850380897522, -1.5525861978530884, -0.10133013129234314, 0.43418389558792114, -1.4995626211166382, -0.47318345308303833, -0.2014051079750061, 1.2731934785842896, -0.17487551271915436, 1.4294793605804443, -0.39730775356292725, -0.2635231018066406, -0.36171671748161316, -0.36693325638771057, 0.22999294102191925, -0.18430234491825104, -0.6304823160171509, 0.15550199151039124, -0.9300394058227539, 0.2999286353588104, 1.5350651741027832, 0.413303405046463, 0.023018624633550644, 0.4864514470100403, 1.0990110635757446, 0.37456509470939636, -0.10065661370754242, -0.9065603613853455, -1.5658254623413086, 1.956932544708252, -1.3921833038330078, 1.9623891115188599, 0.6743853092193604, -0.08317282050848007, -1.8745206594467163, -1.8420385122299194, 1.2876979112625122, 1.2141036987304688, 2.3902599811553955, 0.4433659613132477, 0.3599550724029541, -0.7741530537605286, -0.7590254545211792, 0.36264315247535706, -0.99225914478302, -0.6004055142402649, 0.1783238649368286, 2.2787668704986572, 1.8253601789474487, -0.4908277690410614, -0.18653878569602966, -1.0482884645462036, 1.3714823722839355, -0.24325130879878998, 0.2330946922302246, 1.9881000518798828, -0.33278563618659973, -1.0344181060791016, 1.424367070198059, -2.234454870223999, 0.21848776936531067, 2.005375385284424, 0.29783183336257935, 0.062302302569150925, -1.3222718238830566, -0.6755915880203247, -0.34729012846946716, -0.403041273355484, -1.300951361656189, 0.4940037727355957, -0.25428110361099243, -0.8020524978637695, -1.3854974508285522, 0.07059895247220993, -1.0746866464614868, -1.726068377494812, 0.2909596860408783, 1.8324095010757446, 2.0674195289611816, -0.779207706451416, 1.4639431238174438, -0.3674057126045227, 0.20618146657943726, 1.1961404085159302, 1.2546586990356445, 3.067448616027832, 1.871524453163147, -1.3071084022521973, 0.68687504529953, -0.12387654185295105, -0.47351717948913574, 1.1903607845306396, -1.1702659130096436, 1.283178448677063, -0.19042998552322388, -1.2145582437515259, -1.1728918552398682, 1.0726646184921265, 0.42666083574295044, 0.061728719621896744, -0.5096796154975891, 1.2058333158493042, 0.03266455605626106, 1.3955291509628296, 0.5853676199913025, -0.42841359972953796, 0.6585455536842346, -0.4171101450920105, -0.5483424067497253, 1.5492359399795532, 0.1882944256067276, -1.500125527381897, -2.2374913692474365, -0.31745627522468567, -0.8184854984283447, 0.07447459548711777, -0.5905595421791077, -0.9972897171974182, 1.6635247468948364, 0.37850332260131836, -1.2943898439407349, -0.32000747323036194, -0.39138665795326233, -0.5517477989196777, 2.7495594024658203, -1.2759603261947632, -0.1477433443069458, -0.9620069861412048, -0.6813888549804688, 1.609246850013733, -1.1975281238555908, -0.24117077887058258, -1.063839077949524, -0.60662442445755, -1.4004244804382324, -0.5694291591644287, 0.07046250253915787, -0.970858633518219, 0.7628307342529297, 0.02844059094786644, -1.1065213680267334, -0.2827366888523102, -0.8844032883644104, 0.9733695387840271, -0.2359076887369156, 0.12058219313621521, 1.8499810695648193, 0.32666081190109253, -0.3951759338378906, 0.7375617623329163, 1.172351598739624, 0.6899322271347046, -0.7262793779373169, 0.01616724580526352, -0.7903013229370117, 0.23290668427944183, -1.2964446544647217, 0.2130350023508072, -2.910158157348633, 0.6919992566108704, -0.08193528652191162, -0.048569802194833755, -0.0075378711335361, -1.2619656324386597, 1.0293880701065063, 2.615492820739746, -1.2606662511825562, 0.4742269515991211, 0.3227040767669678, 1.1255638599395752, -1.5156067609786987, 0.30497094988822937, -0.4599120318889618, 2.036881685256958, 0.2832101583480835, 1.229503870010376, -0.5096839070320129, -2.1512250900268555, 0.6751455664634705, -1.2363052368164062, -1.1615350246429443, 0.8243309259414673, -0.9046815633773804, 0.21545347571372986, -1.3974310159683228, -0.2240004688501358, -0.9124523997306824, -1.1578739881515503, 0.6006720662117004, 0.10004977136850357, 0.41995105147361755, -0.5441268682479858, 0.3648173213005066, -2.259077310562134, -1.3967126607894897, -0.24392354488372803, -0.9866589307785034, 0.5244275331497192, -0.37044501304626465, 0.6532667875289917, -0.1753166913986206, 0.07597946375608444, 0.4006357192993164, 1.4674721956253052, 3.380509376525879, 0.23766104876995087, 0.21289274096488953, -0.118400938808918, -0.9747692942619324, 1.489569902420044, 0.9280660152435303, -0.07585127651691437, -0.5250540971755981, -1.0211803913116455, 1.2728869915008545, 1.8861902952194214, 1.058612585067749, 0.021010395139455795, -0.8880873322486877, -0.6757636666297913, 0.008408448658883572, 0.10482735186815262, 0.5013113617897034, 0.9403253793716431, 0.07394538819789886, 0.15772618353366852, 1.5013097524642944, 1.178622841835022, -0.3702889084815979, 0.3313300609588623, -0.8595125079154968, -0.5178197026252747, 0.4989498257637024, 0.2729586660861969, 0.02285158261656761, 0.4501834511756897, -1.0736846923828125, -0.24630247056484222, -0.42340219020843506, -0.9012263417243958, -0.7153199911117554, -0.4088599681854248, -0.44165366888046265, 1.5556045770645142, 0.12883517146110535, -0.5340194702148438, -0.08038638532161713, -0.7287706732749939, -0.1666039079427719, -1.03681480884552, 0.2830653488636017, -0.0748848095536232, -0.12060780823230743, -0.16756099462509155, 1.7294124364852905, -0.9008268117904663, -2.0120205879211426, 0.19780300557613373, 0.27229857444763184, -0.26482635736465454, 0.14982017874717712, 1.6500340700149536, 0.5801982879638672, 1.4119387865066528, 1.2932718992233276, 0.9642196893692017, -0.5882337689399719, -1.2471121549606323, 0.7129762172698975, 0.8999921679496765, -1.3638404607772827, 0.8100379705429077, -0.08744774013757706, -0.5448086857795715, 0.6834933161735535, 1.2709133625030518, 0.4865269362926483, -1.9523200988769531, 0.8391566872596741, -1.0147019624710083, 0.7571409344673157, 0.7514048218727112, 0.737683117389679, 0.11500554531812668, 0.904707133769989, -1.1723908185958862, -1.0523972511291504, -0.7318626046180725, -0.5879958868026733, 1.9409183263778687, -0.31055617332458496, 0.6071065664291382, -0.34753239154815674, -1.162872076034546, -0.0277109257876873, 0.724102795124054, 0.30338168144226074, -0.42789149284362793, 0.843166708946228, -0.5968573093414307, -1.043473482131958, -1.3300384283065796, -0.35405853390693665, -1.1008979082107544, -0.9186868667602539, 1.0604623556137085, 0.7211655378341675, 0.3217957019805908, 1.829956293106079, 0.6577604413032532, 0.25522130727767944, -2.621673583984375, 0.9281827807426453, 0.14333362877368927, -0.023297857493162155, 0.8320704102516174, 0.2730187475681305, 1.0115246772766113, -0.07707974314689636, 0.4918642044067383, -2.3862295150756836, 2.224308490753174, -0.25423499941825867, 0.6912299990653992, -0.023548288270831108, -0.16459588706493378, 1.1691840887069702, 0.6513428688049316, 0.5701993107795715, -1.0799006223678589, 0.6827551126480103, -0.5605362057685852, 1.185127854347229, 0.9520033597946167, -0.8203903436660767, 0.0004329029470682144, 1.4746575355529785, 0.47504740953445435, -0.46303582191467285, -0.9650285243988037, -0.9055814743041992, 1.006790280342102, 1.7191799879074097, -0.08331087231636047, -0.04985908418893814, 0.7689803838729858, 0.7427810430526733, -1.2989140748977661, 0.07025740295648575, -0.6677491664886475, -0.6682308316230774, 1.7591445446014404, 2.0863215923309326, -0.12932437658309937, -0.17046956717967987, -0.6382184028625488, -1.2769043445587158, 0.8105869889259338, -0.030895400792360306, 0.18601877987384796, 0.6584829092025757, -0.6477663516998291, 1.1575113534927368, 0.8041459321975708, 0.9676251411437988, 0.1880137026309967, 0.23578085005283356, 0.349956750869751, -0.3043513894081116, -1.2307788133621216, -0.22887136042118073, -1.0150755643844604, -2.510059118270874, 0.3805122673511505, -0.2182321399450302, -1.5069632530212402, 0.03339334577322006, -1.0036250352859497, 0.9628278017044067, -0.5471760034561157, -1.1105318069458008, -1.5916965007781982, 0.228280171751976, -0.062029656022787094, 0.9937504529953003, -1.6114829778671265, -0.138295516371727, 1.2057665586471558, 0.8924221992492676, -0.6694566607475281, 1.004670262336731, 0.22291620075702667, 0.989993691444397, 0.7794094085693359, -0.4491862952709198, 0.5298041701316833, 0.026254091411828995, -1.3565725088119507, 0.42924702167510986, 1.1648292541503906, 0.22177928686141968, 1.4596914052963257, -0.4926048219203949, 0.08371339738368988, 0.3782968819141388, -0.5986045002937317, -0.4852708578109741, -0.4658183157444, 0.6358498930931091, 0.019972439855337143, -0.9172592759132385, -0.07571323215961456, -0.05524660274386406, -0.2825661897659302, 0.243414044380188, -1.4210996627807617, -0.11562062799930573, -0.44695422053337097, -0.6503564715385437, -1.1827261447906494, -0.04001864045858383, 1.4420502185821533, -0.8743006587028503, -0.16263717412948608, 0.49797874689102173, 0.29492849111557007, 0.6302588582038879, 0.6454830169677734, -0.7296587228775024, -0.1746327131986618, -0.319559246301651, -0.2688648998737335, 0.28283268213272095, 1.294029712677002, -0.11805843561887741, -0.9566794633865356, 0.7088147401809692, -0.32717058062553406, 0.08606957644224167, 1.9333182573318481, 0.09189470112323761, -0.7092863917350769, 0.3276059925556183, -0.7386256456375122, 1.8776118755340576, 1.715536117553711, 1.3681944608688354, -0.1085817813873291, -0.9180020093917847, 0.5152882933616638, -0.26675349473953247, -0.4317878484725952, 0.8891614079475403, 0.40279775857925415, -0.19695726037025452, -1.405161738395691, 0.7984214425086975, 1.2606855630874634, -0.8482918739318848, -0.7543352842330933, 0.13954614102840424, -0.837829053401947, 1.126081109046936, 0.5822492241859436, 0.3645162284374237, 0.26682496070861816, 1.5983879566192627, 0.8052211403846741, -0.43077680468559265, 0.47506392002105713, 0.6105917096138, -0.15568488836288452, -2.1040425300598145, -1.1345041990280151, 0.3710337281227112, -0.5441109538078308, -1.603393793106079, 1.402330994606018, -1.1290777921676636, -1.04764723777771, 0.6391638517379761, 0.10301647335290909, 1.3728901147842407, 0.4097050726413727, 1.592607855796814, 2.0579631328582764, 0.96866774559021, 0.40491220355033875, 1.273206114768982, -0.07949016988277435, -0.39755356311798096, 1.8423749208450317, -0.39679306745529175, 0.4976450800895691, 1.062393307685852, -0.3719801902770996, -1.1047967672348022, -0.7549455165863037, -1.193472146987915, -0.7047680616378784, 1.1165815591812134, 0.12494589388370514, -1.1031898260116577, 0.1367708295583725, 1.518326759338379, 0.1444355547428131, -0.31846755743026733, 0.7200181484222412, 0.3714027404785156, -0.7282354235649109, -0.045048464089632034, -0.968562126159668, 0.5199556946754456, -0.2199803590774536, -0.3841571509838104, 0.24923741817474365, 0.48115673661231995, 1.3393315076828003, -0.08497767150402069, 0.15297378599643707, 1.193092703819275, -1.4210071563720703, 1.470210075378418, -0.6362823247909546, 0.2689446210861206, -2.4132516384124756, 1.3680850267410278, -0.754114031791687, 1.9374735355377197, -2.6600334644317627, 0.440022736787796, -0.5874967575073242, -0.4968354105949402, 0.2814876139163971, -0.4041583240032196, 0.06634742021560669, -0.057788070291280746, -1.150018572807312, 0.0032008644193410873, -0.6958885192871094, 0.661061704158783, 1.1424815654754639, 1.4568277597427368, -1.2402138710021973, -0.3085218667984009, -1.7524458169937134, -0.156694695353508, -0.7897748351097107, 0.34700295329093933, -1.9877986907958984, -0.21324248611927032, -1.8884366750717163, -2.460268259048462, -1.3064030408859253, -0.8332332372665405, 1.0752032995224, 0.13093598186969757, -0.8951519727706909, 1.266789436340332, -0.3867676854133606, -1.9173604249954224, 1.2195003032684326, -2.2370431423187256 ]
https://github.com/huggingface/datasets/issues/4478
Dataset slow during model training
Hi @lehrig, I suspect what's happening here is that our `to_tf_dataset()` method has some performance issues when streaming samples. This is usually not a problem, but they become apparent when streaming a vision dataset into a very small vision model, which will need a lot of sample throughput to saturate the GPU. When you save a `tf.data.Dataset` with `tf.data.experimental.save`, all of the samples from the dataset (which are, in this case, batches of images), are saved to disk. When you load this saved dataset, you're effectively bypassing `to_tf_dataset()` entirely, which alleviates this performance bottleneck. `to_tf_dataset()` is something we're actively working on overhauling right now - particularly for image datasets, we want to make it possible to access the underlying images with `tf.data` without going through the current layer of indirection with `Arrow`, which should massively improve simplicity and performance. However, if you just want this to work quickly but without needing your save/load hack, my advice would be to simply load the dataset into memory if it's small enough to fit. Since all your samples have the same dimensions, you can do this simply with: ``` dataset = load_from_disk(prep_data_dir) dataset = dataset.with_format("numpy") data_in_memory = dataset[:] ``` Then you can simply do something like: ``` model.fit(data_in_memory["pixel_values"], data_in_memory["labels"]) ```
## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB
717
207
Dataset slow during model training ## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB Hi @lehrig, I suspect what's happening here is that our `to_tf_dataset()` method has some performance issues when streaming samples. This is usually not a problem, but they become apparent when streaming a vision dataset into a very small vision model, which will need a lot of sample throughput to saturate the GPU. When you save a `tf.data.Dataset` with `tf.data.experimental.save`, all of the samples from the dataset (which are, in this case, batches of images), are saved to disk. When you load this saved dataset, you're effectively bypassing `to_tf_dataset()` entirely, which alleviates this performance bottleneck. `to_tf_dataset()` is something we're actively working on overhauling right now - particularly for image datasets, we want to make it possible to access the underlying images with `tf.data` without going through the current layer of indirection with `Arrow`, which should massively improve simplicity and performance. However, if you just want this to work quickly but without needing your save/load hack, my advice would be to simply load the dataset into memory if it's small enough to fit. Since all your samples have the same dimensions, you can do this simply with: ``` dataset = load_from_disk(prep_data_dir) dataset = dataset.with_format("numpy") data_in_memory = dataset[:] ``` Then you can simply do something like: ``` model.fit(data_in_memory["pixel_values"], data_in_memory["labels"]) ```
[ -1.33140230178833, -1.0034711360931396, -0.6648240685462952, 1.3942846059799194, -0.20022745430469513, -1.249970555305481, 0.15734997391700745, -1.0949218273162842, 1.5684064626693726, -0.8943634629249573, 0.2955647110939026, -1.7059777975082397, -0.025755688548088074, -0.5267432928085327, -0.7018626928329468, -0.9349560141563416, -0.42303866147994995, -0.7409504652023315, 1.1312156915664673, 2.4330594539642334, 1.1856801509857178, -1.315843105316162, 2.777482509613037, 0.6275325417518616, -0.18068723380565643, -1.0337296724319458, 0.5530669689178467, 0.0764383003115654, -1.286331295967102, -0.4052627384662628, -0.9915039539337158, -0.010935642756521702, -0.5678940415382385, -0.5319175720214844, 0.04824023321270943, 0.3996945917606354, -0.3490602970123291, -0.4369416832923889, -0.5868690013885498, -0.7435707449913025, 0.4826068580150604, -0.3583585321903229, 0.9604023694992065, -0.35297104716300964, 1.8037432432174683, -0.6216796636581421, 0.4497317671775818, 0.7496762871742249, 1.2304091453552246, 0.2205081582069397, 0.033298034220933914, 0.34353107213974, 0.3895590603351593, -0.0023463834077119827, 0.476630300283432, 1.1826101541519165, 0.5581126809120178, 0.5316040515899658, 0.7074525356292725, -2.204211473464966, 1.2891325950622559, -1.03062105178833, 0.3223783075809479, 1.4435936212539673, -0.9370455145835876, 0.4092695713043213, -1.6989243030548096, -0.12863130867481232, 0.5580679774284363, -2.2028024196624756, 0.2629257142543793, -1.3254181146621704, -0.5231800675392151, 0.9990862607955933, 0.4205922484397888, -1.118945837020874, 0.18856976926326752, -0.520612359046936, 1.035857081413269, 0.4113476872444153, 1.1620721817016602, -1.6540378332138062, -0.0413307286798954, -0.2573027014732361, 0.14713039994239807, -1.2923719882965088, -1.5828949213027954, 0.6054858565330505, 0.614232063293457, 0.6143751740455627, -0.15199707448482513, 1.0840188264846802, -1.0102488994598389, 0.7678001523017883, -1.0443211793899536, -1.6289311647415161, -1.4456323385238647, -2.2908477783203125, -2.3031351566314697, 0.7350087761878967, -0.46274203062057495, -0.5635320544242859, 2.092731475830078, -1.0805209875106812, -1.7460706233978271, 1.136231541633606, 0.21592186391353607, -0.013517961837351322, 2.38161039352417, 0.2914092242717743, -0.7044700384140015, 0.5587339401245117, -0.7459902167320251, 0.790701687335968, -0.27533820271492004, 1.3209586143493652, 0.45697614550590515, -0.9999330043792725, 1.5634685754776, -0.37301015853881836, 0.6365277767181396, -0.5827455520629883, -0.4881836771965027, -0.8182321190834045, 0.28396493196487427, 1.9078795909881592, -0.30048710107803345, 1.5901509523391724, -0.3117430806159973, -1.62453031539917, -1.640565037727356, 0.8610480427742004, 0.4556571841239929, -0.7759518027305603, 0.06710934638977051, -0.41714373230934143, 0.12207001447677612, 0.03866815194487572, 1.1637989282608032, 1.283877968788147, 0.8030509352684021, -0.3742998540401459, -0.8396161794662476, 0.15928728878498077, -0.02508327178657055, -0.7094135284423828, -1.7608511447906494, -0.31888869404792786, 0.14569571614265442, 0.5915691256523132, -1.1780710220336914, 1.754166603088379, 0.9565467834472656, 1.8777884244918823, 1.0156190395355225, -0.36638084053993225, 1.4047062397003174, 0.12406668066978455, 1.8515894412994385, -0.5017330050468445, 0.6766777038574219, -0.23524491488933563, -1.1623235940933228, 0.8075413703918457, -0.2961716055870056, -2.038367986679077, -0.8379063010215759, -0.7951989769935608, -0.1516704112291336, -0.7842414379119873, 0.9455950856208801, -0.26844361424446106, -1.4844900369644165, 0.2139638066291809, -0.6556153297424316, 0.1606132686138153, -1.1992584466934204, 0.21698226034641266, 0.6862213611602783, -0.6731002330780029, 0.0073857540264725685, -0.20877322554588318, -1.3257834911346436, -0.4087652564048767, 0.29608598351478577, 1.845707654953003, -0.7713230848312378, 1.008842945098877, 1.021352767944336, -0.6869891285896301, 0.03805007040500641, 0.24239540100097656, -0.29460641741752625, 0.8439412713050842, -1.0428353548049927, -0.4680594205856323, 1.2080788612365723, -0.23930728435516357, -0.6358835697174072, 1.5079584121704102, 0.7192259430885315, -1.0134189128875732, -0.19403326511383057, -0.17005124688148499, -0.8489658832550049, -0.03986850380897522, -1.5525861978530884, -0.10133013129234314, 0.43418389558792114, -1.4995626211166382, -0.47318345308303833, -0.2014051079750061, 1.2731934785842896, -0.17487551271915436, 1.4294793605804443, -0.39730775356292725, -0.2635231018066406, -0.36171671748161316, -0.36693325638771057, 0.22999294102191925, -0.18430234491825104, -0.6304823160171509, 0.15550199151039124, -0.9300394058227539, 0.2999286353588104, 1.5350651741027832, 0.413303405046463, 0.023018624633550644, 0.4864514470100403, 1.0990110635757446, 0.37456509470939636, -0.10065661370754242, -0.9065603613853455, -1.5658254623413086, 1.956932544708252, -1.3921833038330078, 1.9623891115188599, 0.6743853092193604, -0.08317282050848007, -1.8745206594467163, -1.8420385122299194, 1.2876979112625122, 1.2141036987304688, 2.3902599811553955, 0.4433659613132477, 0.3599550724029541, -0.7741530537605286, -0.7590254545211792, 0.36264315247535706, -0.99225914478302, -0.6004055142402649, 0.1783238649368286, 2.2787668704986572, 1.8253601789474487, -0.4908277690410614, -0.18653878569602966, -1.0482884645462036, 1.3714823722839355, -0.24325130879878998, 0.2330946922302246, 1.9881000518798828, -0.33278563618659973, -1.0344181060791016, 1.424367070198059, -2.234454870223999, 0.21848776936531067, 2.005375385284424, 0.29783183336257935, 0.062302302569150925, -1.3222718238830566, -0.6755915880203247, -0.34729012846946716, -0.403041273355484, -1.300951361656189, 0.4940037727355957, -0.25428110361099243, -0.8020524978637695, -1.3854974508285522, 0.07059895247220993, -1.0746866464614868, -1.726068377494812, 0.2909596860408783, 1.8324095010757446, 2.0674195289611816, -0.779207706451416, 1.4639431238174438, -0.3674057126045227, 0.20618146657943726, 1.1961404085159302, 1.2546586990356445, 3.067448616027832, 1.871524453163147, -1.3071084022521973, 0.68687504529953, -0.12387654185295105, -0.47351717948913574, 1.1903607845306396, -1.1702659130096436, 1.283178448677063, -0.19042998552322388, -1.2145582437515259, -1.1728918552398682, 1.0726646184921265, 0.42666083574295044, 0.061728719621896744, -0.5096796154975891, 1.2058333158493042, 0.03266455605626106, 1.3955291509628296, 0.5853676199913025, -0.42841359972953796, 0.6585455536842346, -0.4171101450920105, -0.5483424067497253, 1.5492359399795532, 0.1882944256067276, -1.500125527381897, -2.2374913692474365, -0.31745627522468567, -0.8184854984283447, 0.07447459548711777, -0.5905595421791077, -0.9972897171974182, 1.6635247468948364, 0.37850332260131836, -1.2943898439407349, -0.32000747323036194, -0.39138665795326233, -0.5517477989196777, 2.7495594024658203, -1.2759603261947632, -0.1477433443069458, -0.9620069861412048, -0.6813888549804688, 1.609246850013733, -1.1975281238555908, -0.24117077887058258, -1.063839077949524, -0.60662442445755, -1.4004244804382324, -0.5694291591644287, 0.07046250253915787, -0.970858633518219, 0.7628307342529297, 0.02844059094786644, -1.1065213680267334, -0.2827366888523102, -0.8844032883644104, 0.9733695387840271, -0.2359076887369156, 0.12058219313621521, 1.8499810695648193, 0.32666081190109253, -0.3951759338378906, 0.7375617623329163, 1.172351598739624, 0.6899322271347046, -0.7262793779373169, 0.01616724580526352, -0.7903013229370117, 0.23290668427944183, -1.2964446544647217, 0.2130350023508072, -2.910158157348633, 0.6919992566108704, -0.08193528652191162, -0.048569802194833755, -0.0075378711335361, -1.2619656324386597, 1.0293880701065063, 2.615492820739746, -1.2606662511825562, 0.4742269515991211, 0.3227040767669678, 1.1255638599395752, -1.5156067609786987, 0.30497094988822937, -0.4599120318889618, 2.036881685256958, 0.2832101583480835, 1.229503870010376, -0.5096839070320129, -2.1512250900268555, 0.6751455664634705, -1.2363052368164062, -1.1615350246429443, 0.8243309259414673, -0.9046815633773804, 0.21545347571372986, -1.3974310159683228, -0.2240004688501358, -0.9124523997306824, -1.1578739881515503, 0.6006720662117004, 0.10004977136850357, 0.41995105147361755, -0.5441268682479858, 0.3648173213005066, -2.259077310562134, -1.3967126607894897, -0.24392354488372803, -0.9866589307785034, 0.5244275331497192, -0.37044501304626465, 0.6532667875289917, -0.1753166913986206, 0.07597946375608444, 0.4006357192993164, 1.4674721956253052, 3.380509376525879, 0.23766104876995087, 0.21289274096488953, -0.118400938808918, -0.9747692942619324, 1.489569902420044, 0.9280660152435303, -0.07585127651691437, -0.5250540971755981, -1.0211803913116455, 1.2728869915008545, 1.8861902952194214, 1.058612585067749, 0.021010395139455795, -0.8880873322486877, -0.6757636666297913, 0.008408448658883572, 0.10482735186815262, 0.5013113617897034, 0.9403253793716431, 0.07394538819789886, 0.15772618353366852, 1.5013097524642944, 1.178622841835022, -0.3702889084815979, 0.3313300609588623, -0.8595125079154968, -0.5178197026252747, 0.4989498257637024, 0.2729586660861969, 0.02285158261656761, 0.4501834511756897, -1.0736846923828125, -0.24630247056484222, -0.42340219020843506, -0.9012263417243958, -0.7153199911117554, -0.4088599681854248, -0.44165366888046265, 1.5556045770645142, 0.12883517146110535, -0.5340194702148438, -0.08038638532161713, -0.7287706732749939, -0.1666039079427719, -1.03681480884552, 0.2830653488636017, -0.0748848095536232, -0.12060780823230743, -0.16756099462509155, 1.7294124364852905, -0.9008268117904663, -2.0120205879211426, 0.19780300557613373, 0.27229857444763184, -0.26482635736465454, 0.14982017874717712, 1.6500340700149536, 0.5801982879638672, 1.4119387865066528, 1.2932718992233276, 0.9642196893692017, -0.5882337689399719, -1.2471121549606323, 0.7129762172698975, 0.8999921679496765, -1.3638404607772827, 0.8100379705429077, -0.08744774013757706, -0.5448086857795715, 0.6834933161735535, 1.2709133625030518, 0.4865269362926483, -1.9523200988769531, 0.8391566872596741, -1.0147019624710083, 0.7571409344673157, 0.7514048218727112, 0.737683117389679, 0.11500554531812668, 0.904707133769989, -1.1723908185958862, -1.0523972511291504, -0.7318626046180725, -0.5879958868026733, 1.9409183263778687, -0.31055617332458496, 0.6071065664291382, -0.34753239154815674, -1.162872076034546, -0.0277109257876873, 0.724102795124054, 0.30338168144226074, -0.42789149284362793, 0.843166708946228, -0.5968573093414307, -1.043473482131958, -1.3300384283065796, -0.35405853390693665, -1.1008979082107544, -0.9186868667602539, 1.0604623556137085, 0.7211655378341675, 0.3217957019805908, 1.829956293106079, 0.6577604413032532, 0.25522130727767944, -2.621673583984375, 0.9281827807426453, 0.14333362877368927, -0.023297857493162155, 0.8320704102516174, 0.2730187475681305, 1.0115246772766113, -0.07707974314689636, 0.4918642044067383, -2.3862295150756836, 2.224308490753174, -0.25423499941825867, 0.6912299990653992, -0.023548288270831108, -0.16459588706493378, 1.1691840887069702, 0.6513428688049316, 0.5701993107795715, -1.0799006223678589, 0.6827551126480103, -0.5605362057685852, 1.185127854347229, 0.9520033597946167, -0.8203903436660767, 0.0004329029470682144, 1.4746575355529785, 0.47504740953445435, -0.46303582191467285, -0.9650285243988037, -0.9055814743041992, 1.006790280342102, 1.7191799879074097, -0.08331087231636047, -0.04985908418893814, 0.7689803838729858, 0.7427810430526733, -1.2989140748977661, 0.07025740295648575, -0.6677491664886475, -0.6682308316230774, 1.7591445446014404, 2.0863215923309326, -0.12932437658309937, -0.17046956717967987, -0.6382184028625488, -1.2769043445587158, 0.8105869889259338, -0.030895400792360306, 0.18601877987384796, 0.6584829092025757, -0.6477663516998291, 1.1575113534927368, 0.8041459321975708, 0.9676251411437988, 0.1880137026309967, 0.23578085005283356, 0.349956750869751, -0.3043513894081116, -1.2307788133621216, -0.22887136042118073, -1.0150755643844604, -2.510059118270874, 0.3805122673511505, -0.2182321399450302, -1.5069632530212402, 0.03339334577322006, -1.0036250352859497, 0.9628278017044067, -0.5471760034561157, -1.1105318069458008, -1.5916965007781982, 0.228280171751976, -0.062029656022787094, 0.9937504529953003, -1.6114829778671265, -0.138295516371727, 1.2057665586471558, 0.8924221992492676, -0.6694566607475281, 1.004670262336731, 0.22291620075702667, 0.989993691444397, 0.7794094085693359, -0.4491862952709198, 0.5298041701316833, 0.026254091411828995, -1.3565725088119507, 0.42924702167510986, 1.1648292541503906, 0.22177928686141968, 1.4596914052963257, -0.4926048219203949, 0.08371339738368988, 0.3782968819141388, -0.5986045002937317, -0.4852708578109741, -0.4658183157444, 0.6358498930931091, 0.019972439855337143, -0.9172592759132385, -0.07571323215961456, -0.05524660274386406, -0.2825661897659302, 0.243414044380188, -1.4210996627807617, -0.11562062799930573, -0.44695422053337097, -0.6503564715385437, -1.1827261447906494, -0.04001864045858383, 1.4420502185821533, -0.8743006587028503, -0.16263717412948608, 0.49797874689102173, 0.29492849111557007, 0.6302588582038879, 0.6454830169677734, -0.7296587228775024, -0.1746327131986618, -0.319559246301651, -0.2688648998737335, 0.28283268213272095, 1.294029712677002, -0.11805843561887741, -0.9566794633865356, 0.7088147401809692, -0.32717058062553406, 0.08606957644224167, 1.9333182573318481, 0.09189470112323761, -0.7092863917350769, 0.3276059925556183, -0.7386256456375122, 1.8776118755340576, 1.715536117553711, 1.3681944608688354, -0.1085817813873291, -0.9180020093917847, 0.5152882933616638, -0.26675349473953247, -0.4317878484725952, 0.8891614079475403, 0.40279775857925415, -0.19695726037025452, -1.405161738395691, 0.7984214425086975, 1.2606855630874634, -0.8482918739318848, -0.7543352842330933, 0.13954614102840424, -0.837829053401947, 1.126081109046936, 0.5822492241859436, 0.3645162284374237, 0.26682496070861816, 1.5983879566192627, 0.8052211403846741, -0.43077680468559265, 0.47506392002105713, 0.6105917096138, -0.15568488836288452, -2.1040425300598145, -1.1345041990280151, 0.3710337281227112, -0.5441109538078308, -1.603393793106079, 1.402330994606018, -1.1290777921676636, -1.04764723777771, 0.6391638517379761, 0.10301647335290909, 1.3728901147842407, 0.4097050726413727, 1.592607855796814, 2.0579631328582764, 0.96866774559021, 0.40491220355033875, 1.273206114768982, -0.07949016988277435, -0.39755356311798096, 1.8423749208450317, -0.39679306745529175, 0.4976450800895691, 1.062393307685852, -0.3719801902770996, -1.1047967672348022, -0.7549455165863037, -1.193472146987915, -0.7047680616378784, 1.1165815591812134, 0.12494589388370514, -1.1031898260116577, 0.1367708295583725, 1.518326759338379, 0.1444355547428131, -0.31846755743026733, 0.7200181484222412, 0.3714027404785156, -0.7282354235649109, -0.045048464089632034, -0.968562126159668, 0.5199556946754456, -0.2199803590774536, -0.3841571509838104, 0.24923741817474365, 0.48115673661231995, 1.3393315076828003, -0.08497767150402069, 0.15297378599643707, 1.193092703819275, -1.4210071563720703, 1.470210075378418, -0.6362823247909546, 0.2689446210861206, -2.4132516384124756, 1.3680850267410278, -0.754114031791687, 1.9374735355377197, -2.6600334644317627, 0.440022736787796, -0.5874967575073242, -0.4968354105949402, 0.2814876139163971, -0.4041583240032196, 0.06634742021560669, -0.057788070291280746, -1.150018572807312, 0.0032008644193410873, -0.6958885192871094, 0.661061704158783, 1.1424815654754639, 1.4568277597427368, -1.2402138710021973, -0.3085218667984009, -1.7524458169937134, -0.156694695353508, -0.7897748351097107, 0.34700295329093933, -1.9877986907958984, -0.21324248611927032, -1.8884366750717163, -2.460268259048462, -1.3064030408859253, -0.8332332372665405, 1.0752032995224, 0.13093598186969757, -0.8951519727706909, 1.266789436340332, -0.3867676854133606, -1.9173604249954224, 1.2195003032684326, -2.2370431423187256 ]
https://github.com/huggingface/datasets/issues/4478
Dataset slow during model training
Thanks for the information! I have now updated the training code like so: ``` dataset = load_from_disk(prep_data_dir) train_dataset = dataset["train"][:] validation_dataset = dataset["dev"][:] ... model.fit( train_dataset["pixel_values"], train_dataset["label"], epochs=epochs, validation_data=( validation_dataset["pixel_values"], validation_dataset["label"] ), callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` - Creating the in-memory dataset is quite quick - But: There is now a long wait (~4-5 Minutes) before the training starts (why?) - And: Training times have improved but the very first epoch leaves me wondering why it takes so long (why?) **Epoch Breakdown:** - Epoch 1/10 78s 12s/step - loss: 3.1307 - accuracy: 0.0737 - val_loss: 2.2827 - val_accuracy: 0.1273 - lr: 0.0010 - Epoch 2/10 1s 168ms/step - loss: 2.3616 - accuracy: 0.2350 - val_loss: 2.2679 - val_accuracy: 0.2182 - lr: 0.0010 - Epoch 3/10 1s 189ms/step - loss: 2.0221 - accuracy: 0.3180 - val_loss: 2.2670 - val_accuracy: 0.1818 - lr: 0.0010 - Epoch 4/10 0s 67ms/step - loss: 1.8895 - accuracy: 0.3548 - val_loss: 2.2771 - val_accuracy: 0.1273 - lr: 0.0010 - Epoch 5/10 0s 67ms/step - loss: 1.7846 - accuracy: 0.3963 - val_loss: 2.2860 - val_accuracy: 0.1455 - lr: 0.0010 - Epoch 6/10 0s 65ms/step - loss: 1.5946 - accuracy: 0.4516 - val_loss: 2.2938 - val_accuracy: 0.1636 - lr: 0.0010 - Epoch 7/10 0s 63ms/step - loss: 1.4217 - accuracy: 0.5115 - val_loss: 2.2968 - val_accuracy: 0.2182 - lr: 0.0010 - Epoch 8/10 0s 67ms/step - loss: 1.3089 - accuracy: 0.5438 - val_loss: 2.2842 - val_accuracy: 0.2182 - lr: 0.0010 - Epoch 9/10 1s 184ms/step - loss: 1.2480 - accuracy: 0.5806 - val_loss: 2.2652 - val_accuracy: 0.1818 - lr: 0.0010 - Epoch 10/10 0s 65ms/step - loss: 1.2699 - accuracy: 0.5622 - val_loss: 2.2670 - val_accuracy: 0.2000 - lr: 0.0010
## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB
717
282
Dataset slow during model training ## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB Thanks for the information! I have now updated the training code like so: ``` dataset = load_from_disk(prep_data_dir) train_dataset = dataset["train"][:] validation_dataset = dataset["dev"][:] ... model.fit( train_dataset["pixel_values"], train_dataset["label"], epochs=epochs, validation_data=( validation_dataset["pixel_values"], validation_dataset["label"] ), callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` - Creating the in-memory dataset is quite quick - But: There is now a long wait (~4-5 Minutes) before the training starts (why?) - And: Training times have improved but the very first epoch leaves me wondering why it takes so long (why?) **Epoch Breakdown:** - Epoch 1/10 78s 12s/step - loss: 3.1307 - accuracy: 0.0737 - val_loss: 2.2827 - val_accuracy: 0.1273 - lr: 0.0010 - Epoch 2/10 1s 168ms/step - loss: 2.3616 - accuracy: 0.2350 - val_loss: 2.2679 - val_accuracy: 0.2182 - lr: 0.0010 - Epoch 3/10 1s 189ms/step - loss: 2.0221 - accuracy: 0.3180 - val_loss: 2.2670 - val_accuracy: 0.1818 - lr: 0.0010 - Epoch 4/10 0s 67ms/step - loss: 1.8895 - accuracy: 0.3548 - val_loss: 2.2771 - val_accuracy: 0.1273 - lr: 0.0010 - Epoch 5/10 0s 67ms/step - loss: 1.7846 - accuracy: 0.3963 - val_loss: 2.2860 - val_accuracy: 0.1455 - lr: 0.0010 - Epoch 6/10 0s 65ms/step - loss: 1.5946 - accuracy: 0.4516 - val_loss: 2.2938 - val_accuracy: 0.1636 - lr: 0.0010 - Epoch 7/10 0s 63ms/step - loss: 1.4217 - accuracy: 0.5115 - val_loss: 2.2968 - val_accuracy: 0.2182 - lr: 0.0010 - Epoch 8/10 0s 67ms/step - loss: 1.3089 - accuracy: 0.5438 - val_loss: 2.2842 - val_accuracy: 0.2182 - lr: 0.0010 - Epoch 9/10 1s 184ms/step - loss: 1.2480 - accuracy: 0.5806 - val_loss: 2.2652 - val_accuracy: 0.1818 - lr: 0.0010 - Epoch 10/10 0s 65ms/step - loss: 1.2699 - accuracy: 0.5622 - val_loss: 2.2670 - val_accuracy: 0.2000 - lr: 0.0010
[ -1.33140230178833, -1.0034711360931396, -0.6648240685462952, 1.3942846059799194, -0.20022745430469513, -1.249970555305481, 0.15734997391700745, -1.0949218273162842, 1.5684064626693726, -0.8943634629249573, 0.2955647110939026, -1.7059777975082397, -0.025755688548088074, -0.5267432928085327, -0.7018626928329468, -0.9349560141563416, -0.42303866147994995, -0.7409504652023315, 1.1312156915664673, 2.4330594539642334, 1.1856801509857178, -1.315843105316162, 2.777482509613037, 0.6275325417518616, -0.18068723380565643, -1.0337296724319458, 0.5530669689178467, 0.0764383003115654, -1.286331295967102, -0.4052627384662628, -0.9915039539337158, -0.010935642756521702, -0.5678940415382385, -0.5319175720214844, 0.04824023321270943, 0.3996945917606354, -0.3490602970123291, -0.4369416832923889, -0.5868690013885498, -0.7435707449913025, 0.4826068580150604, -0.3583585321903229, 0.9604023694992065, -0.35297104716300964, 1.8037432432174683, -0.6216796636581421, 0.4497317671775818, 0.7496762871742249, 1.2304091453552246, 0.2205081582069397, 0.033298034220933914, 0.34353107213974, 0.3895590603351593, -0.0023463834077119827, 0.476630300283432, 1.1826101541519165, 0.5581126809120178, 0.5316040515899658, 0.7074525356292725, -2.204211473464966, 1.2891325950622559, -1.03062105178833, 0.3223783075809479, 1.4435936212539673, -0.9370455145835876, 0.4092695713043213, -1.6989243030548096, -0.12863130867481232, 0.5580679774284363, -2.2028024196624756, 0.2629257142543793, -1.3254181146621704, -0.5231800675392151, 0.9990862607955933, 0.4205922484397888, -1.118945837020874, 0.18856976926326752, -0.520612359046936, 1.035857081413269, 0.4113476872444153, 1.1620721817016602, -1.6540378332138062, -0.0413307286798954, -0.2573027014732361, 0.14713039994239807, -1.2923719882965088, -1.5828949213027954, 0.6054858565330505, 0.614232063293457, 0.6143751740455627, -0.15199707448482513, 1.0840188264846802, -1.0102488994598389, 0.7678001523017883, -1.0443211793899536, -1.6289311647415161, -1.4456323385238647, -2.2908477783203125, -2.3031351566314697, 0.7350087761878967, -0.46274203062057495, -0.5635320544242859, 2.092731475830078, -1.0805209875106812, -1.7460706233978271, 1.136231541633606, 0.21592186391353607, -0.013517961837351322, 2.38161039352417, 0.2914092242717743, -0.7044700384140015, 0.5587339401245117, -0.7459902167320251, 0.790701687335968, -0.27533820271492004, 1.3209586143493652, 0.45697614550590515, -0.9999330043792725, 1.5634685754776, -0.37301015853881836, 0.6365277767181396, -0.5827455520629883, -0.4881836771965027, -0.8182321190834045, 0.28396493196487427, 1.9078795909881592, -0.30048710107803345, 1.5901509523391724, -0.3117430806159973, -1.62453031539917, -1.640565037727356, 0.8610480427742004, 0.4556571841239929, -0.7759518027305603, 0.06710934638977051, -0.41714373230934143, 0.12207001447677612, 0.03866815194487572, 1.1637989282608032, 1.283877968788147, 0.8030509352684021, -0.3742998540401459, -0.8396161794662476, 0.15928728878498077, -0.02508327178657055, -0.7094135284423828, -1.7608511447906494, -0.31888869404792786, 0.14569571614265442, 0.5915691256523132, -1.1780710220336914, 1.754166603088379, 0.9565467834472656, 1.8777884244918823, 1.0156190395355225, -0.36638084053993225, 1.4047062397003174, 0.12406668066978455, 1.8515894412994385, -0.5017330050468445, 0.6766777038574219, -0.23524491488933563, -1.1623235940933228, 0.8075413703918457, -0.2961716055870056, -2.038367986679077, -0.8379063010215759, -0.7951989769935608, -0.1516704112291336, -0.7842414379119873, 0.9455950856208801, -0.26844361424446106, -1.4844900369644165, 0.2139638066291809, -0.6556153297424316, 0.1606132686138153, -1.1992584466934204, 0.21698226034641266, 0.6862213611602783, -0.6731002330780029, 0.0073857540264725685, -0.20877322554588318, -1.3257834911346436, -0.4087652564048767, 0.29608598351478577, 1.845707654953003, -0.7713230848312378, 1.008842945098877, 1.021352767944336, -0.6869891285896301, 0.03805007040500641, 0.24239540100097656, -0.29460641741752625, 0.8439412713050842, -1.0428353548049927, -0.4680594205856323, 1.2080788612365723, -0.23930728435516357, -0.6358835697174072, 1.5079584121704102, 0.7192259430885315, -1.0134189128875732, -0.19403326511383057, -0.17005124688148499, -0.8489658832550049, -0.03986850380897522, -1.5525861978530884, -0.10133013129234314, 0.43418389558792114, -1.4995626211166382, -0.47318345308303833, -0.2014051079750061, 1.2731934785842896, -0.17487551271915436, 1.4294793605804443, -0.39730775356292725, -0.2635231018066406, -0.36171671748161316, -0.36693325638771057, 0.22999294102191925, -0.18430234491825104, -0.6304823160171509, 0.15550199151039124, -0.9300394058227539, 0.2999286353588104, 1.5350651741027832, 0.413303405046463, 0.023018624633550644, 0.4864514470100403, 1.0990110635757446, 0.37456509470939636, -0.10065661370754242, -0.9065603613853455, -1.5658254623413086, 1.956932544708252, -1.3921833038330078, 1.9623891115188599, 0.6743853092193604, -0.08317282050848007, -1.8745206594467163, -1.8420385122299194, 1.2876979112625122, 1.2141036987304688, 2.3902599811553955, 0.4433659613132477, 0.3599550724029541, -0.7741530537605286, -0.7590254545211792, 0.36264315247535706, -0.99225914478302, -0.6004055142402649, 0.1783238649368286, 2.2787668704986572, 1.8253601789474487, -0.4908277690410614, -0.18653878569602966, -1.0482884645462036, 1.3714823722839355, -0.24325130879878998, 0.2330946922302246, 1.9881000518798828, -0.33278563618659973, -1.0344181060791016, 1.424367070198059, -2.234454870223999, 0.21848776936531067, 2.005375385284424, 0.29783183336257935, 0.062302302569150925, -1.3222718238830566, -0.6755915880203247, -0.34729012846946716, -0.403041273355484, -1.300951361656189, 0.4940037727355957, -0.25428110361099243, -0.8020524978637695, -1.3854974508285522, 0.07059895247220993, -1.0746866464614868, -1.726068377494812, 0.2909596860408783, 1.8324095010757446, 2.0674195289611816, -0.779207706451416, 1.4639431238174438, -0.3674057126045227, 0.20618146657943726, 1.1961404085159302, 1.2546586990356445, 3.067448616027832, 1.871524453163147, -1.3071084022521973, 0.68687504529953, -0.12387654185295105, -0.47351717948913574, 1.1903607845306396, -1.1702659130096436, 1.283178448677063, -0.19042998552322388, -1.2145582437515259, -1.1728918552398682, 1.0726646184921265, 0.42666083574295044, 0.061728719621896744, -0.5096796154975891, 1.2058333158493042, 0.03266455605626106, 1.3955291509628296, 0.5853676199913025, -0.42841359972953796, 0.6585455536842346, -0.4171101450920105, -0.5483424067497253, 1.5492359399795532, 0.1882944256067276, -1.500125527381897, -2.2374913692474365, -0.31745627522468567, -0.8184854984283447, 0.07447459548711777, -0.5905595421791077, -0.9972897171974182, 1.6635247468948364, 0.37850332260131836, -1.2943898439407349, -0.32000747323036194, -0.39138665795326233, -0.5517477989196777, 2.7495594024658203, -1.2759603261947632, -0.1477433443069458, -0.9620069861412048, -0.6813888549804688, 1.609246850013733, -1.1975281238555908, -0.24117077887058258, -1.063839077949524, -0.60662442445755, -1.4004244804382324, -0.5694291591644287, 0.07046250253915787, -0.970858633518219, 0.7628307342529297, 0.02844059094786644, -1.1065213680267334, -0.2827366888523102, -0.8844032883644104, 0.9733695387840271, -0.2359076887369156, 0.12058219313621521, 1.8499810695648193, 0.32666081190109253, -0.3951759338378906, 0.7375617623329163, 1.172351598739624, 0.6899322271347046, -0.7262793779373169, 0.01616724580526352, -0.7903013229370117, 0.23290668427944183, -1.2964446544647217, 0.2130350023508072, -2.910158157348633, 0.6919992566108704, -0.08193528652191162, -0.048569802194833755, -0.0075378711335361, -1.2619656324386597, 1.0293880701065063, 2.615492820739746, -1.2606662511825562, 0.4742269515991211, 0.3227040767669678, 1.1255638599395752, -1.5156067609786987, 0.30497094988822937, -0.4599120318889618, 2.036881685256958, 0.2832101583480835, 1.229503870010376, -0.5096839070320129, -2.1512250900268555, 0.6751455664634705, -1.2363052368164062, -1.1615350246429443, 0.8243309259414673, -0.9046815633773804, 0.21545347571372986, -1.3974310159683228, -0.2240004688501358, -0.9124523997306824, -1.1578739881515503, 0.6006720662117004, 0.10004977136850357, 0.41995105147361755, -0.5441268682479858, 0.3648173213005066, -2.259077310562134, -1.3967126607894897, -0.24392354488372803, -0.9866589307785034, 0.5244275331497192, -0.37044501304626465, 0.6532667875289917, -0.1753166913986206, 0.07597946375608444, 0.4006357192993164, 1.4674721956253052, 3.380509376525879, 0.23766104876995087, 0.21289274096488953, -0.118400938808918, -0.9747692942619324, 1.489569902420044, 0.9280660152435303, -0.07585127651691437, -0.5250540971755981, -1.0211803913116455, 1.2728869915008545, 1.8861902952194214, 1.058612585067749, 0.021010395139455795, -0.8880873322486877, -0.6757636666297913, 0.008408448658883572, 0.10482735186815262, 0.5013113617897034, 0.9403253793716431, 0.07394538819789886, 0.15772618353366852, 1.5013097524642944, 1.178622841835022, -0.3702889084815979, 0.3313300609588623, -0.8595125079154968, -0.5178197026252747, 0.4989498257637024, 0.2729586660861969, 0.02285158261656761, 0.4501834511756897, -1.0736846923828125, -0.24630247056484222, -0.42340219020843506, -0.9012263417243958, -0.7153199911117554, -0.4088599681854248, -0.44165366888046265, 1.5556045770645142, 0.12883517146110535, -0.5340194702148438, -0.08038638532161713, -0.7287706732749939, -0.1666039079427719, -1.03681480884552, 0.2830653488636017, -0.0748848095536232, -0.12060780823230743, -0.16756099462509155, 1.7294124364852905, -0.9008268117904663, -2.0120205879211426, 0.19780300557613373, 0.27229857444763184, -0.26482635736465454, 0.14982017874717712, 1.6500340700149536, 0.5801982879638672, 1.4119387865066528, 1.2932718992233276, 0.9642196893692017, -0.5882337689399719, -1.2471121549606323, 0.7129762172698975, 0.8999921679496765, -1.3638404607772827, 0.8100379705429077, -0.08744774013757706, -0.5448086857795715, 0.6834933161735535, 1.2709133625030518, 0.4865269362926483, -1.9523200988769531, 0.8391566872596741, -1.0147019624710083, 0.7571409344673157, 0.7514048218727112, 0.737683117389679, 0.11500554531812668, 0.904707133769989, -1.1723908185958862, -1.0523972511291504, -0.7318626046180725, -0.5879958868026733, 1.9409183263778687, -0.31055617332458496, 0.6071065664291382, -0.34753239154815674, -1.162872076034546, -0.0277109257876873, 0.724102795124054, 0.30338168144226074, -0.42789149284362793, 0.843166708946228, -0.5968573093414307, -1.043473482131958, -1.3300384283065796, -0.35405853390693665, -1.1008979082107544, -0.9186868667602539, 1.0604623556137085, 0.7211655378341675, 0.3217957019805908, 1.829956293106079, 0.6577604413032532, 0.25522130727767944, -2.621673583984375, 0.9281827807426453, 0.14333362877368927, -0.023297857493162155, 0.8320704102516174, 0.2730187475681305, 1.0115246772766113, -0.07707974314689636, 0.4918642044067383, -2.3862295150756836, 2.224308490753174, -0.25423499941825867, 0.6912299990653992, -0.023548288270831108, -0.16459588706493378, 1.1691840887069702, 0.6513428688049316, 0.5701993107795715, -1.0799006223678589, 0.6827551126480103, -0.5605362057685852, 1.185127854347229, 0.9520033597946167, -0.8203903436660767, 0.0004329029470682144, 1.4746575355529785, 0.47504740953445435, -0.46303582191467285, -0.9650285243988037, -0.9055814743041992, 1.006790280342102, 1.7191799879074097, -0.08331087231636047, -0.04985908418893814, 0.7689803838729858, 0.7427810430526733, -1.2989140748977661, 0.07025740295648575, -0.6677491664886475, -0.6682308316230774, 1.7591445446014404, 2.0863215923309326, -0.12932437658309937, -0.17046956717967987, -0.6382184028625488, -1.2769043445587158, 0.8105869889259338, -0.030895400792360306, 0.18601877987384796, 0.6584829092025757, -0.6477663516998291, 1.1575113534927368, 0.8041459321975708, 0.9676251411437988, 0.1880137026309967, 0.23578085005283356, 0.349956750869751, -0.3043513894081116, -1.2307788133621216, -0.22887136042118073, -1.0150755643844604, -2.510059118270874, 0.3805122673511505, -0.2182321399450302, -1.5069632530212402, 0.03339334577322006, -1.0036250352859497, 0.9628278017044067, -0.5471760034561157, -1.1105318069458008, -1.5916965007781982, 0.228280171751976, -0.062029656022787094, 0.9937504529953003, -1.6114829778671265, -0.138295516371727, 1.2057665586471558, 0.8924221992492676, -0.6694566607475281, 1.004670262336731, 0.22291620075702667, 0.989993691444397, 0.7794094085693359, -0.4491862952709198, 0.5298041701316833, 0.026254091411828995, -1.3565725088119507, 0.42924702167510986, 1.1648292541503906, 0.22177928686141968, 1.4596914052963257, -0.4926048219203949, 0.08371339738368988, 0.3782968819141388, -0.5986045002937317, -0.4852708578109741, -0.4658183157444, 0.6358498930931091, 0.019972439855337143, -0.9172592759132385, -0.07571323215961456, -0.05524660274386406, -0.2825661897659302, 0.243414044380188, -1.4210996627807617, -0.11562062799930573, -0.44695422053337097, -0.6503564715385437, -1.1827261447906494, -0.04001864045858383, 1.4420502185821533, -0.8743006587028503, -0.16263717412948608, 0.49797874689102173, 0.29492849111557007, 0.6302588582038879, 0.6454830169677734, -0.7296587228775024, -0.1746327131986618, -0.319559246301651, -0.2688648998737335, 0.28283268213272095, 1.294029712677002, -0.11805843561887741, -0.9566794633865356, 0.7088147401809692, -0.32717058062553406, 0.08606957644224167, 1.9333182573318481, 0.09189470112323761, -0.7092863917350769, 0.3276059925556183, -0.7386256456375122, 1.8776118755340576, 1.715536117553711, 1.3681944608688354, -0.1085817813873291, -0.9180020093917847, 0.5152882933616638, -0.26675349473953247, -0.4317878484725952, 0.8891614079475403, 0.40279775857925415, -0.19695726037025452, -1.405161738395691, 0.7984214425086975, 1.2606855630874634, -0.8482918739318848, -0.7543352842330933, 0.13954614102840424, -0.837829053401947, 1.126081109046936, 0.5822492241859436, 0.3645162284374237, 0.26682496070861816, 1.5983879566192627, 0.8052211403846741, -0.43077680468559265, 0.47506392002105713, 0.6105917096138, -0.15568488836288452, -2.1040425300598145, -1.1345041990280151, 0.3710337281227112, -0.5441109538078308, -1.603393793106079, 1.402330994606018, -1.1290777921676636, -1.04764723777771, 0.6391638517379761, 0.10301647335290909, 1.3728901147842407, 0.4097050726413727, 1.592607855796814, 2.0579631328582764, 0.96866774559021, 0.40491220355033875, 1.273206114768982, -0.07949016988277435, -0.39755356311798096, 1.8423749208450317, -0.39679306745529175, 0.4976450800895691, 1.062393307685852, -0.3719801902770996, -1.1047967672348022, -0.7549455165863037, -1.193472146987915, -0.7047680616378784, 1.1165815591812134, 0.12494589388370514, -1.1031898260116577, 0.1367708295583725, 1.518326759338379, 0.1444355547428131, -0.31846755743026733, 0.7200181484222412, 0.3714027404785156, -0.7282354235649109, -0.045048464089632034, -0.968562126159668, 0.5199556946754456, -0.2199803590774536, -0.3841571509838104, 0.24923741817474365, 0.48115673661231995, 1.3393315076828003, -0.08497767150402069, 0.15297378599643707, 1.193092703819275, -1.4210071563720703, 1.470210075378418, -0.6362823247909546, 0.2689446210861206, -2.4132516384124756, 1.3680850267410278, -0.754114031791687, 1.9374735355377197, -2.6600334644317627, 0.440022736787796, -0.5874967575073242, -0.4968354105949402, 0.2814876139163971, -0.4041583240032196, 0.06634742021560669, -0.057788070291280746, -1.150018572807312, 0.0032008644193410873, -0.6958885192871094, 0.661061704158783, 1.1424815654754639, 1.4568277597427368, -1.2402138710021973, -0.3085218667984009, -1.7524458169937134, -0.156694695353508, -0.7897748351097107, 0.34700295329093933, -1.9877986907958984, -0.21324248611927032, -1.8884366750717163, -2.460268259048462, -1.3064030408859253, -0.8332332372665405, 1.0752032995224, 0.13093598186969757, -0.8951519727706909, 1.266789436340332, -0.3867676854133606, -1.9173604249954224, 1.2195003032684326, -2.2370431423187256 ]
https://github.com/huggingface/datasets/issues/4478
Dataset slow during model training
Regarding the new long ~5 min. wait introduced by the in-memory dataset update: this might be causing it? https://datascience.stackexchange.com/questions/33364/why-model-fit-generator-in-keras-is-taking-so-much-time-even-before-picking-the For now, my save/load hack is still more performant, even though having more boiler-plate code :/
## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB
717
35
Dataset slow during model training ## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB Regarding the new long ~5 min. wait introduced by the in-memory dataset update: this might be causing it? https://datascience.stackexchange.com/questions/33364/why-model-fit-generator-in-keras-is-taking-so-much-time-even-before-picking-the For now, my save/load hack is still more performant, even though having more boiler-plate code :/
[ -1.33140230178833, -1.0034711360931396, -0.6648240685462952, 1.3942846059799194, -0.20022745430469513, -1.249970555305481, 0.15734997391700745, -1.0949218273162842, 1.5684064626693726, -0.8943634629249573, 0.2955647110939026, -1.7059777975082397, -0.025755688548088074, -0.5267432928085327, -0.7018626928329468, -0.9349560141563416, -0.42303866147994995, -0.7409504652023315, 1.1312156915664673, 2.4330594539642334, 1.1856801509857178, -1.315843105316162, 2.777482509613037, 0.6275325417518616, -0.18068723380565643, -1.0337296724319458, 0.5530669689178467, 0.0764383003115654, -1.286331295967102, -0.4052627384662628, -0.9915039539337158, -0.010935642756521702, -0.5678940415382385, -0.5319175720214844, 0.04824023321270943, 0.3996945917606354, -0.3490602970123291, -0.4369416832923889, -0.5868690013885498, -0.7435707449913025, 0.4826068580150604, -0.3583585321903229, 0.9604023694992065, -0.35297104716300964, 1.8037432432174683, -0.6216796636581421, 0.4497317671775818, 0.7496762871742249, 1.2304091453552246, 0.2205081582069397, 0.033298034220933914, 0.34353107213974, 0.3895590603351593, -0.0023463834077119827, 0.476630300283432, 1.1826101541519165, 0.5581126809120178, 0.5316040515899658, 0.7074525356292725, -2.204211473464966, 1.2891325950622559, -1.03062105178833, 0.3223783075809479, 1.4435936212539673, -0.9370455145835876, 0.4092695713043213, -1.6989243030548096, -0.12863130867481232, 0.5580679774284363, -2.2028024196624756, 0.2629257142543793, -1.3254181146621704, -0.5231800675392151, 0.9990862607955933, 0.4205922484397888, -1.118945837020874, 0.18856976926326752, -0.520612359046936, 1.035857081413269, 0.4113476872444153, 1.1620721817016602, -1.6540378332138062, -0.0413307286798954, -0.2573027014732361, 0.14713039994239807, -1.2923719882965088, -1.5828949213027954, 0.6054858565330505, 0.614232063293457, 0.6143751740455627, -0.15199707448482513, 1.0840188264846802, -1.0102488994598389, 0.7678001523017883, -1.0443211793899536, -1.6289311647415161, -1.4456323385238647, -2.2908477783203125, -2.3031351566314697, 0.7350087761878967, -0.46274203062057495, -0.5635320544242859, 2.092731475830078, -1.0805209875106812, -1.7460706233978271, 1.136231541633606, 0.21592186391353607, -0.013517961837351322, 2.38161039352417, 0.2914092242717743, -0.7044700384140015, 0.5587339401245117, -0.7459902167320251, 0.790701687335968, -0.27533820271492004, 1.3209586143493652, 0.45697614550590515, -0.9999330043792725, 1.5634685754776, -0.37301015853881836, 0.6365277767181396, -0.5827455520629883, -0.4881836771965027, -0.8182321190834045, 0.28396493196487427, 1.9078795909881592, -0.30048710107803345, 1.5901509523391724, -0.3117430806159973, -1.62453031539917, -1.640565037727356, 0.8610480427742004, 0.4556571841239929, -0.7759518027305603, 0.06710934638977051, -0.41714373230934143, 0.12207001447677612, 0.03866815194487572, 1.1637989282608032, 1.283877968788147, 0.8030509352684021, -0.3742998540401459, -0.8396161794662476, 0.15928728878498077, -0.02508327178657055, -0.7094135284423828, -1.7608511447906494, -0.31888869404792786, 0.14569571614265442, 0.5915691256523132, -1.1780710220336914, 1.754166603088379, 0.9565467834472656, 1.8777884244918823, 1.0156190395355225, -0.36638084053993225, 1.4047062397003174, 0.12406668066978455, 1.8515894412994385, -0.5017330050468445, 0.6766777038574219, -0.23524491488933563, -1.1623235940933228, 0.8075413703918457, -0.2961716055870056, -2.038367986679077, -0.8379063010215759, -0.7951989769935608, -0.1516704112291336, -0.7842414379119873, 0.9455950856208801, -0.26844361424446106, -1.4844900369644165, 0.2139638066291809, -0.6556153297424316, 0.1606132686138153, -1.1992584466934204, 0.21698226034641266, 0.6862213611602783, -0.6731002330780029, 0.0073857540264725685, -0.20877322554588318, -1.3257834911346436, -0.4087652564048767, 0.29608598351478577, 1.845707654953003, -0.7713230848312378, 1.008842945098877, 1.021352767944336, -0.6869891285896301, 0.03805007040500641, 0.24239540100097656, -0.29460641741752625, 0.8439412713050842, -1.0428353548049927, -0.4680594205856323, 1.2080788612365723, -0.23930728435516357, -0.6358835697174072, 1.5079584121704102, 0.7192259430885315, -1.0134189128875732, -0.19403326511383057, -0.17005124688148499, -0.8489658832550049, -0.03986850380897522, -1.5525861978530884, -0.10133013129234314, 0.43418389558792114, -1.4995626211166382, -0.47318345308303833, -0.2014051079750061, 1.2731934785842896, -0.17487551271915436, 1.4294793605804443, -0.39730775356292725, -0.2635231018066406, -0.36171671748161316, -0.36693325638771057, 0.22999294102191925, -0.18430234491825104, -0.6304823160171509, 0.15550199151039124, -0.9300394058227539, 0.2999286353588104, 1.5350651741027832, 0.413303405046463, 0.023018624633550644, 0.4864514470100403, 1.0990110635757446, 0.37456509470939636, -0.10065661370754242, -0.9065603613853455, -1.5658254623413086, 1.956932544708252, -1.3921833038330078, 1.9623891115188599, 0.6743853092193604, -0.08317282050848007, -1.8745206594467163, -1.8420385122299194, 1.2876979112625122, 1.2141036987304688, 2.3902599811553955, 0.4433659613132477, 0.3599550724029541, -0.7741530537605286, -0.7590254545211792, 0.36264315247535706, -0.99225914478302, -0.6004055142402649, 0.1783238649368286, 2.2787668704986572, 1.8253601789474487, -0.4908277690410614, -0.18653878569602966, -1.0482884645462036, 1.3714823722839355, -0.24325130879878998, 0.2330946922302246, 1.9881000518798828, -0.33278563618659973, -1.0344181060791016, 1.424367070198059, -2.234454870223999, 0.21848776936531067, 2.005375385284424, 0.29783183336257935, 0.062302302569150925, -1.3222718238830566, -0.6755915880203247, -0.34729012846946716, -0.403041273355484, -1.300951361656189, 0.4940037727355957, -0.25428110361099243, -0.8020524978637695, -1.3854974508285522, 0.07059895247220993, -1.0746866464614868, -1.726068377494812, 0.2909596860408783, 1.8324095010757446, 2.0674195289611816, -0.779207706451416, 1.4639431238174438, -0.3674057126045227, 0.20618146657943726, 1.1961404085159302, 1.2546586990356445, 3.067448616027832, 1.871524453163147, -1.3071084022521973, 0.68687504529953, -0.12387654185295105, -0.47351717948913574, 1.1903607845306396, -1.1702659130096436, 1.283178448677063, -0.19042998552322388, -1.2145582437515259, -1.1728918552398682, 1.0726646184921265, 0.42666083574295044, 0.061728719621896744, -0.5096796154975891, 1.2058333158493042, 0.03266455605626106, 1.3955291509628296, 0.5853676199913025, -0.42841359972953796, 0.6585455536842346, -0.4171101450920105, -0.5483424067497253, 1.5492359399795532, 0.1882944256067276, -1.500125527381897, -2.2374913692474365, -0.31745627522468567, -0.8184854984283447, 0.07447459548711777, -0.5905595421791077, -0.9972897171974182, 1.6635247468948364, 0.37850332260131836, -1.2943898439407349, -0.32000747323036194, -0.39138665795326233, -0.5517477989196777, 2.7495594024658203, -1.2759603261947632, -0.1477433443069458, -0.9620069861412048, -0.6813888549804688, 1.609246850013733, -1.1975281238555908, -0.24117077887058258, -1.063839077949524, -0.60662442445755, -1.4004244804382324, -0.5694291591644287, 0.07046250253915787, -0.970858633518219, 0.7628307342529297, 0.02844059094786644, -1.1065213680267334, -0.2827366888523102, -0.8844032883644104, 0.9733695387840271, -0.2359076887369156, 0.12058219313621521, 1.8499810695648193, 0.32666081190109253, -0.3951759338378906, 0.7375617623329163, 1.172351598739624, 0.6899322271347046, -0.7262793779373169, 0.01616724580526352, -0.7903013229370117, 0.23290668427944183, -1.2964446544647217, 0.2130350023508072, -2.910158157348633, 0.6919992566108704, -0.08193528652191162, -0.048569802194833755, -0.0075378711335361, -1.2619656324386597, 1.0293880701065063, 2.615492820739746, -1.2606662511825562, 0.4742269515991211, 0.3227040767669678, 1.1255638599395752, -1.5156067609786987, 0.30497094988822937, -0.4599120318889618, 2.036881685256958, 0.2832101583480835, 1.229503870010376, -0.5096839070320129, -2.1512250900268555, 0.6751455664634705, -1.2363052368164062, -1.1615350246429443, 0.8243309259414673, -0.9046815633773804, 0.21545347571372986, -1.3974310159683228, -0.2240004688501358, -0.9124523997306824, -1.1578739881515503, 0.6006720662117004, 0.10004977136850357, 0.41995105147361755, -0.5441268682479858, 0.3648173213005066, -2.259077310562134, -1.3967126607894897, -0.24392354488372803, -0.9866589307785034, 0.5244275331497192, -0.37044501304626465, 0.6532667875289917, -0.1753166913986206, 0.07597946375608444, 0.4006357192993164, 1.4674721956253052, 3.380509376525879, 0.23766104876995087, 0.21289274096488953, -0.118400938808918, -0.9747692942619324, 1.489569902420044, 0.9280660152435303, -0.07585127651691437, -0.5250540971755981, -1.0211803913116455, 1.2728869915008545, 1.8861902952194214, 1.058612585067749, 0.021010395139455795, -0.8880873322486877, -0.6757636666297913, 0.008408448658883572, 0.10482735186815262, 0.5013113617897034, 0.9403253793716431, 0.07394538819789886, 0.15772618353366852, 1.5013097524642944, 1.178622841835022, -0.3702889084815979, 0.3313300609588623, -0.8595125079154968, -0.5178197026252747, 0.4989498257637024, 0.2729586660861969, 0.02285158261656761, 0.4501834511756897, -1.0736846923828125, -0.24630247056484222, -0.42340219020843506, -0.9012263417243958, -0.7153199911117554, -0.4088599681854248, -0.44165366888046265, 1.5556045770645142, 0.12883517146110535, -0.5340194702148438, -0.08038638532161713, -0.7287706732749939, -0.1666039079427719, -1.03681480884552, 0.2830653488636017, -0.0748848095536232, -0.12060780823230743, -0.16756099462509155, 1.7294124364852905, -0.9008268117904663, -2.0120205879211426, 0.19780300557613373, 0.27229857444763184, -0.26482635736465454, 0.14982017874717712, 1.6500340700149536, 0.5801982879638672, 1.4119387865066528, 1.2932718992233276, 0.9642196893692017, -0.5882337689399719, -1.2471121549606323, 0.7129762172698975, 0.8999921679496765, -1.3638404607772827, 0.8100379705429077, -0.08744774013757706, -0.5448086857795715, 0.6834933161735535, 1.2709133625030518, 0.4865269362926483, -1.9523200988769531, 0.8391566872596741, -1.0147019624710083, 0.7571409344673157, 0.7514048218727112, 0.737683117389679, 0.11500554531812668, 0.904707133769989, -1.1723908185958862, -1.0523972511291504, -0.7318626046180725, -0.5879958868026733, 1.9409183263778687, -0.31055617332458496, 0.6071065664291382, -0.34753239154815674, -1.162872076034546, -0.0277109257876873, 0.724102795124054, 0.30338168144226074, -0.42789149284362793, 0.843166708946228, -0.5968573093414307, -1.043473482131958, -1.3300384283065796, -0.35405853390693665, -1.1008979082107544, -0.9186868667602539, 1.0604623556137085, 0.7211655378341675, 0.3217957019805908, 1.829956293106079, 0.6577604413032532, 0.25522130727767944, -2.621673583984375, 0.9281827807426453, 0.14333362877368927, -0.023297857493162155, 0.8320704102516174, 0.2730187475681305, 1.0115246772766113, -0.07707974314689636, 0.4918642044067383, -2.3862295150756836, 2.224308490753174, -0.25423499941825867, 0.6912299990653992, -0.023548288270831108, -0.16459588706493378, 1.1691840887069702, 0.6513428688049316, 0.5701993107795715, -1.0799006223678589, 0.6827551126480103, -0.5605362057685852, 1.185127854347229, 0.9520033597946167, -0.8203903436660767, 0.0004329029470682144, 1.4746575355529785, 0.47504740953445435, -0.46303582191467285, -0.9650285243988037, -0.9055814743041992, 1.006790280342102, 1.7191799879074097, -0.08331087231636047, -0.04985908418893814, 0.7689803838729858, 0.7427810430526733, -1.2989140748977661, 0.07025740295648575, -0.6677491664886475, -0.6682308316230774, 1.7591445446014404, 2.0863215923309326, -0.12932437658309937, -0.17046956717967987, -0.6382184028625488, -1.2769043445587158, 0.8105869889259338, -0.030895400792360306, 0.18601877987384796, 0.6584829092025757, -0.6477663516998291, 1.1575113534927368, 0.8041459321975708, 0.9676251411437988, 0.1880137026309967, 0.23578085005283356, 0.349956750869751, -0.3043513894081116, -1.2307788133621216, -0.22887136042118073, -1.0150755643844604, -2.510059118270874, 0.3805122673511505, -0.2182321399450302, -1.5069632530212402, 0.03339334577322006, -1.0036250352859497, 0.9628278017044067, -0.5471760034561157, -1.1105318069458008, -1.5916965007781982, 0.228280171751976, -0.062029656022787094, 0.9937504529953003, -1.6114829778671265, -0.138295516371727, 1.2057665586471558, 0.8924221992492676, -0.6694566607475281, 1.004670262336731, 0.22291620075702667, 0.989993691444397, 0.7794094085693359, -0.4491862952709198, 0.5298041701316833, 0.026254091411828995, -1.3565725088119507, 0.42924702167510986, 1.1648292541503906, 0.22177928686141968, 1.4596914052963257, -0.4926048219203949, 0.08371339738368988, 0.3782968819141388, -0.5986045002937317, -0.4852708578109741, -0.4658183157444, 0.6358498930931091, 0.019972439855337143, -0.9172592759132385, -0.07571323215961456, -0.05524660274386406, -0.2825661897659302, 0.243414044380188, -1.4210996627807617, -0.11562062799930573, -0.44695422053337097, -0.6503564715385437, -1.1827261447906494, -0.04001864045858383, 1.4420502185821533, -0.8743006587028503, -0.16263717412948608, 0.49797874689102173, 0.29492849111557007, 0.6302588582038879, 0.6454830169677734, -0.7296587228775024, -0.1746327131986618, -0.319559246301651, -0.2688648998737335, 0.28283268213272095, 1.294029712677002, -0.11805843561887741, -0.9566794633865356, 0.7088147401809692, -0.32717058062553406, 0.08606957644224167, 1.9333182573318481, 0.09189470112323761, -0.7092863917350769, 0.3276059925556183, -0.7386256456375122, 1.8776118755340576, 1.715536117553711, 1.3681944608688354, -0.1085817813873291, -0.9180020093917847, 0.5152882933616638, -0.26675349473953247, -0.4317878484725952, 0.8891614079475403, 0.40279775857925415, -0.19695726037025452, -1.405161738395691, 0.7984214425086975, 1.2606855630874634, -0.8482918739318848, -0.7543352842330933, 0.13954614102840424, -0.837829053401947, 1.126081109046936, 0.5822492241859436, 0.3645162284374237, 0.26682496070861816, 1.5983879566192627, 0.8052211403846741, -0.43077680468559265, 0.47506392002105713, 0.6105917096138, -0.15568488836288452, -2.1040425300598145, -1.1345041990280151, 0.3710337281227112, -0.5441109538078308, -1.603393793106079, 1.402330994606018, -1.1290777921676636, -1.04764723777771, 0.6391638517379761, 0.10301647335290909, 1.3728901147842407, 0.4097050726413727, 1.592607855796814, 2.0579631328582764, 0.96866774559021, 0.40491220355033875, 1.273206114768982, -0.07949016988277435, -0.39755356311798096, 1.8423749208450317, -0.39679306745529175, 0.4976450800895691, 1.062393307685852, -0.3719801902770996, -1.1047967672348022, -0.7549455165863037, -1.193472146987915, -0.7047680616378784, 1.1165815591812134, 0.12494589388370514, -1.1031898260116577, 0.1367708295583725, 1.518326759338379, 0.1444355547428131, -0.31846755743026733, 0.7200181484222412, 0.3714027404785156, -0.7282354235649109, -0.045048464089632034, -0.968562126159668, 0.5199556946754456, -0.2199803590774536, -0.3841571509838104, 0.24923741817474365, 0.48115673661231995, 1.3393315076828003, -0.08497767150402069, 0.15297378599643707, 1.193092703819275, -1.4210071563720703, 1.470210075378418, -0.6362823247909546, 0.2689446210861206, -2.4132516384124756, 1.3680850267410278, -0.754114031791687, 1.9374735355377197, -2.6600334644317627, 0.440022736787796, -0.5874967575073242, -0.4968354105949402, 0.2814876139163971, -0.4041583240032196, 0.06634742021560669, -0.057788070291280746, -1.150018572807312, 0.0032008644193410873, -0.6958885192871094, 0.661061704158783, 1.1424815654754639, 1.4568277597427368, -1.2402138710021973, -0.3085218667984009, -1.7524458169937134, -0.156694695353508, -0.7897748351097107, 0.34700295329093933, -1.9877986907958984, -0.21324248611927032, -1.8884366750717163, -2.460268259048462, -1.3064030408859253, -0.8332332372665405, 1.0752032995224, 0.13093598186969757, -0.8951519727706909, 1.266789436340332, -0.3867676854133606, -1.9173604249954224, 1.2195003032684326, -2.2370431423187256 ]
https://github.com/huggingface/datasets/issues/4478
Dataset slow during model training
That 5 minute wait is quite surprising! I don't have a good explanation for why it's happening, but it can't be an issue with `datasets` or `tf.data` because you're just fitting directly on Numpy arrays at this point. All I can suggest is seeing if you can isolate the issue - for example, does fitting on a smaller dataset containing only 10% of the original data reduce the wait? This might indicate the delay is caused by your data being copied or converted somehow. Alternatively, you could try removing things like callbacks and seeing if you could isolate the issue there.
## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB
717
101
Dataset slow during model training ## Describe the bug While migrating towards 🤗 Datasets, I encountered an odd performance degradation: training suddenly slows down dramatically. I train with an image dataset using Keras and execute a `to_tf_dataset` just before training. First, I have optimized my dataset following https://discuss.huggingface.co/t/solved-image-dataset-seems-slow-for-larger-image-size/10960/6, which actually improved the situation from what I had before but did not completely solve it. Second, I saved and loaded my dataset using `tf.data.experimental.save` and `tf.data.experimental.load` before training (for which I would have expected no performance change). However, I ended up with the performance I had before tinkering with 🤗 Datasets. Any idea what's the reason for this and how to speed-up training with 🤗 Datasets? ## Steps to reproduce the bug ```python # Sample code to reproduce the bug from datasets import load_dataset import os dataset_dir = "./dataset" prep_dataset_dir = "./prepdataset" model_dir = "./model" # Load Data dataset = load_dataset("Lehrig/Monkey-Species-Collection", "downsized") def read_image_file(example): with open(example["image"].filename, "rb") as f: example["image"] = {"bytes": f.read()} return example dataset = dataset.map(read_image_file) dataset.save_to_disk(dataset_dir) # Preprocess from datasets import ( Array3D, DatasetDict, Features, load_from_disk, Sequence, Value ) import numpy as np from transformers import ImageFeatureExtractionMixin dataset = load_from_disk(dataset_dir) num_classes = dataset["train"].features["label"].num_classes one_hot_matrix = np.eye(num_classes) feature_extractor = ImageFeatureExtractionMixin() def to_pixels(image): image = feature_extractor.resize(image, size=size) image = feature_extractor.to_numpy_array(image, channel_first=False) image = image / 255.0 return image def process(examples): examples["pixel_values"] = [ to_pixels(image) for image in examples["image"] ] examples["label"] = [ one_hot_matrix[label] for label in examples["label"] ] return examples features = Features({ "pixel_values": Array3D(dtype="float32", shape=(size, size, 3)), "label": Sequence(feature=Value(dtype="int32"), length=num_classes) }) prep_dataset = dataset.map( process, remove_columns=["image"], batched=True, batch_size=batch_size, num_proc=2, features=features, ) prep_dataset = prep_dataset.with_format("numpy") # Split train_dev_dataset = prep_dataset['test'].train_test_split( test_size=test_size, shuffle=True, seed=seed ) train_dev_test_dataset = DatasetDict({ 'train': train_dev_dataset['train'], 'dev': train_dev_dataset['test'], 'test': prep_dataset['test'], }) train_dev_test_dataset.save_to_disk(prep_dataset_dir) # Train Model import datetime import tensorflow as tf from tensorflow.keras import Sequential from tensorflow.keras.applications import InceptionV3 from tensorflow.keras.layers import Dense, Dropout, GlobalAveragePooling2D, BatchNormalization from tensorflow.keras.callbacks import ReduceLROnPlateau, ModelCheckpoint, EarlyStopping from transformers import DefaultDataCollator dataset = load_from_disk(prep_data_dir) data_collator = DefaultDataCollator(return_tensors="tf") train_dataset = dataset["train"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=True, batch_size=batch_size, collate_fn=data_collator ) validation_dataset = dataset["dev"].to_tf_dataset( columns=['pixel_values'], label_cols=['label'], shuffle=False, batch_size=batch_size, collate_fn=data_collator ) print(f'{datetime.datetime.now()} - Saving Data') tf.data.experimental.save(train_dataset, model_dir+"/train") tf.data.experimental.save(validation_dataset, model_dir+"/val") print(f'{datetime.datetime.now()} - Loading Data') train_dataset = tf.data.experimental.load(model_dir+"/train") validation_dataset = tf.data.experimental.load(model_dir+"/val") shape = np.shape(dataset["train"][0]["pixel_values"]) backbone = InceptionV3( include_top=False, weights='imagenet', input_shape=shape ) for layer in backbone.layers: layer.trainable = False model = Sequential() model.add(backbone) model.add(GlobalAveragePooling2D()) model.add(Dense(128, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(64, activation='relu')) model.add(BatchNormalization()) model.add(Dropout(0.3)) model.add(Dense(10, activation='softmax')) model.compile( optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'] ) print(model.summary()) earlyStopping = EarlyStopping( monitor='val_loss', patience=10, verbose=0, mode='min' ) mcp_save = ModelCheckpoint( f'{model_dir}/best_model.hdf5', save_best_only=True, monitor='val_loss', mode='min' ) reduce_lr_loss = ReduceLROnPlateau( monitor='val_loss', factor=0.1, patience=7, verbose=1, min_delta=0.0001, mode='min' ) hist = model.fit( train_dataset, epochs=epochs, validation_data=validation_dataset, callbacks=[earlyStopping, mcp_save, reduce_lr_loss] ) ``` ## Expected results Same performance when training without my "save/load hack" or a good explanation/recommendation about the issue. ## Actual results Performance slower without my "save/load hack". **Epoch Breakdown (without my "save/load hack"):** - Epoch 1/10 41s 2s/step - loss: 1.6302 - accuracy: 0.5048 - val_loss: 1.4713 - val_accuracy: 0.3273 - lr: 0.0010 - Epoch 2/10 32s 2s/step - loss: 0.5357 - accuracy: 0.8510 - val_loss: 1.0447 - val_accuracy: 0.5818 - lr: 0.0010 - Epoch 3/10 36s 3s/step - loss: 0.3547 - accuracy: 0.9231 - val_loss: 0.6245 - val_accuracy: 0.7091 - lr: 0.0010 - Epoch 4/10 36s 3s/step - loss: 0.2721 - accuracy: 0.9231 - val_loss: 0.3395 - val_accuracy: 0.9091 - lr: 0.0010 - Epoch 5/10 32s 2s/step - loss: 0.1676 - accuracy: 0.9856 - val_loss: 0.2187 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 6/10 42s 3s/step - loss: 0.2066 - accuracy: 0.9615 - val_loss: 0.1635 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 7/10 32s 2s/step - loss: 0.1814 - accuracy: 0.9423 - val_loss: 0.1418 - val_accuracy: 0.9636 - lr: 0.0010 - Epoch 8/10 32s 2s/step - loss: 0.1301 - accuracy: 0.9856 - val_loss: 0.1388 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 9/10 loss: 0.1102 - accuracy: 0.9856 - val_loss: 0.1185 - val_accuracy: 0.9818 - lr: 0.0010 - Epoch 10/10 32s 2s/step - loss: 0.1013 - accuracy: 0.9808 - val_loss: 0.0978 - val_accuracy: 0.9818 - lr: 0.0010 **Epoch Breakdown (with my "save/load hack"):** - Epoch 1/10 13s 625ms/step - loss: 3.0478 - accuracy: 0.1146 - val_loss: 2.3061 - val_accuracy: 0.0727 - lr: 0.0010 - Epoch 2/10 0s 80ms/step - loss: 2.3105 - accuracy: 0.2656 - val_loss: 2.3085 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 3/10 0s 77ms/step - loss: 1.8608 - accuracy: 0.3542 - val_loss: 2.3130 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 4/10 1s 98ms/step - loss: 1.8677 - accuracy: 0.3750 - val_loss: 2.3157 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 5/10 1s 204ms/step - loss: 1.5561 - accuracy: 0.4583 - val_loss: 2.3049 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 6/10 1s 210ms/step - loss: 1.4657 - accuracy: 0.4896 - val_loss: 2.2944 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 7/10 1s 205ms/step - loss: 1.4018 - accuracy: 0.5312 - val_loss: 2.2917 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 8/10 1s 207ms/step - loss: 1.2370 - accuracy: 0.5729 - val_loss: 2.2814 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 9/10 1s 214ms/step - loss: 1.1190 - accuracy: 0.6250 - val_loss: 2.2733 - val_accuracy: 0.0909 - lr: 0.0010 - Epoch 10/10 1s 207ms/step - loss: 1.1484 - accuracy: 0.6302 - val_loss: 2.2624 - val_accuracy: 0.0909 - lr: 0.0010 ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-305.45.1.el8_4.ppc64le-ppc64le-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 7.0.0 - Pandas version: 1.4.2 - TensorFlow: 2.8.0 - GPU (used during training): Tesla V100-SXM2-32GB That 5 minute wait is quite surprising! I don't have a good explanation for why it's happening, but it can't be an issue with `datasets` or `tf.data` because you're just fitting directly on Numpy arrays at this point. All I can suggest is seeing if you can isolate the issue - for example, does fitting on a smaller dataset containing only 10% of the original data reduce the wait? This might indicate the delay is caused by your data being copied or converted somehow. Alternatively, you could try removing things like callbacks and seeing if you could isolate the issue there.
[ -1.33140230178833, -1.0034711360931396, -0.6648240685462952, 1.3942846059799194, -0.20022745430469513, -1.249970555305481, 0.15734997391700745, -1.0949218273162842, 1.5684064626693726, -0.8943634629249573, 0.2955647110939026, -1.7059777975082397, -0.025755688548088074, -0.5267432928085327, -0.7018626928329468, -0.9349560141563416, -0.42303866147994995, -0.7409504652023315, 1.1312156915664673, 2.4330594539642334, 1.1856801509857178, -1.315843105316162, 2.777482509613037, 0.6275325417518616, -0.18068723380565643, -1.0337296724319458, 0.5530669689178467, 0.0764383003115654, -1.286331295967102, -0.4052627384662628, -0.9915039539337158, -0.010935642756521702, -0.5678940415382385, -0.5319175720214844, 0.04824023321270943, 0.3996945917606354, -0.3490602970123291, -0.4369416832923889, -0.5868690013885498, -0.7435707449913025, 0.4826068580150604, -0.3583585321903229, 0.9604023694992065, -0.35297104716300964, 1.8037432432174683, -0.6216796636581421, 0.4497317671775818, 0.7496762871742249, 1.2304091453552246, 0.2205081582069397, 0.033298034220933914, 0.34353107213974, 0.3895590603351593, -0.0023463834077119827, 0.476630300283432, 1.1826101541519165, 0.5581126809120178, 0.5316040515899658, 0.7074525356292725, -2.204211473464966, 1.2891325950622559, -1.03062105178833, 0.3223783075809479, 1.4435936212539673, -0.9370455145835876, 0.4092695713043213, -1.6989243030548096, -0.12863130867481232, 0.5580679774284363, -2.2028024196624756, 0.2629257142543793, -1.3254181146621704, -0.5231800675392151, 0.9990862607955933, 0.4205922484397888, -1.118945837020874, 0.18856976926326752, -0.520612359046936, 1.035857081413269, 0.4113476872444153, 1.1620721817016602, -1.6540378332138062, -0.0413307286798954, -0.2573027014732361, 0.14713039994239807, -1.2923719882965088, -1.5828949213027954, 0.6054858565330505, 0.614232063293457, 0.6143751740455627, -0.15199707448482513, 1.0840188264846802, -1.0102488994598389, 0.7678001523017883, -1.0443211793899536, -1.6289311647415161, -1.4456323385238647, -2.2908477783203125, -2.3031351566314697, 0.7350087761878967, -0.46274203062057495, -0.5635320544242859, 2.092731475830078, -1.0805209875106812, -1.7460706233978271, 1.136231541633606, 0.21592186391353607, -0.013517961837351322, 2.38161039352417, 0.2914092242717743, -0.7044700384140015, 0.5587339401245117, -0.7459902167320251, 0.790701687335968, -0.27533820271492004, 1.3209586143493652, 0.45697614550590515, -0.9999330043792725, 1.5634685754776, -0.37301015853881836, 0.6365277767181396, -0.5827455520629883, -0.4881836771965027, -0.8182321190834045, 0.28396493196487427, 1.9078795909881592, -0.30048710107803345, 1.5901509523391724, -0.3117430806159973, -1.62453031539917, -1.640565037727356, 0.8610480427742004, 0.4556571841239929, -0.7759518027305603, 0.06710934638977051, -0.41714373230934143, 0.12207001447677612, 0.03866815194487572, 1.1637989282608032, 1.283877968788147, 0.8030509352684021, -0.3742998540401459, -0.8396161794662476, 0.15928728878498077, -0.02508327178657055, -0.7094135284423828, -1.7608511447906494, -0.31888869404792786, 0.14569571614265442, 0.5915691256523132, -1.1780710220336914, 1.754166603088379, 0.9565467834472656, 1.8777884244918823, 1.0156190395355225, -0.36638084053993225, 1.4047062397003174, 0.12406668066978455, 1.8515894412994385, -0.5017330050468445, 0.6766777038574219, -0.23524491488933563, -1.1623235940933228, 0.8075413703918457, -0.2961716055870056, -2.038367986679077, -0.8379063010215759, -0.7951989769935608, -0.1516704112291336, -0.7842414379119873, 0.9455950856208801, -0.26844361424446106, -1.4844900369644165, 0.2139638066291809, -0.6556153297424316, 0.1606132686138153, -1.1992584466934204, 0.21698226034641266, 0.6862213611602783, -0.6731002330780029, 0.0073857540264725685, -0.20877322554588318, -1.3257834911346436, -0.4087652564048767, 0.29608598351478577, 1.845707654953003, -0.7713230848312378, 1.008842945098877, 1.021352767944336, -0.6869891285896301, 0.03805007040500641, 0.24239540100097656, -0.29460641741752625, 0.8439412713050842, -1.0428353548049927, -0.4680594205856323, 1.2080788612365723, -0.23930728435516357, -0.6358835697174072, 1.5079584121704102, 0.7192259430885315, -1.0134189128875732, -0.19403326511383057, -0.17005124688148499, -0.8489658832550049, -0.03986850380897522, -1.5525861978530884, -0.10133013129234314, 0.43418389558792114, -1.4995626211166382, -0.47318345308303833, -0.2014051079750061, 1.2731934785842896, -0.17487551271915436, 1.4294793605804443, -0.39730775356292725, -0.2635231018066406, -0.36171671748161316, -0.36693325638771057, 0.22999294102191925, -0.18430234491825104, -0.6304823160171509, 0.15550199151039124, -0.9300394058227539, 0.2999286353588104, 1.5350651741027832, 0.413303405046463, 0.023018624633550644, 0.4864514470100403, 1.0990110635757446, 0.37456509470939636, -0.10065661370754242, -0.9065603613853455, -1.5658254623413086, 1.956932544708252, -1.3921833038330078, 1.9623891115188599, 0.6743853092193604, -0.08317282050848007, -1.8745206594467163, -1.8420385122299194, 1.2876979112625122, 1.2141036987304688, 2.3902599811553955, 0.4433659613132477, 0.3599550724029541, -0.7741530537605286, -0.7590254545211792, 0.36264315247535706, -0.99225914478302, -0.6004055142402649, 0.1783238649368286, 2.2787668704986572, 1.8253601789474487, -0.4908277690410614, -0.18653878569602966, -1.0482884645462036, 1.3714823722839355, -0.24325130879878998, 0.2330946922302246, 1.9881000518798828, -0.33278563618659973, -1.0344181060791016, 1.424367070198059, -2.234454870223999, 0.21848776936531067, 2.005375385284424, 0.29783183336257935, 0.062302302569150925, -1.3222718238830566, -0.6755915880203247, -0.34729012846946716, -0.403041273355484, -1.300951361656189, 0.4940037727355957, -0.25428110361099243, -0.8020524978637695, -1.3854974508285522, 0.07059895247220993, -1.0746866464614868, -1.726068377494812, 0.2909596860408783, 1.8324095010757446, 2.0674195289611816, -0.779207706451416, 1.4639431238174438, -0.3674057126045227, 0.20618146657943726, 1.1961404085159302, 1.2546586990356445, 3.067448616027832, 1.871524453163147, -1.3071084022521973, 0.68687504529953, -0.12387654185295105, -0.47351717948913574, 1.1903607845306396, -1.1702659130096436, 1.283178448677063, -0.19042998552322388, -1.2145582437515259, -1.1728918552398682, 1.0726646184921265, 0.42666083574295044, 0.061728719621896744, -0.5096796154975891, 1.2058333158493042, 0.03266455605626106, 1.3955291509628296, 0.5853676199913025, -0.42841359972953796, 0.6585455536842346, -0.4171101450920105, -0.5483424067497253, 1.5492359399795532, 0.1882944256067276, -1.500125527381897, -2.2374913692474365, -0.31745627522468567, -0.8184854984283447, 0.07447459548711777, -0.5905595421791077, -0.9972897171974182, 1.6635247468948364, 0.37850332260131836, -1.2943898439407349, -0.32000747323036194, -0.39138665795326233, -0.5517477989196777, 2.7495594024658203, -1.2759603261947632, -0.1477433443069458, -0.9620069861412048, -0.6813888549804688, 1.609246850013733, -1.1975281238555908, -0.24117077887058258, -1.063839077949524, -0.60662442445755, -1.4004244804382324, -0.5694291591644287, 0.07046250253915787, -0.970858633518219, 0.7628307342529297, 0.02844059094786644, -1.1065213680267334, -0.2827366888523102, -0.8844032883644104, 0.9733695387840271, -0.2359076887369156, 0.12058219313621521, 1.8499810695648193, 0.32666081190109253, -0.3951759338378906, 0.7375617623329163, 1.172351598739624, 0.6899322271347046, -0.7262793779373169, 0.01616724580526352, -0.7903013229370117, 0.23290668427944183, -1.2964446544647217, 0.2130350023508072, -2.910158157348633, 0.6919992566108704, -0.08193528652191162, -0.048569802194833755, -0.0075378711335361, -1.2619656324386597, 1.0293880701065063, 2.615492820739746, -1.2606662511825562, 0.4742269515991211, 0.3227040767669678, 1.1255638599395752, -1.5156067609786987, 0.30497094988822937, -0.4599120318889618, 2.036881685256958, 0.2832101583480835, 1.229503870010376, -0.5096839070320129, -2.1512250900268555, 0.6751455664634705, -1.2363052368164062, -1.1615350246429443, 0.8243309259414673, -0.9046815633773804, 0.21545347571372986, -1.3974310159683228, -0.2240004688501358, -0.9124523997306824, -1.1578739881515503, 0.6006720662117004, 0.10004977136850357, 0.41995105147361755, -0.5441268682479858, 0.3648173213005066, -2.259077310562134, -1.3967126607894897, -0.24392354488372803, -0.9866589307785034, 0.5244275331497192, -0.37044501304626465, 0.6532667875289917, -0.1753166913986206, 0.07597946375608444, 0.4006357192993164, 1.4674721956253052, 3.380509376525879, 0.23766104876995087, 0.21289274096488953, -0.118400938808918, -0.9747692942619324, 1.489569902420044, 0.9280660152435303, -0.07585127651691437, -0.5250540971755981, -1.0211803913116455, 1.2728869915008545, 1.8861902952194214, 1.058612585067749, 0.021010395139455795, -0.8880873322486877, -0.6757636666297913, 0.008408448658883572, 0.10482735186815262, 0.5013113617897034, 0.9403253793716431, 0.07394538819789886, 0.15772618353366852, 1.5013097524642944, 1.178622841835022, -0.3702889084815979, 0.3313300609588623, -0.8595125079154968, -0.5178197026252747, 0.4989498257637024, 0.2729586660861969, 0.02285158261656761, 0.4501834511756897, -1.0736846923828125, -0.24630247056484222, -0.42340219020843506, -0.9012263417243958, -0.7153199911117554, -0.4088599681854248, -0.44165366888046265, 1.5556045770645142, 0.12883517146110535, -0.5340194702148438, -0.08038638532161713, -0.7287706732749939, -0.1666039079427719, -1.03681480884552, 0.2830653488636017, -0.0748848095536232, -0.12060780823230743, -0.16756099462509155, 1.7294124364852905, -0.9008268117904663, -2.0120205879211426, 0.19780300557613373, 0.27229857444763184, -0.26482635736465454, 0.14982017874717712, 1.6500340700149536, 0.5801982879638672, 1.4119387865066528, 1.2932718992233276, 0.9642196893692017, -0.5882337689399719, -1.2471121549606323, 0.7129762172698975, 0.8999921679496765, -1.3638404607772827, 0.8100379705429077, -0.08744774013757706, -0.5448086857795715, 0.6834933161735535, 1.2709133625030518, 0.4865269362926483, -1.9523200988769531, 0.8391566872596741, -1.0147019624710083, 0.7571409344673157, 0.7514048218727112, 0.737683117389679, 0.11500554531812668, 0.904707133769989, -1.1723908185958862, -1.0523972511291504, -0.7318626046180725, -0.5879958868026733, 1.9409183263778687, -0.31055617332458496, 0.6071065664291382, -0.34753239154815674, -1.162872076034546, -0.0277109257876873, 0.724102795124054, 0.30338168144226074, -0.42789149284362793, 0.843166708946228, -0.5968573093414307, -1.043473482131958, -1.3300384283065796, -0.35405853390693665, -1.1008979082107544, -0.9186868667602539, 1.0604623556137085, 0.7211655378341675, 0.3217957019805908, 1.829956293106079, 0.6577604413032532, 0.25522130727767944, -2.621673583984375, 0.9281827807426453, 0.14333362877368927, -0.023297857493162155, 0.8320704102516174, 0.2730187475681305, 1.0115246772766113, -0.07707974314689636, 0.4918642044067383, -2.3862295150756836, 2.224308490753174, -0.25423499941825867, 0.6912299990653992, -0.023548288270831108, -0.16459588706493378, 1.1691840887069702, 0.6513428688049316, 0.5701993107795715, -1.0799006223678589, 0.6827551126480103, -0.5605362057685852, 1.185127854347229, 0.9520033597946167, -0.8203903436660767, 0.0004329029470682144, 1.4746575355529785, 0.47504740953445435, -0.46303582191467285, -0.9650285243988037, -0.9055814743041992, 1.006790280342102, 1.7191799879074097, -0.08331087231636047, -0.04985908418893814, 0.7689803838729858, 0.7427810430526733, -1.2989140748977661, 0.07025740295648575, -0.6677491664886475, -0.6682308316230774, 1.7591445446014404, 2.0863215923309326, -0.12932437658309937, -0.17046956717967987, -0.6382184028625488, -1.2769043445587158, 0.8105869889259338, -0.030895400792360306, 0.18601877987384796, 0.6584829092025757, -0.6477663516998291, 1.1575113534927368, 0.8041459321975708, 0.9676251411437988, 0.1880137026309967, 0.23578085005283356, 0.349956750869751, -0.3043513894081116, -1.2307788133621216, -0.22887136042118073, -1.0150755643844604, -2.510059118270874, 0.3805122673511505, -0.2182321399450302, -1.5069632530212402, 0.03339334577322006, -1.0036250352859497, 0.9628278017044067, -0.5471760034561157, -1.1105318069458008, -1.5916965007781982, 0.228280171751976, -0.062029656022787094, 0.9937504529953003, -1.6114829778671265, -0.138295516371727, 1.2057665586471558, 0.8924221992492676, -0.6694566607475281, 1.004670262336731, 0.22291620075702667, 0.989993691444397, 0.7794094085693359, -0.4491862952709198, 0.5298041701316833, 0.026254091411828995, -1.3565725088119507, 0.42924702167510986, 1.1648292541503906, 0.22177928686141968, 1.4596914052963257, -0.4926048219203949, 0.08371339738368988, 0.3782968819141388, -0.5986045002937317, -0.4852708578109741, -0.4658183157444, 0.6358498930931091, 0.019972439855337143, -0.9172592759132385, -0.07571323215961456, -0.05524660274386406, -0.2825661897659302, 0.243414044380188, -1.4210996627807617, -0.11562062799930573, -0.44695422053337097, -0.6503564715385437, -1.1827261447906494, -0.04001864045858383, 1.4420502185821533, -0.8743006587028503, -0.16263717412948608, 0.49797874689102173, 0.29492849111557007, 0.6302588582038879, 0.6454830169677734, -0.7296587228775024, -0.1746327131986618, -0.319559246301651, -0.2688648998737335, 0.28283268213272095, 1.294029712677002, -0.11805843561887741, -0.9566794633865356, 0.7088147401809692, -0.32717058062553406, 0.08606957644224167, 1.9333182573318481, 0.09189470112323761, -0.7092863917350769, 0.3276059925556183, -0.7386256456375122, 1.8776118755340576, 1.715536117553711, 1.3681944608688354, -0.1085817813873291, -0.9180020093917847, 0.5152882933616638, -0.26675349473953247, -0.4317878484725952, 0.8891614079475403, 0.40279775857925415, -0.19695726037025452, -1.405161738395691, 0.7984214425086975, 1.2606855630874634, -0.8482918739318848, -0.7543352842330933, 0.13954614102840424, -0.837829053401947, 1.126081109046936, 0.5822492241859436, 0.3645162284374237, 0.26682496070861816, 1.5983879566192627, 0.8052211403846741, -0.43077680468559265, 0.47506392002105713, 0.6105917096138, -0.15568488836288452, -2.1040425300598145, -1.1345041990280151, 0.3710337281227112, -0.5441109538078308, -1.603393793106079, 1.402330994606018, -1.1290777921676636, -1.04764723777771, 0.6391638517379761, 0.10301647335290909, 1.3728901147842407, 0.4097050726413727, 1.592607855796814, 2.0579631328582764, 0.96866774559021, 0.40491220355033875, 1.273206114768982, -0.07949016988277435, -0.39755356311798096, 1.8423749208450317, -0.39679306745529175, 0.4976450800895691, 1.062393307685852, -0.3719801902770996, -1.1047967672348022, -0.7549455165863037, -1.193472146987915, -0.7047680616378784, 1.1165815591812134, 0.12494589388370514, -1.1031898260116577, 0.1367708295583725, 1.518326759338379, 0.1444355547428131, -0.31846755743026733, 0.7200181484222412, 0.3714027404785156, -0.7282354235649109, -0.045048464089632034, -0.968562126159668, 0.5199556946754456, -0.2199803590774536, -0.3841571509838104, 0.24923741817474365, 0.48115673661231995, 1.3393315076828003, -0.08497767150402069, 0.15297378599643707, 1.193092703819275, -1.4210071563720703, 1.470210075378418, -0.6362823247909546, 0.2689446210861206, -2.4132516384124756, 1.3680850267410278, -0.754114031791687, 1.9374735355377197, -2.6600334644317627, 0.440022736787796, -0.5874967575073242, -0.4968354105949402, 0.2814876139163971, -0.4041583240032196, 0.06634742021560669, -0.057788070291280746, -1.150018572807312, 0.0032008644193410873, -0.6958885192871094, 0.661061704158783, 1.1424815654754639, 1.4568277597427368, -1.2402138710021973, -0.3085218667984009, -1.7524458169937134, -0.156694695353508, -0.7897748351097107, 0.34700295329093933, -1.9877986907958984, -0.21324248611927032, -1.8884366750717163, -2.460268259048462, -1.3064030408859253, -0.8332332372665405, 1.0752032995224, 0.13093598186969757, -0.8951519727706909, 1.266789436340332, -0.3867676854133606, -1.9173604249954224, 1.2195003032684326, -2.2370431423187256 ]
https://github.com/huggingface/datasets/issues/4477
Dataset Viewer issue for fgrezes/WIESP2022-NER
https://huggingface.co/datasets/fgrezes/WIESP2022-NER The error: ``` Message: Couldn't find a dataset script at /src/services/worker/fgrezes/WIESP2022-NER/WIESP2022-NER.py or any data file in the same directory. Couldn't find 'fgrezes/WIESP2022-NER' on the Hugging Face Hub either: FileNotFoundError: Unable to resolve any data file that matches ['**test*', '**eval*'] in dataset repository fgrezes/WIESP2022-NER with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` I understand the issue is not related to the dataset viewer in itself, but with the autodetection of the data files without a loading script in the datasets library. cc @lhoestq @albertvillanova @mariosasko
### Link _No response_ ### Description _No response_ ### Owner _No response_
718
152
Dataset Viewer issue for fgrezes/WIESP2022-NER ### Link _No response_ ### Description _No response_ ### Owner _No response_ https://huggingface.co/datasets/fgrezes/WIESP2022-NER The error: ``` Message: Couldn't find a dataset script at /src/services/worker/fgrezes/WIESP2022-NER/WIESP2022-NER.py or any data file in the same directory. Couldn't find 'fgrezes/WIESP2022-NER' on the Hugging Face Hub either: FileNotFoundError: Unable to resolve any data file that matches ['**test*', '**eval*'] in dataset repository fgrezes/WIESP2022-NER with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` I understand the issue is not related to the dataset viewer in itself, but with the autodetection of the data files without a loading script in the datasets library. cc @lhoestq @albertvillanova @mariosasko
[ -1.1565876007080078, -1.2248915433883667, -0.8478091955184937, 1.7605451345443726, -0.28903213143348694, -1.0266435146331787, -0.014653580263257027, -0.7971771359443665, 1.5424860715866089, -0.6479870080947876, -0.020549781620502472, -1.7485102415084839, -0.24686948955059052, -0.8862674236297607, -0.5006640553474426, -0.7251412272453308, -0.03295115381479263, -0.9195275902748108, 1.2556904554367065, 2.3859667778015137, 0.8783907890319824, -1.595136046409607, 2.8603832721710205, 0.6985464096069336, -0.07475792616605759, -1.2431999444961548, 0.5328998565673828, -0.2290320247411728, -0.8753853440284729, -0.5835439562797546, -1.0041016340255737, 0.212611585855484, -0.7127333879470825, -0.2101050168275833, 0.10166248679161072, 0.5904964804649353, -0.10629479587078094, -0.5498874187469482, -0.45158493518829346, -0.5581067204475403, 0.30786824226379395, -0.5287391543388367, 0.8547816872596741, -0.15361422300338745, 1.669938564300537, -0.21252068877220154, 0.13778427243232727, 0.5798028707504272, 1.421902060508728, 0.27170056104660034, 0.22592243552207947, 0.3201533257961273, 0.33813387155532837, -0.05388380587100983, 0.6274334192276001, 1.1514928340911865, 0.5844433307647705, 0.30229321122169495, 0.8622912764549255, -2.5256154537200928, 1.210368275642395, -1.1931004524230957, 0.347504585981369, 1.3426332473754883, -0.7195490002632141, 0.7468321323394775, -1.8332810401916504, 0.2776598632335663, 0.670048177242279, -1.9806684255599976, 0.5055897831916809, -1.0772716999053955, -0.3693541884422302, 0.682537317276001, 0.4079775810241699, -1.4223263263702393, 0.28755149245262146, -0.34361207485198975, 1.1229021549224854, 0.24228118360042572, 0.8547173738479614, -1.8383536338806152, 0.09244608879089355, -0.12911616265773773, 0.1569073647260666, -1.2760804891586304, -1.6003355979919434, 0.5223656296730042, 0.5071064233779907, 0.8108022809028625, -0.17295634746551514, 0.8903260231018066, -1.3520232439041138, 0.5060858726501465, -1.0443360805511475, -1.607475757598877, -1.1515706777572632, -2.4153058528900146, -2.2788195610046387, 0.6729735136032104, -0.4016442596912384, -0.384162038564682, 1.9926749467849731, -0.6827901005744934, -1.743924856185913, 1.3771185874938965, 0.5904276371002197, 0.15486560761928558, 2.5789880752563477, 0.22912095487117767, -0.8318389654159546, 0.4933953881263733, -1.03252375125885, 0.9159745573997498, -0.5812085866928101, 1.5827195644378662, 0.376152366399765, -0.6094056367874146, 1.7667832374572754, -0.467638224363327, 0.549900472164154, -0.6237769722938538, -0.48228710889816284, -0.9019384980201721, 0.32521748542785645, 1.8820860385894775, -0.11361289024353027, 1.3009477853775024, -0.618704080581665, -1.457634449005127, -1.478531002998352, 1.0778639316558838, 0.0925559401512146, -1.0901983976364136, 0.13906367123126984, -0.4592539370059967, 0.43324846029281616, -0.32246366143226624, 1.174852967262268, 1.2683064937591553, 0.41083887219429016, -0.34265202283859253, -1.0374797582626343, 0.0892859399318695, -0.44252246618270874, -0.5335250496864319, -1.9367704391479492, -0.22272557020187378, 0.13017459213733673, 0.7659938931465149, -1.3236463069915771, 1.4732760190963745, 0.7891243100166321, 2.011172294616699, 0.9030195474624634, -0.6071406006813049, 1.4875761270523071, 0.1669492870569229, 1.7549782991409302, -0.8661662936210632, 0.5582213401794434, -0.45896974205970764, -1.0518817901611328, 0.9664528965950012, -0.2803713381290436, -1.7257264852523804, -0.8022750020027161, -0.9560675621032715, -0.5445950627326965, -0.7909248471260071, 0.6646406650543213, -0.623728334903717, -1.5680261850357056, 0.314825177192688, -0.6517930030822754, 0.5079805850982666, -1.0606662034988403, 0.16084972023963928, 0.7794684171676636, -0.41733255982398987, 0.1663322001695633, -0.34578463435173035, -1.4790934324264526, -0.5457334518432617, 0.7094539403915405, 1.917104721069336, -0.5674342513084412, 0.7315608263015747, 0.9922446608543396, -0.617041826248169, -0.07492733746767044, 0.2026292234659195, -0.1641589254140854, 0.6254753470420837, -0.945709228515625, -1.0005125999450684, 1.1565598249435425, -0.3882528245449066, -0.6288986206054688, 1.2964085340499878, 0.9812387228012085, -1.1936461925506592, -0.3515440821647644, -0.25648409128189087, -0.8105244040489197, 0.026589885354042053, -1.631897211074829, -0.34321942925453186, 0.5515857934951782, -1.5650652647018433, -0.5056900382041931, -0.44125568866729736, 1.1143567562103271, -0.05798130854964256, 1.2712212800979614, -0.384128212928772, -0.145531564950943, 0.0465376079082489, -0.6993516683578491, 0.5287474393844604, -0.46738186478614807, -0.5075462460517883, -0.05128825828433037, -0.869694709777832, 0.4075707495212555, 1.5233652591705322, 0.27170708775520325, -0.09848013520240784, 0.5513692498207092, 1.160522699356079, 0.6322333216667175, 0.4122702181339264, -0.9004557132720947, -1.3496226072311401, 1.842373251914978, -1.7422679662704468, 1.9107199907302856, 0.5225743651390076, 0.07719534635543823, -1.7361187934875488, -1.7933114767074585, 1.4142223596572876, 1.1666089296340942, 2.0750951766967773, 0.7302842140197754, 0.362295538187027, -1.0069063901901245, -0.7471091747283936, 0.013507131487131119, -0.7212281227111816, -0.7175273895263672, 0.1436820924282074, 2.4596970081329346, 1.8812617063522339, -0.5152201056480408, -0.23248204588890076, -0.7779771685600281, 1.5735712051391602, -0.44393107295036316, 0.5597313046455383, 2.105147123336792, -0.3209473192691803, -0.9538753032684326, 1.2435545921325684, -2.6663520336151123, 0.31033799052238464, 2.0834693908691406, 0.23933829367160797, 0.2893690764904022, -1.369691252708435, -0.8591441512107849, -0.19868499040603638, -0.2632983326911926, -1.2989593744277954, 0.6350231170654297, -0.37822338938713074, -0.6890759468078613, -1.6585431098937988, 0.2645875811576843, -1.1481564044952393, -1.3957691192626953, 0.20978139340877533, 2.116795778274536, 2.33370041847229, -0.9035166501998901, 1.7017323970794678, -0.0450984425842762, 0.4071687161922455, 1.3200325965881348, 1.1266711950302124, 2.735708713531494, 1.6491625308990479, -1.0032590627670288, 0.5296832919120789, -0.198258176445961, -0.5634850859642029, 1.0684152841567993, -0.9416762590408325, 0.923169732093811, -0.18854279816150665, -0.9679070115089417, -1.1848901510238647, 0.8154710531234741, 0.4581984877586365, -0.15889237821102142, -0.31727105379104614, 1.132068157196045, -0.08735710382461548, 1.1095584630966187, 0.8008070588111877, -0.43245929479599, 0.23073267936706543, -0.39066022634506226, -0.6527003049850464, 1.513973593711853, 0.04568418487906456, -1.5557634830474854, -2.0310375690460205, -0.3321830630302429, -0.7149534225463867, -0.003981150686740875, -0.5231021046638489, -1.1075583696365356, 1.3268696069717407, 0.2700504958629608, -0.8578041791915894, -0.12052492797374725, -0.23925937712192535, -0.30466341972351074, 2.5903749465942383, -1.2173889875411987, -0.6186375021934509, -0.8755059838294983, -0.5453535914421082, 1.692326545715332, -1.0344257354736328, -0.09509828686714172, -1.0245099067687988, -0.5405430197715759, -1.4116171598434448, -0.3557369112968445, 0.018797308206558228, -0.8493511080741882, 1.0400471687316895, 0.53924959897995, -1.0473012924194336, -0.19733038544654846, -0.9819484353065491, 0.9356256127357483, -0.21201945841312408, 0.3794046938419342, 1.9143730401992798, 0.24592415988445282, -0.35212576389312744, 1.0672240257263184, 0.9904165863990784, 0.6379030346870422, -0.5847376585006714, 0.04456467553973198, -0.36888736486434937, 0.5502371191978455, -1.3251765966415405, 0.1678374707698822, -3.0021634101867676, 0.5560329556465149, 0.04757125675678253, -0.21168099343776703, 0.03259096294641495, -1.3918957710266113, 1.1990519762039185, 2.2836503982543945, -1.3027212619781494, 0.6816369891166687, 0.35144102573394775, 1.780030608177185, -1.7334165573120117, 0.2551014721393585, -0.33574140071868896, 2.224344491958618, -0.12237654626369476, 1.1033827066421509, -0.5627717971801758, -2.6147634983062744, 0.44807133078575134, -1.3121731281280518, -0.8868577480316162, 0.2762353718280792, -0.983967661857605, 0.2610803544521332, -1.8575050830841064, -0.3219756782054901, -1.0516738891601562, -1.2905241250991821, 0.6805559992790222, 0.20754112303256989, 0.09223964810371399, -0.6711077094078064, 0.40916571021080017, -1.9591987133026123, -1.6213252544403076, -0.09976078569889069, -0.8309386372566223, 0.7128155827522278, -0.5130622982978821, 0.7256041765213013, -0.19191615283489227, 0.016075246036052704, 0.012402176856994629, 1.6393077373504639, 3.4607884883880615, 0.07666626572608948, 0.4248429238796234, -0.1651873141527176, -0.8909862637519836, 1.4250473976135254, 1.0471429824829102, -0.12725111842155457, -0.5215212106704712, -1.310721516609192, 1.5995405912399292, 2.1605889797210693, 0.8098382949829102, 0.06030110642313957, -0.4590573310852051, -0.48626118898391724, -0.04901525005698204, 0.31108900904655457, 0.6034945249557495, 0.7827988862991333, -0.06383323669433594, -0.03564637154340744, 1.2804062366485596, 1.1437050104141235, -0.45733386278152466, 0.23282396793365479, -1.0370900630950928, -0.33036208152770996, 0.5764687657356262, -0.11695538461208344, -0.27666422724723816, 0.29796677827835083, -0.9920639991760254, -0.32125043869018555, -0.27887701988220215, -0.8470279574394226, -0.6173803806304932, -0.29832425713539124, -0.2940479516983032, 1.3711408376693726, 0.662866473197937, -0.7600798010826111, -0.04654046893119812, -0.4665967524051666, 0.02757123112678528, -1.0367671251296997, -0.19848504662513733, -0.36517006158828735, -0.1898564249277115, -0.347881019115448, 1.7182623147964478, -0.8005568981170654, -2.0375001430511475, -0.2796694338321686, 0.7109139561653137, 0.08615852892398834, 0.22085689008235931, 1.7979674339294434, 0.39943405985832214, 1.5202150344848633, 1.3105911016464233, 0.9941486716270447, -0.588855504989624, -1.3333122730255127, 0.5437620282173157, 1.065434217453003, -1.1753830909729004, 0.9985694289207458, -0.03987865149974823, -0.6617847681045532, 0.7114709615707397, 1.5641562938690186, 0.3843977749347687, -2.0338311195373535, 0.8283621072769165, -1.3337544202804565, 0.9880836606025696, 0.8151336312294006, 0.9489843845367432, 0.4618673324584961, 0.7484446167945862, -1.170833945274353, -1.0886307954788208, -1.0118017196655273, -0.7544769048690796, 1.999714970588684, -0.2613314390182495, 0.4727051854133606, 0.14380192756652832, -1.177187442779541, -0.11752419173717499, 0.6047776937484741, 0.48198574781417847, -0.2944885790348053, 0.7799279093742371, -0.8816977739334106, -1.2308366298675537, -1.384286642074585, -0.5045623779296875, -0.921296238899231, -1.1739223003387451, 0.9120798707008362, 0.8869336843490601, 0.3497931659221649, 1.8056848049163818, 0.6239733099937439, 0.022195644676685333, -2.2717931270599365, 1.0064677000045776, 0.38341987133026123, -0.22991272807121277, 0.6526427268981934, 0.35860246419906616, 1.3580431938171387, 0.07801835238933563, 0.5131338238716125, -2.0904736518859863, 2.0168204307556152, -0.1918148398399353, 0.9110592603683472, -0.2544412314891815, 0.03589098900556564, 1.0865144729614258, 0.27302178740501404, 0.6159335374832153, -0.8976901173591614, 0.6634697318077087, -0.4490354061126709, 1.265631079673767, 1.2120436429977417, -0.6891128420829773, 0.08247357606887817, 1.3583465814590454, 0.24121041595935822, -0.9151350855827332, -1.0109142065048218, -0.7468971014022827, 0.8110040426254272, 1.683223843574524, -0.3230952024459839, -0.06730803847312927, 0.751257061958313, 0.4829927682876587, -1.2394057512283325, -0.03552478551864624, -0.4477134943008423, -0.47662800550460815, 1.8672244548797607, 1.9124767780303955, -0.5407620668411255, -0.017595229670405388, -0.7012229561805725, -1.359811782836914, 0.41169312596321106, 0.010918660089373589, -0.039275310933589935, 0.8079891800880432, -0.6619769930839539, 0.8382078409194946, 0.4582497775554657, 0.755919873714447, -0.06176947057247162, 0.40723422169685364, 0.5908074378967285, -0.5816113352775574, -1.015999674797058, -0.3713560104370117, -1.323128581047058, -2.5088090896606445, 0.2483833283185959, -0.08725449442863464, -1.3509176969528198, 0.05461924895644188, -0.8028913140296936, 1.4028664827346802, -0.5008512735366821, -1.3096147775650024, -1.2013263702392578, 0.36571693420410156, 0.003379153087735176, 0.7196602821350098, -1.8659707307815552, -0.02640455588698387, 1.346176266670227, 1.006923794746399, -0.6823351383209229, 1.1534042358398438, 0.4199831485748291, 1.1336147785186768, 0.49673891067504883, -0.2617790699005127, 0.548125147819519, -0.24234925210475922, -1.231021523475647, 0.5937445163726807, 1.2481790781021118, 0.12374459207057953, 1.1449898481369019, -0.3544163107872009, -0.229896679520607, 0.40339747071266174, -0.6072625517845154, -0.3964548408985138, -0.1194494366645813, 0.529465913772583, -0.02983137220144272, -0.659522533416748, 0.06409481167793274, 0.16856524348258972, -0.37237676978111267, 0.18235504627227783, -1.5399448871612549, -0.4603692889213562, -0.48361077904701233, -0.27389785647392273, -1.345397710800171, -0.052252765744924545, 1.3380500078201294, -0.34657883644104004, -0.5661240220069885, 0.6801506280899048, 0.4075225591659546, 0.4019659161567688, 0.49613499641418457, -0.6740727424621582, -0.3160165250301361, -0.1427515149116516, -0.3182160556316376, 0.15561753511428833, 1.3735400438308716, -0.1824052780866623, -1.0693403482437134, 0.5861148834228516, -0.4202447533607483, -0.03749458119273186, 1.5616233348846436, -0.13850590586662292, -0.9364035129547119, 0.17236219346523285, -0.8235859274864197, 2.0371696949005127, 1.6215808391571045, 1.1273256540298462, -0.3123648166656494, -0.7125073075294495, 0.7744702100753784, -0.29810795187950134, -0.4082912504673004, 0.6648777723312378, 0.4170292317867279, -0.23469549417495728, -1.3057574033737183, 0.7458515167236328, 1.103330135345459, -0.7641350030899048, -0.8698608875274658, 0.27755093574523926, -0.7505497932434082, 1.2990787029266357, 0.6271698474884033, 0.35873451828956604, 0.12668558955192566, 1.8335545063018799, 0.823321521282196, -0.6324172616004944, 0.638019859790802, 0.6317809224128723, -0.3578542470932007, -2.0681095123291016, -1.2440842390060425, -0.049162570387125015, -0.3769187331199646, -1.703614354133606, 1.263735294342041, -0.9047343730926514, -0.8303499817848206, 0.6375516057014465, 0.17713096737861633, 1.1259266138076782, 0.60245281457901, 1.2210350036621094, 1.995235800743103, 0.5766533613204956, 0.6655129790306091, 1.2251750230789185, -0.34123340249061584, -0.6605055332183838, 2.0064537525177, -0.3117125332355499, 0.6035587787628174, 1.1675843000411987, -0.344112366437912, -1.1197178363800049, -0.564812421798706, -1.1723580360412598, -0.4816102981567383, 1.1164559125900269, 0.1032504141330719, -1.1336629390716553, 0.3582083284854889, 1.5134493112564087, 0.05320263281464577, -0.557147741317749, 0.8229828476905823, 0.6232264041900635, -0.8435682058334351, -0.006158214528113604, -0.9018478393554688, 0.4512142837047577, -0.36295828223228455, -0.006787247955799103, 0.4980015754699707, 0.47826504707336426, 1.4533435106277466, 0.041242849081754684, 0.2658669948577881, 0.9964186549186707, -1.379381537437439, 1.502646565437317, -0.7593646049499512, 0.3446123003959656, -2.4022364616394043, 1.115346908569336, -0.638698935508728, 2.241152763366699, -2.6454696655273438, 0.4138525426387787, -0.6772058010101318, -0.49838489294052124, 0.22337444126605988, -0.2852790653705597, -0.0573335625231266, 0.07763250172138214, -1.0354361534118652, 0.23989449441432953, -0.5824258327484131, 0.3181394338607788, 1.2873573303222656, 1.328165888786316, -0.9773932099342346, -0.041994865983724594, -1.6645128726959229, -0.16090761125087738, -0.9055221676826477, 0.3309049904346466, -2.207332134246826, -0.3728044927120209, -1.7519558668136597, -2.042253017425537, -1.2198281288146973, -0.8943701982498169, 1.2233117818832397, 0.021686427295207977, -0.9964802265167236, 1.6619693040847778, -0.08980779349803925, -1.7341346740722656, 0.9981814026832581, -1.832716703414917 ]
https://github.com/huggingface/datasets/issues/4477
Dataset Viewer issue for fgrezes/WIESP2022-NER
Apparently it finds `scoring-scripts/compute_seqeval.py` which matches `**eval*`, a regex that detects a test split. We should probably improve the regex because it's not supposed to catch this kind of files. It must also only check for files with supported extensions: txt, csv, png etc.
### Link _No response_ ### Description _No response_ ### Owner _No response_
718
44
Dataset Viewer issue for fgrezes/WIESP2022-NER ### Link _No response_ ### Description _No response_ ### Owner _No response_ Apparently it finds `scoring-scripts/compute_seqeval.py` which matches `**eval*`, a regex that detects a test split. We should probably improve the regex because it's not supposed to catch this kind of files. It must also only check for files with supported extensions: txt, csv, png etc.
[ -1.2126076221466064, -0.8880167007446289, -0.703886866569519, 1.5409204959869385, -0.08956386148929596, -1.4584486484527588, 0.2679319977760315, -0.9799534678459167, 1.7926278114318848, -0.8816244602203369, 0.27219900488853455, -1.6511045694351196, 0.048641741275787354, -0.6136384010314941, -0.7495260834693909, -0.8447443246841431, -0.36802351474761963, -0.7900740504264832, 1.1249772310256958, 2.541234254837036, 1.3154752254486084, -1.2986890077590942, 2.8042240142822266, 0.65838223695755, -0.33549797534942627, -0.8713469505310059, 0.5166619420051575, -0.1319085955619812, -1.2393463850021362, -0.5738875269889832, -0.8726291060447693, -0.2202591896057129, -0.5080512166023254, -0.44981271028518677, 0.049344487488269806, 0.5324480533599854, -0.1466716080904007, -0.506311297416687, -0.49677130579948425, -0.7535520792007446, 0.3529375195503235, -0.41156044602394104, 0.8880453705787659, -0.37775683403015137, 1.9221371412277222, -0.6999145746231079, 0.4156414270401001, 0.5814031958580017, 1.4187192916870117, 0.03912890702486038, -0.11651763319969177, 0.1892796903848648, 0.3757598400115967, -0.16437920928001404, 0.3702940046787262, 1.0920950174331665, 0.5710986256599426, 0.7037236094474792, 0.700608491897583, -2.0727508068084717, 1.3242067098617554, -1.0901696681976318, 0.19948875904083252, 1.3950800895690918, -1.0420684814453125, 0.47430619597435, -1.6344135999679565, -0.0377797968685627, 0.5840497612953186, -2.279289722442627, 0.2529318034648895, -1.213616132736206, -0.5572036504745483, 0.9051930904388428, 0.41397976875305176, -1.4287457466125488, -0.07093672454357147, -0.5364323854446411, 1.0428624153137207, 0.38817328214645386, 1.0490803718566895, -1.7477937936782837, 0.09627438336610794, -0.3649291396141052, -0.04466528818011284, -1.39366614818573, -1.4589345455169678, 0.6942272782325745, 0.6514616012573242, 0.6870756149291992, 0.012654506601393223, 0.9326419830322266, -0.9978973865509033, 0.7541841864585876, -0.9385934472084045, -1.6355140209197998, -1.381003975868225, -2.5073273181915283, -2.2691476345062256, 0.6836650371551514, -0.4372837543487549, -0.6020075082778931, 2.12519907951355, -0.9099311232566833, -1.6409912109375, 1.1671624183654785, -0.002313990145921707, 0.05296195298433304, 2.414283514022827, 0.3153995871543884, -0.6536421179771423, 0.3203071355819702, -0.8286970853805542, 0.8142054080963135, -0.6185717582702637, 1.3010507822036743, 0.3333984613418579, -1.0461584329605103, 1.5128557682037354, -0.421673983335495, 0.6731908321380615, -0.6858202815055847, -0.5172433257102966, -0.8102389574050903, 0.41287240386009216, 1.9142667055130005, -0.2111230343580246, 1.5483593940734863, -0.3680933713912964, -1.5875475406646729, -1.4834060668945312, 0.8636360168457031, 0.4117850363254547, -0.8151006698608398, 0.2549924850463867, -0.4326212704181671, 0.06650976836681366, -0.061632219702005386, 1.1595919132232666, 1.3040597438812256, 0.5479227900505066, -0.3362366855144501, -0.7656679749488831, 0.2753438353538513, -0.10079845041036606, -0.7769439220428467, -1.7670190334320068, -0.368064284324646, -0.04050711914896965, 0.6242673397064209, -1.1591672897338867, 1.7660775184631348, 0.8804882168769836, 2.0648081302642822, 0.9796677231788635, -0.28269532322883606, 1.3123518228530884, -0.06224242225289345, 1.9020603895187378, -0.5508332848548889, 0.7794078588485718, -0.42805829644203186, -1.141381859779358, 0.8561269044876099, -0.41998091340065, -1.907959222793579, -0.8337901830673218, -0.8455155491828918, -0.2353605180978775, -0.6791011691093445, 0.9433391094207764, -0.4158031642436981, -1.3076395988464355, 0.13538888096809387, -0.7464471459388733, 0.25201061367988586, -1.2972795963287354, 0.28225812315940857, 0.7820401191711426, -0.51219242811203, 0.14301688969135284, -0.3182833194732666, -1.2951899766921997, -0.4022155702114105, 0.4105609953403473, 1.9465779066085815, -0.7009553909301758, 0.9191011786460876, 0.8837019801139832, -0.7029812335968018, -0.09855734556913376, 0.2589312791824341, -0.293954461812973, 0.7108100652694702, -1.1912150382995605, -0.3224063515663147, 1.167309045791626, -0.28295549750328064, -0.6054415702819824, 1.4033583402633667, 0.6153421998023987, -1.0331259965896606, -0.10059620440006256, -0.26540109515190125, -0.8510951995849609, 0.09545300155878067, -1.5977712869644165, -0.12471000105142593, 0.3183360993862152, -1.4900964498519897, -0.6002709865570068, -0.12494499236345291, 1.387819528579712, -0.07172374427318573, 1.393195629119873, -0.29790186882019043, -0.1485050469636917, -0.3816673457622528, -0.36836060881614685, 0.23978017270565033, -0.3376961946487427, -0.5672479867935181, 0.19984570145606995, -0.6940175294876099, 0.35602399706840515, 1.5782045125961304, 0.14687621593475342, 0.19923719763755798, 0.47734707593917847, 0.9829908013343811, 0.40803810954093933, -0.1263270378112793, -0.7701061964035034, -1.5063889026641846, 1.929715633392334, -1.5738929510116577, 2.0103535652160645, 0.7851205468177795, -0.06903237849473953, -1.7310082912445068, -1.96047043800354, 1.2029974460601807, 1.2664278745651245, 2.1720266342163086, 0.5334411263465881, 0.2247951626777649, -0.8753095865249634, -0.7430355548858643, 0.18362344801425934, -1.1275355815887451, -0.6751221418380737, 0.09479384124279022, 2.2791032791137695, 1.7327373027801514, -0.497019499540329, -0.13155539333820343, -1.0447008609771729, 1.2083983421325684, -0.13142313063144684, 0.2745303809642792, 2.0322587490081787, -0.29528215527534485, -0.9754062294960022, 1.0941227674484253, -2.2888243198394775, 0.24828019738197327, 2.057368040084839, 0.3448982834815979, 0.17560222744941711, -1.5193711519241333, -0.6372564435005188, -0.3630664348602295, -0.11643612384796143, -1.1890116930007935, 0.7555798888206482, -0.21492315828800201, -0.7787096500396729, -1.4591401815414429, 0.22765815258026123, -1.0050137042999268, -1.6791950464248657, 0.3417096436023712, 1.9922800064086914, 2.079941511154175, -0.8446458578109741, 1.506043791770935, -0.22534923255443573, 0.07301121205091476, 1.307711124420166, 1.0477879047393799, 3.084653377532959, 2.029284954071045, -1.0543150901794434, 0.6811934113502502, -0.11783991754055023, -0.3975179195404053, 1.111281394958496, -1.080489993095398, 1.2898770570755005, -0.23913134634494781, -1.15725576877594, -1.2809839248657227, 0.8560106158256531, 0.4617995023727417, -0.048536062240600586, -0.4204182028770447, 1.4341557025909424, 0.007811828516423702, 1.297760248184204, 0.49567312002182007, -0.3911285698413849, 0.6409865021705627, -0.45457080006599426, -0.37234124541282654, 1.5357496738433838, 0.42523083090782166, -1.5200120210647583, -2.2093162536621094, -0.1595178246498108, -0.9388318657875061, 0.06657350063323975, -0.7467591762542725, -1.0076934099197388, 1.6601141691207886, 0.5253018736839294, -1.0927220582962036, -0.28282907605171204, -0.28784865140914917, -0.6576387882232666, 2.863093376159668, -1.5010515451431274, -0.338205486536026, -0.9806565642356873, -0.5400955080986023, 1.7475697994232178, -1.4648349285125732, -0.273813396692276, -1.062727928161621, -0.5348511338233948, -1.0987281799316406, -0.39618659019470215, -0.10664797574281693, -0.8797345757484436, 0.8731161952018738, 0.14943617582321167, -1.1959726810455322, -0.28145831823349, -0.8092909455299377, 0.9382592439651489, -0.021913014352321625, 0.3097420334815979, 1.911257266998291, 0.20264898240566254, -0.38945868611335754, 0.8052955269813538, 1.2632166147232056, 0.6398875117301941, -0.7414166927337646, 0.1313622146844864, -0.5103656649589539, 0.40656739473342896, -1.2059142589569092, 0.3979600667953491, -2.878173351287842, 0.4910815954208374, -0.13521349430084229, -0.18224556744098663, -0.09272928535938263, -1.4430906772613525, 1.1009955406188965, 2.4785306453704834, -1.1179778575897217, 0.5451536178588867, 0.29497194290161133, 1.3595595359802246, -1.5244511365890503, 0.4683157503604889, -0.5204414129257202, 2.157644748687744, 0.1982754021883011, 1.1790860891342163, -0.5317534804344177, -2.299626350402832, 0.6415243744850159, -1.2438699007034302, -1.139403223991394, 0.8250443339347839, -0.9138805270195007, -0.05486837774515152, -1.3404436111450195, -0.21115371584892273, -0.8405698537826538, -1.3777142763137817, 0.621945321559906, 0.14708197116851807, 0.44565343856811523, -0.6388053894042969, 0.2388354390859604, -2.126600980758667, -1.4167304039001465, -0.31786566972732544, -0.8929809331893921, 0.3242899775505066, -0.48538339138031006, 0.5811461210250854, -0.23126745223999023, 0.1451924443244934, 0.28830572962760925, 1.5504798889160156, 3.339716911315918, 0.07610926032066345, 0.47043341398239136, -0.31943845748901367, -0.9021750688552856, 1.4001864194869995, 1.016189694404602, -0.026867613196372986, -0.6698282957077026, -0.9078764319419861, 1.2932342290878296, 1.9688395261764526, 0.9397150278091431, -0.06033839285373688, -0.793678343296051, -0.6170099377632141, -0.13655951619148254, 0.2451067566871643, 0.43268874287605286, 0.9754495620727539, 0.10155857354402542, 0.081532783806324, 1.4214246273040771, 1.116763710975647, -0.642142117023468, 0.3715861141681671, -0.9196546077728271, -0.39357075095176697, 0.43715864419937134, 0.45120131969451904, -0.02256953902542591, 0.2186097353696823, -0.8458665609359741, -0.3053179979324341, -0.2530350983142853, -0.8819716572761536, -0.8088210225105286, -0.37676355242729187, -0.3363529443740845, 1.7208455801010132, 0.141226127743721, -0.5685608983039856, 0.051941823214292526, -0.6878129839897156, 0.012437759898602962, -1.1457825899124146, 0.1546686738729477, -0.07030095160007477, -0.13987226784229279, 0.031817950308322906, 1.8250951766967773, -1.1401429176330566, -2.2899625301361084, 0.24910613894462585, 0.22388312220573425, -0.26502010226249695, 0.10100729763507843, 1.5957685708999634, 0.47439101338386536, 1.5539741516113281, 1.3177262544631958, 1.0926584005355835, -0.8056778907775879, -1.4718881845474243, 0.6726095676422119, 1.029943585395813, -1.5524556636810303, 0.8784473538398743, -0.01966109126806259, -0.45654863119125366, 0.6558778285980225, 1.319642186164856, 0.48682549595832825, -2.028907537460327, 0.7877951860427856, -1.0896474123001099, 0.9825794696807861, 0.9070557951927185, 0.8662019371986389, 0.43793630599975586, 0.7461057305335999, -1.1209805011749268, -1.2673918008804321, -0.8146325945854187, -0.7000052332878113, 2.029244899749756, -0.3181377351284027, 0.6810235381126404, -0.14743457734584808, -1.3160827159881592, -0.014053959399461746, 0.6341271996498108, 0.36540451645851135, -0.33030882477760315, 0.8150134086608887, -0.7897014617919922, -1.010150671005249, -1.3597798347473145, -0.6984027624130249, -1.0429558753967285, -1.1722869873046875, 1.131550669670105, 0.8397002220153809, 0.4794255197048187, 1.9991824626922607, 0.637597918510437, 0.39769747853279114, -2.48432993888855, 0.9535254240036011, 0.2911573350429535, 0.1445121169090271, 0.7172307968139648, 0.34069857001304626, 1.0440783500671387, 0.044725559651851654, 0.4211988151073456, -2.4093832969665527, 2.367621898651123, -0.33970046043395996, 0.5533139109611511, 0.033010274171829224, -0.05382462963461876, 1.1018229722976685, 0.5658957362174988, 0.4710474908351898, -1.017547607421875, 0.6649117469787598, -0.5139545202255249, 1.305658221244812, 0.7800590991973877, -0.7958780527114868, 0.005590060725808144, 1.3051247596740723, 0.5069109201431274, -0.6225913166999817, -0.9498769044876099, -0.9860842823982239, 0.8335148096084595, 1.5820252895355225, 0.03025127202272415, 0.013780512847006321, 0.7425262331962585, 0.43555498123168945, -1.0863267183303833, 0.07789444923400879, -0.7558156251907349, -0.7882688641548157, 1.529509425163269, 1.9484349489212036, -0.1447254866361618, -0.06883656978607178, -0.7005687952041626, -1.2451934814453125, 0.672631561756134, -0.06098269671201706, -0.08542466908693314, 0.5368526577949524, -0.6021994948387146, 0.9663912057876587, 0.8321433067321777, 0.9718936085700989, 0.038510046899318695, 0.3347763121128082, 0.5059511065483093, -0.28366991877555847, -1.1903743743896484, -0.3403002917766571, -1.148559808731079, -2.5773513317108154, 0.34034818410873413, -0.4430760443210602, -1.425508737564087, 0.09630569070577621, -1.1753313541412354, 0.9358604550361633, -0.6225348711013794, -1.0882855653762817, -1.5544339418411255, 0.12731514871120453, -0.19347265362739563, 0.8743553161621094, -1.5971390008926392, -0.0705057829618454, 1.1588611602783203, 0.8107244968414307, -0.7544850707054138, 1.1339783668518066, 0.24762585759162903, 1.1118521690368652, 0.7986227869987488, -0.30179011821746826, 0.4351811408996582, 0.0972028598189354, -1.3336575031280518, 0.6339448690414429, 1.297093152999878, 0.1305272877216339, 1.414260983467102, -0.5686416625976562, 0.029849302023649216, 0.40895792841911316, -0.541592001914978, -0.5140711665153503, -0.5605226755142212, 0.8324982523918152, 0.1767089068889618, -0.8534730672836304, -0.027386415749788284, -0.287235826253891, -0.27445873618125916, 0.29994404315948486, -1.5596996545791626, -0.19064611196517944, -0.4144502878189087, -0.6117460131645203, -1.3070385456085205, 0.016711052507162094, 1.415986180305481, -0.520138144493103, -0.28065750002861023, 0.5220842957496643, 0.4886569678783417, 0.38348427414894104, 0.6509453058242798, -0.7071641087532043, -0.10948727279901505, -0.22641658782958984, -0.32053858041763306, 0.4619627892971039, 1.3504137992858887, -0.10332868993282318, -1.0217121839523315, 0.727030336856842, -0.4138345718383789, 0.15667225420475006, 1.975205421447754, 0.14087152481079102, -0.8623526692390442, 0.22906437516212463, -0.7691007256507874, 2.0703847408294678, 1.5496174097061157, 1.1789647340774536, -0.024240003898739815, -0.9425131678581238, 0.7492825984954834, -0.13962425291538239, -0.3825206458568573, 0.6703517436981201, 0.39812737703323364, -0.4283900856971741, -1.3852914571762085, 0.6302298903465271, 1.279950499534607, -0.730638861656189, -0.9521003365516663, 0.08027222007513046, -0.7847191691398621, 1.1189494132995605, 0.7000104188919067, 0.43649035692214966, 0.3116133511066437, 1.6653472185134888, 0.7823701500892639, -0.5017243027687073, 0.45328423380851746, 0.4694547951221466, -0.05434804409742355, -2.028291940689087, -1.0356391668319702, 0.40180811285972595, -0.4962124824523926, -1.5745608806610107, 1.4067027568817139, -1.062023639678955, -0.9760047793388367, 0.5065588355064392, 0.20504921674728394, 1.439809799194336, 0.33674854040145874, 1.4817616939544678, 1.9281680583953857, 0.9212448596954346, 0.4333993196487427, 1.2871973514556885, -0.2694481313228607, -0.5709831118583679, 1.7815419435501099, -0.42590850591659546, 0.3786194622516632, 1.1150858402252197, -0.3684352934360504, -1.0694613456726074, -0.6878939867019653, -1.101304054260254, -0.6018970608711243, 1.083878517150879, 0.21930304169654846, -1.1016639471054077, 0.3650916516780853, 1.484084129333496, 0.11567629873752594, -0.30853188037872314, 0.4782634973526001, 0.4832048714160919, -0.9211204051971436, -0.0656328797340393, -1.0037342309951782, 0.4489496946334839, -0.1625196486711502, -0.3529633581638336, 0.4613671600818634, 0.5596490502357483, 1.203750491142273, -0.020080463960766792, 0.19001835584640503, 1.077451467514038, -1.4056553840637207, 1.4378292560577393, -0.5652824640274048, 0.16456761956214905, -2.3443005084991455, 1.4059698581695557, -0.5685644745826721, 1.9087492227554321, -2.6990294456481934, 0.4001427888870239, -0.4956255257129669, -0.45526087284088135, 0.37958335876464844, -0.33841902017593384, 0.20723441243171692, -0.21482868492603302, -1.1651382446289062, -0.03663388639688492, -0.6916146874427795, 0.588241457939148, 1.0791511535644531, 1.3167951107025146, -0.9883916974067688, -0.09773603826761246, -1.7046877145767212, 0.014466491527855396, -0.7841317057609558, 0.23391930758953094, -2.0444133281707764, -0.1504034698009491, -1.858608603477478, -2.1975491046905518, -1.2849771976470947, -0.6179327964782715, 1.060067892074585, 0.3462076783180237, -0.7166429162025452, 1.2551243305206299, -0.22518962621688843, -1.732407569885254, 0.985160231590271, -2.034715175628662 ]
https://github.com/huggingface/datasets/issues/4476
`to_pandas` doesn't take into account format.
Thanks for opening a discussion :) Note that you can use `.remove_columns(...)` to keep only the ones you're interested in before calling `.to_pandas()`
**Is your feature request related to a problem? Please describe.** I have a large dataset that I need to convert part of to pandas to do some further analysis. Calling `to_pandas` directly on it is expensive. So I thought I could simply select the columns that I want and then call `to_pandas`. **Describe the solution you'd like** ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format(columns=['a', 'b']).to_pandas() # I would expect `pandas_df` to only include a,b as column. ``` **Describe alternatives you've considered** I could remove all columns that I don't want? But I don't know all of them in advance. **Additional context** I can probably make a PR with some pointers.
719
23
`to_pandas` doesn't take into account format. **Is your feature request related to a problem? Please describe.** I have a large dataset that I need to convert part of to pandas to do some further analysis. Calling `to_pandas` directly on it is expensive. So I thought I could simply select the columns that I want and then call `to_pandas`. **Describe the solution you'd like** ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format(columns=['a', 'b']).to_pandas() # I would expect `pandas_df` to only include a,b as column. ``` **Describe alternatives you've considered** I could remove all columns that I don't want? But I don't know all of them in advance. **Additional context** I can probably make a PR with some pointers. Thanks for opening a discussion :) Note that you can use `.remove_columns(...)` to keep only the ones you're interested in before calling `.to_pandas()`
[ -1.2285499572753906, -0.9941014647483826, -0.7137067914009094, 1.4171156883239746, -0.1901659071445465, -1.285842776298523, 0.16712673008441925, -1.1423537731170654, 1.8069391250610352, -0.7907490134239197, 0.2956449091434479, -1.6465954780578613, -0.00011318642646074295, -0.724597156047821, -0.8444917798042297, -0.7598136067390442, -0.35117021203041077, -0.8233307003974915, 0.9276906847953796, 2.5307490825653076, 1.0344446897506714, -1.5152628421783447, 2.6534950733184814, 0.7092322111129761, -0.09408944845199585, -1.0334817171096802, 0.48471471667289734, 0.07333719730377197, -1.148539423942566, -0.4774733781814575, -0.9676565527915955, -0.11263923346996307, -0.5769987106323242, -0.5496869087219238, 0.022884413599967957, 0.3847412168979645, -0.25349417328834534, -0.4800267815589905, -0.5018460750579834, -0.7099851369857788, 0.4441489279270172, -0.4338530898094177, 0.9949278235435486, -0.3561559319496155, 1.81048583984375, -0.5515767335891724, 0.513634443283081, 0.7541128993034363, 1.383115291595459, 0.21036094427108765, -0.027048448100686073, 0.37203076481819153, 0.45137646794319153, -0.03557091951370239, 0.5490635633468628, 1.0688021183013916, 0.6309203505516052, 0.5007941126823425, 0.8024869561195374, -2.257598876953125, 1.3104207515716553, -1.199014663696289, 0.39332297444343567, 1.3905061483383179, -0.9021390080451965, 0.3724649250507355, -1.8302841186523438, 0.019229233264923096, 0.6349095702171326, -2.2919607162475586, 0.25451335310935974, -1.3540124893188477, -0.5268661379814148, 0.9923895001411438, 0.3808692991733551, -1.3195867538452148, 0.19461016356945038, -0.43835747241973877, 0.9573200941085815, 0.3898054361343384, 1.0112189054489136, -1.7334511280059814, -0.03131721168756485, -0.2753533720970154, 0.09848478436470032, -1.2323111295700073, -1.4359455108642578, 0.655044674873352, 0.557684063911438, 0.6060971617698669, -0.11504136025905609, 0.9061734080314636, -1.0665345191955566, 0.785021185874939, -1.052147626876831, -1.685543179512024, -1.4817719459533691, -2.186876058578491, -2.266879081726074, 0.8151015043258667, -0.3962544798851013, -0.4527818560600281, 1.9603257179260254, -0.9534890055656433, -1.6915950775146484, 1.1560993194580078, 0.3239401876926422, 0.008934326469898224, 2.3649978637695312, 0.19198434054851532, -0.6535473465919495, 0.4520874619483948, -0.8307077288627625, 0.8195364475250244, -0.4233274757862091, 1.454365849494934, 0.4992923140525818, -0.9823154807090759, 1.746294379234314, -0.3993227779865265, 0.5140450596809387, -0.6524653434753418, -0.5572205185890198, -0.8446203470230103, 0.4235190749168396, 1.9881138801574707, -0.21867096424102783, 1.491959571838379, -0.4245511591434479, -1.5661158561706543, -1.553783655166626, 0.9533207416534424, 0.48398277163505554, -0.9323572516441345, 0.10232684016227722, -0.48670533299446106, 0.19553059339523315, -0.11144587397575378, 1.2067408561706543, 1.2418237924575806, 0.723971426486969, -0.2618245482444763, -0.8275246620178223, 0.187404066324234, -0.11731137335300446, -0.7995709776878357, -1.817156195640564, -0.4217365086078644, 0.0876208245754242, 0.6791973114013672, -1.1642124652862549, 1.7267482280731201, 0.827267050743103, 1.8804147243499756, 1.0456221103668213, -0.3823607563972473, 1.5203118324279785, 0.03957986831665039, 1.9334278106689453, -0.5930271744728088, 0.7187997698783875, -0.3220329284667969, -0.9980059862136841, 0.8721190094947815, -0.4098173975944519, -2.1460137367248535, -0.6976358294487, -0.8361950516700745, -0.19774015247821808, -0.7378343343734741, 0.8295257687568665, -0.34143292903900146, -1.362879991531372, 0.23743286728858948, -0.7298115491867065, 0.2052304893732071, -1.1264413595199585, 0.343871533870697, 0.8196424841880798, -0.6134210824966431, 0.06791917979717255, -0.22771887481212616, -1.3443585634231567, -0.43579697608947754, 0.304882675409317, 1.9580174684524536, -0.7680482864379883, 0.8897632956504822, 0.9467225074768066, -0.6382518410682678, -0.14138804376125336, 0.3341679871082306, -0.2726825177669525, 0.8229189515113831, -1.0609227418899536, -0.4691525399684906, 1.1588351726531982, -0.20065557956695557, -0.43766286969184875, 1.478890061378479, 0.7926770448684692, -1.003944754600525, -0.13833832740783691, -0.23715831339359283, -0.8386902809143066, 0.06514261662960052, -1.5646703243255615, -0.15667544305324554, 0.4239487648010254, -1.5263022184371948, -0.5171633362770081, -0.1272028386592865, 1.2805635929107666, -0.11584877967834473, 1.3371169567108154, -0.37192344665527344, -0.2844409644603729, -0.32133200764656067, -0.41304251551628113, 0.2466612160205841, -0.29055875539779663, -0.6620866656303406, 0.1411556601524353, -0.6807396411895752, 0.45584094524383545, 1.3978990316390991, 0.32131126523017883, 0.030139420181512833, 0.5846494436264038, 1.0687780380249023, 0.32087552547454834, 0.07132074236869812, -0.7846704721450806, -1.6059622764587402, 2.0453946590423584, -1.4451439380645752, 1.9406259059906006, 0.602641224861145, -0.08871020376682281, -1.6965166330337524, -1.8130781650543213, 1.3486406803131104, 1.2593708038330078, 2.2137930393218994, 0.5874108672142029, 0.3281129002571106, -0.8815704584121704, -0.591903030872345, 0.2821059226989746, -1.0019451379776, -0.7318062782287598, 0.0581912137567997, 2.3278391361236572, 1.7972742319107056, -0.5684041380882263, -0.22730214893817902, -1.0240695476531982, 1.5730737447738647, -0.30918189883232117, 0.27328452467918396, 2.022407054901123, -0.3169741630554199, -1.178889274597168, 1.3171236515045166, -2.3701024055480957, 0.19382663071155548, 1.9585810899734497, 0.3172021806240082, 0.14227907359600067, -1.4947742223739624, -0.5815230011940002, -0.3094038963317871, -0.3569123446941376, -1.243739128112793, 0.5313356518745422, -0.23592086136341095, -0.7761544585227966, -1.491303563117981, 0.18431751430034637, -1.1410210132598877, -1.5901944637298584, 0.23967589437961578, 1.9178186655044556, 2.025779962539673, -0.642629086971283, 1.5499783754348755, -0.27070072293281555, 0.24423041939735413, 1.2918730974197388, 1.19229257106781, 3.106147527694702, 1.8901087045669556, -1.1412856578826904, 0.6276201605796814, -0.22629760205745697, -0.5654188990592957, 1.1065387725830078, -1.095566749572754, 1.223371982574463, -0.06576091796159744, -1.069672703742981, -1.1590687036514282, 0.9357300996780396, 0.512929379940033, 0.02771550416946411, -0.46417006850242615, 1.1956596374511719, -0.08032061159610748, 1.3129968643188477, 0.5264549255371094, -0.38970404863357544, 0.5343671441078186, -0.42286333441734314, -0.5388345122337341, 1.5927653312683105, 0.2294924259185791, -1.405434012413025, -2.2989892959594727, -0.18229350447654724, -0.8266607522964478, 0.03788246586918831, -0.5834025740623474, -1.0300920009613037, 1.6885629892349243, 0.4409830868244171, -1.2452727556228638, -0.22324973344802856, -0.31150493025779724, -0.6085407733917236, 2.7003238201141357, -1.3329887390136719, -0.36662083864212036, -0.9621344208717346, -0.5758251547813416, 1.6823753118515015, -1.2391772270202637, -0.18047621846199036, -1.0041797161102295, -0.5698254704475403, -1.22427237033844, -0.5302019119262695, -0.10491824150085449, -0.8949867486953735, 0.9376223683357239, 0.12787799537181854, -1.139276146888733, -0.3707858920097351, -0.921654462814331, 0.8150745630264282, -0.1388811618089676, 0.27114465832710266, 1.839823603630066, 0.3273240625858307, -0.3816854655742645, 0.7529323697090149, 1.2351601123809814, 0.6605476140975952, -0.6119329929351807, 0.2382989525794983, -0.5833389759063721, 0.34468433260917664, -1.2931041717529297, 0.29746872186660767, -2.908437490463257, 0.5995062589645386, -0.015857670456171036, -0.15089021623134613, -0.026569439098238945, -1.410136342048645, 1.1105730533599854, 2.5416617393493652, -1.1905345916748047, 0.47188040614128113, 0.251928448677063, 1.2672619819641113, -1.5846920013427734, 0.358323335647583, -0.29549428820610046, 2.1617915630340576, 0.2768441140651703, 1.1421846151351929, -0.4704896807670593, -2.3574931621551514, 0.6140437126159668, -1.2201513051986694, -1.2243098020553589, 0.5710522532463074, -0.8930141925811768, 0.07432237267494202, -1.537950873374939, -0.21096067130565643, -0.8742285966873169, -1.1920011043548584, 0.7715998888015747, 0.2089383602142334, 0.4202492833137512, -0.6080846190452576, 0.3244476318359375, -2.1693665981292725, -1.3792155981063843, -0.1653783768415451, -0.9801070094108582, 0.5960833430290222, -0.2660474181175232, 0.674105167388916, -0.06980365514755249, 0.01454959250986576, 0.2842976152896881, 1.6007533073425293, 3.456449508666992, 0.11293007433414459, 0.41140860319137573, -0.2155035436153412, -0.7897149920463562, 1.4051342010498047, 0.952362596988678, -0.06054159253835678, -0.6332566738128662, -1.0735816955566406, 1.3295066356658936, 1.9627124071121216, 0.9611431360244751, 0.038129862397909164, -0.7765920758247375, -0.6132287979125977, -0.08783173561096191, 0.18144039809703827, 0.44222772121429443, 0.9278346300125122, 0.11861082911491394, 0.01433262974023819, 1.377388834953308, 1.2622188329696655, -0.515697717666626, 0.39419353008270264, -0.8193550109863281, -0.4318097233772278, 0.513321578502655, 0.2982887327671051, -0.056543558835983276, 0.286696195602417, -0.9831354022026062, -0.13825206458568573, -0.32190096378326416, -0.8854811787605286, -0.7444009780883789, -0.49130815267562866, -0.3799292743206024, 1.664354920387268, 0.21753144264221191, -0.5725529789924622, -0.05550549551844597, -0.7447121739387512, -0.07199465483427048, -0.993611752986908, 0.15775108337402344, -0.11355344951152802, -0.15953654050827026, -0.1532149612903595, 1.7826582193374634, -0.8375401496887207, -1.9679486751556396, 0.15103399753570557, 0.2545742690563202, -0.3418757915496826, 0.2198660671710968, 1.5492157936096191, 0.49724817276000977, 1.4342952966690063, 1.4098048210144043, 0.9020437002182007, -0.6031026244163513, -1.2987260818481445, 0.6127364635467529, 0.8955609798431396, -1.3867104053497314, 0.7954765558242798, 0.08570805191993713, -0.4354424476623535, 0.7262964248657227, 1.3835911750793457, 0.4242975115776062, -1.9866414070129395, 0.8143290877342224, -0.973033607006073, 0.90431809425354, 0.699720025062561, 0.6643814444541931, 0.3697168231010437, 0.8595963716506958, -1.2479296922683716, -1.1527997255325317, -0.9335532188415527, -0.7375965714454651, 2.098737955093384, -0.275515079498291, 0.5894734263420105, -0.06142888590693474, -1.3515956401824951, -0.13696464896202087, 0.7241633534431458, 0.5308200120925903, -0.3821515738964081, 0.745888888835907, -0.7161161303520203, -1.1526333093643188, -1.3657703399658203, -0.4952455759048462, -0.9793904423713684, -0.9305802583694458, 1.0307453870773315, 0.9127680659294128, 0.3551294207572937, 1.8727115392684937, 0.6331795454025269, 0.22709745168685913, -2.6087918281555176, 0.8083723783493042, 0.24153605103492737, -0.10464274883270264, 0.8418392539024353, 0.3362194299697876, 1.08674955368042, -0.0838676244020462, 0.5386411547660828, -2.4065191745758057, 2.2203855514526367, -0.18764600157737732, 0.7451221346855164, -0.07201278209686279, -0.07428587973117828, 1.1691656112670898, 0.5482980012893677, 0.5193249583244324, -1.0624089241027832, 0.5885072350502014, -0.5836564898490906, 1.2931700944900513, 0.917901873588562, -0.7534246444702148, -0.11884385347366333, 1.3025814294815063, 0.4293496310710907, -0.6147725582122803, -1.0492686033248901, -1.0485719442367554, 0.9413272738456726, 1.726454257965088, -0.20934349298477173, -0.16214509308338165, 0.7568540573120117, 0.7131645083427429, -1.2638006210327148, 0.051370568573474884, -0.7987226843833923, -0.7596210837364197, 1.6291682720184326, 2.1634202003479004, -0.2146407961845398, -0.12870648503303528, -0.7079046368598938, -1.333877444267273, 0.6794862747192383, 0.03572654724121094, 0.059807632118463516, 0.5458152294158936, -0.5774590969085693, 1.1256814002990723, 0.8719800114631653, 0.8597983121871948, 0.15780995786190033, 0.4044795632362366, 0.3893675208091736, -0.32615938782691956, -1.1721609830856323, -0.428924024105072, -1.1900655031204224, -2.5507757663726807, 0.4758666753768921, -0.33042776584625244, -1.4377020597457886, -0.021891843527555466, -1.006645917892456, 0.9427414536476135, -0.6072158217430115, -1.0932247638702393, -1.4789150953292847, 0.20105579495429993, 0.04682459682226181, 0.9486128687858582, -1.6238555908203125, -0.023196246474981308, 1.2514170408248901, 0.8560100197792053, -0.6058105826377869, 0.9791663885116577, 0.348182737827301, 1.0244925022125244, 0.7751089334487915, -0.4496612548828125, 0.5070511102676392, 0.028347153216600418, -1.3025140762329102, 0.6406931281089783, 1.1619348526000977, 0.10645532608032227, 1.4094237089157104, -0.5508020520210266, 0.04785614088177681, 0.4029466509819031, -0.5761452317237854, -0.39261701703071594, -0.5235711932182312, 0.6988487243652344, 0.08073411881923676, -0.8459529280662537, -0.021265801042318344, 0.0639130026102066, -0.3295402526855469, 0.16726307570934296, -1.5244920253753662, -0.22108131647109985, -0.3435675799846649, -0.5296643972396851, -1.189061164855957, -0.17068947851657867, 1.3539754152297974, -0.6896814107894897, -0.16160699725151062, 0.5732163190841675, 0.5085852146148682, 0.5163488984107971, 0.6416502594947815, -0.6125479936599731, -0.3928006887435913, -0.28295648097991943, -0.33698952198028564, 0.22347815334796906, 1.2509511709213257, -0.17635054886341095, -0.9864470958709717, 0.6346564292907715, -0.3864460289478302, -0.05783071368932724, 1.8449318408966064, 0.010357173159718513, -0.8140801191329956, 0.3331715762615204, -0.7568796277046204, 1.9601448774337769, 1.7188682556152344, 1.1752842664718628, -0.07967782020568848, -0.9269413948059082, 0.5691547393798828, -0.3648258149623871, -0.35774561762809753, 0.8410033583641052, 0.4441889226436615, -0.15937717258930206, -1.3772203922271729, 0.7472980618476868, 1.2896227836608887, -0.9273781776428223, -0.8544050455093384, 0.08288103342056274, -0.7655833959579468, 1.0758171081542969, 0.671879768371582, 0.447043240070343, 0.2883554995059967, 1.7663450241088867, 0.659482479095459, -0.4299471974372864, 0.5615534782409668, 0.5837824940681458, -0.24069170653820038, -2.1630778312683105, -1.300968885421753, 0.23926469683647156, -0.5353972315788269, -1.6313213109970093, 1.318406343460083, -1.045573115348816, -0.8423716425895691, 0.5728051066398621, 0.1383294016122818, 1.4349639415740967, 0.42331457138061523, 1.5416585206985474, 2.021263599395752, 0.8116540908813477, 0.37735530734062195, 1.294465184211731, -0.13965533673763275, -0.5482848882675171, 1.8926795721054077, -0.35923436284065247, 0.5248265862464905, 1.1141196489334106, -0.3088795840740204, -1.0839072465896606, -0.7437467575073242, -1.1356406211853027, -0.7171922326087952, 1.146767497062683, 0.10013066232204437, -1.2108628749847412, 0.17288407683372498, 1.5933700799942017, 0.05350189283490181, -0.3756122291088104, 0.5336161255836487, 0.3102833926677704, -0.7799245715141296, -0.050159163773059845, -0.9936589002609253, 0.4941555857658386, -0.23985670506954193, -0.3787149488925934, 0.3880615532398224, 0.5088064670562744, 1.2300337553024292, -0.11647555232048035, 0.1613903045654297, 1.0919595956802368, -1.5250368118286133, 1.4787473678588867, -0.6734311580657959, 0.30243822932243347, -2.296694755554199, 1.385985255241394, -0.7178747057914734, 2.0199105739593506, -2.687373638153076, 0.36717113852500916, -0.6123077869415283, -0.4143681824207306, 0.3216826617717743, -0.23732714354991913, 0.15464907884597778, -0.1020929217338562, -1.2507364749908447, 0.040552739053964615, -0.715677797794342, 0.5023449063301086, 1.036117434501648, 1.3301922082901, -1.1573207378387451, -0.22110708057880402, -1.6572097539901733, -0.14583316445350647, -0.6565443873405457, 0.3202568292617798, -2.0458812713623047, -0.10520972311496735, -1.8568490743637085, -2.181457042694092, -1.3910101652145386, -0.7233978509902954, 1.1259366273880005, -0.023104077205061913, -0.8163379430770874, 1.234088659286499, -0.2620463967323303, -1.772896647453308, 1.0580723285675049, -2.1172702312469482 ]
https://github.com/huggingface/datasets/issues/4476
`to_pandas` doesn't take into account format.
Yes I can do that thank you! Do you think that conceptually my example should work? If not, I'm happy to close this issue. If yes, I can start working on it.
**Is your feature request related to a problem? Please describe.** I have a large dataset that I need to convert part of to pandas to do some further analysis. Calling `to_pandas` directly on it is expensive. So I thought I could simply select the columns that I want and then call `to_pandas`. **Describe the solution you'd like** ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format(columns=['a', 'b']).to_pandas() # I would expect `pandas_df` to only include a,b as column. ``` **Describe alternatives you've considered** I could remove all columns that I don't want? But I don't know all of them in advance. **Additional context** I can probably make a PR with some pointers.
719
32
`to_pandas` doesn't take into account format. **Is your feature request related to a problem? Please describe.** I have a large dataset that I need to convert part of to pandas to do some further analysis. Calling `to_pandas` directly on it is expensive. So I thought I could simply select the columns that I want and then call `to_pandas`. **Describe the solution you'd like** ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format(columns=['a', 'b']).to_pandas() # I would expect `pandas_df` to only include a,b as column. ``` **Describe alternatives you've considered** I could remove all columns that I don't want? But I don't know all of them in advance. **Additional context** I can probably make a PR with some pointers. Yes I can do that thank you! Do you think that conceptually my example should work? If not, I'm happy to close this issue. If yes, I can start working on it.
[ -1.2377057075500488, -1.0161147117614746, -0.7421196699142456, 1.394836664199829, -0.22616198658943176, -1.2589770555496216, 0.1772058755159378, -1.1560566425323486, 1.7838672399520874, -0.8101962208747864, 0.29345059394836426, -1.6665434837341309, -0.00024617183953523636, -0.7390065789222717, -0.8476212024688721, -0.777553915977478, -0.3344884216785431, -0.8741918206214905, 0.9481724500656128, 2.52964186668396, 1.0023149251937866, -1.5317314863204956, 2.658311605453491, 0.6927798986434937, -0.08713863044977188, -1.0465726852416992, 0.5232529640197754, 0.0757269561290741, -1.1325407028198242, -0.4745253920555115, -0.9761667251586914, -0.1007162407040596, -0.5849283337593079, -0.4964710772037506, -0.002794909756630659, 0.3844354748725891, -0.19433839619159698, -0.4320452809333801, -0.47982773184776306, -0.6873029470443726, 0.44776222109794617, -0.4473463296890259, 1.022605061531067, -0.3788435459136963, 1.8570624589920044, -0.543144941329956, 0.4479781687259674, 0.7794509530067444, 1.3900141716003418, 0.24169906973838806, 0.02327357977628708, 0.3059578239917755, 0.46226391196250916, -0.06821884214878082, 0.5107142329216003, 1.033693790435791, 0.6246916651725769, 0.5243362784385681, 0.782873272895813, -2.238581895828247, 1.3311904668807983, -1.1804569959640503, 0.41025716066360474, 1.4270726442337036, -0.8961220383644104, 0.37378165125846863, -1.8319011926651, 0.00017281435430049896, 0.6319097876548767, -2.290876626968384, 0.2650770843029022, -1.3262783288955688, -0.5532324910163879, 0.9727296829223633, 0.38470888137817383, -1.3349436521530151, 0.2064022719860077, -0.4283946752548218, 0.9546427726745605, 0.41660749912261963, 1.0204620361328125, -1.7247090339660645, -0.04130592569708824, -0.2825639247894287, 0.12000925093889236, -1.28042471408844, -1.450168251991272, 0.6543809175491333, 0.5340095162391663, 0.5926130414009094, -0.141561821103096, 0.9208933115005493, -1.1057214736938477, 0.8046732544898987, -1.031730055809021, -1.6488765478134155, -1.4925628900527954, -2.213303565979004, -2.2601099014282227, 0.8246694207191467, -0.3962838053703308, -0.4653143584728241, 1.9434961080551147, -0.9983932375907898, -1.669301986694336, 1.1804144382476807, 0.2950563132762909, 0.006283667869865894, 2.388453960418701, 0.2127980887889862, -0.6591132879257202, 0.4513176381587982, -0.8511797785758972, 0.8443059921264648, -0.40717312693595886, 1.4275016784667969, 0.5124043226242065, -0.9552720785140991, 1.7103244066238403, -0.40854543447494507, 0.5065478086471558, -0.6321924328804016, -0.5534369349479675, -0.8819422125816345, 0.4034486711025238, 1.9547659158706665, -0.2104579359292984, 1.5141525268554688, -0.4371587634086609, -1.5861456394195557, -1.5817060470581055, 0.9477167725563049, 0.47311705350875854, -0.9656243920326233, 0.11865223199129105, -0.5137748718261719, 0.20782192051410675, -0.11863036453723907, 1.2080013751983643, 1.227479338645935, 0.7005744576454163, -0.2798101007938385, -0.8181688189506531, 0.20434103906154633, -0.15013030171394348, -0.7753036618232727, -1.826553463935852, -0.42849043011665344, 0.06968265771865845, 0.6981223821640015, -1.1372615098953247, 1.7412434816360474, 0.8474003672599792, 1.8779759407043457, 1.0734858512878418, -0.36994919180870056, 1.498392939567566, 0.04056057706475258, 1.9136874675750732, -0.6367431879043579, 0.6886284947395325, -0.3301231265068054, -0.984790027141571, 0.8448894023895264, -0.4018779397010803, -2.1007916927337646, -0.713579535484314, -0.8485192656517029, -0.21184469759464264, -0.7798509001731873, 0.8260459303855896, -0.3512796461582184, -1.3861106634140015, 0.2448028326034546, -0.7033930420875549, 0.18288357555866241, -1.1425361633300781, 0.3680657744407654, 0.8388548493385315, -0.6081442832946777, 0.02204998955130577, -0.19883619248867035, -1.3486714363098145, -0.42605745792388916, 0.29786789417266846, 1.9718573093414307, -0.7504362463951111, 0.8995737433433533, 0.8949167728424072, -0.6145879030227661, -0.15109021961688995, 0.3791855275630951, -0.27831029891967773, 0.7836371660232544, -1.0489898920059204, -0.4729543626308441, 1.1089609861373901, -0.2392164021730423, -0.41896432638168335, 1.4764560461044312, 0.8392354249954224, -0.9888237118721008, -0.13610132038593292, -0.25862979888916016, -0.7933971285820007, 0.038267821073532104, -1.5467612743377686, -0.172371044754982, 0.40527769923210144, -1.4875191450119019, -0.5338325500488281, -0.14197202026844025, 1.2652186155319214, -0.14592580497264862, 1.3117926120758057, -0.36344999074935913, -0.2668776214122772, -0.34413430094718933, -0.4529726505279541, 0.29311347007751465, -0.2935428023338318, -0.6583731770515442, 0.17674677073955536, -0.6907938122749329, 0.44059211015701294, 1.3750624656677246, 0.35398635268211365, 0.0038324138149619102, 0.5462964773178101, 1.0669163465499878, 0.3132900297641754, 0.10333716124296188, -0.7973029017448425, -1.5575796365737915, 2.0412967205047607, -1.4698553085327148, 1.955889344215393, 0.6388779282569885, -0.1178671270608902, -1.6856822967529297, -1.8082655668258667, 1.3618993759155273, 1.2720494270324707, 2.1814138889312744, 0.5694631934165955, 0.2962234616279602, -0.8828475475311279, -0.6068458557128906, 0.2951037883758545, -1.0198780298233032, -0.7325009703636169, 0.03382839262485504, 2.326119899749756, 1.7933034896850586, -0.6065666079521179, -0.18887868523597717, -1.0199544429779053, 1.5215048789978027, -0.2821035087108612, 0.2744520306587219, 2.05918025970459, -0.3237830400466919, -1.1996233463287354, 1.2952319383621216, -2.378450632095337, 0.20334675908088684, 1.9783529043197632, 0.31949588656425476, 0.1186535581946373, -1.4723180532455444, -0.5572848916053772, -0.2953295409679413, -0.3678853213787079, -1.265724778175354, 0.5640482306480408, -0.23288114368915558, -0.7869756817817688, -1.4853811264038086, 0.19878828525543213, -1.1522244215011597, -1.5651100873947144, 0.30271077156066895, 1.8954637050628662, 2.086527109146118, -0.663353443145752, 1.5369398593902588, -0.2510510981082916, 0.25491952896118164, 1.2572290897369385, 1.196096420288086, 3.1270534992218018, 1.9104994535446167, -1.1289715766906738, 0.5783776044845581, -0.2475971281528473, -0.5892166495323181, 1.1317411661148071, -1.0657745599746704, 1.1985565423965454, -0.03923601657152176, -1.0583126544952393, -1.1678293943405151, 0.9125807881355286, 0.49048298597335815, 0.014053425751626492, -0.4593173861503601, 1.196095585823059, -0.055353693664073944, 1.323681354522705, 0.5430961847305298, -0.3290975093841553, 0.5272224545478821, -0.4472975730895996, -0.5549075603485107, 1.6024870872497559, 0.21988120675086975, -1.4263839721679688, -2.310722589492798, -0.2242262065410614, -0.827737033367157, 0.08151553571224213, -0.5701552629470825, -1.0534169673919678, 1.658352255821228, 0.43787065148353577, -1.229245662689209, -0.21060609817504883, -0.32568448781967163, -0.6352767944335938, 2.6643104553222656, -1.3358814716339111, -0.36542168259620667, -0.9306004643440247, -0.5978454947471619, 1.6821012496948242, -1.266083836555481, -0.1663784682750702, -1.0431411266326904, -0.5899149775505066, -1.2429440021514893, -0.4880927503108978, -0.13752737641334534, -0.897707998752594, 0.9522275924682617, 0.16960300505161285, -1.1155285835266113, -0.37690502405166626, -0.9369757175445557, 0.7744536995887756, -0.13827380537986755, 0.31592699885368347, 1.8077222108840942, 0.2955760359764099, -0.3927549123764038, 0.7406501173973083, 1.2461745738983154, 0.6634200215339661, -0.6280145049095154, 0.22816196084022522, -0.5964745283126831, 0.34560638666152954, -1.2508317232131958, 0.29082560539245605, -2.9102425575256348, 0.6340839862823486, -0.000848742201924324, -0.20754015445709229, -0.047425318509340286, -1.4051321744918823, 1.1410787105560303, 2.5103609561920166, -1.193367600440979, 0.47851991653442383, 0.26036953926086426, 1.2963860034942627, -1.6018872261047363, 0.3506166636943817, -0.28245827555656433, 2.1699893474578857, 0.29744836688041687, 1.1488488912582397, -0.4824977219104767, -2.3658127784729004, 0.5899327993392944, -1.213631510734558, -1.1847466230392456, 0.5722658038139343, -0.8913220763206482, 0.054817281663417816, -1.5389472246170044, -0.2201787829399109, -0.911307156085968, -1.2038861513137817, 0.7683939337730408, 0.19160933792591095, 0.44581514596939087, -0.6341968774795532, 0.3196335434913635, -2.17708158493042, -1.380007266998291, -0.15065667033195496, -0.9911307096481323, 0.5838061571121216, -0.2565650939941406, 0.6687913537025452, -0.07570164650678635, 0.027529116719961166, 0.2999404966831207, 1.6215530633926392, 3.458796262741089, 0.13692106306552887, 0.4579748809337616, -0.20698368549346924, -0.770452618598938, 1.4070020914077759, 0.9653213620185852, -0.0177934467792511, -0.6181600689888, -1.081548810005188, 1.3542147874832153, 1.9682416915893555, 0.9629982709884644, 0.03298211842775345, -0.7459232807159424, -0.5797498822212219, -0.10295715928077698, 0.20117798447608948, 0.44924721121788025, 0.935483992099762, 0.06424017250537872, 0.027763821184635162, 1.3707919120788574, 1.280032753944397, -0.5376978516578674, 0.4258989691734314, -0.8258770108222961, -0.4267928898334503, 0.48638299107551575, 0.282827764749527, -0.06346410512924194, 0.32839590311050415, -0.9751045107841492, -0.14787431061267853, -0.290812224149704, -0.9008945226669312, -0.7287876009941101, -0.4824470579624176, -0.3853971064090729, 1.6463208198547363, 0.2121933549642563, -0.5978196263313293, -0.024298325181007385, -0.7209160923957825, -0.08837036043405533, -1.009425163269043, 0.08495999127626419, -0.12638556957244873, -0.1599719375371933, -0.14759917557239532, 1.7820420265197754, -0.8078426122665405, -1.9738606214523315, 0.15917156636714935, 0.2979874014854431, -0.31638872623443604, 0.2146719992160797, 1.5388513803482056, 0.453220009803772, 1.4162297248840332, 1.4007573127746582, 0.9394607543945312, -0.5966396927833557, -1.313757061958313, 0.6498282551765442, 0.870042085647583, -1.355454444885254, 0.8284787535667419, 0.07079800218343735, -0.4486221373081207, 0.7570018172264099, 1.371351957321167, 0.4335097074508667, -1.974298119544983, 0.8366614580154419, -0.9969024658203125, 0.9059323668479919, 0.6886882781982422, 0.6686021685600281, 0.4034195840358734, 0.8869153261184692, -1.244018793106079, -1.1108191013336182, -0.9545010328292847, -0.698440432548523, 2.145662784576416, -0.25836867094039917, 0.5919182896614075, -0.059070538729429245, -1.311775803565979, -0.16238240897655487, 0.6916416883468628, 0.5179235339164734, -0.33404025435447693, 0.73614901304245, -0.7355127334594727, -1.1515076160430908, -1.3737503290176392, -0.45390352606773376, -0.9930176734924316, -0.9280200004577637, 1.052602767944336, 0.9102980494499207, 0.3350357413291931, 1.8625894784927368, 0.6281464695930481, 0.24316641688346863, -2.5819528102874756, 0.8197688460350037, 0.23512358963489532, -0.10470341145992279, 0.8303626775741577, 0.3349403440952301, 1.117836833000183, -0.05686618760228157, 0.551659345626831, -2.4230124950408936, 2.2553203105926514, -0.23581114411354065, 0.7551246285438538, -0.06392180919647217, -0.07641950994729996, 1.1973485946655273, 0.5688590407371521, 0.5102521777153015, -1.0603199005126953, 0.5765165686607361, -0.5763371586799622, 1.3035327196121216, 0.9715614318847656, -0.7459849715232849, -0.09964440017938614, 1.2897355556488037, 0.41726699471473694, -0.5858142375946045, -1.049452781677246, -1.0118945837020874, 0.943347692489624, 1.7130753993988037, -0.18981917202472687, -0.19292426109313965, 0.7516410946846008, 0.7504484057426453, -1.2173364162445068, 0.0828680619597435, -0.7814553380012512, -0.7993682622909546, 1.6255027055740356, 2.1923773288726807, -0.19360800087451935, -0.113473080098629, -0.6670987010002136, -1.3440850973129272, 0.6832118630409241, 0.05035748332738876, 0.06336154043674469, 0.5537508130073547, -0.575462818145752, 1.11540687084198, 0.8728854060173035, 0.8528788685798645, 0.17017187178134918, 0.3668561577796936, 0.4035533666610718, -0.3077070116996765, -1.138440489768982, -0.4359833598136902, -1.2188555002212524, -2.5400047302246094, 0.4617970585823059, -0.3567637503147125, -1.41592276096344, -0.03257400542497635, -0.982505202293396, 0.9275354146957397, -0.6240615844726562, -1.0764225721359253, -1.5131779909133911, 0.1971072256565094, 0.04368619620800018, 0.9374452829360962, -1.6636048555374146, -0.044590841978788376, 1.2292530536651611, 0.8376062512397766, -0.5732611417770386, 0.9851784110069275, 0.3424419164657593, 1.0318858623504639, 0.747045636177063, -0.5136757493019104, 0.47719624638557434, 0.04224010556936264, -1.3030695915222168, 0.6533750295639038, 1.163199543952942, 0.10767200589179993, 1.4207032918930054, -0.5146976709365845, 0.04956036061048508, 0.4288579821586609, -0.5724997520446777, -0.3971811532974243, -0.5255903005599976, 0.7025215029716492, 0.1300620287656784, -0.8529640436172485, -0.008492570370435715, 0.03923160582780838, -0.30211251974105835, 0.2089085578918457, -1.5301569700241089, -0.24427849054336548, -0.3592837452888489, -0.51883465051651, -1.2150301933288574, -0.15954609215259552, 1.3861558437347412, -0.6900942325592041, -0.16690820455551147, 0.5648976564407349, 0.5372301936149597, 0.5069684982299805, 0.6207351088523865, -0.6335192918777466, -0.41817137598991394, -0.2839519679546356, -0.3409992456436157, 0.20521734654903412, 1.2117388248443604, -0.21128182113170624, -0.9889091849327087, 0.5850359797477722, -0.35619181394577026, -0.058462418615818024, 1.8429255485534668, 0.007298815064132214, -0.8332821130752563, 0.32968929409980774, -0.7544941902160645, 1.984588384628296, 1.6791627407073975, 1.2067716121673584, -0.06752162426710129, -0.8980487585067749, 0.5565621256828308, -0.33333343267440796, -0.3648180067539215, 0.8226996064186096, 0.43720605969429016, -0.1563439667224884, -1.389397144317627, 0.7471696734428406, 1.2879263162612915, -0.9223589897155762, -0.8825908899307251, 0.051645051687955856, -0.7785102128982544, 1.073235273361206, 0.60830157995224, 0.4746725261211395, 0.2991568446159363, 1.759641408920288, 0.6614696979522705, -0.46686533093452454, 0.5622082948684692, 0.5862720012664795, -0.2521359920501709, -2.17834210395813, -1.2941315174102783, 0.21403077244758606, -0.5353648066520691, -1.6226495504379272, 1.3457956314086914, -1.0240769386291504, -0.8164231777191162, 0.5925684571266174, 0.12564632296562195, 1.3975614309310913, 0.43132472038269043, 1.5742000341415405, 1.9871330261230469, 0.7929844260215759, 0.40234941244125366, 1.2902148962020874, -0.14665618538856506, -0.5557133555412292, 1.883806824684143, -0.3482620120048523, 0.5115076303482056, 1.1356455087661743, -0.31926795840263367, -1.0769044160842896, -0.731674313545227, -1.1013274192810059, -0.7161851525306702, 1.1413167715072632, 0.09104888886213303, -1.1999151706695557, 0.14587539434432983, 1.6187794208526611, 0.03727267310023308, -0.4064890146255493, 0.5096685290336609, 0.3579305410385132, -0.7512302398681641, -0.03201397880911827, -1.009791374206543, 0.4951390027999878, -0.2629905641078949, -0.38412922620773315, 0.3855367600917816, 0.5331036448478699, 1.2434099912643433, -0.13689003884792328, 0.14784497022628784, 1.104177474975586, -1.5044293403625488, 1.452232003211975, -0.650509238243103, 0.2782691717147827, -2.3320555686950684, 1.3897608518600464, -0.6994675397872925, 2.06274676322937, -2.675492286682129, 0.3369804918766022, -0.6544052362442017, -0.43871694803237915, 0.3332839012145996, -0.21670623123645782, 0.15391601622104645, -0.10575548559427261, -1.2088699340820312, 0.05139843747019768, -0.7696717381477356, 0.4676281213760376, 1.0489609241485596, 1.321289300918579, -1.1110838651657104, -0.2160148173570633, -1.6395775079727173, -0.14543850719928741, -0.6462485790252686, 0.29609206318855286, -2.0639803409576416, -0.1117628961801529, -1.8970943689346313, -2.138249397277832, -1.4061256647109985, -0.7693185806274414, 1.1336678266525269, 0.008283761329948902, -0.8247420787811279, 1.2342686653137207, -0.24033531546592712, -1.742398977279663, 1.0686043500900269, -2.0952677726745605 ]
https://github.com/huggingface/datasets/issues/4476
`to_pandas` doesn't take into account format.
Hi! Instead of `with_format(columns=['a', 'b']).to_pandas()`, use `with_format("pandas", columns=["a", "b"])` for easy conversion of the parts of the dataset to pandas via indexing/slicing. The full code: ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format("pandas", columns=['a', 'b'])[:] ```
**Is your feature request related to a problem? Please describe.** I have a large dataset that I need to convert part of to pandas to do some further analysis. Calling `to_pandas` directly on it is expensive. So I thought I could simply select the columns that I want and then call `to_pandas`. **Describe the solution you'd like** ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format(columns=['a', 'b']).to_pandas() # I would expect `pandas_df` to only include a,b as column. ``` **Describe alternatives you've considered** I could remove all columns that I don't want? But I don't know all of them in advance. **Additional context** I can probably make a PR with some pointers.
719
44
`to_pandas` doesn't take into account format. **Is your feature request related to a problem? Please describe.** I have a large dataset that I need to convert part of to pandas to do some further analysis. Calling `to_pandas` directly on it is expensive. So I thought I could simply select the columns that I want and then call `to_pandas`. **Describe the solution you'd like** ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format(columns=['a', 'b']).to_pandas() # I would expect `pandas_df` to only include a,b as column. ``` **Describe alternatives you've considered** I could remove all columns that I don't want? But I don't know all of them in advance. **Additional context** I can probably make a PR with some pointers. Hi! Instead of `with_format(columns=['a', 'b']).to_pandas()`, use `with_format("pandas", columns=["a", "b"])` for easy conversion of the parts of the dataset to pandas via indexing/slicing. The full code: ```python from datasets import Dataset ds = Dataset.from_dict({'a': [1,2,3], 'b': [5,6,7], 'c': [8,9,10]}) pandas_df = ds.with_format("pandas", columns=['a', 'b'])[:] ```
[ -1.2016232013702393, -0.9610621929168701, -0.7329643368721008, 1.4914920330047607, -0.2066020667552948, -1.237613320350647, 0.1476498693227768, -1.154596209526062, 1.7777341604232788, -0.7498394250869751, 0.25420308113098145, -1.6954392194747925, -0.034881409257650375, -0.7653412222862244, -0.7946439385414124, -0.7848345637321472, -0.32368218898773193, -0.8023673892021179, 1.0213481187820435, 2.4954094886779785, 1.0354739427566528, -1.4978365898132324, 2.6983556747436523, 0.7271338701248169, -0.09095104038715363, -0.9716312289237976, 0.5398091077804565, 0.033185943961143494, -1.1476168632507324, -0.44988012313842773, -0.9658984541893005, -0.12377076596021652, -0.5734161138534546, -0.46996527910232544, -0.07572419941425323, 0.42792752385139465, -0.2773551344871521, -0.48758652806282043, -0.5347581505775452, -0.7327825427055359, 0.40853792428970337, -0.39747855067253113, 1.0011800527572632, -0.31159722805023193, 1.84440016746521, -0.5175672769546509, 0.38213878870010376, 0.7080487012863159, 1.3504369258880615, 0.2179640233516693, 0.042506203055381775, 0.38622021675109863, 0.3995361030101776, -0.1111014187335968, 0.6212124228477478, 1.12724769115448, 0.6656383872032166, 0.4883790910243988, 0.8478783369064331, -2.2783913612365723, 1.2915313243865967, -1.1926394701004028, 0.39239180088043213, 1.4101775884628296, -0.8564049601554871, 0.3983941078186035, -1.7803895473480225, 0.01178148202598095, 0.6316863298416138, -2.263965129852295, 0.32078784704208374, -1.3569622039794922, -0.5360492467880249, 0.983437716960907, 0.44195571541786194, -1.289647102355957, 0.20293475687503815, -0.4233906865119934, 0.999865710735321, 0.3124881088733673, 1.0218197107315063, -1.7459828853607178, 0.008619332686066628, -0.27263596653938293, 0.1152595579624176, -1.229647159576416, -1.4734275341033936, 0.6437519788742065, 0.532476007938385, 0.6367332935333252, -0.14784154295921326, 0.9935829043388367, -1.0989748239517212, 0.6942840814590454, -1.0588878393173218, -1.722548484802246, -1.4480857849121094, -2.224489212036133, -2.2317962646484375, 0.774853527545929, -0.4038305878639221, -0.5015500783920288, 1.9916718006134033, -0.8913249969482422, -1.650342583656311, 1.1252285242080688, 0.37735089659690857, -0.01603107526898384, 2.43914532661438, 0.18658757209777832, -0.6899967789649963, 0.46818146109580994, -0.844280481338501, 0.8359343409538269, -0.3653305768966675, 1.4228166341781616, 0.4763331115245819, -1.0064375400543213, 1.7293158769607544, -0.3660767078399658, 0.5545535683631897, -0.6538295149803162, -0.5309295058250427, -0.7726368308067322, 0.39487507939338684, 1.9390755891799927, -0.22757330536842346, 1.4598472118377686, -0.4352760910987854, -1.512442946434021, -1.588714361190796, 0.9816891551017761, 0.41891488432884216, -0.9324496388435364, 0.0827479213476181, -0.5045177340507507, 0.19659629464149475, -0.13955464959144592, 1.2874730825424194, 1.2880240678787231, 0.6676473617553711, -0.27785810828208923, -0.8053640127182007, 0.11663301289081573, -0.14982815086841583, -0.827700138092041, -1.764114260673523, -0.35658183693885803, 0.08718349039554596, 0.6479092836380005, -1.17060124874115, 1.752729058265686, 0.8074990510940552, 1.8503272533416748, 1.0562937259674072, -0.45980459451675415, 1.497154951095581, 0.0849270299077034, 1.8724218606948853, -0.6389936208724976, 0.6194978356361389, -0.3552391529083252, -1.0693968534469604, 0.914739191532135, -0.36577877402305603, -2.076242446899414, -0.7426748871803284, -0.7963032126426697, -0.2229500263929367, -0.7797106504440308, 0.8078937530517578, -0.38421186804771423, -1.4274661540985107, 0.22120381891727448, -0.7642068266868591, 0.1807253509759903, -1.1007333993911743, 0.28226277232170105, 0.80036860704422, -0.5604129433631897, 0.07127996534109116, -0.19302091002464294, -1.318070411682129, -0.4358970522880554, 0.37832844257354736, 1.9572306871414185, -0.7134529948234558, 0.8601393699645996, 1.0486239194869995, -0.659940779209137, -0.14942164719104767, 0.2866716682910919, -0.28791582584381104, 0.8331895470619202, -1.0175822973251343, -0.6006457209587097, 1.0968601703643799, -0.19332952797412872, -0.4736151099205017, 1.4947248697280884, 0.8008829951286316, -1.0239397287368774, -0.18505138158798218, -0.175401508808136, -0.8264917135238647, 0.06794624030590057, -1.5375933647155762, -0.15541286766529083, 0.47525328397750854, -1.5699338912963867, -0.5235463976860046, -0.18156231939792633, 1.2677490711212158, -0.14205092191696167, 1.2946443557739258, -0.31812694668769836, -0.2231294959783554, -0.31091973185539246, -0.4086044132709503, 0.21067602932453156, -0.2770647704601288, -0.6307963728904724, 0.1166604608297348, -0.6584872603416443, 0.4327889680862427, 1.4332250356674194, 0.3099282383918762, 0.03794670104980469, 0.5216889381408691, 1.1373692750930786, 0.4101434350013733, 0.09862574934959412, -0.8168197274208069, -1.5427770614624023, 1.9560798406600952, -1.4791620969772339, 1.961846947669983, 0.6582851409912109, -0.023530729115009308, -1.7214428186416626, -1.8685473203659058, 1.4232617616653442, 1.25586998462677, 2.1879069805145264, 0.5707295536994934, 0.34496620297431946, -0.8646658062934875, -0.6016271114349365, 0.2586665451526642, -0.9280028343200684, -0.6725385189056396, 0.15486399829387665, 2.335222005844116, 1.800162434577942, -0.5130967497825623, -0.21566160023212433, -0.9889225959777832, 1.5986998081207275, -0.30667614936828613, 0.24514140188694, 2.033114433288574, -0.28810545802116394, -1.1725006103515625, 1.3499222993850708, -2.4254956245422363, 0.17579595744609833, 1.9696273803710938, 0.2870792746543884, 0.12306222319602966, -1.3967829942703247, -0.6163493394851685, -0.37070438265800476, -0.4249890148639679, -1.2684204578399658, 0.4935743510723114, -0.20864856243133545, -0.7349473834037781, -1.5072029829025269, 0.2213698923587799, -1.1590890884399414, -1.5432482957839966, 0.20081400871276855, 1.93909752368927, 2.095703125, -0.714646577835083, 1.6013133525848389, -0.2669954001903534, 0.22097866237163544, 1.2521204948425293, 1.2646993398666382, 3.087062120437622, 1.820444941520691, -1.1366617679595947, 0.5896725058555603, -0.21534724533557892, -0.5672268867492676, 1.141370415687561, -1.1500648260116577, 1.2528690099716187, -0.0669286698102951, -1.084952712059021, -1.1886975765228271, 0.8855454921722412, 0.5172465443611145, 0.03851649910211563, -0.45599350333213806, 1.14406156539917, -0.04172614961862564, 1.2853225469589233, 0.5947021842002869, -0.34972119331359863, 0.4854895770549774, -0.3966194689273834, -0.5530540347099304, 1.5778517723083496, 0.16307948529720306, -1.3971984386444092, -2.2645492553710938, -0.20295046269893646, -0.8267436027526855, 0.09049563854932785, -0.6157503128051758, -1.0960822105407715, 1.686898112297058, 0.37465140223503113, -1.1755949258804321, -0.19791026413440704, -0.33971551060676575, -0.5596716403961182, 2.6956753730773926, -1.3088877201080322, -0.3449249565601349, -0.972893238067627, -0.6357870697975159, 1.7035796642303467, -1.1769477128982544, -0.16401992738246918, -1.0115623474121094, -0.5437915325164795, -1.226747989654541, -0.4535599946975708, -0.06302263587713242, -0.9525320529937744, 0.9699296355247498, 0.1734047383069992, -1.1867763996124268, -0.3710481822490692, -0.9154225587844849, 0.8921269178390503, -0.2351853847503662, 0.23340514302253723, 1.8703464269638062, 0.3138231635093689, -0.38579314947128296, 0.8062000274658203, 1.2525954246520996, 0.6858252882957458, -0.601860523223877, 0.25384312868118286, -0.570327639579773, 0.36964309215545654, -1.2881600856781006, 0.25539231300354004, -2.899151563644409, 0.5599011778831482, -0.006313460413366556, -0.12405098974704742, 0.024516085162758827, -1.3685777187347412, 1.121678352355957, 2.4930193424224854, -1.2161736488342285, 0.4692552089691162, 0.24949543178081512, 1.308342456817627, -1.6354409456253052, 0.2511245310306549, -0.32319343090057373, 2.1018288135528564, 0.18580012023448944, 1.1155102252960205, -0.4514346420764923, -2.437927007675171, 0.5826171636581421, -1.284164547920227, -1.163364052772522, 0.582358181476593, -0.9071900844573975, 0.12984032928943634, -1.547061800956726, -0.24831809103488922, -0.8920338153839111, -1.1589906215667725, 0.7082787156105042, 0.16607899963855743, 0.36313506960868835, -0.6274338960647583, 0.34720268845558167, -2.179147481918335, -1.4337835311889648, -0.10499192774295807, -0.9816808104515076, 0.6637158393859863, -0.3366836905479431, 0.6705054044723511, -0.09455673396587372, -0.005434443708509207, 0.25067955255508423, 1.6181070804595947, 3.4659945964813232, 0.11445582658052444, 0.4012441039085388, -0.21442687511444092, -0.8343356847763062, 1.4157029390335083, 0.9693882465362549, -0.04907670617103577, -0.582724928855896, -1.138527274131775, 1.36838698387146, 1.9575287103652954, 0.994540274143219, -0.009049949236214161, -0.7701668739318848, -0.6428887248039246, -0.12693434953689575, 0.28529223799705505, 0.4470389187335968, 0.9068438410758972, 0.1251576840877533, 0.019045142456889153, 1.3408085107803345, 1.2051067352294922, -0.5235674977302551, 0.3775591552257538, -0.8465731739997864, -0.46269211173057556, 0.5088960528373718, 0.1998683363199234, -0.08479567617177963, 0.35164085030555725, -1.0283401012420654, -0.22998520731925964, -0.34774425625801086, -0.8312035202980042, -0.7016635537147522, -0.40419021248817444, -0.3401411771774292, 1.5981727838516235, 0.19046777486801147, -0.6115543842315674, -0.022607047110795975, -0.6892496347427368, -0.08763349056243896, -1.0164293050765991, 0.10908755660057068, -0.17333851754665375, -0.17001233994960785, -0.18717144429683685, 1.7628964185714722, -0.8266723155975342, -1.9434831142425537, 0.051017433404922485, 0.3157009482383728, -0.23599661886692047, 0.2720727026462555, 1.5747530460357666, 0.49074509739875793, 1.4482789039611816, 1.3661150932312012, 0.9088398218154907, -0.5912983417510986, -1.3639570474624634, 0.6169235110282898, 0.9326245188713074, -1.2561266422271729, 0.8557684421539307, -0.008435102179646492, -0.49012279510498047, 0.6809055209159851, 1.4042848348617554, 0.4740714132785797, -2.0465505123138428, 0.8146159648895264, -1.0696017742156982, 0.9538378715515137, 0.7239254117012024, 0.6710723638534546, 0.371413916349411, 0.8152164220809937, -1.2417325973510742, -1.1566394567489624, -0.8610013127326965, -0.7806240916252136, 2.0387864112854004, -0.26457250118255615, 0.6337815523147583, -0.1288735419511795, -1.3473573923110962, -0.11853473633527756, 0.6756107807159424, 0.5512141585350037, -0.476315975189209, 0.7687414884567261, -0.7254533171653748, -1.098455786705017, -1.356692910194397, -0.4616577923297882, -1.025947093963623, -0.9237311482429504, 1.015985369682312, 0.8735871911048889, 0.31050658226013184, 1.860939860343933, 0.6471617221832275, 0.22171235084533691, -2.496901035308838, 0.8419202566146851, 0.2858745753765106, -0.14982382953166962, 0.8314986824989319, 0.3896704614162445, 1.1064846515655518, -0.026567531749606133, 0.5588255524635315, -2.381336212158203, 2.272005319595337, -0.15097524225711823, 0.7631365656852722, -0.120062917470932, -0.06176257133483887, 1.1375937461853027, 0.5403844714164734, 0.4910294711589813, -1.0196964740753174, 0.5766935348510742, -0.5330815315246582, 1.3221652507781982, 0.9071396589279175, -0.7248278856277466, -0.11168600618839264, 1.3442128896713257, 0.4892829954624176, -0.6363663077354431, -1.0354090929031372, -1.0228384733200073, 0.9582967758178711, 1.7107200622558594, -0.16779738664627075, -0.10468849539756775, 0.7513951063156128, 0.6696059703826904, -1.2596228122711182, 0.03617379069328308, -0.6776691675186157, -0.7319638133049011, 1.6664955615997314, 2.160820722579956, -0.30462363362312317, -0.10617989301681519, -0.6801304221153259, -1.3370139598846436, 0.680282711982727, -0.016066689044237137, 0.06868787854909897, 0.564332902431488, -0.5992065072059631, 1.1069825887680054, 0.8590087890625, 0.8250701427459717, 0.1662856638431549, 0.3637389540672302, 0.43573468923568726, -0.3580753207206726, -1.203233003616333, -0.3728327453136444, -1.142477035522461, -2.531402826309204, 0.43046969175338745, -0.2717721462249756, -1.3967359066009521, -0.0532161146402359, -0.9963548183441162, 0.9947492480278015, -0.5859978795051575, -1.1104538440704346, -1.4351117610931396, 0.24547700583934784, 0.10759995132684708, 0.9735206365585327, -1.6530792713165283, -0.0746256560087204, 1.2613579034805298, 0.8888150453567505, -0.6872892379760742, 0.9590891003608704, 0.317886620759964, 1.0353238582611084, 0.7849857807159424, -0.43634364008903503, 0.5091009140014648, -0.04919622838497162, -1.2865824699401855, 0.5811116099357605, 1.1976988315582275, 0.08456423133611679, 1.4145663976669312, -0.5010055303573608, -0.03716450184583664, 0.4040641188621521, -0.5369462966918945, -0.4040379524230957, -0.5046652555465698, 0.5621709823608398, 0.06789091229438782, -0.8225173354148865, -0.03581467643380165, 0.13869285583496094, -0.37304672598838806, 0.15923236310482025, -1.501376748085022, -0.24337781965732574, -0.41970300674438477, -0.5398381948471069, -1.2214605808258057, -0.12418461591005325, 1.351404070854187, -0.6493304967880249, -0.18136975169181824, 0.5627060532569885, 0.44627657532691956, 0.4669457972049713, 0.6336212158203125, -0.6087333559989929, -0.3973817527294159, -0.24161957204341888, -0.37142279744148254, 0.24070702493190765, 1.2880003452301025, -0.20594796538352966, -0.9694443941116333, 0.6070651412010193, -0.3589133620262146, -0.0651337057352066, 1.8303709030151367, -0.021937742829322815, -0.8230047225952148, 0.3126784861087799, -0.7471854090690613, 1.9860868453979492, 1.7376238107681274, 1.2174016237258911, -0.15335196256637573, -0.8799788951873779, 0.6037835478782654, -0.36645469069480896, -0.3787495195865631, 0.8220981359481812, 0.32828280329704285, -0.2307446151971817, -1.4490175247192383, 0.7842305302619934, 1.2983099222183228, -0.8983926773071289, -0.8214874267578125, 0.13026908040046692, -0.76127690076828, 1.0709728002548218, 0.6378118991851807, 0.39454033970832825, 0.32450827956199646, 1.723672866821289, 0.7128630876541138, -0.4398127496242523, 0.5593133568763733, 0.6116248965263367, -0.23198160529136658, -2.1828904151916504, -1.3188329935073853, 0.17937400937080383, -0.5710471868515015, -1.6521304845809937, 1.3229138851165771, -1.0100417137145996, -0.8900309205055237, 0.5935102105140686, 0.03498830646276474, 1.3762843608856201, 0.4362252950668335, 1.4966647624969482, 2.0151617527008057, 0.7567576766014099, 0.4314492642879486, 1.2137365341186523, -0.15649765729904175, -0.5219153761863708, 1.8794130086898804, -0.39688774943351746, 0.5300156474113464, 1.1017091274261475, -0.27108219265937805, -1.0970875024795532, -0.7141507863998413, -1.2332626581192017, -0.7618595957756042, 1.1625678539276123, 0.06227404624223709, -1.1699316501617432, 0.23696477711200714, 1.5805495977401733, 0.053564928472042084, -0.39272722601890564, 0.6008270978927612, 0.4051481783390045, -0.8706580400466919, -0.09268372505903244, -0.9657936096191406, 0.5487843751907349, -0.2151551991701126, -0.3074975311756134, 0.4237542450428009, 0.5263893008232117, 1.3510898351669312, -0.06490305811166763, 0.19886021316051483, 1.0021995306015015, -1.507310390472412, 1.5020891427993774, -0.7303839921951294, 0.3147633373737335, -2.3165414333343506, 1.36348295211792, -0.6487772464752197, 2.1073694229125977, -2.6983931064605713, 0.42103296518325806, -0.5959309339523315, -0.4422139823436737, 0.2908279299736023, -0.21623408794403076, 0.128569558262825, -0.09647925943136215, -1.2035976648330688, 0.028140364214777946, -0.683112621307373, 0.4553568363189697, 1.0774800777435303, 1.3829586505889893, -1.1030962467193604, -0.2409689873456955, -1.6436201333999634, -0.14053913950920105, -0.6282787322998047, 0.24897457659244537, -2.041639566421509, -0.1762862652540207, -1.8637052774429321, -2.2344276905059814, -1.3211244344711304, -0.7276775240898132, 1.1841473579406738, -0.04896378517150879, -0.8779358863830566, 1.3422671556472778, -0.31816181540489197, -1.7670103311538696, 1.0556731224060059, -2.0717709064483643 ]
https://github.com/huggingface/datasets/issues/4467
Transcript string 'null' converted to [None] by load_dataset()
Hi @mbarnig, thanks for reporting. Please note that is an expected behavior by `pandas` (we use the `pandas` library to parse CSV files): https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html ``` By default the following values are interpreted as NaN: ‘’, ‘#N/A’, ‘#N/A N/A’, ‘#NA’, ‘-1.#IND’, ‘-1.#QNAN’, ‘-NaN’, ‘-nan’, ‘1.#IND’, ‘1.#QNAN’, ‘<NA>’, ‘N/A’, ‘NA’, ‘NULL’, ‘NaN’, ‘n/a’, ‘nan’, ‘null’. ``` (see "null" in the last position in the above list). In order to prevent `pandas` from performing that automatic conversion from the string "null" to a NaN value, you should pass the `pandas` parameter `keep_default_na=False`: ```python In [2]: dataset = load_dataset('csv', data_files={'train': 'null-test.csv'}, keep_default_na=False) In [3]: dataset["train"][0]["transcript"] Out[3]: 'null' ```
## Issue I am training a luxembourgish speech-recognition model in Colab with a custom dataset, including a dictionary of luxembourgish words, for example the speaken numbers 0 to 9. When preparing the dataset with the script `ds_train1 = mydataset.map(prepare_dataset)` the following error was issued: ``` ValueError Traceback (most recent call last) <ipython-input-69-1e8f2b37f5bc> in <module>() ----> 1 ds_train = mydataset_train.map(prepare_dataset) 11 frames /usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py in __call__(self, text, text_pair, add_special_tokens, padding, truncation, max_length, stride, is_split_into_words, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs) 2450 if not _is_valid_text_input(text): 2451 raise ValueError( -> 2452 "text input must of type str (single example), List[str] (batch or single pretokenized example) " 2453 "or List[List[str]] (batch of pretokenized examples)." 2454 ) ValueError: text input must of type str (single example), List[str] (batch or single pretokenized example) or List[List[str]] (batch of pretokenized examples). ``` Debugging this problem was not easy, all transcriptions in the dataset are correct strings. Finally I discovered that the transcription string 'null' is interpreted as [None] by the `load_dataset()` script. By deleting this row in the dataset the training worked fine. ## Expected result: transcription 'null' interpreted as 'str' instead of 'None'. ## Reproduction Here is the code to reproduce the error with a one-row-dataset. ``` with open("null-test.csv") as f: reader = csv.reader(f) for row in reader: print(row) ``` ['wav_filename', 'wav_filesize', 'transcript'] ['wavs/female/NULL1.wav', '17530', 'null'] ``` dataset = load_dataset('csv', data_files={'train': 'null-test.csv'}) ``` Using custom data configuration default-81ac0c0e27af3514 Downloading and preparing dataset csv/default to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519... Downloading data files: 100% 1/1 [00:00<00:00, 29.55it/s] Extracting data files: 100% 1/1 [00:00<00:00, 23.66it/s] Dataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519. Subsequent calls will reuse this data. 100% 1/1 [00:00<00:00, 25.84it/s] ``` print(dataset['train']['transcript']) ``` [None] ## Environment info ``` !pip install datasets==2.2.2 !pip install transformers==4.19.2 ```
721
104
Transcript string 'null' converted to [None] by load_dataset() ## Issue I am training a luxembourgish speech-recognition model in Colab with a custom dataset, including a dictionary of luxembourgish words, for example the speaken numbers 0 to 9. When preparing the dataset with the script `ds_train1 = mydataset.map(prepare_dataset)` the following error was issued: ``` ValueError Traceback (most recent call last) <ipython-input-69-1e8f2b37f5bc> in <module>() ----> 1 ds_train = mydataset_train.map(prepare_dataset) 11 frames /usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py in __call__(self, text, text_pair, add_special_tokens, padding, truncation, max_length, stride, is_split_into_words, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs) 2450 if not _is_valid_text_input(text): 2451 raise ValueError( -> 2452 "text input must of type str (single example), List[str] (batch or single pretokenized example) " 2453 "or List[List[str]] (batch of pretokenized examples)." 2454 ) ValueError: text input must of type str (single example), List[str] (batch or single pretokenized example) or List[List[str]] (batch of pretokenized examples). ``` Debugging this problem was not easy, all transcriptions in the dataset are correct strings. Finally I discovered that the transcription string 'null' is interpreted as [None] by the `load_dataset()` script. By deleting this row in the dataset the training worked fine. ## Expected result: transcription 'null' interpreted as 'str' instead of 'None'. ## Reproduction Here is the code to reproduce the error with a one-row-dataset. ``` with open("null-test.csv") as f: reader = csv.reader(f) for row in reader: print(row) ``` ['wav_filename', 'wav_filesize', 'transcript'] ['wavs/female/NULL1.wav', '17530', 'null'] ``` dataset = load_dataset('csv', data_files={'train': 'null-test.csv'}) ``` Using custom data configuration default-81ac0c0e27af3514 Downloading and preparing dataset csv/default to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519... Downloading data files: 100% 1/1 [00:00<00:00, 29.55it/s] Extracting data files: 100% 1/1 [00:00<00:00, 23.66it/s] Dataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519. Subsequent calls will reuse this data. 100% 1/1 [00:00<00:00, 25.84it/s] ``` print(dataset['train']['transcript']) ``` [None] ## Environment info ``` !pip install datasets==2.2.2 !pip install transformers==4.19.2 ``` Hi @mbarnig, thanks for reporting. Please note that is an expected behavior by `pandas` (we use the `pandas` library to parse CSV files): https://pandas.pydata.org/docs/reference/api/pandas.read_csv.html ``` By default the following values are interpreted as NaN: ‘’, ‘#N/A’, ‘#N/A N/A’, ‘#NA’, ‘-1.#IND’, ‘-1.#QNAN’, ‘-NaN’, ‘-nan’, ‘1.#IND’, ‘1.#QNAN’, ‘<NA>’, ‘N/A’, ‘NA’, ‘NULL’, ‘NaN’, ‘n/a’, ‘nan’, ‘null’. ``` (see "null" in the last position in the above list). In order to prevent `pandas` from performing that automatic conversion from the string "null" to a NaN value, you should pass the `pandas` parameter `keep_default_na=False`: ```python In [2]: dataset = load_dataset('csv', data_files={'train': 'null-test.csv'}, keep_default_na=False) In [3]: dataset["train"][0]["transcript"] Out[3]: 'null' ```
[ -1.2223650217056274, -0.9403827786445618, -0.7258449196815491, 1.5120038986206055, -0.13584694266319275, -1.2539769411087036, 0.17796558141708374, -1.0782947540283203, 1.6011165380477905, -0.8420072793960571, 0.31322869658470154, -1.6118943691253662, 0.009023545309901237, -0.6299734115600586, -0.7583151459693909, -0.8707744479179382, -0.3530500829219818, -0.8452326059341431, 1.1408673524856567, 2.5032236576080322, 1.2538894414901733, -1.349826455116272, 2.7635555267333984, 0.6086902618408203, -0.25883516669273376, -1.0570915937423706, 0.47491255402565, -0.10868439823389053, -1.1957871913909912, -0.549987256526947, -0.9555780291557312, -0.03695406764745712, -0.66299968957901, -0.4109286963939667, 0.048648901283741, 0.4547887444496155, -0.23895438015460968, -0.32086777687072754, -0.5566900372505188, -0.8092495799064636, 0.47116363048553467, -0.3525574505329132, 0.9350443482398987, -0.2476690411567688, 1.7963589429855347, -0.5989899635314941, 0.3909919857978821, 0.6586385369300842, 1.398059368133545, 0.1763569712638855, 0.0015824558213353157, 0.27530041337013245, 0.34489819407463074, -0.061152637004852295, 0.5248063802719116, 1.1864924430847168, 0.6360008120536804, 0.5017855763435364, 0.7701468467712402, -2.245917558670044, 1.3082906007766724, -1.0077813863754272, 0.313309907913208, 1.2962392568588257, -0.8962187170982361, 0.3810148537158966, -1.8116745948791504, -0.12903574109077454, 0.634728729724884, -2.2606868743896484, 0.27486923336982727, -1.2635382413864136, -0.4729219377040863, 0.9384368658065796, 0.3525092899799347, -1.3038326501846313, 0.20935240387916565, -0.5092287063598633, 1.0978333950042725, 0.3937256336212158, 1.015246868133545, -1.7912487983703613, 0.0019692312926054, -0.2180090695619583, 0.18920175731182098, -1.2612553834915161, -1.5994911193847656, 0.6762020587921143, 0.508966326713562, 0.5566830635070801, -0.1562976986169815, 1.0851929187774658, -1.096500039100647, 0.8283882141113281, -1.1170271635055542, -1.7006758451461792, -1.4243346452713013, -2.3625898361206055, -2.2627460956573486, 0.712729275226593, -0.4538477957248688, -0.551374614238739, 2.131432294845581, -0.9756042957305908, -1.6552907228469849, 1.159427285194397, 0.3074246048927307, 0.05498602241277695, 2.4596967697143555, 0.22531162202358246, -0.8033301830291748, 0.47389280796051025, -0.7712236642837524, 0.8966132402420044, -0.29485422372817993, 1.3547999858856201, 0.41864678263664246, -1.0869861841201782, 1.5945669412612915, -0.3724706470966339, 0.5593894124031067, -0.6268268823623657, -0.5457107424736023, -0.7400994300842285, 0.3215525150299072, 1.8575783967971802, -0.21794767677783966, 1.4871947765350342, -0.37501025199890137, -1.5102436542510986, -1.5666958093643188, 0.9105522632598877, 0.4681749939918518, -0.9128406047821045, 0.10594239830970764, -0.47316884994506836, 0.12714368104934692, 0.021180542185902596, 1.255852222442627, 1.3164538145065308, 0.6245408654212952, -0.36621159315109253, -0.843284547328949, 0.11326724290847778, -0.10946626216173172, -0.7149087190628052, -1.855223536491394, -0.3642744719982147, 0.15474821627140045, 0.7254809141159058, -1.0946835279464722, 1.7760989665985107, 0.9263491630554199, 1.9513057470321655, 1.0061769485473633, -0.3742794394493103, 1.470611572265625, 0.0005439212545752525, 1.7097355127334595, -0.5663467049598694, 0.6053898334503174, -0.46185097098350525, -1.1981987953186035, 0.8609222769737244, -0.253610223531723, -1.9701730012893677, -0.75797438621521, -0.6580085754394531, -0.17830868065357208, -0.735578179359436, 0.8817512392997742, -0.35780802369117737, -1.4256519079208374, 0.18866735696792603, -0.7122214436531067, 0.18468868732452393, -1.145328402519226, 0.28545987606048584, 0.6592907309532166, -0.6197043061256409, 0.07348089665174484, -0.2418835610151291, -1.2924458980560303, -0.5016972422599792, 0.3556549847126007, 1.854914665222168, -0.6723741292953491, 0.8896912336349487, 1.004554033279419, -0.575481116771698, -0.024904226884245872, 0.21266017854213715, -0.3034709393978119, 0.8484026789665222, -1.0035433769226074, -0.5244929790496826, 1.189575433731079, -0.2661091983318329, -0.5839062929153442, 1.4226646423339844, 0.7243781089782715, -1.0419058799743652, -0.259746789932251, -0.14379991590976715, -0.9595685601234436, 0.09744415432214737, -1.5801345109939575, -0.19823402166366577, 0.5547369122505188, -1.5756419897079468, -0.34265321493148804, -0.14359213411808014, 1.371626615524292, -0.14414045214653015, 1.4736359119415283, -0.427740216255188, -0.16225269436836243, -0.2967459559440613, -0.4482939839363098, 0.21520966291427612, -0.17488209903240204, -0.5819203853607178, 0.13599419593811035, -0.807197630405426, 0.3551235496997833, 1.4813287258148193, 0.2772923409938812, 0.050081364810466766, 0.41326218843460083, 1.1572933197021484, 0.3823442757129669, -0.006896344944834709, -0.8483006954193115, -1.523301601409912, 2.0204601287841797, -1.4570417404174805, 2.0452396869659424, 0.877362072467804, -0.025143660604953766, -1.7471641302108765, -1.8066226243972778, 1.3701894283294678, 1.1610229015350342, 2.2833917140960693, 0.451639860868454, 0.36245012283325195, -0.8091884255409241, -0.6418134570121765, 0.3090195059776306, -1.0129917860031128, -0.6964071989059448, 0.11555907130241394, 2.4064764976501465, 1.8038944005966187, -0.4647255539894104, -0.2155485302209854, -0.9278101921081543, 1.4788037538528442, -0.3057754337787628, 0.23232300579547882, 2.0006229877471924, -0.2563592493534088, -1.0944266319274902, 1.3202296495437622, -2.413961172103882, 0.21330007910728455, 2.1241252422332764, 0.28682106733322144, 0.16435472667217255, -1.3010333776474, -0.5655125379562378, -0.361285924911499, -0.40163561701774597, -1.2381716966629028, 0.5689272880554199, -0.2776148319244385, -0.8202826380729675, -1.4456454515457153, 0.18824762105941772, -1.1852409839630127, -1.6119474172592163, 0.32881662249565125, 1.9351133108139038, 2.1421732902526855, -0.6429268717765808, 1.555078148841858, -0.39152348041534424, 0.17598770558834076, 1.141013503074646, 1.3606255054473877, 3.009744644165039, 1.786825180053711, -1.2849411964416504, 0.5660460591316223, -0.1973419040441513, -0.5594453811645508, 1.008612871170044, -1.0643807649612427, 1.2513453960418701, -0.12985143065452576, -1.2372891902923584, -1.2499403953552246, 0.9826866388320923, 0.49570170044898987, -0.024538179859519005, -0.5588067173957825, 1.2806403636932373, 0.09807176887989044, 1.2773873805999756, 0.6539509892463684, -0.31249234080314636, 0.5686869025230408, -0.4306198060512543, -0.6275842189788818, 1.5626873970031738, 0.1851159930229187, -1.5420286655426025, -2.302175760269165, -0.15684333443641663, -0.7856865525245667, 0.13708926737308502, -0.6966856122016907, -1.0317399501800537, 1.6264398097991943, 0.2882791757583618, -1.2244868278503418, -0.28468114137649536, -0.37677761912345886, -0.5151944160461426, 2.6996264457702637, -1.2412992715835571, -0.1898493617773056, -0.931443989276886, -0.5882722735404968, 1.6059966087341309, -1.2417571544647217, -0.18482626974582672, -1.0384306907653809, -0.5352755784988403, -1.2017269134521484, -0.49623820185661316, 0.012960633262991905, -0.9287467002868652, 0.8025412559509277, 0.19811993837356567, -1.2531272172927856, -0.3720402121543884, -0.8895159363746643, 0.9708993434906006, -0.22404958307743073, 0.1368231475353241, 1.8133622407913208, 0.2850568890571594, -0.40482136607170105, 0.8621821999549866, 1.2359960079193115, 0.6613832116127014, -0.5536540746688843, 0.026039330288767815, -0.5642449259757996, 0.4236851632595062, -1.2604328393936157, 0.30956003069877625, -2.954442262649536, 0.7530649304389954, -0.033065348863601685, -0.09117436408996582, -0.021540772169828415, -1.387986421585083, 1.0218024253845215, 2.585136651992798, -1.2550585269927979, 0.4880334734916687, 0.33899253606796265, 1.123177170753479, -1.6810317039489746, 0.25502824783325195, -0.46440374851226807, 2.1035966873168945, 0.20395797491073608, 1.319077730178833, -0.5416243672370911, -2.2955429553985596, 0.5743144154548645, -1.3038580417633057, -1.1220710277557373, 0.7816808819770813, -0.9551292061805725, 0.16484247148036957, -1.4467594623565674, -0.24963368475437164, -0.8945888876914978, -1.1707704067230225, 0.665882408618927, 0.15470193326473236, 0.4148252606391907, -0.5695911645889282, 0.2655147910118103, -2.191530704498291, -1.396086573600769, -0.1494840383529663, -1.0154026746749878, 0.544918954372406, -0.4779658317565918, 0.6705623269081116, -0.12878477573394775, 0.03509979695081711, 0.2824675440788269, 1.545146107673645, 3.386688232421875, 0.16170157492160797, 0.2898712456226349, -0.3312663435935974, -0.9186621904373169, 1.4618802070617676, 0.8761084079742432, -0.1831083595752716, -0.5236594080924988, -0.9830315113067627, 1.3235089778900146, 2.0067994594573975, 0.8992388844490051, 0.006613889709115028, -0.8423811793327332, -0.688498854637146, -0.0587717741727829, 0.21910680830478668, 0.5745694637298584, 0.8777269721031189, 0.05829526484012604, 0.039202697575092316, 1.3475300073623657, 1.0874524116516113, -0.45006752014160156, 0.3925239145755768, -0.8875744342803955, -0.44898173213005066, 0.4498220980167389, 0.17927658557891846, -0.07196879386901855, 0.4213777482509613, -0.890095591545105, -0.263562947511673, -0.38790565729141235, -0.8210555911064148, -0.714829683303833, -0.37358760833740234, -0.42727378010749817, 1.6090492010116577, 0.13303200900554657, -0.4697079360485077, 0.06897834688425064, -0.6552425622940063, -0.16492101550102234, -1.0151848793029785, 0.1681082546710968, -0.023947112262248993, -0.1660090982913971, -0.18878522515296936, 1.659268856048584, -0.9075547456741333, -2.095832109451294, 0.17952708899974823, 0.28597182035446167, -0.2752879858016968, 0.16785040497779846, 1.7519078254699707, 0.49162182211875916, 1.475527048110962, 1.3620080947875977, 0.8937347531318665, -0.6878658533096313, -1.2764095067977905, 0.7837620377540588, 0.9985984563827515, -1.4379160404205322, 0.9365739226341248, -0.13447639346122742, -0.49924150109291077, 0.7068336009979248, 1.2931976318359375, 0.5262007713317871, -2.0301201343536377, 0.8887296915054321, -1.0572282075881958, 0.8784173727035522, 0.7575839757919312, 0.644117534160614, 0.2842522859573364, 0.8863525986671448, -1.163604736328125, -1.1274340152740479, -0.6661415696144104, -0.7080857753753662, 1.9660484790802002, -0.3194602429866791, 0.5646502375602722, -0.14673136174678802, -1.2742366790771484, -0.10430438071489334, 0.7210002541542053, 0.3388729691505432, -0.416221559047699, 0.8193849921226501, -0.701853334903717, -1.002511978149414, -1.311264157295227, -0.4211300313472748, -1.0664366483688354, -1.0186554193496704, 1.0301495790481567, 0.736690104007721, 0.3074180483818054, 1.8795363903045654, 0.5944540500640869, 0.21808841824531555, -2.4479148387908936, 0.8820302486419678, 0.30895504355430603, -0.1737983226776123, 0.8579107522964478, 0.36059725284576416, 1.0854049921035767, 0.053834035992622375, 0.6040738224983215, -2.417905807495117, 2.2463083267211914, -0.15938319265842438, 0.7724004983901978, -0.03365737944841385, -0.1790585070848465, 1.0943071842193604, 0.5345793962478638, 0.5279304385185242, -1.0176539421081543, 0.7162026762962341, -0.5316702127456665, 1.191847324371338, 0.9179739356040955, -0.7810075283050537, 0.030811918899416924, 1.4552900791168213, 0.4640685021877289, -0.6040179133415222, -0.996317982673645, -0.9045560359954834, 0.8955016732215881, 1.7002686262130737, -0.08115101605653763, -0.03315379470586777, 0.6716288924217224, 0.6835476756095886, -1.200101375579834, 0.059854745864868164, -0.5806705951690674, -0.7875667810440063, 1.5934816598892212, 2.095698356628418, -0.27420946955680847, -0.10982584208250046, -0.6894693970680237, -1.281058669090271, 0.7754666209220886, -0.13116146624088287, 0.041593149304389954, 0.5612287521362305, -0.6300601363182068, 1.0814886093139648, 0.7924009561538696, 0.8467020392417908, 0.1833084523677826, 0.2558436691761017, 0.3534870147705078, -0.28616833686828613, -1.1449769735336304, -0.2937004268169403, -1.157231092453003, -2.5756165981292725, 0.3546983003616333, -0.25607985258102417, -1.3194462060928345, 0.1234135776758194, -0.9717564582824707, 0.8629094958305359, -0.5568178296089172, -1.1085842847824097, -1.5344386100769043, 0.26821520924568176, -0.00550982728600502, 0.9285680651664734, -1.660722017288208, -0.11913517862558365, 1.2216451168060303, 0.8282516598701477, -0.734121561050415, 0.9787367582321167, 0.2339537888765335, 1.0253806114196777, 0.8095232844352722, -0.3761572241783142, 0.5580363273620605, 0.0114162378013134, -1.34597909450531, 0.4796891212463379, 1.2143579721450806, 0.20628772675991058, 1.4290838241577148, -0.4070090353488922, -0.043435268104076385, 0.4356067478656769, -0.5532301664352417, -0.5136477947235107, -0.373525470495224, 0.6744136214256287, 0.08703535795211792, -0.8790251016616821, -0.021023856475949287, -0.1213926151394844, -0.38991254568099976, 0.29787659645080566, -1.5440857410430908, -0.24393945932388306, -0.47815170884132385, -0.4982445538043976, -1.3548449277877808, -0.11581055819988251, 1.434848666191101, -0.6418713927268982, -0.30828484892845154, 0.4939627945423126, 0.5046365857124329, 0.521274209022522, 0.7433780431747437, -0.7067424654960632, -0.3215909004211426, -0.2732883095741272, -0.2965456247329712, 0.2799694538116455, 1.3429882526397705, -0.1337423324584961, -0.9256970286369324, 0.6527649164199829, -0.3870448172092438, 0.08154657483100891, 1.899612307548523, 0.07102162390947342, -0.787380576133728, 0.309353768825531, -0.7028467655181885, 1.8999366760253906, 1.6863456964492798, 1.196995496749878, -0.14541590213775635, -0.9803166389465332, 0.7375057935714722, -0.36026671528816223, -0.3346943259239197, 0.8622730374336243, 0.33269497752189636, -0.24536661803722382, -1.5306249856948853, 0.7536137104034424, 1.2433249950408936, -0.7928293347358704, -0.8240464329719543, 0.07709721475839615, -0.8102460503578186, 1.1498806476593018, 0.5738970041275024, 0.36365634202957153, 0.3037852346897125, 1.664537787437439, 0.7624609470367432, -0.42246541380882263, 0.5112844109535217, 0.497301310300827, -0.2680957317352295, -2.1300621032714844, -1.1731168031692505, 0.25778770446777344, -0.43972310423851013, -1.6051000356674194, 1.3775097131729126, -1.068286657333374, -1.0326714515686035, 0.5888235569000244, -0.004420675337314606, 1.355922818183899, 0.356628954410553, 1.599278211593628, 2.0386734008789062, 0.8157187104225159, 0.437152624130249, 1.2725492715835571, -0.21941787004470825, -0.4322735369205475, 1.748412847518921, -0.3814404308795929, 0.5033235549926758, 1.0864323377609253, -0.3787854015827179, -1.148862361907959, -0.7713568806648254, -1.1606038808822632, -0.6789388656616211, 1.1370731592178345, 0.07804115116596222, -1.125185489654541, 0.3566604554653168, 1.5929969549179077, 0.1600692868232727, -0.30185186862945557, 0.6425488591194153, 0.4259163439273834, -0.748415470123291, -0.03167932480573654, -0.9106744527816772, 0.47838839888572693, -0.2813747823238373, -0.3819413185119629, 0.37842074036598206, 0.5190898180007935, 1.346287727355957, -0.042301639914512634, 0.12310883402824402, 1.0569645166397095, -1.4666579961776733, 1.2733116149902344, -0.6196355223655701, 0.38544946908950806, -2.374095916748047, 1.389397144317627, -0.7197427749633789, 2.075510025024414, -2.6612164974212646, 0.4881550967693329, -0.6152673363685608, -0.5769256353378296, 0.2818611264228821, -0.20895478129386902, 0.19480815529823303, -0.08873139321804047, -1.0716058015823364, -0.005366905592381954, -0.6554733514785767, 0.5713836550712585, 1.160879135131836, 1.3256168365478516, -1.0101367235183716, -0.23450565338134766, -1.653397798538208, -0.15571555495262146, -0.7462495565414429, 0.15916937589645386, -2.0693864822387695, -0.21263207495212555, -1.984961748123169, -2.3249459266662598, -1.2759995460510254, -0.8410734534263611, 1.1240297555923462, 0.2594660222530365, -0.858215868473053, 1.3812670707702637, -0.30920785665512085, -1.8184783458709717, 1.081468939781189, -2.1167666912078857 ]
https://github.com/huggingface/datasets/issues/4467
Transcript string 'null' converted to [None] by load_dataset()
@albertvillanova I also ran into this issue, it had me scratching my head for a while! In my case it was tripped by a literal "NA" comment collected from a user-facing form (e.g., this question does not apply to me). Thankfully this answer was here, but I feel it is such a common trap that it deserves to be noted in the official docs, maybe [here](https://huggingface.co/docs/datasets/loading#csv)? I'm happy to submit a PR if you agree!
## Issue I am training a luxembourgish speech-recognition model in Colab with a custom dataset, including a dictionary of luxembourgish words, for example the speaken numbers 0 to 9. When preparing the dataset with the script `ds_train1 = mydataset.map(prepare_dataset)` the following error was issued: ``` ValueError Traceback (most recent call last) <ipython-input-69-1e8f2b37f5bc> in <module>() ----> 1 ds_train = mydataset_train.map(prepare_dataset) 11 frames /usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py in __call__(self, text, text_pair, add_special_tokens, padding, truncation, max_length, stride, is_split_into_words, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs) 2450 if not _is_valid_text_input(text): 2451 raise ValueError( -> 2452 "text input must of type str (single example), List[str] (batch or single pretokenized example) " 2453 "or List[List[str]] (batch of pretokenized examples)." 2454 ) ValueError: text input must of type str (single example), List[str] (batch or single pretokenized example) or List[List[str]] (batch of pretokenized examples). ``` Debugging this problem was not easy, all transcriptions in the dataset are correct strings. Finally I discovered that the transcription string 'null' is interpreted as [None] by the `load_dataset()` script. By deleting this row in the dataset the training worked fine. ## Expected result: transcription 'null' interpreted as 'str' instead of 'None'. ## Reproduction Here is the code to reproduce the error with a one-row-dataset. ``` with open("null-test.csv") as f: reader = csv.reader(f) for row in reader: print(row) ``` ['wav_filename', 'wav_filesize', 'transcript'] ['wavs/female/NULL1.wav', '17530', 'null'] ``` dataset = load_dataset('csv', data_files={'train': 'null-test.csv'}) ``` Using custom data configuration default-81ac0c0e27af3514 Downloading and preparing dataset csv/default to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519... Downloading data files: 100% 1/1 [00:00<00:00, 29.55it/s] Extracting data files: 100% 1/1 [00:00<00:00, 23.66it/s] Dataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519. Subsequent calls will reuse this data. 100% 1/1 [00:00<00:00, 25.84it/s] ``` print(dataset['train']['transcript']) ``` [None] ## Environment info ``` !pip install datasets==2.2.2 !pip install transformers==4.19.2 ```
721
75
Transcript string 'null' converted to [None] by load_dataset() ## Issue I am training a luxembourgish speech-recognition model in Colab with a custom dataset, including a dictionary of luxembourgish words, for example the speaken numbers 0 to 9. When preparing the dataset with the script `ds_train1 = mydataset.map(prepare_dataset)` the following error was issued: ``` ValueError Traceback (most recent call last) <ipython-input-69-1e8f2b37f5bc> in <module>() ----> 1 ds_train = mydataset_train.map(prepare_dataset) 11 frames /usr/local/lib/python3.7/dist-packages/transformers/tokenization_utils_base.py in __call__(self, text, text_pair, add_special_tokens, padding, truncation, max_length, stride, is_split_into_words, pad_to_multiple_of, return_tensors, return_token_type_ids, return_attention_mask, return_overflowing_tokens, return_special_tokens_mask, return_offsets_mapping, return_length, verbose, **kwargs) 2450 if not _is_valid_text_input(text): 2451 raise ValueError( -> 2452 "text input must of type str (single example), List[str] (batch or single pretokenized example) " 2453 "or List[List[str]] (batch of pretokenized examples)." 2454 ) ValueError: text input must of type str (single example), List[str] (batch or single pretokenized example) or List[List[str]] (batch of pretokenized examples). ``` Debugging this problem was not easy, all transcriptions in the dataset are correct strings. Finally I discovered that the transcription string 'null' is interpreted as [None] by the `load_dataset()` script. By deleting this row in the dataset the training worked fine. ## Expected result: transcription 'null' interpreted as 'str' instead of 'None'. ## Reproduction Here is the code to reproduce the error with a one-row-dataset. ``` with open("null-test.csv") as f: reader = csv.reader(f) for row in reader: print(row) ``` ['wav_filename', 'wav_filesize', 'transcript'] ['wavs/female/NULL1.wav', '17530', 'null'] ``` dataset = load_dataset('csv', data_files={'train': 'null-test.csv'}) ``` Using custom data configuration default-81ac0c0e27af3514 Downloading and preparing dataset csv/default to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519... Downloading data files: 100% 1/1 [00:00<00:00, 29.55it/s] Extracting data files: 100% 1/1 [00:00<00:00, 23.66it/s] Dataset csv downloaded and prepared to /root/.cache/huggingface/datasets/csv/default-81ac0c0e27af3514/0.0.0/433e0ccc46f9880962cc2b12065189766fbb2bee57a221866138fb9203c83519. Subsequent calls will reuse this data. 100% 1/1 [00:00<00:00, 25.84it/s] ``` print(dataset['train']['transcript']) ``` [None] ## Environment info ``` !pip install datasets==2.2.2 !pip install transformers==4.19.2 ``` @albertvillanova I also ran into this issue, it had me scratching my head for a while! In my case it was tripped by a literal "NA" comment collected from a user-facing form (e.g., this question does not apply to me). Thankfully this answer was here, but I feel it is such a common trap that it deserves to be noted in the official docs, maybe [here](https://huggingface.co/docs/datasets/loading#csv)? I'm happy to submit a PR if you agree!
[ -1.2223650217056274, -0.9403827786445618, -0.7258449196815491, 1.5120038986206055, -0.13584694266319275, -1.2539769411087036, 0.17796558141708374, -1.0782947540283203, 1.6011165380477905, -0.8420072793960571, 0.31322869658470154, -1.6118943691253662, 0.009023545309901237, -0.6299734115600586, -0.7583151459693909, -0.8707744479179382, -0.3530500829219818, -0.8452326059341431, 1.1408673524856567, 2.5032236576080322, 1.2538894414901733, -1.349826455116272, 2.7635555267333984, 0.6086902618408203, -0.25883516669273376, -1.0570915937423706, 0.47491255402565, -0.10868439823389053, -1.1957871913909912, -0.549987256526947, -0.9555780291557312, -0.03695406764745712, -0.66299968957901, -0.4109286963939667, 0.048648901283741, 0.4547887444496155, -0.23895438015460968, -0.32086777687072754, -0.5566900372505188, -0.8092495799064636, 0.47116363048553467, -0.3525574505329132, 0.9350443482398987, -0.2476690411567688, 1.7963589429855347, -0.5989899635314941, 0.3909919857978821, 0.6586385369300842, 1.398059368133545, 0.1763569712638855, 0.0015824558213353157, 0.27530041337013245, 0.34489819407463074, -0.061152637004852295, 0.5248063802719116, 1.1864924430847168, 0.6360008120536804, 0.5017855763435364, 0.7701468467712402, -2.245917558670044, 1.3082906007766724, -1.0077813863754272, 0.313309907913208, 1.2962392568588257, -0.8962187170982361, 0.3810148537158966, -1.8116745948791504, -0.12903574109077454, 0.634728729724884, -2.2606868743896484, 0.27486923336982727, -1.2635382413864136, -0.4729219377040863, 0.9384368658065796, 0.3525092899799347, -1.3038326501846313, 0.20935240387916565, -0.5092287063598633, 1.0978333950042725, 0.3937256336212158, 1.015246868133545, -1.7912487983703613, 0.0019692312926054, -0.2180090695619583, 0.18920175731182098, -1.2612553834915161, -1.5994911193847656, 0.6762020587921143, 0.508966326713562, 0.5566830635070801, -0.1562976986169815, 1.0851929187774658, -1.096500039100647, 0.8283882141113281, -1.1170271635055542, -1.7006758451461792, -1.4243346452713013, -2.3625898361206055, -2.2627460956573486, 0.712729275226593, -0.4538477957248688, -0.551374614238739, 2.131432294845581, -0.9756042957305908, -1.6552907228469849, 1.159427285194397, 0.3074246048927307, 0.05498602241277695, 2.4596967697143555, 0.22531162202358246, -0.8033301830291748, 0.47389280796051025, -0.7712236642837524, 0.8966132402420044, -0.29485422372817993, 1.3547999858856201, 0.41864678263664246, -1.0869861841201782, 1.5945669412612915, -0.3724706470966339, 0.5593894124031067, -0.6268268823623657, -0.5457107424736023, -0.7400994300842285, 0.3215525150299072, 1.8575783967971802, -0.21794767677783966, 1.4871947765350342, -0.37501025199890137, -1.5102436542510986, -1.5666958093643188, 0.9105522632598877, 0.4681749939918518, -0.9128406047821045, 0.10594239830970764, -0.47316884994506836, 0.12714368104934692, 0.021180542185902596, 1.255852222442627, 1.3164538145065308, 0.6245408654212952, -0.36621159315109253, -0.843284547328949, 0.11326724290847778, -0.10946626216173172, -0.7149087190628052, -1.855223536491394, -0.3642744719982147, 0.15474821627140045, 0.7254809141159058, -1.0946835279464722, 1.7760989665985107, 0.9263491630554199, 1.9513057470321655, 1.0061769485473633, -0.3742794394493103, 1.470611572265625, 0.0005439212545752525, 1.7097355127334595, -0.5663467049598694, 0.6053898334503174, -0.46185097098350525, -1.1981987953186035, 0.8609222769737244, -0.253610223531723, -1.9701730012893677, -0.75797438621521, -0.6580085754394531, -0.17830868065357208, -0.735578179359436, 0.8817512392997742, -0.35780802369117737, -1.4256519079208374, 0.18866735696792603, -0.7122214436531067, 0.18468868732452393, -1.145328402519226, 0.28545987606048584, 0.6592907309532166, -0.6197043061256409, 0.07348089665174484, -0.2418835610151291, -1.2924458980560303, -0.5016972422599792, 0.3556549847126007, 1.854914665222168, -0.6723741292953491, 0.8896912336349487, 1.004554033279419, -0.575481116771698, -0.024904226884245872, 0.21266017854213715, -0.3034709393978119, 0.8484026789665222, -1.0035433769226074, -0.5244929790496826, 1.189575433731079, -0.2661091983318329, -0.5839062929153442, 1.4226646423339844, 0.7243781089782715, -1.0419058799743652, -0.259746789932251, -0.14379991590976715, -0.9595685601234436, 0.09744415432214737, -1.5801345109939575, -0.19823402166366577, 0.5547369122505188, -1.5756419897079468, -0.34265321493148804, -0.14359213411808014, 1.371626615524292, -0.14414045214653015, 1.4736359119415283, -0.427740216255188, -0.16225269436836243, -0.2967459559440613, -0.4482939839363098, 0.21520966291427612, -0.17488209903240204, -0.5819203853607178, 0.13599419593811035, -0.807197630405426, 0.3551235496997833, 1.4813287258148193, 0.2772923409938812, 0.050081364810466766, 0.41326218843460083, 1.1572933197021484, 0.3823442757129669, -0.006896344944834709, -0.8483006954193115, -1.523301601409912, 2.0204601287841797, -1.4570417404174805, 2.0452396869659424, 0.877362072467804, -0.025143660604953766, -1.7471641302108765, -1.8066226243972778, 1.3701894283294678, 1.1610229015350342, 2.2833917140960693, 0.451639860868454, 0.36245012283325195, -0.8091884255409241, -0.6418134570121765, 0.3090195059776306, -1.0129917860031128, -0.6964071989059448, 0.11555907130241394, 2.4064764976501465, 1.8038944005966187, -0.4647255539894104, -0.2155485302209854, -0.9278101921081543, 1.4788037538528442, -0.3057754337787628, 0.23232300579547882, 2.0006229877471924, -0.2563592493534088, -1.0944266319274902, 1.3202296495437622, -2.413961172103882, 0.21330007910728455, 2.1241252422332764, 0.28682106733322144, 0.16435472667217255, -1.3010333776474, -0.5655125379562378, -0.361285924911499, -0.40163561701774597, -1.2381716966629028, 0.5689272880554199, -0.2776148319244385, -0.8202826380729675, -1.4456454515457153, 0.18824762105941772, -1.1852409839630127, -1.6119474172592163, 0.32881662249565125, 1.9351133108139038, 2.1421732902526855, -0.6429268717765808, 1.555078148841858, -0.39152348041534424, 0.17598770558834076, 1.141013503074646, 1.3606255054473877, 3.009744644165039, 1.786825180053711, -1.2849411964416504, 0.5660460591316223, -0.1973419040441513, -0.5594453811645508, 1.008612871170044, -1.0643807649612427, 1.2513453960418701, -0.12985143065452576, -1.2372891902923584, -1.2499403953552246, 0.9826866388320923, 0.49570170044898987, -0.024538179859519005, -0.5588067173957825, 1.2806403636932373, 0.09807176887989044, 1.2773873805999756, 0.6539509892463684, -0.31249234080314636, 0.5686869025230408, -0.4306198060512543, -0.6275842189788818, 1.5626873970031738, 0.1851159930229187, -1.5420286655426025, -2.302175760269165, -0.15684333443641663, -0.7856865525245667, 0.13708926737308502, -0.6966856122016907, -1.0317399501800537, 1.6264398097991943, 0.2882791757583618, -1.2244868278503418, -0.28468114137649536, -0.37677761912345886, -0.5151944160461426, 2.6996264457702637, -1.2412992715835571, -0.1898493617773056, -0.931443989276886, -0.5882722735404968, 1.6059966087341309, -1.2417571544647217, -0.18482626974582672, -1.0384306907653809, -0.5352755784988403, -1.2017269134521484, -0.49623820185661316, 0.012960633262991905, -0.9287467002868652, 0.8025412559509277, 0.19811993837356567, -1.2531272172927856, -0.3720402121543884, -0.8895159363746643, 0.9708993434906006, -0.22404958307743073, 0.1368231475353241, 1.8133622407913208, 0.2850568890571594, -0.40482136607170105, 0.8621821999549866, 1.2359960079193115, 0.6613832116127014, -0.5536540746688843, 0.026039330288767815, -0.5642449259757996, 0.4236851632595062, -1.2604328393936157, 0.30956003069877625, -2.954442262649536, 0.7530649304389954, -0.033065348863601685, -0.09117436408996582, -0.021540772169828415, -1.387986421585083, 1.0218024253845215, 2.585136651992798, -1.2550585269927979, 0.4880334734916687, 0.33899253606796265, 1.123177170753479, -1.6810317039489746, 0.25502824783325195, -0.46440374851226807, 2.1035966873168945, 0.20395797491073608, 1.319077730178833, -0.5416243672370911, -2.2955429553985596, 0.5743144154548645, -1.3038580417633057, -1.1220710277557373, 0.7816808819770813, -0.9551292061805725, 0.16484247148036957, -1.4467594623565674, -0.24963368475437164, -0.8945888876914978, -1.1707704067230225, 0.665882408618927, 0.15470193326473236, 0.4148252606391907, -0.5695911645889282, 0.2655147910118103, -2.191530704498291, -1.396086573600769, -0.1494840383529663, -1.0154026746749878, 0.544918954372406, -0.4779658317565918, 0.6705623269081116, -0.12878477573394775, 0.03509979695081711, 0.2824675440788269, 1.545146107673645, 3.386688232421875, 0.16170157492160797, 0.2898712456226349, -0.3312663435935974, -0.9186621904373169, 1.4618802070617676, 0.8761084079742432, -0.1831083595752716, -0.5236594080924988, -0.9830315113067627, 1.3235089778900146, 2.0067994594573975, 0.8992388844490051, 0.006613889709115028, -0.8423811793327332, -0.688498854637146, -0.0587717741727829, 0.21910680830478668, 0.5745694637298584, 0.8777269721031189, 0.05829526484012604, 0.039202697575092316, 1.3475300073623657, 1.0874524116516113, -0.45006752014160156, 0.3925239145755768, -0.8875744342803955, -0.44898173213005066, 0.4498220980167389, 0.17927658557891846, -0.07196879386901855, 0.4213777482509613, -0.890095591545105, -0.263562947511673, -0.38790565729141235, -0.8210555911064148, -0.714829683303833, -0.37358760833740234, -0.42727378010749817, 1.6090492010116577, 0.13303200900554657, -0.4697079360485077, 0.06897834688425064, -0.6552425622940063, -0.16492101550102234, -1.0151848793029785, 0.1681082546710968, -0.023947112262248993, -0.1660090982913971, -0.18878522515296936, 1.659268856048584, -0.9075547456741333, -2.095832109451294, 0.17952708899974823, 0.28597182035446167, -0.2752879858016968, 0.16785040497779846, 1.7519078254699707, 0.49162182211875916, 1.475527048110962, 1.3620080947875977, 0.8937347531318665, -0.6878658533096313, -1.2764095067977905, 0.7837620377540588, 0.9985984563827515, -1.4379160404205322, 0.9365739226341248, -0.13447639346122742, -0.49924150109291077, 0.7068336009979248, 1.2931976318359375, 0.5262007713317871, -2.0301201343536377, 0.8887296915054321, -1.0572282075881958, 0.8784173727035522, 0.7575839757919312, 0.644117534160614, 0.2842522859573364, 0.8863525986671448, -1.163604736328125, -1.1274340152740479, -0.6661415696144104, -0.7080857753753662, 1.9660484790802002, -0.3194602429866791, 0.5646502375602722, -0.14673136174678802, -1.2742366790771484, -0.10430438071489334, 0.7210002541542053, 0.3388729691505432, -0.416221559047699, 0.8193849921226501, -0.701853334903717, -1.002511978149414, -1.311264157295227, -0.4211300313472748, -1.0664366483688354, -1.0186554193496704, 1.0301495790481567, 0.736690104007721, 0.3074180483818054, 1.8795363903045654, 0.5944540500640869, 0.21808841824531555, -2.4479148387908936, 0.8820302486419678, 0.30895504355430603, -0.1737983226776123, 0.8579107522964478, 0.36059725284576416, 1.0854049921035767, 0.053834035992622375, 0.6040738224983215, -2.417905807495117, 2.2463083267211914, -0.15938319265842438, 0.7724004983901978, -0.03365737944841385, -0.1790585070848465, 1.0943071842193604, 0.5345793962478638, 0.5279304385185242, -1.0176539421081543, 0.7162026762962341, -0.5316702127456665, 1.191847324371338, 0.9179739356040955, -0.7810075283050537, 0.030811918899416924, 1.4552900791168213, 0.4640685021877289, -0.6040179133415222, -0.996317982673645, -0.9045560359954834, 0.8955016732215881, 1.7002686262130737, -0.08115101605653763, -0.03315379470586777, 0.6716288924217224, 0.6835476756095886, -1.200101375579834, 0.059854745864868164, -0.5806705951690674, -0.7875667810440063, 1.5934816598892212, 2.095698356628418, -0.27420946955680847, -0.10982584208250046, -0.6894693970680237, -1.281058669090271, 0.7754666209220886, -0.13116146624088287, 0.041593149304389954, 0.5612287521362305, -0.6300601363182068, 1.0814886093139648, 0.7924009561538696, 0.8467020392417908, 0.1833084523677826, 0.2558436691761017, 0.3534870147705078, -0.28616833686828613, -1.1449769735336304, -0.2937004268169403, -1.157231092453003, -2.5756165981292725, 0.3546983003616333, -0.25607985258102417, -1.3194462060928345, 0.1234135776758194, -0.9717564582824707, 0.8629094958305359, -0.5568178296089172, -1.1085842847824097, -1.5344386100769043, 0.26821520924568176, -0.00550982728600502, 0.9285680651664734, -1.660722017288208, -0.11913517862558365, 1.2216451168060303, 0.8282516598701477, -0.734121561050415, 0.9787367582321167, 0.2339537888765335, 1.0253806114196777, 0.8095232844352722, -0.3761572241783142, 0.5580363273620605, 0.0114162378013134, -1.34597909450531, 0.4796891212463379, 1.2143579721450806, 0.20628772675991058, 1.4290838241577148, -0.4070090353488922, -0.043435268104076385, 0.4356067478656769, -0.5532301664352417, -0.5136477947235107, -0.373525470495224, 0.6744136214256287, 0.08703535795211792, -0.8790251016616821, -0.021023856475949287, -0.1213926151394844, -0.38991254568099976, 0.29787659645080566, -1.5440857410430908, -0.24393945932388306, -0.47815170884132385, -0.4982445538043976, -1.3548449277877808, -0.11581055819988251, 1.434848666191101, -0.6418713927268982, -0.30828484892845154, 0.4939627945423126, 0.5046365857124329, 0.521274209022522, 0.7433780431747437, -0.7067424654960632, -0.3215909004211426, -0.2732883095741272, -0.2965456247329712, 0.2799694538116455, 1.3429882526397705, -0.1337423324584961, -0.9256970286369324, 0.6527649164199829, -0.3870448172092438, 0.08154657483100891, 1.899612307548523, 0.07102162390947342, -0.787380576133728, 0.309353768825531, -0.7028467655181885, 1.8999366760253906, 1.6863456964492798, 1.196995496749878, -0.14541590213775635, -0.9803166389465332, 0.7375057935714722, -0.36026671528816223, -0.3346943259239197, 0.8622730374336243, 0.33269497752189636, -0.24536661803722382, -1.5306249856948853, 0.7536137104034424, 1.2433249950408936, -0.7928293347358704, -0.8240464329719543, 0.07709721475839615, -0.8102460503578186, 1.1498806476593018, 0.5738970041275024, 0.36365634202957153, 0.3037852346897125, 1.664537787437439, 0.7624609470367432, -0.42246541380882263, 0.5112844109535217, 0.497301310300827, -0.2680957317352295, -2.1300621032714844, -1.1731168031692505, 0.25778770446777344, -0.43972310423851013, -1.6051000356674194, 1.3775097131729126, -1.068286657333374, -1.0326714515686035, 0.5888235569000244, -0.004420675337314606, 1.355922818183899, 0.356628954410553, 1.599278211593628, 2.0386734008789062, 0.8157187104225159, 0.437152624130249, 1.2725492715835571, -0.21941787004470825, -0.4322735369205475, 1.748412847518921, -0.3814404308795929, 0.5033235549926758, 1.0864323377609253, -0.3787854015827179, -1.148862361907959, -0.7713568806648254, -1.1606038808822632, -0.6789388656616211, 1.1370731592178345, 0.07804115116596222, -1.125185489654541, 0.3566604554653168, 1.5929969549179077, 0.1600692868232727, -0.30185186862945557, 0.6425488591194153, 0.4259163439273834, -0.748415470123291, -0.03167932480573654, -0.9106744527816772, 0.47838839888572693, -0.2813747823238373, -0.3819413185119629, 0.37842074036598206, 0.5190898180007935, 1.346287727355957, -0.042301639914512634, 0.12310883402824402, 1.0569645166397095, -1.4666579961776733, 1.2733116149902344, -0.6196355223655701, 0.38544946908950806, -2.374095916748047, 1.389397144317627, -0.7197427749633789, 2.075510025024414, -2.6612164974212646, 0.4881550967693329, -0.6152673363685608, -0.5769256353378296, 0.2818611264228821, -0.20895478129386902, 0.19480815529823303, -0.08873139321804047, -1.0716058015823364, -0.005366905592381954, -0.6554733514785767, 0.5713836550712585, 1.160879135131836, 1.3256168365478516, -1.0101367235183716, -0.23450565338134766, -1.653397798538208, -0.15571555495262146, -0.7462495565414429, 0.15916937589645386, -2.0693864822387695, -0.21263207495212555, -1.984961748123169, -2.3249459266662598, -1.2759995460510254, -0.8410734534263611, 1.1240297555923462, 0.2594660222530365, -0.858215868473053, 1.3812670707702637, -0.30920785665512085, -1.8184783458709717, 1.081468939781189, -2.1167666912078857 ]
https://github.com/huggingface/datasets/issues/4462
BigBench: NonMatchingSplitsSizesError when passing a dataset configuration parameter
Yup it can also work, and maybe it's simpler this way. Opening a PR to fix bigbench instead of https://github.com/huggingface/datasets/pull/4463
As noticed in https://github.com/huggingface/datasets/pull/4125 when a dataset config class has a parameter that reduces the number of examples (e.g. named `max_examples`), then loading the dataset and passing `max_examples` raises `NonMatchingSplitsSizesError`. This is because it will check for expected the number of examples of the config with the same name without taking into account the `max_examples` parameter. This can be fixed by checking the expected number of examples using the **config id** instead of name. Indeed the config id corresponds to the config name + an optional suffix that depends on the config parameters
722
20
BigBench: NonMatchingSplitsSizesError when passing a dataset configuration parameter As noticed in https://github.com/huggingface/datasets/pull/4125 when a dataset config class has a parameter that reduces the number of examples (e.g. named `max_examples`), then loading the dataset and passing `max_examples` raises `NonMatchingSplitsSizesError`. This is because it will check for expected the number of examples of the config with the same name without taking into account the `max_examples` parameter. This can be fixed by checking the expected number of examples using the **config id** instead of name. Indeed the config id corresponds to the config name + an optional suffix that depends on the config parameters Yup it can also work, and maybe it's simpler this way. Opening a PR to fix bigbench instead of https://github.com/huggingface/datasets/pull/4463
[ -1.2497447729110718, -0.9999146461486816, -0.8366141319274902, 1.450700044631958, -0.06207055225968361, -1.3802154064178467, 0.10129261016845703, -1.025817632675171, 1.6619616746902466, -0.7785031795501709, 0.3647173047065735, -1.85182523727417, 0.03916659206151962, -0.604341983795166, -0.8389915227890015, -0.8705363273620605, -0.36516717076301575, -0.7785314917564392, 0.9980587959289551, 2.4707186222076416, 1.1908342838287354, -1.4399135112762451, 2.7033469676971436, 0.6472141146659851, -0.17096124589443207, -1.000226616859436, 0.5623666644096375, -0.002448566257953644, -1.2437963485717773, -0.547031819820404, -0.9127517938613892, 0.021005067974328995, -0.4578053057193756, -0.5452540516853333, -0.05212247371673584, 0.38467222452163696, -0.20908421277999878, -0.3577493727207184, -0.5448915958404541, -0.8317506909370422, 0.3362409770488739, -0.3329722583293915, 0.8965358734130859, -0.4277157783508301, 1.8596694469451904, -0.46958181262016296, 0.29714515805244446, 0.6884323358535767, 1.3778727054595947, 0.2000402957201004, -0.05339851230382919, 0.15618093311786652, 0.4067697525024414, -0.03220977634191513, 0.43623489141464233, 1.179449439048767, 0.6679707765579224, 0.5055210590362549, 0.7155675888061523, -2.264023780822754, 1.4219073057174683, -1.0147182941436768, 0.2439962923526764, 1.4146255254745483, -1.1016179323196411, 0.30397701263427734, -1.8043979406356812, -0.0709804818034172, 0.41966915130615234, -2.3846311569213867, 0.16501344740390778, -1.2137776613235474, -0.5021304488182068, 0.9393857717514038, 0.2734757661819458, -1.2355118989944458, 0.12655602395534515, -0.4044526219367981, 1.049007773399353, 0.5050023198127747, 1.2162929773330688, -1.6820544004440308, 0.008551024831831455, -0.30271175503730774, 0.003177928738296032, -1.3990108966827393, -1.594683289527893, 0.5275383591651917, 0.6570151448249817, 0.5405710935592651, -0.16991914808750153, 0.9403519630432129, -0.878017783164978, 0.881557822227478, -0.9487888216972351, -1.572204828262329, -1.3527108430862427, -2.2685706615448, -2.305436372756958, 0.8481854200363159, -0.5393023490905762, -0.597890317440033, 1.9598230123519897, -1.0453020334243774, -1.7319395542144775, 1.0723849534988403, 0.19082850217819214, 0.097621850669384, 2.3114123344421387, 0.16282229125499725, -0.6538161635398865, 0.28528496623039246, -0.6394230723381042, 0.8452876806259155, -0.4217868745326996, 1.4768232107162476, 0.5842293500900269, -1.0391809940338135, 1.533236026763916, -0.42682239413261414, 0.4182751476764679, -0.7274110317230225, -0.5239628553390503, -0.7418684959411621, 0.28381088376045227, 1.8025420904159546, -0.40427324175834656, 1.5867793560028076, -0.35043081641197205, -1.5593286752700806, -1.5912331342697144, 0.8688927888870239, 0.4744516909122467, -0.7974539995193481, 0.1335696578025818, -0.3463117778301239, 0.14279700815677643, -0.03266328200697899, 1.128980278968811, 1.1925759315490723, 0.6752201914787292, -0.27791082859039307, -0.8183255791664124, 0.23660241067409515, -0.08840090036392212, -0.6725472807884216, -1.7512872219085693, -0.2716994285583496, 0.2436404526233673, 0.6952480673789978, -1.2314701080322266, 1.7690705060958862, 0.8521003127098083, 1.8984295129776, 0.9352318644523621, -0.295758455991745, 1.518633246421814, -0.1108233705163002, 1.8379677534103394, -0.5224471092224121, 0.5402473211288452, -0.19584494829177856, -1.0274497270584106, 0.8612509369850159, -0.3518742620944977, -2.037099838256836, -0.8215001821517944, -0.8858352303504944, -0.23888085782527924, -0.7447100877761841, 1.005351185798645, -0.3180903494358063, -1.251299500465393, 0.21271492540836334, -0.5899983644485474, 0.12909647822380066, -1.1797410249710083, 0.20097556710243225, 0.6948230862617493, -0.7471897006034851, -0.044440291821956635, -0.18732158839702606, -1.2967662811279297, -0.5364208817481995, 0.3164982199668884, 1.969865083694458, -0.7200552225112915, 0.9379331469535828, 1.0126550197601318, -0.7806759476661682, 0.060853585600852966, 0.3914717733860016, -0.180669367313385, 0.8579328656196594, -1.0642331838607788, -0.48739129304885864, 1.1439684629440308, -0.17747585475444794, -0.6110975742340088, 1.6565885543823242, 0.7463851571083069, -1.0155504941940308, -0.14360414445400238, -0.07065548747777939, -0.8900973200798035, 0.021116357296705246, -1.6611369848251343, -0.21510049700737, 0.2595677673816681, -1.431316614151001, -0.48085248470306396, -0.22828370332717896, 1.3423107862472534, -0.18037402629852295, 1.4119759798049927, -0.2907263934612274, -0.3312675654888153, -0.3953298330307007, -0.27908557653427124, 0.07934325188398361, -0.16003109514713287, -0.6815150380134583, 0.2956355810165405, -0.8038548827171326, 0.3337596654891968, 1.447359561920166, 0.4083872139453888, 0.025983508676290512, 0.6079419851303101, 1.1870304346084595, 0.30104026198387146, -0.0014890218153595924, -0.9040680527687073, -1.5215721130371094, 2.0377514362335205, -1.4547358751296997, 1.9471666812896729, 0.796276867389679, -0.019139409065246582, -1.7371195554733276, -1.8437862396240234, 1.3810138702392578, 1.2304904460906982, 2.2855384349823, 0.5723158717155457, 0.29924219846725464, -0.7993380427360535, -0.5180705785751343, 0.4122296869754791, -1.0470643043518066, -0.8089371919631958, 0.10805340111255646, 2.2976086139678955, 1.918329119682312, -0.4740683436393738, -0.29218870401382446, -1.1130106449127197, 1.2877960205078125, -0.03529042750597, 0.12230147421360016, 2.0212056636810303, -0.2859996557235718, -1.141897439956665, 1.184197187423706, -2.2886571884155273, 0.07432639598846436, 1.9993926286697388, 0.34823787212371826, 0.02606493979692459, -1.4483314752578735, -0.6257677674293518, -0.2652888596057892, -0.5529943704605103, -1.2798357009887695, 0.6177102327346802, -0.38053616881370544, -0.7882286906242371, -1.4389853477478027, 0.19703105092048645, -1.102013349533081, -1.7741550207138062, 0.45185035467147827, 1.798473596572876, 2.019742012023926, -0.6957059502601624, 1.4979839324951172, -0.2888167202472687, 0.12550467252731323, 1.4101759195327759, 1.193782925605774, 3.101043939590454, 1.992780327796936, -1.2801741361618042, 0.722893476486206, -0.1941274255514145, -0.40281111001968384, 1.142737865447998, -1.0875306129455566, 1.240936517715454, -0.1366722136735916, -1.227375864982605, -1.2210067510604858, 0.9222590923309326, 0.4811834394931793, 0.0775628313422203, -0.5493544936180115, 1.2663251161575317, 0.1181710958480835, 1.1861457824707031, 0.5528918504714966, -0.3837583661079407, 0.5201670527458191, -0.4095638692378998, -0.6377477049827576, 1.645447015762329, 0.23247405886650085, -1.4694151878356934, -2.276416778564453, -0.25725460052490234, -0.7930882573127747, -0.07473747432231903, -0.6131333708763123, -0.9537453651428223, 1.754886269569397, 0.47546669840812683, -1.4139295816421509, -0.2998412251472473, -0.47564926743507385, -0.6830276250839233, 2.600285530090332, -1.5252000093460083, -0.1918201446533203, -1.0481258630752563, -0.4673955738544464, 1.663074016571045, -1.2782917022705078, -0.26165392994880676, -1.0834764242172241, -0.6380763649940491, -1.4202897548675537, -0.5633044242858887, 0.04961197078227997, -0.812534511089325, 0.7750561833381653, 0.08552107214927673, -1.0611823797225952, -0.3203311562538147, -0.8042486310005188, 0.7997899651527405, -0.08917048573493958, 0.35669445991516113, 1.955968976020813, 0.494147926568985, -0.4719942808151245, 0.645307719707489, 1.0618016719818115, 0.6939319968223572, -0.5528910756111145, 0.2838490307331085, -0.5839722752571106, 0.3738064765930176, -1.3321903944015503, 0.3268989026546478, -2.8212039470672607, 0.6487249135971069, -0.11419318616390228, -0.04122299700975418, -0.010252684354782104, -1.2785074710845947, 1.1182900667190552, 2.590043306350708, -1.288059949874878, 0.4581429660320282, 0.2555750608444214, 1.1165205240249634, -1.5959354639053345, 0.4298754334449768, -0.3439592719078064, 2.1066012382507324, 0.11810944974422455, 1.0975302457809448, -0.48987939953804016, -2.1232340335845947, 0.6778081059455872, -1.1080149412155151, -1.0834277868270874, 0.8108423352241516, -0.6948186755180359, -0.03256883844733238, -1.3963749408721924, -0.18987201154232025, -0.857323169708252, -1.259596347808838, 0.9831298589706421, 0.18780073523521423, 0.4563984274864197, -0.6875141859054565, 0.3234843313694, -2.139028310775757, -1.3226637840270996, -0.27641284465789795, -0.9167622327804565, 0.43505534529685974, -0.3919673264026642, 0.5455183386802673, -0.08077855408191681, 0.12971611320972443, 0.3469884693622589, 1.3554836511611938, 3.41233229637146, 0.23799000680446625, 0.4813477694988251, -0.06277885288000107, -0.9310643076896667, 1.423553705215454, 0.8601961135864258, 0.014700471423566341, -0.5460405349731445, -1.0507714748382568, 1.2491134405136108, 1.8982937335968018, 1.0258102416992188, 0.15779373049736023, -0.7793982625007629, -0.6905114054679871, 0.005736048333346844, 0.21088209748268127, 0.601010799407959, 0.9745340347290039, -0.029566634446382523, 0.050359878689050674, 1.4252976179122925, 1.2543668746948242, -0.3577043414115906, 0.4173048436641693, -0.8411514759063721, -0.3754720091819763, 0.5117202997207642, 0.3041284382343292, 0.005183094181120396, 0.39847472310066223, -1.038917899131775, -0.35706627368927, -0.26447463035583496, -1.0465987920761108, -0.7051842212677002, -0.4753010869026184, -0.37317171692848206, 1.614745855331421, 0.09723040461540222, -0.5489733219146729, -0.04915161803364754, -0.8045024275779724, -0.1815272867679596, -1.084054708480835, 0.22607599198818207, -0.07375109940767288, -0.09678340703248978, -0.09293793886899948, 1.7225210666656494, -0.9111809134483337, -2.184627056121826, 0.3995291292667389, 0.28905823826789856, -0.4483036398887634, 0.25311827659606934, 1.6056309938430786, 0.48977163434028625, 1.3475452661514282, 1.2501336336135864, 0.9419702291488647, -0.6405072212219238, -1.387670874595642, 0.6524415016174316, 0.8606575131416321, -1.4330573081970215, 0.8696871995925903, -0.062141187489032745, -0.4480072557926178, 0.8247237801551819, 1.2999939918518066, 0.44031769037246704, -2.020258903503418, 0.7638365030288696, -0.8175252676010132, 0.7074047923088074, 0.6531534790992737, 0.8309513330459595, 0.1628418266773224, 0.8890964388847351, -1.2438939809799194, -1.1556650400161743, -0.6726185083389282, -0.6339439153671265, 1.8827707767486572, -0.116048164665699, 0.514293372631073, -0.13733278214931488, -1.318863868713379, -0.14618243277072906, 0.7367162108421326, 0.25040850043296814, -0.37447217106819153, 0.7976059317588806, -0.7541686296463013, -1.0132842063903809, -1.435501217842102, -0.5252390503883362, -0.8602988719940186, -0.8991522192955017, 1.0714516639709473, 0.8962212800979614, 0.18346364796161652, 1.9999817609786987, 0.5778211951255798, 0.15520471334457397, -2.6024601459503174, 0.8245545029640198, 0.29712456464767456, 0.07738425582647324, 1.032098650932312, 0.23671868443489075, 0.988739013671875, -0.013949574902653694, 0.5381504893302917, -2.3736650943756104, 2.307645797729492, -0.4137505888938904, 0.6532794237136841, -0.12305468320846558, -0.3307841420173645, 1.1360222101211548, 0.5193853974342346, 0.610588788986206, -1.1396409273147583, 0.7812658548355103, -0.6965927481651306, 1.186809778213501, 1.0802369117736816, -0.7913914918899536, -0.03498471528291702, 1.2701196670532227, 0.5268746614456177, -0.42943960428237915, -0.900416374206543, -1.0023462772369385, 0.9137865900993347, 1.8582701683044434, 0.09158641844987869, 0.06580527126789093, 0.8165122270584106, 0.681261420249939, -1.1706011295318604, 0.16520220041275024, -0.7768938541412354, -0.7751312255859375, 1.6611254215240479, 1.9895060062408447, -0.15203092992305756, -0.15925967693328857, -0.7861318588256836, -1.0445820093154907, 0.7196255326271057, 0.08120504766702652, 0.04995003715157509, 0.7172770500183105, -0.7419342994689941, 1.1836817264556885, 0.9206699728965759, 0.9598491787910461, 0.1634509563446045, 0.4225761294364929, 0.4567483067512512, -0.17878124117851257, -1.2040261030197144, -0.29760584235191345, -1.2545326948165894, -2.5329158306121826, 0.47147801518440247, -0.24742069840431213, -1.4092040061950684, -0.012738663703203201, -1.0983107089996338, 0.8461493849754333, -0.5278230905532837, -1.2670038938522339, -1.4601551294326782, 0.19491440057754517, -0.13589872419834137, 0.8972110152244568, -1.661985993385315, -0.13757911324501038, 1.3448104858398438, 0.8794800639152527, -0.5585263967514038, 0.8863130807876587, 0.183712899684906, 1.1394456624984741, 0.8201380968093872, -0.4431605935096741, 0.36511915922164917, 0.14560525119304657, -1.363543152809143, 0.4579026997089386, 1.0847543478012085, 0.1637028604745865, 1.4556349515914917, -0.5683447122573853, 0.15111392736434937, 0.4424654543399811, -0.5586132407188416, -0.5492259860038757, -0.6523639559745789, 0.7931986451148987, 0.05789276212453842, -0.8197510242462158, 0.1589684933423996, -0.16970238089561462, -0.20261195302009583, 0.22558218240737915, -1.4619468450546265, -0.26273539662361145, -0.32923659682273865, -0.44085603952407837, -1.3599827289581299, -0.048142556101083755, 1.3240883350372314, -0.7956521511077881, -0.223936527967453, 0.5176610350608826, 0.407474160194397, 0.5539173483848572, 0.5709755420684814, -0.6649296283721924, -0.3632970154285431, -0.284394234418869, -0.33047303557395935, 0.31427058577537537, 1.2035396099090576, -0.18062518537044525, -1.0175573825836182, 0.8304331302642822, -0.3684677481651306, 0.14735446870326996, 1.9457639455795288, 0.03739595040678978, -0.7545280456542969, 0.3896518349647522, -0.6308051943778992, 1.8066366910934448, 1.740585207939148, 1.3233613967895508, -0.11073322594165802, -0.9825714230537415, 0.619745671749115, -0.2501216232776642, -0.4107406735420227, 0.9397884011268616, 0.5131685137748718, -0.19412630796432495, -1.3888580799102783, 0.4448722004890442, 1.2877423763275146, -0.9538275599479675, -0.7796099781990051, 0.01740412786602974, -0.7980726361274719, 1.0919833183288574, 0.6828035116195679, 0.4054390490055084, 0.3008650541305542, 1.530175805091858, 0.5361616611480713, -0.3321589529514313, 0.4481167793273926, 0.4678805470466614, -0.17426042258739471, -2.1360485553741455, -1.0998120307922363, 0.2145967185497284, -0.4074055850505829, -1.458591103553772, 1.2670567035675049, -1.1863023042678833, -0.9683515429496765, 0.525040328502655, 0.18354853987693787, 1.553638219833374, 0.27150556445121765, 1.5600048303604126, 2.1474556922912598, 0.8503585457801819, 0.3068508803844452, 1.3451011180877686, -0.02987455204129219, -0.4909256100654602, 1.8273814916610718, -0.42812636494636536, 0.5029152631759644, 1.0441244840621948, -0.2975471019744873, -1.0442594289779663, -0.8265971541404724, -1.2576124668121338, -0.5814768075942993, 1.2422932386398315, 0.08122006058692932, -1.2013157606124878, 0.2038206160068512, 1.4238232374191284, 0.11868233978748322, -0.2177533507347107, 0.48246416449546814, 0.47738149762153625, -0.7262303829193115, -0.03609202429652214, -0.9069135785102844, 0.5660362839698792, -0.20838384330272675, -0.3693329989910126, 0.3373771011829376, 0.5305135250091553, 1.2665045261383057, 0.009856424294412136, 0.19113507866859436, 1.3066836595535278, -1.3896859884262085, 1.5307427644729614, -0.48610034584999084, 0.1731785535812378, -2.3886022567749023, 1.4748369455337524, -0.8128626942634583, 1.9312939643859863, -2.710562229156494, 0.4471192955970764, -0.5732136964797974, -0.4604528248310089, 0.42571768164634705, -0.48494869470596313, 0.17645259201526642, -0.16853584349155426, -0.9517614841461182, 0.027029357850551605, -0.6687703132629395, 0.5261470675468445, 1.2684427499771118, 1.404855728149414, -1.0649605989456177, -0.2660934627056122, -1.8454203605651855, -0.19168344140052795, -0.7352219223976135, 0.39851924777030945, -2.0641958713531494, -0.10968669503927231, -1.9380223751068115, -2.4028022289276123, -1.3191940784454346, -0.8771059513092041, 1.0654711723327637, 0.2590741515159607, -0.833817720413208, 0.9543031454086304, -0.43032556772232056, -1.7354793548583984, 0.9917628765106201, -2.0973360538482666 ]
https://github.com/huggingface/datasets/issues/4462
BigBench: NonMatchingSplitsSizesError when passing a dataset configuration parameter
Hi @lhoestq, Thank you for taking a look at this issue, and proposing a solution. Unfortunately, after trying the fix in #4465 I still see the same issue. I think there is some subtlety where the config name gets overwritten somewhere when `BUILDER_CONFIGS`[(link)](https://github.com/huggingface/datasets/blob/master/datasets/bigbench/bigbench.py#L126) is defined. If I print out the `self.config.name` in the current version (with the fix in #4465), I see just the task name, but if I comment out `BUILDER_CONFIGS`, the `num_shots` and `max_examples` gets appended as was meant by #4465. I haven't managed to track down where this happens, but I thought you might know? (Another comment on your fix: the `name` variable is used to fetch the task from the bigbench API, so modifying it causes an error if it's actually called. This can easily be fixed by having `config_name` variable in addition to the `task_name`)
As noticed in https://github.com/huggingface/datasets/pull/4125 when a dataset config class has a parameter that reduces the number of examples (e.g. named `max_examples`), then loading the dataset and passing `max_examples` raises `NonMatchingSplitsSizesError`. This is because it will check for expected the number of examples of the config with the same name without taking into account the `max_examples` parameter. This can be fixed by checking the expected number of examples using the **config id** instead of name. Indeed the config id corresponds to the config name + an optional suffix that depends on the config parameters
722
140
BigBench: NonMatchingSplitsSizesError when passing a dataset configuration parameter As noticed in https://github.com/huggingface/datasets/pull/4125 when a dataset config class has a parameter that reduces the number of examples (e.g. named `max_examples`), then loading the dataset and passing `max_examples` raises `NonMatchingSplitsSizesError`. This is because it will check for expected the number of examples of the config with the same name without taking into account the `max_examples` parameter. This can be fixed by checking the expected number of examples using the **config id** instead of name. Indeed the config id corresponds to the config name + an optional suffix that depends on the config parameters Hi @lhoestq, Thank you for taking a look at this issue, and proposing a solution. Unfortunately, after trying the fix in #4465 I still see the same issue. I think there is some subtlety where the config name gets overwritten somewhere when `BUILDER_CONFIGS`[(link)](https://github.com/huggingface/datasets/blob/master/datasets/bigbench/bigbench.py#L126) is defined. If I print out the `self.config.name` in the current version (with the fix in #4465), I see just the task name, but if I comment out `BUILDER_CONFIGS`, the `num_shots` and `max_examples` gets appended as was meant by #4465. I haven't managed to track down where this happens, but I thought you might know? (Another comment on your fix: the `name` variable is used to fetch the task from the bigbench API, so modifying it causes an error if it's actually called. This can easily be fixed by having `config_name` variable in addition to the `task_name`)
[ -1.212031602859497, -0.9085132479667664, -0.8070840239524841, 1.388117790222168, -0.09563277661800385, -1.3046938180923462, 0.18705661594867706, -1.072714924812317, 1.7088029384613037, -0.7775355577468872, 0.3182140588760376, -1.7652125358581543, 0.02877594530582428, -0.6242077350616455, -0.8823914527893066, -0.8301068544387817, -0.4763972759246826, -0.790575385093689, 1.0201280117034912, 2.4427804946899414, 1.1775400638580322, -1.441573977470398, 2.6889472007751465, 0.6213293075561523, -0.1268111616373062, -1.0168073177337646, 0.5479803681373596, -0.09210436046123505, -1.2550402879714966, -0.5496664643287659, -0.9350440502166748, -0.044753022491931915, -0.6042429208755493, -0.5795443058013916, -0.022375863045454025, 0.3905427157878876, -0.23317578434944153, -0.42519238591194153, -0.5330570936203003, -0.8266122341156006, 0.4133561849594116, -0.2837343215942383, 0.9415385127067566, -0.3570091724395752, 1.830862283706665, -0.5145905613899231, 0.3686865270137787, 0.7919183969497681, 1.3855704069137573, 0.1989719718694687, -0.047341831028461456, 0.260940283536911, 0.4331356883049011, -0.060447998344898224, 0.525595486164093, 1.1834577322006226, 0.7438599467277527, 0.529019832611084, 0.7090904712677002, -2.2234814167022705, 1.3657022714614868, -1.0260733366012573, 0.2911697030067444, 1.3633469343185425, -1.0100845098495483, 0.30389246344566345, -1.822053074836731, -0.026532623916864395, 0.444743275642395, -2.315272808074951, 0.21788538992404938, -1.2963062524795532, -0.4627123475074768, 0.9697188138961792, 0.276578813791275, -1.258981466293335, 0.1444041132926941, -0.3297247886657715, 1.0425622463226318, 0.43963271379470825, 1.24176824092865, -1.657928228378296, -0.05815466493368149, -0.3694148063659668, 0.0806855708360672, -1.230508804321289, -1.597572922706604, 0.47319531440734863, 0.6615082621574402, 0.43701982498168945, -0.20638984441757202, 1.0219788551330566, -0.9460507035255432, 0.8352514505386353, -0.9462267756462097, -1.6364350318908691, -1.421534538269043, -2.2032270431518555, -2.2989540100097656, 0.8183587789535522, -0.5187497735023499, -0.5342974662780762, 2.082500696182251, -1.0577430725097656, -1.7490200996398926, 1.0720149278640747, 0.20166555047035217, 0.060146745294332504, 2.3027544021606445, 0.1750306636095047, -0.6837174892425537, 0.3358989953994751, -0.6816710233688354, 0.8124791383743286, -0.43359431624412537, 1.409769058227539, 0.5137941241264343, -1.014269471168518, 1.5533102750778198, -0.36758556962013245, 0.4887239634990692, -0.7560635209083557, -0.4724113941192627, -0.7193613648414612, 0.31740909814834595, 1.8746002912521362, -0.39727404713630676, 1.5820963382720947, -0.37331265211105347, -1.6001726388931274, -1.5394588708877563, 0.8977230787277222, 0.4907124936580658, -0.8114723563194275, 0.1327531933784485, -0.35373443365097046, 0.1422937661409378, -0.028701886534690857, 1.1264785528182983, 1.2667170763015747, 0.6868135333061218, -0.3263653516769409, -0.8653849959373474, 0.2392382025718689, -0.0828443318605423, -0.7254930734634399, -1.7285938262939453, -0.308798223733902, 0.1388692557811737, 0.6576457023620605, -1.2224082946777344, 1.8056753873825073, 0.8327355980873108, 1.855696678161621, 0.9604793787002563, -0.37324759364128113, 1.5350030660629272, -0.020360540598630905, 1.8281358480453491, -0.4742065668106079, 0.5631811618804932, -0.28512611985206604, -1.1001383066177368, 0.9270350337028503, -0.32570701837539673, -2.0258703231811523, -0.7929384708404541, -0.7989293932914734, -0.1802597939968109, -0.7461689710617065, 0.9553382396697998, -0.2637577950954437, -1.307336449623108, 0.21900631487369537, -0.6384499073028564, 0.16479836404323578, -1.2551432847976685, 0.26737385988235474, 0.6251369714736938, -0.7123395204544067, 0.04392616078257561, -0.21975013613700867, -1.284714937210083, -0.5003167986869812, 0.3058009743690491, 1.8660576343536377, -0.7658030390739441, 0.8986751437187195, 1.065061330795288, -0.7431049346923828, -0.023668929934501648, 0.43537136912345886, -0.24689079821109772, 0.9154521822929382, -1.0666136741638184, -0.49212342500686646, 1.1431423425674438, -0.13841544091701508, -0.5721868872642517, 1.5373238325119019, 0.7411497831344604, -1.0574506521224976, -0.15526250004768372, -0.024320365861058235, -0.994443416595459, 0.060799870640039444, -1.6514561176300049, -0.16015826165676117, 0.3392625153064728, -1.59811270236969, -0.4895714521408081, -0.23991933465003967, 1.3332116603851318, -0.19250090420246124, 1.5089308023452759, -0.3610308766365051, -0.2356249988079071, -0.3891696035861969, -0.27836868166923523, 0.11045055091381073, -0.1670006513595581, -0.6591549515724182, 0.2467820644378662, -0.7554751634597778, 0.3485089838504791, 1.4207873344421387, 0.3562789261341095, -0.05161145702004433, 0.5883702039718628, 1.1851547956466675, 0.31717464327812195, 0.01234932616353035, -0.896282970905304, -1.502189040184021, 2.028691291809082, -1.4658180475234985, 1.953849196434021, 0.8226109147071838, 0.001252906396985054, -1.7403684854507446, -1.8186328411102295, 1.4228551387786865, 1.1803804636001587, 2.288712739944458, 0.5223386883735657, 0.4063636362552643, -0.8004904389381409, -0.5628853440284729, 0.40501728653907776, -1.0166677236557007, -0.8138067126274109, 0.11080549657344818, 2.346679925918579, 1.8613227605819702, -0.4590049386024475, -0.32409149408340454, -1.0093166828155518, 1.3551290035247803, -0.14896737039089203, 0.14527665078639984, 2.0038466453552246, -0.27587318420410156, -1.1100324392318726, 1.2105251550674438, -2.3135430812835693, 0.10697105526924133, 1.9633129835128784, 0.2583518922328949, 0.02551647275686264, -1.4367029666900635, -0.5693891644477844, -0.25918158888816833, -0.5200980305671692, -1.2173337936401367, 0.6003255248069763, -0.2688300609588623, -0.7398778796195984, -1.3973079919815063, 0.22033078968524933, -1.1196690797805786, -1.7429395914077759, 0.3215184211730957, 1.9011011123657227, 1.995404839515686, -0.7606282830238342, 1.5608409643173218, -0.32440006732940674, 0.2164141833782196, 1.3195853233337402, 1.1556745767593384, 3.1610381603240967, 1.9724606275558472, -1.3192366361618042, 0.6289083957672119, -0.19145269691944122, -0.5111391544342041, 1.155353307723999, -1.1150001287460327, 1.2361335754394531, -0.14592894911766052, -1.2255364656448364, -1.2100375890731812, 0.9496481418609619, 0.47113364934921265, 0.09098653495311737, -0.4838545024394989, 1.2124278545379639, 0.10254019498825073, 1.2367615699768066, 0.5197831988334656, -0.395651638507843, 0.6133244633674622, -0.36073508858680725, -0.5807567238807678, 1.5774447917938232, 0.23944276571273804, -1.3866585493087769, -2.2922422885894775, -0.24052703380584717, -0.8625234961509705, 0.049759503453969955, -0.6174371242523193, -0.9333977103233337, 1.6537660360336304, 0.4390210211277008, -1.375205397605896, -0.40504953265190125, -0.3971787989139557, -0.6276541352272034, 2.5978896617889404, -1.4678928852081299, -0.20174530148506165, -0.9865236878395081, -0.5734944343566895, 1.6955617666244507, -1.2202022075653076, -0.29740652441978455, -1.0619583129882812, -0.5681047439575195, -1.316770315170288, -0.5685344934463501, -0.005249119829386473, -0.8512541055679321, 0.7394442558288574, 0.18166275322437286, -1.129373550415039, -0.33984729647636414, -0.8349658846855164, 0.7989300489425659, -0.09979616105556488, 0.25366392731666565, 1.9017473459243774, 0.4404585361480713, -0.44078460335731506, 0.6862488389015198, 1.0522911548614502, 0.626940906047821, -0.503116250038147, 0.1984737664461136, -0.6201701164245605, 0.3760735094547272, -1.3454477787017822, 0.2699600160121918, -2.765681743621826, 0.6206942796707153, -0.10296767950057983, 0.026774026453495026, -0.0715949684381485, -1.3253048658370972, 1.0932761430740356, 2.5377466678619385, -1.2234838008880615, 0.4956149458885193, 0.30398309230804443, 1.1709107160568237, -1.6326704025268555, 0.36077114939689636, -0.38876697421073914, 2.1246554851531982, 0.11178059875965118, 1.1722763776779175, -0.39382612705230713, -2.240320920944214, 0.5879055857658386, -1.1465791463851929, -1.1438697576522827, 0.8158867359161377, -0.6705474257469177, -0.04754943028092384, -1.3577202558517456, -0.2867562472820282, -0.8456467390060425, -1.2291442155838013, 0.8695679306983948, 0.16775862872600555, 0.45146432518959045, -0.7428349256515503, 0.32171013951301575, -2.147648334503174, -1.2839710712432861, -0.24888832867145538, -0.9120697379112244, 0.41036078333854675, -0.380247563123703, 0.5641131401062012, -0.13663357496261597, 0.10172286629676819, 0.3198924660682678, 1.3770793676376343, 3.4503695964813232, 0.2526032328605652, 0.46004438400268555, -0.14376774430274963, -0.8836812973022461, 1.40993070602417, 0.8216261863708496, -0.09889896214008331, -0.5434535145759583, -1.0887601375579834, 1.2355989217758179, 1.8826860189437866, 0.9722673892974854, 0.08046197891235352, -0.7422784566879272, -0.7044573426246643, -0.06725209951400757, 0.17316879332065582, 0.5206944346427917, 0.9681381583213806, 0.055753182619810104, 0.06301325559616089, 1.341174602508545, 1.192167043685913, -0.363088995218277, 0.4760357141494751, -0.8145302534103394, -0.4209994673728943, 0.49417680501937866, 0.32073718309402466, -0.012391438707709312, 0.31273946166038513, -0.9818605780601501, -0.3178490102291107, -0.35198262333869934, -1.0045084953308105, -0.770897388458252, -0.42150557041168213, -0.28439754247665405, 1.637200117111206, 0.10909375548362732, -0.5821657776832581, -0.023035559803247452, -0.7256057858467102, -0.1276276856660843, -1.0612159967422485, 0.22342824935913086, -0.08882233500480652, -0.12355305254459381, -0.08077780902385712, 1.699965000152588, -0.8732622861862183, -2.0750784873962402, 0.33785000443458557, 0.2629547119140625, -0.3671591281890869, 0.27113163471221924, 1.6501315832138062, 0.5018695592880249, 1.391776442527771, 1.3794622421264648, 0.9419105052947998, -0.671823263168335, -1.3454405069351196, 0.6384737491607666, 0.9413223266601562, -1.41351318359375, 0.7831151485443115, 0.044883403927087784, -0.4976584017276764, 0.7507360577583313, 1.2484986782073975, 0.39675813913345337, -2.1023502349853516, 0.785974383354187, -0.835183322429657, 0.6847950220108032, 0.6371904611587524, 0.7939320802688599, 0.2408708930015564, 0.8629131317138672, -1.1535381078720093, -1.1768466234207153, -0.6671314835548401, -0.6686460971832275, 1.9767422676086426, -0.1932774782180786, 0.5595801472663879, -0.1724707931280136, -1.3504630327224731, -0.16034717857837677, 0.7493559122085571, 0.3392140567302704, -0.5026229023933411, 0.7002685070037842, -0.6788525581359863, -1.1083059310913086, -1.4354504346847534, -0.4382171630859375, -0.9953683018684387, -0.9149498343467712, 1.0331069231033325, 0.856954038143158, 0.21212977170944214, 1.9612218141555786, 0.6596665978431702, 0.15196271240711212, -2.6385347843170166, 0.8507388830184937, 0.3586290776729584, -0.06870610266923904, 0.9767846465110779, 0.31171196699142456, 0.9663534164428711, 0.012034500017762184, 0.5711150169372559, -2.432969331741333, 2.337813138961792, -0.3135644793510437, 0.7023878693580627, -0.080988809466362, -0.3398347795009613, 1.151024580001831, 0.5849754214286804, 0.6129372119903564, -1.1047919988632202, 0.7313543558120728, -0.6789158582687378, 1.2280783653259277, 0.9921451210975647, -0.8195437788963318, 0.020581433549523354, 1.3424335718154907, 0.48549553751945496, -0.5047556161880493, -0.9521102905273438, -1.0672332048416138, 0.963712751865387, 1.833228349685669, 0.0217572171241045, 0.03849760442972183, 0.8231178522109985, 0.746456503868103, -1.1874812841415405, 0.22527649998664856, -0.8022498488426208, -0.8286951780319214, 1.6052415370941162, 2.07090163230896, -0.1648487150669098, -0.21951468288898468, -0.807421863079071, -1.2009731531143188, 0.7857815623283386, 0.06011832877993584, 0.054829131811857224, 0.6937970519065857, -0.7065531611442566, 1.2125916481018066, 0.9125999212265015, 0.9217814803123474, 0.23305974900722504, 0.2912445366382599, 0.4010218381881714, -0.188808411359787, -1.1473768949508667, -0.22225582599639893, -1.2120906114578247, -2.5378665924072266, 0.44503265619277954, -0.18317675590515137, -1.395949125289917, -0.024647951126098633, -1.0114268064498901, 0.8210912346839905, -0.5709015727043152, -1.2300280332565308, -1.5126208066940308, 0.23488515615463257, -0.07591603696346283, 0.8878582119941711, -1.634905457496643, -0.11172616481781006, 1.2815431356430054, 0.8788739442825317, -0.5915752649307251, 0.919844925403595, 0.21729743480682373, 1.0648120641708374, 0.8485904335975647, -0.3897422254085541, 0.45437341928482056, 0.045163121074438095, -1.3490527868270874, 0.5216320157051086, 1.1704106330871582, 0.1445506066083908, 1.4959089756011963, -0.6282769441604614, 0.077114537358284, 0.3850286304950714, -0.5030631422996521, -0.4818190336227417, -0.6152539253234863, 0.7416673898696899, 0.03975079581141472, -0.8507878184318542, 0.12527485191822052, -0.12941844761371613, -0.17639529705047607, 0.2203613966703415, -1.4828375577926636, -0.2173858880996704, -0.31918320059776306, -0.5169394016265869, -1.2416713237762451, -0.06017941236495972, 1.3926491737365723, -0.7785419821739197, -0.24910664558410645, 0.5654991865158081, 0.38367602229118347, 0.5193465352058411, 0.5249636173248291, -0.6495295763015747, -0.3724246621131897, -0.24830946326255798, -0.36708226799964905, 0.34336936473846436, 1.3068753480911255, -0.15680919587612152, -0.9075286388397217, 0.7418433427810669, -0.37058568000793457, 0.07427628338336945, 1.9204144477844238, 0.11325560510158539, -0.7451866865158081, 0.4194786548614502, -0.6061179041862488, 1.884202241897583, 1.8030989170074463, 1.3095601797103882, -0.08128723502159119, -1.0153968334197998, 0.6248891949653625, -0.3300867974758148, -0.4173203408718109, 0.9666731953620911, 0.39212480187416077, -0.16275173425674438, -1.3851560354232788, 0.5153526663780212, 1.2859634160995483, -0.868992805480957, -0.8426178097724915, 0.006533556617796421, -0.8384284973144531, 1.1001170873641968, 0.6798484921455383, 0.4065121114253998, 0.15920890867710114, 1.6026495695114136, 0.6581367254257202, -0.34975260496139526, 0.5585060715675354, 0.44539299607276917, -0.16419605910778046, -2.164116382598877, -1.1869159936904907, 0.25768768787384033, -0.4621569812297821, -1.5410549640655518, 1.3528841733932495, -1.1803810596466064, -1.0178499221801758, 0.5148209929466248, 0.08345556259155273, 1.5290719270706177, 0.2837252914905548, 1.5577753782272339, 2.135338544845581, 0.8733595013618469, 0.3711858093738556, 1.2721670866012573, -0.08778500556945801, -0.4431426227092743, 1.8446239233016968, -0.460033655166626, 0.496579647064209, 1.0586062669754028, -0.3643532395362854, -1.0256227254867554, -0.8205069303512573, -1.233859658241272, -0.6676796078681946, 1.2268110513687134, -0.0033593354746699333, -1.0871456861495972, 0.2913207411766052, 1.549859642982483, 0.11611764132976532, -0.3006761372089386, 0.528018593788147, 0.47987067699432373, -0.7205461263656616, -0.04157142713665962, -0.8528541326522827, 0.526881992816925, -0.21113178133964539, -0.38101935386657715, 0.43847382068634033, 0.48926013708114624, 1.3619052171707153, 0.0031502749770879745, 0.14057956635951996, 1.2223862409591675, -1.4597270488739014, 1.523415207862854, -0.5236321091651917, 0.1791383922100067, -2.3916163444519043, 1.4475226402282715, -0.7786834239959717, 1.9230633974075317, -2.7047786712646484, 0.4086788296699524, -0.5811174511909485, -0.477821946144104, 0.37404391169548035, -0.39724522829055786, 0.1640440672636032, -0.1797817200422287, -1.086558222770691, -0.026567723602056503, -0.6661617159843445, 0.5858381986618042, 1.1312683820724487, 1.4545209407806396, -1.060604214668274, -0.26183056831359863, -1.7656478881835938, -0.11608697474002838, -0.6101551055908203, 0.36201900243759155, -2.030557870864868, -0.09073066711425781, -1.9814296960830688, -2.332728862762451, -1.3004118204116821, -0.8736423850059509, 1.0274091958999634, 0.22379235923290253, -0.8039894700050354, 1.070060133934021, -0.448763906955719, -1.8356907367706299, 1.0396361351013184, -2.107534885406494 ]
https://github.com/huggingface/datasets/issues/4456
Workflow for Tabular data
I use below to load a dataset: ``` dataset = datasets.load_dataset("scikit-learn/auto-mpg") df = pd.DataFrame(dataset["train"]) ``` TBH as said, tabular folk split their own dataset, they sometimes have two splits, sometimes three. Maybe somehow avoiding it for tabular datasets might be good for later. (it's just UX improvement)
Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion !
724
47
Workflow for Tabular data Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion ! I use below to load a dataset: ``` dataset = datasets.load_dataset("scikit-learn/auto-mpg") df = pd.DataFrame(dataset["train"]) ``` TBH as said, tabular folk split their own dataset, they sometimes have two splits, sometimes three. Maybe somehow avoiding it for tabular datasets might be good for later. (it's just UX improvement)
[ -1.2587257623672485, -0.9613173007965088, -0.6441880464553833, 1.3759702444076538, -0.15172450244426727, -1.169630527496338, 0.12735439836978912, -1.1366373300552368, 1.6928726434707642, -0.8903157711029053, 0.3346561789512634, -1.729291319847107, 0.008818191476166248, -0.5960850119590759, -0.7456956505775452, -0.9596385359764099, -0.5061373114585876, -0.8146231770515442, 1.0314524173736572, 2.5221383571624756, 1.1594412326812744, -1.445844054222107, 2.6391704082489014, 0.6313457489013672, -0.15132425725460052, -0.9742680788040161, 0.5203883647918701, 0.09043671935796738, -1.2534210681915283, -0.36333563923835754, -0.994192898273468, -0.09150172024965286, -0.6327378749847412, -0.5035575032234192, -0.02461821958422661, 0.369048535823822, -0.3562137484550476, -0.3540971279144287, -0.4954138696193695, -0.7944408059120178, 0.5143169164657593, -0.33608439564704895, 0.9946663975715637, -0.36498937010765076, 1.876128077507019, -0.5259292721748352, 0.4680819809436798, 0.640326738357544, 1.3727374076843262, 0.22741079330444336, -0.029711786657571793, 0.2963734269142151, 0.35848623514175415, -0.04483393207192421, 0.5272700786590576, 1.1803184747695923, 0.6277042627334595, 0.5455582737922668, 0.7218312621116638, -2.1900360584259033, 1.3213367462158203, -1.0225489139556885, 0.3494434654712677, 1.4552781581878662, -0.9357386231422424, 0.4431309401988983, -1.760860562324524, -0.15355068445205688, 0.5130323171615601, -2.2527248859405518, 0.1876218169927597, -1.2013260126113892, -0.4617946445941925, 1.0069139003753662, 0.3780962824821472, -1.144275188446045, 0.33123907446861267, -0.43219417333602905, 1.0455822944641113, 0.4548095166683197, 1.1835181713104248, -1.7275997400283813, -0.06456641852855682, -0.30891790986061096, 0.12016041576862335, -1.297370195388794, -1.5982662439346313, 0.5377417206764221, 0.6405004858970642, 0.5866372585296631, -0.07289449870586395, 1.001426339149475, -1.081995964050293, 0.7438521385192871, -1.0636793375015259, -1.5598289966583252, -1.3265550136566162, -2.221173048019409, -2.4038147926330566, 0.7714537382125854, -0.42690521478652954, -0.5266711711883545, 2.0423712730407715, -0.9984370470046997, -1.7209928035736084, 1.2330920696258545, 0.35339710116386414, -0.0463959202170372, 2.4650659561157227, 0.18885929882526398, -0.6701761484146118, 0.5127352476119995, -0.6944466829299927, 0.8648659586906433, -0.3443391025066376, 1.4232121706008911, 0.4801309406757355, -1.083266019821167, 1.5703940391540527, -0.39304080605506897, 0.5769220590591431, -0.6179922819137573, -0.5915228128433228, -0.7307223677635193, 0.35138073563575745, 1.8101896047592163, -0.3053150475025177, 1.5739144086837769, -0.3296968340873718, -1.5665462017059326, -1.6639044284820557, 0.9401383399963379, 0.4370483458042145, -0.7088142037391663, -0.01219949685037136, -0.27504557371139526, 0.11669327318668365, 0.012494225986301899, 1.1329090595245361, 1.1392360925674438, 0.7109069228172302, -0.277058482170105, -0.9183613061904907, 0.14465944468975067, -0.12068544328212738, -0.670071005821228, -1.7042524814605713, -0.40377238392829895, 0.13402070105075836, 0.5371785759925842, -1.1522713899612427, 1.7631852626800537, 0.9482647776603699, 1.8879706859588623, 0.9508706331253052, -0.3279940187931061, 1.4614208936691284, 0.10772310942411423, 1.791558861732483, -0.459475040435791, 0.6949397921562195, -0.32484138011932373, -1.2081719636917114, 0.8275917768478394, -0.3969957232475281, -2.043358564376831, -0.7801351547241211, -0.7722879648208618, -0.19616684317588806, -0.7725854516029358, 0.9585312008857727, -0.25749942660331726, -1.421636939048767, 0.3031543493270874, -0.6200839281082153, 0.16217869520187378, -1.1502374410629272, 0.3580057919025421, 0.7269096970558167, -0.7174447178840637, 0.006570927798748016, -0.22546350955963135, -1.289485216140747, -0.4179353713989258, 0.2538042664527893, 1.888167381286621, -0.7896615862846375, 0.8218091726303101, 1.0559399127960205, -0.7366009950637817, 0.01931699737906456, 0.25666773319244385, -0.2548363506793976, 0.8190551400184631, -1.0348533391952515, -0.42268338799476624, 1.2390040159225464, -0.17030885815620422, -0.629490315914154, 1.4689815044403076, 0.7043213844299316, -0.9748354554176331, -0.1713782399892807, -0.16083268821239471, -0.8441804051399231, -0.023912325501441956, -1.5513477325439453, -0.10218032449483871, 0.33036544919013977, -1.5047298669815063, -0.45596349239349365, -0.29232555627822876, 1.2453278303146362, -0.24620352685451508, 1.381062626838684, -0.40251508355140686, -0.24523401260375977, -0.419257253408432, -0.5246553421020508, 0.12735074758529663, -0.19668926298618317, -0.5900713801383972, 0.20460443198680878, -0.8585566282272339, 0.3433323800563812, 1.5102156400680542, 0.36890673637390137, 0.06423567980527878, 0.4386431574821472, 1.0819916725158691, 0.39089128375053406, -0.09290071576833725, -0.876636803150177, -1.5315985679626465, 2.035245656967163, -1.432775616645813, 1.9342827796936035, 0.7745652198791504, -0.00046927761286497116, -1.7960995435714722, -1.7662880420684814, 1.3197681903839111, 1.1892502307891846, 2.411282539367676, 0.5331260561943054, 0.3620096743106842, -0.7780401706695557, -0.6723018288612366, 0.41023021936416626, -1.0061941146850586, -0.7341901063919067, 0.17618443071842194, 2.3386714458465576, 1.758873462677002, -0.45811355113983154, -0.21655738353729248, -1.0164543390274048, 1.4530829191207886, -0.19765758514404297, 0.1882999837398529, 2.0253801345825195, -0.40355926752090454, -1.153475284576416, 1.381463646888733, -2.3637688159942627, 0.10789191722869873, 1.9296412467956543, 0.33242592215538025, 0.02201830968260765, -1.3870295286178589, -0.6422979831695557, -0.26589277386665344, -0.4029345214366913, -1.3101502656936646, 0.4999745488166809, -0.26514124870300293, -0.7157595753669739, -1.5186153650283813, 0.13833606243133545, -1.234283447265625, -1.6001760959625244, 0.25712162256240845, 1.7738350629806519, 2.085134506225586, -0.8104987740516663, 1.4990556240081787, -0.2405901402235031, 0.21203821897506714, 1.183381199836731, 1.199017882347107, 3.086400032043457, 1.8521957397460938, -1.2895756959915161, 0.5882028341293335, -0.17248699069023132, -0.4825451970100403, 1.144761085510254, -1.1552942991256714, 1.3360649347305298, -0.1544611006975174, -1.2472457885742188, -1.2590070962905884, 1.0016348361968994, 0.43483680486679077, 0.1453663408756256, -0.565519392490387, 1.1832574605941772, 0.07099044322967529, 1.3083263635635376, 0.4799436330795288, -0.29298871755599976, 0.5666133761405945, -0.42938143014907837, -0.6302773952484131, 1.5877041816711426, 0.18471913039684296, -1.4236068725585938, -2.3159539699554443, -0.27475935220718384, -0.8243170976638794, -0.0062621599063277245, -0.5705745816230774, -0.984085202217102, 1.6373103857040405, 0.34222477674484253, -1.2990180253982544, -0.2065933644771576, -0.3017446994781494, -0.5823684334754944, 2.6710257530212402, -1.424562931060791, -0.16776032745838165, -0.9702786803245544, -0.6074879169464111, 1.60483717918396, -1.165148138999939, -0.1558004468679428, -1.0007158517837524, -0.6537760496139526, -1.3673603534698486, -0.5100811123847961, 0.02826940268278122, -0.9821598529815674, 0.756637692451477, 0.19358812272548676, -1.108552098274231, -0.3050733804702759, -0.8942680358886719, 0.8746148347854614, -0.15331953763961792, 0.3173484206199646, 1.8421787023544312, 0.44229069352149963, -0.4103375971317291, 0.7078574299812317, 1.180985689163208, 0.6972018480300903, -0.6373035907745361, 0.14827454090118408, -0.7980127334594727, 0.29758983850479126, -1.2879592180252075, 0.3274720311164856, -2.8380489349365234, 0.7034944891929626, -0.09166460484266281, -0.14407409727573395, 0.05061004310846329, -1.3095810413360596, 1.0692238807678223, 2.6040661334991455, -1.188905119895935, 0.4589228928089142, 0.34643277525901794, 1.1635044813156128, -1.5397779941558838, 0.2646421492099762, -0.3549732565879822, 2.049522876739502, 0.18433211743831635, 1.0967437028884888, -0.5234810709953308, -2.3093185424804688, 0.5619029998779297, -1.3566176891326904, -1.191562533378601, 0.8170251250267029, -0.9424853920936584, 0.07383376359939575, -1.4194610118865967, -0.1855621039867401, -0.9440050721168518, -1.215470790863037, 0.7103884816169739, 0.09681593626737595, 0.48082149028778076, -0.613641083240509, 0.3548395037651062, -2.165025472640991, -1.4250187873840332, -0.2708652913570404, -0.9532535076141357, 0.4449259042739868, -0.3059256970882416, 0.6922107934951782, -0.22907130420207977, 0.03828443959355354, 0.3493446409702301, 1.4165910482406616, 3.343226194381714, 0.2534080445766449, 0.3520815670490265, -0.10411396622657776, -0.9810264110565186, 1.444278359413147, 0.9528458118438721, -0.04146318882703781, -0.520190954208374, -1.0242441892623901, 1.212903380393982, 1.9422551393508911, 1.0392569303512573, 0.010588324628770351, -0.779373049736023, -0.6550693511962891, -0.002846422605216503, 0.206705242395401, 0.5391732454299927, 0.8515456914901733, -0.024584263563156128, 0.20125551521778107, 1.4080640077590942, 1.2660869359970093, -0.42500558495521545, 0.3078013062477112, -0.7921997904777527, -0.5761431455612183, 0.4738042652606964, 0.2873430550098419, 0.0508030503988266, 0.3905043601989746, -0.9621791243553162, -0.25860318541526794, -0.47842153906822205, -0.9729049205780029, -0.7249412536621094, -0.4652014672756195, -0.39338386058807373, 1.6488280296325684, 0.10019388049840927, -0.5352889895439148, 0.025943666696548462, -0.737065315246582, -0.1785764843225479, -1.119156002998352, 0.26647472381591797, -0.08942513167858124, -0.15260851383209229, -0.12066764384508133, 1.7773374319076538, -0.9871127009391785, -2.1008925437927246, 0.17150276899337769, 0.22380343079566956, -0.40160486102104187, 0.14527657628059387, 1.6619457006454468, 0.4585198163986206, 1.4836164712905884, 1.3723396062850952, 0.9904401898384094, -0.639610767364502, -1.3128963708877563, 0.7856544256210327, 0.9461050629615784, -1.3215376138687134, 0.8787348866462708, 0.04868291690945625, -0.5503374338150024, 0.7317571043968201, 1.2176132202148438, 0.4768586754798889, -1.9715865850448608, 0.7771211862564087, -0.9796274304389954, 0.7589694857597351, 0.6933032274246216, 0.6931086182594299, 0.1309581845998764, 0.8188495635986328, -1.2534724473953247, -1.1894479990005493, -0.7327335476875305, -0.5977357625961304, 1.9531182050704956, -0.22531390190124512, 0.6288855075836182, -0.22852784395217896, -1.3167476654052734, -0.02533019706606865, 0.7838965654373169, 0.35730698704719543, -0.4519287347793579, 0.83088219165802, -0.7109240293502808, -1.0078812837600708, -1.4260600805282593, -0.3784298896789551, -1.0583672523498535, -0.8680016398429871, 1.1641767024993896, 0.8506434559822083, 0.2069723904132843, 1.868351936340332, 0.6995893716812134, 0.3136386573314667, -2.566002130508423, 0.8499950170516968, 0.2388891577720642, -0.18384712934494019, 0.8175129890441895, 0.30219483375549316, 0.9329980611801147, -0.024096574634313583, 0.5167004466056824, -2.347257137298584, 2.3172693252563477, -0.2168610394001007, 0.7105432748794556, -0.06423912942409515, -0.12720619142055511, 1.171220302581787, 0.5414656400680542, 0.49161386489868164, -1.1413739919662476, 0.6641126275062561, -0.47751227021217346, 1.1573171615600586, 0.9466181397438049, -0.8475844860076904, -0.009231171570718288, 1.3582862615585327, 0.5007767081260681, -0.44931551814079285, -0.9189537763595581, -0.9084876179695129, 0.9556964635848999, 1.7197940349578857, -0.11026087403297424, -0.018847253173589706, 0.9213029146194458, 0.6867756843566895, -1.3878192901611328, 0.12371157109737396, -0.6096981763839722, -0.7545316219329834, 1.6213983297348022, 2.0007643699645996, -0.08688762038946152, -0.22099821269512177, -0.6883074641227722, -1.2205480337142944, 0.8144214749336243, 0.0797409862279892, 0.16634297370910645, 0.6269747614860535, -0.6536142826080322, 1.1685717105865479, 0.9772590398788452, 0.8325513005256653, 0.18836583197116852, 0.2666504979133606, 0.3843955993652344, -0.35538265109062195, -1.125964641571045, -0.12478183209896088, -1.0144071578979492, -2.5444517135620117, 0.4862111210823059, -0.1947977989912033, -1.4706569910049438, -0.02378183789551258, -1.0208539962768555, 0.9239448308944702, -0.5715768337249756, -1.040122628211975, -1.620654821395874, 0.3087919354438782, -0.027095623314380646, 0.9775647521018982, -1.6072065830230713, -0.08799038082361221, 1.140016794204712, 0.9007889628410339, -0.5776406526565552, 1.0180450677871704, 0.24519941210746765, 0.9530563354492188, 0.7856485247612, -0.4376377761363983, 0.5630155205726624, 0.09207481890916824, -1.3777772188186646, 0.3247346878051758, 1.118582010269165, 0.15792495012283325, 1.3655146360397339, -0.517425537109375, 0.01765913888812065, 0.37390902638435364, -0.5076586008071899, -0.46916383504867554, -0.5334667563438416, 0.6812993884086609, 0.06601782143115997, -0.8541176319122314, 0.03376080095767975, -0.050542786717414856, -0.34100663661956787, 0.28824254870414734, -1.467934012413025, -0.18057948350906372, -0.48532065749168396, -0.5555399060249329, -1.2347242832183838, -0.007907460443675518, 1.4807542562484741, -0.775783121585846, -0.18496759235858917, 0.5422410368919373, 0.3955777585506439, 0.5132304430007935, 0.6034616827964783, -0.7181134819984436, -0.2474568635225296, -0.29618027806282043, -0.29801812767982483, 0.2804534137248993, 1.3042337894439697, -0.19705380499362946, -0.9968982338905334, 0.7620664834976196, -0.34065496921539307, 0.07804100215435028, 1.9038041830062866, 0.12069782614707947, -0.84659343957901, 0.3122496008872986, -0.7476648092269897, 1.904495120048523, 1.8705849647521973, 1.4340311288833618, -0.09099912643432617, -0.9165516495704651, 0.6781035661697388, -0.3231119215488434, -0.31066563725471497, 1.04710054397583, 0.3852987289428711, -0.1685733199119568, -1.4523379802703857, 0.680836021900177, 1.295872449874878, -0.8067414164543152, -0.7366682291030884, 0.14567488431930542, -0.8900933265686035, 1.044448971748352, 0.6223931908607483, 0.4337233603000641, 0.2037757784128189, 1.6176245212554932, 0.7700216770172119, -0.38177958130836487, 0.570235550403595, 0.6062304377555847, -0.13493883609771729, -2.1010916233062744, -1.2459194660186768, 0.2708218991756439, -0.5592986941337585, -1.5928014516830444, 1.409677505493164, -1.1417399644851685, -0.9545049071311951, 0.5348795056343079, 0.00547746941447258, 1.5310263633728027, 0.35609954595565796, 1.5478395223617554, 2.1171581745147705, 0.884910523891449, 0.3497464954853058, 1.3949123620986938, -0.10685508698225021, -0.33531689643859863, 1.8248835802078247, -0.4710130989551544, 0.42397093772888184, 1.1019697189331055, -0.27800583839416504, -1.0216788053512573, -0.7614361047744751, -1.1636070013046265, -0.6431891322135925, 1.148803949356079, 0.08048033714294434, -1.0949584245681763, 0.28095579147338867, 1.6197947263717651, 0.00604241993278265, -0.27519848942756653, 0.5663188099861145, 0.442554771900177, -0.8018047213554382, -0.03955984488129616, -0.9346150755882263, 0.5452747344970703, -0.20400211215019226, -0.2626444101333618, 0.29222068190574646, 0.4120926260948181, 1.3146365880966187, -0.024488743394613266, 0.1776769906282425, 1.1163299083709717, -1.4755803346633911, 1.3918468952178955, -0.6216700673103333, 0.22912585735321045, -2.382739305496216, 1.3955464363098145, -0.6990246176719666, 1.876725435256958, -2.657640218734741, 0.49031537771224976, -0.646186113357544, -0.5229658484458923, 0.3983396291732788, -0.47651544213294983, 0.1263931840658188, -0.10862873494625092, -1.1057690382003784, -0.106706902384758, -0.6368959546089172, 0.6301867365837097, 1.1173776388168335, 1.3656840324401855, -1.074884057044983, -0.5021554827690125, -1.6786391735076904, -0.1857597678899765, -0.6861696243286133, 0.3179001808166504, -2.0465312004089355, -0.2295580357313156, -1.9396727085113525, -2.4118857383728027, -1.342808485031128, -0.7828627824783325, 1.1341512203216553, 0.12189590930938721, -0.9762330055236816, 1.2140976190567017, -0.43828442692756653, -1.8725863695144653, 1.1897878646850586, -2.1614458560943604 ]
https://github.com/huggingface/datasets/issues/4456
Workflow for Tabular data
is very slow batch access of a dataset (tabular, csv) with many columns to be expected?
Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion !
724
16
Workflow for Tabular data Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion ! is very slow batch access of a dataset (tabular, csv) with many columns to be expected?
[ -1.2690353393554688, -0.955466628074646, -0.6565491557121277, 1.3583579063415527, -0.12861062586307526, -1.1951669454574585, 0.12468445301055908, -1.1579457521438599, 1.6440989971160889, -0.916862428188324, 0.33655720949172974, -1.7025840282440186, 0.038430605083703995, -0.6543622016906738, -0.7408724427223206, -0.9234357476234436, -0.4961756765842438, -0.8080763220787048, 0.9909436106681824, 2.530155897140503, 1.1559302806854248, -1.459236979484558, 2.635316848754883, 0.6680055260658264, -0.15033908188343048, -0.9991654753684998, 0.5355072617530823, 0.07276977598667145, -1.2318955659866333, -0.4097968339920044, -0.9644052386283875, -0.0963757112622261, -0.6246163249015808, -0.46467888355255127, -0.040493905544281006, 0.32569751143455505, -0.31269797682762146, -0.2863653898239136, -0.49783816933631897, -0.8054268956184387, 0.5258890986442566, -0.3360547721385956, 0.9990125298500061, -0.3711816072463989, 1.8734980821609497, -0.5216675400733948, 0.4487456679344177, 0.6716822981834412, 1.446425437927246, 0.20784054696559906, -0.0363578163087368, 0.27666571736335754, 0.3251686990261078, -0.07833332568407059, 0.5206136107444763, 1.1381146907806396, 0.6121062636375427, 0.518206000328064, 0.7048320174217224, -2.208022356033325, 1.3436663150787354, -1.0465306043624878, 0.3615935742855072, 1.4781579971313477, -0.9298893213272095, 0.4431582987308502, -1.74984610080719, -0.15911135077476501, 0.5280003547668457, -2.2796125411987305, 0.17426708340644836, -1.1380070447921753, -0.448275089263916, 0.9944897294044495, 0.34303581714630127, -1.164995789527893, 0.33843836188316345, -0.43162333965301514, 1.0251288414001465, 0.4879436194896698, 1.1664243936538696, -1.6976391077041626, -0.08752446621656418, -0.312677800655365, 0.11307200789451599, -1.3748540878295898, -1.5975083112716675, 0.520504891872406, 0.652042806148529, 0.5629020929336548, -0.027241677045822144, 0.9626513123512268, -1.0899840593338013, 0.7962854504585266, -1.056551218032837, -1.514272689819336, -1.345267653465271, -2.2175540924072266, -2.378098726272583, 0.7782712578773499, -0.4440879225730896, -0.5303571224212646, 2.0064659118652344, -1.0332633256912231, -1.7238867282867432, 1.2639179229736328, 0.3412432372570038, -0.03485039994120598, 2.4914474487304688, 0.166371688246727, -0.6534110903739929, 0.48484399914741516, -0.6555646061897278, 0.8561676144599915, -0.3865221440792084, 1.376968264579773, 0.45922955870628357, -1.1193101406097412, 1.5871503353118896, -0.4571468234062195, 0.5403231978416443, -0.6200184226036072, -0.6127064228057861, -0.7635433077812195, 0.3819672167301178, 1.7579299211502075, -0.27390211820602417, 1.5589739084243774, -0.3106689453125, -1.54380464553833, -1.6870652437210083, 0.9343902468681335, 0.3965546190738678, -0.737130880355835, 0.01714424043893814, -0.31161391735076904, 0.1254979968070984, -0.006333718076348305, 1.1006509065628052, 1.1616010665893555, 0.6586044430732727, -0.25245413184165955, -0.8818334341049194, 0.17762251198291779, -0.12482751160860062, -0.6740177273750305, -1.7418032884597778, -0.4404517412185669, 0.12925167381763458, 0.5607503056526184, -1.1350826025009155, 1.8185553550720215, 0.9766520261764526, 1.8681552410125732, 0.9676535129547119, -0.28973039984703064, 1.4987245798110962, 0.0770331472158432, 1.7976675033569336, -0.4582250118255615, 0.7280727624893188, -0.33299461007118225, -1.2086420059204102, 0.7922225594520569, -0.4210529029369354, -2.066485643386841, -0.7898483276367188, -0.7598381638526917, -0.21599166095256805, -0.7553538680076599, 0.9811097383499146, -0.26833418011665344, -1.366604208946228, 0.30449947714805603, -0.6061882376670837, 0.21019163727760315, -1.1349222660064697, 0.39308062195777893, 0.7546586990356445, -0.7112220525741577, -0.017727870494127274, -0.24040721356868744, -1.281906247138977, -0.38445714116096497, 0.21909743547439575, 1.8775540590286255, -0.8145759701728821, 0.781836986541748, 1.008459210395813, -0.675944983959198, 0.045874424278736115, 0.2939535975456238, -0.27408313751220703, 0.7984878420829773, -0.9975234270095825, -0.42122337222099304, 1.2544043064117432, -0.1783626824617386, -0.649478554725647, 1.5025830268859863, 0.7457326650619507, -0.9602745771408081, -0.1467648595571518, -0.20766505599021912, -0.8721233010292053, -0.03141200169920921, -1.5734891891479492, -0.06951052695512772, 0.3142031133174896, -1.4944638013839722, -0.428916335105896, -0.2429189234972, 1.2740370035171509, -0.2615589499473572, 1.4228581190109253, -0.475753515958786, -0.2604053318500519, -0.396126389503479, -0.529930830001831, 0.20340748131275177, -0.19043266773223877, -0.6086663007736206, 0.2054886519908905, -0.8558209538459778, 0.3648386001586914, 1.5067768096923828, 0.4099685251712799, 0.09244820475578308, 0.4716235399246216, 1.0536680221557617, 0.33881524205207825, -0.0840090736746788, -0.8763318657875061, -1.5374881029129028, 2.073859930038452, -1.4292678833007812, 1.9853808879852295, 0.7874787449836731, -0.016997138038277626, -1.783644199371338, -1.7487287521362305, 1.2849024534225464, 1.1968448162078857, 2.361394166946411, 0.5109615921974182, 0.3564271926879883, -0.8238744735717773, -0.6579597592353821, 0.4103865921497345, -1.0366791486740112, -0.7468322515487671, 0.11617261171340942, 2.3406972885131836, 1.7879184484481812, -0.4849863648414612, -0.19660402834415436, -1.0308678150177002, 1.4577791690826416, -0.20876088738441467, 0.21862635016441345, 2.0561540126800537, -0.4206729531288147, -1.1672255992889404, 1.4076662063598633, -2.415243148803711, 0.10966657102108002, 1.9482204914093018, 0.2958974838256836, 0.003249061293900013, -1.3612738847732544, -0.5764771103858948, -0.26543429493904114, -0.38159283995628357, -1.2840917110443115, 0.5244950652122498, -0.25598037242889404, -0.6841699481010437, -1.4846901893615723, 0.1374596357345581, -1.2462191581726074, -1.58591628074646, 0.3466261923313141, 1.6908339262008667, 2.11099910736084, -0.768703281879425, 1.4917162656784058, -0.2014341801404953, 0.24920980632305145, 1.1685620546340942, 1.2130779027938843, 3.1024861335754395, 1.8410507440567017, -1.3033201694488525, 0.5614312291145325, -0.1997697353363037, -0.492135226726532, 1.109565258026123, -1.140096664428711, 1.3470226526260376, -0.11690940707921982, -1.27166748046875, -1.2643742561340332, 0.9871566295623779, 0.4178919494152069, 0.1737089306116104, -0.5951351523399353, 1.2032121419906616, 0.06157349795103073, 1.3410171270370483, 0.4708993434906006, -0.2884291112422943, 0.4937343895435333, -0.4400586783885956, -0.6795700192451477, 1.6179555654525757, 0.21147117018699646, -1.4413032531738281, -2.3337297439575195, -0.26546940207481384, -0.8198428750038147, -0.015032695606350899, -0.5966168642044067, -0.9604641795158386, 1.6570266485214233, 0.32828137278556824, -1.2972277402877808, -0.24430425465106964, -0.28644680976867676, -0.5654651522636414, 2.684561014175415, -1.4878767728805542, -0.18537428975105286, -0.9467436075210571, -0.586589515209198, 1.6032947301864624, -1.2293758392333984, -0.13725711405277252, -1.0157902240753174, -0.6682016849517822, -1.3365002870559692, -0.48607271909713745, -0.018173785880208015, -1.0043237209320068, 0.7783926129341125, 0.23050957918167114, -1.1132315397262573, -0.3487272560596466, -0.9109164476394653, 0.8591315746307373, -0.1270674169063568, 0.39373499155044556, 1.7659080028533936, 0.47711262106895447, -0.4273163974285126, 0.7480227947235107, 1.2055237293243408, 0.6726189255714417, -0.6316806674003601, 0.11514642834663391, -0.7921059727668762, 0.32004314661026, -1.2663302421569824, 0.3366929292678833, -2.8822553157806396, 0.713806688785553, -0.09545110166072845, -0.1565128117799759, 0.008666167967021465, -1.325638771057129, 1.095786452293396, 2.611706256866455, -1.143987774848938, 0.4413544237613678, 0.3530596196651459, 1.1898667812347412, -1.4997191429138184, 0.27963945269584656, -0.3520934581756592, 2.0553970336914062, 0.16796272993087769, 1.074722409248352, -0.5409380197525024, -2.324341297149658, 0.5690828561782837, -1.3673585653305054, -1.1704561710357666, 0.8397518396377563, -0.9495154023170471, 0.03966384008526802, -1.4139505624771118, -0.1602289229631424, -0.9648112058639526, -1.1858806610107422, 0.7199164032936096, 0.09424474835395813, 0.5012331604957581, -0.6275438666343689, 0.32026761770248413, -2.182924747467041, -1.425976276397705, -0.24625271558761597, -0.935539186000824, 0.42918720841407776, -0.3036002516746521, 0.6792008876800537, -0.22371649742126465, 0.06893116235733032, 0.3484326899051666, 1.4433562755584717, 3.3066792488098145, 0.26881885528564453, 0.4270491600036621, -0.16405832767486572, -0.9336409568786621, 1.4475325345993042, 0.907080888748169, -0.01742955856025219, -0.5351793766021729, -0.9898751974105835, 1.2344220876693726, 1.9029176235198975, 1.0233948230743408, -0.020047927275300026, -0.7784318923950195, -0.5959861278533936, -0.05211948975920677, 0.22241464257240295, 0.5821298360824585, 0.885039746761322, -0.11268496513366699, 0.18800218403339386, 1.4149705171585083, 1.3382025957107544, -0.446158230304718, 0.31344321370124817, -0.7538674473762512, -0.5610847473144531, 0.48088717460632324, 0.30056801438331604, 0.05276370793581009, 0.4220825135707855, -0.9158462882041931, -0.2649975121021271, -0.4492081105709076, -0.9498040080070496, -0.7114244103431702, -0.5216802954673767, -0.41564619541168213, 1.6453036069869995, 0.13152988255023956, -0.5007486343383789, 0.05170387774705887, -0.7432036399841309, -0.19567205011844635, -1.1279797554016113, 0.2389538735151291, -0.04056717827916145, -0.15491795539855957, -0.1379389464855194, 1.775266408920288, -0.9976634383201599, -2.114122152328491, 0.1878848522901535, 0.21799379587173462, -0.3983439803123474, 0.12607279419898987, 1.6595838069915771, 0.4010974168777466, 1.4877630472183228, 1.376536250114441, 0.9724803566932678, -0.6565832495689392, -1.2739107608795166, 0.807116687297821, 0.9588797092437744, -1.373736023902893, 0.8909927010536194, 0.05390830710530281, -0.5998603105545044, 0.7447279691696167, 1.1754313707351685, 0.44842398166656494, -1.982488751411438, 0.8121945858001709, -1.0237348079681396, 0.7761648893356323, 0.705488383769989, 0.6317949295043945, 0.1657128632068634, 0.8374384641647339, -1.2352187633514404, -1.2052713632583618, -0.7567001581192017, -0.5928786993026733, 1.9567272663116455, -0.22185125946998596, 0.6214923858642578, -0.14253810048103333, -1.3361667394638062, -0.04567912220954895, 0.7845991849899292, 0.33845528960227966, -0.40093761682510376, 0.8466843962669373, -0.7458720207214355, -1.0083856582641602, -1.4281984567642212, -0.38356831669807434, -1.0446468591690063, -0.8682453036308289, 1.2116844654083252, 0.8831859827041626, 0.1381707787513733, 1.8748947381973267, 0.6727368235588074, 0.305617094039917, -2.5189263820648193, 0.8274416923522949, 0.20962423086166382, -0.20899999141693115, 0.815203845500946, 0.27941519021987915, 0.9378339052200317, 0.026669930666685104, 0.4769129157066345, -2.422884464263916, 2.3357110023498535, -0.22561533749103546, 0.6982380747795105, -0.08317200839519501, -0.09973108023405075, 1.1870447397232056, 0.5367394685745239, 0.47678595781326294, -1.1249343156814575, 0.6575499773025513, -0.4822058081626892, 1.1526761054992676, 0.9661560654640198, -0.8560581803321838, 0.00345813762396574, 1.31179940700531, 0.4674854278564453, -0.4643773138523102, -0.9169726371765137, -0.9148886799812317, 0.9543480277061462, 1.7400896549224854, -0.07697216421365738, -0.002019117586314678, 0.8902923464775085, 0.7079917788505554, -1.3530200719833374, 0.12171295285224915, -0.639249861240387, -0.7801079750061035, 1.569047212600708, 1.988400936126709, -0.07441620528697968, -0.16044771671295166, -0.6929423213005066, -1.2169774770736694, 0.7989677786827087, 0.05513329058885574, 0.1863163560628891, 0.5868444442749023, -0.657115638256073, 1.146425485610962, 1.0057668685913086, 0.846556544303894, 0.19699856638908386, 0.2659512758255005, 0.35003480315208435, -0.34212544560432434, -1.1140198707580566, -0.14289139211177826, -1.0644291639328003, -2.588301420211792, 0.49769434332847595, -0.2499203383922577, -1.468572735786438, -0.012827855534851551, -0.9960988163948059, 0.8868781924247742, -0.5657654404640198, -1.031876802444458, -1.6241756677627563, 0.3101278245449066, -0.06974276155233383, 0.9615975022315979, -1.584364891052246, -0.06789375096559525, 1.1215723752975464, 0.8739266395568848, -0.5191060900688171, 1.027114748954773, 0.29328712821006775, 0.9710046052932739, 0.772290825843811, -0.48050662875175476, 0.549568772315979, 0.09332511574029922, -1.3923215866088867, 0.3427591323852539, 1.1107860803604126, 0.14173637330532074, 1.3446038961410522, -0.49916884303092957, 0.050212882459163666, 0.344511479139328, -0.515952467918396, -0.472231924533844, -0.5407059788703918, 0.7455123662948608, 0.06340667605400085, -0.8695358037948608, 0.04624543339014053, -0.09960100799798965, -0.3935433030128479, 0.26623502373695374, -1.4736618995666504, -0.16874706745147705, -0.4947477877140045, -0.525102436542511, -1.298776388168335, 0.03190560266375542, 1.4733165502548218, -0.745029091835022, -0.16269315779209137, 0.5266737341880798, 0.4502655267715454, 0.5618934035301208, 0.6493222117424011, -0.7083918452262878, -0.2667081356048584, -0.2929069399833679, -0.26921799778938293, 0.3282904326915741, 1.2592540979385376, -0.19162669777870178, -0.943861186504364, 0.7734241485595703, -0.3350944221019745, 0.07389174401760101, 1.9380618333816528, 0.17459861934185028, -0.8258534073829651, 0.3378780484199524, -0.743826150894165, 1.9005982875823975, 1.8607165813446045, 1.3836452960968018, -0.08074343949556351, -0.9478597044944763, 0.7053517699241638, -0.3379579782485962, -0.2520999610424042, 1.0143450498580933, 0.44437381625175476, -0.17832165956497192, -1.459551453590393, 0.6649019122123718, 1.2439249753952026, -0.7544071674346924, -0.7589471340179443, 0.10091928392648697, -0.9038018584251404, 1.057532548904419, 0.6323831677436829, 0.4329628348350525, 0.2020389586687088, 1.601721167564392, 0.7493298053741455, -0.41296449303627014, 0.5334047675132751, 0.6326536536216736, -0.15382394194602966, -2.0888776779174805, -1.2378400564193726, 0.26824334263801575, -0.5121787190437317, -1.6036021709442139, 1.3865081071853638, -1.139116883277893, -0.9104259014129639, 0.5158432722091675, 0.012985334731638432, 1.5122534036636353, 0.3616376519203186, 1.5193535089492798, 2.1238059997558594, 0.9004830718040466, 0.3287818431854248, 1.441900372505188, -0.10693544149398804, -0.3244946002960205, 1.856741189956665, -0.4270350933074951, 0.3710915744304657, 1.127852439880371, -0.2844183146953583, -1.0082097053527832, -0.7500092387199402, -1.0969276428222656, -0.6361123323440552, 1.194114089012146, 0.06280073523521423, -1.0511806011199951, 0.2484539896249771, 1.6181763410568237, 0.012173880822956562, -0.28447118401527405, 0.5202539563179016, 0.45282936096191406, -0.769271969795227, -0.06841032952070236, -0.9586520791053772, 0.5490694046020508, -0.2513948380947113, -0.27123430371284485, 0.311667263507843, 0.39706918597221375, 1.2913627624511719, -0.0695236548781395, 0.1847345232963562, 1.1222153902053833, -1.4887245893478394, 1.3499218225479126, -0.5889977812767029, 0.21923120319843292, -2.3588461875915527, 1.4233371019363403, -0.6794357299804688, 1.901684045791626, -2.6075937747955322, 0.49657419323921204, -0.663062334060669, -0.5085676908493042, 0.43227052688598633, -0.46568676829338074, 0.09891139715909958, -0.09955310076475143, -1.1128089427947998, -0.1261286735534668, -0.6025702953338623, 0.5895894169807434, 1.0966837406158447, 1.325724482536316, -1.0542298555374146, -0.5107349753379822, -1.658329725265503, -0.23237672448158264, -0.7140010595321655, 0.31673628091812134, -2.058635711669922, -0.2620721757411957, -1.9763063192367554, -2.357740640640259, -1.3848507404327393, -0.7863609790802002, 1.181283712387085, 0.17037202417850494, -0.9761568307876587, 1.180808424949646, -0.44513624906539917, -1.8516650199890137, 1.1731367111206055, -2.1420159339904785 ]
https://github.com/huggingface/datasets/issues/4456
Workflow for Tabular data
~20k! I was surprised batch loading with as few as 32 samples was really slow. I was speculating the columnar format was the cause -- or do you see good performance with this approx size of tabular data?
Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion !
724
38
Workflow for Tabular data Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion ! ~20k! I was surprised batch loading with as few as 32 samples was really slow. I was speculating the columnar format was the cause -- or do you see good performance with this approx size of tabular data?
[ -1.2884511947631836, -0.9509177803993225, -0.6658450365066528, 1.3366944789886475, -0.13963688910007477, -1.1997686624526978, 0.13625578582286835, -1.1556216478347778, 1.6278969049453735, -0.901124119758606, 0.31876206398010254, -1.7181427478790283, 0.05332370847463608, -0.6275080442428589, -0.7396920323371887, -0.9502404928207397, -0.5092160701751709, -0.8046756982803345, 1.0022131204605103, 2.5289664268493652, 1.1490153074264526, -1.4658011198043823, 2.643775463104248, 0.622304379940033, -0.15102340281009674, -0.9964650273323059, 0.5154590606689453, 0.0837092399597168, -1.247228980064392, -0.40901607275009155, -0.913909375667572, -0.09050197154283524, -0.6069896817207336, -0.4582153856754303, -0.026000915095210075, 0.3390005826950073, -0.26882776618003845, -0.31224530935287476, -0.4420344829559326, -0.7795564532279968, 0.5147138237953186, -0.3174563944339752, 0.9948900938034058, -0.3412938714027405, 1.893744945526123, -0.5422375202178955, 0.4566026031970978, 0.6827771663665771, 1.4353548288345337, 0.22264142334461212, -0.042536549270153046, 0.28120726346969604, 0.32938626408576965, -0.08203984051942825, 0.5082759857177734, 1.1213337182998657, 0.6280677914619446, 0.5321739912033081, 0.7062092423439026, -2.1878464221954346, 1.3480175733566284, -1.044880747795105, 0.37322279810905457, 1.4903240203857422, -0.928388774394989, 0.43406012654304504, -1.7966578006744385, -0.12247036397457123, 0.4865204989910126, -2.2644457817077637, 0.17775137722492218, -1.1412508487701416, -0.47898685932159424, 0.9889012575149536, 0.3072030544281006, -1.1878225803375244, 0.3362671434879303, -0.418512761592865, 1.049060344696045, 0.4940750002861023, 1.1777114868164062, -1.6676592826843262, -0.05695442855358124, -0.29745346307754517, 0.10206873714923859, -1.3506813049316406, -1.6111955642700195, 0.5311641097068787, 0.6481635570526123, 0.5359712243080139, -0.021900217980146408, 0.9798992872238159, -1.0454223155975342, 0.8401085734367371, -1.0391874313354492, -1.549997091293335, -1.3674875497817993, -2.226717233657837, -2.375704288482666, 0.79935222864151, -0.47166329622268677, -0.5221430063247681, 2.0284030437469482, -1.0386630296707153, -1.7397229671478271, 1.2532835006713867, 0.3270384967327118, -0.04498358815908432, 2.4766452312469482, 0.17160603404045105, -0.6550611257553101, 0.45615318417549133, -0.6838585734367371, 0.8461145758628845, -0.4026997685432434, 1.3668930530548096, 0.4591430425643921, -1.103307843208313, 1.595882534980774, -0.43058064579963684, 0.5428969264030457, -0.6540769934654236, -0.6275699138641357, -0.7669306397438049, 0.3895108699798584, 1.7722182273864746, -0.2702306807041168, 1.556509017944336, -0.3419272005558014, -1.5531352758407593, -1.6707404851913452, 0.9012125730514526, 0.4320923984050751, -0.7725615501403809, 0.025801556184887886, -0.2790133059024811, 0.1025581881403923, 0.030192630365490913, 1.0783964395523071, 1.1729152202606201, 0.6568669676780701, -0.27468958497047424, -0.8966015577316284, 0.18000566959381104, -0.11508873850107193, -0.6281096935272217, -1.7350157499313354, -0.42230620980262756, 0.11560706794261932, 0.5759013295173645, -1.1588943004608154, 1.78490149974823, 0.9645200371742249, 1.86989426612854, 0.9836786389350891, -0.317941814661026, 1.494611144065857, 0.08613324165344238, 1.7811414003372192, -0.46841001510620117, 0.711208701133728, -0.33453384041786194, -1.1937006711959839, 0.7922966480255127, -0.3697499930858612, -2.061920166015625, -0.8060101866722107, -0.7510643601417542, -0.22702646255493164, -0.7699586153030396, 0.9701553583145142, -0.2678292989730835, -1.3527452945709229, 0.3019726574420929, -0.572972297668457, 0.19887396693229675, -1.1647673845291138, 0.3809545636177063, 0.7543222308158875, -0.7032798528671265, 0.011746460571885109, -0.24890276789665222, -1.297285556793213, -0.3948664963245392, 0.2483641356229782, 1.8751072883605957, -0.7971515655517578, 0.8219952583312988, 1.0015475749969482, -0.6606317162513733, 0.02900499664247036, 0.2982594966888428, -0.25868260860443115, 0.839741051197052, -0.9845933318138123, -0.4500124156475067, 1.1836744546890259, -0.2026713788509369, -0.6000518798828125, 1.483441948890686, 0.7220447659492493, -0.945223331451416, -0.17136068642139435, -0.22307762503623962, -0.8918634653091431, -0.04599183052778244, -1.5826207399368286, -0.09535486996173859, 0.30406057834625244, -1.5104453563690186, -0.42730551958084106, -0.24567395448684692, 1.2796603441238403, -0.26206880807876587, 1.4486804008483887, -0.47572776675224304, -0.2594147026538849, -0.4052737057209015, -0.5457791686058044, 0.2099238485097885, -0.18598492443561554, -0.639388382434845, 0.1964309811592102, -0.8404163122177124, 0.3673742711544037, 1.4775960445404053, 0.3857812285423279, 0.06802956759929657, 0.44703271985054016, 1.0922574996948242, 0.32604119181632996, -0.08527781069278717, -0.8693512678146362, -1.52568519115448, 2.0895187854766846, -1.4614843130111694, 1.9694209098815918, 0.7953324913978577, -0.02184286341071129, -1.7703990936279297, -1.7364581823349, 1.3300217390060425, 1.2085212469100952, 2.3785738945007324, 0.5220744609832764, 0.36144593358039856, -0.8133510947227478, -0.6518682241439819, 0.40990784764289856, -1.0394026041030884, -0.7707709670066833, 0.10511211305856705, 2.317549228668213, 1.740835428237915, -0.4759567677974701, -0.21068128943443298, -0.9992167353630066, 1.4392476081848145, -0.1904112696647644, 0.19367800652980804, 2.0651252269744873, -0.40138810873031616, -1.1760156154632568, 1.3721808195114136, -2.4240121841430664, 0.10218767821788788, 1.974961757659912, 0.33168452978134155, 0.013965973630547523, -1.3236303329467773, -0.5715216994285583, -0.2737966775894165, -0.3896375894546509, -1.2688522338867188, 0.5177273154258728, -0.24760548770427704, -0.6934747099876404, -1.495603322982788, 0.11626501381397247, -1.262084722518921, -1.58421790599823, 0.33176180720329285, 1.7430779933929443, 2.10689640045166, -0.7664007544517517, 1.5053468942642212, -0.23546193540096283, 0.23545625805854797, 1.1739046573638916, 1.2066348791122437, 3.1084771156311035, 1.8330721855163574, -1.2566651105880737, 0.5427801012992859, -0.2119157463312149, -0.5074858665466309, 1.110339879989624, -1.1079447269439697, 1.3243883848190308, -0.10318863391876221, -1.269416093826294, -1.2721667289733887, 0.9689998030662537, 0.3690570890903473, 0.15139852464199066, -0.580895721912384, 1.1951643228530884, 0.09666331112384796, 1.325944185256958, 0.4594079852104187, -0.27447524666786194, 0.5071426630020142, -0.4506753087043762, -0.653109610080719, 1.6353563070297241, 0.19433660805225372, -1.4329873323440552, -2.348466634750366, -0.2782890200614929, -0.8066134452819824, -0.005641165189445019, -0.5855222344398499, -0.9950396418571472, 1.6519745588302612, 0.3716696500778198, -1.2869517803192139, -0.265056848526001, -0.33532434701919556, -0.5932045578956604, 2.667229175567627, -1.4732555150985718, -0.18536987900733948, -0.9319319725036621, -0.5868062376976013, 1.6025424003601074, -1.245145320892334, -0.12513020634651184, -0.984108567237854, -0.6375839114189148, -1.3463078737258911, -0.4837658405303955, -0.015433421358466148, -1.0221487283706665, 0.7742635011672974, 0.21631939709186554, -1.1172057390213013, -0.31946590542793274, -0.9092643857002258, 0.8542047142982483, -0.14581522345542908, 0.37692996859550476, 1.765015721321106, 0.4879053831100464, -0.4006088972091675, 0.764720618724823, 1.193946361541748, 0.6744283437728882, -0.6042258739471436, 0.11103551834821701, -0.8006243705749512, 0.3450154960155487, -1.2431390285491943, 0.3668224513530731, -2.865485668182373, 0.7080481052398682, -0.062180668115615845, -0.15611927211284637, -0.008577213622629642, -1.3414695262908936, 1.1012064218521118, 2.616367816925049, -1.1446536779403687, 0.45436298847198486, 0.3647579848766327, 1.2049007415771484, -1.504940152168274, 0.2674083709716797, -0.3625926077365875, 2.072289228439331, 0.16209396719932556, 1.0930445194244385, -0.5350226163864136, -2.3543860912323, 0.5440009236335754, -1.366085410118103, -1.2088531255722046, 0.8347705602645874, -0.9278664588928223, 0.008423253893852234, -1.3856298923492432, -0.16689185798168182, -0.9895269870758057, -1.1808032989501953, 0.7531907558441162, 0.10851788520812988, 0.48476168513298035, -0.6444413661956787, 0.320163756608963, -2.214646577835083, -1.4247636795043945, -0.25006675720214844, -0.9618765711784363, 0.395907461643219, -0.3107979893684387, 0.6825778484344482, -0.18735921382904053, 0.09072139114141464, 0.3347497284412384, 1.454344391822815, 3.2740440368652344, 0.2606604993343353, 0.43879765272140503, -0.15794071555137634, -0.9376440644264221, 1.5070791244506836, 0.9151188135147095, -0.034673966467380524, -0.5428528189659119, -1.0048589706420898, 1.2002745866775513, 1.9032318592071533, 1.0085958242416382, -0.012951500713825226, -0.7754524350166321, -0.6213030219078064, -0.04705680161714554, 0.20838670432567596, 0.5931351780891418, 0.921180009841919, -0.09326592087745667, 0.21183785796165466, 1.4038190841674805, 1.3148598670959473, -0.4666421115398407, 0.3316846191883087, -0.753372073173523, -0.5576980710029602, 0.46588483452796936, 0.31305161118507385, 0.05647873878479004, 0.39491546154022217, -0.9041419625282288, -0.24400313198566437, -0.4396573305130005, -0.9636307954788208, -0.7132081389427185, -0.4873930513858795, -0.4240911900997162, 1.6451417207717896, 0.13050879538059235, -0.5020735859870911, 0.04665296524763107, -0.7374723553657532, -0.1823735386133194, -1.1154605150222778, 0.2476167529821396, -0.0748872309923172, -0.13861526548862457, -0.1033327579498291, 1.8017641305923462, -0.9992517232894897, -2.1158714294433594, 0.2144903838634491, 0.23927752673625946, -0.40733447670936584, 0.11206862330436707, 1.6529226303100586, 0.42611247301101685, 1.4752628803253174, 1.3870296478271484, 0.9722641110420227, -0.6476725339889526, -1.314956784248352, 0.8224762082099915, 0.9317595362663269, -1.3529393672943115, 0.8833416700363159, 0.06666970252990723, -0.550032913684845, 0.7132141590118408, 1.1826411485671997, 0.4286777377128601, -2.0152089595794678, 0.8322197794914246, -1.0114349126815796, 0.774756669998169, 0.7102028727531433, 0.6463531851768494, 0.17218215763568878, 0.8760889768600464, -1.2230134010314941, -1.1841235160827637, -0.7550961971282959, -0.5755882859230042, 1.9681428670883179, -0.2323964685201645, 0.6337459087371826, -0.15136128664016724, -1.3282607793807983, -0.052180416882038116, 0.7567411065101624, 0.32827866077423096, -0.40558189153671265, 0.8617909550666809, -0.7171297073364258, -1.029342770576477, -1.450685739517212, -0.3685416579246521, -1.010719895362854, -0.8696573376655579, 1.1613575220108032, 0.852683424949646, 0.14139771461486816, 1.859770655632019, 0.6491040587425232, 0.2772253751754761, -2.553070068359375, 0.853245198726654, 0.19373880326747894, -0.22364374995231628, 0.8136218786239624, 0.2984430491924286, 0.9467201828956604, 0.03977544605731964, 0.4922860860824585, -2.429807424545288, 2.355142116546631, -0.2631814479827881, 0.7725657224655151, -0.06220404803752899, -0.10577689856290817, 1.19896399974823, 0.5710505247116089, 0.5138453245162964, -1.1218289136886597, 0.6807643175125122, -0.5195942521095276, 1.1807332038879395, 0.9545847177505493, -0.8255181908607483, 0.003448738716542721, 1.3273372650146484, 0.47448745369911194, -0.44368982315063477, -0.9215361475944519, -0.925220787525177, 0.9667812585830688, 1.7451967000961304, -0.06950177252292633, 0.005210908129811287, 0.8659256100654602, 0.7280099987983704, -1.3384885787963867, 0.11498907953500748, -0.6416804194450378, -0.7967153191566467, 1.583569884300232, 2.0203282833099365, -0.0832090824842453, -0.19964851438999176, -0.6874107718467712, -1.2232775688171387, 0.7991219162940979, 0.05166896432638168, 0.18555931746959686, 0.6159258484840393, -0.6806631684303284, 1.1718887090682983, 0.9658593535423279, 0.8348614573478699, 0.20998317003250122, 0.2635738253593445, 0.3262961208820343, -0.3464464843273163, -1.1007134914398193, -0.1409565508365631, -1.0626425743103027, -2.579235792160034, 0.46124687790870667, -0.24908752739429474, -1.4666552543640137, 0.005017472431063652, -0.9879878759384155, 0.8807965517044067, -0.5990831851959229, -1.0550371408462524, -1.624546766281128, 0.29663610458374023, -0.0671616718173027, 0.9638216495513916, -1.5844595432281494, -0.07789602130651474, 1.1238349676132202, 0.8649319410324097, -0.5100497603416443, 1.0125478506088257, 0.2735304534435272, 0.953873336315155, 0.7973242402076721, -0.4602562487125397, 0.5327231884002686, 0.11006244271993637, -1.3759071826934814, 0.3434842526912689, 1.1214241981506348, 0.14800241589546204, 1.3734534978866577, -0.5200939774513245, 0.042501188814640045, 0.3525926470756531, -0.4919082522392273, -0.4867910146713257, -0.5768610835075378, 0.7362179160118103, 0.06385365128517151, -0.8764541745185852, 0.043564118444919586, -0.10608087480068207, -0.35720857977867126, 0.2868861258029938, -1.5009580850601196, -0.18217243254184723, -0.4703487157821655, -0.5471777319908142, -1.2976311445236206, 0.044673748314380646, 1.4681897163391113, -0.7621994018554688, -0.15828998386859894, 0.5326323509216309, 0.45074719190597534, 0.5592323541641235, 0.6162884831428528, -0.6886788010597229, -0.2564646899700165, -0.31106269359588623, -0.2729092240333557, 0.2884151041507721, 1.2436447143554688, -0.20148245990276337, -0.9261888861656189, 0.7366913557052612, -0.3246488869190216, 0.060680605471134186, 1.9511700868606567, 0.1410008817911148, -0.8493849635124207, 0.3527902364730835, -0.7120662331581116, 1.897761583328247, 1.8225505352020264, 1.4004130363464355, -0.10865231603384018, -0.9561883807182312, 0.680508553981781, -0.34046557545661926, -0.26945528388023376, 1.0068185329437256, 0.458699494600296, -0.19258996844291687, -1.4678127765655518, 0.6925612092018127, 1.2508022785186768, -0.7916484475135803, -0.7770232558250427, 0.12532740831375122, -0.9025506973266602, 1.0401405096054077, 0.6325684785842896, 0.4429257810115814, 0.16472481191158295, 1.620806097984314, 0.730717658996582, -0.4270005226135254, 0.5393915176391602, 0.606537401676178, -0.144316166639328, -2.0764925479888916, -1.2628734111785889, 0.24346722662448883, -0.5072124004364014, -1.595887541770935, 1.4362835884094238, -1.1257058382034302, -0.9434848427772522, 0.528561532497406, 0.022203411906957626, 1.4975781440734863, 0.3507455885410309, 1.5527708530426025, 2.097797393798828, 0.8922707438468933, 0.3686371147632599, 1.4245471954345703, -0.10059615224599838, -0.3374529480934143, 1.8569447994232178, -0.4459252953529358, 0.3796626329421997, 1.158624291419983, -0.29447251558303833, -1.0068925619125366, -0.7713117599487305, -1.1060715913772583, -0.6641814112663269, 1.1566370725631714, 0.09188210219144821, -1.048685073852539, 0.27058956027030945, 1.6188089847564697, 0.022419694811105728, -0.2863156795501709, 0.5222353339195251, 0.46782049536705017, -0.7609901428222656, -0.06963291019201279, -0.9532122611999512, 0.5300408005714417, -0.2285611480474472, -0.3129839301109314, 0.32265704870224, 0.3953176736831665, 1.2989193201065063, -0.06463821232318878, 0.18383899331092834, 1.1354931592941284, -1.4794646501541138, 1.330156683921814, -0.5759115219116211, 0.24371688067913055, -2.341864585876465, 1.433350682258606, -0.6718593835830688, 1.8926682472229004, -2.61496639251709, 0.4715944826602936, -0.6808943152427673, -0.5133392214775085, 0.4245426058769226, -0.4289548695087433, 0.10039219260215759, -0.10817498713731766, -1.097357153892517, -0.1599458009004593, -0.6378234624862671, 0.5734114646911621, 1.0854326486587524, 1.3041518926620483, -1.0265718698501587, -0.4988122880458832, -1.6552566289901733, -0.21593263745307922, -0.6775609850883484, 0.3429163992404938, -2.0607941150665283, -0.26747119426727295, -1.995139718055725, -2.33693265914917, -1.3652504682540894, -0.8200066685676575, 1.1562423706054688, 0.17292122542858124, -0.9751909375190735, 1.2092941999435425, -0.420791894197464, -1.8248032331466675, 1.1896941661834717, -2.1058707237243652 ]
https://github.com/huggingface/datasets/issues/4456
Workflow for Tabular data
20k can be a lot for a columnar format but maybe we can optimize a few things. It would be cool to profile the code to see if there's an unoptimized part of the code that slows everything down. (it's also possible to kill the job when it accesses the batch, it often gives you the traceback at the location where the code was running)
Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion !
724
65
Workflow for Tabular data Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion ! 20k can be a lot for a columnar format but maybe we can optimize a few things. It would be cool to profile the code to see if there's an unoptimized part of the code that slows everything down. (it's also possible to kill the job when it accesses the batch, it often gives you the traceback at the location where the code was running)
[ -1.2788333892822266, -0.9857860803604126, -0.7160062193870544, 1.3961797952651978, -0.12037309259176254, -1.196848750114441, 0.09308391064405441, -1.1445682048797607, 1.6715949773788452, -0.8646240234375, 0.32197025418281555, -1.7047169208526611, 0.04775972664356232, -0.6085860729217529, -0.761076033115387, -0.9239228963851929, -0.493673712015152, -0.8516870141029358, 1.0169270038604736, 2.5181379318237305, 1.174707055091858, -1.4861376285552979, 2.666585922241211, 0.6492125988006592, -0.15173989534378052, -0.9939541816711426, 0.5322728157043457, 0.024635877460241318, -1.249222755432129, -0.4319450855255127, -0.9215896129608154, -0.033993907272815704, -0.6076358556747437, -0.45620471239089966, -0.023979928344488144, 0.33876413106918335, -0.2850046455860138, -0.3377096951007843, -0.5100840926170349, -0.7811453938484192, 0.49756887555122375, -0.3189968764781952, 1.004692792892456, -0.3268231749534607, 1.9114516973495483, -0.4754195511341095, 0.42280247807502747, 0.6684970855712891, 1.440528154373169, 0.23415665328502655, -0.011198237538337708, 0.2988404929637909, 0.3404248356819153, -0.10115256905555725, 0.47945693135261536, 1.1609793901443481, 0.5925987958908081, 0.5120502710342407, 0.7284083366394043, -2.199578046798706, 1.3838058710098267, -1.032002568244934, 0.3552231192588806, 1.4455132484436035, -0.9242565631866455, 0.4327753186225891, -1.774793267250061, -0.09801731258630753, 0.5231645107269287, -2.2897613048553467, 0.183974027633667, -1.139379858970642, -0.4620507061481476, 0.9917541742324829, 0.3041315972805023, -1.2124687433242798, 0.3596217930316925, -0.442700058221817, 1.0472944974899292, 0.4704957902431488, 1.1840006113052368, -1.6966115236282349, -0.0696919709444046, -0.2965630292892456, 0.09387414157390594, -1.3495662212371826, -1.6028810739517212, 0.5384917259216309, 0.6372111439704895, 0.5637243986129761, -0.04184137284755707, 0.9934139251708984, -1.0354052782058716, 0.8159374594688416, -0.9819672107696533, -1.5673103332519531, -1.376541256904602, -2.2252185344696045, -2.358814001083374, 0.7854152321815491, -0.46839213371276855, -0.5348996520042419, 2.0344960689544678, -1.0219178199768066, -1.7445461750030518, 1.2431621551513672, 0.3417854607105255, -0.03549591079354286, 2.4793407917022705, 0.16023243963718414, -0.6590980291366577, 0.4697783589363098, -0.6853237152099609, 0.9181540012359619, -0.4240322411060333, 1.3634284734725952, 0.44691547751426697, -1.0732015371322632, 1.5577105283737183, -0.4246169924736023, 0.54787278175354, -0.6647285223007202, -0.620021402835846, -0.7884992361068726, 0.36677315831184387, 1.800374984741211, -0.2890909016132355, 1.5838608741760254, -0.3160315752029419, -1.5474423170089722, -1.6865811347961426, 0.9267327189445496, 0.42165592312812805, -0.786759078502655, 0.020013347268104553, -0.30534154176712036, 0.10976007580757141, -0.017908422276377678, 1.1033682823181152, 1.1990282535552979, 0.6443983912467957, -0.27631843090057373, -0.9112876057624817, 0.1686466932296753, -0.16568873822689056, -0.6341091394424438, -1.7228336334228516, -0.43323031067848206, 0.12605229020118713, 0.5582438707351685, -1.1732125282287598, 1.7570034265518188, 0.9846753478050232, 1.9065335988998413, 0.9964555501937866, -0.3208330571651459, 1.4898021221160889, 0.11002209037542343, 1.7829786539077759, -0.4747234582901001, 0.6745394468307495, -0.3584387004375458, -1.199472188949585, 0.8270382285118103, -0.40745142102241516, -2.0347204208374023, -0.7893060445785522, -0.7729085683822632, -0.23615813255310059, -0.7206770777702332, 0.939827024936676, -0.30535832047462463, -1.3484553098678589, 0.30969923734664917, -0.6159218549728394, 0.1811412274837494, -1.1570026874542236, 0.35994553565979004, 0.7668721675872803, -0.704745888710022, 0.037806738168001175, -0.25483229756355286, -1.2925728559494019, -0.3949883282184601, 0.26997724175453186, 1.8751392364501953, -0.7842069268226624, 0.8374453783035278, 0.9998353719711304, -0.6874485015869141, 0.024103790521621704, 0.28355833888053894, -0.27129414677619934, 0.8624157905578613, -1.0237739086151123, -0.46195951104164124, 1.1820956468582153, -0.2207491099834442, -0.6244182586669922, 1.4849356412887573, 0.7187774777412415, -0.9382556676864624, -0.17115238308906555, -0.15267938375473022, -0.9004790782928467, -0.030203811824321747, -1.5833666324615479, -0.10839871317148209, 0.3303201198577881, -1.5358792543411255, -0.4713347852230072, -0.2635006606578827, 1.2382066249847412, -0.25228646397590637, 1.4298466444015503, -0.42868807911872864, -0.21509504318237305, -0.4027366638183594, -0.5199047327041626, 0.16935133934020996, -0.19890260696411133, -0.6033807992935181, 0.21639928221702576, -0.8352193236351013, 0.39153608679771423, 1.4786956310272217, 0.3883264660835266, 0.07561139762401581, 0.46013036370277405, 1.1235953569412231, 0.3986610472202301, -0.03670637682080269, -0.8493974208831787, -1.5269335508346558, 2.0815372467041016, -1.4632052183151245, 1.9754821062088013, 0.8263456225395203, -0.01151831541210413, -1.766261339187622, -1.7553129196166992, 1.2974926233291626, 1.1809037923812866, 2.3483974933624268, 0.5668458342552185, 0.35530155897140503, -0.7915717959403992, -0.6482179760932922, 0.40529853105545044, -1.0214970111846924, -0.7595239877700806, 0.1235041618347168, 2.326239824295044, 1.7690762281417847, -0.4713331460952759, -0.22059105336666107, -0.9898096323013306, 1.4701695442199707, -0.17508161067962646, 0.18962574005126953, 2.018008232116699, -0.32566067576408386, -1.156703233718872, 1.3679252862930298, -2.4003512859344482, 0.12609025835990906, 1.962512731552124, 0.3363153636455536, -0.006536101922392845, -1.3705217838287354, -0.5811322927474976, -0.2697378098964691, -0.373300164937973, -1.2619223594665527, 0.5084540247917175, -0.2814745008945465, -0.7034766674041748, -1.5343647003173828, 0.14028257131576538, -1.2331522703170776, -1.5952434539794922, 0.2895815074443817, 1.787863850593567, 2.105339527130127, -0.717412531375885, 1.5082006454467773, -0.2265673726797104, 0.2024986892938614, 1.1768110990524292, 1.1820343732833862, 3.12412428855896, 1.8316730260849, -1.2520753145217896, 0.5325357913970947, -0.18999210000038147, -0.4964568018913269, 1.1255501508712769, -1.1087517738342285, 1.336918592453003, -0.11932636797428131, -1.2353770732879639, -1.2525702714920044, 0.9958693981170654, 0.4359230101108551, 0.13698872923851013, -0.594306230545044, 1.1807395219802856, 0.07828304171562195, 1.3065789937973022, 0.46042364835739136, -0.29531046748161316, 0.4928947389125824, -0.4393519163131714, -0.6797299385070801, 1.6247525215148926, 0.19714967906475067, -1.4249610900878906, -2.3089871406555176, -0.2645343542098999, -0.7969088554382324, 0.02699258178472519, -0.5946301817893982, -0.9899455308914185, 1.636577844619751, 0.3493039309978485, -1.3065356016159058, -0.27263757586479187, -0.3251403272151947, -0.6110023856163025, 2.624967098236084, -1.4604116678237915, -0.1903497278690338, -0.9162522554397583, -0.5727360844612122, 1.5930533409118652, -1.2364524602890015, -0.14875563979148865, -1.025913119316101, -0.63243567943573, -1.2840832471847534, -0.5174303650856018, -0.02512986585497856, -0.9886367321014404, 0.7598057985305786, 0.22320996224880219, -1.111966609954834, -0.3035392761230469, -0.9045690894126892, 0.8549715280532837, -0.13928085565567017, 0.34951210021972656, 1.8178175687789917, 0.484931081533432, -0.4420177638530731, 0.7611704468727112, 1.1924347877502441, 0.659494161605835, -0.626434862613678, 0.10958447307348251, -0.7460367679595947, 0.32570332288742065, -1.235399842262268, 0.34751102328300476, -2.8484978675842285, 0.6900623440742493, -0.04827544838190079, -0.15792907774448395, 0.050983015447854996, -1.293797492980957, 1.0718328952789307, 2.618288278579712, -1.1678341627120972, 0.4755505621433258, 0.33651256561279297, 1.1860851049423218, -1.5878537893295288, 0.2695280909538269, -0.3575172424316406, 2.083786964416504, 0.15926297008991241, 1.0874524116516113, -0.5502908825874329, -2.377016544342041, 0.5259217619895935, -1.3301924467086792, -1.2137742042541504, 0.8245310187339783, -0.9466317296028137, -0.008165356703102589, -1.418452262878418, -0.16416095197200775, -0.9531981348991394, -1.1821516752243042, 0.7317299842834473, 0.07331506907939911, 0.4793427288532257, -0.6299797892570496, 0.32602420449256897, -2.209148645401001, -1.422436237335205, -0.22370430827140808, -0.97078537940979, 0.4587649703025818, -0.37155309319496155, 0.6899109482765198, -0.1970018446445465, 0.061736755073070526, 0.33939704298973083, 1.423454999923706, 3.3292815685272217, 0.27679190039634705, 0.4462108016014099, -0.1557258665561676, -0.918911874294281, 1.4536831378936768, 0.9225151538848877, -0.07531415671110153, -0.5617813467979431, -1.036049723625183, 1.2400835752487183, 1.9357267618179321, 1.007760763168335, 0.003449619747698307, -0.7640199065208435, -0.6543908715248108, -0.05830073356628418, 0.20805314183235168, 0.555246889591217, 0.9056973457336426, -0.043408796191215515, 0.2269175499677658, 1.393183708190918, 1.304565191268921, -0.4376266896724701, 0.3256531059741974, -0.7357941269874573, -0.5657891631126404, 0.45013368129730225, 0.33623868227005005, 0.0008486760780215263, 0.4148906171321869, -0.936253011226654, -0.24592286348342896, -0.506511390209198, -0.941241979598999, -0.7082598209381104, -0.44534364342689514, -0.39706137776374817, 1.6604751348495483, 0.13338278234004974, -0.4973982274532318, 0.0211016908288002, -0.7630115747451782, -0.14222082495689392, -1.149011492729187, 0.2548857629299164, -0.059554439038038254, -0.15815654397010803, -0.08185258507728577, 1.7757699489593506, -0.9813620448112488, -2.128980875015259, 0.17858198285102844, 0.19467948377132416, -0.38416433334350586, 0.12754295766353607, 1.6510745286941528, 0.39874759316444397, 1.4480445384979248, 1.3876539468765259, 0.9593400955200195, -0.6928839087486267, -1.3156604766845703, 0.7726873159408569, 0.9268633723258972, -1.3615505695343018, 0.9020766019821167, 0.038354337215423584, -0.5606732368469238, 0.7222639918327332, 1.2110626697540283, 0.42284777760505676, -2.004193067550659, 0.8346009850502014, -0.9951483607292175, 0.8114179968833923, 0.7252412438392639, 0.6279000639915466, 0.18569792807102203, 0.8413136005401611, -1.2180321216583252, -1.2137387990951538, -0.7566125392913818, -0.629285454750061, 1.955466866493225, -0.2389029562473297, 0.6110478639602661, -0.16180676221847534, -1.3261879682540894, -0.07960349321365356, 0.721093475818634, 0.34644919633865356, -0.3995354473590851, 0.8388100266456604, -0.7474947571754456, -1.0671777725219727, -1.4500269889831543, -0.40629270672798157, -1.0283246040344238, -0.9044672250747681, 1.169250249862671, 0.8576701283454895, 0.16603431105613708, 1.8847705125808716, 0.6536738276481628, 0.26856401562690735, -2.5487940311431885, 0.8438806533813477, 0.2828233540058136, -0.2071739137172699, 0.8529642820358276, 0.3008095622062683, 0.9838158488273621, 0.030740298330783844, 0.47665151953697205, -2.3753979206085205, 2.328488349914551, -0.24224421381950378, 0.7847577929496765, -0.06529556959867477, -0.13153928518295288, 1.1880192756652832, 0.5531433820724487, 0.5173243880271912, -1.142944097518921, 0.695449948310852, -0.49001964926719666, 1.15925931930542, 0.9477063417434692, -0.8408294916152954, 0.00796572770923376, 1.3373303413391113, 0.4949896037578583, -0.4894993305206299, -0.9357832074165344, -0.930679202079773, 0.928914487361908, 1.7604916095733643, -0.06437484920024872, 0.05259668827056885, 0.8693345189094543, 0.6649364829063416, -1.3447942733764648, 0.1423160433769226, -0.6665670871734619, -0.8435071110725403, 1.5667306184768677, 1.986802101135254, -0.1041160300374031, -0.19704458117485046, -0.6662874221801758, -1.2726725339889526, 0.7887782454490662, 0.06573938578367233, 0.19601748883724213, 0.5944394469261169, -0.6819937825202942, 1.1731691360473633, 0.9640761613845825, 0.8634347915649414, 0.14455586671829224, 0.2260005623102188, 0.3619976341724396, -0.3534906506538391, -1.0979951620101929, -0.13462229073047638, -1.0255488157272339, -2.553739547729492, 0.46664851903915405, -0.2010640799999237, -1.4757802486419678, -0.031142234802246094, -0.9506939649581909, 0.90892094373703, -0.5674489140510559, -1.0740312337875366, -1.6201918125152588, 0.28838369250297546, -0.07463859766721725, 0.9413881301879883, -1.6061664819717407, -0.12314584851264954, 1.1376214027404785, 0.8602330684661865, -0.5423693656921387, 1.0321484804153442, 0.24564601480960846, 0.9454402923583984, 0.8147907853126526, -0.4504700005054474, 0.5026887059211731, 0.10254576802253723, -1.404530644416809, 0.3375633656978607, 1.0954784154891968, 0.1273801028728485, 1.372628927230835, -0.5338617563247681, 0.02444562315940857, 0.3653319180011749, -0.47412484884262085, -0.42578059434890747, -0.5568572878837585, 0.7307612299919128, 0.019224688410758972, -0.8356983065605164, 0.07895974814891815, -0.12108032405376434, -0.37100303173065186, 0.24062035977840424, -1.4889771938323975, -0.1934865564107895, -0.4927821159362793, -0.5434046387672424, -1.2647285461425781, 0.03334788978099823, 1.4576268196105957, -0.7267786264419556, -0.18803192675113678, 0.5268446207046509, 0.47666314244270325, 0.5388088226318359, 0.6321191787719727, -0.67960125207901, -0.30093908309936523, -0.2512958347797394, -0.28700190782546997, 0.295137494802475, 1.2518236637115479, -0.17760290205478668, -0.9050347805023193, 0.7366130352020264, -0.3055862486362457, 0.058671243488788605, 1.9499191045761108, 0.15795022249221802, -0.8123476505279541, 0.3257778286933899, -0.7209375500679016, 1.8915319442749023, 1.8265398740768433, 1.4170125722885132, -0.11301245540380478, -0.9556872844696045, 0.6983975172042847, -0.32250216603279114, -0.27048400044441223, 0.9840337634086609, 0.4253237247467041, -0.20115350186824799, -1.463342547416687, 0.6754866242408752, 1.2455909252166748, -0.8001692891120911, -0.7834866046905518, 0.10727154463529587, -0.8599158525466919, 1.0527206659317017, 0.6210463643074036, 0.46060723066329956, 0.17694199085235596, 1.6409721374511719, 0.7494804263114929, -0.4406534433364868, 0.5837674736976624, 0.6093069911003113, -0.13564467430114746, -2.088514804840088, -1.219334602355957, 0.25503653287887573, -0.4868490695953369, -1.5956491231918335, 1.4020555019378662, -1.1246625185012817, -0.9491480588912964, 0.5058261752128601, 0.011372589506208897, 1.52235746383667, 0.3360365927219391, 1.551565408706665, 2.1597461700439453, 0.8778855800628662, 0.3719111979007721, 1.396577000617981, -0.10072296857833862, -0.3623819351196289, 1.8668361902236938, -0.4531084895133972, 0.38467344641685486, 1.1133379936218262, -0.30547547340393066, -1.0080974102020264, -0.7256091237068176, -1.1118782758712769, -0.6559388637542725, 1.1428595781326294, 0.07778215408325195, -1.0265414714813232, 0.30085694789886475, 1.6355109214782715, 0.053950659930706024, -0.2692561447620392, 0.5436999201774597, 0.49633756279945374, -0.7672103643417358, -0.06636671721935272, -0.953805685043335, 0.5303837060928345, -0.2003842294216156, -0.3050350844860077, 0.3511664867401123, 0.3931216299533844, 1.3131613731384277, -0.02498159185051918, 0.1607879102230072, 1.1126761436462402, -1.509046196937561, 1.3502968549728394, -0.5863715410232544, 0.19695338606834412, -2.3631489276885986, 1.4408767223358154, -0.7001633048057556, 1.909876823425293, -2.5962066650390625, 0.4627297520637512, -0.7010501623153687, -0.5226693153381348, 0.4208572208881378, -0.44024306535720825, 0.12373821437358856, -0.13964805006980896, -1.0723520517349243, -0.11890946328639984, -0.6203355193138123, 0.5887970924377441, 1.1038060188293457, 1.2945975065231323, -1.0157660245895386, -0.44310805201530457, -1.666007399559021, -0.19986248016357422, -0.6743267178535461, 0.33105385303497314, -2.035543203353882, -0.28617528080940247, -1.984562635421753, -2.3442325592041016, -1.3555455207824707, -0.7858787178993225, 1.1153688430786133, 0.16871246695518494, -0.9388967752456665, 1.232478380203247, -0.42442551255226135, -1.849314570426941, 1.139278531074524, -2.0960371494293213 ]
https://github.com/huggingface/datasets/issues/4456
Workflow for Tabular data
@wconnell I'm not sure what you mean by my secret, I load them into a numpy array 😁 An example dataset is [here](https://portal.gdc.cancer.gov/repository?facetTab=files&filters=%7B%22content%22%3A%5B%7B%22content%22%3A%7B%22field%22%3A%22cases.project.project_id%22%2C%22value%22%3A%5B%22TCGA-CESC%22%5D%7D%2C%22op%22%3A%22in%22%7D%2C%7B%22content%22%3A%7B%22field%22%3A%22files.data_category%22%2C%22value%22%3A%5B%22DNA%20Methylation%22%5D%7D%2C%22op%22%3A%22in%22%7D%5D%2C%22op%22%3A%22and%22%7D&searchTableTab=files) which is a dataset of DNA methylation reads. This dataset is about 950 rows and 450k columns.
Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion !
724
40
Workflow for Tabular data Tabular data are treated very differently than data for NLP, audio, vision, etc. and therefore the worflow for tabular data in `datasets` is not ideal. For example for tabular data, it is common to use pandas/spark/dask to process the data, and then load the data into X and y (X is an array of features and y an array of labels), then train_test_split and finally feed the data to a machine learning model. In `datasets` the workflow is different: we use load_dataset, then map, then train_test_split (if we only have a train split) and we end up with columnar dataset splits, not formatted as X and y. Right now, it is already possible to convert a dataset from and to pandas, but there are still many things that could improve the workflow for tabular data: - be able to load the data into X and y - be able to load a dataset from the output of spark or dask (as far as I know it's usually csv or parquet files on S3/GCS/HDFS etc.) - support "unsplit" datasets explicitly, instead of putting everything in "train" by default cc @adrinjalali @merveenoyan feel free to complete/correct this :) Feel free to also share ideas of APIs that would be super intuitive in your opinion ! @wconnell I'm not sure what you mean by my secret, I load them into a numpy array 😁 An example dataset is [here](https://portal.gdc.cancer.gov/repository?facetTab=files&filters=%7B%22content%22%3A%5B%7B%22content%22%3A%7B%22field%22%3A%22cases.project.project_id%22%2C%22value%22%3A%5B%22TCGA-CESC%22%5D%7D%2C%22op%22%3A%22in%22%7D%2C%7B%22content%22%3A%7B%22field%22%3A%22files.data_category%22%2C%22value%22%3A%5B%22DNA%20Methylation%22%5D%7D%2C%22op%22%3A%22in%22%7D%5D%2C%22op%22%3A%22and%22%7D&searchTableTab=files) which is a dataset of DNA methylation reads. This dataset is about 950 rows and 450k columns.
[ -1.319327712059021, -0.948590099811554, -0.5651821494102478, 1.3341641426086426, -0.1637420952320099, -1.1554548740386963, 0.025730103254318237, -1.1703834533691406, 1.4639427661895752, -0.8159989714622498, 0.3318185806274414, -1.6898488998413086, 0.03957409784197807, -0.5296154022216797, -0.617659330368042, -0.9668276906013489, -0.4205298125743866, -0.8166096210479736, 1.0706363916397095, 2.624284505844116, 1.1290735006332397, -1.4337525367736816, 2.704298973083496, 0.5041660666465759, -0.2586393654346466, -1.0624276399612427, 0.5357946157455444, 0.09323882311582565, -1.4218676090240479, -0.5046118497848511, -0.9448002576828003, 0.028252340853214264, -0.5096263289451599, -0.32118213176727295, -0.041877131909132004, 0.2911570072174072, -0.2523286044597626, -0.36154183745384216, -0.4639251232147217, -0.8764998912811279, 0.6098653078079224, -0.3194146752357483, 0.91031414270401, -0.4250125288963318, 1.8099861145019531, -0.6557068228721619, 0.3887183368206024, 0.6006272435188293, 1.418151617050171, 0.1671668291091919, 0.10859307646751404, 0.25657129287719727, 0.3848443627357483, 0.02609540894627571, 0.5300289392471313, 1.114890694618225, 0.6764268279075623, 0.37849152088165283, 0.7686799764633179, -2.1139731407165527, 1.3793118000030518, -1.0550878047943115, 0.35103535652160645, 1.3359274864196777, -0.8965075612068176, 0.539588212966919, -1.7729476690292358, -0.15352563560009003, 0.5632655024528503, -2.298222541809082, 0.2277994602918625, -1.2935192584991455, -0.5318706035614014, 0.8547899127006531, 0.34031200408935547, -1.1604465246200562, 0.37042686343193054, -0.5609408020973206, 1.0637484788894653, 0.49102509021759033, 1.0228348970413208, -1.5702917575836182, -0.1498931348323822, -0.3113879859447479, 0.05350898578763008, -1.4357023239135742, -1.539993166923523, 0.5899114608764648, 0.6738186478614807, 0.5018714666366577, 0.11940708756446838, 0.9198616147041321, -1.0532174110412598, 0.7547093033790588, -1.00736403465271, -1.511974573135376, -1.3132387399673462, -2.1555285453796387, -2.263265609741211, 0.8337041735649109, -0.35289379954338074, -0.6551278829574585, 2.019439697265625, -0.9689900279045105, -1.6763927936553955, 1.2249802350997925, 0.26171308755874634, 0.034181419759988785, 2.4696247577667236, 0.22403419017791748, -0.7687937617301941, 0.4907512366771698, -0.7013776302337646, 0.8614375591278076, -0.4037941098213196, 1.3518011569976807, 0.40556201338768005, -0.9555237293243408, 1.5909466743469238, -0.4469398558139801, 0.5228593945503235, -0.5229638814926147, -0.7497367262840271, -0.8322162628173828, 0.25298503041267395, 1.9352384805679321, -0.30443274974823, 1.4701176881790161, -0.3921881914138794, -1.6731199026107788, -1.6606425046920776, 0.9610355496406555, 0.4248107373714447, -0.78879314661026, -0.008839667774736881, -0.2645288109779358, 0.09510473161935806, 0.049965303391218185, 0.9979739189147949, 1.2687867879867554, 0.6388742923736572, -0.24602270126342773, -0.9774850010871887, 0.10881068557500839, -0.2017718255519867, -0.5972943902015686, -1.8430742025375366, -0.41472068428993225, 0.1670776903629303, 0.7244035601615906, -1.1949725151062012, 1.738793969154358, 0.9811443090438843, 1.9067447185516357, 0.9754727482795715, -0.40052342414855957, 1.5073226690292358, 0.08755426108837128, 1.8040225505828857, -0.6179198622703552, 0.7854184508323669, -0.385488361120224, -1.1559498310089111, 0.686819314956665, -0.416849285364151, -2.0909388065338135, -0.7287972569465637, -0.6758791208267212, -0.1856287270784378, -0.7474401593208313, 0.8384633660316467, -0.2816617488861084, -1.4641902446746826, 0.3931656777858734, -0.6741829514503479, 0.20981301367282867, -1.1545175313949585, 0.39898043870925903, 0.761403501033783, -0.649168848991394, 0.06345098465681076, -0.12735825777053833, -1.388350486755371, -0.4908456802368164, 0.22037535905838013, 1.832556962966919, -0.8030335903167725, 0.9052808284759521, 0.9966078996658325, -0.6929803490638733, 0.0993335172533989, 0.2836611568927765, -0.21172867715358734, 0.7682945728302002, -1.0744843482971191, -0.34733864665031433, 1.2409104108810425, -0.20948845148086548, -0.5370334386825562, 1.4362366199493408, 0.9011271595954895, -0.9802921414375305, -0.24918149411678314, -0.1370483934879303, -0.8233681321144104, 0.09592283517122269, -1.4725213050842285, -0.09406217187643051, 0.43837761878967285, -1.4102433919906616, -0.4783223569393158, -0.21022368967533112, 1.1730525493621826, -0.20840269327163696, 1.527398943901062, -0.44054895639419556, -0.2930794954299927, -0.35439908504486084, -0.4817485511302948, 0.08090430498123169, -0.2816897928714752, -0.5754181742668152, 0.17803509533405304, -0.9062066674232483, 0.40029507875442505, 1.586286187171936, 0.36847609281539917, 0.11283651739358902, 0.3268758952617645, 1.080264687538147, 0.40639379620552063, -0.06852979212999344, -0.8800234198570251, -1.5146437883377075, 2.030634880065918, -1.4125245809555054, 2.1457760334014893, 0.8403161764144897, -0.017236048355698586, -1.6987714767456055, -1.8206634521484375, 1.178427815437317, 1.1553665399551392, 2.433150291442871, 0.5752445459365845, 0.3017026484012604, -0.8679918646812439, -0.6458624005317688, 0.3314388394355774, -1.064812421798706, -0.7556512355804443, 0.1593448519706726, 2.4606943130493164, 1.832769513130188, -0.39709264039993286, -0.21001967787742615, -0.9714887142181396, 1.4859834909439087, -0.15772153437137604, 0.24180835485458374, 2.0005505084991455, -0.33658134937286377, -1.2249194383621216, 1.2944810390472412, -2.3862931728363037, 0.11399516463279724, 2.03169846534729, 0.3776019513607025, 0.05585522949695587, -1.3174530267715454, -0.706976592540741, -0.4129258096218109, -0.25409358739852905, -1.250545859336853, 0.5166851878166199, -0.3129359185695648, -0.7805030345916748, -1.5523483753204346, 0.09833770990371704, -1.2635746002197266, -1.6018563508987427, 0.2758396565914154, 1.7297210693359375, 2.158583879470825, -0.8111881017684937, 1.556440830230713, -0.23589199781417847, 0.1751374751329422, 1.2115978002548218, 1.2493951320648193, 2.938133716583252, 1.8368860483169556, -1.1906238794326782, 0.6351494193077087, -0.1715105026960373, -0.3410385847091675, 0.9895009398460388, -1.179638147354126, 1.3624074459075928, -0.06333061307668686, -1.182587742805481, -1.2425272464752197, 0.998828649520874, 0.48031967878341675, -0.0425158366560936, -0.475561261177063, 1.1283830404281616, 0.030677594244480133, 1.3366782665252686, 0.4418661892414093, -0.3772795796394348, 0.5405439138412476, -0.3326026201248169, -0.6755588054656982, 1.692287802696228, 0.25472795963287354, -1.562643051147461, -2.245234251022339, -0.33072805404663086, -0.7798133492469788, 0.017762325704097748, -0.5708765983581543, -1.1323437690734863, 1.7102735042572021, 0.262234628200531, -1.3161790370941162, -0.20365937054157257, -0.22251859307289124, -0.4985903203487396, 2.6485323905944824, -1.4130710363388062, -0.10508247464895248, -0.8452286124229431, -0.6188571453094482, 1.4676991701126099, -1.231212854385376, -0.23041629791259766, -1.0279860496520996, -0.5969962477684021, -1.2428786754608154, -0.4320160448551178, 0.058708690106868744, -1.0059114694595337, 0.6329367160797119, 0.2834085524082184, -0.9597266912460327, -0.3918532133102417, -0.8947353363037109, 0.9160397052764893, 0.022184621542692184, 0.2807358503341675, 1.8813462257385254, 0.3964826762676239, -0.29419130086898804, 0.6561191082000732, 1.2695832252502441, 0.5751529932022095, -0.7531323432922363, 0.04306983947753906, -0.8589992523193359, 0.18167558312416077, -1.2453786134719849, 0.32352569699287415, -2.897390127182007, 0.7086395025253296, -0.031299788504838943, -0.022861642763018608, 0.13088609278202057, -1.3604240417480469, 1.1341164112091064, 2.6277687549591064, -1.0332268476486206, 0.550584077835083, 0.32551223039627075, 1.1977272033691406, -1.6207154989242554, 0.37472912669181824, -0.18306483328342438, 2.0500123500823975, 0.28353413939476013, 1.2447844743728638, -0.6250407695770264, -2.3948781490325928, 0.48613429069519043, -1.227465033531189, -1.3038585186004639, 0.6483904123306274, -0.9720677733421326, 0.04413429647684097, -1.4458602666854858, -0.301042765378952, -0.9998958706855774, -1.1969099044799805, 0.6925173401832581, 0.13464020192623138, 0.499555766582489, -0.4793843924999237, 0.29019394516944885, -2.160068988800049, -1.353265643119812, -0.15442664921283722, -0.9085853099822998, 0.5030657649040222, -0.3301743268966675, 0.6119152903556824, -0.15739744901657104, -0.029548440128564835, 0.2718280255794525, 1.4034219980239868, 3.2866532802581787, 0.17709939181804657, 0.35986560583114624, -0.19448931515216827, -0.9446545839309692, 1.3529149293899536, 0.9748722910881042, -0.1078394204378128, -0.4814258813858032, -0.9764346480369568, 1.2244478464126587, 2.0117697715759277, 0.9948161840438843, 0.071933314204216, -0.8062818646430969, -0.6803876757621765, -0.11264066398143768, 0.28168991208076477, 0.5334110260009766, 0.9355918765068054, -0.07611215114593506, 0.10157030820846558, 1.443835973739624, 1.3148809671401978, -0.5631229281425476, 0.25844961404800415, -0.9674174189567566, -0.5386733412742615, 0.43839746713638306, 0.20713911950588226, -0.05229887366294861, 0.38059747219085693, -1.0091859102249146, -0.12536630034446716, -0.5082950592041016, -0.8939063549041748, -0.7627418637275696, -0.4579695165157318, -0.2820736765861511, 1.6645433902740479, 0.1296449899673462, -0.509785532951355, 0.0991799458861351, -0.7565355896949768, -0.28761205077171326, -1.1601158380508423, 0.3390924632549286, -0.013282569125294685, -0.143143892288208, -0.20364104211330414, 1.8616936206817627, -0.9021642804145813, -2.1182188987731934, 0.17563986778259277, 0.2065754234790802, -0.37067246437072754, 0.21068640053272247, 1.631516695022583, 0.47144588828086853, 1.5701909065246582, 1.3315426111221313, 1.0563558340072632, -0.6853629946708679, -1.3433220386505127, 0.7307284474372864, 1.0548902750015259, -1.2697416543960571, 0.9379914999008179, -0.052883949130773544, -0.49347275495529175, 0.675649106502533, 1.2334719896316528, 0.4938651919364929, -2.100493907928467, 0.828827440738678, -0.9657312035560608, 0.6846973896026611, 0.7459361553192139, 0.6438912749290466, 0.1345846801996231, 0.855076253414154, -1.2990927696228027, -1.163163185119629, -0.8674988150596619, -0.6101391315460205, 1.9299007654190063, -0.2886720895767212, 0.5363646149635315, -0.17285531759262085, -1.1918938159942627, -0.08658024668693542, 0.7211530208587646, 0.3893868923187256, -0.46845561265945435, 0.8143189549446106, -0.8332452774047852, -1.1377590894699097, -1.3369914293289185, -0.45108965039253235, -1.0658411979675293, -0.9875024557113647, 1.1108324527740479, 0.7812718749046326, 0.268917053937912, 1.8806896209716797, 0.6950785517692566, 0.32417184114456177, -2.5955312252044678, 0.89931720495224, 0.17368781566619873, -0.0639655590057373, 0.8794777989387512, 0.28798070549964905, 0.9507465958595276, 0.0845077633857727, 0.4045394957065582, -2.3608334064483643, 2.36661958694458, -0.2929723262786865, 0.7268587946891785, -0.14567424356937408, -0.149368017911911, 1.0997638702392578, 0.5430496335029602, 0.5126999020576477, -1.11149263381958, 0.6754199266433716, -0.43515992164611816, 1.1181271076202393, 0.9044349193572998, -0.7368369698524475, 0.018286503851413727, 1.3041658401489258, 0.5306873917579651, -0.5562397241592407, -0.9872575998306274, -0.7540107369422913, 0.8046059012413025, 1.7806074619293213, -0.19282184541225433, 0.054327547550201416, 0.7769691944122314, 0.6340031027793884, -1.3883625268936157, 0.06886202841997147, -0.6278111934661865, -0.7686904072761536, 1.5897226333618164, 1.9284493923187256, -0.09300738573074341, -0.31996801495552063, -0.6085310578346252, -1.2948251962661743, 0.7553715705871582, -0.02628452703356743, 0.2546854615211487, 0.5665600299835205, -0.7601639032363892, 1.132187843322754, 0.7932004332542419, 0.9056950211524963, 0.22427766025066376, 0.29489246010780334, 0.37575119733810425, -0.370806485414505, -1.1590501070022583, -0.30338868498802185, -1.0718560218811035, -2.5155029296875, 0.5000869035720825, -0.14096108078956604, -1.492430329322815, 0.04798535630106926, -1.0171778202056885, 0.9305392503738403, -0.5512727499008179, -1.135164499282837, -1.6438699960708618, 0.3344086706638336, -0.14054711163043976, 1.0340723991394043, -1.6641958951950073, -0.07426150143146515, 1.1835453510284424, 0.9269635081291199, -0.5402926206588745, 1.1280065774917603, 0.23526808619499207, 1.134498119354248, 0.7044346332550049, -0.3193744421005249, 0.5663068890571594, 0.025244370102882385, -1.3023407459259033, 0.3539828360080719, 1.1587309837341309, 0.11136550456285477, 1.3695217370986938, -0.542047917842865, 0.024459000676870346, 0.3085375130176544, -0.4536726176738739, -0.437167227268219, -0.49112653732299805, 0.74088054895401, 0.02221950888633728, -0.9217209219932556, 0.015372906811535358, -0.1103895977139473, -0.36996686458587646, 0.3033539652824402, -1.3447529077529907, -0.3028416335582733, -0.5025428533554077, -0.500614583492279, -1.218607783317566, -0.03122638165950775, 1.4800516366958618, -0.6400486826896667, -0.19964702427387238, 0.524377703666687, 0.5327913761138916, 0.5582692623138428, 0.8271335363388062, -0.709248960018158, -0.34462544322013855, -0.2476637214422226, -0.3863770663738251, 0.3691713213920593, 1.3471730947494507, -0.17849764227867126, -1.0046764612197876, 0.8033068180084229, -0.31738632917404175, 0.06947527080774307, 1.9730451107025146, 0.2166345715522766, -0.772447943687439, 0.1933610439300537, -0.8447884321212769, 2.0494813919067383, 1.8094578981399536, 1.3229265213012695, -0.20193129777908325, -0.8771921992301941, 0.7353816032409668, -0.35860005021095276, -0.2411232888698578, 1.0520957708358765, 0.5453928709030151, -0.19818216562271118, -1.4432990550994873, 0.6303776502609253, 1.2742362022399902, -0.8104562759399414, -0.6195928454399109, 0.11471877992153168, -0.8538462519645691, 1.059981346130371, 0.6583667397499084, 0.39869147539138794, 0.1837107539176941, 1.5464142560958862, 0.8130818605422974, -0.33788740634918213, 0.6313666701316833, 0.5587037801742554, -0.23619015514850616, -2.0659048557281494, -1.2078663110733032, 0.2548850476741791, -0.42633548378944397, -1.6515991687774658, 1.446122169494629, -1.0996434688568115, -0.9125831127166748, 0.5386557579040527, 0.08833862096071243, 1.4815175533294678, 0.3067477345466614, 1.541058897972107, 2.1180126667022705, 0.8460482954978943, 0.3634829819202423, 1.421594262123108, -0.08883403241634369, -0.3937811255455017, 1.8127355575561523, -0.354127436876297, 0.41382670402526855, 1.1483784914016724, -0.28832224011421204, -0.9793801307678223, -0.7448853850364685, -1.135582685470581, -0.5876560211181641, 0.9840989112854004, 0.001454271376132965, -1.1704157590866089, 0.24982011318206787, 1.5839743614196777, 0.013959106989204884, -0.3775189518928528, 0.6273980736732483, 0.442973256111145, -0.7747317552566528, -0.05114232748746872, -1.0638971328735352, 0.5128823518753052, -0.23008860647678375, -0.28243914246559143, 0.3034290671348572, 0.35974347591400146, 1.3054933547973633, 0.10914262384176254, 0.18407860398292542, 1.1275209188461304, -1.4517046213150024, 1.3044662475585938, -0.6211528778076172, 0.29812750220298767, -2.3035788536071777, 1.3493211269378662, -0.7327752113342285, 1.90871262550354, -2.623997211456299, 0.48530393838882446, -0.6609503030776978, -0.49381357431411743, 0.31395936012268066, -0.3874305784702301, 0.22946834564208984, -0.021884258836507797, -1.1251450777053833, -0.04525531828403473, -0.5884043574333191, 0.6654815077781677, 0.9986709356307983, 1.3065563440322876, -1.0302865505218506, -0.34983596205711365, -1.7479279041290283, -0.1528385877609253, -0.944093644618988, 0.16971905529499054, -2.089526891708374, -0.2556283473968506, -1.8978688716888428, -2.3182032108306885, -1.369663953781128, -0.7669284343719482, 1.0346063375473022, 0.3344258964061737, -0.9284740090370178, 1.2875200510025024, -0.36428460478782654, -1.8040471076965332, 1.1376734972000122, -2.128730535507202 ]
https://github.com/huggingface/datasets/issues/4453
Dataset Viewer issue for Yaxin/SemEval2015
I understand that the issue is that a remote file (URL) is being loaded as a local file. Right @albertvillanova @lhoestq? ``` Message: [Errno 2] No such file or directory: 'https://raw.githubusercontent.com/YaxinCui/ABSADataset/main/SemEval2015Task12Corrected/train/restaurants_train.xml' ```
### Link _No response_ ### Description _No response_ ### Owner _No response_
726
32
Dataset Viewer issue for Yaxin/SemEval2015 ### Link _No response_ ### Description _No response_ ### Owner _No response_ I understand that the issue is that a remote file (URL) is being loaded as a local file. Right @albertvillanova @lhoestq? ``` Message: [Errno 2] No such file or directory: 'https://raw.githubusercontent.com/YaxinCui/ABSADataset/main/SemEval2015Task12Corrected/train/restaurants_train.xml' ```
[ -1.1853889226913452, -0.8854483366012573, -0.840958833694458, 1.6682674884796143, -0.08599764108657837, -1.2910560369491577, 0.13046209514141083, -0.893546998500824, 1.6058588027954102, -0.5928777456283569, 0.3441598117351532, -1.6064913272857666, -0.13424979150295258, -0.6883212924003601, -0.737695038318634, -0.8645017147064209, -0.362605482339859, -0.7888900637626648, 1.1545772552490234, 2.5188918113708496, 1.3178807497024536, -1.3302112817764282, 2.7605082988739014, 0.7114314436912537, -0.360521525144577, -1.0407737493515015, 0.5682672262191772, -0.025751013308763504, -1.1626068353652954, -0.5553817749023438, -0.9367139339447021, -0.08916135132312775, -0.47478950023651123, -0.4690167307853699, -0.07249972969293594, 0.45786693692207336, -0.2256978303194046, -0.45504140853881836, -0.5821281671524048, -0.7902798056602478, 0.46512123942375183, -0.3232711851596832, 0.8315712213516235, -0.30136221647262573, 1.8365514278411865, -0.7067415714263916, 0.3478168249130249, 0.6389142274856567, 1.5013022422790527, 0.11739259958267212, -0.009887960739433765, 0.4420725107192993, 0.49718379974365234, -0.14943720400333405, 0.45262470841407776, 1.2468513250350952, 0.46762412786483765, 0.5169188976287842, 0.6872907876968384, -2.1735849380493164, 1.2789771556854248, -0.9710823893547058, 0.24133780598640442, 1.2588070631027222, -1.203525424003601, 0.418953001499176, -1.6886128187179565, 0.033504076302051544, 0.5227118134498596, -2.1836540699005127, 0.23478351533412933, -1.269717812538147, -0.5363945364952087, 0.8531643748283386, 0.29760968685150146, -1.419179081916809, 0.06984101980924606, -0.48315441608428955, 1.1068472862243652, 0.44050082564353943, 1.1041951179504395, -1.6053894758224487, -0.03536820039153099, -0.2630588710308075, -0.11736708134412766, -1.304564118385315, -1.3735332489013672, 0.530246376991272, 0.6736325025558472, 0.8412843346595764, -0.033576637506484985, 0.9633365869522095, -0.8108076453208923, 0.770834743976593, -0.9521652460098267, -1.8162602186203003, -1.5169975757598877, -2.3596677780151367, -2.1735737323760986, 0.8033992648124695, -0.5257266759872437, -0.5773102045059204, 2.001865863800049, -0.8226352334022522, -1.8829585313796997, 1.1098805665969849, 0.29819703102111816, -0.005649934522807598, 2.3420181274414062, 0.3191656768321991, -0.7595346570014954, 0.3636161684989929, -0.7341639995574951, 0.8498728275299072, -0.6310267448425293, 1.4291843175888062, 0.42409220337867737, -1.0228710174560547, 1.548631191253662, -0.42432355880737305, 0.730457603931427, -0.6395500898361206, -0.521481990814209, -0.8326315879821777, 0.34853601455688477, 1.9408819675445557, -0.2917822301387787, 1.603009819984436, -0.40610867738723755, -1.5802603960037231, -1.6184755563735962, 0.8637538552284241, 0.39134398102760315, -0.8702449202537537, 0.2749619781970978, -0.4304890036582947, 0.14885161817073822, -0.047357358038425446, 1.1490163803100586, 1.3828917741775513, 0.469860315322876, -0.22030967473983765, -0.8398008346557617, 0.2842819094657898, -0.04707714170217514, -0.7248515486717224, -1.807142972946167, -0.43499016761779785, 0.18545231223106384, 0.5457310676574707, -1.2110991477966309, 1.6598418951034546, 0.8435356020927429, 2.0291635990142822, 1.0570333003997803, -0.22912907600402832, 1.4074724912643433, -0.11662023514509201, 1.8794406652450562, -0.5407370328903198, 0.5755276083946228, -0.28970956802368164, -1.157171368598938, 0.8219926357269287, -0.3900993764400482, -2.0128283500671387, -0.9116131663322449, -0.8029051423072815, -0.13663248717784882, -0.6326272487640381, 0.8805577158927917, -0.3382221758365631, -1.340989351272583, 0.132481649518013, -0.8616617918014526, 0.22368261218070984, -1.3799203634262085, 0.19488857686519623, 0.800349235534668, -0.521776020526886, 0.07976227253675461, -0.18468178808689117, -1.2900785207748413, -0.5022737979888916, 0.4197249114513397, 1.9666956663131714, -0.7586456537246704, 1.0457334518432617, 0.8659595251083374, -0.7762768268585205, 0.12404946982860565, 0.21532635390758514, -0.2555893063545227, 0.8526768088340759, -1.0852550268173218, -0.3158448338508606, 1.2679117918014526, -0.24662533402442932, -0.730268120765686, 1.3960976600646973, 0.9890161156654358, -1.0090255737304688, -0.13658177852630615, -0.24909454584121704, -0.8612014651298523, -0.00037109386175870895, -1.667589783668518, -0.13940942287445068, 0.384003609418869, -1.4084084033966064, -0.47750988602638245, -0.22916918992996216, 1.3886622190475464, -0.11342266201972961, 1.4072524309158325, -0.33030077815055847, -0.20912529528141022, -0.3222745954990387, -0.45098012685775757, 0.12624725699424744, -0.35178685188293457, -0.6154953837394714, 0.16409580409526825, -0.6933590769767761, 0.3262331485748291, 1.375043511390686, 0.2805258333683014, 0.11212163418531418, 0.6462478041648865, 1.1889954805374146, 0.2892398536205292, -0.08629811555147171, -0.8028736114501953, -1.4892637729644775, 1.9962527751922607, -1.2104458808898926, 1.9418752193450928, 0.7469015121459961, -0.12616726756095886, -1.7534475326538086, -1.9223588705062866, 1.355546474456787, 1.3452142477035522, 2.3258168697357178, 0.6537599563598633, 0.4303555488586426, -0.8208088278770447, -0.7187824845314026, 0.15549501776695251, -1.275291919708252, -0.7136180996894836, 0.09583704173564911, 2.4587018489837646, 1.907077670097351, -0.5858960747718811, -0.257745623588562, -1.0183080434799194, 1.2946780920028687, -0.18011708557605743, 0.21183724701404572, 1.9210618734359741, -0.2694667875766754, -0.9939543008804321, 1.0899600982666016, -2.3986968994140625, 0.21484284102916718, 2.1146953105926514, 0.3568258583545685, 0.15063178539276123, -1.5781316757202148, -0.7119275331497192, -0.16062679886817932, -0.32738953828811646, -1.1237117052078247, 0.768497109413147, -0.1507958024740219, -0.8285993933677673, -1.3719918727874756, 0.16550147533416748, -1.0002150535583496, -1.8186861276626587, 0.31020236015319824, 1.9086562395095825, 1.7753452062606812, -0.7679110765457153, 1.5708297491073608, -0.22770509123802185, 0.11668658256530762, 1.4324684143066406, 1.3178110122680664, 3.1320555210113525, 1.983039140701294, -1.1244492530822754, 0.8452717661857605, -0.10859154909849167, -0.46171578764915466, 1.2246644496917725, -1.1932380199432373, 1.2266448736190796, -0.2026710957288742, -1.195908784866333, -1.3522850275039673, 0.8505727052688599, 0.5435230135917664, -0.09738927334547043, -0.4721587896347046, 1.3353748321533203, 0.041287437081336975, 1.2712210416793823, 0.4581466317176819, -0.42856565117836, 0.7063221335411072, -0.33309271931648254, -0.3482697308063507, 1.5469266176223755, 0.3172919750213623, -1.4162743091583252, -2.2516226768493652, -0.15085595846176147, -0.887475848197937, -0.10052616894245148, -0.6590932011604309, -1.098472237586975, 1.6289677619934082, 0.40086936950683594, -1.2502024173736572, -0.3118014633655548, -0.2952692210674286, -0.5531280636787415, 2.765575408935547, -1.3889142274856567, -0.2801763117313385, -0.9696506857872009, -0.5399067401885986, 1.8328306674957275, -1.1233887672424316, -0.3437369465827942, -1.1463980674743652, -0.6364681720733643, -1.2326680421829224, -0.4868466258049011, 0.006214872933924198, -0.8942206501960754, 0.7555345892906189, 0.05602654069662094, -1.216634750366211, -0.2640273869037628, -0.7508766651153564, 0.986980676651001, -0.1433391124010086, 0.18027429282665253, 1.9611095190048218, 0.4386446475982666, -0.42930087447166443, 0.8572804927825928, 1.1608505249023438, 0.5168596506118774, -0.6170250177383423, 0.18330031633377075, -0.5125772356987, 0.3160826563835144, -1.4177184104919434, 0.2252895087003708, -2.975831985473633, 0.619982898235321, -0.16539670526981354, -0.07903890311717987, -0.030622657388448715, -1.3857909440994263, 1.1747595071792603, 2.5874927043914795, -1.1395206451416016, 0.4547958970069885, 0.3275146484375, 1.2012543678283691, -1.6186549663543701, 0.36349645256996155, -0.4639873206615448, 2.1364316940307617, 0.09148605167865753, 1.3232002258300781, -0.4681326746940613, -2.2157037258148193, 0.6222969889640808, -1.2237809896469116, -1.0091592073440552, 0.7966744303703308, -0.8188529014587402, 0.06313499808311462, -1.3860852718353271, -0.14633844792842865, -0.8189408779144287, -1.28196120262146, 0.7214640974998474, 0.16644510626792908, 0.3895956575870514, -0.6006219387054443, 0.29005569219589233, -2.127121686935425, -1.347979187965393, -0.20089520514011383, -0.9551628828048706, 0.4162088930606842, -0.3715531527996063, 0.5843542814254761, -0.25329697132110596, 0.05257441848516464, 0.24727071821689606, 1.551779866218567, 3.3990437984466553, 0.09271005541086197, 0.32697758078575134, -0.1535218209028244, -0.7184996604919434, 1.442612886428833, 0.9280799031257629, -0.14920493960380554, -0.5813146829605103, -0.8740295767784119, 1.3447848558425903, 1.9647480249404907, 1.0294137001037598, 0.08957614004611969, -0.8639733791351318, -0.6472213268280029, -0.10417245328426361, 0.06461236625909805, 0.47767603397369385, 0.8904198408126831, 0.07473772019147873, -0.06632278114557266, 1.2352088689804077, 1.0449721813201904, -0.4452448785305023, 0.46136221289634705, -0.9425638318061829, -0.3754940629005432, 0.34495025873184204, 0.34606340527534485, -0.004155774135142565, 0.4229004383087158, -0.9996073246002197, -0.24902720749378204, -0.1649061143398285, -0.8619175553321838, -0.8809807896614075, -0.3896793723106384, -0.37243667244911194, 1.6332297325134277, 0.12883354723453522, -0.5848608016967773, -0.0238160602748394, -0.7505344152450562, -0.0490570068359375, -0.9602568745613098, 0.1345357596874237, -0.1270279735326767, -0.052145227789878845, 0.0454738512635231, 1.6960554122924805, -1.1175117492675781, -2.241454601287842, 0.30310675501823425, 0.31803658604621887, -0.31676962971687317, 0.08901778608560562, 1.6510528326034546, 0.5307216048240662, 1.3868887424468994, 1.3448126316070557, 1.0379067659378052, -0.885522723197937, -1.2709020376205444, 0.6525185108184814, 0.9785228371620178, -1.3369938135147095, 0.8635925054550171, -0.09637890011072159, -0.3431393504142761, 0.5565900802612305, 1.346642255783081, 0.44255131483078003, -1.9236637353897095, 0.7601297497749329, -0.7780864238739014, 0.8093836903572083, 0.7415826916694641, 0.735040545463562, 0.4015474319458008, 0.7406754493713379, -1.1361093521118164, -1.211642861366272, -0.7656328082084656, -0.732571005821228, 1.9887394905090332, -0.21163390576839447, 0.64866042137146, -0.007661416195333004, -1.3587895631790161, -0.08803033083677292, 0.7698785066604614, 0.34397271275520325, -0.4360504746437073, 0.7329736351966858, -0.6662254333496094, -0.9867852330207825, -1.2899423837661743, -0.5349900722503662, -0.9401712417602539, -1.1054573059082031, 1.0463100671768188, 0.8766136169433594, 0.3579539358615875, 1.9437428712844849, 0.7061367034912109, 0.2591325342655182, -2.6503689289093018, 0.9877491593360901, 0.32106834650039673, 0.09415178745985031, 0.7476174235343933, 0.2615455985069275, 1.0126991271972656, -0.04074288159608841, 0.5736903548240662, -2.3367137908935547, 2.2729709148406982, -0.17865543067455292, 0.5030092000961304, 0.013982648029923439, -0.14135240018367767, 0.9974620342254639, 0.48990705609321594, 0.6112444996833801, -1.1202476024627686, 0.7505319118499756, -0.5822654962539673, 1.1924464702606201, 0.9315021634101868, -0.8429356813430786, 0.08045874536037445, 1.4612928628921509, 0.4744572043418884, -0.4707479476928711, -1.0156828165054321, -0.7909781336784363, 1.0327872037887573, 1.5649977922439575, 0.09757085144519806, 0.030302496626973152, 0.87784343957901, 0.48725247383117676, -1.271329641342163, 0.042972661554813385, -0.7041428685188293, -0.6452873349189758, 1.6519440412521362, 2.030118942260742, -0.16994574666023254, -0.1835339367389679, -0.8874219059944153, -1.223607063293457, 0.746907114982605, -0.008584116585552692, -0.007825993001461029, 0.6910485029220581, -0.6487550735473633, 1.1524524688720703, 0.5634956955909729, 0.9372139573097229, 0.036249347031116486, 0.3786861300468445, 0.44156938791275024, -0.2631668746471405, -1.2704999446868896, -0.35204002261161804, -1.1697170734405518, -2.4323513507843018, 0.3419037461280823, -0.24383419752120972, -1.3916417360305786, 0.031248128041625023, -1.2220287322998047, 0.918217658996582, -0.6286110281944275, -1.0286617279052734, -1.5150115489959717, 0.24587209522724152, -0.29270973801612854, 0.7865920066833496, -1.5785263776779175, -0.07899242639541626, 1.1692633628845215, 0.8230335712432861, -0.8565941452980042, 1.0358151197433472, 0.1523509919643402, 1.115522027015686, 0.9200918674468994, -0.3870387673377991, 0.525595486164093, -0.11516875773668289, -1.299005150794983, 0.5940485000610352, 1.1164859533309937, 0.105170339345932, 1.5326815843582153, -0.5977193713188171, -0.07385313510894775, 0.5584929585456848, -0.60061115026474, -0.560693621635437, -0.5951531529426575, 0.6395189762115479, 0.15581397712230682, -0.989097535610199, -0.02783413976430893, -0.16025657951831818, -0.302802711725235, 0.30450311303138733, -1.5554914474487305, -0.12607790529727936, -0.25040894746780396, -0.5281402468681335, -1.2380179166793823, 0.05288258194923401, 1.2823028564453125, -0.5528702139854431, -0.3047674000263214, 0.5109788179397583, 0.292656272649765, 0.4627941846847534, 0.5498563647270203, -0.7880325317382812, -0.18770524859428406, -0.24528184533119202, -0.2273862510919571, 0.4831588864326477, 1.2019546031951904, -0.10342025756835938, -0.9817879796028137, 0.7333059906959534, -0.4322470724582672, 0.14040343463420868, 1.9938082695007324, 0.14800484478473663, -0.886652946472168, 0.22516150772571564, -0.6691168546676636, 1.9721068143844604, 1.518740177154541, 1.1687039136886597, -0.04604187607765198, -0.9854777455329895, 0.643217146396637, -0.14647361636161804, -0.3925298750400543, 0.7146892547607422, 0.293123722076416, -0.2552900016307831, -1.4638671875, 0.6187983155250549, 1.296804428100586, -0.742531418800354, -0.9274522066116333, -0.02747081033885479, -0.9773253202438354, 1.0243654251098633, 0.6580495238304138, 0.3605325520038605, 0.16173136234283447, 1.589292287826538, 0.765862226486206, -0.392731249332428, 0.3527691066265106, 0.440340518951416, -0.06929505616426468, -2.105529546737671, -1.0616954565048218, 0.4125517010688782, -0.429933100938797, -1.6712942123413086, 1.368066430091858, -1.1457247734069824, -0.9378322958946228, 0.5049153566360474, 0.19104790687561035, 1.4831451177597046, 0.32288461923599243, 1.5700997114181519, 2.01483416557312, 0.8403176069259644, 0.2922897934913635, 1.290273666381836, -0.1756688505411148, -0.5766162276268005, 1.795320987701416, -0.4043411612510681, 0.4283227026462555, 0.977691113948822, -0.5009422302246094, -1.1444660425186157, -0.7898262739181519, -1.1524033546447754, -0.6289553642272949, 1.1354472637176514, 0.23029834032058716, -1.1180925369262695, 0.2774103581905365, 1.449249029159546, 0.14872585237026215, -0.3189728856086731, 0.6734781265258789, 0.44103583693504333, -0.8970547914505005, 0.09052855521440506, -0.8802969455718994, 0.4995928406715393, -0.048298582434654236, -0.34781867265701294, 0.354768842458725, 0.4895364046096802, 1.197436809539795, -0.07135546207427979, 0.07909455895423889, 1.1517304182052612, -1.4569694995880127, 1.6104692220687866, -0.5144530534744263, 0.1796860694885254, -2.400397539138794, 1.4185739755630493, -0.7801846265792847, 1.8981990814208984, -2.6003637313842773, 0.3799908459186554, -0.5271775722503662, -0.460904985666275, 0.4048430025577545, -0.30926525592803955, 0.1540132462978363, -0.10067442059516907, -1.1189554929733276, 0.05300343036651611, -0.6855309009552002, 0.5006060600280762, 1.1609110832214355, 1.364511251449585, -1.0528563261032104, -0.24255064129829407, -1.821247935295105, -0.10201019793748856, -0.7206133008003235, 0.41524749994277954, -2.0214414596557617, -0.23787257075309753, -1.8244268894195557, -2.214149236679077, -1.2456578016281128, -0.7996679544448853, 0.9326122999191284, 0.26573657989501953, -0.8553451895713806, 1.252670407295227, -0.38029465079307556, -1.802133321762085, 1.0338335037231445, -2.1421473026275635 ]
https://github.com/huggingface/datasets/issues/4453
Dataset Viewer issue for Yaxin/SemEval2015
`xml.dom.minidom.parse` is not supported in streaming mode. I opened a PR here to fix it: https://huggingface.co/datasets/Yaxin/SemEval2015/discussions/1 Please review the PR @WithYouTo and let me know if it works !
### Link _No response_ ### Description _No response_ ### Owner _No response_
726
29
Dataset Viewer issue for Yaxin/SemEval2015 ### Link _No response_ ### Description _No response_ ### Owner _No response_ `xml.dom.minidom.parse` is not supported in streaming mode. I opened a PR here to fix it: https://huggingface.co/datasets/Yaxin/SemEval2015/discussions/1 Please review the PR @WithYouTo and let me know if it works !
[ -1.153558611869812, -0.9515496492385864, -0.7534737586975098, 1.6254000663757324, -0.14421598613262177, -1.3537907600402832, 0.20881281793117523, -0.8810123801231384, 1.562457799911499, -0.7647835612297058, 0.3543154001235962, -1.6550158262252808, -0.08269557356834412, -0.512526273727417, -0.7279037833213806, -0.9223713874816895, -0.4408254325389862, -0.7333829402923584, 1.1704351902008057, 2.472121000289917, 1.351015329360962, -1.2670819759368896, 2.769751787185669, 0.6287039518356323, -0.35872429609298706, -1.0885310173034668, 0.572648823261261, 0.024012990295886993, -1.263291358947754, -0.47212132811546326, -0.9262573719024658, -0.02762584388256073, -0.4707643389701843, -0.35718730092048645, -0.05582628771662712, 0.5128867626190186, -0.1982821524143219, -0.4809478521347046, -0.5418277978897095, -0.8171064853668213, 0.4421270787715912, -0.4086417853832245, 0.7631688117980957, -0.3848300278186798, 1.9219456911087036, -0.6015705466270447, 0.41876035928726196, 0.7152258157730103, 1.3721438646316528, 0.08280117064714432, 0.04115758091211319, 0.1377798467874527, 0.4432860016822815, -0.07988405972719193, 0.4557279646396637, 1.1563125848770142, 0.49995121359825134, 0.555945873260498, 0.4631091058254242, -2.0689499378204346, 1.3605437278747559, -0.8507584929466248, 0.23623771965503693, 1.4024019241333008, -1.131790041923523, 0.3294266164302826, -1.661642074584961, -0.016362354159355164, 0.5945224761962891, -2.1209239959716797, 0.2573431432247162, -1.242874264717102, -0.6119429469108582, 1.0205875635147095, 0.39504706859588623, -1.395353078842163, 0.01676413044333458, -0.4769047498703003, 1.1699179410934448, 0.4761577248573303, 1.1953271627426147, -1.6003506183624268, -0.007863321341574192, -0.2529962956905365, -0.12288016825914383, -1.3197920322418213, -1.453268051147461, 0.4887928366661072, 0.6869457364082336, 0.922807514667511, -0.02433435618877411, 0.7848445773124695, -0.871393084526062, 0.7665947079658508, -0.8818851113319397, -1.6958746910095215, -1.4425123929977417, -2.4994261264801025, -2.345914602279663, 0.7375179529190063, -0.43391111493110657, -0.5982388257980347, 1.9618935585021973, -0.9578107595443726, -1.859427809715271, 1.2187278270721436, 0.1600589156150818, 0.11317785829305649, 2.385023832321167, 0.19641607999801636, -0.6645908355712891, 0.2998484969139099, -0.7165499329566956, 0.8072945475578308, -0.65123051404953, 1.3655825853347778, 0.4461352229118347, -1.0884840488433838, 1.543920874595642, -0.5036560893058777, 0.6262970566749573, -0.7124478220939636, -0.4131796658039093, -0.7056455016136169, 0.3540682792663574, 1.796700119972229, -0.3581322729587555, 1.5877009630203247, -0.4179711937904358, -1.526719093322754, -1.5653138160705566, 0.9016286134719849, 0.3715575039386749, -0.7818393111228943, 0.19406743347644806, -0.3670540750026703, 0.07149751484394073, -0.05357198044657707, 1.0906224250793457, 1.3834642171859741, 0.6191741824150085, -0.34205368161201477, -0.857930600643158, 0.24615371227264404, -0.0021767313592135906, -0.7042316198348999, -1.8395322561264038, -0.3410351574420929, 0.09448439627885818, 0.5612139105796814, -1.164292812347412, 1.7297059297561646, 0.9038387537002563, 2.0946805477142334, 0.9989641904830933, -0.23717418313026428, 1.445420265197754, -0.05304944887757301, 1.8448116779327393, -0.5013766884803772, 0.6391279101371765, -0.2895756661891937, -1.2078384160995483, 0.7462647557258606, -0.4423881769180298, -1.9180772304534912, -0.9145244359970093, -0.8434345126152039, -0.24668465554714203, -0.6977961659431458, 0.9053437113761902, -0.2433779388666153, -1.3750739097595215, 0.10995597392320633, -0.812595546245575, 0.1690247356891632, -1.3604928255081177, 0.14870193600654602, 0.8061898946762085, -0.5091819763183594, -0.032404784113168716, -0.21702587604522705, -1.2863459587097168, -0.48455026745796204, 0.5305521488189697, 1.9734416007995605, -0.7329990267753601, 0.9102504849433899, 0.8969202041625977, -0.7135457396507263, 0.15110410749912262, 0.17853012681007385, -0.3064245581626892, 0.8175762891769409, -1.187614917755127, -0.3687746822834015, 1.2351247072219849, -0.2092420607805252, -0.7829611301422119, 1.4359591007232666, 0.8210167288780212, -1.0001964569091797, -0.06207879260182381, -0.23541259765625, -0.8531364798545837, 0.05045958235859871, -1.6556686162948608, -0.1089421957731247, 0.259558767080307, -1.3964998722076416, -0.4767335057258606, -0.22863587737083435, 1.4274240732192993, -0.11920583248138428, 1.4439735412597656, -0.2218872308731079, -0.14557789266109467, -0.40894243121147156, -0.4636336863040924, 0.15542186796665192, -0.35377615690231323, -0.5080446600914001, 0.16883781552314758, -0.755738377571106, 0.3144076466560364, 1.488647699356079, 0.32553625106811523, 0.14635905623435974, 0.5722084045410156, 1.0493825674057007, 0.29737648367881775, -0.18752148747444153, -0.7974245548248291, -1.568703293800354, 1.9452673196792603, -1.2114403247833252, 1.9774415493011475, 0.8476560115814209, -0.08795028924942017, -1.8030253648757935, -1.8659027814865112, 1.2210067510604858, 1.2084240913391113, 2.4056396484375, 0.5146673917770386, 0.40115609765052795, -0.8577808737754822, -0.7785187363624573, 0.19282296299934387, -1.1531509160995483, -0.696239173412323, 0.12901411950588226, 2.411095380783081, 1.7951042652130127, -0.5205529928207397, -0.11532929539680481, -1.0087196826934814, 1.2117725610733032, -0.16691066324710846, 0.20130059123039246, 1.9594885110855103, -0.29550644755363464, -0.9113122820854187, 1.02314031124115, -2.3403587341308594, 0.22860875725746155, 2.075873851776123, 0.24237969517707825, 0.1001681238412857, -1.592233419418335, -0.7347356677055359, -0.1981467306613922, -0.2519944906234741, -1.2134758234024048, 0.7511515021324158, -0.3425828516483307, -0.8743810653686523, -1.3599497079849243, 0.19078004360198975, -0.866767168045044, -1.7628507614135742, 0.3495856523513794, 1.9294379949569702, 1.827542781829834, -0.9429239630699158, 1.5288097858428955, -0.1568794548511505, -0.048256076872348785, 1.3590896129608154, 1.2035431861877441, 3.1388885974884033, 2.0569405555725098, -1.2423111200332642, 0.9204927682876587, -0.07714678347110748, -0.41622188687324524, 1.2437231540679932, -1.2008893489837646, 1.3127340078353882, -0.31133466958999634, -1.2500420808792114, -1.2943391799926758, 1.0704914331436157, 0.597841739654541, -0.05545223876833916, -0.4560891091823578, 1.3984882831573486, 0.008581944741308689, 1.3316550254821777, 0.4690317213535309, -0.38680312037467957, 0.7133452296257019, -0.43227463960647583, -0.46118924021720886, 1.4335700273513794, 0.3769923150539398, -1.4923741817474365, -2.157432794570923, -0.13801226019859314, -0.9506698250770569, -0.1346745491027832, -0.6862850785255432, -1.040436029434204, 1.6206873655319214, 0.5437117218971252, -1.123815894126892, -0.3244541883468628, -0.30571600794792175, -0.5877847075462341, 2.7220299243927, -1.3832889795303345, -0.16947399079799652, -1.0648084878921509, -0.43919649720191956, 1.7650717496871948, -1.2381839752197266, -0.2496972233057022, -1.0363439321517944, -0.6607269048690796, -1.1253782510757446, -0.4071485698223114, 0.06736646592617035, -0.8117997646331787, 0.7764665484428406, 0.11439424008131027, -1.2265795469284058, -0.23095233738422394, -0.8020692467689514, 0.9868806004524231, -0.012542689219117165, 0.2552795112133026, 1.9489935636520386, 0.3540600538253784, -0.44891446828842163, 0.7173524498939514, 1.1786915063858032, 0.534786581993103, -0.667712926864624, 0.14384308457374573, -0.5754449963569641, 0.3061563968658447, -1.4054771661758423, 0.2859712839126587, -2.995558023452759, 0.673267662525177, -0.12861871719360352, -0.14628401398658752, -0.09084359556436539, -1.3955943584442139, 1.1728695631027222, 2.541456937789917, -1.24006986618042, 0.5461342930793762, 0.415324330329895, 1.2933543920516968, -1.6471803188323975, 0.4124269485473633, -0.6053046584129333, 2.0242326259613037, 0.09041290730237961, 1.1941089630126953, -0.49262866377830505, -2.1767380237579346, 0.7033119201660156, -1.2472318410873413, -0.9435803294181824, 0.7949672341346741, -0.9367353320121765, 0.034098900854587555, -1.3103337287902832, -0.2192082703113556, -0.7973659038543701, -1.3372303247451782, 0.5566933751106262, 0.10394368320703506, 0.3882550895214081, -0.5672705173492432, 0.3501111567020416, -2.117948293685913, -1.3251547813415527, -0.2178279012441635, -0.8904731869697571, 0.3887287378311157, -0.40045860409736633, 0.535435676574707, -0.2376432716846466, 0.12892760336399078, 0.3297818601131439, 1.4130414724349976, 3.3641200065612793, 0.08189017325639725, 0.33827468752861023, -0.11737485975027084, -0.9038450121879578, 1.4553390741348267, 0.8935656547546387, -0.09651146829128265, -0.6440685987472534, -0.87639981508255, 1.2820024490356445, 1.9468815326690674, 1.1260747909545898, 0.09832238405942917, -0.7717667818069458, -0.639319896697998, -0.03151482716202736, 0.14396993815898895, 0.5022087693214417, 0.9022622108459473, 0.05940897762775421, 0.08461618423461914, 1.3678406476974487, 1.1874443292617798, -0.40596503019332886, 0.50947105884552, -0.998740553855896, -0.4281597435474396, 0.39332225918769836, 0.333670437335968, -0.006231470499187708, 0.30303430557250977, -1.0351123809814453, -0.375209242105484, -0.1330835074186325, -0.945820152759552, -0.8802812099456787, -0.3868013918399811, -0.3689437508583069, 1.5655763149261475, 0.11920251697301865, -0.5898731350898743, 0.04204331710934639, -0.7466179132461548, -0.07235141098499298, -1.0618000030517578, 0.2049141824245453, -0.11359249800443649, -0.06957647204399109, 0.0024941302835941315, 1.7174358367919922, -1.176481008529663, -2.3130855560302734, 0.2747795581817627, 0.2406506985425949, -0.33790379762649536, 0.0480082705616951, 1.6093418598175049, 0.41367268562316895, 1.4416415691375732, 1.3211332559585571, 1.040587067604065, -0.7956331968307495, -1.3065587282180786, 0.7187206149101257, 1.083982229232788, -1.3664426803588867, 0.8300716876983643, -0.12061624974012375, -0.46059319376945496, 0.7488463521003723, 1.2786287069320679, 0.5300164222717285, -1.8999555110931396, 0.7882481813430786, -0.8737919926643372, 0.9174284338951111, 0.7164491415023804, 0.8218823671340942, 0.33191215991973877, 0.8289531469345093, -1.2272859811782837, -1.246786117553711, -0.6505360007286072, -0.7762052416801453, 1.9418511390686035, -0.262384831905365, 0.636319100856781, -0.04505486041307449, -1.2448023557662964, -0.026827901601791382, 0.7430883049964905, 0.27647456526756287, -0.5264002084732056, 0.721167266368866, -0.6373090744018555, -0.9100083708763123, -1.3384217023849487, -0.5371569991111755, -1.0581694841384888, -1.0505881309509277, 1.0490026473999023, 0.9307159781455994, 0.34511956572532654, 1.8786355257034302, 0.5885259509086609, 0.32592371106147766, -2.602191686630249, 0.8933765292167664, 0.2770947515964508, 0.18829834461212158, 0.7635929584503174, 0.26969850063323975, 1.0439964532852173, -0.0015730890445411205, 0.3962496519088745, -2.4058945178985596, 2.3297433853149414, -0.2560705244541168, 0.5067362785339355, 0.015655256807804108, -0.09091252088546753, 1.0845457315444946, 0.5451043248176575, 0.5815528035163879, -1.145753026008606, 0.8192269206047058, -0.4613059461116791, 1.1921045780181885, 0.892037570476532, -0.8649690747261047, -0.009846708737313747, 1.3357431888580322, 0.5534186363220215, -0.46068617701530457, -0.9441967010498047, -0.8194385170936584, 0.8885338306427002, 1.6127411127090454, 0.06905501335859299, 0.07041990756988525, 0.8698316812515259, 0.4341532289981842, -1.2329450845718384, -0.07972025871276855, -0.8582556247711182, -0.687237024307251, 1.6631205081939697, 2.021484613418579, -0.08228327333927155, -0.12248067557811737, -0.7649957537651062, -1.173859715461731, 0.6843993067741394, -0.11154280602931976, -0.03539887070655823, 0.6609151363372803, -0.6540564894676208, 1.0138996839523315, 0.5573248863220215, 0.9646700620651245, -0.003997855354100466, 0.1893589049577713, 0.5176686644554138, -0.3564833700656891, -1.3008122444152832, -0.28865331411361694, -1.1403963565826416, -2.4535648822784424, 0.33940836787223816, -0.28228455781936646, -1.4912184476852417, 0.05802438408136368, -1.241111159324646, 0.9723461270332336, -0.6200041770935059, -1.1328585147857666, -1.3993687629699707, 0.2279573231935501, -0.21479129791259766, 0.7814320921897888, -1.674975872039795, -0.04272251948714256, 1.2365676164627075, 0.816289484500885, -0.7147646546363831, 1.1095002889633179, 0.24402546882629395, 1.1946293115615845, 0.8222125768661499, -0.3017658293247223, 0.4527268409729004, 0.0394166074693203, -1.3511707782745361, 0.5617198348045349, 1.1183199882507324, 0.15550237894058228, 1.5176705121994019, -0.6109219789505005, -0.018083756789565086, 0.5784151554107666, -0.6303677558898926, -0.5701457858085632, -0.4916379749774933, 0.7692259550094604, 0.022077564150094986, -0.9877806901931763, 0.06421415507793427, -0.24775908887386322, -0.26695385575294495, 0.3018154501914978, -1.5443077087402344, -0.18751370906829834, -0.414585143327713, -0.5850940346717834, -1.3231675624847412, 0.11616240441799164, 1.4099950790405273, -0.6871746778488159, -0.33122068643569946, 0.48384106159210205, 0.34500938653945923, 0.46535271406173706, 0.6173407435417175, -0.7849722504615784, -0.18123659491539001, -0.2322520911693573, -0.2574983835220337, 0.43514981865882874, 1.3507649898529053, -0.200940802693367, -0.9744753837585449, 0.7207159996032715, -0.5175537467002869, 0.22593244910240173, 1.9690933227539062, 0.17687144875526428, -0.7769941687583923, 0.28174296021461487, -0.7659335732460022, 1.968112826347351, 1.5791388750076294, 1.2925564050674438, -0.07464566826820374, -0.929878294467926, 0.6508281826972961, -0.05940655991435051, -0.40378710627555847, 0.7441214919090271, 0.4899977743625641, -0.26083803176879883, -1.4199990034103394, 0.502689003944397, 1.1672759056091309, -0.8553922772407532, -0.9050265550613403, 0.045165300369262695, -0.8645488023757935, 1.1300193071365356, 0.7139421105384827, 0.4498552978038788, 0.16962552070617676, 1.5260779857635498, 0.800431489944458, -0.48423564434051514, 0.4260958731174469, 0.4529667794704437, -0.10610887408256531, -2.060685873031616, -0.8799005746841431, 0.3907422423362732, -0.4948151111602783, -1.644250750541687, 1.3040199279785156, -1.0943578481674194, -1.0894231796264648, 0.4504660367965698, 0.14666147530078888, 1.5481345653533936, 0.28277772665023804, 1.626749873161316, 2.0375146865844727, 0.9703385829925537, 0.27735963463783264, 1.3957898616790771, -0.10974869132041931, -0.4675503671169281, 1.8408290147781372, -0.4230100214481354, 0.36646443605422974, 0.9455164074897766, -0.5284481048583984, -1.1195672750473022, -0.745620608329773, -0.9967101812362671, -0.5970383882522583, 1.1664131879806519, 0.3028091490268707, -1.0326389074325562, 0.23936310410499573, 1.454203486442566, 0.12580350041389465, -0.28910940885543823, 0.6415356397628784, 0.4924710690975189, -0.7968018651008606, 0.08416271954774857, -0.781425416469574, 0.5070845484733582, -0.18141111731529236, -0.33405449986457825, 0.351312518119812, 0.5701737999916077, 1.2824190855026245, -0.05877407267689705, 0.11763589829206467, 1.1692150831222534, -1.3691209554672241, 1.5268818140029907, -0.5967891216278076, 0.17280393838882446, -2.4277942180633545, 1.3474664688110352, -0.6418352723121643, 1.8243237733840942, -2.715862512588501, 0.45948725938796997, -0.45036402344703674, -0.457885205745697, 0.3479940891265869, -0.386721670627594, 0.09244044125080109, -0.23356212675571442, -1.106613278388977, 0.0313110426068306, -0.6587628722190857, 0.5991141200065613, 1.2136900424957275, 1.2587910890579224, -1.0910297632217407, -0.2380966991186142, -1.8038849830627441, -0.0823376402258873, -0.802361011505127, 0.38576656579971313, -1.9983861446380615, -0.24133025109767914, -1.8548157215118408, -2.2251548767089844, -1.2720669507980347, -0.7645049691200256, 1.0309394598007202, 0.3021143674850464, -0.8119508624076843, 1.2020580768585205, -0.3838476240634918, -1.908850073814392, 1.1116591691970825, -2.1122679710388184 ]
https://github.com/huggingface/datasets/issues/4452
Trying to load FEVER dataset results in NonMatchingChecksumError
Thanks for reporting @santhnm2. We are fixing it. Data owners updated their URLs recently. We have to align with them, otherwise you do not download anything (that is why ignore_verifications does not work).
## Describe the bug Trying to load the `fever` dataset fails with `datasets.utils.info_utils.NonMatchingChecksumError`. I tried with `download_mode="force_redownload"` but that did not fix the error. I also tried with `ignore_verification=True` but then that raised a `json.decoder.JSONDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('fever', 'v1.0') # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', download_mode="force_redownload") # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', ignore_verification=True)` # Fails with JSONDecodeError ``` ## Expected results I expect this call to return with no error raised. ## Actual results With `ignore_verification=False`: ``` *** datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://s3-eu-west-1.amazonaws.com/fever.public/train.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev_public.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_test.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_test.jsonl'] ``` With `ignore_verification=True`: ``` *** json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.3.dev0 - Platform: Linux-4.15.0-50-generic-x86_64-with-glibc2.10 - Python version: 3.8.13 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
727
33
Trying to load FEVER dataset results in NonMatchingChecksumError ## Describe the bug Trying to load the `fever` dataset fails with `datasets.utils.info_utils.NonMatchingChecksumError`. I tried with `download_mode="force_redownload"` but that did not fix the error. I also tried with `ignore_verification=True` but then that raised a `json.decoder.JSONDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('fever', 'v1.0') # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', download_mode="force_redownload") # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', ignore_verification=True)` # Fails with JSONDecodeError ``` ## Expected results I expect this call to return with no error raised. ## Actual results With `ignore_verification=False`: ``` *** datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://s3-eu-west-1.amazonaws.com/fever.public/train.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev_public.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_test.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_test.jsonl'] ``` With `ignore_verification=True`: ``` *** json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.3.dev0 - Platform: Linux-4.15.0-50-generic-x86_64-with-glibc2.10 - Python version: 3.8.13 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Thanks for reporting @santhnm2. We are fixing it. Data owners updated their URLs recently. We have to align with them, otherwise you do not download anything (that is why ignore_verifications does not work).
[ -1.1363145112991333, -1.045562744140625, -0.6615517735481262, 1.4013290405273438, -0.15105748176574707, -1.165265440940857, 0.27451395988464355, -0.9217529296875, 1.6847399473190308, -0.7750723958015442, 0.24035458266735077, -1.7542277574539185, -0.10324238240718842, -0.6786274313926697, -0.6569426655769348, -0.7145822644233704, -0.33501824736595154, -0.7233603596687317, 1.062833309173584, 2.467599868774414, 1.1596721410751343, -1.3448030948638916, 2.737467050552368, 0.6455549597740173, -0.1971825510263443, -1.0177263021469116, 0.42382940649986267, -0.05976513773202896, -1.267365574836731, -0.3627903163433075, -0.9079663157463074, 0.020559122785925865, -0.6555831432342529, -0.4335618317127228, 0.0606997013092041, 0.45772939920425415, -0.3156134784221649, -0.3401578664779663, -0.5825628042221069, -0.6783172488212585, 0.4242541491985321, -0.4216989576816559, 0.8970679044723511, -0.33597812056541443, 1.8056647777557373, -0.5153291821479797, 0.45846959948539734, 0.7349259257316589, 1.2356979846954346, 0.1928207129240036, 0.12944863736629486, 0.3120814263820648, 0.40078526735305786, 0.021131319925189018, 0.5782625675201416, 1.2046887874603271, 0.6162855625152588, 0.41631636023521423, 0.6700406670570374, -2.392944574356079, 1.2649013996124268, -0.8889179229736328, 0.3295459449291229, 1.2741049528121948, -0.9120070934295654, 0.3667362928390503, -1.808761477470398, 0.08695811033248901, 0.6247996091842651, -2.264138698577881, 0.260227233171463, -1.4074536561965942, -0.5566248893737793, 0.9797942042350769, 0.3893815875053406, -1.259310007095337, 0.06417720019817352, -0.30871206521987915, 1.0588746070861816, 0.4478265941143036, 1.0845695734024048, -1.6476198434829712, -0.11240079998970032, -0.1585100293159485, 0.18435849249362946, -1.1832771301269531, -1.5206748247146606, 0.5019301176071167, 0.6410204768180847, 0.7180197238922119, -0.24138200283050537, 1.0258464813232422, -1.1067638397216797, 0.7489348649978638, -1.0797703266143799, -1.809314489364624, -1.40220308303833, -2.343763828277588, -2.3535547256469727, 0.7587617039680481, -0.35134464502334595, -0.411061555147171, 2.0394866466522217, -0.8688685297966003, -1.8130486011505127, 1.1844993829727173, 0.30811363458633423, -0.011193701066076756, 2.3454232215881348, 0.2234862744808197, -0.8067538738250732, 0.48605409264564514, -0.8450735211372375, 0.8354708552360535, -0.31344157457351685, 1.3246992826461792, 0.5124166011810303, -0.930383026599884, 1.544232964515686, -0.39533892273902893, 0.5837199091911316, -0.62147456407547, -0.42447641491889954, -0.7344182133674622, 0.1796717345714569, 1.820660948753357, -0.2999490797519684, 1.5101348161697388, -0.32592272758483887, -1.5523865222930908, -1.5470696687698364, 0.9237813353538513, 0.4593484401702881, -0.8223834037780762, 0.10063072293996811, -0.44278666377067566, 0.22925323247909546, -0.10468126833438873, 1.1657493114471436, 1.334133267402649, 0.76284259557724, -0.2961982190608978, -0.8118762373924255, 0.1817566454410553, -0.13329508900642395, -0.6918759346008301, -1.8231403827667236, -0.33363208174705505, 0.1695779711008072, 0.570095956325531, -1.218701958656311, 1.7439696788787842, 0.8578069806098938, 1.9521673917770386, 0.9645888209342957, -0.386968731880188, 1.53720223903656, -0.012884316965937614, 1.9582302570343018, -0.535183310508728, 0.5447053909301758, -0.38086408376693726, -1.0525178909301758, 0.8227787613868713, -0.3152403235435486, -2.0528204441070557, -0.6946887969970703, -0.7811371684074402, -0.2679540812969208, -0.7657412886619568, 0.8250949382781982, -0.25480929017066956, -1.519159197807312, 0.22482453286647797, -0.774156928062439, 0.15428194403648376, -1.2257726192474365, 0.20907175540924072, 0.756905734539032, -0.6361510157585144, 0.08600074797868729, -0.298460453748703, -1.2981864213943481, -0.44748038053512573, 0.521165668964386, 1.7980479001998901, -0.6833713054656982, 0.9175613522529602, 0.9846530556678772, -0.72743159532547, 0.05178292840719223, 0.34433338046073914, -0.25542935729026794, 0.7592953443527222, -1.011048436164856, -0.547663688659668, 1.0801801681518555, -0.22841645777225494, -0.6663185954093933, 1.4396353960037231, 0.7868292927742004, -1.0275367498397827, -0.22737331688404083, -0.19000384211540222, -0.730109691619873, 0.05637670308351517, -1.693186640739441, -0.1903439611196518, 0.38699817657470703, -1.539017677307129, -0.46714097261428833, -0.31268200278282166, 1.3377797603607178, -0.059630006551742554, 1.3939874172210693, -0.28018078207969666, -0.1583331674337387, -0.30608075857162476, -0.44868940114974976, 0.1981339305639267, -0.27347415685653687, -0.5917702913284302, 0.1794935166835785, -0.8350713849067688, 0.3909745216369629, 1.5099073648452759, 0.3050858676433563, 0.07145581394433975, 0.5438807010650635, 1.103261947631836, 0.5240854024887085, 0.05802695453166962, -0.8711642026901245, -1.4373834133148193, 1.9847972393035889, -1.4610447883605957, 1.960816502571106, 0.7217090129852295, -0.08046107739210129, -1.8018524646759033, -1.9344371557235718, 1.3599506616592407, 1.072222352027893, 2.419827938079834, 0.5486143231391907, 0.41028857231140137, -0.8349804282188416, -0.711052417755127, 0.2657299339771271, -0.9538252353668213, -0.7703840732574463, 0.19580845534801483, 2.437169075012207, 1.823164463043213, -0.4458465874195099, -0.2580774426460266, -0.9396900534629822, 1.4154638051986694, -0.18232180178165436, 0.29128769040107727, 2.0848724842071533, -0.2636435925960541, -1.0232415199279785, 1.2681939601898193, -2.364988088607788, 0.3073002099990845, 2.0470659732818604, 0.14489425718784332, 0.08479373157024384, -1.4278806447982788, -0.6773363947868347, -0.24108190834522247, -0.36909741163253784, -1.2223862409591675, 0.5265281796455383, -0.247279092669487, -0.8829346895217896, -1.4377096891403198, 0.17014573514461517, -1.013631820678711, -1.7499827146530151, 0.1680523157119751, 2.0303304195404053, 2.0228042602539062, -0.7764641642570496, 1.4398585557937622, -0.25465768575668335, 0.12581996619701385, 1.3126046657562256, 1.2054693698883057, 3.1031017303466797, 1.9499574899673462, -1.2978283166885376, 0.7056361436843872, -0.26593267917633057, -0.49417978525161743, 1.0717759132385254, -1.17264723777771, 1.173754334449768, -0.20225557684898376, -1.1766331195831299, -1.226510763168335, 1.0034586191177368, 0.48217713832855225, -0.07300996035337448, -0.4852619171142578, 1.2389830350875854, 0.07217054069042206, 1.3535535335540771, 0.6554258465766907, -0.39626213908195496, 0.6087955236434937, -0.35464271903038025, -0.5578432083129883, 1.5963592529296875, 0.17330610752105713, -1.4376333951950073, -2.2519352436065674, -0.2976232171058655, -0.9950920939445496, 0.05282384902238846, -0.5341002941131592, -1.0494555234909058, 1.6089973449707031, 0.4838940501213074, -1.1927249431610107, -0.22156023979187012, -0.3096010386943817, -0.5222710371017456, 2.6930081844329834, -1.2399927377700806, -0.20255640149116516, -0.9544972777366638, -0.5579870939254761, 1.7248060703277588, -1.112720012664795, -0.2361069917678833, -1.0938198566436768, -0.6472471952438354, -1.2932103872299194, -0.5027006268501282, -0.014226632192730904, -0.8020465970039368, 0.9030857086181641, 0.13499782979488373, -1.2714366912841797, -0.3035121262073517, -0.995306670665741, 0.9947355389595032, -0.10094437003135681, 0.2046104371547699, 1.908638834953308, 0.329642117023468, -0.4410476088523865, 0.7842434048652649, 1.104429841041565, 0.6384270191192627, -0.6501309871673584, 0.33324164152145386, -0.644517719745636, 0.388557493686676, -1.2710225582122803, 0.26503971219062805, -2.904984474182129, 0.7532180547714233, -0.07223542779684067, -0.11843513697385788, -0.19216513633728027, -1.3151381015777588, 1.1241321563720703, 2.4442431926727295, -1.2213585376739502, 0.5875426530838013, 0.42554062604904175, 1.2454625368118286, -1.5478143692016602, 0.17999805510044098, -0.506910502910614, 2.122821807861328, 0.16979888081550598, 1.2175264358520508, -0.4471204876899719, -2.3431525230407715, 0.6427508592605591, -1.260833740234375, -1.0444239377975464, 0.8123749494552612, -0.9136881232261658, 0.06322065740823746, -1.4425737857818604, -0.2518009841442108, -0.8309857249259949, -1.2871569395065308, 0.6314456462860107, 0.1381693333387375, 0.44794973731040955, -0.6949129104614258, 0.4423564374446869, -2.219554901123047, -1.4307829141616821, -0.22149087488651276, -0.9799102544784546, 0.4919039011001587, -0.3251946270465851, 0.7180245518684387, -0.15296415984630585, 0.0029351869598031044, 0.28715261816978455, 1.4552216529846191, 3.3211913108825684, 0.12646369636058807, 0.26517051458358765, -0.157291978597641, -0.9730986952781677, 1.4307535886764526, 0.8905035257339478, -0.11217989772558212, -0.5530950427055359, -1.1804900169372559, 1.2902191877365112, 2.0359792709350586, 1.0925402641296387, 0.03195354342460632, -0.8077007532119751, -0.7341064214706421, 0.05852273851633072, 0.21080105006694794, 0.5318428874015808, 0.9372578263282776, 0.16241805255413055, 0.15697427093982697, 1.3429783582687378, 1.1388477087020874, -0.3489198088645935, 0.472206175327301, -0.8912607431411743, -0.5121614933013916, 0.4426003396511078, 0.2340477854013443, -0.0671226978302002, 0.31662556529045105, -1.1707223653793335, -0.1833392083644867, -0.3349815607070923, -0.9002985954284668, -0.797537088394165, -0.34906893968582153, -0.3757983148097992, 1.5984983444213867, 0.14488385617733002, -0.4373963475227356, 0.0004096096381545067, -0.7003324031829834, -0.1190493181347847, -1.0703144073486328, 0.22018516063690186, -0.21640874445438385, -0.08666661381721497, -0.16391099989414215, 1.637900710105896, -0.9595279693603516, -2.008817195892334, 0.18436101078987122, 0.34276285767555237, -0.32421085238456726, 0.2840544283390045, 1.717250108718872, 0.5881145596504211, 1.386837363243103, 1.3818299770355225, 0.9945456385612488, -0.5641225576400757, -1.276550054550171, 0.6628032326698303, 0.9551663398742676, -1.3224419355392456, 0.7622471451759338, -0.04594113677740097, -0.5193657875061035, 0.6724714636802673, 1.3029351234436035, 0.3574899733066559, -2.105452060699463, 0.8569207191467285, -0.9982121586799622, 0.7999585270881653, 0.7674258351325989, 0.7712904810905457, 0.1931995451450348, 0.8235984444618225, -1.270801305770874, -1.0870903730392456, -0.6920427680015564, -0.6750175952911377, 2.0609655380249023, -0.224812313914299, 0.5094054341316223, -0.06926428526639938, -1.3183854818344116, -0.09009051322937012, 0.6844180226325989, 0.41018322110176086, -0.5201588273048401, 0.7369480729103088, -0.6295865178108215, -1.0112580060958862, -1.3149412870407104, -0.4325175881385803, -1.0669703483581543, -0.9931389689445496, 0.9865972399711609, 0.8431657552719116, 0.4734639525413513, 1.8585633039474487, 0.5985894203186035, 0.3163755536079407, -2.6286611557006836, 0.8399321436882019, 0.35158810019493103, -0.0791672021150589, 0.8268818259239197, 0.33605507016181946, 1.1419875621795654, -0.030246444046497345, 0.6505826711654663, -2.3723442554473877, 2.2335948944091797, -0.1971014440059662, 0.6845188140869141, -0.04083283990621567, -0.11852318048477173, 1.0657943487167358, 0.5177510976791382, 0.5953797101974487, -0.9938023686408997, 0.7909314632415771, -0.5826454162597656, 1.2314763069152832, 0.9205880761146545, -0.7843543291091919, 0.00007234606891870499, 1.292886734008789, 0.4038030803203583, -0.5360100865364075, -0.9198375940322876, -0.9723104238510132, 0.8959472179412842, 1.7377033233642578, -0.1250869631767273, -0.03626192361116409, 0.879867434501648, 0.6537817120552063, -1.3142963647842407, -0.006583621725440025, -0.7337517142295837, -0.6568843722343445, 1.6201353073120117, 2.115574598312378, -0.24141298234462738, -0.18801197409629822, -0.7722293138504028, -1.3014914989471436, 0.6485494375228882, 0.05699104070663452, 0.0289547648280859, 0.7683619260787964, -0.6160441040992737, 1.0556944608688354, 0.5648419260978699, 0.9521490931510925, 0.0959453135728836, 0.3262921869754791, 0.268041729927063, -0.39403411746025085, -1.2839151620864868, -0.3443925380706787, -1.0590262413024902, -2.494036912918091, 0.44224828481674194, -0.27779775857925415, -1.3864587545394897, 0.08252599090337753, -0.9632753729820251, 0.9056843519210815, -0.6557588577270508, -1.2303426265716553, -1.419382929801941, 0.2752976715564728, -0.12906809151172638, 0.8475508093833923, -1.6538699865341187, -0.09632033109664917, 1.3023872375488281, 0.8941486477851868, -0.6438263058662415, 1.0288125276565552, 0.2942894995212555, 1.0272350311279297, 0.8390107154846191, -0.3101959824562073, 0.5272505879402161, 0.06465662270784378, -1.385568380355835, 0.4094091057777405, 1.1492691040039062, 0.21313296258449554, 1.545211672782898, -0.6243447661399841, 0.04478227347135544, 0.48286172747612, -0.5832803249359131, -0.5173472762107849, -0.4912013113498688, 0.758672833442688, -0.12098678946495056, -0.9421640038490295, 0.044528186321258545, -0.018405936658382416, -0.10523204505443573, 0.19034242630004883, -1.4804918766021729, -0.15925487875938416, -0.366482138633728, -0.6285620927810669, -1.318124771118164, -0.0278451107442379, 1.3099274635314941, -0.7808973789215088, -0.3002561330795288, 0.4891759157180786, 0.2991067171096802, 0.5749644637107849, 0.6251047253608704, -0.6547752022743225, -0.4467872977256775, -0.22956398129463196, -0.31674838066101074, 0.3765109181404114, 1.367287516593933, -0.12504717707633972, -1.0130555629730225, 0.6731624603271484, -0.4115111529827118, 0.12147685885429382, 1.8735344409942627, 0.031317584216594696, -0.7626070976257324, 0.3088120222091675, -0.7333368062973022, 1.872969388961792, 1.6942274570465088, 1.3358454704284668, -0.1232842281460762, -0.9578338265419006, 0.639930009841919, -0.3757629990577698, -0.4871436655521393, 0.8540720343589783, 0.40487396717071533, -0.17819461226463318, -1.2727025747299194, 0.6737734079360962, 1.318753719329834, -0.9579524993896484, -0.9427910447120667, 0.19754117727279663, -0.7651529312133789, 1.1509085893630981, 0.6424045562744141, 0.33322474360466003, 0.15135589241981506, 1.5805414915084839, 0.7873360514640808, -0.5095508694648743, 0.5336319208145142, 0.457470566034317, -0.22516222298145294, -2.0688700675964355, -1.1851990222930908, 0.3304670453071594, -0.46123412251472473, -1.5947004556655884, 1.370575189590454, -1.0714080333709717, -0.9579838514328003, 0.539020299911499, 0.13791730999946594, 1.2804667949676514, 0.3778640627861023, 1.6266148090362549, 2.0999231338500977, 0.9024161696434021, 0.44289228320121765, 1.3037548065185547, -0.17044955492019653, -0.5248333811759949, 1.7402136325836182, -0.4491006135940552, 0.5473966002464294, 1.0886764526367188, -0.35462483763694763, -1.0538164377212524, -0.8420262336730957, -1.2906774282455444, -0.6160073280334473, 1.1978381872177124, 0.17219243943691254, -1.1368086338043213, 0.2982640564441681, 1.5402849912643433, 0.12401843070983887, -0.2592872679233551, 0.7825739979743958, 0.4077754616737366, -0.7682791352272034, 0.019769608974456787, -0.9033814072608948, 0.446490079164505, -0.2929762005805969, -0.3436472415924072, 0.2556418776512146, 0.4713806211948395, 1.3497884273529053, -0.07419509440660477, 0.10917231440544128, 1.1485402584075928, -1.3071879148483276, 1.427231788635254, -0.6649022698402405, 0.3674260675907135, -2.3743202686309814, 1.3161019086837769, -0.819441556930542, 1.9750250577926636, -2.636289358139038, 0.4153832793235779, -0.5201041102409363, -0.4027981162071228, 0.2057420164346695, -0.2775849401950836, 0.03713320940732956, -0.04242166876792908, -1.215388536453247, -0.055543579161167145, -0.767606258392334, 0.5105012059211731, 1.1134600639343262, 1.3540672063827515, -1.1242692470550537, -0.2802428901195526, -1.792623519897461, -0.19206975400447845, -0.7646291851997375, 0.3850332200527191, -1.9774843454360962, -0.24589833617210388, -1.9127748012542725, -2.323356866836548, -1.2356524467468262, -0.857660174369812, 1.0535826683044434, 0.07177227735519409, -0.7957985997200012, 1.134587287902832, -0.2289430946111679, -1.8165658712387085, 1.0382736921310425, -2.1537303924560547 ]
https://github.com/huggingface/datasets/issues/4452
Trying to load FEVER dataset results in NonMatchingChecksumError
Hello! Is there any update on this? I am having the same issue 6 months later.
## Describe the bug Trying to load the `fever` dataset fails with `datasets.utils.info_utils.NonMatchingChecksumError`. I tried with `download_mode="force_redownload"` but that did not fix the error. I also tried with `ignore_verification=True` but then that raised a `json.decoder.JSONDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('fever', 'v1.0') # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', download_mode="force_redownload") # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', ignore_verification=True)` # Fails with JSONDecodeError ``` ## Expected results I expect this call to return with no error raised. ## Actual results With `ignore_verification=False`: ``` *** datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://s3-eu-west-1.amazonaws.com/fever.public/train.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev_public.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_test.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_test.jsonl'] ``` With `ignore_verification=True`: ``` *** json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.3.dev0 - Platform: Linux-4.15.0-50-generic-x86_64-with-glibc2.10 - Python version: 3.8.13 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
727
16
Trying to load FEVER dataset results in NonMatchingChecksumError ## Describe the bug Trying to load the `fever` dataset fails with `datasets.utils.info_utils.NonMatchingChecksumError`. I tried with `download_mode="force_redownload"` but that did not fix the error. I also tried with `ignore_verification=True` but then that raised a `json.decoder.JSONDecodeError`. ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('fever', 'v1.0') # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', download_mode="force_redownload") # Fails with NonMatchingChecksumError dataset = load_dataset('fever', 'v1.0', ignore_verification=True)` # Fails with JSONDecodeError ``` ## Expected results I expect this call to return with no error raised. ## Actual results With `ignore_verification=False`: ``` *** datasets.utils.info_utils.NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://s3-eu-west-1.amazonaws.com/fever.public/train.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_dev_public.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/shared_task_test.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_dev.jsonl', 'https://s3-eu-west-1.amazonaws.com/fever.public/paper_test.jsonl'] ``` With `ignore_verification=True`: ``` *** json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0) ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.3.dev0 - Platform: Linux-4.15.0-50-generic-x86_64-with-glibc2.10 - Python version: 3.8.13 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Hello! Is there any update on this? I am having the same issue 6 months later.
[ -1.1363145112991333, -1.045562744140625, -0.6615517735481262, 1.4013290405273438, -0.15105748176574707, -1.165265440940857, 0.27451395988464355, -0.9217529296875, 1.6847399473190308, -0.7750723958015442, 0.24035458266735077, -1.7542277574539185, -0.10324238240718842, -0.6786274313926697, -0.6569426655769348, -0.7145822644233704, -0.33501824736595154, -0.7233603596687317, 1.062833309173584, 2.467599868774414, 1.1596721410751343, -1.3448030948638916, 2.737467050552368, 0.6455549597740173, -0.1971825510263443, -1.0177263021469116, 0.42382940649986267, -0.05976513773202896, -1.267365574836731, -0.3627903163433075, -0.9079663157463074, 0.020559122785925865, -0.6555831432342529, -0.4335618317127228, 0.0606997013092041, 0.45772939920425415, -0.3156134784221649, -0.3401578664779663, -0.5825628042221069, -0.6783172488212585, 0.4242541491985321, -0.4216989576816559, 0.8970679044723511, -0.33597812056541443, 1.8056647777557373, -0.5153291821479797, 0.45846959948539734, 0.7349259257316589, 1.2356979846954346, 0.1928207129240036, 0.12944863736629486, 0.3120814263820648, 0.40078526735305786, 0.021131319925189018, 0.5782625675201416, 1.2046887874603271, 0.6162855625152588, 0.41631636023521423, 0.6700406670570374, -2.392944574356079, 1.2649013996124268, -0.8889179229736328, 0.3295459449291229, 1.2741049528121948, -0.9120070934295654, 0.3667362928390503, -1.808761477470398, 0.08695811033248901, 0.6247996091842651, -2.264138698577881, 0.260227233171463, -1.4074536561965942, -0.5566248893737793, 0.9797942042350769, 0.3893815875053406, -1.259310007095337, 0.06417720019817352, -0.30871206521987915, 1.0588746070861816, 0.4478265941143036, 1.0845695734024048, -1.6476198434829712, -0.11240079998970032, -0.1585100293159485, 0.18435849249362946, -1.1832771301269531, -1.5206748247146606, 0.5019301176071167, 0.6410204768180847, 0.7180197238922119, -0.24138200283050537, 1.0258464813232422, -1.1067638397216797, 0.7489348649978638, -1.0797703266143799, -1.809314489364624, -1.40220308303833, -2.343763828277588, -2.3535547256469727, 0.7587617039680481, -0.35134464502334595, -0.411061555147171, 2.0394866466522217, -0.8688685297966003, -1.8130486011505127, 1.1844993829727173, 0.30811363458633423, -0.011193701066076756, 2.3454232215881348, 0.2234862744808197, -0.8067538738250732, 0.48605409264564514, -0.8450735211372375, 0.8354708552360535, -0.31344157457351685, 1.3246992826461792, 0.5124166011810303, -0.930383026599884, 1.544232964515686, -0.39533892273902893, 0.5837199091911316, -0.62147456407547, -0.42447641491889954, -0.7344182133674622, 0.1796717345714569, 1.820660948753357, -0.2999490797519684, 1.5101348161697388, -0.32592272758483887, -1.5523865222930908, -1.5470696687698364, 0.9237813353538513, 0.4593484401702881, -0.8223834037780762, 0.10063072293996811, -0.44278666377067566, 0.22925323247909546, -0.10468126833438873, 1.1657493114471436, 1.334133267402649, 0.76284259557724, -0.2961982190608978, -0.8118762373924255, 0.1817566454410553, -0.13329508900642395, -0.6918759346008301, -1.8231403827667236, -0.33363208174705505, 0.1695779711008072, 0.570095956325531, -1.218701958656311, 1.7439696788787842, 0.8578069806098938, 1.9521673917770386, 0.9645888209342957, -0.386968731880188, 1.53720223903656, -0.012884316965937614, 1.9582302570343018, -0.535183310508728, 0.5447053909301758, -0.38086408376693726, -1.0525178909301758, 0.8227787613868713, -0.3152403235435486, -2.0528204441070557, -0.6946887969970703, -0.7811371684074402, -0.2679540812969208, -0.7657412886619568, 0.8250949382781982, -0.25480929017066956, -1.519159197807312, 0.22482453286647797, -0.774156928062439, 0.15428194403648376, -1.2257726192474365, 0.20907175540924072, 0.756905734539032, -0.6361510157585144, 0.08600074797868729, -0.298460453748703, -1.2981864213943481, -0.44748038053512573, 0.521165668964386, 1.7980479001998901, -0.6833713054656982, 0.9175613522529602, 0.9846530556678772, -0.72743159532547, 0.05178292840719223, 0.34433338046073914, -0.25542935729026794, 0.7592953443527222, -1.011048436164856, -0.547663688659668, 1.0801801681518555, -0.22841645777225494, -0.6663185954093933, 1.4396353960037231, 0.7868292927742004, -1.0275367498397827, -0.22737331688404083, -0.19000384211540222, -0.730109691619873, 0.05637670308351517, -1.693186640739441, -0.1903439611196518, 0.38699817657470703, -1.539017677307129, -0.46714097261428833, -0.31268200278282166, 1.3377797603607178, -0.059630006551742554, 1.3939874172210693, -0.28018078207969666, -0.1583331674337387, -0.30608075857162476, -0.44868940114974976, 0.1981339305639267, -0.27347415685653687, -0.5917702913284302, 0.1794935166835785, -0.8350713849067688, 0.3909745216369629, 1.5099073648452759, 0.3050858676433563, 0.07145581394433975, 0.5438807010650635, 1.103261947631836, 0.5240854024887085, 0.05802695453166962, -0.8711642026901245, -1.4373834133148193, 1.9847972393035889, -1.4610447883605957, 1.960816502571106, 0.7217090129852295, -0.08046107739210129, -1.8018524646759033, -1.9344371557235718, 1.3599506616592407, 1.072222352027893, 2.419827938079834, 0.5486143231391907, 0.41028857231140137, -0.8349804282188416, -0.711052417755127, 0.2657299339771271, -0.9538252353668213, -0.7703840732574463, 0.19580845534801483, 2.437169075012207, 1.823164463043213, -0.4458465874195099, -0.2580774426460266, -0.9396900534629822, 1.4154638051986694, -0.18232180178165436, 0.29128769040107727, 2.0848724842071533, -0.2636435925960541, -1.0232415199279785, 1.2681939601898193, -2.364988088607788, 0.3073002099990845, 2.0470659732818604, 0.14489425718784332, 0.08479373157024384, -1.4278806447982788, -0.6773363947868347, -0.24108190834522247, -0.36909741163253784, -1.2223862409591675, 0.5265281796455383, -0.247279092669487, -0.8829346895217896, -1.4377096891403198, 0.17014573514461517, -1.013631820678711, -1.7499827146530151, 0.1680523157119751, 2.0303304195404053, 2.0228042602539062, -0.7764641642570496, 1.4398585557937622, -0.25465768575668335, 0.12581996619701385, 1.3126046657562256, 1.2054693698883057, 3.1031017303466797, 1.9499574899673462, -1.2978283166885376, 0.7056361436843872, -0.26593267917633057, -0.49417978525161743, 1.0717759132385254, -1.17264723777771, 1.173754334449768, -0.20225557684898376, -1.1766331195831299, -1.226510763168335, 1.0034586191177368, 0.48217713832855225, -0.07300996035337448, -0.4852619171142578, 1.2389830350875854, 0.07217054069042206, 1.3535535335540771, 0.6554258465766907, -0.39626213908195496, 0.6087955236434937, -0.35464271903038025, -0.5578432083129883, 1.5963592529296875, 0.17330610752105713, -1.4376333951950073, -2.2519352436065674, -0.2976232171058655, -0.9950920939445496, 0.05282384902238846, -0.5341002941131592, -1.0494555234909058, 1.6089973449707031, 0.4838940501213074, -1.1927249431610107, -0.22156023979187012, -0.3096010386943817, -0.5222710371017456, 2.6930081844329834, -1.2399927377700806, -0.20255640149116516, -0.9544972777366638, -0.5579870939254761, 1.7248060703277588, -1.112720012664795, -0.2361069917678833, -1.0938198566436768, -0.6472471952438354, -1.2932103872299194, -0.5027006268501282, -0.014226632192730904, -0.8020465970039368, 0.9030857086181641, 0.13499782979488373, -1.2714366912841797, -0.3035121262073517, -0.995306670665741, 0.9947355389595032, -0.10094437003135681, 0.2046104371547699, 1.908638834953308, 0.329642117023468, -0.4410476088523865, 0.7842434048652649, 1.104429841041565, 0.6384270191192627, -0.6501309871673584, 0.33324164152145386, -0.644517719745636, 0.388557493686676, -1.2710225582122803, 0.26503971219062805, -2.904984474182129, 0.7532180547714233, -0.07223542779684067, -0.11843513697385788, -0.19216513633728027, -1.3151381015777588, 1.1241321563720703, 2.4442431926727295, -1.2213585376739502, 0.5875426530838013, 0.42554062604904175, 1.2454625368118286, -1.5478143692016602, 0.17999805510044098, -0.506910502910614, 2.122821807861328, 0.16979888081550598, 1.2175264358520508, -0.4471204876899719, -2.3431525230407715, 0.6427508592605591, -1.260833740234375, -1.0444239377975464, 0.8123749494552612, -0.9136881232261658, 0.06322065740823746, -1.4425737857818604, -0.2518009841442108, -0.8309857249259949, -1.2871569395065308, 0.6314456462860107, 0.1381693333387375, 0.44794973731040955, -0.6949129104614258, 0.4423564374446869, -2.219554901123047, -1.4307829141616821, -0.22149087488651276, -0.9799102544784546, 0.4919039011001587, -0.3251946270465851, 0.7180245518684387, -0.15296415984630585, 0.0029351869598031044, 0.28715261816978455, 1.4552216529846191, 3.3211913108825684, 0.12646369636058807, 0.26517051458358765, -0.157291978597641, -0.9730986952781677, 1.4307535886764526, 0.8905035257339478, -0.11217989772558212, -0.5530950427055359, -1.1804900169372559, 1.2902191877365112, 2.0359792709350586, 1.0925402641296387, 0.03195354342460632, -0.8077007532119751, -0.7341064214706421, 0.05852273851633072, 0.21080105006694794, 0.5318428874015808, 0.9372578263282776, 0.16241805255413055, 0.15697427093982697, 1.3429783582687378, 1.1388477087020874, -0.3489198088645935, 0.472206175327301, -0.8912607431411743, -0.5121614933013916, 0.4426003396511078, 0.2340477854013443, -0.0671226978302002, 0.31662556529045105, -1.1707223653793335, -0.1833392083644867, -0.3349815607070923, -0.9002985954284668, -0.797537088394165, -0.34906893968582153, -0.3757983148097992, 1.5984983444213867, 0.14488385617733002, -0.4373963475227356, 0.0004096096381545067, -0.7003324031829834, -0.1190493181347847, -1.0703144073486328, 0.22018516063690186, -0.21640874445438385, -0.08666661381721497, -0.16391099989414215, 1.637900710105896, -0.9595279693603516, -2.008817195892334, 0.18436101078987122, 0.34276285767555237, -0.32421085238456726, 0.2840544283390045, 1.717250108718872, 0.5881145596504211, 1.386837363243103, 1.3818299770355225, 0.9945456385612488, -0.5641225576400757, -1.276550054550171, 0.6628032326698303, 0.9551663398742676, -1.3224419355392456, 0.7622471451759338, -0.04594113677740097, -0.5193657875061035, 0.6724714636802673, 1.3029351234436035, 0.3574899733066559, -2.105452060699463, 0.8569207191467285, -0.9982121586799622, 0.7999585270881653, 0.7674258351325989, 0.7712904810905457, 0.1931995451450348, 0.8235984444618225, -1.270801305770874, -1.0870903730392456, -0.6920427680015564, -0.6750175952911377, 2.0609655380249023, -0.224812313914299, 0.5094054341316223, -0.06926428526639938, -1.3183854818344116, -0.09009051322937012, 0.6844180226325989, 0.41018322110176086, -0.5201588273048401, 0.7369480729103088, -0.6295865178108215, -1.0112580060958862, -1.3149412870407104, -0.4325175881385803, -1.0669703483581543, -0.9931389689445496, 0.9865972399711609, 0.8431657552719116, 0.4734639525413513, 1.8585633039474487, 0.5985894203186035, 0.3163755536079407, -2.6286611557006836, 0.8399321436882019, 0.35158810019493103, -0.0791672021150589, 0.8268818259239197, 0.33605507016181946, 1.1419875621795654, -0.030246444046497345, 0.6505826711654663, -2.3723442554473877, 2.2335948944091797, -0.1971014440059662, 0.6845188140869141, -0.04083283990621567, -0.11852318048477173, 1.0657943487167358, 0.5177510976791382, 0.5953797101974487, -0.9938023686408997, 0.7909314632415771, -0.5826454162597656, 1.2314763069152832, 0.9205880761146545, -0.7843543291091919, 0.00007234606891870499, 1.292886734008789, 0.4038030803203583, -0.5360100865364075, -0.9198375940322876, -0.9723104238510132, 0.8959472179412842, 1.7377033233642578, -0.1250869631767273, -0.03626192361116409, 0.879867434501648, 0.6537817120552063, -1.3142963647842407, -0.006583621725440025, -0.7337517142295837, -0.6568843722343445, 1.6201353073120117, 2.115574598312378, -0.24141298234462738, -0.18801197409629822, -0.7722293138504028, -1.3014914989471436, 0.6485494375228882, 0.05699104070663452, 0.0289547648280859, 0.7683619260787964, -0.6160441040992737, 1.0556944608688354, 0.5648419260978699, 0.9521490931510925, 0.0959453135728836, 0.3262921869754791, 0.268041729927063, -0.39403411746025085, -1.2839151620864868, -0.3443925380706787, -1.0590262413024902, -2.494036912918091, 0.44224828481674194, -0.27779775857925415, -1.3864587545394897, 0.08252599090337753, -0.9632753729820251, 0.9056843519210815, -0.6557588577270508, -1.2303426265716553, -1.419382929801941, 0.2752976715564728, -0.12906809151172638, 0.8475508093833923, -1.6538699865341187, -0.09632033109664917, 1.3023872375488281, 0.8941486477851868, -0.6438263058662415, 1.0288125276565552, 0.2942894995212555, 1.0272350311279297, 0.8390107154846191, -0.3101959824562073, 0.5272505879402161, 0.06465662270784378, -1.385568380355835, 0.4094091057777405, 1.1492691040039062, 0.21313296258449554, 1.545211672782898, -0.6243447661399841, 0.04478227347135544, 0.48286172747612, -0.5832803249359131, -0.5173472762107849, -0.4912013113498688, 0.758672833442688, -0.12098678946495056, -0.9421640038490295, 0.044528186321258545, -0.018405936658382416, -0.10523204505443573, 0.19034242630004883, -1.4804918766021729, -0.15925487875938416, -0.366482138633728, -0.6285620927810669, -1.318124771118164, -0.0278451107442379, 1.3099274635314941, -0.7808973789215088, -0.3002561330795288, 0.4891759157180786, 0.2991067171096802, 0.5749644637107849, 0.6251047253608704, -0.6547752022743225, -0.4467872977256775, -0.22956398129463196, -0.31674838066101074, 0.3765109181404114, 1.367287516593933, -0.12504717707633972, -1.0130555629730225, 0.6731624603271484, -0.4115111529827118, 0.12147685885429382, 1.8735344409942627, 0.031317584216594696, -0.7626070976257324, 0.3088120222091675, -0.7333368062973022, 1.872969388961792, 1.6942274570465088, 1.3358454704284668, -0.1232842281460762, -0.9578338265419006, 0.639930009841919, -0.3757629990577698, -0.4871436655521393, 0.8540720343589783, 0.40487396717071533, -0.17819461226463318, -1.2727025747299194, 0.6737734079360962, 1.318753719329834, -0.9579524993896484, -0.9427910447120667, 0.19754117727279663, -0.7651529312133789, 1.1509085893630981, 0.6424045562744141, 0.33322474360466003, 0.15135589241981506, 1.5805414915084839, 0.7873360514640808, -0.5095508694648743, 0.5336319208145142, 0.457470566034317, -0.22516222298145294, -2.0688700675964355, -1.1851990222930908, 0.3304670453071594, -0.46123412251472473, -1.5947004556655884, 1.370575189590454, -1.0714080333709717, -0.9579838514328003, 0.539020299911499, 0.13791730999946594, 1.2804667949676514, 0.3778640627861023, 1.6266148090362549, 2.0999231338500977, 0.9024161696434021, 0.44289228320121765, 1.3037548065185547, -0.17044955492019653, -0.5248333811759949, 1.7402136325836182, -0.4491006135940552, 0.5473966002464294, 1.0886764526367188, -0.35462483763694763, -1.0538164377212524, -0.8420262336730957, -1.2906774282455444, -0.6160073280334473, 1.1978381872177124, 0.17219243943691254, -1.1368086338043213, 0.2982640564441681, 1.5402849912643433, 0.12401843070983887, -0.2592872679233551, 0.7825739979743958, 0.4077754616737366, -0.7682791352272034, 0.019769608974456787, -0.9033814072608948, 0.446490079164505, -0.2929762005805969, -0.3436472415924072, 0.2556418776512146, 0.4713806211948395, 1.3497884273529053, -0.07419509440660477, 0.10917231440544128, 1.1485402584075928, -1.3071879148483276, 1.427231788635254, -0.6649022698402405, 0.3674260675907135, -2.3743202686309814, 1.3161019086837769, -0.819441556930542, 1.9750250577926636, -2.636289358139038, 0.4153832793235779, -0.5201041102409363, -0.4027981162071228, 0.2057420164346695, -0.2775849401950836, 0.03713320940732956, -0.04242166876792908, -1.215388536453247, -0.055543579161167145, -0.767606258392334, 0.5105012059211731, 1.1134600639343262, 1.3540672063827515, -1.1242692470550537, -0.2802428901195526, -1.792623519897461, -0.19206975400447845, -0.7646291851997375, 0.3850332200527191, -1.9774843454360962, -0.24589833617210388, -1.9127748012542725, -2.323356866836548, -1.2356524467468262, -0.857660174369812, 1.0535826683044434, 0.07177227735519409, -0.7957985997200012, 1.134587287902832, -0.2289430946111679, -1.8165658712387085, 1.0382736921310425, -2.1537303924560547 ]
https://github.com/huggingface/datasets/issues/4448
New Preprocessing Feature - Deduplication [Request]
Hi! The [datasets_sql](https://github.com/mariosasko/datasets_sql) package lets you easily find distinct rows in a dataset (an example with `SELECT DISTINCT` is in the readme). Deduplication is (still) not part of the official API because it's hard to implement for datasets bigger than RAM while only using the native PyArrow ops. (Btw, this is a duplicate of https://github.com/huggingface/datasets/issues/2514)
**Is your feature request related to a problem? Please describe.** Many large datasets are full of duplications and it has been shown that deduplicating datasets can lead to better performance while training, and more truthful evaluation at test-time. A feature that allows one to easily deduplicate a dataset can be cool! **Describe the solution you'd like** We can define a function and keep only the first/last data-point that yields the value according to this function. **Describe alternatives you've considered** The clear alternative is to repeat a clear boilerplate every time someone want to deduplicate a dataset.
728
55
New Preprocessing Feature - Deduplication [Request] **Is your feature request related to a problem? Please describe.** Many large datasets are full of duplications and it has been shown that deduplicating datasets can lead to better performance while training, and more truthful evaluation at test-time. A feature that allows one to easily deduplicate a dataset can be cool! **Describe the solution you'd like** We can define a function and keep only the first/last data-point that yields the value according to this function. **Describe alternatives you've considered** The clear alternative is to repeat a clear boilerplate every time someone want to deduplicate a dataset. Hi! The [datasets_sql](https://github.com/mariosasko/datasets_sql) package lets you easily find distinct rows in a dataset (an example with `SELECT DISTINCT` is in the readme). Deduplication is (still) not part of the official API because it's hard to implement for datasets bigger than RAM while only using the native PyArrow ops. (Btw, this is a duplicate of https://github.com/huggingface/datasets/issues/2514)
[ -1.270326018333435, -1.0608476400375366, -0.8171753883361816, 1.3942599296569824, -0.16480125486850739, -1.3295568227767944, 0.0016734646633267403, -1.0566775798797607, 1.7384365797042847, -0.8085863590240479, 0.32408034801483154, -1.6936689615249634, 0.054974041879177094, -0.585068941116333, -0.8855241537094116, -0.8649797439575195, -0.4007306396961212, -0.955973744392395, 0.8942588567733765, 2.5117411613464355, 1.184518575668335, -1.3963515758514404, 2.7418341636657715, 0.6768882274627686, -0.2222963273525238, -1.0395009517669678, 0.5123475790023804, 0.02312156930565834, -1.274748682975769, -0.41400909423828125, -0.9371516704559326, -0.03103042021393776, -0.5838674306869507, -0.4882667660713196, 0.04619627818465233, 0.3352152705192566, -0.22365616261959076, -0.32414740324020386, -0.5602452754974365, -0.706015944480896, 0.46558162569999695, -0.3754756450653076, 0.9947776794433594, -0.46481993794441223, 1.8921971321105957, -0.6009690761566162, 0.29906606674194336, 0.6671974658966064, 1.3801425695419312, 0.18180644512176514, -0.038911186158657074, 0.25955575704574585, 0.3202621340751648, -0.06800755858421326, 0.39516255259513855, 1.2412694692611694, 0.6271631717681885, 0.5097190141677856, 0.8071991205215454, -2.193773031234741, 1.3910084962844849, -0.9849523305892944, 0.40115028619766235, 1.3789751529693604, -0.9988627433776855, 0.40615957975387573, -1.7865405082702637, -0.08953215181827545, 0.6149289608001709, -2.392803907394409, 0.12194082140922546, -1.273657202720642, -0.5833619832992554, 0.9561703205108643, 0.2004406601190567, -1.258301019668579, 0.29549074172973633, -0.5071948766708374, 1.0388975143432617, 0.543166995048523, 1.1533702611923218, -1.756605863571167, -0.03857388347387314, -0.19446486234664917, 0.14716440439224243, -1.428397536277771, -1.5449880361557007, 0.6159595251083374, 0.6422654390335083, 0.6610836982727051, -0.10766618698835373, 0.9573765993118286, -0.999678373336792, 0.8599117994308472, -0.9258981943130493, -1.6443456411361694, -1.451234221458435, -2.2530834674835205, -2.2397372722625732, 0.8088735342025757, -0.43372514843940735, -0.5506443977355957, 1.9550540447235107, -1.0516974925994873, -1.7819204330444336, 1.1468069553375244, 0.3590828478336334, 0.039572130888700485, 2.41369366645813, 0.13876277208328247, -0.7257530689239502, 0.5084917545318604, -0.6745408773422241, 0.8147808313369751, -0.4078410863876343, 1.4629554748535156, 0.4922005236148834, -1.0087637901306152, 1.5755724906921387, -0.51954185962677, 0.522863507270813, -0.6363890171051025, -0.5442237854003906, -0.8742721080780029, 0.3849802613258362, 1.827120304107666, -0.3161952495574951, 1.6350888013839722, -0.36260321736335754, -1.5926101207733154, -1.603617548942566, 0.841961145401001, 0.4697578549385071, -0.9038633108139038, 0.05692256987094879, -0.3929760456085205, 0.1339021921157837, -0.04785275086760521, 1.1606031656265259, 1.137180209159851, 0.6266351938247681, -0.2455146759748459, -0.8859078884124756, 0.20678438246250153, -0.172907754778862, -0.6039363145828247, -1.8489325046539307, -0.3443472981452942, 0.28437498211860657, 0.6222597360610962, -1.2329490184783936, 1.7055106163024902, 0.9197181463241577, 1.9418728351593018, 1.0370286703109741, -0.30377551913261414, 1.3849081993103027, -0.002563303802162409, 1.8541964292526245, -0.6076233386993408, 0.6899137496948242, -0.3072507381439209, -1.0176936388015747, 0.733086347579956, -0.4530010223388672, -2.0711522102355957, -0.8133251667022705, -0.8416426181793213, -0.2146594077348709, -0.7516227960586548, 0.9498960971832275, -0.28935766220092773, -1.3682563304901123, 0.2664217948913574, -0.7127045392990112, 0.11016115546226501, -1.1762775182724, 0.28509727120399475, 0.8229899406433105, -0.6618475914001465, -0.0647733062505722, -0.19298559427261353, -1.3258761167526245, -0.5220510959625244, 0.25407254695892334, 1.942063808441162, -0.7061744928359985, 0.9272562265396118, 0.9070937633514404, -0.6213127374649048, 0.08274070173501968, 0.34370487928390503, -0.24466735124588013, 0.9030418395996094, -1.013871192932129, -0.3771929144859314, 1.1308317184448242, -0.19381506741046906, -0.6116392612457275, 1.520339846611023, 0.828373908996582, -0.9594101905822754, -0.15183928608894348, -0.20583653450012207, -0.8341473340988159, -0.04546414315700531, -1.5190470218658447, -0.07644928991794586, 0.23141084611415863, -1.4423614740371704, -0.48764103651046753, -0.23670536279678345, 1.2670576572418213, -0.15262845158576965, 1.2978761196136475, -0.34879499673843384, -0.3008384108543396, -0.4176177978515625, -0.475129634141922, 0.1705220341682434, -0.24485601484775543, -0.6617988348007202, 0.2736961841583252, -0.8276478052139282, 0.3843112289905548, 1.4644731283187866, 0.5822951793670654, 0.05814622342586517, 0.5644652843475342, 1.0938966274261475, 0.2802855968475342, -0.0904829204082489, -0.7629543542861938, -1.576006293296814, 2.0858514308929443, -1.4086731672286987, 1.9752222299575806, 0.8044600486755371, -0.06663778424263, -1.7658052444458008, -1.846134066581726, 1.3709261417388916, 1.2081838846206665, 2.3227756023406982, 0.6024767160415649, 0.33245497941970825, -0.7983262538909912, -0.7145463228225708, 0.28750333189964294, -1.0391672849655151, -0.7561947107315063, 0.07322383671998978, 2.3654427528381348, 1.8161028623580933, -0.5576834678649902, -0.1431499570608139, -1.032214879989624, 1.3756829500198364, -0.18834760785102844, 0.19220224022865295, 1.9969642162322998, -0.3438141942024231, -1.0801786184310913, 1.3304548263549805, -2.3073461055755615, 0.125004842877388, 2.016697406768799, 0.332014799118042, -0.0005146004259586334, -1.4402819871902466, -0.5974118709564209, -0.3798498809337616, -0.3596506714820862, -1.2737436294555664, 0.5256929397583008, -0.3136975169181824, -0.8182761669158936, -1.5255942344665527, 0.07599851489067078, -1.1349164247512817, -1.6250028610229492, 0.42738428711891174, 1.815306544303894, 2.0273163318634033, -0.6522270441055298, 1.4794766902923584, -0.1954694539308548, 0.10127999633550644, 1.245711088180542, 1.2900060415267944, 3.1868672370910645, 1.8265036344528198, -1.2164355516433716, 0.5718237161636353, -0.17346058785915375, -0.4965774118900299, 1.161954641342163, -1.1375733613967896, 1.2589558362960815, -0.18173463642597198, -1.257967472076416, -1.194942593574524, 1.039595603942871, 0.5388039350509644, 0.07351810485124588, -0.5818221569061279, 1.2361860275268555, 0.024251863360404968, 1.3203964233398438, 0.4235936999320984, -0.3719319701194763, 0.5529526472091675, -0.4048392176628113, -0.627255916595459, 1.5643118619918823, 0.17483508586883545, -1.4327508211135864, -2.319960832595825, -0.19733750820159912, -0.7819932699203491, -0.038400836288928986, -0.5712049007415771, -1.0297951698303223, 1.670754075050354, 0.41979488730430603, -1.323779582977295, -0.30435237288475037, -0.3686600625514984, -0.6917074918746948, 2.61761212348938, -1.4900518655776978, -0.19433103501796722, -0.9810749292373657, -0.5220129489898682, 1.611671805381775, -1.235913872718811, -0.18721914291381836, -1.076530933380127, -0.6645472049713135, -1.3435455560684204, -0.5959485769271851, -0.08315491676330566, -0.8748131990432739, 0.7741448879241943, 0.14870229363441467, -1.0412423610687256, -0.3325452506542206, -0.880670428276062, 0.8171894550323486, -0.0833483561873436, 0.30730578303337097, 1.879315972328186, 0.4559400975704193, -0.46009448170661926, 0.661013126373291, 1.1908459663391113, 0.6650803089141846, -0.6978105306625366, 0.13372774422168732, -0.6441085338592529, 0.34295976161956787, -1.3094381093978882, 0.30139052867889404, -2.918170213699341, 0.6955281496047974, -0.02290259674191475, -0.1301511526107788, 0.12742814421653748, -1.317879319190979, 1.0976158380508423, 2.5910184383392334, -1.1535924673080444, 0.44171667098999023, 0.2818582057952881, 1.2007050514221191, -1.6324894428253174, 0.36544498801231384, -0.40739139914512634, 2.076209545135498, 0.2146175354719162, 1.1748847961425781, -0.6259287595748901, -2.1255640983581543, 0.616509199142456, -1.1681151390075684, -1.0935457944869995, 0.744940996170044, -0.904789924621582, 0.20372630655765533, -1.466219186782837, -0.09043220430612564, -0.9684773683547974, -1.1949266195297241, 0.7737298011779785, 0.08863566070795059, 0.39687836170196533, -0.5862786769866943, 0.27900880575180054, -2.1128342151641846, -1.3922028541564941, -0.24350249767303467, -0.9412364959716797, 0.5792223215103149, -0.3477795720100403, 0.6549290418624878, -0.08516540378332138, 0.0548991933465004, 0.2987518012523651, 1.3729580640792847, 3.3641719818115234, 0.21248994767665863, 0.4170267879962921, -0.03485359996557236, -0.9301513433456421, 1.4069888591766357, 0.9816046953201294, -0.0818704143166542, -0.531470537185669, -0.9239364862442017, 1.3695372343063354, 1.9067182540893555, 1.0037001371383667, 0.12913186848163605, -0.7760745286941528, -0.6623736619949341, 0.07661011815071106, 0.2177342027425766, 0.4332835376262665, 0.8757364749908447, -0.004767663311213255, 0.12384666502475739, 1.4758063554763794, 1.2734571695327759, -0.484063059091568, 0.47884035110473633, -0.8390038013458252, -0.5042536854743958, 0.46191802620887756, 0.3165934085845947, -0.07260103523731232, 0.42337772250175476, -0.9867783784866333, -0.20840206742286682, -0.34662866592407227, -1.0033503770828247, -0.6785759925842285, -0.5213828086853027, -0.3896882236003876, 1.6904608011245728, 0.08835215866565704, -0.46870341897010803, -0.07105658203363419, -0.8124833106994629, -0.08899560570716858, -1.0744086503982544, 0.27593281865119934, -0.020312543958425522, -0.09942907094955444, -0.10804522782564163, 1.7484707832336426, -0.8613531589508057, -2.067901134490967, 0.20679119229316711, 0.2982686460018158, -0.4807983934879303, 0.10794427990913391, 1.5890512466430664, 0.44412487745285034, 1.5109230279922485, 1.3835978507995605, 0.938796877861023, -0.6755226850509644, -1.2681840658187866, 0.6730179786682129, 0.8893845081329346, -1.4067779779434204, 0.9315663576126099, -0.05634549632668495, -0.575239896774292, 0.8188067674636841, 1.3859819173812866, 0.3877396583557129, -1.9691256284713745, 0.8588426113128662, -0.885627269744873, 0.8046460151672363, 0.6895091533660889, 0.6999622583389282, 0.29707908630371094, 0.9153717756271362, -1.3478522300720215, -1.2051448822021484, -0.9705952405929565, -0.6578900814056396, 1.9758939743041992, -0.1659846305847168, 0.5860840082168579, -0.14083170890808105, -1.2242467403411865, -0.20118176937103271, 0.685758113861084, 0.5018237829208374, -0.28149694204330444, 0.8435686826705933, -0.6966638565063477, -1.0879294872283936, -1.3463839292526245, -0.42062199115753174, -0.911605954170227, -0.8660502433776855, 1.0529485940933228, 0.8690035343170166, 0.3113429546356201, 1.9391273260116577, 0.5891256332397461, 0.20603595674037933, -2.5850532054901123, 0.8054203987121582, 0.3067087233066559, -0.07559539377689362, 0.9176255464553833, 0.28247496485710144, 1.0358580350875854, 0.08185981214046478, 0.4715006947517395, -2.369685411453247, 2.168117046356201, -0.26479026675224304, 0.6842995882034302, -0.008117269724607468, -0.21112610399723053, 1.2218482494354248, 0.5310554504394531, 0.5111379623413086, -1.068709373474121, 0.6820274591445923, -0.5430601835250854, 1.2125526666641235, 0.9654443264007568, -0.8589013814926147, 0.06513768434524536, 1.2587239742279053, 0.44432157278060913, -0.48339712619781494, -1.0036927461624146, -0.8028978109359741, 0.9684629440307617, 1.7561360597610474, -0.0027591045945882797, 0.01138516515493393, 0.8451409339904785, 0.7559717893600464, -1.323155164718628, 0.20696279406547546, -0.8162363767623901, -0.7782622575759888, 1.6758323907852173, 2.0972399711608887, -0.046281710267066956, -0.052662916481494904, -0.6098312139511108, -1.234402060508728, 0.7369610071182251, 0.028159089386463165, 0.15361954271793365, 0.700798511505127, -0.6410964727401733, 1.1054919958114624, 0.9263222217559814, 0.9331408739089966, 0.05857811123132706, 0.373058557510376, 0.3742588758468628, -0.2738422155380249, -1.1645900011062622, -0.2154323309659958, -1.1726524829864502, -2.3783271312713623, 0.4694652259349823, -0.23009096086025238, -1.4797840118408203, 0.006295816041529179, -0.9651120901107788, 0.9178475141525269, -0.5665128231048584, -1.101313829421997, -1.5585566759109497, 0.19137577712535858, -0.06282004714012146, 0.8786084651947021, -1.554269552230835, -0.0756441280245781, 1.170285940170288, 0.8627640008926392, -0.6401020288467407, 1.0208182334899902, 0.22263851761817932, 0.9749268293380737, 0.831800103187561, -0.46712952852249146, 0.44222697615623474, 0.07258822023868561, -1.3922542333602905, 0.510459303855896, 1.1400398015975952, 0.09660667926073074, 1.3597116470336914, -0.5037842988967896, 0.03970378264784813, 0.4567946791648865, -0.5443851947784424, -0.44612905383110046, -0.4788695275783539, 0.7387112379074097, 0.11276805400848389, -0.7856571674346924, 0.06886554509401321, -0.08222927898168564, -0.3203369379043579, 0.2362794131040573, -1.501721978187561, -0.30241507291793823, -0.38932815194129944, -0.564102292060852, -1.2563958168029785, 0.011302610859274864, 1.3976553678512573, -0.8206723928451538, -0.22456999123096466, 0.5135453939437866, 0.4968636929988861, 0.6093354225158691, 0.7467795610427856, -0.6719820499420166, -0.3839380741119385, -0.31183043122291565, -0.2826189398765564, 0.17245252430438995, 1.2228151559829712, -0.2084030658006668, -0.9642192125320435, 0.6641011238098145, -0.453185111284256, -0.020389094948768616, 1.956175446510315, 0.060994237661361694, -0.7614208459854126, 0.33493196964263916, -0.7796547412872314, 1.8153609037399292, 1.699824571609497, 1.3179036378860474, -0.060154568403959274, -0.9060360193252563, 0.5898091793060303, -0.1300266981124878, -0.35777008533477783, 0.9769821166992188, 0.4642512798309326, -0.15275262296199799, -1.3637785911560059, 0.5593298673629761, 1.291697382926941, -0.9313622713088989, -0.7195942401885986, 0.08189953863620758, -0.853030800819397, 1.1556212902069092, 0.6499093770980835, 0.35708120465278625, 0.2948567569255829, 1.648301362991333, 0.6649324893951416, -0.4735528528690338, 0.4527982175350189, 0.5471159219741821, -0.17469587922096252, -2.0962047576904297, -1.042103886604309, 0.237875297665596, -0.3888314366340637, -1.448570966720581, 1.2826358079910278, -1.1176843643188477, -0.7890803813934326, 0.47010037302970886, 0.10690178722143173, 1.4195088148117065, 0.32881689071655273, 1.6435130834579468, 2.144777297973633, 0.8802171945571899, 0.2200838327407837, 1.373927116394043, -0.06566473096609116, -0.3779188096523285, 1.849982500076294, -0.3997383713722229, 0.5392451286315918, 1.0512197017669678, -0.3919003903865814, -1.1180922985076904, -0.7026445865631104, -1.0699336528778076, -0.6118643283843994, 1.119774580001831, 0.16085803508758545, -1.1670082807540894, 0.1301049292087555, 1.5113651752471924, 0.1269093155860901, -0.27294299006462097, 0.4578293263912201, 0.4966653883457184, -0.6833056211471558, -0.12697528302669525, -0.9437836408615112, 0.481263130903244, -0.19265234470367432, -0.34894537925720215, 0.3029365539550781, 0.48593688011169434, 1.1532092094421387, -0.03164321556687355, 0.0818236693739891, 1.214436650276184, -1.4676176309585571, 1.4728901386260986, -0.5781892538070679, 0.23471477627754211, -2.428462028503418, 1.497941493988037, -0.716787576675415, 1.970687747001648, -2.628513813018799, 0.38430503010749817, -0.6933406591415405, -0.4571475684642792, 0.4117317199707031, -0.4406543970108032, 0.1794380396604538, -0.1918400377035141, -1.0584884881973267, 0.013596655800938606, -0.757866382598877, 0.5622552633285522, 1.195337176322937, 1.2883559465408325, -1.173980712890625, -0.31258559226989746, -1.728013277053833, -0.23099525272846222, -0.7900243997573853, 0.3708985447883606, -2.038262367248535, -0.06452537328004837, -1.9244940280914307, -2.336158037185669, -1.4514262676239014, -0.8698300123214722, 1.0762379169464111, 0.12287689745426178, -0.9727100133895874, 1.1135793924331665, -0.43271371722221375, -1.7293853759765625, 1.0659708976745605, -2.2343454360961914 ]
https://github.com/huggingface/datasets/issues/4448
New Preprocessing Feature - Deduplication [Request]
Here is an example using the [datasets_sql](https://github.com/mariosasko/datasets_sql) mentioned ```python from datasets_sql import query dataset = load_dataset("imdb", split="train") # If you dont have an id column just add one by enumerating dataset=dataset.map(lambda x,i: {"id":i}, with_indices=True) id_column='id' unique_column='text' # always selects min id unique_dataset = query(f"SELECT dataset.* FROM dataset JOIN (SELECT MIN({id_column}) as unique_id FROM dataset group by {unique_column}) ON unique_id=dataset.{id_column}") ``` Not ideal for large datasets but good enough for basic cases. Sure would be nice to have in the library 🤗
**Is your feature request related to a problem? Please describe.** Many large datasets are full of duplications and it has been shown that deduplicating datasets can lead to better performance while training, and more truthful evaluation at test-time. A feature that allows one to easily deduplicate a dataset can be cool! **Describe the solution you'd like** We can define a function and keep only the first/last data-point that yields the value according to this function. **Describe alternatives you've considered** The clear alternative is to repeat a clear boilerplate every time someone want to deduplicate a dataset.
728
81
New Preprocessing Feature - Deduplication [Request] **Is your feature request related to a problem? Please describe.** Many large datasets are full of duplications and it has been shown that deduplicating datasets can lead to better performance while training, and more truthful evaluation at test-time. A feature that allows one to easily deduplicate a dataset can be cool! **Describe the solution you'd like** We can define a function and keep only the first/last data-point that yields the value according to this function. **Describe alternatives you've considered** The clear alternative is to repeat a clear boilerplate every time someone want to deduplicate a dataset. Here is an example using the [datasets_sql](https://github.com/mariosasko/datasets_sql) mentioned ```python from datasets_sql import query dataset = load_dataset("imdb", split="train") # If you dont have an id column just add one by enumerating dataset=dataset.map(lambda x,i: {"id":i}, with_indices=True) id_column='id' unique_column='text' # always selects min id unique_dataset = query(f"SELECT dataset.* FROM dataset JOIN (SELECT MIN({id_column}) as unique_id FROM dataset group by {unique_column}) ON unique_id=dataset.{id_column}") ``` Not ideal for large datasets but good enough for basic cases. Sure would be nice to have in the library 🤗
[ -1.268455147743225, -0.9828152060508728, -0.7521442174911499, 1.414304256439209, -0.1930304914712906, -1.2260442972183228, 0.09182382375001907, -1.0949459075927734, 1.6567379236221313, -0.7955741286277771, 0.2900005578994751, -1.6908595561981201, -0.009032626636326313, -0.5686222314834595, -0.7247535586357117, -0.9293777346611023, -0.4406554698944092, -0.8307044506072998, 0.979877769947052, 2.5222063064575195, 1.1582485437393188, -1.3692185878753662, 2.6972928047180176, 0.7332831621170044, -0.15675906836986542, -0.9820970296859741, 0.5266305208206177, 0.09269007295370102, -1.251977562904358, -0.4005281627178192, -0.8732596039772034, -0.07353147864341736, -0.5529214143753052, -0.47973158955574036, -0.02014497108757496, 0.4107407331466675, -0.332883358001709, -0.40868276357650757, -0.5747084617614746, -0.7500824332237244, 0.5057905912399292, -0.3920147120952606, 0.940559446811676, -0.43143680691719055, 1.8455455303192139, -0.5862768292427063, 0.35835546255111694, 0.6928855776786804, 1.2970339059829712, 0.21580253541469574, -0.0031762304715812206, 0.35510146617889404, 0.3407520651817322, -0.07459470629692078, 0.46639761328697205, 1.201397180557251, 0.6485528945922852, 0.5035831332206726, 0.7203154563903809, -2.2094826698303223, 1.3239786624908447, -1.067379355430603, 0.42332231998443604, 1.4055328369140625, -0.9291991591453552, 0.47133684158325195, -1.7676554918289185, -0.07632196694612503, 0.5897449254989624, -2.2976601123809814, 0.19596271216869354, -1.269289255142212, -0.537704348564148, 0.9869643449783325, 0.27974361181259155, -1.1762875318527222, 0.24155353009700775, -0.4508042633533478, 1.0541993379592896, 0.4846228361129761, 1.129022479057312, -1.7259795665740967, -0.04698868468403816, -0.24349841475486755, 0.10181711614131927, -1.4282469749450684, -1.5381773710250854, 0.5310391783714294, 0.5976395606994629, 0.6394845247268677, -0.15154172480106354, 0.999934196472168, -1.03819739818573, 0.7913686037063599, -0.9867987632751465, -1.6334502696990967, -1.437738060951233, -2.2888529300689697, -2.2794559001922607, 0.805412232875824, -0.40450820326805115, -0.5649709105491638, 1.9397653341293335, -1.015950322151184, -1.7245441675186157, 1.198002815246582, 0.3243521749973297, 0.006582761183381081, 2.4157745838165283, 0.1468549221754074, -0.7232950925827026, 0.4743984341621399, -0.745652973651886, 0.7913793325424194, -0.3813472092151642, 1.4781132936477661, 0.4501953423023224, -1.0160185098648071, 1.566711664199829, -0.476616233587265, 0.5629738569259644, -0.6475353837013245, -0.5917007923126221, -0.8785627484321594, 0.3615477681159973, 1.8987845182418823, -0.25521135330200195, 1.6634966135025024, -0.33082136511802673, -1.593272089958191, -1.6666786670684814, 0.8766684532165527, 0.47736412286758423, -0.8877430558204651, 0.0693923756480217, -0.4243960380554199, 0.19915077090263367, -0.039260461926460266, 1.1564427614212036, 1.1781597137451172, 0.6513628363609314, -0.3319578468799591, -0.8570833206176758, 0.17801980674266815, -0.1705176681280136, -0.6700055003166199, -1.7798054218292236, -0.3085087835788727, 0.22344988584518433, 0.5507525205612183, -1.2391947507858276, 1.6698004007339478, 0.9055480360984802, 1.858002781867981, 1.0449070930480957, -0.35344812273979187, 1.3914152383804321, 0.0815519317984581, 1.8292180299758911, -0.579754114151001, 0.6764699816703796, -0.2909678518772125, -1.1016877889633179, 0.8036670088768005, -0.3453047275543213, -2.076425075531006, -0.8716561794281006, -0.8478004932403564, -0.15994542837142944, -0.7743699550628662, 0.8720248937606812, -0.29200828075408936, -1.430901288986206, 0.27133908867836, -0.690668523311615, 0.15715894103050232, -1.194284439086914, 0.365430623292923, 0.7902446985244751, -0.6604775786399841, -0.06987091153860092, -0.22210341691970825, -1.2761095762252808, -0.4681563079357147, 0.2873820662498474, 1.8842283487319946, -0.7014045715332031, 0.8684709072113037, 0.9907678961753845, -0.7122788429260254, 0.05052084103226662, 0.23393765091896057, -0.2728714048862457, 0.8321370482444763, -1.0051909685134888, -0.40822499990463257, 1.1567723751068115, -0.22805842757225037, -0.5658611059188843, 1.504256248474121, 0.7458357214927673, -0.9881775379180908, -0.22203567624092102, -0.221405491232872, -0.8470962047576904, -0.05880196765065193, -1.5214325189590454, -0.09530223906040192, 0.34356120228767395, -1.5011184215545654, -0.5462769269943237, -0.2109197974205017, 1.270155668258667, -0.19691725075244904, 1.3107266426086426, -0.3969080448150635, -0.2454562783241272, -0.3877495527267456, -0.4363337457180023, 0.20150913298130035, -0.22321397066116333, -0.605756402015686, 0.21763291954994202, -0.8312488794326782, 0.31101882457733154, 1.4189269542694092, 0.5181300044059753, 0.05218830704689026, 0.53525310754776, 1.0783618688583374, 0.3183267116546631, -0.13584759831428528, -0.7637700438499451, -1.534645438194275, 1.9656354188919067, -1.394020438194275, 1.9726051092147827, 0.7269479036331177, 0.014648168347775936, -1.808591604232788, -1.8368315696716309, 1.3338543176651, 1.1622614860534668, 2.383251428604126, 0.5363660454750061, 0.4027961790561676, -0.8341668248176575, -0.7183868288993835, 0.258017897605896, -1.0478533506393433, -0.7243145704269409, 0.11590510606765747, 2.37837553024292, 1.7948938608169556, -0.5783715844154358, -0.1643390953540802, -0.9942997097969055, 1.470264196395874, -0.2651631236076355, 0.2026607245206833, 2.0366666316986084, -0.30131736397743225, -1.0966330766677856, 1.3448094129562378, -2.3795571327209473, 0.10262664407491684, 2.005369186401367, 0.35287758708000183, 0.041308578103780746, -1.4138221740722656, -0.6475412249565125, -0.34632036089897156, -0.39223816990852356, -1.3034677505493164, 0.43725886940956116, -0.24939195811748505, -0.718854546546936, -1.497556209564209, 0.09762723743915558, -1.102437138557434, -1.5602887868881226, 0.3645470440387726, 1.841058373451233, 1.984923243522644, -0.7172048687934875, 1.5431532859802246, -0.25269052386283875, 0.13094718754291534, 1.2786591053009033, 1.2648478746414185, 3.1312363147735596, 1.8437135219573975, -1.2833372354507446, 0.6013292074203491, -0.15705522894859314, -0.5090557932853699, 1.1879034042358398, -1.1617486476898193, 1.3214173316955566, -0.08947661519050598, -1.2280712127685547, -1.257633924484253, 1.0204854011535645, 0.5351235866546631, 0.04782135784626007, -0.5057615041732788, 1.2004796266555786, -0.0008085574954748154, 1.4043686389923096, 0.5089629888534546, -0.3692021667957306, 0.555986225605011, -0.45240747928619385, -0.5506978631019592, 1.5927729606628418, 0.2128918319940567, -1.394214391708374, -2.3134965896606445, -0.25693777203559875, -0.7670862078666687, -0.01702473685145378, -0.5534251928329468, -0.997835636138916, 1.6143152713775635, 0.39364567399024963, -1.2826069593429565, -0.24420155584812164, -0.3936775028705597, -0.6215638518333435, 2.6367392539978027, -1.4181853532791138, -0.1416948139667511, -0.9245927333831787, -0.6501384377479553, 1.6421235799789429, -1.189867615699768, -0.21414527297019958, -1.0575753450393677, -0.6440457701683044, -1.3013216257095337, -0.5598230957984924, -0.007788314484059811, -0.931958794593811, 0.7718687057495117, 0.1516428142786026, -1.0592654943466187, -0.3333066403865814, -0.9011908769607544, 0.854698896408081, -0.14823418855667114, 0.2509611248970032, 1.8328288793563843, 0.41745734214782715, -0.36892667412757874, 0.7707524299621582, 1.1765352487564087, 0.6260037422180176, -0.6807852983474731, 0.1703622043132782, -0.6911541819572449, 0.29517555236816406, -1.3311712741851807, 0.20532646775245667, -2.915327548980713, 0.6105444431304932, -0.03370359167456627, -0.05770466849207878, 0.060381192713975906, -1.3287901878356934, 1.1190816164016724, 2.5826947689056396, -1.1981960535049438, 0.5052816271781921, 0.34933149814605713, 1.1320874691009521, -1.6530437469482422, 0.3729810416698456, -0.3838993310928345, 2.069798231124878, 0.2474365085363388, 1.227953314781189, -0.5866479277610779, -2.193162679672241, 0.5599231123924255, -1.2249895334243774, -1.154477596282959, 0.737437903881073, -0.9736535549163818, 0.2850181460380554, -1.5377161502838135, -0.21113397181034088, -0.8922839760780334, -1.2573015689849854, 0.7358253002166748, 0.10727301239967346, 0.36429715156555176, -0.5211673378944397, 0.3456043004989624, -2.2367541790008545, -1.3854713439941406, -0.24500778317451477, -0.9675220847129822, 0.5465746521949768, -0.3427956998348236, 0.688200831413269, -0.06886105239391327, 0.052249014377593994, 0.2954128682613373, 1.4273078441619873, 3.3328287601470947, 0.26418110728263855, 0.38009166717529297, -0.06438080221414566, -0.974851667881012, 1.4659810066223145, 0.9474594593048096, -0.046317581087350845, -0.5465875267982483, -1.0074442625045776, 1.2598124742507935, 1.907116174697876, 1.0827547311782837, 0.028581026941537857, -0.751985490322113, -0.6613604426383972, 0.034429240971803665, 0.23232154548168182, 0.3908741772174835, 0.9054733514785767, 0.01708374172449112, 0.13888335227966309, 1.474985957145691, 1.2177622318267822, -0.4503112733364105, 0.4017239212989807, -0.8191516995429993, -0.5406355857849121, 0.44720637798309326, 0.26808613538742065, -0.07133813947439194, 0.3809996247291565, -0.952916145324707, -0.20105309784412384, -0.33966708183288574, -0.9288956522941589, -0.619909405708313, -0.5555477142333984, -0.42734700441360474, 1.6169625520706177, 0.13017725944519043, -0.5762454867362976, -0.11348986625671387, -0.8221084475517273, -0.13308705389499664, -1.1457823514938354, 0.2814498245716095, -0.03183440864086151, -0.1714802235364914, -0.1435008943080902, 1.7760350704193115, -0.8916080594062805, -2.1190025806427, 0.18536701798439026, 0.2885324954986572, -0.34001103043556213, 0.0842636302113533, 1.6365772485733032, 0.4691574275493622, 1.4618123769760132, 1.3145809173583984, 0.943395733833313, -0.6942874193191528, -1.321373462677002, 0.6636687517166138, 0.9507129192352295, -1.2903989553451538, 0.8107595443725586, 0.008048449642956257, -0.5392858982086182, 0.6626379489898682, 1.302903652191162, 0.480770081281662, -1.8996424674987793, 0.8613855838775635, -0.9755942225456238, 0.7573087811470032, 0.7001490592956543, 0.7071753144264221, 0.19988520443439484, 0.8574988842010498, -1.3031096458435059, -1.14241623878479, -0.835328221321106, -0.6235877871513367, 2.0131406784057617, -0.23126502335071564, 0.6714250445365906, -0.2008666694164276, -1.2782137393951416, -0.06593684107065201, 0.7648211717605591, 0.4570833742618561, -0.3988834619522095, 0.8640806078910828, -0.6248964667320251, -1.063354730606079, -1.363409399986267, -0.3464437425136566, -1.027714729309082, -0.854793906211853, 1.0498647689819336, 0.8273243308067322, 0.2511350214481354, 1.8642836809158325, 0.669299304485321, 0.28264060616493225, -2.601982831954956, 0.8536142706871033, 0.30036842823028564, -0.062045685946941376, 0.8938465714454651, 0.31074097752571106, 0.979211151599884, 0.061759937554597855, 0.5076675415039062, -2.448397636413574, 2.2125868797302246, -0.2296227365732193, 0.6956921219825745, -0.04644838348031044, -0.20796425640583038, 1.1961264610290527, 0.5629022121429443, 0.5041792988777161, -1.0682636499404907, 0.6816129684448242, -0.5100498199462891, 1.1906248331069946, 0.9355180859565735, -0.8170242309570312, -0.04364859685301781, 1.3821873664855957, 0.44084662199020386, -0.48049405217170715, -1.0112308263778687, -0.8313685655593872, 0.9819706678390503, 1.731301188468933, -0.1035616546869278, -0.05141352862119675, 0.8440266847610474, 0.6852027773857117, -1.3393878936767578, 0.1564694046974182, -0.7744261026382446, -0.7620151042938232, 1.6758402585983276, 2.0761361122131348, -0.0420757532119751, -0.16197146475315094, -0.6322827935218811, -1.287017583847046, 0.7846136689186096, 0.05493754521012306, 0.169392928481102, 0.7032504081726074, -0.6404231190681458, 1.0530318021774292, 0.9348074197769165, 0.8845021724700928, 0.1440255045890808, 0.2922455370426178, 0.38856032490730286, -0.2892265021800995, -1.13548743724823, -0.18365496397018433, -1.1126360893249512, -2.466460704803467, 0.4608311057090759, -0.2323734015226364, -1.4386928081512451, -0.02215149626135826, -0.9849256277084351, 1.0167571306228638, -0.5755069851875305, -1.0729621648788452, -1.6196826696395874, 0.17398668825626373, -0.009907444939017296, 0.9274486303329468, -1.598869800567627, -0.18864642083644867, 1.1548752784729004, 0.8258248567581177, -0.6782748699188232, 1.0404638051986694, 0.2403927594423294, 0.9929909706115723, 0.7570583820343018, -0.47070637345314026, 0.5206030607223511, 0.024329498410224915, -1.3713042736053467, 0.5005624294281006, 1.1388847827911377, 0.1428246945142746, 1.4247196912765503, -0.5309922695159912, 0.026471752673387527, 0.4377305805683136, -0.617260217666626, -0.41278836131095886, -0.45352452993392944, 0.6609984040260315, 0.0779419019818306, -0.8437828421592712, -0.006398149766027927, -0.04618190973997116, -0.3046676218509674, 0.19469775259494781, -1.4630781412124634, -0.22540783882141113, -0.4424010217189789, -0.5756668448448181, -1.2262383699417114, -0.03331384062767029, 1.4286043643951416, -0.8078103065490723, -0.1888599842786789, 0.5332090854644775, 0.4643078148365021, 0.6472791433334351, 0.6468999981880188, -0.6882233023643494, -0.2590157091617584, -0.3024916648864746, -0.27408304810523987, 0.1841755211353302, 1.2950290441513062, -0.1602092683315277, -0.9747911095619202, 0.7264389395713806, -0.28594332933425903, 0.07458601891994476, 1.9609615802764893, 0.04527142643928528, -0.7943787574768066, 0.3004336655139923, -0.7521518468856812, 1.8244222402572632, 1.7750122547149658, 1.4055341482162476, -0.1352178454399109, -0.918938398361206, 0.5780263543128967, -0.25557124614715576, -0.35385259985923767, 0.941120445728302, 0.47966331243515015, -0.20698627829551697, -1.4047688245773315, 0.6916340589523315, 1.269603967666626, -0.8498036861419678, -0.679000198841095, 0.15277211368083954, -0.8357954025268555, 1.1487144231796265, 0.58608478307724, 0.386319637298584, 0.3468627631664276, 1.6708710193634033, 0.7169569134712219, -0.4497918486595154, 0.4723910391330719, 0.6426435112953186, -0.18900367617607117, -2.0827488899230957, -1.11819589138031, 0.35108259320259094, -0.5515187978744507, -1.5140711069107056, 1.3956027030944824, -1.1159369945526123, -0.9158646464347839, 0.5621144771575928, 0.08636748790740967, 1.43422269821167, 0.37565940618515015, 1.6270545721054077, 2.1093387603759766, 0.8709827661514282, 0.3089136779308319, 1.3386870622634888, -0.07797394692897797, -0.4016416668891907, 1.8014453649520874, -0.3819880485534668, 0.49147829413414, 1.1227939128875732, -0.2650721073150635, -1.0668450593948364, -0.7151883840560913, -1.1649445295333862, -0.6960700154304504, 1.1181788444519043, 0.14206449687480927, -1.1134787797927856, 0.17418499290943146, 1.5861806869506836, 0.13005411624908447, -0.31349486112594604, 0.5373685359954834, 0.4699259102344513, -0.7988881468772888, -0.09829848259687424, -1.0039325952529907, 0.4707950949668884, -0.2142801135778427, -0.28887277841567993, 0.2737353444099426, 0.48188072443008423, 1.3070564270019531, -0.03920047730207443, 0.17273622751235962, 1.1225494146347046, -1.4567214250564575, 1.505110502243042, -0.6288998126983643, 0.2293892204761505, -2.404050588607788, 1.4508602619171143, -0.7064121961593628, 1.9749630689620972, -2.677530288696289, 0.46021807193756104, -0.6443964838981628, -0.444206565618515, 0.4120884835720062, -0.4445570409297943, 0.14336656033992767, -0.10491649806499481, -1.1164019107818604, -0.012966752983629704, -0.7051360011100769, 0.5671606659889221, 1.166985273361206, 1.3004570007324219, -1.1663964986801147, -0.38545358180999756, -1.6632752418518066, -0.23814962804317474, -0.7901178598403931, 0.34896552562713623, -2.008729934692383, -0.11695157736539841, -1.818589687347412, -2.3746986389160156, -1.3037439584732056, -0.8116596341133118, 1.1261943578720093, 0.04652593657374382, -0.9434942603111267, 1.2395596504211426, -0.4294548034667969, -1.8339824676513672, 1.1743322610855103, -2.181600332260132 ]
https://github.com/huggingface/datasets/issues/4443
Dataset Viewer issue for openclimatefix/nimrod-uk-1km
If I understand correctly, this is due to the key `split` missing in the line https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L41 of the script. Maybe @albertvillanova could confirm.
### Link _No response_ ### Description _No response_ ### Owner _No response_
729
23
Dataset Viewer issue for openclimatefix/nimrod-uk-1km ### Link _No response_ ### Description _No response_ ### Owner _No response_ If I understand correctly, this is due to the key `split` missing in the line https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L41 of the script. Maybe @albertvillanova could confirm.
[ -1.1245816946029663, -0.5825266242027283, -0.7408245801925659, 1.5335572957992554, -0.0693071037530899, -1.39859938621521, 0.19990259408950806, -0.9064490795135498, 1.603202223777771, -0.8274538516998291, 0.2593793570995331, -1.6638706922531128, -0.04671875759959221, -0.6029850840568542, -0.6118128299713135, -0.807251513004303, -0.432341605424881, -0.5254212617874146, 1.1837990283966064, 2.395763874053955, 1.3831135034561157, -1.2927467823028564, 2.8094639778137207, 0.6746104955673218, -0.33347195386886597, -0.8443441987037659, 0.589377760887146, -0.022467181086540222, -1.1963160037994385, -0.41368284821510315, -0.8598220944404602, -0.04007333517074585, -0.5154750347137451, -0.38765448331832886, 0.010560046881437302, 0.5154982209205627, -0.19820919632911682, -0.461154043674469, -0.49264541268348694, -0.8161208033561707, 0.3212921917438507, -0.2640933692455292, 0.8246788382530212, -0.36480143666267395, 1.825713038444519, -0.5904514193534851, 0.41257330775260925, 0.5887755751609802, 1.3234236240386963, 0.12723276019096375, -0.021559854969382286, 0.24160590767860413, 0.3671928644180298, -0.12147756665945053, 0.4753437936306, 1.2442688941955566, 0.4988143742084503, 0.6415232419967651, 0.6292493343353271, -2.07485032081604, 1.3595401048660278, -0.7800997495651245, 0.08403915911912918, 1.4841598272323608, -1.1459295749664307, 0.4355582892894745, -1.6611486673355103, -0.09757707267999649, 0.511523962020874, -2.240190029144287, 0.1853700578212738, -1.202513575553894, -0.6871098279953003, 0.8408980965614319, 0.3462822735309601, -1.3420803546905518, -0.09706196933984756, -0.5080800652503967, 1.089446783065796, 0.43662920594215393, 1.200740933418274, -1.5783058404922485, 0.03514423221349716, -0.27494052052497864, -0.08600615710020065, -1.3698042631149292, -1.5049526691436768, 0.4953232705593109, 0.6304206252098083, 0.7987366318702698, -0.007223482243716717, 0.8863874077796936, -0.983160674571991, 0.7206233739852905, -0.8340441584587097, -1.7590419054031372, -1.3692708015441895, -2.5310871601104736, -2.245596170425415, 0.7600606679916382, -0.43965572118759155, -0.5295097231864929, 2.044919967651367, -1.0032044649124146, -1.775800347328186, 1.076578140258789, 0.23589083552360535, 0.10230520367622375, 2.483701705932617, 0.30569881200790405, -0.7492682933807373, 0.3912507891654968, -0.7822611331939697, 0.7692561149597168, -0.6436069011688232, 1.3048746585845947, 0.4826134741306305, -0.9658873081207275, 1.7018911838531494, -0.4421118497848511, 0.6357301473617554, -0.7533743977546692, -0.41312775015830994, -0.7458145618438721, 0.2898666262626648, 1.8237701654434204, -0.3334706425666809, 1.5839018821716309, -0.2783273160457611, -1.470389485359192, -1.499603509902954, 0.8623124361038208, 0.3784672021865845, -0.8055645823478699, 0.30210575461387634, -0.45243802666664124, 0.07719677686691284, 0.030594002455472946, 1.0523912906646729, 1.3832621574401855, 0.5587847232818604, -0.3299983739852905, -0.8288319706916809, 0.24402877688407898, -0.04012156277894974, -0.598691463470459, -1.7897151708602905, -0.28522759675979614, 0.08817470818758011, 0.5725919604301453, -1.1138546466827393, 1.791407585144043, 0.9017202258110046, 1.991961121559143, 1.0312581062316895, -0.2972862720489502, 1.4040615558624268, -0.09514223784208298, 1.8498446941375732, -0.39310914278030396, 0.7598453164100647, -0.32127270102500916, -1.1141422986984253, 0.8216153979301453, -0.44217121601104736, -1.8586968183517456, -0.858879804611206, -0.9084506034851074, -0.19924470782279968, -0.7219734787940979, 1.0402634143829346, -0.37145090103149414, -1.207756519317627, -0.008906366303563118, -0.7132307887077332, 0.17813041806221008, -1.5022393465042114, 0.23469161987304688, 0.7264833450317383, -0.5310503840446472, 0.012910710647702217, -0.3799997866153717, -1.2318371534347534, -0.46527978777885437, 0.49191024899482727, 1.9533114433288574, -0.6514553427696228, 0.9508395791053772, 0.8954399228096008, -0.6864970326423645, 0.059304170310497284, 0.2887934148311615, -0.257854700088501, 0.7928553819656372, -1.237392783164978, -0.4284168481826782, 1.1073800325393677, -0.3040102422237396, -0.735334038734436, 1.4719200134277344, 0.8117659091949463, -1.0923376083374023, -0.19839665293693542, -0.1917991042137146, -0.9024804830551147, -0.05111811310052872, -1.638827919960022, -0.14498239755630493, 0.2224423587322235, -1.4681988954544067, -0.5450957417488098, -0.1700236201286316, 1.4926708936691284, -0.15353721380233765, 1.5876774787902832, -0.251510351896286, -0.15584644675254822, -0.48120322823524475, -0.439027339220047, 0.12002985924482346, -0.12288234382867813, -0.6399456858634949, 0.1933644413948059, -0.7864022850990295, 0.20714575052261353, 1.5170313119888306, 0.2420712411403656, 0.15547910332679749, 0.5709966421127319, 1.1021709442138672, 0.3685343265533447, -0.16527539491653442, -0.8447730541229248, -1.571507453918457, 1.9661321640014648, -1.4131470918655396, 1.9868247509002686, 0.7662603259086609, -0.18357977271080017, -1.7988675832748413, -1.9513758420944214, 1.426003098487854, 1.2207212448120117, 2.247509479522705, 0.5298420786857605, 0.31016555428504944, -0.8177255392074585, -0.7902369499206543, 0.20403149724006653, -1.027996301651001, -0.6351885199546814, 0.22751697897911072, 2.1675302982330322, 1.6733940839767456, -0.47860008478164673, -0.18032214045524597, -1.0414860248565674, 1.225643515586853, -0.10263299196958542, 0.22923550009727478, 1.8614819049835205, -0.40567344427108765, -0.8015217185020447, 0.9463809132575989, -2.3102641105651855, 0.21635127067565918, 2.067497730255127, 0.17184406518936157, 0.1268247365951538, -1.437260389328003, -0.7243953347206116, -0.21853414177894592, -0.28278210759162903, -1.2846248149871826, 0.6595489382743835, -0.24524173140525818, -0.9784359335899353, -1.3891650438308716, 0.12831851840019226, -1.0677553415298462, -1.7307459115982056, 0.3940647840499878, 1.9835035800933838, 2.043294906616211, -0.8839651942253113, 1.4487409591674805, -0.12908144295215607, -0.008017289452254772, 1.3739336729049683, 1.1623716354370117, 3.116997480392456, 1.9413645267486572, -1.267284870147705, 0.8340443968772888, -0.04483179375529289, -0.5685437917709351, 1.15576171875, -1.1532728672027588, 1.2707897424697876, -0.3784787356853485, -1.2781330347061157, -1.2487620115280151, 0.9118624329566956, 0.45961833000183105, -0.008049444295465946, -0.47864118218421936, 1.381894588470459, 0.02100304886698723, 1.3342018127441406, 0.5788845419883728, -0.40510401129722595, 0.6894042491912842, -0.46597495675086975, -0.409565806388855, 1.4996683597564697, 0.313180536031723, -1.623379111289978, -2.254581928253174, -0.15439775586128235, -0.9742756485939026, -0.116579569876194, -0.7503595352172852, -1.0640865564346313, 1.607992172241211, 0.5744773745536804, -0.94931560754776, -0.4063890874385834, -0.318421870470047, -0.6192094683647156, 2.7840545177459717, -1.4523435831069946, -0.298091858625412, -0.9516271948814392, -0.5249614119529724, 1.7295700311660767, -1.1961783170700073, -0.1312759816646576, -1.09390389919281, -0.5118696093559265, -1.2555545568466187, -0.39449405670166016, 0.06540627777576447, -0.8048686385154724, 0.8745669722557068, -0.006744891405105591, -1.215286135673523, -0.16504302620887756, -0.903186559677124, 0.8486925363540649, -0.264385461807251, 0.26137804985046387, 1.8461010456085205, 0.2145470678806305, -0.4959518611431122, 0.8047796487808228, 1.2432889938354492, 0.5824753046035767, -0.6792598962783813, 0.1008879616856575, -0.5123046040534973, 0.4430697560310364, -1.2661263942718506, 0.23968195915222168, -2.9760401248931885, 0.5338089466094971, -0.22174149751663208, -0.1296136975288391, -0.1717853546142578, -1.422494649887085, 1.101855993270874, 2.4925599098205566, -1.2053841352462769, 0.5670113563537598, 0.29111719131469727, 1.287253737449646, -1.6258606910705566, 0.3773370087146759, -0.7017145752906799, 2.0559804439544678, 0.09376853704452515, 1.1400114297866821, -0.5061396956443787, -2.138812303543091, 0.6899223327636719, -1.0839762687683105, -0.9353713989257812, 0.9135330319404602, -0.9212833046913147, 0.12953174114227295, -1.3114856481552124, -0.17368146777153015, -0.8438799977302551, -1.3196386098861694, 0.5977491736412048, 0.11323182284832001, 0.5791966915130615, -0.6073418259620667, 0.333569198846817, -2.23185133934021, -1.2961881160736084, -0.2640335261821747, -0.9365540742874146, 0.36202719807624817, -0.5397650003433228, 0.6225876808166504, -0.192613422870636, 0.1877433955669403, 0.18572616577148438, 1.3636285066604614, 3.295274496078491, 0.028740689158439636, 0.27645453810691833, -0.306371808052063, -0.9931395649909973, 1.5430909395217896, 0.9944236278533936, 0.027866292744874954, -0.5891541838645935, -0.9197083711624146, 1.3406535387039185, 1.8110722303390503, 1.0453273057937622, 0.010027330368757248, -0.8691824674606323, -0.5765411257743835, -0.08674554526805878, 0.13877713680267334, 0.4655371308326721, 1.0396382808685303, 0.011315371841192245, 0.06550835072994232, 1.2386054992675781, 1.1794047355651855, -0.5202634930610657, 0.5251368880271912, -0.9498008489608765, -0.2943042814731598, 0.44821062684059143, 0.41037529706954956, 0.04568011686205864, 0.31509149074554443, -0.9721319079399109, -0.3501853346824646, -0.25085118412971497, -0.9150497913360596, -0.8466767072677612, -0.41068288683891296, -0.43414565920829773, 1.67976975440979, 0.14581182599067688, -0.5367744565010071, 0.07241865992546082, -0.8458771705627441, -0.0920884758234024, -1.0927844047546387, 0.18164730072021484, -0.18813976645469666, 0.02293901890516281, 0.04078718647360802, 1.862496256828308, -1.1545143127441406, -2.3738820552825928, 0.31962332129478455, 0.22152245044708252, -0.3192783296108246, 0.09739766269922256, 1.739398717880249, 0.5173009037971497, 1.4059913158416748, 1.3681524991989136, 1.0902550220489502, -0.7550632357597351, -1.2673161029815674, 0.6406179070472717, 1.037713646888733, -1.4616299867630005, 0.9274519085884094, -0.1561863124370575, -0.5181610584259033, 0.6161893606185913, 1.2294597625732422, 0.371372789144516, -1.9478306770324707, 0.8974087238311768, -0.9564844965934753, 1.0298511981964111, 0.840454638004303, 0.8750590682029724, 0.3954728841781616, 0.8852221369743347, -1.1690117120742798, -1.216806411743164, -0.7565497756004333, -0.6558271050453186, 1.9560399055480957, -0.27832555770874023, 0.5161805152893066, -0.15082979202270508, -1.160805583000183, 0.1035168245434761, 0.7445369958877563, 0.25560444593429565, -0.3599197268486023, 0.7987359762191772, -0.595109224319458, -1.053398847579956, -1.469684362411499, -0.563829243183136, -1.0172139406204224, -1.0965560674667358, 1.0705701112747192, 0.7204330563545227, 0.49935290217399597, 1.9203439950942993, 0.6835935115814209, 0.2724723219871521, -2.5406346321105957, 0.9448688626289368, 0.3386051058769226, 0.1135268285870552, 0.6708931922912598, 0.32603633403778076, 1.1098754405975342, -0.01182589866220951, 0.42567822337150574, -2.3913307189941406, 2.2849059104919434, -0.2540750205516815, 0.6728751063346863, 0.08765984326601028, -0.07952552288770676, 1.0327702760696411, 0.5822588205337524, 0.5062180161476135, -1.1590378284454346, 0.9235175251960754, -0.6473209857940674, 1.1877453327178955, 0.8939356207847595, -0.8074797987937927, 0.16337850689888, 1.4531636238098145, 0.5171900987625122, -0.5273764729499817, -0.8225349187850952, -0.7694394588470459, 0.8844277262687683, 1.5772335529327393, 0.09851250052452087, 0.11272963881492615, 0.9004544019699097, 0.5224192142486572, -1.187323808670044, 0.019706454128026962, -0.7264655828475952, -0.5199092626571655, 1.7731280326843262, 1.937016248703003, -0.1807135045528412, 0.0705014169216156, -0.8623514771461487, -1.3399996757507324, 0.6899592280387878, 0.0287170372903347, -0.03489997237920761, 0.6395745277404785, -0.631367027759552, 1.1969488859176636, 0.47778868675231934, 0.7846235632896423, 0.001355394721031189, 0.298839807510376, 0.5460871458053589, -0.346969336271286, -1.1913052797317505, -0.31778231263160706, -1.1132476329803467, -2.468106985092163, 0.2925422787666321, -0.46975177526474, -1.4088590145111084, 0.03245026245713234, -1.104161262512207, 0.9418738484382629, -0.6409233212471008, -1.1121488809585571, -1.535046935081482, 0.14934766292572021, -0.1601783037185669, 0.8527639508247375, -1.5762295722961426, -0.14282310009002686, 1.3187024593353271, 0.8005887866020203, -0.7753010988235474, 1.0526081323623657, 0.2912650406360626, 1.0904420614242554, 0.8488959670066833, -0.3046209514141083, 0.4163064658641815, 0.011915471404790878, -1.391013264656067, 0.5948135852813721, 1.3236523866653442, 0.10556267946958542, 1.4608482122421265, -0.5317787528038025, 0.001886500045657158, 0.4526275098323822, -0.44253820180892944, -0.6410428285598755, -0.502131462097168, 0.7524799108505249, -0.004330385942012072, -0.912196695804596, 0.0011841850355267525, -0.2140960693359375, -0.20502588152885437, 0.32185229659080505, -1.5683690309524536, -0.0743543952703476, -0.3643720746040344, -0.5882376432418823, -1.3320528268814087, 0.13182726502418518, 1.2256335020065308, -0.6816332340240479, -0.2804257571697235, 0.4720110595226288, 0.2980344295501709, 0.48231327533721924, 0.6231850981712341, -0.7997892498970032, -0.20980873703956604, -0.2510037124156952, -0.2550086975097656, 0.3972107768058777, 1.205074667930603, -0.19137677550315857, -1.0530167818069458, 0.6591787934303284, -0.41534677147865295, 0.05231831222772598, 2.0149266719818115, 0.11646652966737747, -0.8387446403503418, 0.2974735498428345, -0.7314155697822571, 1.9422471523284912, 1.5092918872833252, 1.3364077806472778, -0.005668749567121267, -0.9427652359008789, 0.6757521629333496, -0.21207404136657715, -0.335550457239151, 0.6766261458396912, 0.5051966905593872, -0.30419838428497314, -1.5050686597824097, 0.4513363242149353, 1.3199619054794312, -0.8529929518699646, -0.9125632643699646, 0.09938489645719528, -0.9186112880706787, 1.2448152303695679, 0.7545356154441833, 0.4244830906391144, 0.2246823012828827, 1.6456390619277954, 0.6116961240768433, -0.5092729330062866, 0.39879342913627625, 0.4947514235973358, -0.01658003404736519, -2.0744874477386475, -0.921962559223175, 0.4401954412460327, -0.4297988712787628, -1.4287898540496826, 1.4203217029571533, -1.1062722206115723, -1.0772809982299805, 0.4314727485179901, 0.2397371530532837, 1.444187879562378, 0.18326836824417114, 1.7390867471694946, 2.0095911026000977, 0.9463227987289429, 0.39538678526878357, 1.252996563911438, -0.25652772188186646, -0.433195024728775, 1.7355809211730957, -0.5055462718009949, 0.49973252415657043, 0.9715988039970398, -0.40911248326301575, -1.2230151891708374, -0.705245852470398, -1.1473363637924194, -0.6035923361778259, 1.1783089637756348, 0.2464125156402588, -1.0054564476013184, 0.228959321975708, 1.4528841972351074, 0.1805957555770874, -0.3003723919391632, 0.6977069973945618, 0.5427656769752502, -0.7428231835365295, 0.0026479093357920647, -0.9750764966011047, 0.5814890265464783, -0.14551487565040588, -0.38299477100372314, 0.3604077100753784, 0.5904874205589294, 1.3327791690826416, -0.09647342562675476, 0.2574003040790558, 1.3046852350234985, -1.3728399276733398, 1.4254196882247925, -0.6664356589317322, 0.09613649547100067, -2.4107398986816406, 1.3815834522247314, -0.5772964954376221, 1.8817006349563599, -2.776784658432007, 0.3410376310348511, -0.5722821354866028, -0.37093061208724976, 0.32840999960899353, -0.29007163643836975, 0.001840890385210514, -0.22985047101974487, -1.08362877368927, -0.034366805106401443, -0.7133228182792664, 0.5409207344055176, 1.2107458114624023, 1.2396655082702637, -1.0422312021255493, -0.1515137255191803, -1.8127567768096924, -0.05051223561167717, -0.7662824392318726, 0.2912864685058594, -2.0096094608306885, -0.20570802688598633, -1.9539661407470703, -2.349254608154297, -1.3694766759872437, -0.8005650043487549, 1.0778292417526245, 0.31412744522094727, -0.7847825288772583, 1.261610746383667, -0.29558265209198, -1.9056466817855835, 1.130389928817749, -2.004615068435669 ]
https://github.com/huggingface/datasets/issues/4443
Dataset Viewer issue for openclimatefix/nimrod-uk-1km
Indeed there are several issues in this dataset loading script. The one pointed out by @severo: for the default configuration "crops": https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L244 - The download manager downloads `_URL` - But `_URL` is not defined: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L41 ```python _URL = {'train': []} ``` - Afterwards, for each split, a different key in `_ULR` is used, but it only contains one key: "train" - "valid" key: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L260 - "test key: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L269 These keys do not exist inside `_URL`, thus the error message reported in the viewer: ``` Exception: KeyError Message: 'valid' ```
### Link _No response_ ### Description _No response_ ### Owner _No response_
729
89
Dataset Viewer issue for openclimatefix/nimrod-uk-1km ### Link _No response_ ### Description _No response_ ### Owner _No response_ Indeed there are several issues in this dataset loading script. The one pointed out by @severo: for the default configuration "crops": https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L244 - The download manager downloads `_URL` - But `_URL` is not defined: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L41 ```python _URL = {'train': []} ``` - Afterwards, for each split, a different key in `_ULR` is used, but it only contains one key: "train" - "valid" key: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L260 - "test key: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/blob/main/nimrod-uk-1km.py#L269 These keys do not exist inside `_URL`, thus the error message reported in the viewer: ``` Exception: KeyError Message: 'valid' ```
[ -1.017494797706604, -0.6547011733055115, -0.7622743248939514, 1.5453991889953613, 0.03724425658583641, -1.2849448919296265, 0.15744252502918243, -0.9582563638687134, 1.639961838722229, -0.6737002730369568, 0.3386615812778473, -1.7390023469924927, -0.06976144015789032, -0.638006329536438, -0.6763770580291748, -0.7868361473083496, -0.4212108552455902, -0.6443766355514526, 1.083522915840149, 2.411705732345581, 1.3475120067596436, -1.35169517993927, 2.7017180919647217, 0.6481446623802185, -0.26550742983818054, -0.8783454298973083, 0.5551424026489258, -0.08282436430454254, -1.1996228694915771, -0.34822046756744385, -0.8264276385307312, -0.16559359431266785, -0.6228254437446594, -0.49557292461395264, 0.021416570991277695, 0.541448175907135, -0.28670454025268555, -0.347993940114975, -0.6410719156265259, -0.820132315158844, 0.41532644629478455, -0.3355754315853119, 0.8994452953338623, -0.2883210778236389, 1.8072677850723267, -0.6325235366821289, 0.35671862959861755, 0.6550071835517883, 1.3022990226745605, 0.19122721254825592, 0.05928608775138855, 0.30132707953453064, 0.3578312397003174, -0.08321388810873032, 0.5795484185218811, 1.3065544366836548, 0.5952315330505371, 0.5221708416938782, 0.6874642968177795, -2.1478374004364014, 1.303194284439087, -0.8428579568862915, 0.10291405767202377, 1.4386889934539795, -0.9392634034156799, 0.35173454880714417, -1.7030656337738037, -0.01883498579263687, 0.5474104881286621, -2.1973483562469482, 0.21059851348400116, -1.3134733438491821, -0.5491087436676025, 0.9345042109489441, 0.2932291328907013, -1.2607927322387695, -0.030335363000631332, -0.41455531120300293, 1.084899663925171, 0.3880839943885803, 1.1754158735275269, -1.7083585262298584, -0.034259069710969925, -0.2657679319381714, 0.11647215485572815, -1.322383999824524, -1.6187318563461304, 0.4427110254764557, 0.6557551622390747, 0.6911148428916931, -0.0951681062579155, 0.9872359037399292, -1.0513215065002441, 0.6409829258918762, -0.976335346698761, -1.8268671035766602, -1.4168561697006226, -2.3867733478546143, -2.2482831478118896, 0.737671434879303, -0.49197304248809814, -0.42567169666290283, 2.0038199424743652, -0.9762845635414124, -1.7512863874435425, 1.058190107345581, 0.37398776412010193, 0.14740753173828125, 2.388885259628296, 0.23425841331481934, -0.7735196352005005, 0.42899882793426514, -0.8229285478591919, 0.7065788507461548, -0.42810869216918945, 1.2896082401275635, 0.5417256951332092, -0.9867919683456421, 1.651251196861267, -0.47323745489120483, 0.5913345217704773, -0.7983879446983337, -0.33626624941825867, -0.6096674799919128, 0.2896728515625, 1.8352230787277222, -0.37814539670944214, 1.6180349588394165, -0.19780254364013672, -1.476097822189331, -1.5258837938308716, 0.7704139947891235, 0.4071444272994995, -0.8622901439666748, 0.16774210333824158, -0.3675205409526825, 0.15130630135536194, -0.10314220190048218, 1.094948172569275, 1.2166041135787964, 0.6227685809135437, -0.3468017578125, -0.8131149411201477, 0.241045743227005, -0.0028823227621614933, -0.6448330283164978, -1.7331695556640625, -0.3282986581325531, 0.20047889649868011, 0.5476641654968262, -1.2168546915054321, 1.8620637655258179, 0.8015292286872864, 2.0061862468719482, 0.9875556230545044, -0.39967480301856995, 1.5296950340270996, -0.024405192583799362, 1.9462977647781372, -0.42797109484672546, 0.6375399827957153, -0.35000166296958923, -1.1617060899734497, 0.8433477282524109, -0.409414142370224, -1.9581406116485596, -0.7457715272903442, -0.9114352464675903, -0.09992630034685135, -0.778911828994751, 0.8840533494949341, -0.3114626407623291, -1.3380098342895508, 0.10164052248001099, -0.744498074054718, 0.10465669631958008, -1.4070590734481812, 0.21851328015327454, 0.7189000248908997, -0.6016842126846313, 0.03730934113264084, -0.34655919671058655, -1.216023325920105, -0.5148228406906128, 0.517034113407135, 1.9506266117095947, -0.5577117204666138, 0.8979964852333069, 1.016231894493103, -0.6594532132148743, 0.09416214376688004, 0.3000496029853821, -0.27813056111335754, 0.8185930848121643, -1.1403717994689941, -0.4751564860343933, 1.0462098121643066, -0.15683798491954803, -0.7266178131103516, 1.4527790546417236, 0.8957962989807129, -1.1323598623275757, -0.3163098096847534, -0.1782541126012802, -0.7263519763946533, 0.054133810102939606, -1.6350443363189697, -0.0670560672879219, 0.28123512864112854, -1.5197075605392456, -0.4623860716819763, -0.1944434642791748, 1.397908091545105, -0.28444746136665344, 1.469704270362854, -0.2905430495738983, -0.06443342566490173, -0.49017173051834106, -0.48207056522369385, 0.09953275322914124, -0.13424432277679443, -0.7194216847419739, 0.20464369654655457, -0.7950341105461121, 0.33195799589157104, 1.4307613372802734, 0.2662227749824524, 0.1404884159564972, 0.47747117280960083, 1.2357521057128906, 0.35462018847465515, -0.007090091705322266, -1.0041505098342896, -1.5502768754959106, 1.9673616886138916, -1.4584500789642334, 2.012314796447754, 0.8319149017333984, -0.015865901485085487, -1.78220796585083, -1.883080244064331, 1.4438533782958984, 1.1341861486434937, 2.349236011505127, 0.5698338150978088, 0.3587695062160492, -0.8510181903839111, -0.6962169408798218, 0.32362478971481323, -0.923096239566803, -0.6686261892318726, 0.2786337435245514, 2.298241138458252, 1.6691595315933228, -0.40665313601493835, -0.3201991617679596, -0.9211531281471252, 1.3759374618530273, -0.1334376484155655, 0.17948102951049805, 2.0176563262939453, -0.2444867640733719, -0.933223307132721, 1.1326900720596313, -2.3589231967926025, 0.2505476474761963, 1.987235426902771, 0.23084837198257446, 0.16773080825805664, -1.3784259557724, -0.7279816269874573, -0.27144086360931396, -0.41718319058418274, -1.2422878742218018, 0.5168993473052979, -0.17355376482009888, -0.9103612303733826, -1.4213346242904663, 0.12367069721221924, -1.1181304454803467, -1.7436002492904663, 0.27266618609428406, 1.8668286800384521, 2.040302276611328, -0.9713103175163269, 1.4520418643951416, -0.23853304982185364, 0.08048561215400696, 1.4051278829574585, 1.216471791267395, 3.197913646697998, 1.897682547569275, -1.2960847616195679, 0.778052806854248, -0.2202458530664444, -0.5767454504966736, 1.1499723196029663, -1.2191567420959473, 1.1566798686981201, -0.40228134393692017, -1.283043384552002, -1.2537320852279663, 1.0181952714920044, 0.4762595593929291, 0.025690793991088867, -0.5372699499130249, 1.2328921556472778, 0.18738006055355072, 1.34676194190979, 0.6197038292884827, -0.32362014055252075, 0.6480294466018677, -0.3993053734302521, -0.4670155346393585, 1.5766242742538452, 0.1639387011528015, -1.5275392532348633, -2.3291053771972656, -0.19296562671661377, -0.9676408767700195, -0.139795184135437, -0.7113794088363647, -1.1013014316558838, 1.6028274297714233, 0.44110068678855896, -1.154300332069397, -0.27245381474494934, -0.40615829825401306, -0.5963703393936157, 2.7572643756866455, -1.452392339706421, -0.19680777192115784, -0.9887804985046387, -0.5292776226997375, 1.6535789966583252, -1.1201210021972656, -0.15923342108726501, -1.0978151559829712, -0.5032619833946228, -1.2555204629898071, -0.4666789770126343, 0.02587277442216873, -0.7328768968582153, 0.814535915851593, 0.1019083559513092, -1.234681248664856, -0.2480131834745407, -0.9647976756095886, 0.8259528279304504, -0.2608053982257843, 0.19068361818790436, 1.8941481113433838, 0.3582773208618164, -0.34815114736557007, 0.7407037615776062, 1.1664608716964722, 0.6219936013221741, -0.6629363298416138, 0.2724510431289673, -0.5880939364433289, 0.38544926047325134, -1.351787805557251, 0.19829161465168, -2.8235819339752197, 0.6407554149627686, -0.0528205968439579, -0.05181412771344185, -0.13306564092636108, -1.4219001531600952, 1.090116024017334, 2.5420544147491455, -1.1448475122451782, 0.48606714606285095, 0.2793876826763153, 1.21445631980896, -1.7267611026763916, 0.22467276453971863, -0.5810747146606445, 2.065791368484497, 0.065627321600914, 1.2148529291152954, -0.463336318731308, -2.2789809703826904, 0.5680478811264038, -1.2125416994094849, -0.9847071766853333, 0.9659700989723206, -0.8599011898040771, 0.17742282152175903, -1.3885173797607422, -0.18928080797195435, -0.8897510766983032, -1.2672538757324219, 0.7093634009361267, 0.026108097285032272, 0.513455331325531, -0.5951362252235413, 0.34386736154556274, -2.153913974761963, -1.4768686294555664, -0.25206494331359863, -0.9729174375534058, 0.4850439727306366, -0.39766308665275574, 0.6733208894729614, -0.09215674549341202, 0.06497161090373993, 0.31524792313575745, 1.4062529802322388, 3.3135178089141846, 0.17443329095840454, 0.28665536642074585, -0.26048779487609863, -1.0439904928207397, 1.4993799924850464, 0.8254006505012512, -0.09765195846557617, -0.4956103563308716, -1.0052658319473267, 1.3157830238342285, 1.8618189096450806, 1.0950233936309814, -0.005138975568115711, -0.832674503326416, -0.7936168313026428, -0.01589926891028881, 0.18015176057815552, 0.42000913619995117, 0.9096869826316833, 0.011165126226842403, 0.05571460723876953, 1.2597033977508545, 1.1835033893585205, -0.427086740732193, 0.44668611884117126, -0.9236717224121094, -0.344455748796463, 0.48517248034477234, 0.28061896562576294, 0.11264257878065109, 0.40970128774642944, -0.9994702935218811, -0.3432115614414215, -0.31790924072265625, -0.894268274307251, -0.81163489818573, -0.5137472152709961, -0.34628403186798096, 1.6522371768951416, 0.05544906109571457, -0.5025621652603149, 0.08335172384977341, -0.7831771969795227, -0.10715323686599731, -1.1614701747894287, 0.15198571979999542, -0.17515696585178375, -0.06993477791547775, -0.05417943373322487, 1.7337032556533813, -1.0630652904510498, -2.153033971786499, 0.2764541208744049, 0.30302950739860535, -0.429514080286026, 0.1785537153482437, 1.7735896110534668, 0.4838527739048004, 1.3516818284988403, 1.3707681894302368, 1.0979939699172974, -0.7295118570327759, -1.2729475498199463, 0.6442784667015076, 1.0845694541931152, -1.3758538961410522, 0.9686614274978638, -0.1276988387107849, -0.5091171860694885, 0.522742509841919, 1.2728426456451416, 0.3762570917606354, -1.9373304843902588, 0.7251403331756592, -0.8813373446464539, 0.9052838087081909, 0.7258814573287964, 0.8671388030052185, 0.2484654188156128, 0.7961779832839966, -1.2009464502334595, -1.1446802616119385, -0.6446148753166199, -0.5699194073677063, 1.905968427658081, -0.238213449716568, 0.5164783000946045, -0.19944843649864197, -1.3159093856811523, 0.08347350358963013, 0.7867143154144287, 0.40535300970077515, -0.4980681836605072, 0.851468026638031, -0.617416262626648, -1.0134936571121216, -1.3408913612365723, -0.47224655747413635, -0.9838483929634094, -1.0429701805114746, 1.0107887983322144, 0.7672011256217957, 0.4859639108181, 1.9097696542739868, 0.7685394883155823, 0.26274651288986206, -2.586838960647583, 0.9442615509033203, 0.2879147231578827, -0.008672798052430153, 0.7684977054595947, 0.3047996461391449, 1.0482796430587769, -0.14394021034240723, 0.5616760849952698, -2.3343560695648193, 2.2935869693756104, -0.16269460320472717, 0.6294022798538208, -0.005257740616798401, -0.18539956212043762, 0.9854048490524292, 0.5299803018569946, 0.5009324550628662, -1.12252676486969, 0.8275191783905029, -0.6583057045936584, 1.0990914106369019, 0.8577435612678528, -0.9171179533004761, 0.06717192381620407, 1.342665672302246, 0.47804906964302063, -0.5499553084373474, -0.9139456152915955, -0.8227402567863464, 0.9506142139434814, 1.5927844047546387, 0.061893731355667114, 0.022250786423683167, 1.0043853521347046, 0.666904628276825, -1.2632943391799927, 0.1313505321741104, -0.6832430362701416, -0.6457690000534058, 1.8342212438583374, 1.989882230758667, -0.22009271383285522, -0.11381541937589645, -0.856755793094635, -1.2676994800567627, 0.7353501319885254, 0.0901104286313057, -0.01915232092142105, 0.6289726495742798, -0.6353005170822144, 1.2294420003890991, 0.603138267993927, 0.8520386219024658, 0.13628831505775452, 0.33922892808914185, 0.37820741534233093, -0.4857727587223053, -1.2087901830673218, -0.3241977393627167, -1.132609486579895, -2.5206403732299805, 0.4377918541431427, -0.2461930811405182, -1.3087319135665894, 0.03280290961265564, -1.0270799398422241, 0.9160956144332886, -0.6466661691665649, -1.0909770727157593, -1.4120010137557983, 0.351348340511322, -0.14439928531646729, 0.8681659698486328, -1.6039568185806274, -0.11930570006370544, 1.2622328996658325, 0.8952207565307617, -0.6874363422393799, 0.8517510294914246, 0.2626880407333374, 1.0223950147628784, 0.9251867532730103, -0.3153174817562103, 0.5243548154830933, 0.10726890712976456, -1.3647758960723877, 0.444805383682251, 1.2568163871765137, 0.13948719203472137, 1.5202900171279907, -0.48319390416145325, 0.032851751893758774, 0.36727890372276306, -0.4623625874519348, -0.5282644629478455, -0.6111048460006714, 0.7520094513893127, 0.044893089681863785, -1.0492299795150757, 0.05830659717321396, -0.06085819751024246, -0.04298381507396698, 0.239218607544899, -1.5200053453445435, -0.054367195814847946, -0.28684207797050476, -0.5589240193367004, -1.2929096221923828, -0.016590820625424385, 1.2053416967391968, -0.7406959533691406, -0.1830042600631714, 0.4168943464756012, 0.18780778348445892, 0.5283786058425903, 0.5231038928031921, -0.7486886382102966, -0.349163293838501, -0.23552681505680084, -0.30418428778648376, 0.31615161895751953, 1.178021788597107, -0.11519895493984222, -1.0145119428634644, 0.6637945175170898, -0.42089563608169556, 0.1437259316444397, 1.9883835315704346, 0.05979766696691513, -0.8270062208175659, 0.30977892875671387, -0.6521331071853638, 1.8082026243209839, 1.6875778436660767, 1.3033603429794312, -0.1166008710861206, -0.8799839019775391, 0.7503977417945862, -0.362277090549469, -0.34531843662261963, 0.8972224593162537, 0.4013825058937073, -0.21768641471862793, -1.4526855945587158, 0.5282816290855408, 1.4643715620040894, -0.823948323726654, -0.941309928894043, 0.15552538633346558, -0.9239320755004883, 1.2175782918930054, 0.6420350670814514, 0.35660693049430847, 0.2657806873321533, 1.5991710424423218, 0.6882919073104858, -0.44768598675727844, 0.5106548070907593, 0.47077977657318115, -0.1383395791053772, -2.097407102584839, -1.0940266847610474, 0.39130422472953796, -0.39690643548965454, -1.5258452892303467, 1.3885942697525024, -1.2567673921585083, -0.9697269797325134, 0.5473020076751709, 0.15428078174591064, 1.3866664171218872, 0.20352639257907867, 1.685264229774475, 2.0508134365081787, 0.8512228727340698, 0.36621078848838806, 1.1586624383926392, -0.09086444228887558, -0.4140271842479706, 1.739930510520935, -0.5516745448112488, 0.5821698904037476, 0.9769285917282104, -0.36259549856185913, -1.2805544137954712, -0.8144859075546265, -1.2293339967727661, -0.715738832950592, 1.2945582866668701, 0.1786874383687973, -1.1176649332046509, 0.32143089175224304, 1.6764342784881592, 0.052502986043691635, -0.28614363074302673, 0.7606421113014221, 0.45986711978912354, -0.7541875243186951, -0.027117721736431122, -0.9687865972518921, 0.5769141316413879, -0.10041749477386475, -0.20893937349319458, 0.3271847665309906, 0.5783073902130127, 1.3294063806533813, 0.0268496535718441, 0.12898920476436615, 1.2561933994293213, -1.329626202583313, 1.5023561716079712, -0.6943551898002625, 0.21843157708644867, -2.372530460357666, 1.3656977415084839, -0.7598901391029358, 1.914760708808899, -2.6386539936065674, 0.4139927625656128, -0.5431152582168579, -0.4668338894844055, 0.29803141951560974, -0.35474351048469543, 0.05853060632944107, -0.14881156384944916, -1.0397404432296753, -0.1326211392879486, -0.8117528557777405, 0.5695686340332031, 1.233526587486267, 1.4011529684066772, -1.0417532920837402, -0.2630899250507355, -1.7792648077011108, -0.1176832988858223, -0.7230885028839111, 0.32113412022590637, -1.9227066040039062, -0.1663922518491745, -2.0283567905426025, -2.368535041809082, -1.3276491165161133, -0.8180127143859863, 1.0664494037628174, 0.19800721108913422, -0.8473657965660095, 1.169477105140686, -0.3738788366317749, -1.8833608627319336, 1.1786928176879883, -2.0981569290161133 ]
https://github.com/huggingface/datasets/issues/4443
Dataset Viewer issue for openclimatefix/nimrod-uk-1km
Would anyone want to submit a Hub PR (or open a Discussion for the authors to be aware) to this dataset? https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km
### Link _No response_ ### Description _No response_ ### Owner _No response_
729
22
Dataset Viewer issue for openclimatefix/nimrod-uk-1km ### Link _No response_ ### Description _No response_ ### Owner _No response_ Would anyone want to submit a Hub PR (or open a Discussion for the authors to be aware) to this dataset? https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km
[ -1.136980414390564, -0.7029814720153809, -0.7743594646453857, 1.4730329513549805, -0.0780314952135086, -1.4468497037887573, 0.2404189258813858, -0.9028992652893066, 1.563198208808899, -0.792489767074585, 0.21237121522426605, -1.7242097854614258, 0.00796583667397499, -0.6439200043678284, -0.5471175312995911, -0.8959947824478149, -0.4595560133457184, -0.46639949083328247, 1.1461858749389648, 2.4972147941589355, 1.31985604763031, -1.3629727363586426, 2.915860891342163, 0.7623779773712158, -0.3446098864078522, -0.793860912322998, 0.48842063546180725, -0.00005375966429710388, -1.1530356407165527, -0.4443597197532654, -0.9432592391967773, -0.020126506686210632, -0.4847349226474762, -0.34813109040260315, 0.005467928014695644, 0.5787073969841003, -0.22463524341583252, -0.5309960842132568, -0.5828717350959778, -0.6814789175987244, 0.3149389326572418, -0.36569422483444214, 0.880894124507904, -0.4132916033267975, 1.8125348091125488, -0.6779569983482361, 0.43298059701919556, 0.5857126116752625, 1.243460774421692, 0.15275482833385468, 0.04565037041902542, 0.26564890146255493, 0.3362414836883545, -0.2107437252998352, 0.45869141817092896, 1.3328336477279663, 0.46433499455451965, 0.7281915545463562, 0.5608261823654175, -1.9874566793441772, 1.3557428121566772, -0.8043703436851501, 0.06244662031531334, 1.391914963722229, -1.1222047805786133, 0.574467122554779, -1.5283961296081543, -0.0906403511762619, 0.5303624868392944, -2.1862261295318604, 0.2098751962184906, -1.2653380632400513, -0.7177506685256958, 0.7589429616928101, 0.34033632278442383, -1.303566575050354, 0.020145688205957413, -0.5092946290969849, 1.1241544485092163, 0.42352181673049927, 1.1915310621261597, -1.5018237829208374, 0.12694986164569855, -0.24256622791290283, -0.14482563734054565, -1.3497906923294067, -1.53927481174469, 0.5824611186981201, 0.6435112953186035, 0.8546905517578125, 0.01282140240073204, 0.9471805691719055, -0.9320634007453918, 0.65446937084198, -0.842593252658844, -1.653435468673706, -1.428316593170166, -2.5542306900024414, -2.2966644763946533, 0.7969475388526917, -0.4232836961746216, -0.6416194438934326, 1.9664497375488281, -1.10543954372406, -1.803505539894104, 1.1911197900772095, 0.2394903153181076, 0.09532150626182556, 2.4627246856689453, 0.2778971493244171, -0.6088293790817261, 0.4340694844722748, -0.7927893400192261, 0.8452726006507874, -0.7283434271812439, 1.3510099649429321, 0.5028324723243713, -1.0576423406600952, 1.6271436214447021, -0.45078033208847046, 0.765910804271698, -0.6980131268501282, -0.41086506843566895, -0.8584940433502197, 0.3297502398490906, 1.8007616996765137, -0.3277615010738373, 1.7080227136611938, -0.3418985903263092, -1.4816961288452148, -1.5208408832550049, 0.8769433498382568, 0.36849114298820496, -0.8553783297538757, 0.31132248044013977, -0.44170182943344116, 0.0376766100525856, -0.02788638323545456, 1.0772244930267334, 1.3547770977020264, 0.5454370379447937, -0.3097567558288574, -0.772790253162384, 0.26231515407562256, -0.04978879913687706, -0.6450644731521606, -1.7734770774841309, -0.3083151578903198, 0.11177828907966614, 0.49392613768577576, -1.0825315713882446, 1.725670337677002, 0.8031061887741089, 1.9389982223510742, 1.03837251663208, -0.3133764863014221, 1.3937276601791382, -0.06459911167621613, 1.8100885152816772, -0.42261144518852234, 0.7191782593727112, -0.2704530358314514, -1.1155924797058105, 0.7567142844200134, -0.5256609320640564, -2.0261483192443848, -0.8251904249191284, -0.7762166261672974, -0.19841638207435608, -0.7641438245773315, 0.9322817325592041, -0.3815673291683197, -1.256873369216919, 0.106165811419487, -0.6777198910713196, 0.30419251322746277, -1.4380542039871216, 0.21330109238624573, 0.7753214836120605, -0.4935735762119293, -0.0868879109621048, -0.33976346254348755, -1.2251139879226685, -0.37497034668922424, 0.46441659331321716, 1.914565086364746, -0.6430328488349915, 0.9213213324546814, 0.8759955763816833, -0.6313604116439819, 0.03230315074324608, 0.2608192265033722, -0.20296461880207062, 0.8369904160499573, -1.2686350345611572, -0.41515976190567017, 1.1620993614196777, -0.22418908774852753, -0.611953616142273, 1.5063951015472412, 0.833746075630188, -0.9413782954216003, -0.22556665539741516, -0.22301900386810303, -0.9264660477638245, -0.08800184726715088, -1.5695183277130127, -0.11730436980724335, 0.22130368649959564, -1.4888118505477905, -0.5507006049156189, -0.28405046463012695, 1.350330114364624, -0.15877608954906464, 1.5019088983535767, -0.3173256516456604, -0.26557332277297974, -0.49801766872406006, -0.4784584045410156, 0.21913067996501923, -0.2529853582382202, -0.5980390906333923, 0.1011345237493515, -0.6914349794387817, 0.2703212797641754, 1.4897701740264893, 0.2628311216831207, 0.2276095449924469, 0.6308132410049438, 1.0578123331069946, 0.30156630277633667, -0.22203519940376282, -0.7908803820610046, -1.5766003131866455, 1.8714380264282227, -1.4157546758651733, 1.9444259405136108, 0.8358950018882751, -0.0452164001762867, -1.9209811687469482, -1.8931193351745605, 1.3583751916885376, 1.2122743129730225, 2.244058609008789, 0.5149163603782654, 0.3707190454006195, -0.9101449251174927, -0.8254572749137878, 0.200871080160141, -1.0241154432296753, -0.6362136006355286, 0.23055042326450348, 2.1456034183502197, 1.7746808528900146, -0.4141239821910858, -0.256528377532959, -1.1149828433990479, 1.3097790479660034, -0.12463979423046112, 0.14444664120674133, 1.8775262832641602, -0.4402052164077759, -0.7994160652160645, 0.9747902154922485, -2.3468685150146484, 0.1431514024734497, 2.033632516860962, 0.24370616674423218, 0.06793490052223206, -1.4209821224212646, -0.75468909740448, -0.2584392726421356, -0.28067001700401306, -1.2437725067138672, 0.6515639424324036, -0.24936315417289734, -0.8004958033561707, -1.410030722618103, 0.039614252746105194, -1.1179957389831543, -1.5474637746810913, 0.3874260485172272, 1.889106273651123, 2.0459117889404297, -0.8947545886039734, 1.4646954536437988, -0.08812813460826874, -0.045421309769153595, 1.3827558755874634, 1.132814645767212, 3.1539385318756104, 1.954614520072937, -1.2920634746551514, 0.8569449782371521, -0.038864001631736755, -0.523740291595459, 1.1054273843765259, -1.1949542760849, 1.3268290758132935, -0.4205241799354553, -1.226431965827942, -1.3474178314208984, 0.9627050161361694, 0.46723294258117676, 0.03032127022743225, -0.45881518721580505, 1.4195637702941895, -0.03935761749744415, 1.3281238079071045, 0.6019360423088074, -0.484559565782547, 0.5593074560165405, -0.4113176465034485, -0.4535052180290222, 1.485517978668213, 0.31706473231315613, -1.6443126201629639, -2.1787912845611572, -0.12846016883850098, -0.9253538846969604, -0.09930241107940674, -0.7860474586486816, -1.0879360437393188, 1.6780534982681274, 0.5721035599708557, -1.057567834854126, -0.4217945635318756, -0.26390430331230164, -0.6195734739303589, 2.812645435333252, -1.5065399408340454, -0.27001431584358215, -0.9046987891197205, -0.38970574736595154, 1.696691870689392, -1.1766502857208252, -0.20321209728717804, -1.0212916135787964, -0.6112006902694702, -1.1781790256500244, -0.36715564131736755, 0.0009817685931921005, -0.7881544232368469, 0.8798225522041321, -0.04383077844977379, -1.2266390323638916, -0.1248779147863388, -0.8117431998252869, 0.8805335760116577, -0.22842401266098022, 0.31072187423706055, 1.90354323387146, 0.23969900608062744, -0.4231838881969452, 0.7788587212562561, 1.2636439800262451, 0.5789839029312134, -0.7686456441879272, 0.05881069228053093, -0.62446129322052, 0.4855368137359619, -1.258836269378662, 0.22381317615509033, -2.9616057872772217, 0.5959203243255615, -0.1798839271068573, -0.11472664773464203, -0.15109780430793762, -1.4350842237472534, 1.0301411151885986, 2.502263307571411, -1.2833616733551025, 0.5313218235969543, 0.33580753207206726, 1.2871490716934204, -1.598189353942871, 0.4023263454437256, -0.672839879989624, 1.9771682024002075, 0.14229191839694977, 1.142234206199646, -0.42767223715782166, -2.1371684074401855, 0.6131612658500671, -1.1479499340057373, -0.9772019982337952, 0.9046338200569153, -0.9603545069694519, 0.07413776218891144, -1.356269121170044, -0.18572404980659485, -0.8416382670402527, -1.3266944885253906, 0.6049192547798157, 0.12249454855918884, 0.5099011063575745, -0.5260809063911438, 0.24785813689231873, -2.236107110977173, -1.3220716714859009, -0.3036790192127228, -0.8376709222793579, 0.3856314420700073, -0.5314189791679382, 0.6548764705657959, -0.1646786332130432, 0.1463358998298645, 0.11318738758563995, 1.3792353868484497, 3.2497811317443848, 0.08072197437286377, 0.34164851903915405, -0.275677889585495, -0.9456172585487366, 1.3639004230499268, 0.9097768068313599, -0.030963867902755737, -0.7295611500740051, -0.8866298794746399, 1.4300774335861206, 1.712220549583435, 1.0742536783218384, 0.1584843248128891, -0.8773160576820374, -0.4925220012664795, -0.11757533252239227, 0.12350904941558838, 0.33546310663223267, 1.0472743511199951, 0.01852598786354065, 0.1805976778268814, 1.352463722229004, 1.245983600616455, -0.4170662462711334, 0.45626431703567505, -0.8492316603660583, -0.2715795934200287, 0.49448540806770325, 0.3693964183330536, 0.011284556239843369, 0.33387503027915955, -0.9172001481056213, -0.3748961091041565, -0.3423570394515991, -0.9490846991539001, -0.8788406848907471, -0.4145592451095581, -0.40865835547447205, 1.62877357006073, 0.1757284253835678, -0.6022935509681702, -0.0740012377500534, -0.7795227766036987, -0.1799388825893402, -1.1755435466766357, 0.18658731877803802, -0.1865638941526413, 0.0016243765130639076, 0.027820877730846405, 1.7828946113586426, -1.201882243156433, -2.438509225845337, 0.21726103127002716, 0.25521087646484375, -0.30040693283081055, 0.0026023630052804947, 1.728808045387268, 0.43578600883483887, 1.4717942476272583, 1.2940672636032104, 1.0097378492355347, -0.8056132793426514, -1.1984893083572388, 0.6811003088951111, 1.0846893787384033, -1.4034576416015625, 0.8563181161880493, -0.08103837072849274, -0.5654981136322021, 0.6721770167350769, 1.0927579402923584, 0.4331745207309723, -1.9013924598693848, 0.7757468819618225, -1.0892857313156128, 0.9278338551521301, 0.8176698684692383, 0.8937767148017883, 0.4697873294353485, 0.9303699135780334, -1.2267171144485474, -1.2029842138290405, -0.7383378744125366, -0.5483821034431458, 2.04292631149292, -0.35354867577552795, 0.6117483377456665, -0.16739925742149353, -1.1802093982696533, 0.12567739188671112, 0.8014869689941406, 0.3014509379863739, -0.399554580450058, 0.7388917803764343, -0.6297770738601685, -0.97865891456604, -1.3550564050674438, -0.5539512038230896, -0.9731918573379517, -1.0908275842666626, 1.187017798423767, 0.7870192527770996, 0.442876398563385, 1.9000433683395386, 0.6800999641418457, 0.2970426082611084, -2.572997808456421, 0.8788773417472839, 0.2529675364494324, 0.13932467997074127, 0.7321245670318604, 0.3036266565322876, 1.0406160354614258, -0.006166250444948673, 0.4594826400279999, -2.3609683513641357, 2.2575247287750244, -0.2838205397129059, 0.6184866428375244, -0.15240603685379028, 0.05684683099389076, 1.1210405826568604, 0.4568043649196625, 0.5279964208602905, -1.1119040250778198, 0.7933804988861084, -0.38704389333724976, 1.15775465965271, 0.9456002712249756, -0.8613305687904358, 0.10449494421482086, 1.512676477432251, 0.4742775559425354, -0.4792439043521881, -0.8115725517272949, -0.7372400760650635, 0.916765034198761, 1.6930522918701172, 0.15328390896320343, 0.20186811685562134, 0.9688176512718201, 0.4785608947277069, -1.3068029880523682, 0.039239730685949326, -0.6240288019180298, -0.5295246839523315, 1.7652332782745361, 1.9289379119873047, -0.12481003999710083, 0.17103305459022522, -0.8693059682846069, -1.3205069303512573, 0.7263698577880859, 0.00006729923188686371, -0.03770098835229874, 0.7106950879096985, -0.6207478046417236, 1.1120867729187012, 0.44099920988082886, 0.85133957862854, 0.046201497316360474, 0.2780469059944153, 0.6070418357849121, -0.2331797331571579, -1.2281103134155273, -0.3600929379463196, -1.1193718910217285, -2.344562530517578, 0.2761348783969879, -0.47453299164772034, -1.4149558544158936, -0.015008628368377686, -1.0846953392028809, 1.0098094940185547, -0.6309654116630554, -1.1410953998565674, -1.6122087240219116, 0.13705439865589142, -0.17380084097385406, 0.8626325130462646, -1.4755401611328125, -0.20687170326709747, 1.1400253772735596, 0.8154451251029968, -0.7192177176475525, 1.0454765558242798, 0.26589763164520264, 0.9352934956550598, 0.8082940578460693, -0.30368125438690186, 0.4571770131587982, 0.03545675426721573, -1.363545298576355, 0.6524983048439026, 1.3439016342163086, 0.11360245943069458, 1.4188835620880127, -0.6807786226272583, -0.11037677526473999, 0.45470136404037476, -0.44111818075180054, -0.5534545183181763, -0.4126622974872589, 0.6996095180511475, 0.04256507009267807, -0.8634300827980042, -0.058942534029483795, -0.2480197697877884, -0.28778791427612305, 0.23084348440170288, -1.5473970174789429, -0.14365634322166443, -0.43801915645599365, -0.6633371710777283, -1.2769948244094849, 0.13903926312923431, 1.3075621128082275, -0.691670298576355, -0.3372132182121277, 0.4913516342639923, 0.43266957998275757, 0.5105569958686829, 0.5982115864753723, -0.7386287450790405, -0.10069595277309418, -0.23317138850688934, -0.24510103464126587, 0.37369513511657715, 1.2977834939956665, -0.2057231366634369, -1.064211368560791, 0.7068638205528259, -0.5075927376747131, 0.0891154557466507, 2.1043896675109863, 0.21788544952869415, -0.7723471522331238, 0.3662623465061188, -0.8257529735565186, 1.9542828798294067, 1.6277995109558105, 1.3452184200286865, 0.010782858356833458, -0.8266792893409729, 0.6858134269714355, -0.13118845224380493, -0.33687731623649597, 0.7624099850654602, 0.4166181683540344, -0.25090110301971436, -1.5463463068008423, 0.5271342396736145, 1.2979488372802734, -0.936206042766571, -0.9871072173118591, 0.035895366221666336, -0.9566653966903687, 1.2534408569335938, 0.6678776144981384, 0.4785393178462982, 0.24317583441734314, 1.7183421850204468, 0.6222223043441772, -0.5482988357543945, 0.3823293447494507, 0.5628705024719238, -0.00027238111943006516, -2.0292932987213135, -0.9233416318893433, 0.4254123866558075, -0.353145569562912, -1.4534651041030884, 1.2587580680847168, -1.1077979803085327, -1.1103272438049316, 0.5512936115264893, 0.22745291888713837, 1.460923433303833, 0.20667344331741333, 1.6533005237579346, 2.0743513107299805, 0.9019067883491516, 0.38488277792930603, 1.252380132675171, -0.3039351999759674, -0.3761090338230133, 1.8449875116348267, -0.4413406252861023, 0.5249584317207336, 1.0052204132080078, -0.4383307695388794, -1.1591590642929077, -0.6088734269142151, -1.182580590248108, -0.6002010107040405, 1.2299968004226685, 0.2599518597126007, -0.938880980014801, 0.21992790699005127, 1.4905383586883545, 0.09848892688751221, -0.30772244930267334, 0.6384280920028687, 0.5628646612167358, -0.7713174223899841, 0.0034125158563256264, -0.9834400415420532, 0.6478504538536072, -0.16019366681575775, -0.3558986485004425, 0.3784337043762207, 0.6184176206588745, 1.2870814800262451, -0.08097513020038605, 0.09641122817993164, 1.253460168838501, -1.3798656463623047, 1.3785786628723145, -0.565373957157135, -0.04093736782670021, -2.4580280780792236, 1.4785401821136475, -0.5487558841705322, 1.8556493520736694, -2.8348076343536377, 0.4571366608142853, -0.5721415281295776, -0.4661957919597626, 0.3999435305595398, -0.30876490473747253, -0.005019845440983772, -0.2281947284936905, -1.1212468147277832, 0.022872190922498703, -0.640078604221344, 0.5178715586662292, 1.2392522096633911, 1.1907243728637695, -1.1393659114837646, -0.16891910135746002, -1.669639229774475, -0.023407787084579468, -0.8348879218101501, 0.2926095426082611, -2.034679412841797, -0.1308278888463974, -1.8732361793518066, -2.4420783519744873, -1.3076647520065308, -0.7570410966873169, 1.0928072929382324, 0.30537405610084534, -0.9332574009895325, 1.314712643623352, -0.40330836176872253, -2.0047800540924072, 1.1687545776367188, -2.0740671157836914 ]
https://github.com/huggingface/datasets/issues/4443
Dataset Viewer issue for openclimatefix/nimrod-uk-1km
Hi, I'm the main author for that dataset, so I'll work on updating it! I was working on debugging some stuff awhile ago, which is what broke it.
### Link _No response_ ### Description _No response_ ### Owner _No response_
729
28
Dataset Viewer issue for openclimatefix/nimrod-uk-1km ### Link _No response_ ### Description _No response_ ### Owner _No response_ Hi, I'm the main author for that dataset, so I'll work on updating it! I was working on debugging some stuff awhile ago, which is what broke it.
[ -1.2320196628570557, -0.8533768057823181, -0.7731630802154541, 1.5190116167068481, -0.1375034600496292, -1.4120103120803833, 0.2922505736351013, -0.8675333261489868, 1.5794885158538818, -0.9737752676010132, 0.17083723843097687, -1.7540452480316162, -0.025137512013316154, -0.5199172496795654, -0.5528634190559387, -0.8812421560287476, -0.4152807593345642, -0.6667754054069519, 1.282456636428833, 2.490476608276367, 1.2887650728225708, -1.3377647399902344, 2.8533132076263428, 0.5954228639602661, -0.2833678126335144, -1.0500385761260986, 0.693510115146637, -0.001457255333662033, -1.072708249092102, -0.47217071056365967, -1.0105924606323242, -0.10111013054847717, -0.48994311690330505, -0.2726263999938965, -0.03549177199602127, 0.6054001450538635, -0.08680759370326996, -0.5994337201118469, -0.4027826189994812, -0.7393578290939331, 0.33698558807373047, -0.3622896373271942, 1.0382238626480103, -0.37850841879844666, 1.8887364864349365, -0.5313494205474854, 0.4360319674015045, 0.7327823638916016, 1.339059591293335, 0.20631064474582672, 0.02151738852262497, 0.013179694302380085, 0.463567316532135, -0.1619979739189148, 0.4645691215991974, 0.9767285585403442, 0.534027099609375, 0.6856352090835571, 0.639085054397583, -2.0135438442230225, 1.2896839380264282, -0.9610329866409302, 0.2793126404285431, 1.479004979133606, -1.1602375507354736, 0.5307374596595764, -1.619096279144287, -0.0362556166946888, 0.5980624556541443, -2.0479135513305664, 0.2615394592285156, -1.2719155550003052, -0.5362333655357361, 0.8643480539321899, 0.4066254198551178, -1.4557729959487915, -0.05315351486206055, -0.4371010661125183, 1.0507632493972778, 0.4779455363750458, 1.0707288980484009, -1.6709730625152588, 0.11014623939990997, -0.3072827160358429, -0.027111515402793884, -1.284278154373169, -1.5336673259735107, 0.48355740308761597, 0.6134905815124512, 0.8263609409332275, 0.0037227626889944077, 0.9718742966651917, -1.0438792705535889, 0.580152690410614, -0.9318248629570007, -1.628195881843567, -1.3451800346374512, -2.5367889404296875, -2.415102243423462, 0.7118678689002991, -0.48586562275886536, -0.5153265595436096, 2.078794240951538, -1.0426058769226074, -1.7419462203979492, 1.2018649578094482, 0.22905386984348297, 0.05447007343173027, 2.472879409790039, 0.2878134250640869, -0.7611988186836243, 0.49771207571029663, -0.8882264494895935, 0.8434953093528748, -0.7686735391616821, 1.3197112083435059, 0.4054078161716461, -0.9890148639678955, 1.6292994022369385, -0.41029760241508484, 0.8369060754776001, -0.6683247089385986, -0.3297255337238312, -0.8747174739837646, 0.30155372619628906, 1.8315171003341675, -0.2384347915649414, 1.5355957746505737, -0.37720441818237305, -1.5820318460464478, -1.5336109399795532, 0.940148651599884, 0.3343866467475891, -0.8838232159614563, 0.3691611886024475, -0.27474257349967957, 0.11763280630111694, -0.003912736661732197, 1.0828747749328613, 1.330087661743164, 0.6621308922767639, -0.3755403459072113, -0.9689487218856812, 0.23581716418266296, -0.19616107642650604, -0.7919976115226746, -1.7465749979019165, -0.4315526783466339, -0.11114294826984406, 0.6818402409553528, -1.0160255432128906, 1.6534045934677124, 0.8783199787139893, 1.8894318342208862, 0.9359902143478394, -0.34070083498954773, 1.3321952819824219, 0.12922435998916626, 1.8560165166854858, -0.4711152911186218, 0.68258136510849, -0.27661097049713135, -1.1202436685562134, 0.7177485823631287, -0.48497724533081055, -1.7337979078292847, -0.8736822009086609, -0.8176363706588745, -0.15696965157985687, -0.7639893889427185, 0.8692253828048706, -0.40900856256484985, -1.4141453504562378, 0.24333234131336212, -0.6552459597587585, 0.35290417075157166, -1.4832655191421509, 0.40172073245048523, 0.6876927018165588, -0.48152533173561096, 0.036202482879161835, -0.2956894040107727, -1.2982656955718994, -0.4933011829853058, 0.410701185464859, 1.9577112197875977, -0.6383869647979736, 1.0767875909805298, 0.7974071502685547, -0.7019140720367432, -0.06300516426563263, 0.32287392020225525, -0.26325130462646484, 0.7708825469017029, -1.2451900243759155, -0.5259104371070862, 1.268741250038147, -0.41581907868385315, -0.5981500148773193, 1.4117621183395386, 0.8653804659843445, -1.0296865701675415, -0.16757754981517792, -0.15189917385578156, -0.7932197451591492, 0.03089713305234909, -1.6337958574295044, -0.09385811537504196, 0.37896087765693665, -1.4895362854003906, -0.5969763994216919, -0.29705482721328735, 1.3365859985351562, -0.07697626203298569, 1.4140939712524414, -0.3045918643474579, -0.21629545092582703, -0.4536466598510742, -0.4247206747531891, 0.35201117396354675, -0.320120632648468, -0.4943264126777649, 0.07518862932920456, -0.7352990508079529, 0.2993507385253906, 1.5526434183120728, 0.1500723510980606, 0.03312589228153229, 0.5182703137397766, 1.1080832481384277, 0.19246768951416016, -0.05472888424992561, -0.8411657214164734, -1.3869668245315552, 1.8959548473358154, -1.4421448707580566, 1.9210916757583618, 0.8481279611587524, -0.16107305884361267, -1.7875477075576782, -1.8830372095108032, 1.3972151279449463, 1.2959139347076416, 2.1544127464294434, 0.5762602090835571, 0.3095514476299286, -0.8876335024833679, -0.7299523949623108, 0.02924126386642456, -1.0357590913772583, -0.6956697702407837, 0.16193775832653046, 2.2744991779327393, 1.647866129875183, -0.43523141741752625, -0.10753248631954193, -1.0364633798599243, 1.337842345237732, -0.17495767772197723, 0.2283933460712433, 1.9017302989959717, -0.4561513364315033, -0.8727468252182007, 0.9167028665542603, -2.3275375366210938, 0.22012901306152344, 2.119488000869751, 0.3476138114929199, 0.16529028117656708, -1.5058047771453857, -0.8362563252449036, -0.24527740478515625, -0.24613527953624725, -1.234617829322815, 0.7407381534576416, -0.34545961022377014, -0.779113233089447, -1.4776005744934082, 0.15009616315364838, -0.9883458614349365, -1.5673768520355225, 0.2912521958351135, 1.9298396110534668, 2.052788734436035, -0.9268917441368103, 1.5327942371368408, -0.06131376698613167, 0.09026766568422318, 1.3310493230819702, 1.0974698066711426, 3.0987541675567627, 1.8821985721588135, -1.1627323627471924, 0.7948322892189026, 0.026290681213140488, -0.5077572464942932, 1.209288239479065, -1.1800601482391357, 1.2314939498901367, -0.3463793396949768, -1.1947168111801147, -1.3363022804260254, 0.7949497699737549, 0.42538732290267944, -0.018786588683724403, -0.32064348459243774, 1.298122525215149, -0.005049712955951691, 1.3250173330307007, 0.5753101706504822, -0.39730164408683777, 0.7489911913871765, -0.4414163827896118, -0.3228655457496643, 1.543476939201355, 0.2968084514141083, -1.6434166431427002, -2.2300198078155518, -0.2884184718132019, -0.8473148941993713, 0.06527405232191086, -0.6975208520889282, -1.1029211282730103, 1.5528887510299683, 0.5427586436271667, -0.985838770866394, -0.4345172047615051, -0.27905213832855225, -0.6912583112716675, 2.746150016784668, -1.306553840637207, -0.35006052255630493, -0.8267329335212708, -0.5049521923065186, 1.6169019937515259, -1.335540533065796, -0.16196796298027039, -1.1685454845428467, -0.580322802066803, -1.1571598052978516, -0.34313786029815674, 0.034830011427402496, -0.8964903950691223, 0.9086931943893433, 0.16812150180339813, -1.2429500818252563, -0.175417959690094, -0.9290486574172974, 0.8452126979827881, -0.07108945399522781, 0.3305770754814148, 1.7593716382980347, 0.2743484675884247, -0.5043107867240906, 0.8054800033569336, 1.155092716217041, 0.5317424535751343, -0.7860361933708191, 0.09210969507694244, -0.5973869562149048, 0.38519802689552307, -1.1525025367736816, 0.23585145175457, -3.0428831577301025, 0.5401531457901001, -0.19583483040332794, -0.2873620092868805, -0.17099903523921967, -1.4840900897979736, 1.156409502029419, 2.435718059539795, -1.2303166389465332, 0.5801538228988647, 0.2861589193344116, 1.4670872688293457, -1.6589442491531372, 0.40945005416870117, -0.5655401945114136, 2.040893793106079, 0.17741866409778595, 1.1750935316085815, -0.4212198257446289, -2.387916088104248, 0.5803146958351135, -1.1821262836456299, -1.1190056800842285, 0.8042335510253906, -1.0499285459518433, 0.05365605279803276, -1.2413578033447266, -0.2503550946712494, -0.8006710410118103, -1.3199291229248047, 0.6973661184310913, 0.1101342961192131, 0.46112945675849915, -0.5334891676902771, 0.2729857861995697, -2.2230865955352783, -1.3442630767822266, -0.27855464816093445, -0.8516845703125, 0.2850750982761383, -0.5070218443870544, 0.650675356388092, -0.176762193441391, 0.0897529348731041, 0.12683813273906708, 1.5179376602172852, 3.253976345062256, 0.07531490176916122, 0.36498498916625977, -0.242909774184227, -0.9987319111824036, 1.4647923707962036, 0.9010727405548096, -0.10963106900453568, -0.5842488408088684, -0.932056725025177, 1.413001298904419, 1.818105697631836, 0.8820441365242004, -0.003655882552266121, -0.6500359773635864, -0.3785208463668823, -0.2474832832813263, 0.1540365368127823, 0.4535072147846222, 0.927853524684906, 0.030134212225675583, 0.06463126093149185, 1.2407810688018799, 1.03876531124115, -0.5183975100517273, 0.48859989643096924, -0.8350461721420288, -0.3407058119773865, 0.5455039739608765, 0.3211526870727539, -0.054399386048316956, 0.29814785718917847, -0.9476355910301208, -0.32016003131866455, -0.20862384140491486, -0.8978787660598755, -0.7743269205093384, -0.3777874708175659, -0.3839918375015259, 1.6138569116592407, 0.13071322441101074, -0.6860822439193726, -0.020467326045036316, -0.7205601334571838, -0.020710695534944534, -1.178349494934082, 0.0005788719281554222, -0.2901114821434021, -0.03613094985485077, 0.03169649839401245, 1.9368242025375366, -1.0963287353515625, -2.259369134902954, 0.12376441061496735, 0.31235364079475403, -0.12461995333433151, 0.06617968529462814, 1.661527395248413, 0.33936500549316406, 1.4641896486282349, 1.392652153968811, 1.0698100328445435, -0.8687006831169128, -1.2947900295257568, 0.7140832543373108, 1.0119470357894897, -1.296508550643921, 0.9293525218963623, -0.11364685744047165, -0.5289525389671326, 0.6618726849555969, 1.1311297416687012, 0.4484884440898895, -1.8298146724700928, 0.7963029742240906, -1.085897445678711, 1.0750627517700195, 0.8445870280265808, 0.9178767800331116, 0.394961953163147, 0.9543529748916626, -1.1678720712661743, -1.1825522184371948, -0.7961728572845459, -0.5842815637588501, 2.171424627304077, -0.3647547662258148, 0.6547203063964844, -0.084307461977005, -1.0530706644058228, -0.0049009923823177814, 0.7028008103370667, 0.3747631311416626, -0.26915571093559265, 0.7092930674552917, -0.6884766817092896, -1.083023190498352, -1.4581111669540405, -0.49590519070625305, -1.0752326250076294, -1.0847442150115967, 1.2004895210266113, 0.811640202999115, 0.4118289053440094, 1.857714295387268, 0.7373124361038208, 0.29596537351608276, -2.466839075088501, 0.8891430497169495, 0.28359153866767883, 0.03326261043548584, 0.6915253400802612, 0.41682517528533936, 1.1558583974838257, 0.1397734433412552, 0.46148136258125305, -2.3666021823883057, 2.2819981575012207, -0.36567384004592896, 0.6723009347915649, -0.04226240515708923, -0.0027424502186477184, 1.177511215209961, 0.5648024082183838, 0.55739825963974, -1.034342885017395, 0.7406401038169861, -0.4125531017780304, 1.2750898599624634, 0.9834022521972656, -0.8684900403022766, 0.1253160685300827, 1.5413837432861328, 0.49428677558898926, -0.5016911029815674, -0.9288980960845947, -0.8470675945281982, 0.9180312156677246, 1.609282374382019, 0.06885232776403427, 0.02903622016310692, 0.8192291259765625, 0.5804633498191833, -1.270248532295227, -0.10285182297229767, -0.6958812475204468, -0.6213083863258362, 1.7622736692428589, 2.04945707321167, -0.10296593606472015, 0.03231536224484444, -0.8649818897247314, -1.3314578533172607, 0.6796128153800964, -0.017115456983447075, -0.1654544472694397, 0.6884278059005737, -0.6125057935714722, 1.0169926881790161, 0.4710935056209564, 0.8333801031112671, 0.1988535374403, 0.14299392700195312, 0.56309574842453, -0.1824081987142563, -1.114297866821289, -0.2471732497215271, -1.2936513423919678, -2.50144362449646, 0.2887147068977356, -0.4109801948070526, -1.5553653240203857, 0.12182709574699402, -1.0636905431747437, 1.0015016794204712, -0.6459736824035645, -1.1478896141052246, -1.574021816253662, 0.009057148359715939, -0.16010388731956482, 0.8191909790039062, -1.6293797492980957, -0.05496072769165039, 1.2205899953842163, 0.8583230376243591, -0.6972987651824951, 1.0676360130310059, 0.3089330792427063, 1.0904567241668701, 0.7360881567001343, -0.31292834877967834, 0.5226653218269348, -0.07872233539819717, -1.3512539863586426, 0.7537326812744141, 1.3139463663101196, 0.13794471323490143, 1.5103509426116943, -0.525635302066803, -0.11889931559562683, 0.4985042214393616, -0.5505220890045166, -0.6228885650634766, -0.3668101727962494, 0.6770561933517456, 0.11976161599159241, -0.8309663534164429, 0.018362320959568024, -0.23852351307868958, -0.207037091255188, 0.3650071918964386, -1.6186124086380005, -0.32173675298690796, -0.481748104095459, -0.6369363069534302, -1.2996079921722412, 0.023484963923692703, 1.4553452730178833, -0.6190496683120728, -0.28141820430755615, 0.5008745193481445, 0.4773113429546356, 0.4061352014541626, 0.5466025471687317, -0.7178187966346741, -0.12271707504987717, -0.29203489422798157, -0.38477325439453125, 0.32586589455604553, 1.3582152128219604, -0.25138068199157715, -1.0015003681182861, 0.6153501272201538, -0.3468876779079437, 0.06958384811878204, 1.9495666027069092, 0.2671329975128174, -0.9320565462112427, 0.33428776264190674, -0.8300278782844543, 2.053642749786377, 1.4511597156524658, 1.3942252397537231, -0.014100227504968643, -0.864205539226532, 0.6249063611030579, -0.1588137000799179, -0.4225670099258423, 0.7203160524368286, 0.3478359282016754, -0.27447232604026794, -1.4279417991638184, 0.7076812386512756, 1.249076247215271, -0.7692747116088867, -0.9699532985687256, 0.10310440510511398, -0.9287034273147583, 1.1761016845703125, 0.6399067640304565, 0.5681101083755493, 0.1722182184457779, 1.7068346738815308, 0.7254723310470581, -0.5459045767784119, 0.4817124009132385, 0.563589334487915, 0.015357826836407185, -1.9818567037582397, -0.9808328151702881, 0.3264990746974945, -0.4458102583885193, -1.5012990236282349, 1.3845888376235962, -0.9111140370368958, -1.053642988204956, 0.5656676888465881, 0.20676568150520325, 1.4289214611053467, 0.42545729875564575, 1.5607715845108032, 1.9101133346557617, 0.9969709515571594, 0.40531161427497864, 1.2051634788513184, -0.39600738883018494, -0.5176189541816711, 1.897269606590271, -0.3124920427799225, 0.3690169155597687, 1.2310311794281006, -0.3987891376018524, -1.1669268608093262, -0.6133938431739807, -1.0620037317276, -0.5783753395080566, 1.136362075805664, 0.26064661145210266, -1.107721209526062, 0.23852236568927765, 1.4599800109863281, 0.14695397019386292, -0.3198634386062622, 0.7394669651985168, 0.5145595669746399, -0.7986561059951782, 0.08208747953176498, -0.9940219521522522, 0.4135248363018036, -0.32341909408569336, -0.48023590445518494, 0.5187417268753052, 0.68070387840271, 1.3255374431610107, -0.10989933460950851, 0.14907771348953247, 1.160500407218933, -1.4595599174499512, 1.3441187143325806, -0.6882620453834534, 0.03856121748685837, -2.3144047260284424, 1.3528741598129272, -0.5614985823631287, 1.8425272703170776, -2.8494622707366943, 0.42799678444862366, -0.7003366351127625, -0.48335203528404236, 0.2514197528362274, -0.40325677394866943, 0.00919435266405344, -0.2199055701494217, -1.175726056098938, 0.034080587327480316, -0.7712711095809937, 0.5359399318695068, 1.1156748533248901, 1.1336661577224731, -1.007302165031433, -0.15886105597019196, -1.5751738548278809, 0.026533860713243484, -0.7521515488624573, 0.2956629693508148, -2.0246095657348633, -0.27365073561668396, -1.8741214275360107, -2.208775281906128, -1.1442924737930298, -0.7967028021812439, 1.0753309726715088, 0.36545437574386597, -0.8954484462738037, 1.3842206001281738, -0.256162166595459, -1.8703980445861816, 1.0776642560958862, -2.126002788543701 ]
https://github.com/huggingface/datasets/issues/4443
Dataset Viewer issue for openclimatefix/nimrod-uk-1km
I've opened a Discussion page, so that we can ask/answer and propose fixes until the script works properly: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/discussions/1 CC: @julien-c @jacobbieker
### Link _No response_ ### Description _No response_ ### Owner _No response_
729
22
Dataset Viewer issue for openclimatefix/nimrod-uk-1km ### Link _No response_ ### Description _No response_ ### Owner _No response_ I've opened a Discussion page, so that we can ask/answer and propose fixes until the script works properly: https://huggingface.co/datasets/openclimatefix/nimrod-uk-1km/discussions/1 CC: @julien-c @jacobbieker
[ -1.1113334894180298, -0.7077827453613281, -0.8006747364997864, 1.5333449840545654, 0.0015936857089400291, -1.384235143661499, 0.22889678180217743, -0.9504249095916748, 1.5367778539657593, -0.7700194716453552, 0.21272481977939606, -1.6800824403762817, -0.10656748712062836, -0.68489670753479, -0.5280962586402893, -0.7803009152412415, -0.4056026041507721, -0.5932459235191345, 1.1450756788253784, 2.436343193054199, 1.326822280883789, -1.2614269256591797, 2.8943417072296143, 0.7398794889450073, -0.30719974637031555, -0.9409028887748718, 0.6029371023178101, -0.0757751390337944, -1.1633379459381104, -0.40271151065826416, -0.8857967853546143, -0.09536327421665192, -0.5639551877975464, -0.3060767948627472, -0.06471636146306992, 0.620653510093689, -0.15181487798690796, -0.4655557870864868, -0.5264075398445129, -0.8152251243591309, 0.35916081070899963, -0.3036327660083771, 0.819640576839447, -0.3898155987262726, 1.857657790184021, -0.6669749021530151, 0.3544982969760895, 0.6270133256912231, 1.370072841644287, 0.10509756952524185, 0.01979946345090866, 0.1685224175453186, 0.4189480245113373, -0.1650642454624176, 0.40341246128082275, 1.2788944244384766, 0.4779196083545685, 0.6072328686714172, 0.6420387625694275, -1.9669578075408936, 1.2942928075790405, -0.687000036239624, 0.15238186717033386, 1.4370787143707275, -1.1062695980072021, 0.46409836411476135, -1.586909294128418, -0.065257228910923, 0.4941616952419281, -2.1878252029418945, 0.19387158751487732, -1.2423359155654907, -0.6972911953926086, 0.7698746919631958, 0.37488722801208496, -1.3817565441131592, -0.023211505264043808, -0.4434945285320282, 1.1056164503097534, 0.4073156714439392, 1.2126222848892212, -1.5374130010604858, 0.0754127949476242, -0.2615039646625519, -0.11246364563703537, -1.3626418113708496, -1.4843982458114624, 0.4863469898700714, 0.6323664784431458, 0.8111302256584167, -0.10551707446575165, 0.9103320240974426, -0.9595838189125061, 0.6427611112594604, -0.8295918107032776, -1.6952879428863525, -1.4524863958358765, -2.590414524078369, -2.242593288421631, 0.7482470870018005, -0.4544191360473633, -0.5574630498886108, 2.006402015686035, -1.0147051811218262, -1.7956815958023071, 1.0985621213912964, 0.23666542768478394, 0.09394240379333496, 2.408658027648926, 0.34901443123817444, -0.6924377083778381, 0.39514946937561035, -0.8513004183769226, 0.7744808793067932, -0.6160659193992615, 1.4035601615905762, 0.5029575824737549, -0.9496573805809021, 1.5909404754638672, -0.47900405526161194, 0.6692706942558289, -0.7535322904586792, -0.3252614140510559, -0.8469716310501099, 0.26996973156929016, 1.7989277839660645, -0.2767556607723236, 1.6320078372955322, -0.23230868577957153, -1.5449243783950806, -1.4468778371810913, 0.8110466003417969, 0.331092894077301, -0.8187692761421204, 0.2785625457763672, -0.45974239706993103, 0.015084032900631428, -0.013085862621665001, 1.082950472831726, 1.3324733972549438, 0.6550798416137695, -0.35354918241500854, -0.8422986268997192, 0.21680526435375214, -0.014921984635293484, -0.7660619020462036, -1.7720003128051758, -0.25930508971214294, 0.10480839759111404, 0.5152767300605774, -1.2417877912521362, 1.7781931161880493, 0.8435447812080383, 2.0132088661193848, 0.9680776596069336, -0.35190147161483765, 1.3627136945724487, -0.0634818971157074, 1.880786418914795, -0.4122854769229889, 0.7014089226722717, -0.33706796169281006, -1.1110539436340332, 0.787616491317749, -0.49317485094070435, -1.9291582107543945, -0.8255924582481384, -0.9344046115875244, -0.15561504662036896, -0.8118648529052734, 0.9203227758407593, -0.4373639225959778, -1.277805209159851, 0.08285709470510483, -0.716616153717041, 0.3178870975971222, -1.5124506950378418, 0.1784467250108719, 0.7361196875572205, -0.5116064548492432, -0.14067122340202332, -0.3354123532772064, -1.2160460948944092, -0.4143172800540924, 0.5027341842651367, 1.9238518476486206, -0.6292884945869446, 0.9246014356613159, 0.9360601305961609, -0.6607819199562073, 0.151066392660141, 0.22822526097297668, -0.2941761016845703, 0.8370774984359741, -1.2384835481643677, -0.45933642983436584, 1.1292047500610352, -0.19230833649635315, -0.6409948468208313, 1.4880136251449585, 0.856510579586029, -0.9967718124389648, -0.18220490217208862, -0.2286093533039093, -0.8829687237739563, -0.052719976752996445, -1.6097533702850342, -0.08329177647829056, 0.23158863186836243, -1.4347392320632935, -0.5756344199180603, -0.1870737224817276, 1.4334355592727661, -0.14007070660591125, 1.4985737800598145, -0.32483378052711487, -0.13179469108581543, -0.5389691591262817, -0.43576693534851074, 0.30140674114227295, -0.26038146018981934, -0.6050605773925781, 0.18930228054523468, -0.8267179727554321, 0.22182726860046387, 1.50541090965271, 0.29358044266700745, 0.1820957511663437, 0.5663071870803833, 1.1272650957107544, 0.30255287885665894, -0.1279304325580597, -0.8016263246536255, -1.513144850730896, 1.9777601957321167, -1.3933167457580566, 1.9257447719573975, 0.8194643259048462, -0.05367523059248924, -1.8846583366394043, -1.9175318479537964, 1.3008049726486206, 1.1955740451812744, 2.240968704223633, 0.5025032162666321, 0.3468540608882904, -0.8521924018859863, -0.7936366200447083, 0.18090854585170746, -0.9751010537147522, -0.6092879176139832, 0.17220495641231537, 2.1848397254943848, 1.7412898540496826, -0.49576762318611145, -0.27849891781806946, -1.0200321674346924, 1.205344319343567, -0.17496579885482788, 0.16211648285388947, 1.9517855644226074, -0.3292611837387085, -0.873177707195282, 1.011631965637207, -2.300827980041504, 0.26202288269996643, 2.0714828968048096, 0.29276543855667114, 0.10905355215072632, -1.4273558855056763, -0.8047307133674622, -0.32038816809654236, -0.27910086512565613, -1.2810779809951782, 0.739423930644989, -0.2440437227487564, -0.9150466918945312, -1.3966227769851685, 0.05960455536842346, -1.0478264093399048, -1.7327214479446411, 0.4106805920600891, 1.9002981185913086, 2.038999319076538, -0.9028723835945129, 1.4346277713775635, -0.10662423074245453, -0.006162379402667284, 1.3282274007797241, 1.1192842721939087, 3.144394874572754, 1.880908489227295, -1.3291443586349487, 0.8389893770217896, -0.05641167610883713, -0.5463141798973083, 1.101466178894043, -1.1658263206481934, 1.2848358154296875, -0.44700613617897034, -1.2639381885528564, -1.2548996210098267, 0.9441308975219727, 0.46016815304756165, 0.06511072814464569, -0.4474671185016632, 1.3842004537582397, -0.010488267056643963, 1.3605130910873413, 0.6381460428237915, -0.3795849680900574, 0.5716378688812256, -0.3507596552371979, -0.43784669041633606, 1.5286600589752197, 0.28497591614723206, -1.669293761253357, -2.2685930728912354, -0.18296527862548828, -0.9163817167282104, -0.14684969186782837, -0.8010238409042358, -1.1205742359161377, 1.5647411346435547, 0.6292303800582886, -1.0331058502197266, -0.43888261914253235, -0.26582345366477966, -0.6487923860549927, 2.807595729827881, -1.4910554885864258, -0.2541028559207916, -0.911766529083252, -0.4080691337585449, 1.7496172189712524, -1.2428381443023682, -0.20495060086250305, -1.0873948335647583, -0.542943000793457, -1.1696960926055908, -0.34360843896865845, 0.03729325532913208, -0.8180822730064392, 0.7891339659690857, -0.006878728047013283, -1.1930099725723267, -0.19488288462162018, -0.9672616720199585, 0.9540536403656006, -0.21120409667491913, 0.23282457888126373, 1.8230090141296387, 0.3037475347518921, -0.4721185863018036, 0.8114230036735535, 1.2578874826431274, 0.5857677459716797, -0.7934728264808655, 0.0722310021519661, -0.526502251625061, 0.3532922565937042, -1.2825026512145996, 0.23233257234096527, -2.957883358001709, 0.593818724155426, -0.22310687601566315, -0.14171355962753296, -0.1473919302225113, -1.4680266380310059, 1.1982994079589844, 2.4482781887054443, -1.219451665878296, 0.5786944627761841, 0.31325191259384155, 1.3205995559692383, -1.6289910078048706, 0.36266565322875977, -0.6852921843528748, 2.004802942276001, 0.11736851185560226, 1.1844340562820435, -0.4307522773742676, -2.174468755722046, 0.6620709896087646, -1.2199320793151855, -0.911227285861969, 0.8779947757720947, -0.908847451210022, 0.17387527227401733, -1.3592736721038818, -0.19622169435024261, -0.8987738490104675, -1.2700344324111938, 0.5397410988807678, 0.15266036987304688, 0.42166656255722046, -0.6110134124755859, 0.22077104449272156, -2.20719313621521, -1.3751823902130127, -0.274065226316452, -0.8892980813980103, 0.3441353142261505, -0.5473964214324951, 0.6033828258514404, -0.14478899538516998, 0.10229591280221939, 0.19356553256511688, 1.3929728269577026, 3.22670316696167, 0.0981743112206459, 0.3635746240615845, -0.19597631692886353, -0.9787288308143616, 1.4426249265670776, 0.9164877533912659, -0.005868026055395603, -0.6356977820396423, -0.8504591584205627, 1.3798080682754517, 1.8293808698654175, 1.108468770980835, 0.011868131347000599, -0.7903885841369629, -0.5958173274993896, -0.12120944261550903, 0.20294418931007385, 0.4064368009567261, 1.0108894109725952, 0.001353229396045208, 0.07438398152589798, 1.3350666761398315, 1.1628658771514893, -0.4983362853527069, 0.4176083505153656, -0.9482847452163696, -0.306009441614151, 0.4639815390110016, 0.3754807710647583, 0.06371685862541199, 0.4105593264102936, -0.9455279111862183, -0.4223268926143646, -0.2104673534631729, -0.9276060461997986, -0.773512601852417, -0.4522896111011505, -0.476594477891922, 1.6357219219207764, 0.16562829911708832, -0.5903423428535461, -0.008190233260393143, -0.7355457544326782, -0.07217417657375336, -1.2210053205490112, 0.18322022259235382, -0.20981542766094208, 0.12057182937860489, 0.014671790413558483, 1.765588402748108, -1.1363918781280518, -2.4645845890045166, 0.24899406731128693, 0.2785354256629944, -0.3504626154899597, 0.029885433614253998, 1.7653987407684326, 0.4747672975063324, 1.4216101169586182, 1.3226319551467896, 1.118241786956787, -0.7651141285896301, -1.189239263534546, 0.7411039471626282, 1.042376160621643, -1.4035589694976807, 0.8665927648544312, -0.1513994038105011, -0.5603877902030945, 0.6302953958511353, 1.214772343635559, 0.3606548607349396, -1.9447332620620728, 0.8086692094802856, -0.9734921455383301, 0.9610710740089417, 0.8739274740219116, 0.9368257522583008, 0.440926730632782, 0.9096918106079102, -1.2871006727218628, -1.1978204250335693, -0.7536618709564209, -0.6147742867469788, 2.024216890335083, -0.2978416681289673, 0.5132995247840881, -0.21328556537628174, -1.1120716333389282, 0.07787948846817017, 0.7053790092468262, 0.19260570406913757, -0.38858312368392944, 0.7587295770645142, -0.6455631256103516, -1.052405834197998, -1.3802952766418457, -0.49988964200019836, -0.9448592066764832, -1.123680591583252, 1.1038447618484497, 0.7794660925865173, 0.5079445838928223, 1.9067739248275757, 0.7352548241615295, 0.2687208652496338, -2.4844064712524414, 0.9196453094482422, 0.28421229124069214, 0.15146681666374207, 0.6887323260307312, 0.3009687066078186, 1.1414382457733154, 0.041763413697481155, 0.4271811842918396, -2.4269649982452393, 2.293351888656616, -0.3024314343929291, 0.5857237577438354, -0.06048373505473137, -0.057262174785137177, 1.1740247011184692, 0.5701858401298523, 0.5466462969779968, -1.1520445346832275, 0.8536551594734192, -0.5141017436981201, 1.0774859189987183, 0.8654515743255615, -0.9007848501205444, 0.15705783665180206, 1.433342695236206, 0.5578054785728455, -0.5371972918510437, -0.8611392378807068, -0.6999484896659851, 0.9065186381340027, 1.5581591129302979, 0.1441168189048767, 0.12876275181770325, 0.9601866006851196, 0.5394218564033508, -1.2967034578323364, -0.02259126864373684, -0.6518439054489136, -0.5824390649795532, 1.827822208404541, 2.024264335632324, -0.19259509444236755, 0.10318142920732498, -0.8652865290641785, -1.3321597576141357, 0.7181576490402222, -0.06012517213821411, -0.047437213361263275, 0.6260706782341003, -0.6341521739959717, 1.101419448852539, 0.4419160783290863, 0.8236491680145264, -0.020683906972408295, 0.2918819189071655, 0.5943253040313721, -0.23382535576820374, -1.2248045206069946, -0.3020389974117279, -1.1812633275985718, -2.3544468879699707, 0.3246392607688904, -0.41816645860671997, -1.4304362535476685, 0.09363819658756256, -1.1140941381454468, 0.9962799549102783, -0.727601170539856, -1.0387591123580933, -1.4924067258834839, 0.2619568109512329, -0.17444245517253876, 0.7840547561645508, -1.549548864364624, -0.10277261584997177, 1.289154291152954, 0.834283709526062, -0.6922367811203003, 1.0259913206100464, 0.29374998807907104, 1.0393444299697876, 0.8124477863311768, -0.2833234965801239, 0.4447624683380127, 0.08987011015415192, -1.3456050157546997, 0.5825062990188599, 1.331072449684143, 0.09894371777772903, 1.3923693895339966, -0.5607463121414185, 0.024157192558050156, 0.4836304485797882, -0.4706604480743408, -0.5757314562797546, -0.47669047117233276, 0.6808889508247375, 0.12953947484493256, -0.9196142554283142, -0.0833246111869812, -0.2365982085466385, -0.26178058981895447, 0.39196333289146423, -1.58659827709198, -0.20365525782108307, -0.3895114064216614, -0.5815801620483398, -1.3367093801498413, 0.1054479107260704, 1.2843903303146362, -0.6602786183357239, -0.25509071350097656, 0.5159394145011902, 0.3007420003414154, 0.577865719795227, 0.6292133331298828, -0.7917414307594299, -0.11690180748701096, -0.2983977794647217, -0.22778789699077606, 0.3459201157093048, 1.2602254152297974, -0.202358216047287, -0.9987013936042786, 0.6745540499687195, -0.4793834388256073, 0.1910545974969864, 2.1825637817382812, 0.1367214471101761, -0.778484582901001, 0.3571814298629761, -0.8658274412155151, 1.9890459775924683, 1.5950087308883667, 1.3029543161392212, -0.0019843378104269505, -0.8485299944877625, 0.6254096031188965, -0.13388709723949432, -0.31256741285324097, 0.7344375252723694, 0.45112791657447815, -0.28054872155189514, -1.5174401998519897, 0.4973536431789398, 1.3156613111495972, -0.9078050851821899, -0.9703523516654968, 0.06818407028913498, -0.9460616707801819, 1.273038625717163, 0.682900071144104, 0.4767385423183441, 0.30965274572372437, 1.6027876138687134, 0.6678740978240967, -0.5895748734474182, 0.34369099140167236, 0.5030785799026489, 0.02255825698375702, -1.9729424715042114, -0.9032406806945801, 0.45766526460647583, -0.3489082157611847, -1.4680025577545166, 1.2777148485183716, -1.113099455833435, -1.0636653900146484, 0.5278292298316956, 0.23721405863761902, 1.4205595254898071, 0.36936649680137634, 1.607885479927063, 2.068294048309326, 0.8790419697761536, 0.39492470026016235, 1.2092013359069824, -0.22666729986667633, -0.4391295313835144, 1.7788141965866089, -0.34899961948394775, 0.49038931727409363, 0.993248462677002, -0.38509601354599, -1.2173099517822266, -0.7557101249694824, -1.1127222776412964, -0.5817896127700806, 1.2816115617752075, 0.32366764545440674, -1.053066372871399, 0.20152080059051514, 1.5202360153198242, 0.11530567705631256, -0.33243846893310547, 0.7189757823944092, 0.46806204319000244, -0.7839764952659607, -0.012795720249414444, -1.069932460784912, 0.5981525778770447, -0.1487303525209427, -0.33971458673477173, 0.40069031715393066, 0.7034338712692261, 1.2591274976730347, -0.07332730293273926, 0.185393288731575, 1.2836769819259644, -1.359262466430664, 1.4608538150787354, -0.6068606376647949, 0.07189566642045975, -2.381500005722046, 1.401634693145752, -0.5404101610183716, 1.8821690082550049, -2.7658729553222656, 0.42941826581954956, -0.5763147473335266, -0.5018712878227234, 0.38198891282081604, -0.40468692779541016, 0.0008338745683431625, -0.18565234541893005, -1.1112525463104248, -0.012122118845582008, -0.7340561151504517, 0.48667678236961365, 1.2857319116592407, 1.2243692874908447, -1.0181962251663208, -0.2099044919013977, -1.7092127799987793, -0.08505580574274063, -0.7772322297096252, 0.3216809630393982, -2.005769968032837, -0.12459521740674973, -1.9011890888214111, -2.3344666957855225, -1.3140318393707275, -0.8396310210227966, 1.0926578044891357, 0.3219633102416992, -0.8525012731552124, 1.2831979990005493, -0.31009426712989807, -1.9184036254882812, 1.1088074445724487, -2.0860838890075684 ]
https://github.com/huggingface/datasets/issues/4439
TIMIT won't load after manual download: Errors about files that don't exist
To have some context, please see: - #4145 Please, also note that we have recently made some fixes to the script, which are in our GitHub master branch but not yet released: - #4422 - #4425 - #4436
## Describe the bug I get the message from HuggingFace that it must be downloaded manually. From the URL provided in the message, I got to UPenn page for manual download. (UPenn apparently want $250? for the dataset??) ...So, ok, I obtained a copy from a friend and also a smaller version from Kaggle. But in both cases the HF dataloader fails; it is looking for files that don't exist anywhere in the dataset: it is looking for files with lower-case letters like "**test*" (all the filenames in both my copies are uppercase) and certain file extensions that exclude the .DOC which is provided in TIMIT: ## Steps to reproduce the bug ```python data = load_dataset('timit_asr', 'clean')['train'] ``` ## Expected results The dataset should load with no errors. ## Actual results This error message: ``` File "/home/ubuntu/envs/data2vec/lib/python3.9/site-packages/datasets/data_files.py", line 201, in resolve_patterns_locally_or_by_urls raise FileNotFoundError(error_msg) FileNotFoundError: Unable to resolve any data file that matches '['**test*', '**eval*']' at /home/ubuntu/datasets/timit with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` But this is a strange sort of error: why is it looking for lower-case file names when all the TIMIT dataset filenames are uppercase? Why does it exclude .DOC files when the only parts of the TIMIT data set with "TEST" in them have ".DOC" extensions? ...I wonder, how was anyone able to get this to work in the first place? The files in the dataset look like the following: ``` ³ PHONCODE.DOC ³ PROMPTS.TXT ³ SPKRINFO.TXT ³ SPKRSENT.TXT ³ TESTSET.DOC ``` ...so why are these being excluded by the dataset loader? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1060-aws-x86_64-with-glibc2.27 - Python version: 3.9.9 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
732
38
TIMIT won't load after manual download: Errors about files that don't exist ## Describe the bug I get the message from HuggingFace that it must be downloaded manually. From the URL provided in the message, I got to UPenn page for manual download. (UPenn apparently want $250? for the dataset??) ...So, ok, I obtained a copy from a friend and also a smaller version from Kaggle. But in both cases the HF dataloader fails; it is looking for files that don't exist anywhere in the dataset: it is looking for files with lower-case letters like "**test*" (all the filenames in both my copies are uppercase) and certain file extensions that exclude the .DOC which is provided in TIMIT: ## Steps to reproduce the bug ```python data = load_dataset('timit_asr', 'clean')['train'] ``` ## Expected results The dataset should load with no errors. ## Actual results This error message: ``` File "/home/ubuntu/envs/data2vec/lib/python3.9/site-packages/datasets/data_files.py", line 201, in resolve_patterns_locally_or_by_urls raise FileNotFoundError(error_msg) FileNotFoundError: Unable to resolve any data file that matches '['**test*', '**eval*']' at /home/ubuntu/datasets/timit with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` But this is a strange sort of error: why is it looking for lower-case file names when all the TIMIT dataset filenames are uppercase? Why does it exclude .DOC files when the only parts of the TIMIT data set with "TEST" in them have ".DOC" extensions? ...I wonder, how was anyone able to get this to work in the first place? The files in the dataset look like the following: ``` ³ PHONCODE.DOC ³ PROMPTS.TXT ³ SPKRINFO.TXT ³ SPKRSENT.TXT ³ TESTSET.DOC ``` ...so why are these being excluded by the dataset loader? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1060-aws-x86_64-with-glibc2.27 - Python version: 3.9.9 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 To have some context, please see: - #4145 Please, also note that we have recently made some fixes to the script, which are in our GitHub master branch but not yet released: - #4422 - #4425 - #4436
[ -1.2092194557189941, -1.09916353225708, -0.7991034984588623, 1.659130334854126, -0.23792819678783417, -1.1105786561965942, 0.008354252204298973, -0.9388540387153625, 1.6038144826889038, -0.7046318054199219, 0.0936746746301651, -1.7402209043502808, -0.15552416443824768, -0.7209328413009644, -0.6171408295631409, -0.789310872554779, -0.21809200942516327, -0.8990737199783325, 1.1200047731399536, 2.3567607402801514, 1.0073444843292236, -1.5354866981506348, 2.8089828491210938, 0.7012159824371338, -0.08951058983802795, -1.1385047435760498, 0.5750123262405396, -0.09988671541213989, -1.037184476852417, -0.5584052801132202, -0.9757896661758423, 0.09059770405292511, -0.6433587074279785, -0.30813169479370117, 0.06394274532794952, 0.465253621339798, -0.24056211113929749, -0.49393752217292786, -0.5488629937171936, -0.6380028128623962, 0.3790743350982666, -0.46709442138671875, 0.9368727207183838, -0.2454601377248764, 1.777475118637085, -0.3784841001033783, 0.24552059173583984, 0.6512373685836792, 1.4118168354034424, 0.23139691352844238, 0.14573051035404205, 0.33620506525039673, 0.3310754597187042, -0.0381578654050827, 0.6041749119758606, 1.1620254516601562, 0.6214415431022644, 0.39477357268333435, 0.8144632577896118, -2.388749361038208, 1.2772870063781738, -1.1560189723968506, 0.318368136882782, 1.3314710855484009, -0.8239879608154297, 0.6246005892753601, -1.7508870363235474, 0.14642179012298584, 0.6578723788261414, -2.174730062484741, 0.41641712188720703, -1.1800974607467651, -0.35186949372291565, 0.7859175205230713, 0.34385496377944946, -1.2833871841430664, 0.25285157561302185, -0.4157954752445221, 1.0866246223449707, 0.31646469235420227, 0.9816744923591614, -1.764826774597168, 0.052063919603824615, -0.1920180767774582, 0.1482553780078888, -1.2826671600341797, -1.5997737646102905, 0.5825706124305725, 0.5926257371902466, 0.6988129615783691, -0.1516309678554535, 0.9915952682495117, -1.208814024925232, 0.6216449737548828, -1.0155504941940308, -1.6150866746902466, -1.3037391901016235, -2.3347394466400146, -2.22320294380188, 0.7783908247947693, -0.480811208486557, -0.4824464023113251, 2.0409083366394043, -0.8456682562828064, -1.810716986656189, 1.2744075059890747, 0.43659716844558716, 0.14048634469509125, 2.4703173637390137, 0.14704689383506775, -0.7727996110916138, 0.44374555349349976, -0.8757089376449585, 0.8762209415435791, -0.44619786739349365, 1.4544029235839844, 0.38017940521240234, -0.8058536648750305, 1.7509803771972656, -0.45730990171432495, 0.6001707911491394, -0.5826203227043152, -0.53497713804245, -0.83638995885849, 0.31045714020729065, 1.9506181478500366, -0.19331520795822144, 1.4525229930877686, -0.4893830120563507, -1.5158672332763672, -1.5321681499481201, 0.9836907982826233, 0.27958452701568604, -1.0195866823196411, 0.0891939029097557, -0.3949703276157379, 0.28843942284584045, -0.22910179197788239, 1.1582770347595215, 1.2601912021636963, 0.5351148247718811, -0.299125075340271, -0.9402719736099243, 0.1413813829421997, -0.3093754053115845, -0.6436750888824463, -1.8805729150772095, -0.28915929794311523, 0.17307820916175842, 0.7371931672096252, -1.3065084218978882, 1.5903980731964111, 0.8538467884063721, 1.9312647581100464, 0.9726617336273193, -0.4732060730457306, 1.5096575021743774, 0.11721907556056976, 1.790653109550476, -0.7001440525054932, 0.5979230999946594, -0.4949548840522766, -1.1242549419403076, 0.8870415091514587, -0.32251453399658203, -1.862413763999939, -0.7836341857910156, -0.8939196467399597, -0.33017152547836304, -0.7459279298782349, 0.8093533515930176, -0.5191386342048645, -1.4974024295806885, 0.26131582260131836, -0.6420435905456543, 0.4113009572029114, -1.1209261417388916, 0.253348171710968, 0.7766588926315308, -0.5439253449440002, 0.1047167032957077, -0.3193281590938568, -1.3910131454467773, -0.4970490634441376, 0.5381519794464111, 1.900920033454895, -0.6522611975669861, 0.7681813836097717, 0.9896129369735718, -0.7284762263298035, -0.034998372197151184, 0.24759697914123535, -0.18913210928440094, 0.7354859113693237, -0.9766380190849304, -0.7338990569114685, 1.2033843994140625, -0.321175217628479, -0.6062990427017212, 1.3231201171875, 0.86246657371521, -1.1249111890792847, -0.299129456281662, -0.19993004202842712, -0.8545604348182678, -0.025975795462727547, -1.5782623291015625, -0.25401267409324646, 0.456497460603714, -1.5847408771514893, -0.45054134726524353, -0.38052353262901306, 1.1675238609313965, -0.09795825928449631, 1.3548296689987183, -0.3785282075405121, -0.19250455498695374, -0.07763054221868515, -0.6155608892440796, 0.3422902226448059, -0.360042005777359, -0.5691567659378052, 0.011911006644368172, -0.8065339922904968, 0.4281242787837982, 1.4677993059158325, 0.30430418252944946, -0.0469137579202652, 0.5507975816726685, 1.1572823524475098, 0.5265190601348877, 0.18994560837745667, -0.8874846696853638, -1.4302642345428467, 1.9286484718322754, -1.628777027130127, 1.9342654943466187, 0.5922849774360657, -0.010277933441102505, -1.7321269512176514, -1.8337254524230957, 1.3916946649551392, 1.190900206565857, 2.150865316390991, 0.6415542364120483, 0.36560681462287903, -0.9620648622512817, -0.6938142776489258, 0.11934542655944824, -0.8773738145828247, -0.6887314915657043, 0.11116736382246017, 2.430148124694824, 1.862323522567749, -0.5257430672645569, -0.2410542070865631, -0.9060433506965637, 1.5214756727218628, -0.385064959526062, 0.41073673963546753, 1.9992175102233887, -0.26740145683288574, -1.014293909072876, 1.2853981256484985, -2.5603408813476562, 0.23154793679714203, 2.0447118282318115, 0.24694421887397766, 0.21293160319328308, -1.4015518426895142, -0.7594953179359436, -0.18353448808193207, -0.31834715604782104, -1.2803032398223877, 0.5505691766738892, -0.32283905148506165, -0.6953548789024353, -1.5789095163345337, 0.2484213411808014, -1.1563801765441895, -1.521307110786438, 0.24712994694709778, 2.0857656002044678, 2.2097585201263428, -0.8256853222846985, 1.6320215463638306, -0.1308952271938324, 0.27683648467063904, 1.3257174491882324, 1.1810275316238403, 2.930947780609131, 1.7814041376113892, -1.1059281826019287, 0.5545892715454102, -0.19337725639343262, -0.4937325417995453, 1.1504380702972412, -1.042474627494812, 1.0588160753250122, -0.12995214760303497, -1.0569626092910767, -1.214971661567688, 0.8773706555366516, 0.4391177296638489, -0.028835372999310493, -0.37994682788848877, 1.1899462938308716, -0.04331350326538086, 1.2179418802261353, 0.6724183559417725, -0.42369556427001953, 0.3472295105457306, -0.3928488492965698, -0.61403888463974, 1.5830520391464233, 0.09596608579158783, -1.485244870185852, -2.1531026363372803, -0.30668577551841736, -0.7485930323600769, 0.04574749618768692, -0.521342396736145, -1.0635995864868164, 1.4600245952606201, 0.2911466956138611, -1.0370815992355347, -0.1993875950574875, -0.31300416588783264, -0.490535706281662, 2.6318390369415283, -1.3436930179595947, -0.4553610384464264, -0.9420580267906189, -0.5495873689651489, 1.6616191864013672, -1.081748604774475, -0.13889631628990173, -0.9963341355323792, -0.5586535930633545, -1.3954895734786987, -0.4764508306980133, -0.02427142672240734, -0.9373582005500793, 0.9151737093925476, 0.43609753251075745, -1.1268445253372192, -0.28795841336250305, -0.9389960765838623, 0.9905164241790771, -0.15560683608055115, 0.3194882571697235, 1.901955246925354, 0.3007678985595703, -0.34727582335472107, 0.9604578614234924, 1.1177095174789429, 0.6563518643379211, -0.6225849390029907, 0.08671728521585464, -0.4974292814731598, 0.44173166155815125, -1.4156264066696167, 0.17456986010074615, -2.9385292530059814, 0.5804385542869568, -0.0662950798869133, -0.16836762428283691, 0.037534162402153015, -1.382577896118164, 1.1512069702148438, 2.455639362335205, -1.2504507303237915, 0.5388336181640625, 0.3529294431209564, 1.526861548423767, -1.6970546245574951, 0.27177757024765015, -0.37317419052124023, 2.2219784259796143, 0.03451751172542572, 1.1744261980056763, -0.5052415132522583, -2.5360326766967773, 0.5231098532676697, -1.2762484550476074, -1.0543622970581055, 0.5137742161750793, -0.9454726576805115, 0.18099291622638702, -1.6943436861038208, -0.2737662196159363, -0.9294615387916565, -1.2637104988098145, 0.7506516575813293, 0.1579807847738266, 0.21610940992832184, -0.628754734992981, 0.39098551869392395, -2.0721819400787354, -1.499853253364563, -0.13492107391357422, -0.9118029475212097, 0.6598941087722778, -0.4327595829963684, 0.6779497861862183, -0.16168946027755737, 0.03253798931837082, 0.11260045319795609, 1.585423231124878, 3.4634041786193848, 0.15189360082149506, 0.377582848072052, -0.15752629935741425, -0.8918988108634949, 1.4240268468856812, 0.9719491600990295, -0.18211877346038818, -0.4719596207141876, -1.1956878900527954, 1.4757635593414307, 2.090113401412964, 0.8701180219650269, 0.02997351624071598, -0.5944274067878723, -0.5768197178840637, -0.0353531576693058, 0.24123701453208923, 0.580316960811615, 0.8179198503494263, 0.002520977519452572, 0.019375324249267578, 1.283092737197876, 1.1859196424484253, -0.40444186329841614, 0.2898508608341217, -0.9119479060173035, -0.3842131793498993, 0.5294319987297058, 0.07261663675308228, -0.15892137587070465, 0.34511929750442505, -1.0111277103424072, -0.2991909980773926, -0.3514270484447479, -0.8515684604644775, -0.6902168393135071, -0.343573659658432, -0.316617876291275, 1.547861099243164, 0.4221416413784027, -0.7342420220375061, -0.04022213816642761, -0.5204334259033203, -0.039491988718509674, -1.042061448097229, -0.012138956226408482, -0.24724654853343964, -0.15118134021759033, -0.22462764382362366, 1.7423268556594849, -0.880088746547699, -2.033273220062256, -0.024755286052823067, 0.5228889584541321, -0.058310262858867645, 0.21778224408626556, 1.6979471445083618, 0.40900102257728577, 1.5075790882110596, 1.4128351211547852, 0.9935727119445801, -0.6106582283973694, -1.3359133005142212, 0.5960367918014526, 1.0061283111572266, -1.2802386283874512, 0.8821502923965454, -0.005161621607840061, -0.6169265508651733, 0.6516554355621338, 1.504245638847351, 0.4094897210597992, -2.034409761428833, 0.8455997109413147, -1.1620982885360718, 0.8558318614959717, 0.783821702003479, 0.8334211111068726, 0.3735869228839874, 0.8048407435417175, -1.1907672882080078, -1.1422123908996582, -0.9134975075721741, -0.7579280138015747, 1.9650596380233765, -0.3195130228996277, 0.539377748966217, 0.05237763375043869, -1.2456942796707153, -0.14372636377811432, 0.693793773651123, 0.44203394651412964, -0.34610170125961304, 0.825663149356842, -0.8136340975761414, -1.224107027053833, -1.3547638654708862, -0.48916444182395935, -0.9841649532318115, -1.0147346258163452, 0.9538853168487549, 0.890268087387085, 0.32024914026260376, 1.8780373334884644, 0.6067994236946106, 0.13170945644378662, -2.4405338764190674, 0.9915951490402222, 0.3175618052482605, -0.17825457453727722, 0.7546594738960266, 0.33670774102211, 1.1829502582550049, 0.08168189972639084, 0.5352609753608704, -2.2066731452941895, 2.1449196338653564, -0.16071073710918427, 0.7946195602416992, -0.16695384681224823, -0.05896400660276413, 1.1018458604812622, 0.43586382269859314, 0.595585286617279, -0.9636216163635254, 0.6398953199386597, -0.5356218814849854, 1.230294942855835, 1.0759516954421997, -0.7724555730819702, 0.024003418162465096, 1.3983350992202759, 0.3703949451446533, -0.768531084060669, -1.0178207159042358, -0.8394889235496521, 0.8870512843132019, 1.7111139297485352, -0.167899489402771, -0.03733796626329422, 0.8227918148040771, 0.59074866771698, -1.2390005588531494, 0.0185766089707613, -0.5798653364181519, -0.5989104509353638, 1.745418667793274, 1.9933135509490967, -0.31813663244247437, -0.09054221212863922, -0.727462887763977, -1.339119553565979, 0.5424662232398987, 0.02993217296898365, 0.027466891333460808, 0.7358772158622742, -0.6754112243652344, 0.9681513905525208, 0.6301854252815247, 0.8816794753074646, 0.074166439473629, 0.37226781249046326, 0.5267731547355652, -0.4545086622238159, -1.0799802541732788, -0.2859382927417755, -1.217210292816162, -2.4851186275482178, 0.35462671518325806, -0.11723118275403976, -1.4142663478851318, 0.060512974858284, -0.915043830871582, 1.1845134496688843, -0.5564892292022705, -1.2282781600952148, -1.3779720067977905, 0.3049037456512451, -0.0295674167573452, 0.8341749310493469, -1.7388349771499634, -0.06643911451101303, 1.2725378274917603, 0.994398832321167, -0.7023364305496216, 1.1360623836517334, 0.3346561789512634, 1.0814390182495117, 0.6521047353744507, -0.3357534408569336, 0.5359832644462585, -0.13892266154289246, -1.2581095695495605, 0.5389041304588318, 1.1917566061019897, 0.10395128279924393, 1.308124303817749, -0.483857661485672, -0.13762779533863068, 0.4603007733821869, -0.6310995221138, -0.397659033536911, -0.3008139133453369, 0.5525573492050171, 0.013108666986227036, -0.7748396396636963, -0.03633950650691986, 0.08731759339570999, -0.33656102418899536, 0.14048385620117188, -1.5652745962142944, -0.3712708353996277, -0.44875332713127136, -0.39465656876564026, -1.3131930828094482, -0.01705484837293625, 1.4160516262054443, -0.5415269732475281, -0.39279091358184814, 0.5891852974891663, 0.454509437084198, 0.3898113965988159, 0.5723462104797363, -0.6827567219734192, -0.28237035870552063, -0.2026558518409729, -0.3088698387145996, 0.2538243532180786, 1.3335955142974854, -0.1758650839328766, -1.0490710735321045, 0.6057167649269104, -0.36503568291664124, -0.0031971391290426254, 1.7457610368728638, -0.08105189353227615, -0.8469750285148621, 0.24227702617645264, -0.8168084025382996, 1.9858267307281494, 1.6854193210601807, 1.19801926612854, -0.2109571397304535, -0.8030754923820496, 0.7022755742073059, -0.2990437150001526, -0.34527838230133057, 0.7648997902870178, 0.41512370109558105, -0.19535426795482635, -1.4238547086715698, 0.7554963827133179, 1.1810426712036133, -0.8147250413894653, -0.7866709232330322, 0.19260834157466888, -0.8008904457092285, 1.2010694742202759, 0.6431951522827148, 0.3669377863407135, 0.186105415225029, 1.7696369886398315, 0.8286763429641724, -0.5417739152908325, 0.6404298543930054, 0.5985738039016724, -0.31323370337486267, -2.0950496196746826, -1.2178354263305664, 0.08438912779092789, -0.42476728558540344, -1.6848472356796265, 1.3142268657684326, -0.9942269325256348, -0.8033600449562073, 0.5374333262443542, 0.11293374001979828, 1.2426903247833252, 0.4966928958892822, 1.3421800136566162, 2.017554759979248, 0.7025101184844971, 0.5388800501823425, 1.2284657955169678, -0.2713193893432617, -0.5841702818870544, 1.919426441192627, -0.3652491569519043, 0.5658981800079346, 1.166698694229126, -0.3245934247970581, -1.066861629486084, -0.6633636355400085, -1.208227515220642, -0.5539637804031372, 1.0905076265335083, 0.09060903638601303, -1.1207107305526733, 0.2520955204963684, 1.4993447065353394, 0.09019766002893448, -0.43238338828086853, 0.7230780720710754, 0.5216166973114014, -0.8551818132400513, -0.07922735065221786, -0.9004516005516052, 0.5242947340011597, -0.25845515727996826, -0.19307318329811096, 0.4274342954158783, 0.4523855149745941, 1.3706618547439575, 0.05362764000892639, 0.2171739935874939, 1.0750445127487183, -1.4204518795013428, 1.553470492362976, -0.7118616104125977, 0.3294628858566284, -2.424752950668335, 1.2549633979797363, -0.708514392375946, 2.1485679149627686, -2.5972867012023926, 0.40165087580680847, -0.6737127304077148, -0.48012909293174744, 0.29571351408958435, -0.33453840017318726, 0.030347222462296486, -0.021971970796585083, -1.0673367977142334, 0.10910001397132874, -0.6278384327888489, 0.43258029222488403, 1.185060977935791, 1.3815124034881592, -1.059017300605774, -0.1279398798942566, -1.7198492288589478, -0.19631919264793396, -0.8041257858276367, 0.3614470660686493, -2.1046230792999268, -0.3107926845550537, -1.8562781810760498, -2.2138824462890625, -1.2687623500823975, -0.7908322811126709, 1.168379783630371, 0.04629862308502197, -0.9642203450202942, 1.5064479112625122, -0.2032945156097412, -1.7583889961242676, 1.068968415260315, -1.983134150505066 ]
https://github.com/huggingface/datasets/issues/4439
TIMIT won't load after manual download: Errors about files that don't exist
Thanks Albert! I'll try pulling `datasets` from the git repo instead of PyPI, and/or just wait for the next release.
## Describe the bug I get the message from HuggingFace that it must be downloaded manually. From the URL provided in the message, I got to UPenn page for manual download. (UPenn apparently want $250? for the dataset??) ...So, ok, I obtained a copy from a friend and also a smaller version from Kaggle. But in both cases the HF dataloader fails; it is looking for files that don't exist anywhere in the dataset: it is looking for files with lower-case letters like "**test*" (all the filenames in both my copies are uppercase) and certain file extensions that exclude the .DOC which is provided in TIMIT: ## Steps to reproduce the bug ```python data = load_dataset('timit_asr', 'clean')['train'] ``` ## Expected results The dataset should load with no errors. ## Actual results This error message: ``` File "/home/ubuntu/envs/data2vec/lib/python3.9/site-packages/datasets/data_files.py", line 201, in resolve_patterns_locally_or_by_urls raise FileNotFoundError(error_msg) FileNotFoundError: Unable to resolve any data file that matches '['**test*', '**eval*']' at /home/ubuntu/datasets/timit with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` But this is a strange sort of error: why is it looking for lower-case file names when all the TIMIT dataset filenames are uppercase? Why does it exclude .DOC files when the only parts of the TIMIT data set with "TEST" in them have ".DOC" extensions? ...I wonder, how was anyone able to get this to work in the first place? The files in the dataset look like the following: ``` ³ PHONCODE.DOC ³ PROMPTS.TXT ³ SPKRINFO.TXT ³ SPKRSENT.TXT ³ TESTSET.DOC ``` ...so why are these being excluded by the dataset loader? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1060-aws-x86_64-with-glibc2.27 - Python version: 3.9.9 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
732
20
TIMIT won't load after manual download: Errors about files that don't exist ## Describe the bug I get the message from HuggingFace that it must be downloaded manually. From the URL provided in the message, I got to UPenn page for manual download. (UPenn apparently want $250? for the dataset??) ...So, ok, I obtained a copy from a friend and also a smaller version from Kaggle. But in both cases the HF dataloader fails; it is looking for files that don't exist anywhere in the dataset: it is looking for files with lower-case letters like "**test*" (all the filenames in both my copies are uppercase) and certain file extensions that exclude the .DOC which is provided in TIMIT: ## Steps to reproduce the bug ```python data = load_dataset('timit_asr', 'clean')['train'] ``` ## Expected results The dataset should load with no errors. ## Actual results This error message: ``` File "/home/ubuntu/envs/data2vec/lib/python3.9/site-packages/datasets/data_files.py", line 201, in resolve_patterns_locally_or_by_urls raise FileNotFoundError(error_msg) FileNotFoundError: Unable to resolve any data file that matches '['**test*', '**eval*']' at /home/ubuntu/datasets/timit with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` But this is a strange sort of error: why is it looking for lower-case file names when all the TIMIT dataset filenames are uppercase? Why does it exclude .DOC files when the only parts of the TIMIT data set with "TEST" in them have ".DOC" extensions? ...I wonder, how was anyone able to get this to work in the first place? The files in the dataset look like the following: ``` ³ PHONCODE.DOC ³ PROMPTS.TXT ³ SPKRINFO.TXT ³ SPKRSENT.TXT ³ TESTSET.DOC ``` ...so why are these being excluded by the dataset loader? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1060-aws-x86_64-with-glibc2.27 - Python version: 3.9.9 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Thanks Albert! I'll try pulling `datasets` from the git repo instead of PyPI, and/or just wait for the next release.
[ -1.2092194557189941, -1.09916353225708, -0.7991034984588623, 1.659130334854126, -0.23792819678783417, -1.1105786561965942, 0.008354252204298973, -0.9388540387153625, 1.6038144826889038, -0.7046318054199219, 0.0936746746301651, -1.7402209043502808, -0.15552416443824768, -0.7209328413009644, -0.6171408295631409, -0.789310872554779, -0.21809200942516327, -0.8990737199783325, 1.1200047731399536, 2.3567607402801514, 1.0073444843292236, -1.5354866981506348, 2.8089828491210938, 0.7012159824371338, -0.08951058983802795, -1.1385047435760498, 0.5750123262405396, -0.09988671541213989, -1.037184476852417, -0.5584052801132202, -0.9757896661758423, 0.09059770405292511, -0.6433587074279785, -0.30813169479370117, 0.06394274532794952, 0.465253621339798, -0.24056211113929749, -0.49393752217292786, -0.5488629937171936, -0.6380028128623962, 0.3790743350982666, -0.46709442138671875, 0.9368727207183838, -0.2454601377248764, 1.777475118637085, -0.3784841001033783, 0.24552059173583984, 0.6512373685836792, 1.4118168354034424, 0.23139691352844238, 0.14573051035404205, 0.33620506525039673, 0.3310754597187042, -0.0381578654050827, 0.6041749119758606, 1.1620254516601562, 0.6214415431022644, 0.39477357268333435, 0.8144632577896118, -2.388749361038208, 1.2772870063781738, -1.1560189723968506, 0.318368136882782, 1.3314710855484009, -0.8239879608154297, 0.6246005892753601, -1.7508870363235474, 0.14642179012298584, 0.6578723788261414, -2.174730062484741, 0.41641712188720703, -1.1800974607467651, -0.35186949372291565, 0.7859175205230713, 0.34385496377944946, -1.2833871841430664, 0.25285157561302185, -0.4157954752445221, 1.0866246223449707, 0.31646469235420227, 0.9816744923591614, -1.764826774597168, 0.052063919603824615, -0.1920180767774582, 0.1482553780078888, -1.2826671600341797, -1.5997737646102905, 0.5825706124305725, 0.5926257371902466, 0.6988129615783691, -0.1516309678554535, 0.9915952682495117, -1.208814024925232, 0.6216449737548828, -1.0155504941940308, -1.6150866746902466, -1.3037391901016235, -2.3347394466400146, -2.22320294380188, 0.7783908247947693, -0.480811208486557, -0.4824464023113251, 2.0409083366394043, -0.8456682562828064, -1.810716986656189, 1.2744075059890747, 0.43659716844558716, 0.14048634469509125, 2.4703173637390137, 0.14704689383506775, -0.7727996110916138, 0.44374555349349976, -0.8757089376449585, 0.8762209415435791, -0.44619786739349365, 1.4544029235839844, 0.38017940521240234, -0.8058536648750305, 1.7509803771972656, -0.45730990171432495, 0.6001707911491394, -0.5826203227043152, -0.53497713804245, -0.83638995885849, 0.31045714020729065, 1.9506181478500366, -0.19331520795822144, 1.4525229930877686, -0.4893830120563507, -1.5158672332763672, -1.5321681499481201, 0.9836907982826233, 0.27958452701568604, -1.0195866823196411, 0.0891939029097557, -0.3949703276157379, 0.28843942284584045, -0.22910179197788239, 1.1582770347595215, 1.2601912021636963, 0.5351148247718811, -0.299125075340271, -0.9402719736099243, 0.1413813829421997, -0.3093754053115845, -0.6436750888824463, -1.8805729150772095, -0.28915929794311523, 0.17307820916175842, 0.7371931672096252, -1.3065084218978882, 1.5903980731964111, 0.8538467884063721, 1.9312647581100464, 0.9726617336273193, -0.4732060730457306, 1.5096575021743774, 0.11721907556056976, 1.790653109550476, -0.7001440525054932, 0.5979230999946594, -0.4949548840522766, -1.1242549419403076, 0.8870415091514587, -0.32251453399658203, -1.862413763999939, -0.7836341857910156, -0.8939196467399597, -0.33017152547836304, -0.7459279298782349, 0.8093533515930176, -0.5191386342048645, -1.4974024295806885, 0.26131582260131836, -0.6420435905456543, 0.4113009572029114, -1.1209261417388916, 0.253348171710968, 0.7766588926315308, -0.5439253449440002, 0.1047167032957077, -0.3193281590938568, -1.3910131454467773, -0.4970490634441376, 0.5381519794464111, 1.900920033454895, -0.6522611975669861, 0.7681813836097717, 0.9896129369735718, -0.7284762263298035, -0.034998372197151184, 0.24759697914123535, -0.18913210928440094, 0.7354859113693237, -0.9766380190849304, -0.7338990569114685, 1.2033843994140625, -0.321175217628479, -0.6062990427017212, 1.3231201171875, 0.86246657371521, -1.1249111890792847, -0.299129456281662, -0.19993004202842712, -0.8545604348182678, -0.025975795462727547, -1.5782623291015625, -0.25401267409324646, 0.456497460603714, -1.5847408771514893, -0.45054134726524353, -0.38052353262901306, 1.1675238609313965, -0.09795825928449631, 1.3548296689987183, -0.3785282075405121, -0.19250455498695374, -0.07763054221868515, -0.6155608892440796, 0.3422902226448059, -0.360042005777359, -0.5691567659378052, 0.011911006644368172, -0.8065339922904968, 0.4281242787837982, 1.4677993059158325, 0.30430418252944946, -0.0469137579202652, 0.5507975816726685, 1.1572823524475098, 0.5265190601348877, 0.18994560837745667, -0.8874846696853638, -1.4302642345428467, 1.9286484718322754, -1.628777027130127, 1.9342654943466187, 0.5922849774360657, -0.010277933441102505, -1.7321269512176514, -1.8337254524230957, 1.3916946649551392, 1.190900206565857, 2.150865316390991, 0.6415542364120483, 0.36560681462287903, -0.9620648622512817, -0.6938142776489258, 0.11934542655944824, -0.8773738145828247, -0.6887314915657043, 0.11116736382246017, 2.430148124694824, 1.862323522567749, -0.5257430672645569, -0.2410542070865631, -0.9060433506965637, 1.5214756727218628, -0.385064959526062, 0.41073673963546753, 1.9992175102233887, -0.26740145683288574, -1.014293909072876, 1.2853981256484985, -2.5603408813476562, 0.23154793679714203, 2.0447118282318115, 0.24694421887397766, 0.21293160319328308, -1.4015518426895142, -0.7594953179359436, -0.18353448808193207, -0.31834715604782104, -1.2803032398223877, 0.5505691766738892, -0.32283905148506165, -0.6953548789024353, -1.5789095163345337, 0.2484213411808014, -1.1563801765441895, -1.521307110786438, 0.24712994694709778, 2.0857656002044678, 2.2097585201263428, -0.8256853222846985, 1.6320215463638306, -0.1308952271938324, 0.27683648467063904, 1.3257174491882324, 1.1810275316238403, 2.930947780609131, 1.7814041376113892, -1.1059281826019287, 0.5545892715454102, -0.19337725639343262, -0.4937325417995453, 1.1504380702972412, -1.042474627494812, 1.0588160753250122, -0.12995214760303497, -1.0569626092910767, -1.214971661567688, 0.8773706555366516, 0.4391177296638489, -0.028835372999310493, -0.37994682788848877, 1.1899462938308716, -0.04331350326538086, 1.2179418802261353, 0.6724183559417725, -0.42369556427001953, 0.3472295105457306, -0.3928488492965698, -0.61403888463974, 1.5830520391464233, 0.09596608579158783, -1.485244870185852, -2.1531026363372803, -0.30668577551841736, -0.7485930323600769, 0.04574749618768692, -0.521342396736145, -1.0635995864868164, 1.4600245952606201, 0.2911466956138611, -1.0370815992355347, -0.1993875950574875, -0.31300416588783264, -0.490535706281662, 2.6318390369415283, -1.3436930179595947, -0.4553610384464264, -0.9420580267906189, -0.5495873689651489, 1.6616191864013672, -1.081748604774475, -0.13889631628990173, -0.9963341355323792, -0.5586535930633545, -1.3954895734786987, -0.4764508306980133, -0.02427142672240734, -0.9373582005500793, 0.9151737093925476, 0.43609753251075745, -1.1268445253372192, -0.28795841336250305, -0.9389960765838623, 0.9905164241790771, -0.15560683608055115, 0.3194882571697235, 1.901955246925354, 0.3007678985595703, -0.34727582335472107, 0.9604578614234924, 1.1177095174789429, 0.6563518643379211, -0.6225849390029907, 0.08671728521585464, -0.4974292814731598, 0.44173166155815125, -1.4156264066696167, 0.17456986010074615, -2.9385292530059814, 0.5804385542869568, -0.0662950798869133, -0.16836762428283691, 0.037534162402153015, -1.382577896118164, 1.1512069702148438, 2.455639362335205, -1.2504507303237915, 0.5388336181640625, 0.3529294431209564, 1.526861548423767, -1.6970546245574951, 0.27177757024765015, -0.37317419052124023, 2.2219784259796143, 0.03451751172542572, 1.1744261980056763, -0.5052415132522583, -2.5360326766967773, 0.5231098532676697, -1.2762484550476074, -1.0543622970581055, 0.5137742161750793, -0.9454726576805115, 0.18099291622638702, -1.6943436861038208, -0.2737662196159363, -0.9294615387916565, -1.2637104988098145, 0.7506516575813293, 0.1579807847738266, 0.21610940992832184, -0.628754734992981, 0.39098551869392395, -2.0721819400787354, -1.499853253364563, -0.13492107391357422, -0.9118029475212097, 0.6598941087722778, -0.4327595829963684, 0.6779497861862183, -0.16168946027755737, 0.03253798931837082, 0.11260045319795609, 1.585423231124878, 3.4634041786193848, 0.15189360082149506, 0.377582848072052, -0.15752629935741425, -0.8918988108634949, 1.4240268468856812, 0.9719491600990295, -0.18211877346038818, -0.4719596207141876, -1.1956878900527954, 1.4757635593414307, 2.090113401412964, 0.8701180219650269, 0.02997351624071598, -0.5944274067878723, -0.5768197178840637, -0.0353531576693058, 0.24123701453208923, 0.580316960811615, 0.8179198503494263, 0.002520977519452572, 0.019375324249267578, 1.283092737197876, 1.1859196424484253, -0.40444186329841614, 0.2898508608341217, -0.9119479060173035, -0.3842131793498993, 0.5294319987297058, 0.07261663675308228, -0.15892137587070465, 0.34511929750442505, -1.0111277103424072, -0.2991909980773926, -0.3514270484447479, -0.8515684604644775, -0.6902168393135071, -0.343573659658432, -0.316617876291275, 1.547861099243164, 0.4221416413784027, -0.7342420220375061, -0.04022213816642761, -0.5204334259033203, -0.039491988718509674, -1.042061448097229, -0.012138956226408482, -0.24724654853343964, -0.15118134021759033, -0.22462764382362366, 1.7423268556594849, -0.880088746547699, -2.033273220062256, -0.024755286052823067, 0.5228889584541321, -0.058310262858867645, 0.21778224408626556, 1.6979471445083618, 0.40900102257728577, 1.5075790882110596, 1.4128351211547852, 0.9935727119445801, -0.6106582283973694, -1.3359133005142212, 0.5960367918014526, 1.0061283111572266, -1.2802386283874512, 0.8821502923965454, -0.005161621607840061, -0.6169265508651733, 0.6516554355621338, 1.504245638847351, 0.4094897210597992, -2.034409761428833, 0.8455997109413147, -1.1620982885360718, 0.8558318614959717, 0.783821702003479, 0.8334211111068726, 0.3735869228839874, 0.8048407435417175, -1.1907672882080078, -1.1422123908996582, -0.9134975075721741, -0.7579280138015747, 1.9650596380233765, -0.3195130228996277, 0.539377748966217, 0.05237763375043869, -1.2456942796707153, -0.14372636377811432, 0.693793773651123, 0.44203394651412964, -0.34610170125961304, 0.825663149356842, -0.8136340975761414, -1.224107027053833, -1.3547638654708862, -0.48916444182395935, -0.9841649532318115, -1.0147346258163452, 0.9538853168487549, 0.890268087387085, 0.32024914026260376, 1.8780373334884644, 0.6067994236946106, 0.13170945644378662, -2.4405338764190674, 0.9915951490402222, 0.3175618052482605, -0.17825457453727722, 0.7546594738960266, 0.33670774102211, 1.1829502582550049, 0.08168189972639084, 0.5352609753608704, -2.2066731452941895, 2.1449196338653564, -0.16071073710918427, 0.7946195602416992, -0.16695384681224823, -0.05896400660276413, 1.1018458604812622, 0.43586382269859314, 0.595585286617279, -0.9636216163635254, 0.6398953199386597, -0.5356218814849854, 1.230294942855835, 1.0759516954421997, -0.7724555730819702, 0.024003418162465096, 1.3983350992202759, 0.3703949451446533, -0.768531084060669, -1.0178207159042358, -0.8394889235496521, 0.8870512843132019, 1.7111139297485352, -0.167899489402771, -0.03733796626329422, 0.8227918148040771, 0.59074866771698, -1.2390005588531494, 0.0185766089707613, -0.5798653364181519, -0.5989104509353638, 1.745418667793274, 1.9933135509490967, -0.31813663244247437, -0.09054221212863922, -0.727462887763977, -1.339119553565979, 0.5424662232398987, 0.02993217296898365, 0.027466891333460808, 0.7358772158622742, -0.6754112243652344, 0.9681513905525208, 0.6301854252815247, 0.8816794753074646, 0.074166439473629, 0.37226781249046326, 0.5267731547355652, -0.4545086622238159, -1.0799802541732788, -0.2859382927417755, -1.217210292816162, -2.4851186275482178, 0.35462671518325806, -0.11723118275403976, -1.4142663478851318, 0.060512974858284, -0.915043830871582, 1.1845134496688843, -0.5564892292022705, -1.2282781600952148, -1.3779720067977905, 0.3049037456512451, -0.0295674167573452, 0.8341749310493469, -1.7388349771499634, -0.06643911451101303, 1.2725378274917603, 0.994398832321167, -0.7023364305496216, 1.1360623836517334, 0.3346561789512634, 1.0814390182495117, 0.6521047353744507, -0.3357534408569336, 0.5359832644462585, -0.13892266154289246, -1.2581095695495605, 0.5389041304588318, 1.1917566061019897, 0.10395128279924393, 1.308124303817749, -0.483857661485672, -0.13762779533863068, 0.4603007733821869, -0.6310995221138, -0.397659033536911, -0.3008139133453369, 0.5525573492050171, 0.013108666986227036, -0.7748396396636963, -0.03633950650691986, 0.08731759339570999, -0.33656102418899536, 0.14048385620117188, -1.5652745962142944, -0.3712708353996277, -0.44875332713127136, -0.39465656876564026, -1.3131930828094482, -0.01705484837293625, 1.4160516262054443, -0.5415269732475281, -0.39279091358184814, 0.5891852974891663, 0.454509437084198, 0.3898113965988159, 0.5723462104797363, -0.6827567219734192, -0.28237035870552063, -0.2026558518409729, -0.3088698387145996, 0.2538243532180786, 1.3335955142974854, -0.1758650839328766, -1.0490710735321045, 0.6057167649269104, -0.36503568291664124, -0.0031971391290426254, 1.7457610368728638, -0.08105189353227615, -0.8469750285148621, 0.24227702617645264, -0.8168084025382996, 1.9858267307281494, 1.6854193210601807, 1.19801926612854, -0.2109571397304535, -0.8030754923820496, 0.7022755742073059, -0.2990437150001526, -0.34527838230133057, 0.7648997902870178, 0.41512370109558105, -0.19535426795482635, -1.4238547086715698, 0.7554963827133179, 1.1810426712036133, -0.8147250413894653, -0.7866709232330322, 0.19260834157466888, -0.8008904457092285, 1.2010694742202759, 0.6431951522827148, 0.3669377863407135, 0.186105415225029, 1.7696369886398315, 0.8286763429641724, -0.5417739152908325, 0.6404298543930054, 0.5985738039016724, -0.31323370337486267, -2.0950496196746826, -1.2178354263305664, 0.08438912779092789, -0.42476728558540344, -1.6848472356796265, 1.3142268657684326, -0.9942269325256348, -0.8033600449562073, 0.5374333262443542, 0.11293374001979828, 1.2426903247833252, 0.4966928958892822, 1.3421800136566162, 2.017554759979248, 0.7025101184844971, 0.5388800501823425, 1.2284657955169678, -0.2713193893432617, -0.5841702818870544, 1.919426441192627, -0.3652491569519043, 0.5658981800079346, 1.166698694229126, -0.3245934247970581, -1.066861629486084, -0.6633636355400085, -1.208227515220642, -0.5539637804031372, 1.0905076265335083, 0.09060903638601303, -1.1207107305526733, 0.2520955204963684, 1.4993447065353394, 0.09019766002893448, -0.43238338828086853, 0.7230780720710754, 0.5216166973114014, -0.8551818132400513, -0.07922735065221786, -0.9004516005516052, 0.5242947340011597, -0.25845515727996826, -0.19307318329811096, 0.4274342954158783, 0.4523855149745941, 1.3706618547439575, 0.05362764000892639, 0.2171739935874939, 1.0750445127487183, -1.4204518795013428, 1.553470492362976, -0.7118616104125977, 0.3294628858566284, -2.424752950668335, 1.2549633979797363, -0.708514392375946, 2.1485679149627686, -2.5972867012023926, 0.40165087580680847, -0.6737127304077148, -0.48012909293174744, 0.29571351408958435, -0.33453840017318726, 0.030347222462296486, -0.021971970796585083, -1.0673367977142334, 0.10910001397132874, -0.6278384327888489, 0.43258029222488403, 1.185060977935791, 1.3815124034881592, -1.059017300605774, -0.1279398798942566, -1.7198492288589478, -0.19631919264793396, -0.8041257858276367, 0.3614470660686493, -2.1046230792999268, -0.3107926845550537, -1.8562781810760498, -2.2138824462890625, -1.2687623500823975, -0.7908322811126709, 1.168379783630371, 0.04629862308502197, -0.9642203450202942, 1.5064479112625122, -0.2032945156097412, -1.7583889961242676, 1.068968415260315, -1.983134150505066 ]
https://github.com/huggingface/datasets/issues/4439
TIMIT won't load after manual download: Errors about files that don't exist
I'm closing this issue then. Please, feel free to reopen it again if the problem persists.
## Describe the bug I get the message from HuggingFace that it must be downloaded manually. From the URL provided in the message, I got to UPenn page for manual download. (UPenn apparently want $250? for the dataset??) ...So, ok, I obtained a copy from a friend and also a smaller version from Kaggle. But in both cases the HF dataloader fails; it is looking for files that don't exist anywhere in the dataset: it is looking for files with lower-case letters like "**test*" (all the filenames in both my copies are uppercase) and certain file extensions that exclude the .DOC which is provided in TIMIT: ## Steps to reproduce the bug ```python data = load_dataset('timit_asr', 'clean')['train'] ``` ## Expected results The dataset should load with no errors. ## Actual results This error message: ``` File "/home/ubuntu/envs/data2vec/lib/python3.9/site-packages/datasets/data_files.py", line 201, in resolve_patterns_locally_or_by_urls raise FileNotFoundError(error_msg) FileNotFoundError: Unable to resolve any data file that matches '['**test*', '**eval*']' at /home/ubuntu/datasets/timit with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` But this is a strange sort of error: why is it looking for lower-case file names when all the TIMIT dataset filenames are uppercase? Why does it exclude .DOC files when the only parts of the TIMIT data set with "TEST" in them have ".DOC" extensions? ...I wonder, how was anyone able to get this to work in the first place? The files in the dataset look like the following: ``` ³ PHONCODE.DOC ³ PROMPTS.TXT ³ SPKRINFO.TXT ³ SPKRSENT.TXT ³ TESTSET.DOC ``` ...so why are these being excluded by the dataset loader? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1060-aws-x86_64-with-glibc2.27 - Python version: 3.9.9 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
732
16
TIMIT won't load after manual download: Errors about files that don't exist ## Describe the bug I get the message from HuggingFace that it must be downloaded manually. From the URL provided in the message, I got to UPenn page for manual download. (UPenn apparently want $250? for the dataset??) ...So, ok, I obtained a copy from a friend and also a smaller version from Kaggle. But in both cases the HF dataloader fails; it is looking for files that don't exist anywhere in the dataset: it is looking for files with lower-case letters like "**test*" (all the filenames in both my copies are uppercase) and certain file extensions that exclude the .DOC which is provided in TIMIT: ## Steps to reproduce the bug ```python data = load_dataset('timit_asr', 'clean')['train'] ``` ## Expected results The dataset should load with no errors. ## Actual results This error message: ``` File "/home/ubuntu/envs/data2vec/lib/python3.9/site-packages/datasets/data_files.py", line 201, in resolve_patterns_locally_or_by_urls raise FileNotFoundError(error_msg) FileNotFoundError: Unable to resolve any data file that matches '['**test*', '**eval*']' at /home/ubuntu/datasets/timit with any supported extension ['csv', 'tsv', 'json', 'jsonl', 'parquet', 'txt', 'blp', 'bmp', 'dib', 'bufr', 'cur', 'pcx', 'dcx', 'dds', 'ps', 'eps', 'fit', 'fits', 'fli', 'flc', 'ftc', 'ftu', 'gbr', 'gif', 'grib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', 'mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', 'emf', 'xbm', 'xpm', 'zip'] ``` But this is a strange sort of error: why is it looking for lower-case file names when all the TIMIT dataset filenames are uppercase? Why does it exclude .DOC files when the only parts of the TIMIT data set with "TEST" in them have ".DOC" extensions? ...I wonder, how was anyone able to get this to work in the first place? The files in the dataset look like the following: ``` ³ PHONCODE.DOC ³ PROMPTS.TXT ³ SPKRINFO.TXT ³ SPKRSENT.TXT ³ TESTSET.DOC ``` ...so why are these being excluded by the dataset loader? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1060-aws-x86_64-with-glibc2.27 - Python version: 3.9.9 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 I'm closing this issue then. Please, feel free to reopen it again if the problem persists.
[ -1.2092194557189941, -1.09916353225708, -0.7991034984588623, 1.659130334854126, -0.23792819678783417, -1.1105786561965942, 0.008354252204298973, -0.9388540387153625, 1.6038144826889038, -0.7046318054199219, 0.0936746746301651, -1.7402209043502808, -0.15552416443824768, -0.7209328413009644, -0.6171408295631409, -0.789310872554779, -0.21809200942516327, -0.8990737199783325, 1.1200047731399536, 2.3567607402801514, 1.0073444843292236, -1.5354866981506348, 2.8089828491210938, 0.7012159824371338, -0.08951058983802795, -1.1385047435760498, 0.5750123262405396, -0.09988671541213989, -1.037184476852417, -0.5584052801132202, -0.9757896661758423, 0.09059770405292511, -0.6433587074279785, -0.30813169479370117, 0.06394274532794952, 0.465253621339798, -0.24056211113929749, -0.49393752217292786, -0.5488629937171936, -0.6380028128623962, 0.3790743350982666, -0.46709442138671875, 0.9368727207183838, -0.2454601377248764, 1.777475118637085, -0.3784841001033783, 0.24552059173583984, 0.6512373685836792, 1.4118168354034424, 0.23139691352844238, 0.14573051035404205, 0.33620506525039673, 0.3310754597187042, -0.0381578654050827, 0.6041749119758606, 1.1620254516601562, 0.6214415431022644, 0.39477357268333435, 0.8144632577896118, -2.388749361038208, 1.2772870063781738, -1.1560189723968506, 0.318368136882782, 1.3314710855484009, -0.8239879608154297, 0.6246005892753601, -1.7508870363235474, 0.14642179012298584, 0.6578723788261414, -2.174730062484741, 0.41641712188720703, -1.1800974607467651, -0.35186949372291565, 0.7859175205230713, 0.34385496377944946, -1.2833871841430664, 0.25285157561302185, -0.4157954752445221, 1.0866246223449707, 0.31646469235420227, 0.9816744923591614, -1.764826774597168, 0.052063919603824615, -0.1920180767774582, 0.1482553780078888, -1.2826671600341797, -1.5997737646102905, 0.5825706124305725, 0.5926257371902466, 0.6988129615783691, -0.1516309678554535, 0.9915952682495117, -1.208814024925232, 0.6216449737548828, -1.0155504941940308, -1.6150866746902466, -1.3037391901016235, -2.3347394466400146, -2.22320294380188, 0.7783908247947693, -0.480811208486557, -0.4824464023113251, 2.0409083366394043, -0.8456682562828064, -1.810716986656189, 1.2744075059890747, 0.43659716844558716, 0.14048634469509125, 2.4703173637390137, 0.14704689383506775, -0.7727996110916138, 0.44374555349349976, -0.8757089376449585, 0.8762209415435791, -0.44619786739349365, 1.4544029235839844, 0.38017940521240234, -0.8058536648750305, 1.7509803771972656, -0.45730990171432495, 0.6001707911491394, -0.5826203227043152, -0.53497713804245, -0.83638995885849, 0.31045714020729065, 1.9506181478500366, -0.19331520795822144, 1.4525229930877686, -0.4893830120563507, -1.5158672332763672, -1.5321681499481201, 0.9836907982826233, 0.27958452701568604, -1.0195866823196411, 0.0891939029097557, -0.3949703276157379, 0.28843942284584045, -0.22910179197788239, 1.1582770347595215, 1.2601912021636963, 0.5351148247718811, -0.299125075340271, -0.9402719736099243, 0.1413813829421997, -0.3093754053115845, -0.6436750888824463, -1.8805729150772095, -0.28915929794311523, 0.17307820916175842, 0.7371931672096252, -1.3065084218978882, 1.5903980731964111, 0.8538467884063721, 1.9312647581100464, 0.9726617336273193, -0.4732060730457306, 1.5096575021743774, 0.11721907556056976, 1.790653109550476, -0.7001440525054932, 0.5979230999946594, -0.4949548840522766, -1.1242549419403076, 0.8870415091514587, -0.32251453399658203, -1.862413763999939, -0.7836341857910156, -0.8939196467399597, -0.33017152547836304, -0.7459279298782349, 0.8093533515930176, -0.5191386342048645, -1.4974024295806885, 0.26131582260131836, -0.6420435905456543, 0.4113009572029114, -1.1209261417388916, 0.253348171710968, 0.7766588926315308, -0.5439253449440002, 0.1047167032957077, -0.3193281590938568, -1.3910131454467773, -0.4970490634441376, 0.5381519794464111, 1.900920033454895, -0.6522611975669861, 0.7681813836097717, 0.9896129369735718, -0.7284762263298035, -0.034998372197151184, 0.24759697914123535, -0.18913210928440094, 0.7354859113693237, -0.9766380190849304, -0.7338990569114685, 1.2033843994140625, -0.321175217628479, -0.6062990427017212, 1.3231201171875, 0.86246657371521, -1.1249111890792847, -0.299129456281662, -0.19993004202842712, -0.8545604348182678, -0.025975795462727547, -1.5782623291015625, -0.25401267409324646, 0.456497460603714, -1.5847408771514893, -0.45054134726524353, -0.38052353262901306, 1.1675238609313965, -0.09795825928449631, 1.3548296689987183, -0.3785282075405121, -0.19250455498695374, -0.07763054221868515, -0.6155608892440796, 0.3422902226448059, -0.360042005777359, -0.5691567659378052, 0.011911006644368172, -0.8065339922904968, 0.4281242787837982, 1.4677993059158325, 0.30430418252944946, -0.0469137579202652, 0.5507975816726685, 1.1572823524475098, 0.5265190601348877, 0.18994560837745667, -0.8874846696853638, -1.4302642345428467, 1.9286484718322754, -1.628777027130127, 1.9342654943466187, 0.5922849774360657, -0.010277933441102505, -1.7321269512176514, -1.8337254524230957, 1.3916946649551392, 1.190900206565857, 2.150865316390991, 0.6415542364120483, 0.36560681462287903, -0.9620648622512817, -0.6938142776489258, 0.11934542655944824, -0.8773738145828247, -0.6887314915657043, 0.11116736382246017, 2.430148124694824, 1.862323522567749, -0.5257430672645569, -0.2410542070865631, -0.9060433506965637, 1.5214756727218628, -0.385064959526062, 0.41073673963546753, 1.9992175102233887, -0.26740145683288574, -1.014293909072876, 1.2853981256484985, -2.5603408813476562, 0.23154793679714203, 2.0447118282318115, 0.24694421887397766, 0.21293160319328308, -1.4015518426895142, -0.7594953179359436, -0.18353448808193207, -0.31834715604782104, -1.2803032398223877, 0.5505691766738892, -0.32283905148506165, -0.6953548789024353, -1.5789095163345337, 0.2484213411808014, -1.1563801765441895, -1.521307110786438, 0.24712994694709778, 2.0857656002044678, 2.2097585201263428, -0.8256853222846985, 1.6320215463638306, -0.1308952271938324, 0.27683648467063904, 1.3257174491882324, 1.1810275316238403, 2.930947780609131, 1.7814041376113892, -1.1059281826019287, 0.5545892715454102, -0.19337725639343262, -0.4937325417995453, 1.1504380702972412, -1.042474627494812, 1.0588160753250122, -0.12995214760303497, -1.0569626092910767, -1.214971661567688, 0.8773706555366516, 0.4391177296638489, -0.028835372999310493, -0.37994682788848877, 1.1899462938308716, -0.04331350326538086, 1.2179418802261353, 0.6724183559417725, -0.42369556427001953, 0.3472295105457306, -0.3928488492965698, -0.61403888463974, 1.5830520391464233, 0.09596608579158783, -1.485244870185852, -2.1531026363372803, -0.30668577551841736, -0.7485930323600769, 0.04574749618768692, -0.521342396736145, -1.0635995864868164, 1.4600245952606201, 0.2911466956138611, -1.0370815992355347, -0.1993875950574875, -0.31300416588783264, -0.490535706281662, 2.6318390369415283, -1.3436930179595947, -0.4553610384464264, -0.9420580267906189, -0.5495873689651489, 1.6616191864013672, -1.081748604774475, -0.13889631628990173, -0.9963341355323792, -0.5586535930633545, -1.3954895734786987, -0.4764508306980133, -0.02427142672240734, -0.9373582005500793, 0.9151737093925476, 0.43609753251075745, -1.1268445253372192, -0.28795841336250305, -0.9389960765838623, 0.9905164241790771, -0.15560683608055115, 0.3194882571697235, 1.901955246925354, 0.3007678985595703, -0.34727582335472107, 0.9604578614234924, 1.1177095174789429, 0.6563518643379211, -0.6225849390029907, 0.08671728521585464, -0.4974292814731598, 0.44173166155815125, -1.4156264066696167, 0.17456986010074615, -2.9385292530059814, 0.5804385542869568, -0.0662950798869133, -0.16836762428283691, 0.037534162402153015, -1.382577896118164, 1.1512069702148438, 2.455639362335205, -1.2504507303237915, 0.5388336181640625, 0.3529294431209564, 1.526861548423767, -1.6970546245574951, 0.27177757024765015, -0.37317419052124023, 2.2219784259796143, 0.03451751172542572, 1.1744261980056763, -0.5052415132522583, -2.5360326766967773, 0.5231098532676697, -1.2762484550476074, -1.0543622970581055, 0.5137742161750793, -0.9454726576805115, 0.18099291622638702, -1.6943436861038208, -0.2737662196159363, -0.9294615387916565, -1.2637104988098145, 0.7506516575813293, 0.1579807847738266, 0.21610940992832184, -0.628754734992981, 0.39098551869392395, -2.0721819400787354, -1.499853253364563, -0.13492107391357422, -0.9118029475212097, 0.6598941087722778, -0.4327595829963684, 0.6779497861862183, -0.16168946027755737, 0.03253798931837082, 0.11260045319795609, 1.585423231124878, 3.4634041786193848, 0.15189360082149506, 0.377582848072052, -0.15752629935741425, -0.8918988108634949, 1.4240268468856812, 0.9719491600990295, -0.18211877346038818, -0.4719596207141876, -1.1956878900527954, 1.4757635593414307, 2.090113401412964, 0.8701180219650269, 0.02997351624071598, -0.5944274067878723, -0.5768197178840637, -0.0353531576693058, 0.24123701453208923, 0.580316960811615, 0.8179198503494263, 0.002520977519452572, 0.019375324249267578, 1.283092737197876, 1.1859196424484253, -0.40444186329841614, 0.2898508608341217, -0.9119479060173035, -0.3842131793498993, 0.5294319987297058, 0.07261663675308228, -0.15892137587070465, 0.34511929750442505, -1.0111277103424072, -0.2991909980773926, -0.3514270484447479, -0.8515684604644775, -0.6902168393135071, -0.343573659658432, -0.316617876291275, 1.547861099243164, 0.4221416413784027, -0.7342420220375061, -0.04022213816642761, -0.5204334259033203, -0.039491988718509674, -1.042061448097229, -0.012138956226408482, -0.24724654853343964, -0.15118134021759033, -0.22462764382362366, 1.7423268556594849, -0.880088746547699, -2.033273220062256, -0.024755286052823067, 0.5228889584541321, -0.058310262858867645, 0.21778224408626556, 1.6979471445083618, 0.40900102257728577, 1.5075790882110596, 1.4128351211547852, 0.9935727119445801, -0.6106582283973694, -1.3359133005142212, 0.5960367918014526, 1.0061283111572266, -1.2802386283874512, 0.8821502923965454, -0.005161621607840061, -0.6169265508651733, 0.6516554355621338, 1.504245638847351, 0.4094897210597992, -2.034409761428833, 0.8455997109413147, -1.1620982885360718, 0.8558318614959717, 0.783821702003479, 0.8334211111068726, 0.3735869228839874, 0.8048407435417175, -1.1907672882080078, -1.1422123908996582, -0.9134975075721741, -0.7579280138015747, 1.9650596380233765, -0.3195130228996277, 0.539377748966217, 0.05237763375043869, -1.2456942796707153, -0.14372636377811432, 0.693793773651123, 0.44203394651412964, -0.34610170125961304, 0.825663149356842, -0.8136340975761414, -1.224107027053833, -1.3547638654708862, -0.48916444182395935, -0.9841649532318115, -1.0147346258163452, 0.9538853168487549, 0.890268087387085, 0.32024914026260376, 1.8780373334884644, 0.6067994236946106, 0.13170945644378662, -2.4405338764190674, 0.9915951490402222, 0.3175618052482605, -0.17825457453727722, 0.7546594738960266, 0.33670774102211, 1.1829502582550049, 0.08168189972639084, 0.5352609753608704, -2.2066731452941895, 2.1449196338653564, -0.16071073710918427, 0.7946195602416992, -0.16695384681224823, -0.05896400660276413, 1.1018458604812622, 0.43586382269859314, 0.595585286617279, -0.9636216163635254, 0.6398953199386597, -0.5356218814849854, 1.230294942855835, 1.0759516954421997, -0.7724555730819702, 0.024003418162465096, 1.3983350992202759, 0.3703949451446533, -0.768531084060669, -1.0178207159042358, -0.8394889235496521, 0.8870512843132019, 1.7111139297485352, -0.167899489402771, -0.03733796626329422, 0.8227918148040771, 0.59074866771698, -1.2390005588531494, 0.0185766089707613, -0.5798653364181519, -0.5989104509353638, 1.745418667793274, 1.9933135509490967, -0.31813663244247437, -0.09054221212863922, -0.727462887763977, -1.339119553565979, 0.5424662232398987, 0.02993217296898365, 0.027466891333460808, 0.7358772158622742, -0.6754112243652344, 0.9681513905525208, 0.6301854252815247, 0.8816794753074646, 0.074166439473629, 0.37226781249046326, 0.5267731547355652, -0.4545086622238159, -1.0799802541732788, -0.2859382927417755, -1.217210292816162, -2.4851186275482178, 0.35462671518325806, -0.11723118275403976, -1.4142663478851318, 0.060512974858284, -0.915043830871582, 1.1845134496688843, -0.5564892292022705, -1.2282781600952148, -1.3779720067977905, 0.3049037456512451, -0.0295674167573452, 0.8341749310493469, -1.7388349771499634, -0.06643911451101303, 1.2725378274917603, 0.994398832321167, -0.7023364305496216, 1.1360623836517334, 0.3346561789512634, 1.0814390182495117, 0.6521047353744507, -0.3357534408569336, 0.5359832644462585, -0.13892266154289246, -1.2581095695495605, 0.5389041304588318, 1.1917566061019897, 0.10395128279924393, 1.308124303817749, -0.483857661485672, -0.13762779533863068, 0.4603007733821869, -0.6310995221138, -0.397659033536911, -0.3008139133453369, 0.5525573492050171, 0.013108666986227036, -0.7748396396636963, -0.03633950650691986, 0.08731759339570999, -0.33656102418899536, 0.14048385620117188, -1.5652745962142944, -0.3712708353996277, -0.44875332713127136, -0.39465656876564026, -1.3131930828094482, -0.01705484837293625, 1.4160516262054443, -0.5415269732475281, -0.39279091358184814, 0.5891852974891663, 0.454509437084198, 0.3898113965988159, 0.5723462104797363, -0.6827567219734192, -0.28237035870552063, -0.2026558518409729, -0.3088698387145996, 0.2538243532180786, 1.3335955142974854, -0.1758650839328766, -1.0490710735321045, 0.6057167649269104, -0.36503568291664124, -0.0031971391290426254, 1.7457610368728638, -0.08105189353227615, -0.8469750285148621, 0.24227702617645264, -0.8168084025382996, 1.9858267307281494, 1.6854193210601807, 1.19801926612854, -0.2109571397304535, -0.8030754923820496, 0.7022755742073059, -0.2990437150001526, -0.34527838230133057, 0.7648997902870178, 0.41512370109558105, -0.19535426795482635, -1.4238547086715698, 0.7554963827133179, 1.1810426712036133, -0.8147250413894653, -0.7866709232330322, 0.19260834157466888, -0.8008904457092285, 1.2010694742202759, 0.6431951522827148, 0.3669377863407135, 0.186105415225029, 1.7696369886398315, 0.8286763429641724, -0.5417739152908325, 0.6404298543930054, 0.5985738039016724, -0.31323370337486267, -2.0950496196746826, -1.2178354263305664, 0.08438912779092789, -0.42476728558540344, -1.6848472356796265, 1.3142268657684326, -0.9942269325256348, -0.8033600449562073, 0.5374333262443542, 0.11293374001979828, 1.2426903247833252, 0.4966928958892822, 1.3421800136566162, 2.017554759979248, 0.7025101184844971, 0.5388800501823425, 1.2284657955169678, -0.2713193893432617, -0.5841702818870544, 1.919426441192627, -0.3652491569519043, 0.5658981800079346, 1.166698694229126, -0.3245934247970581, -1.066861629486084, -0.6633636355400085, -1.208227515220642, -0.5539637804031372, 1.0905076265335083, 0.09060903638601303, -1.1207107305526733, 0.2520955204963684, 1.4993447065353394, 0.09019766002893448, -0.43238338828086853, 0.7230780720710754, 0.5216166973114014, -0.8551818132400513, -0.07922735065221786, -0.9004516005516052, 0.5242947340011597, -0.25845515727996826, -0.19307318329811096, 0.4274342954158783, 0.4523855149745941, 1.3706618547439575, 0.05362764000892639, 0.2171739935874939, 1.0750445127487183, -1.4204518795013428, 1.553470492362976, -0.7118616104125977, 0.3294628858566284, -2.424752950668335, 1.2549633979797363, -0.708514392375946, 2.1485679149627686, -2.5972867012023926, 0.40165087580680847, -0.6737127304077148, -0.48012909293174744, 0.29571351408958435, -0.33453840017318726, 0.030347222462296486, -0.021971970796585083, -1.0673367977142334, 0.10910001397132874, -0.6278384327888489, 0.43258029222488403, 1.185060977935791, 1.3815124034881592, -1.059017300605774, -0.1279398798942566, -1.7198492288589478, -0.19631919264793396, -0.8041257858276367, 0.3614470660686493, -2.1046230792999268, -0.3107926845550537, -1.8562781810760498, -2.2138824462890625, -1.2687623500823975, -0.7908322811126709, 1.168379783630371, 0.04629862308502197, -0.9642203450202942, 1.5064479112625122, -0.2032945156097412, -1.7583889961242676, 1.068968415260315, -1.983134150505066 ]
https://github.com/huggingface/datasets/issues/4435
Load a local cached dataset that has been modified
Hi! `datasets` caches every modification/loading, so you can either rerun the pipeline up to the `map` call or use `Dataset.from_file(modified_dataset)` to load the dataset directly from the cache file.
## Describe the bug I have loaded a dataset as follows: ``` d = load_dataset("emotion", split="validation") ``` Afterwards I make some modifications to the dataset via a `map` call: ``` d.map(some_update_func, cache_file_name=modified_dataset) ``` This generates a cached version of the dataset on my local system in the same directory as the original download of the data (/path/to/cache). Running an `ls` returns: ``` modified_dataset dataset_info.json emotion-test.arrow emotion-train.arrow emotion-validation.arrow ``` as expected. However, when I try to load up the modified cached dataset via a call to ``` modified = load_dataset("emotion", split="validation", data_files="/path/to/cache/modified_dataset") ``` it simply redownloads a new version of the dataset and dumps to a new cache rather than loading up the original modified dataset: ``` Using custom data configuration validation-cdbf51685638421b Downloading and preparing dataset emotion/validation to ... ``` How am I supposed to load the original modified local cache copy of the dataset? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-113-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
733
29
Load a local cached dataset that has been modified ## Describe the bug I have loaded a dataset as follows: ``` d = load_dataset("emotion", split="validation") ``` Afterwards I make some modifications to the dataset via a `map` call: ``` d.map(some_update_func, cache_file_name=modified_dataset) ``` This generates a cached version of the dataset on my local system in the same directory as the original download of the data (/path/to/cache). Running an `ls` returns: ``` modified_dataset dataset_info.json emotion-test.arrow emotion-train.arrow emotion-validation.arrow ``` as expected. However, when I try to load up the modified cached dataset via a call to ``` modified = load_dataset("emotion", split="validation", data_files="/path/to/cache/modified_dataset") ``` it simply redownloads a new version of the dataset and dumps to a new cache rather than loading up the original modified dataset: ``` Using custom data configuration validation-cdbf51685638421b Downloading and preparing dataset emotion/validation to ... ``` How am I supposed to load the original modified local cache copy of the dataset? ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-113-generic-x86_64-with-glibc2.17 - Python version: 3.8.13 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Hi! `datasets` caches every modification/loading, so you can either rerun the pipeline up to the `map` call or use `Dataset.from_file(modified_dataset)` to load the dataset directly from the cache file.
[ -1.1404510736465454, -0.8440902233123779, -0.7685056924819946, 1.3862619400024414, -0.14329677820205688, -1.3472893238067627, 0.13436481356620789, -1.1150181293487549, 1.8353875875473022, -0.8595495820045471, 0.34071165323257446, -1.6896315813064575, -0.007701713591814041, -0.5806730389595032, -0.7934272289276123, -0.9242032766342163, -0.4159134328365326, -0.675936222076416, 0.9801002740859985, 2.4284775257110596, 1.1384390592575073, -1.3195832967758179, 2.624999523162842, 0.6630037426948547, -0.16780969500541687, -0.9840885996818542, 0.492008775472641, 0.031270161271095276, -1.2798854112625122, -0.37558260560035706, -0.8527626395225525, -0.10620449483394623, -0.6305620670318604, -0.6427385210990906, -0.009472689591348171, 0.4367508888244629, -0.3904901444911957, -0.47211307287216187, -0.47502434253692627, -0.8151558637619019, 0.4878740608692169, -0.35613173246383667, 0.9713929295539856, -0.40693289041519165, 1.7997453212738037, -0.6142195463180542, 0.4806252717971802, 0.7757622003555298, 1.259117603302002, 0.1660396158695221, 0.06958749145269394, 0.29853975772857666, 0.4104531407356262, 0.03614690154790878, 0.5025229454040527, 1.1379367113113403, 0.5599566698074341, 0.5649473071098328, 0.7461168766021729, -2.2843410968780518, 1.2833644151687622, -1.052377462387085, 0.322589635848999, 1.3270994424819946, -0.9665096998214722, 0.31797751784324646, -1.8076616525650024, -0.005628969520330429, 0.47046324610710144, -2.2402050495147705, 0.26329800486564636, -1.4280556440353394, -0.4749678373336792, 1.043134093284607, 0.3633793592453003, -1.1464557647705078, 0.1942274570465088, -0.36751416325569153, 1.0040619373321533, 0.5206177830696106, 1.1520525217056274, -1.7183758020401, -0.020812369883060455, -0.3375692069530487, 0.1255253106355667, -1.270517110824585, -1.516045093536377, 0.50663161277771, 0.6542304158210754, 0.5985891222953796, -0.14670637249946594, 1.0271391868591309, -0.9432221055030823, 0.7029390335083008, -0.9967920184135437, -1.7909324169158936, -1.410069465637207, -2.1721761226654053, -2.3670952320098877, 0.7424384355545044, -0.4240860044956207, -0.41351598501205444, 2.0504167079925537, -1.0029090642929077, -1.783820390701294, 1.0299943685531616, 0.3397865891456604, -0.09543191641569138, 2.236936330795288, 0.1642524152994156, -0.724575936794281, 0.46815305948257446, -0.7239235639572144, 0.6909816265106201, -0.3113303780555725, 1.272939920425415, 0.508213222026825, -1.1150590181350708, 1.583478569984436, -0.4025462865829468, 0.6793736815452576, -0.6817254424095154, -0.45779603719711304, -0.7575715184211731, 0.2724912464618683, 1.9047553539276123, -0.27063480019569397, 1.5847591161727905, -0.3490195870399475, -1.539522409439087, -1.56211256980896, 0.9072309136390686, 0.4876079857349396, -0.6751849055290222, 0.09171021729707718, -0.2936040461063385, 0.1446845382452011, -0.08760116249322891, 1.1455942392349243, 1.1864625215530396, 0.8257502317428589, -0.2850660979747772, -0.8308577537536621, 0.20423488318920135, 0.005945637822151184, -0.7872377038002014, -1.746299147605896, -0.3306361138820648, 0.14843447506427765, 0.5927249789237976, -1.1164896488189697, 1.7578585147857666, 0.8719489574432373, 1.9032843112945557, 1.0067921876907349, -0.36668357253074646, 1.483669638633728, 0.06598861515522003, 1.9697149991989136, -0.3717706799507141, 0.6453277468681335, -0.2827930152416229, -1.1608633995056152, 0.8436710238456726, -0.29327842593193054, -2.101717233657837, -0.6898095607757568, -0.8529937863349915, -0.1402001976966858, -0.7573232650756836, 0.8932541608810425, -0.23985973000526428, -1.491871953010559, 0.11601881682872772, -0.6420601010322571, 0.06228680908679962, -1.252723217010498, 0.2703956663608551, 0.7552521228790283, -0.6711425185203552, 0.07002617418766022, -0.2694251835346222, -1.3251765966415405, -0.4609587788581848, 0.30955880880355835, 1.8667664527893066, -0.7657049298286438, 1.0415223836898804, 1.0813994407653809, -0.7994674444198608, -0.06101582199335098, 0.32466137409210205, -0.29734015464782715, 0.8656628727912903, -1.065354824066162, -0.3434916138648987, 1.2330518960952759, -0.16118241846561432, -0.623099148273468, 1.498690128326416, 0.7365016937255859, -0.9332591891288757, -0.0542776957154274, -0.19984586536884308, -0.8028385043144226, 0.04479213058948517, -1.5195163488388062, -0.06027945131063461, 0.42658233642578125, -1.5431956052780151, -0.514308750629425, -0.15722723305225372, 1.2439335584640503, -0.15939831733703613, 1.3597910404205322, -0.24125011265277863, -0.2619817852973938, -0.42430463433265686, -0.39058229327201843, 0.06459687650203705, -0.1594659686088562, -0.6799027919769287, 0.19807343184947968, -0.7577536106109619, 0.3284240961074829, 1.397688627243042, 0.25581860542297363, 0.02074454538524151, 0.5643876194953918, 1.1797198057174683, 0.3127021789550781, -0.05738914757966995, -0.8986827731132507, -1.5601646900177002, 1.9397867918014526, -1.4127436876296997, 1.9527109861373901, 0.6032232046127319, -0.04589727520942688, -1.791646122932434, -1.9224803447723389, 1.4409425258636475, 1.1053978204727173, 2.4008491039276123, 0.5412744879722595, 0.4126116633415222, -0.8362730145454407, -0.6261541247367859, 0.36532965302467346, -0.9830726981163025, -0.6909230351448059, 0.18351806700229645, 2.379746675491333, 1.693466067314148, -0.4818664491176605, -0.2119949609041214, -1.0567904710769653, 1.4247993230819702, -0.17651747167110443, 0.15950053930282593, 1.9882206916809082, -0.3043579161167145, -1.0752332210540771, 1.3365869522094727, -2.300039529800415, 0.12481918931007385, 1.9339087009429932, 0.2764551341533661, 0.05150589346885681, -1.3568382263183594, -0.6607682704925537, -0.19789978861808777, -0.49652454257011414, -1.2541099786758423, 0.5182110667228699, -0.24274004995822906, -0.7290904521942139, -1.3775607347488403, 0.1873185634613037, -1.0752243995666504, -1.7144173383712769, 0.16599658131599426, 1.9206829071044922, 1.9352339506149292, -0.7162855267524719, 1.5222101211547852, -0.29903605580329895, 0.18971191346645355, 1.3039973974227905, 1.216413974761963, 3.171715021133423, 1.9532586336135864, -1.326700210571289, 0.7590217590332031, -0.08326450735330582, -0.5076329112052917, 1.2358216047286987, -1.199508547782898, 1.258846402168274, -0.22182001173496246, -1.2029603719711304, -1.2625060081481934, 0.8700751662254333, 0.46674174070358276, 0.1102285236120224, -0.4981941878795624, 1.1886920928955078, 0.06746450811624527, 1.3093854188919067, 0.5830458402633667, -0.3858622908592224, 0.7199763655662537, -0.38474616408348083, -0.4992315173149109, 1.5826255083084106, 0.1715807020664215, -1.2553045749664307, -2.3751683235168457, -0.22325217723846436, -0.9321430325508118, 0.04839994013309479, -0.5982112884521484, -0.9377613067626953, 1.6607555150985718, 0.4600796401500702, -1.3088349103927612, -0.2030171900987625, -0.3523889482021332, -0.6593566536903381, 2.751708984375, -1.3497906923294067, -0.2060171216726303, -1.0381014347076416, -0.6855524182319641, 1.6339495182037354, -1.2037726640701294, -0.20932325720787048, -1.0384050607681274, -0.5241565108299255, -1.370809555053711, -0.5367681384086609, 0.07169052958488464, -0.9464051723480225, 0.9479417204856873, 0.11511559784412384, -1.2292770147323608, -0.3541181683540344, -0.8943724036216736, 0.9236011505126953, -0.15450677275657654, 0.1437249481678009, 1.867461085319519, 0.4587779939174652, -0.355648398399353, 0.638718843460083, 1.130622386932373, 0.6311864256858826, -0.627059280872345, 0.3688167631626129, -0.7163206934928894, 0.28859764337539673, -1.3267239332199097, 0.2427089512348175, -2.843167781829834, 0.6700687408447266, -0.05273366719484329, -0.03362732380628586, -0.06105722486972809, -1.326205849647522, 0.9495519399642944, 2.6448681354522705, -1.2141854763031006, 0.46743276715278625, 0.30641862750053406, 1.1916643381118774, -1.514369249343872, 0.22126740217208862, -0.48026320338249207, 2.062500238418579, 0.17669548094272614, 1.2231309413909912, -0.45200315117836, -2.2703697681427, 0.570574939250946, -1.2775075435638428, -1.2099189758300781, 0.9264606833457947, -0.7872621417045593, 0.098046213388443, -1.2662190198898315, -0.253860205411911, -0.8835479021072388, -1.1553353071212769, 0.7495191097259521, 0.1429337114095688, 0.5654087066650391, -0.7110602259635925, 0.3885904848575592, -2.2089908123016357, -1.2893500328063965, -0.28317585587501526, -0.8984189033508301, 0.4676108658313751, -0.24860522150993347, 0.698670506477356, -0.17136266827583313, 0.026045585051178932, 0.33539867401123047, 1.4461060762405396, 3.3867859840393066, 0.17246650159358978, 0.27669185400009155, -0.18815869092941284, -1.0057071447372437, 1.4317525625228882, 0.9450019001960754, -0.13919749855995178, -0.607072651386261, -1.0894949436187744, 1.1603292226791382, 1.919037103652954, 1.088532567024231, -0.011421955190598965, -0.8185730576515198, -0.7316136360168457, 0.05280660092830658, 0.15647485852241516, 0.444472998380661, 0.8323559165000916, 0.13551568984985352, 0.1421319544315338, 1.353926181793213, 1.11122465133667, -0.29754137992858887, 0.35574525594711304, -0.8548372983932495, -0.3978966474533081, 0.559784471988678, 0.340943306684494, 0.06923772394657135, 0.29870015382766724, -1.0489225387573242, -0.19888220727443695, -0.40671059489250183, -0.9593105912208557, -0.7401595115661621, -0.5022714138031006, -0.3654784858226776, 1.681201457977295, -0.048961758613586426, -0.45456525683403015, -0.052138328552246094, -0.780994713306427, -0.09218540787696838, -1.038378357887268, 0.3696584403514862, -0.21122433245182037, -0.09334230422973633, -0.1174265444278717, 1.724034309387207, -1.015851378440857, -1.971013069152832, 0.27584102749824524, 0.19508661329746246, -0.3930758833885193, 0.2370009571313858, 1.5810840129852295, 0.5407954454421997, 1.356319785118103, 1.3963667154312134, 0.99818354845047, -0.6408571004867554, -1.288508653640747, 0.6317116022109985, 0.9396239519119263, -1.3217395544052124, 0.7829002737998962, 0.09972523152828217, -0.5529786944389343, 0.6588706374168396, 1.2879910469055176, 0.4235437214374542, -2.0596437454223633, 0.6571674942970276, -0.8336735963821411, 0.7094945907592773, 0.739663302898407, 0.7936195135116577, 0.14368119835853577, 0.79735267162323, -1.2562769651412964, -1.141528844833374, -0.6308922171592712, -0.6794261336326599, 1.969886302947998, -0.18527920544147491, 0.6212203502655029, -0.17784275114536285, -1.345363736152649, -0.07609976083040237, 0.7127922773361206, 0.40573444962501526, -0.544035017490387, 0.7625288367271423, -0.6091530919075012, -1.0274347066879272, -1.3647947311401367, -0.4830126464366913, -1.16823410987854, -0.873848557472229, 0.958625853061676, 0.9049891829490662, 0.3572537302970886, 1.815065622329712, 0.7042024731636047, 0.2998363673686981, -2.6265363693237305, 0.8365700840950012, 0.3060022294521332, -0.05178600549697876, 0.7796648144721985, 0.34723204374313354, 0.9770190119743347, -0.04283805191516876, 0.6509850025177002, -2.41210675239563, 2.315321207046509, -0.20566964149475098, 0.6246891021728516, -0.07474882900714874, -0.17839249968528748, 1.0306370258331299, 0.5655549764633179, 0.4993812143802643, -1.1268808841705322, 0.7756728529930115, -0.5985576510429382, 1.182389736175537, 0.9117620587348938, -0.8300934433937073, -0.024348493665456772, 1.4196263551712036, 0.49721959233283997, -0.478108674287796, -0.9553263187408447, -1.0274194478988647, 1.0454331636428833, 1.790037751197815, -0.07004904747009277, 0.013924693688750267, 0.8949955701828003, 0.6924164295196533, -1.276641607284546, 0.1538289338350296, -0.7320939898490906, -0.7400665283203125, 1.6750537157058716, 1.9870473146438599, -0.11604801565408707, -0.1942700743675232, -0.7970611453056335, -1.1644866466522217, 0.8148446679115295, 0.10390836745500565, 0.03310362249612808, 0.673017680644989, -0.6661643385887146, 1.1832324266433716, 0.92063969373703, 0.9418650269508362, 0.1789749264717102, 0.2770163118839264, 0.3274087905883789, -0.329678475856781, -1.2461286783218384, -0.24036236107349396, -1.0370830297470093, -2.519397258758545, 0.5548237562179565, -0.20337893068790436, -1.4443644285202026, -0.051991842687129974, -1.0870938301086426, 0.8729873299598694, -0.6298571825027466, -1.190968632698059, -1.4638020992279053, 0.24575263261795044, -0.018489813432097435, 0.8543214797973633, -1.579027533531189, -0.007936401292681694, 1.2148851156234741, 0.9901303648948669, -0.7133626937866211, 0.9685889482498169, 0.11976893246173859, 0.9284600019454956, 0.9247409701347351, -0.4222398102283478, 0.4704292416572571, 0.06240539997816086, -1.3904821872711182, 0.4370264410972595, 1.1220113039016724, 0.20229028165340424, 1.4987995624542236, -0.601275622844696, 0.0657396987080574, 0.39646896719932556, -0.411490261554718, -0.5222538709640503, -0.7632349133491516, 0.6277116537094116, 0.09383895993232727, -0.921437680721283, 0.08288715779781342, -0.00025716517120599747, -0.17122915387153625, 0.2207561731338501, -1.4012978076934814, -0.18427997827529907, -0.3096819818019867, -0.6232053637504578, -1.167439341545105, -0.07024984806776047, 1.3204337358474731, -0.7593442797660828, -0.1563321352005005, 0.5493775010108948, 0.24669381976127625, 0.5118873715400696, 0.5586594939231873, -0.6367124319076538, -0.3268406391143799, -0.2886246144771576, -0.3568161427974701, 0.29144272208213806, 1.347248911857605, -0.17086537182331085, -0.9587752223014832, 0.7217915058135986, -0.3543379306793213, 0.1079837754368782, 1.9410476684570312, 0.1008504256606102, -0.7553004622459412, 0.339840829372406, -0.6815887093544006, 1.8600260019302368, 1.8047188520431519, 1.3604600429534912, -0.03300962597131729, -0.9570408463478088, 0.5685032606124878, -0.4489216208457947, -0.46071168780326843, 1.0814017057418823, 0.35942959785461426, -0.1720290631055832, -1.4072678089141846, 0.7744840979576111, 1.3144111633300781, -0.8369232416152954, -0.8265153765678406, 0.05831580609083176, -0.814024031162262, 0.9854536652565002, 0.6859266757965088, 0.3117292523384094, 0.3173292875289917, 1.5727609395980835, 0.7336937189102173, -0.3538716733455658, 0.605954110622406, 0.47595348954200745, -0.14823868870735168, -2.093384265899658, -1.2270584106445312, 0.36656445264816284, -0.5408403873443604, -1.670560359954834, 1.464194893836975, -1.1782186031341553, -0.9679818153381348, 0.6038848161697388, 0.11673413217067719, 1.495757818222046, 0.3387701213359833, 1.6093302965164185, 2.092881679534912, 0.8759304285049438, 0.34877803921699524, 1.3057398796081543, -0.08652052283287048, -0.4544796943664551, 1.8119138479232788, -0.5170108675956726, 0.44540008902549744, 1.0130622386932373, -0.33304500579833984, -1.0760819911956787, -0.8348439335823059, -1.2777390480041504, -0.772087037563324, 1.1759639978408813, 0.0541839525103569, -1.126273512840271, 0.28600046038627625, 1.6367732286453247, 0.07731010764837265, -0.21677808463573456, 0.7940792441368103, 0.29417479038238525, -0.8310856819152832, -0.06438560783863068, -0.9573912620544434, 0.5508182644844055, -0.17751024663448334, -0.3071373999118805, 0.2772706151008606, 0.559220016002655, 1.3150352239608765, 0.018128743395209312, 0.03747670352458954, 1.2656065225601196, -1.354233980178833, 1.491556167602539, -0.7256168723106384, 0.3094131350517273, -2.3994140625, 1.4229038953781128, -0.8630761504173279, 1.820541501045227, -2.628592014312744, 0.4302314519882202, -0.4963357150554657, -0.5025849342346191, 0.2891677916049957, -0.3948971927165985, 0.13783296942710876, -0.12669654190540314, -1.1612790822982788, -0.08302777260541916, -0.775759756565094, 0.5749567151069641, 1.1412712335586548, 1.447213053703308, -1.2234538793563843, -0.3463488519191742, -1.7127844095230103, -0.14420649409294128, -0.5580589175224304, 0.4210033714771271, -1.9388883113861084, -0.16168557107448578, -1.9036262035369873, -2.476071357727051, -1.2735341787338257, -0.8755484819412231, 1.0620341300964355, 0.047849416732788086, -0.893642246723175, 1.092742919921875, -0.3947070837020874, -1.8415179252624512, 1.1196448802947998, -2.2170915603637695 ]
https://github.com/huggingface/datasets/issues/4430
Add ability to load newer, cleaner version of Multi-News
Hi! Our versioning is based on Git revisions (the `revision` param in `load_dataset`), so you can just replace the old URL with the new one and open a PR :). I can also give you some pointers if needed.
**Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`?
734
39
Add ability to load newer, cleaner version of Multi-News **Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`? Hi! Our versioning is based on Git revisions (the `revision` param in `load_dataset`), so you can just replace the old URL with the new one and open a PR :). I can also give you some pointers if needed.
[ -1.219362735748291, -0.9471238851547241, -0.7977760434150696, 1.4168765544891357, -0.1790095865726471, -1.2458544969558716, 0.18637841939926147, -1.0070221424102783, 1.6529130935668945, -0.7732445597648621, 0.3374288082122803, -1.681625247001648, 0.01479474175721407, -0.5402986407279968, -0.8273423910140991, -0.8198474049568176, -0.37966111302375793, -0.8543131947517395, 0.888605535030365, 2.516749143600464, 1.1374160051345825, -1.4432634115219116, 2.7290477752685547, 0.6760727763175964, -0.15367692708969116, -1.0012272596359253, 0.4827503263950348, 0.06818871945142746, -1.1987690925598145, -0.43093883991241455, -0.9288932681083679, -0.008433932438492775, -0.5819026827812195, -0.5006241202354431, 0.0816660150885582, 0.3123405873775482, -0.20372764766216278, -0.36905378103256226, -0.6455388069152832, -0.7132701873779297, 0.5137047171592712, -0.385073721408844, 0.9010667204856873, -0.30211523175239563, 1.8182880878448486, -0.5958825349807739, 0.3432457447052002, 0.7925189733505249, 1.3229418992996216, 0.1768573820590973, -0.06003553792834282, 0.30704641342163086, 0.3266793191432953, -0.03336397558450699, 0.42757755517959595, 1.2341662645339966, 0.6389519572257996, 0.5085204243659973, 0.6899516582489014, -2.226522922515869, 1.3631867170333862, -1.0856528282165527, 0.3593809902667999, 1.3202533721923828, -0.9868212938308716, 0.43755868077278137, -1.8342019319534302, -0.06675974279642105, 0.5629581212997437, -2.3193936347961426, 0.1732262223958969, -1.3229111433029175, -0.5974683165550232, 0.9182865023612976, 0.2016458362340927, -1.270729660987854, 0.2326415777206421, -0.5306010246276855, 1.036712646484375, 0.4123408794403076, 1.203832745552063, -1.7645032405853271, -0.025426361709833145, -0.23565050959587097, 0.13257324695587158, -1.3434951305389404, -1.6173202991485596, 0.5916923880577087, 0.6265110373497009, 0.5606412291526794, -0.1280490756034851, 0.9553745985031128, -0.9875923991203308, 0.8965924978256226, -0.9229493737220764, -1.6069104671478271, -1.4031822681427002, -2.1895370483398438, -2.181703567504883, 0.8404982089996338, -0.4954564869403839, -0.5134320259094238, 2.0405161380767822, -1.0506904125213623, -1.7692314386367798, 1.1765435934066772, 0.3097708225250244, 0.022559374570846558, 2.38126802444458, 0.2319096177816391, -0.7021857500076294, 0.376255065202713, -0.7011788487434387, 0.9039373993873596, -0.415278822183609, 1.3434691429138184, 0.4743625223636627, -1.0076595544815063, 1.645561695098877, -0.42927324771881104, 0.4915415048599243, -0.6512906551361084, -0.6052067875862122, -0.8046450614929199, 0.349818617105484, 1.8721486330032349, -0.34256798028945923, 1.6335208415985107, -0.39468711614608765, -1.569830298423767, -1.5160014629364014, 0.9180278778076172, 0.5599204301834106, -0.8594346046447754, 0.07539953291416168, -0.36262625455856323, 0.09110300987958908, -0.017803821712732315, 1.196448564529419, 1.2349073886871338, 0.66864413022995, -0.2721445560455322, -0.8877164721488953, 0.19373586773872375, -0.15283121168613434, -0.6304514408111572, -1.8629177808761597, -0.36081209778785706, 0.25658273696899414, 0.6494793891906738, -1.2555174827575684, 1.721116065979004, 0.9060038924217224, 1.922763466835022, 0.9986599683761597, -0.41402050852775574, 1.5303318500518799, 0.015887487679719925, 1.825178861618042, -0.5343596935272217, 0.6871006488800049, -0.2933259606361389, -1.1201400756835938, 0.8047250509262085, -0.3189992606639862, -2.0457987785339355, -0.7127019762992859, -0.843249499797821, -0.25547710061073303, -0.6813125610351562, 0.9081569314002991, -0.32582393288612366, -1.3576658964157104, 0.28939250111579895, -0.6371786594390869, 0.13900688290596008, -1.1974945068359375, 0.2620283365249634, 0.7678893208503723, -0.635504961013794, -0.036030154675245285, -0.22688347101211548, -1.2994648218154907, -0.47322261333465576, 0.2989363968372345, 1.8736963272094727, -0.6526532769203186, 1.0090851783752441, 0.9410070776939392, -0.7070743441581726, -0.04128343239426613, 0.32942190766334534, -0.29208317399024963, 0.9066588878631592, -1.0650513172149658, -0.45471420884132385, 1.0271543264389038, -0.15286989510059357, -0.534965455532074, 1.4500735998153687, 0.7449029088020325, -0.9111611247062683, -0.3286389112472534, -0.22921234369277954, -0.8699168562889099, -0.03230581432580948, -1.5921226739883423, -0.2393360435962677, 0.2961008548736572, -1.4685250520706177, -0.48551034927368164, -0.27194392681121826, 1.308382511138916, -0.13279201090335846, 1.392189860343933, -0.32780951261520386, -0.2709139883518219, -0.4221207797527313, -0.41376981139183044, 0.14344316720962524, -0.20327721536159515, -0.6611888408660889, 0.19556750357151031, -0.7834758162498474, 0.3543817102909088, 1.4493076801300049, 0.40003952383995056, 0.07498529553413391, 0.5597497820854187, 1.0958328247070312, 0.34563371539115906, 0.0025619976222515106, -0.8639170527458191, -1.5681906938552856, 1.9336265325546265, -1.4987248182296753, 1.9808025360107422, 0.855988085269928, -0.005524714943021536, -1.8114017248153687, -1.830674409866333, 1.3995288610458374, 1.2365272045135498, 2.378521203994751, 0.5427609086036682, 0.42382633686065674, -0.820096492767334, -0.6827681064605713, 0.31542500853538513, -1.096752405166626, -0.7381206154823303, 0.1434333175420761, 2.3732664585113525, 1.768699288368225, -0.5566830039024353, -0.1953517496585846, -1.032738447189331, 1.3370991945266724, -0.1335468590259552, 0.1310420036315918, 2.053560495376587, -0.29617637395858765, -1.0957694053649902, 1.2485969066619873, -2.3253300189971924, 0.13891781866550446, 1.9723774194717407, 0.3243991434574127, 0.023295391350984573, -1.4166005849838257, -0.5383382439613342, -0.2764469385147095, -0.38614776730537415, -1.2676292657852173, 0.5365118384361267, -0.25933942198753357, -0.8430466055870056, -1.522572636604309, 0.05105515941977501, -1.1041055917739868, -1.652827501296997, 0.41382741928100586, 1.863889217376709, 2.0594046115875244, -0.7264965772628784, 1.4686024188995361, -0.30515313148498535, 0.08604974299669266, 1.2148303985595703, 1.1963762044906616, 3.1110050678253174, 1.9135173559188843, -1.2598819732666016, 0.5754688382148743, -0.13196690380573273, -0.5141631960868835, 1.1012959480285645, -1.0508805513381958, 1.2746654748916626, -0.2135986089706421, -1.1935086250305176, -1.189926266670227, 1.0498569011688232, 0.5397949814796448, 0.029757369309663773, -0.5080065131187439, 1.2735852003097534, 0.10223883390426636, 1.2833670377731323, 0.5756624341011047, -0.3940843343734741, 0.5636618733406067, -0.4303598403930664, -0.5597923398017883, 1.6801236867904663, 0.12757691740989685, -1.4471110105514526, -2.3508012294769287, -0.2251991182565689, -0.8204888701438904, 0.05329608544707298, -0.6524208188056946, -1.002364158630371, 1.608379602432251, 0.4059509336948395, -1.3197466135025024, -0.2682943046092987, -0.46772468090057373, -0.66828453540802, 2.5846107006073, -1.4980719089508057, -0.2244766801595688, -0.981475830078125, -0.5043831467628479, 1.5196350812911987, -1.2079384326934814, -0.17654933035373688, -1.0257823467254639, -0.6354604959487915, -1.3114254474639893, -0.5806307196617126, -0.054316915571689606, -0.8038949966430664, 0.7699017524719238, 0.07969050109386444, -1.047104835510254, -0.2752543091773987, -0.8467511534690857, 0.8408204913139343, -0.1397484838962555, 0.2317551076412201, 1.9030711650848389, 0.4048483669757843, -0.383276104927063, 0.7435979247093201, 1.1896756887435913, 0.6053392291069031, -0.6455749273300171, 0.20681767165660858, -0.5994835495948792, 0.2398160696029663, -1.3945634365081787, 0.3026086390018463, -2.8989076614379883, 0.72336345911026, -0.015016534365713596, -0.07135339081287384, 0.020996619015932083, -1.2801494598388672, 1.0937119722366333, 2.56292986869812, -1.2203699350357056, 0.370404452085495, 0.3707585036754608, 1.1152266263961792, -1.6512647867202759, 0.2757185101509094, -0.4180808365345001, 2.1256065368652344, 0.2053910791873932, 1.1155316829681396, -0.5976439714431763, -2.175356388092041, 0.5247049331665039, -1.1257039308547974, -1.1132454872131348, 0.7679246664047241, -0.8224048018455505, 0.13093720376491547, -1.492746353149414, -0.2089819610118866, -0.8997538089752197, -1.250869870185852, 0.7761156558990479, 0.08905328065156937, 0.4765298068523407, -0.6316662430763245, 0.2661403715610504, -2.128685235977173, -1.383746862411499, -0.1793357878923416, -0.9321070313453674, 0.5452336072921753, -0.27897587418556213, 0.7215709686279297, -0.10467857867479324, 0.1597791314125061, 0.27407556772232056, 1.3614307641983032, 3.368741750717163, 0.25422006845474243, 0.39913564920425415, -0.14248161017894745, -0.8795861005783081, 1.427173376083374, 1.011971116065979, -0.030492283403873444, -0.5602697134017944, -1.0079102516174316, 1.2868902683258057, 1.918816328048706, 0.9862560033798218, 0.14582078158855438, -0.8009974360466003, -0.6123017072677612, 0.03877547010779381, 0.23193232715129852, 0.4963653087615967, 0.9445397853851318, 0.0357772521674633, 0.22115297615528107, 1.4003995656967163, 1.2789692878723145, -0.44939109683036804, 0.4776962399482727, -0.8676995635032654, -0.46672460436820984, 0.42211616039276123, 0.3150441646575928, -0.022979941219091415, 0.3780156672000885, -1.0447572469711304, -0.33043649792671204, -0.3902122676372528, -1.0664204359054565, -0.6918638944625854, -0.41425907611846924, -0.3825934827327728, 1.6362907886505127, 0.06160058081150055, -0.41753944754600525, -0.01987856812775135, -0.7417287230491638, -0.15887333452701569, -1.0947672128677368, 0.2197505235671997, -0.09093567728996277, -0.07432453334331512, -0.11071353405714035, 1.7572050094604492, -0.828258216381073, -2.0489566326141357, 0.23324453830718994, 0.2980756163597107, -0.463221937417984, 0.1540798544883728, 1.688570261001587, 0.4715620279312134, 1.4854629039764404, 1.3328601121902466, 0.9565948843955994, -0.5592761039733887, -1.1887099742889404, 0.6977790594100952, 0.9615182280540466, -1.422263264656067, 0.7711441516876221, -0.023710627108812332, -0.5443717241287231, 0.7590475678443909, 1.3423112630844116, 0.4637114405632019, -2.015972852706909, 0.8356300592422485, -0.883181631565094, 0.7794557809829712, 0.6722030639648438, 0.7552884221076965, 0.23476916551589966, 0.8983392119407654, -1.3167616128921509, -1.1689190864562988, -0.7991052865982056, -0.6028503179550171, 2.0100581645965576, -0.21015553176403046, 0.5482832789421082, -0.17845816910266876, -1.3445491790771484, -0.1243605986237526, 0.746467649936676, 0.4276596009731293, -0.4237808287143707, 0.8404674530029297, -0.6659812927246094, -1.0763416290283203, -1.3794537782669067, -0.3622642159461975, -0.9423856139183044, -0.8984110355377197, 0.9948199987411499, 0.9108853936195374, 0.3186678886413574, 1.89913010597229, 0.5911116600036621, 0.16565614938735962, -2.6322250366210938, 0.8582753539085388, 0.34521058201789856, -0.06953556090593338, 1.0210691690444946, 0.2557648718357086, 1.0864450931549072, 0.05384445935487747, 0.5050198435783386, -2.359137773513794, 2.229954242706299, -0.2453499287366867, 0.8127419352531433, -0.023416511714458466, -0.22306276857852936, 1.1578340530395508, 0.5248105525970459, 0.6046856641769409, -1.1301366090774536, 0.669189989566803, -0.6161143779754639, 1.1820770502090454, 0.9762065410614014, -0.7941941618919373, -0.03854876756668091, 1.3916058540344238, 0.5365169644355774, -0.5118411779403687, -0.8980003595352173, -0.9455628395080566, 0.894052267074585, 1.842917561531067, 0.009848193265497684, 0.03889459744095802, 0.8720511198043823, 0.7002176642417908, -1.3591965436935425, 0.16449576616287231, -0.7418420314788818, -0.8747477531433105, 1.6328339576721191, 1.9996141195297241, -0.05989152565598488, -0.20912960171699524, -0.6850178837776184, -1.2860666513442993, 0.7608028054237366, 0.025922685861587524, 0.1681457906961441, 0.7193697094917297, -0.6481680870056152, 1.1459016799926758, 0.8140605092048645, 0.921005129814148, 0.1177007183432579, 0.34582340717315674, 0.3296002745628357, -0.3351980745792389, -1.146451711654663, -0.26629671454429626, -1.1424648761749268, -2.453411340713501, 0.45075690746307373, -0.23943668603897095, -1.4912489652633667, -0.01887325942516327, -1.006822943687439, 0.8987507224082947, -0.6610403060913086, -1.131389856338501, -1.635007381439209, 0.2490505874156952, -0.09032431244850159, 0.9532210826873779, -1.5823659896850586, -0.12783019244670868, 1.1758368015289307, 0.90289705991745, -0.5694254636764526, 0.98736971616745, 0.2966729700565338, 0.9464187622070312, 0.8477367162704468, -0.4870254397392273, 0.4308779537677765, 0.18989822268486023, -1.3858801126480103, 0.48624441027641296, 1.1389013528823853, 0.25546392798423767, 1.398863673210144, -0.5319953560829163, 0.06617177277803421, 0.4492265582084656, -0.5061199069023132, -0.4279666244983673, -0.5902252793312073, 0.6226134300231934, -0.008820727467536926, -0.9369824528694153, 0.10448648780584335, -0.115692138671875, -0.23205767571926117, 0.22547028958797455, -1.551722764968872, -0.2976067066192627, -0.45373478531837463, -0.5474672317504883, -1.2673720121383667, -0.00719688693061471, 1.389671802520752, -0.7627406716346741, -0.1557873785495758, 0.4795491397380829, 0.5129112005233765, 0.5476949214935303, 0.6411442756652832, -0.5825075507164001, -0.44335928559303284, -0.2602473199367523, -0.36509135365486145, 0.2563634514808655, 1.2025761604309082, -0.17871487140655518, -0.9848769903182983, 0.7182918787002563, -0.43070635199546814, 0.08207756280899048, 1.9300198554992676, 0.07051805406808853, -0.7456770539283752, 0.36831676959991455, -0.7058619260787964, 1.8539055585861206, 1.6690473556518555, 1.3469855785369873, -0.09574615210294724, -0.8534078598022461, 0.6658946871757507, -0.29348024725914, -0.35083529353141785, 1.0016926527023315, 0.5110241174697876, -0.14574994146823883, -1.4153108596801758, 0.5887893438339233, 1.378193974494934, -0.9018329977989197, -0.80788654088974, 0.0659981295466423, -0.8454011678695679, 1.1021342277526855, 0.5916857123374939, 0.3854754567146301, 0.24056242406368256, 1.606041431427002, 0.6748390793800354, -0.5103560090065002, 0.5856528282165527, 0.5288597941398621, -0.19366644322872162, -2.143338918685913, -1.1911321878433228, 0.2714669704437256, -0.34681466221809387, -1.571167230606079, 1.3774800300598145, -1.1365388631820679, -0.9766055345535278, 0.4824711084365845, 0.06137321889400482, 1.359201431274414, 0.2541082799434662, 1.6659574508666992, 2.0829148292541504, 0.830781877040863, 0.3266570568084717, 1.4299999475479126, -0.05961870774626732, -0.4199075400829315, 1.8549723625183105, -0.4788393974304199, 0.5629172921180725, 1.0804622173309326, -0.390434592962265, -1.1328375339508057, -0.7976038455963135, -1.1928741931915283, -0.6367001533508301, 1.1814359426498413, 0.09256348013877869, -1.091443419456482, 0.21893839538097382, 1.5886603593826294, 0.1702464371919632, -0.311226487159729, 0.5694724917411804, 0.4442196786403656, -0.7158570885658264, -0.09342712163925171, -0.9620754718780518, 0.49960005283355713, -0.20174641907215118, -0.24663996696472168, 0.32199960947036743, 0.5024550557136536, 1.1772613525390625, -0.041081756353378296, 0.02171478047966957, 1.2066218852996826, -1.433227777481079, 1.5358235836029053, -0.5670710206031799, 0.2827036678791046, -2.450439453125, 1.4432333707809448, -0.6924747824668884, 1.9492058753967285, -2.624058246612549, 0.3968396484851837, -0.6611437797546387, -0.40308892726898193, 0.37661415338516235, -0.3403385281562805, 0.17304199934005737, -0.20961450040340424, -1.0348654985427856, -0.10287440568208694, -0.7920450568199158, 0.537664532661438, 1.2048588991165161, 1.3629834651947021, -1.1107827425003052, -0.22954384982585907, -1.7374032735824585, -0.15718340873718262, -0.7094470262527466, 0.3142068088054657, -2.0754172801971436, -0.18612729012966156, -1.9169738292694092, -2.367281198501587, -1.3464046716690063, -0.8172323107719421, 1.0224031209945679, 0.18779069185256958, -0.9233232140541077, 1.0424519777297974, -0.4031226336956024, -1.8132543563842773, 1.0893402099609375, -2.135648488998413 ]
https://github.com/huggingface/datasets/issues/4430
Add ability to load newer, cleaner version of Multi-News
@mariosasko Awesome thanks! I will do that. Looks like this new version of the data is not available as a zip but as three files (train/dev/test). How is this usually handled in HF Datasets, should `_URL` be a dict with keys `train`, `val`, `test` perhaps?
**Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`?
734
45
Add ability to load newer, cleaner version of Multi-News **Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`? @mariosasko Awesome thanks! I will do that. Looks like this new version of the data is not available as a zip but as three files (train/dev/test). How is this usually handled in HF Datasets, should `_URL` be a dict with keys `train`, `val`, `test` perhaps?
[ -1.1654938459396362, -0.9414830803871155, -0.7672776579856873, 1.4234099388122559, -0.19994588196277618, -1.2627019882202148, 0.18489781022071838, -1.0086463689804077, 1.6640255451202393, -0.7538171410560608, 0.31212326884269714, -1.69741690158844, -0.01417223084717989, -0.5650848150253296, -0.8113649487495422, -0.805229902267456, -0.3989883363246918, -0.8352415561676025, 0.8798874616622925, 2.554421901702881, 1.1618269681930542, -1.4177502393722534, 2.707975149154663, 0.7074228525161743, -0.15690261125564575, -0.9857634902000427, 0.48050442337989807, 0.062213629484176636, -1.2039788961410522, -0.4357912242412567, -0.932309627532959, -0.025555012747645378, -0.5945304036140442, -0.5046774744987488, 0.04665473848581314, 0.34867188334465027, -0.21408513188362122, -0.35361573100090027, -0.6463234424591064, -0.7301104664802551, 0.5253127813339233, -0.38529372215270996, 0.9234928488731384, -0.2982805669307709, 1.8169499635696411, -0.6236216425895691, 0.3278500437736511, 0.7848348617553711, 1.3463691473007202, 0.18075473606586456, -0.07151233404874802, 0.28799211978912354, 0.34393051266670227, -0.045254044234752655, 0.4551222324371338, 1.223677396774292, 0.6607030034065247, 0.49480128288269043, 0.6920174360275269, -2.223012685775757, 1.3512663841247559, -1.0854662656784058, 0.35210978984832764, 1.299081563949585, -0.963283360004425, 0.41849982738494873, -1.8271411657333374, -0.05993302911520004, 0.564388632774353, -2.2900640964508057, 0.16136354207992554, -1.3542499542236328, -0.5995831489562988, 0.8903336524963379, 0.19958288967609406, -1.264304757118225, 0.22610847651958466, -0.5008614659309387, 1.0342761278152466, 0.4207342267036438, 1.1739777326583862, -1.7877405881881714, -0.06234365701675415, -0.24789990484714508, 0.15055210888385773, -1.3377357721328735, -1.604881763458252, 0.5891156792640686, 0.6444659233093262, 0.5510066151618958, -0.1335984766483307, 0.9612255692481995, -1.0000394582748413, 0.8765854835510254, -0.965701162815094, -1.6193256378173828, -1.401974081993103, -2.16985821723938, -2.188798666000366, 0.821962833404541, -0.48531046509742737, -0.5080050826072693, 2.016756534576416, -1.028457760810852, -1.7773152589797974, 1.1538879871368408, 0.2972477078437805, 0.007921183481812477, 2.3826401233673096, 0.22951547801494598, -0.6939629316329956, 0.3893522322177887, -0.712858259677887, 0.8806123733520508, -0.3979770541191101, 1.3728816509246826, 0.4571426808834076, -1.022274136543274, 1.6670682430267334, -0.4311676025390625, 0.5103803277015686, -0.67330002784729, -0.5942336916923523, -0.7652251124382019, 0.3445216119289398, 1.856668472290039, -0.3427990674972534, 1.6029762029647827, -0.41603824496269226, -1.5693604946136475, -1.5307037830352783, 0.9359312653541565, 0.5536205172538757, -0.8641846776008606, 0.03755543380975723, -0.39613136649131775, 0.10303841531276703, -0.015153158456087112, 1.1881992816925049, 1.219457983970642, 0.6735177636146545, -0.267203688621521, -0.8531931042671204, 0.18029730021953583, -0.14485181868076324, -0.6247708797454834, -1.8676570653915405, -0.35439401865005493, 0.24837064743041992, 0.6541566848754883, -1.2186139822006226, 1.7604776620864868, 0.8929165601730347, 1.916430115699768, 1.002605676651001, -0.41357386112213135, 1.5173428058624268, -0.01786869391798973, 1.8327909708023071, -0.5486690998077393, 0.6751703023910522, -0.31082767248153687, -1.1084131002426147, 0.8409683108329773, -0.29018616676330566, -2.045722007751465, -0.7016922831535339, -0.8290466666221619, -0.26383063197135925, -0.6957579255104065, 0.8772109746932983, -0.2976706922054291, -1.3489704132080078, 0.26901954412460327, -0.6215541362762451, 0.14870303869247437, -1.1814522743225098, 0.286458283662796, 0.7588112950325012, -0.6234642267227173, 0.016815226525068283, -0.21840131282806396, -1.3001513481140137, -0.5196322798728943, 0.3032844662666321, 1.8828035593032837, -0.6646976470947266, 0.9723061919212341, 0.9649326205253601, -0.7265756726264954, -0.021706877276301384, 0.34699729084968567, -0.2734909951686859, 0.8680500984191895, -1.0520479679107666, -0.4120612144470215, 1.0411370992660522, -0.17251558601856232, -0.525188148021698, 1.4693065881729126, 0.7657299041748047, -0.9445121884346008, -0.32522737979888916, -0.24958732724189758, -0.8598927855491638, -0.013357415795326233, -1.602020502090454, -0.22746913135051727, 0.29399171471595764, -1.4598430395126343, -0.501611590385437, -0.2810746729373932, 1.3277350664138794, -0.1195954978466034, 1.3688876628875732, -0.32761257886886597, -0.30135515332221985, -0.3938915431499481, -0.4265109896659851, 0.13530685007572174, -0.20639701187610626, -0.6495899558067322, 0.21587516367435455, -0.7817174196243286, 0.3574415445327759, 1.4672787189483643, 0.39664599299430847, 0.07598098367452621, 0.5341963768005371, 1.117749571800232, 0.3442513048648834, -0.016982465982437134, -0.8496291041374207, -1.5427862405776978, 1.9276576042175293, -1.500348448753357, 1.9507263898849487, 0.8387700915336609, 0.024967500939965248, -1.794567346572876, -1.8405295610427856, 1.4116802215576172, 1.2398022413253784, 2.3799641132354736, 0.5637863874435425, 0.38603511452674866, -0.8397725820541382, -0.6711829900741577, 0.3223356008529663, -1.0742614269256592, -0.7524981498718262, 0.146505668759346, 2.3740506172180176, 1.7705280780792236, -0.5866567492485046, -0.19890093803405762, -1.057855248451233, 1.352264642715454, -0.1364358514547348, 0.16194890439510345, 2.057384729385376, -0.3272337317466736, -1.0892410278320312, 1.2818008661270142, -2.328428030014038, 0.15014447271823883, 1.957698941230774, 0.3092111349105835, 0.05380590260028839, -1.3991166353225708, -0.5540356636047363, -0.3037870228290558, -0.3891429603099823, -1.253574013710022, 0.5480639934539795, -0.24798521399497986, -0.8527043461799622, -1.552252173423767, 0.0734538584947586, -1.1099488735198975, -1.6541379690170288, 0.40458443760871887, 1.892425775527954, 2.048917531967163, -0.7146701216697693, 1.4975287914276123, -0.3034147024154663, 0.09003859013319016, 1.2539000511169434, 1.2224996089935303, 3.139397621154785, 1.9333235025405884, -1.221177101135254, 0.5947849154472351, -0.15641960501670837, -0.5160291194915771, 1.1070621013641357, -1.0678484439849854, 1.2406831979751587, -0.235282301902771, -1.1872313022613525, -1.198520302772522, 1.0263147354125977, 0.527962327003479, 0.03171636164188385, -0.4844474494457245, 1.2475526332855225, 0.1282254308462143, 1.2695081233978271, 0.5880618095397949, -0.3675370216369629, 0.5748355388641357, -0.4182148873806, -0.523639440536499, 1.6676042079925537, 0.1711909919977188, -1.441745400428772, -2.353215217590332, -0.21110078692436218, -0.8405206799507141, 0.03556801378726959, -0.640324592590332, -1.0070533752441406, 1.6092619895935059, 0.40563565492630005, -1.3242230415344238, -0.2390017807483673, -0.4218955636024475, -0.6380607485771179, 2.5964670181274414, -1.4820566177368164, -0.23290568590164185, -0.969736635684967, -0.5170549750328064, 1.5574272871017456, -1.2078429460525513, -0.16530708968639374, -1.0068359375, -0.600109338760376, -1.3179693222045898, -0.5709598064422607, -0.06831240653991699, -0.8351262211799622, 0.7888230681419373, 0.07073397189378738, -1.0650817155838013, -0.28927403688430786, -0.8785933256149292, 0.8494554162025452, -0.15419656038284302, 0.23538188636302948, 1.9050421714782715, 0.4152083992958069, -0.3698940575122833, 0.7421910166740417, 1.1959822177886963, 0.6044134497642517, -0.6150563955307007, 0.24014577269554138, -0.6145641207695007, 0.2855491638183594, -1.3989973068237305, 0.305438756942749, -2.8932442665100098, 0.7236911654472351, -0.024023639038205147, -0.07846564054489136, 0.006708154454827309, -1.318956971168518, 1.0834846496582031, 2.5465853214263916, -1.219696283340454, 0.3647015690803528, 0.35692086815834045, 1.1457005739212036, -1.6394705772399902, 0.2633711099624634, -0.41903093457221985, 2.1198959350585938, 0.19907526671886444, 1.123422384262085, -0.5617504715919495, -2.1737864017486572, 0.5199983716011047, -1.143978238105774, -1.1258388757705688, 0.7532733082771301, -0.7999320030212402, 0.09982217848300934, -1.5033059120178223, -0.193140909075737, -0.9313312768936157, -1.2519274950027466, 0.8065392971038818, 0.10556196421384811, 0.47259142994880676, -0.6496330499649048, 0.27748727798461914, -2.104306697845459, -1.3918544054031372, -0.20612917840480804, -0.9200166463851929, 0.5571796298027039, -0.24981912970542908, 0.7034597396850586, -0.13580173254013062, 0.12486011534929276, 0.29624781012535095, 1.3843421936035156, 3.37534499168396, 0.24114397168159485, 0.4134930372238159, -0.14708974957466125, -0.8764603137969971, 1.4422143697738647, 0.9999658465385437, -0.024981584399938583, -0.5456749796867371, -1.0183323621749878, 1.2413913011550903, 1.916066288948059, 1.0047883987426758, 0.11404476314783096, -0.795559287071228, -0.6363651752471924, 0.019309502094984055, 0.22237461805343628, 0.4705001711845398, 0.953377366065979, 0.04791032522916794, 0.17980819940567017, 1.3913116455078125, 1.2765132188796997, -0.4686702787876129, 0.4714218080043793, -0.8660569787025452, -0.4578009247779846, 0.4166874885559082, 0.2970176041126251, 0.0017815614119172096, 0.3571852743625641, -1.049356460571289, -0.301706463098526, -0.3850872218608856, -1.0327351093292236, -0.7208308577537537, -0.4539202153682709, -0.37091779708862305, 1.6237993240356445, 0.06114126741886139, -0.45266830921173096, -0.03354702144861221, -0.7367978096008301, -0.15933912992477417, -1.0543001890182495, 0.24256306886672974, -0.11807932704687119, -0.09201264381408691, -0.1221044510602951, 1.733899712562561, -0.8497603535652161, -2.0527942180633545, 0.26318833231925964, 0.29840919375419617, -0.4776010513305664, 0.20723648369312286, 1.661444067955017, 0.4773290753364563, 1.4793369770050049, 1.3656339645385742, 0.969619870185852, -0.5677458643913269, -1.2007372379302979, 0.7172558903694153, 0.9445837140083313, -1.4061652421951294, 0.7715279459953308, 0.012074319645762444, -0.5135705471038818, 0.7469469308853149, 1.3244508504867554, 0.4535519778728485, -2.0158193111419678, 0.8027847409248352, -0.8806807994842529, 0.7438317537307739, 0.6823627352714539, 0.763412594795227, 0.24876272678375244, 0.867992639541626, -1.2794545888900757, -1.1678544282913208, -0.7996384501457214, -0.6185591220855713, 2.0003786087036133, -0.21494171023368835, 0.5598238110542297, -0.14541873335838318, -1.3449348211288452, -0.12977388501167297, 0.7616884708404541, 0.4356677830219269, -0.47702327370643616, 0.8213443160057068, -0.6433558464050293, -1.0705980062484741, -1.3146047592163086, -0.3683050274848938, -0.9895084500312805, -0.9092631340026855, 0.9799683690071106, 0.905868649482727, 0.34199613332748413, 1.9123890399932861, 0.5823739171028137, 0.2046937197446823, -2.63287615776062, 0.8611622452735901, 0.3547039031982422, -0.058253154158592224, 1.004030704498291, 0.28700676560401917, 1.036124587059021, 0.025434380397200584, 0.5385889410972595, -2.3578543663024902, 2.2512943744659424, -0.23824816942214966, 0.8075554370880127, -0.021516352891921997, -0.21692821383476257, 1.1466777324676514, 0.5197210907936096, 0.5716024041175842, -1.145355224609375, 0.6721615195274353, -0.6287370920181274, 1.1776025295257568, 0.9590575695037842, -0.7955545783042908, -0.015766026452183723, 1.371540904045105, 0.527574360370636, -0.504406213760376, -0.9147627949714661, -0.9226126074790955, 0.9135844707489014, 1.8116940259933472, -0.025732271373271942, 0.007316002622246742, 0.8881730437278748, 0.6953967809677124, -1.3451911211013794, 0.14906752109527588, -0.7111966013908386, -0.826478123664856, 1.624197244644165, 1.9894214868545532, -0.07497192919254303, -0.20054493844509125, -0.6917111277580261, -1.26760995388031, 0.767242431640625, 0.06628881394863129, 0.1343601942062378, 0.710088849067688, -0.6632969379425049, 1.1573803424835205, 0.8237254023551941, 0.9104973077774048, 0.1478157937526703, 0.3781313896179199, 0.35411491990089417, -0.35548898577690125, -1.138283371925354, -0.2997496724128723, -1.1910109519958496, -2.4396016597747803, 0.45466288924217224, -0.25760096311569214, -1.481031894683838, -0.008030389435589314, -1.031952977180481, 0.8986309170722961, -0.6625677347183228, -1.1361923217773438, -1.6477031707763672, 0.26921504735946655, -0.07213817536830902, 0.9477715492248535, -1.6075605154037476, -0.1179540827870369, 1.154406189918518, 0.8880211710929871, -0.5919086933135986, 0.9837407469749451, 0.30484485626220703, 0.9534534215927124, 0.8695549368858337, -0.4652820825576782, 0.4445008337497711, 0.1605411171913147, -1.3805116415023804, 0.47563937306404114, 1.1455748081207275, 0.2364601492881775, 1.3958086967468262, -0.5445358157157898, 0.08010662347078323, 0.427716463804245, -0.5171843767166138, -0.4718968868255615, -0.5863722562789917, 0.6332176327705383, 0.015233820304274559, -0.9316297173500061, 0.07002934068441391, -0.08923304826021194, -0.2158052921295166, 0.23030085861682892, -1.5521581172943115, -0.27414214611053467, -0.43584123253822327, -0.5149378180503845, -1.2812055349349976, -0.04087110608816147, 1.3895635604858398, -0.7276473641395569, -0.1483144313097, 0.5183363556861877, 0.4923592209815979, 0.5498459935188293, 0.625443160533905, -0.5711697340011597, -0.44194331765174866, -0.2565051317214966, -0.3736826479434967, 0.2918206751346588, 1.2281686067581177, -0.1724119782447815, -1.0020049810409546, 0.7406179904937744, -0.449895441532135, 0.09732572734355927, 1.934942603111267, 0.047506287693977356, -0.7461596727371216, 0.36565086245536804, -0.7194737195968628, 1.8466039896011353, 1.719215750694275, 1.32403564453125, -0.08098272234201431, -0.8571701049804688, 0.6547545790672302, -0.3001770079135895, -0.3431393802165985, 0.9939762949943542, 0.45683103799819946, -0.18738678097724915, -1.4129436016082764, 0.5971692204475403, 1.4111194610595703, -0.8951115608215332, -0.7979734539985657, 0.06383416801691055, -0.8441757559776306, 1.092030644416809, 0.600854218006134, 0.36320751905441284, 0.2410103976726532, 1.605172038078308, 0.6809078454971313, -0.47965890169143677, 0.5744072198867798, 0.5218455195426941, -0.1855846792459488, -2.175684928894043, -1.2157284021377563, 0.2772175371646881, -0.37453868985176086, -1.5962368249893188, 1.3482756614685059, -1.1521564722061157, -0.9737014770507812, 0.5131935477256775, 0.07633507996797562, 1.373934030532837, 0.2580207586288452, 1.6510937213897705, 2.1237308979034424, 0.804621160030365, 0.3459727168083191, 1.399155616760254, -0.07562332600355148, -0.4231311082839966, 1.842502236366272, -0.4661542475223541, 0.5587632060050964, 1.0913300514221191, -0.36825016140937805, -1.1395199298858643, -0.7988012433052063, -1.1872103214263916, -0.6405171751976013, 1.208966612815857, 0.09175511449575424, -1.1296859979629517, 0.2381788045167923, 1.594855546951294, 0.12254970520734787, -0.33150336146354675, 0.5420991778373718, 0.42702871561050415, -0.742371678352356, -0.0713597759604454, -0.9629597663879395, 0.5229182243347168, -0.20533092319965363, -0.2558499276638031, 0.33949974179267883, 0.5248672962188721, 1.1746333837509155, -0.03717312216758728, 0.02945989929139614, 1.188003659248352, -1.4429407119750977, 1.5384999513626099, -0.5848301649093628, 0.2778424322605133, -2.4305338859558105, 1.4730734825134277, -0.6785866022109985, 1.9328376054763794, -2.6439759731292725, 0.38773754239082336, -0.6170883178710938, -0.4268340468406677, 0.34220126271247864, -0.3107202649116516, 0.1724833995103836, -0.1853211522102356, -1.0171895027160645, -0.09384515881538391, -0.7636483311653137, 0.5119986534118652, 1.1994423866271973, 1.3910082578659058, -1.1198660135269165, -0.2529716193675995, -1.7574849128723145, -0.1723777800798416, -0.6931118965148926, 0.3088569641113281, -2.075390577316284, -0.18083138763904572, -1.901321530342102, -2.3467493057250977, -1.3499678373336792, -0.8295512199401855, 1.0077242851257324, 0.1587674468755722, -0.9046826362609863, 1.0558465719223022, -0.4285968542098999, -1.8365535736083984, 1.0942823886871338, -2.1620848178863525 ]
https://github.com/huggingface/datasets/issues/4430
Add ability to load newer, cleaner version of Multi-News
Yes! Let me help you with more detailed instructions. In the first step, we need to update the URLs. One of the possible dictionary structures is as follows: ```python _URLs = { "train": {"src": "https://drive.google.com/uc?export=download&id=1wHAWDOwOoQWSj7HYpyJ3Aeud8WhhaJ7P", "tgt": "https://drive.google.com/uc?export=download&id=1QVgswwhVTkd3VLCzajK6eVkcrSWEK6kq"} "val": ... "test": ... } ``` (You can use this page to generate direct download links: https://sites.google.com/site/gdocs2direct/) Then we move to the `split_generators` method: ```python def _split_generators(self, dl_manager): """Returns SplitGenerators.""" files = dl_manager.download(_URLs) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"src_file": files["train"]["src"], "tgt_file": files["train"]["tgt"]}, ), ... # same for val and test ] ``` Finally, we adjust the signature of `_generate_examples`: ```python def _generate_examples(self, src_file, tgt_file): """Yields examples.""" with open(src_file, encoding="utf-8") as src_f, open( tgt_file, encoding="utf-8" ) as tgt_f: ... # the rest is the same ``` And that's it! PS: Let me know if you need help updating the dummy data and regenerating the metadata file.
**Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`?
734
141
Add ability to load newer, cleaner version of Multi-News **Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`? Yes! Let me help you with more detailed instructions. In the first step, we need to update the URLs. One of the possible dictionary structures is as follows: ```python _URLs = { "train": {"src": "https://drive.google.com/uc?export=download&id=1wHAWDOwOoQWSj7HYpyJ3Aeud8WhhaJ7P", "tgt": "https://drive.google.com/uc?export=download&id=1QVgswwhVTkd3VLCzajK6eVkcrSWEK6kq"} "val": ... "test": ... } ``` (You can use this page to generate direct download links: https://sites.google.com/site/gdocs2direct/) Then we move to the `split_generators` method: ```python def _split_generators(self, dl_manager): """Returns SplitGenerators.""" files = dl_manager.download(_URLs) return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"src_file": files["train"]["src"], "tgt_file": files["train"]["tgt"]}, ), ... # same for val and test ] ``` Finally, we adjust the signature of `_generate_examples`: ```python def _generate_examples(self, src_file, tgt_file): """Yields examples.""" with open(src_file, encoding="utf-8") as src_f, open( tgt_file, encoding="utf-8" ) as tgt_f: ... # the rest is the same ``` And that's it! PS: Let me know if you need help updating the dummy data and regenerating the metadata file.
[ -1.1866450309753418, -0.9036477208137512, -0.784929633140564, 1.3952783346176147, -0.2165578454732895, -1.232679843902588, 0.19921934604644775, -1.0669564008712769, 1.630368709564209, -0.7400505542755127, 0.3415530025959015, -1.64574134349823, 0.002742818556725979, -0.5491533279418945, -0.7809103727340698, -0.788105845451355, -0.39872246980667114, -0.8036176562309265, 0.8722659349441528, 2.553065538406372, 1.2094084024429321, -1.3968898057937622, 2.6929585933685303, 0.7350589036941528, -0.18844743072986603, -0.9631410241127014, 0.5055543184280396, 0.05474396049976349, -1.2638641595840454, -0.428101509809494, -0.9286085963249207, -0.043166883289813995, -0.5622585415840149, -0.4904704988002777, 0.053639523684978485, 0.37467336654663086, -0.22246164083480835, -0.37019455432891846, -0.7168143391609192, -0.7414237260818481, 0.5032837390899658, -0.4195536971092224, 0.9461961984634399, -0.30184897780418396, 1.7879703044891357, -0.6099753975868225, 0.3701906204223633, 0.7948275804519653, 1.33153235912323, 0.17813199758529663, -0.007547406945377588, 0.2602197229862213, 0.37599191069602966, -0.072562076151371, 0.44242939352989197, 1.23518705368042, 0.6854606866836548, 0.45399630069732666, 0.7300032377243042, -2.2165491580963135, 1.3129794597625732, -1.0672725439071655, 0.32299864292144775, 1.3306660652160645, -0.9226784706115723, 0.3958894908428192, -1.8772855997085571, -0.04838856682181358, 0.5581518411636353, -2.3007864952087402, 0.24010148644447327, -1.3072255849838257, -0.6073822379112244, 0.9044617414474487, 0.1949743926525116, -1.2276713848114014, 0.2194327861070633, -0.5246557593345642, 1.0090655088424683, 0.42717036604881287, 1.1955872774124146, -1.7507926225662231, -0.0869450643658638, -0.2557292878627777, 0.1296822875738144, -1.3224506378173828, -1.600624680519104, 0.5848645567893982, 0.6032830476760864, 0.551189124584198, -0.11391422897577286, 0.981923520565033, -1.0379688739776611, 0.8996269702911377, -0.9828647971153259, -1.6553020477294922, -1.442898154258728, -2.202122449874878, -2.1389355659484863, 0.7967056035995483, -0.47429853677749634, -0.49786505103111267, 1.969284176826477, -1.000594139099121, -1.7235236167907715, 1.1484190225601196, 0.27878209948539734, 0.03718810901045799, 2.359234094619751, 0.21644598245620728, -0.7114195227622986, 0.384310781955719, -0.7225347757339478, 0.8550595045089722, -0.37698936462402344, 1.3248172998428345, 0.42655521631240845, -0.9766747951507568, 1.6241616010665894, -0.43076586723327637, 0.5211031436920166, -0.6525677442550659, -0.5791211128234863, -0.7443975806236267, 0.30408570170402527, 1.8908894062042236, -0.3429884612560272, 1.5802377462387085, -0.3511618375778198, -1.5577524900436401, -1.5420376062393188, 0.9072311520576477, 0.5934638381004333, -0.8382012248039246, 0.033063530921936035, -0.3993063271045685, 0.12654107809066772, -0.07897493243217468, 1.1576770544052124, 1.2613911628723145, 0.7055560946464539, -0.2600806951522827, -0.8536514043807983, 0.17730283737182617, -0.13673707842826843, -0.6812437772750854, -1.8312698602676392, -0.3461848795413971, 0.26339536905288696, 0.6587634682655334, -1.2997926473617554, 1.7281975746154785, 0.9277715682983398, 1.9002320766448975, 1.0062333345413208, -0.4289279282093048, 1.5523021221160889, 0.018684763461351395, 1.799480676651001, -0.5551204085350037, 0.6602304577827454, -0.30313923954963684, -1.1199871301651, 0.8330808281898499, -0.28322964906692505, -2.090184450149536, -0.7029736638069153, -0.7999248504638672, -0.259787380695343, -0.68791663646698, 0.8943025469779968, -0.31456947326660156, -1.3273472785949707, 0.2368185669183731, -0.6592391133308411, 0.08219082653522491, -1.1934401988983154, 0.29554232954978943, 0.7330610752105713, -0.6353628039360046, 0.017134089022874832, -0.19979166984558105, -1.2793023586273193, -0.5070598721504211, 0.27548566460609436, 1.8913010358810425, -0.6847332119941711, 0.9128456711769104, 0.9898050427436829, -0.7329768538475037, 0.02956775575876236, 0.35430142283439636, -0.3233318626880646, 0.851632833480835, -1.078943133354187, -0.4447939991950989, 1.0144309997558594, -0.1318584829568863, -0.5369590520858765, 1.4449741840362549, 0.7343240976333618, -0.9682608842849731, -0.36541175842285156, -0.1908637136220932, -0.8432143330574036, -0.026626911014318466, -1.5770262479782104, -0.22326616942882538, 0.2837449014186859, -1.4816981554031372, -0.5137215852737427, -0.3040602207183838, 1.2938789129257202, -0.13938719034194946, 1.3928858041763306, -0.28478237986564636, -0.24286317825317383, -0.35481372475624084, -0.40964275598526, 0.12877832353115082, -0.23982495069503784, -0.6834481954574585, 0.21585102379322052, -0.8301658034324646, 0.345770001411438, 1.4751384258270264, 0.39850032329559326, 0.051319222897291183, 0.5318452715873718, 1.0755459070205688, 0.4002228379249573, -0.010976427234709263, -0.8729622960090637, -1.5123735666275024, 1.9322651624679565, -1.5263010263442993, 1.998707890510559, 0.864906370639801, 0.0028316201642155647, -1.8016544580459595, -1.883521556854248, 1.3331035375595093, 1.197217345237732, 2.417891025543213, 0.5440906882286072, 0.4084950089454651, -0.7691416144371033, -0.6548389196395874, 0.31721511483192444, -1.0882630348205566, -0.735292911529541, 0.15840253233909607, 2.3783419132232666, 1.7623591423034668, -0.5572527647018433, -0.23674027621746063, -1.0077425241470337, 1.327637791633606, -0.086257703602314, 0.1601586639881134, 2.094650983810425, -0.2546454071998596, -1.0858778953552246, 1.2846978902816772, -2.343632221221924, 0.1602584570646286, 1.950598955154419, 0.30551764369010925, 0.051027871668338776, -1.3916209936141968, -0.5946106910705566, -0.3203558027744293, -0.43958529829978943, -1.24736750125885, 0.5323768258094788, -0.2319813221693039, -0.8774393200874329, -1.5433534383773804, 0.05817996710538864, -1.151747703552246, -1.6550570726394653, 0.41905441880226135, 1.9191944599151611, 2.063959836959839, -0.7525439262390137, 1.4669748544692993, -0.3129228353500366, 0.02961660921573639, 1.2091901302337646, 1.2492388486862183, 3.153505325317383, 1.9231977462768555, -1.2586618661880493, 0.6035152673721313, -0.1788765788078308, -0.45996615290641785, 1.0230602025985718, -1.0762999057769775, 1.2399665117263794, -0.17285065352916718, -1.131279468536377, -1.1435580253601074, 1.015259027481079, 0.5110931396484375, 0.036191895604133606, -0.48671433329582214, 1.1751149892807007, 0.1245650053024292, 1.3400524854660034, 0.5981713533401489, -0.35156702995300293, 0.5890003442764282, -0.38478606939315796, -0.48810306191444397, 1.653368592262268, 0.14781756699085236, -1.4469451904296875, -2.4152774810791016, -0.21575132012367249, -0.8301817774772644, 0.04780152067542076, -0.6454866528511047, -1.0326147079467773, 1.6702090501785278, 0.36483949422836304, -1.3305892944335938, -0.2805570662021637, -0.4312361776828766, -0.5967543721199036, 2.6179776191711426, -1.5177253484725952, -0.20151327550411224, -0.9871873259544373, -0.5533800721168518, 1.57254159450531, -1.2163156270980835, -0.2182413935661316, -1.0382213592529297, -0.602553129196167, -1.309432864189148, -0.592651903629303, 0.014523337595164776, -0.836713433265686, 0.8050323724746704, 0.12182958424091339, -1.0531574487686157, -0.30794164538383484, -0.874680757522583, 0.8667130470275879, -0.13033343851566315, 0.21373619139194489, 1.946382761001587, 0.4105190634727478, -0.3478220999240875, 0.7130995988845825, 1.2074928283691406, 0.5842428803443909, -0.6275644898414612, 0.16927480697631836, -0.6261811256408691, 0.25119686126708984, -1.4003713130950928, 0.288428395986557, -2.842559337615967, 0.7225027084350586, -0.045672811567783356, -0.07024962455034256, 0.027076728641986847, -1.2839299440383911, 1.1289199590682983, 2.5819337368011475, -1.177873969078064, 0.40884944796562195, 0.36659911274909973, 1.1180181503295898, -1.587675929069519, 0.2533610761165619, -0.39695391058921814, 2.085967779159546, 0.18532977998256683, 1.1446967124938965, -0.5690804719924927, -2.178375005722046, 0.5515332221984863, -1.1337534189224243, -1.150233507156372, 0.7443827986717224, -0.8323416113853455, 0.12245815992355347, -1.523990511894226, -0.20283135771751404, -0.9222572445869446, -1.2317432165145874, 0.7402369379997253, 0.13448679447174072, 0.4270232319831848, -0.6686763763427734, 0.29629644751548767, -2.1578853130340576, -1.3807413578033447, -0.23005256056785583, -0.9016153216362, 0.5410348773002625, -0.29137128591537476, 0.7011998891830444, -0.09540821611881256, 0.08553095906972885, 0.2692182958126068, 1.3769645690917969, 3.342132568359375, 0.19480885565280914, 0.35780686140060425, -0.17117643356323242, -0.9224655032157898, 1.4845035076141357, 1.00590181350708, 0.022338993847370148, -0.5725423097610474, -1.0451253652572632, 1.2253730297088623, 1.9160566329956055, 1.033490777015686, 0.0889478549361229, -0.8421106338500977, -0.6601948142051697, -0.015437092632055283, 0.23817415535449982, 0.46701642870903015, 1.0186487436294556, 0.019727930426597595, 0.1329401582479477, 1.466870903968811, 1.2824645042419434, -0.4261358082294464, 0.40322235226631165, -0.8465690612792969, -0.47622621059417725, 0.4054791331291199, 0.32923582196235657, 0.010165411047637463, 0.37508624792099, -1.088367223739624, -0.32975801825523376, -0.36721938848495483, -1.028027057647705, -0.6927914023399353, -0.44618311524391174, -0.34466201066970825, 1.6364665031433105, 0.1089697927236557, -0.39072999358177185, -0.016696998849511147, -0.7929739356040955, -0.14106154441833496, -1.1218881607055664, 0.27878522872924805, -0.13063201308250427, -0.06670990586280823, -0.1190318837761879, 1.7479139566421509, -0.8133867979049683, -2.044032573699951, 0.23797686398029327, 0.2675730288028717, -0.4365766942501068, 0.21719306707382202, 1.6968694925308228, 0.5302982330322266, 1.4087953567504883, 1.2890276908874512, 0.9455431699752808, -0.5456148982048035, -1.1886322498321533, 0.6856048107147217, 0.9876026511192322, -1.4430289268493652, 0.7441301941871643, -0.020848030224442482, -0.5112725496292114, 0.7351858615875244, 1.316719651222229, 0.4306490123271942, -2.0062735080718994, 0.834947407245636, -0.8774400949478149, 0.7416107058525085, 0.6799465417861938, 0.7403239607810974, 0.2569521963596344, 0.8664885759353638, -1.279430866241455, -1.1301449537277222, -0.8074590563774109, -0.6060509085655212, 2.0226287841796875, -0.2462952733039856, 0.5751137137413025, -0.20291195809841156, -1.2933663129806519, -0.1285114288330078, 0.7255311012268066, 0.4124941825866699, -0.44551071524620056, 0.8127065896987915, -0.6389356851577759, -1.0913257598876953, -1.3007107973098755, -0.373144268989563, -0.9484856724739075, -0.9336158633232117, 0.9756800532341003, 0.904102623462677, 0.3640272319316864, 1.955830693244934, 0.649000883102417, 0.22043462097644806, -2.6416027545928955, 0.8554129600524902, 0.3868066966533661, -0.06656746566295624, 1.0439039468765259, 0.2735631465911865, 1.0699690580368042, 0.03962736949324608, 0.5147510766983032, -2.411769390106201, 2.2569005489349365, -0.22916170954704285, 0.8248296976089478, -0.029929202049970627, -0.19340747594833374, 1.1433672904968262, 0.5415512323379517, 0.5612720251083374, -1.1043282747268677, 0.6230873465538025, -0.6293618679046631, 1.1904008388519287, 0.9536651968955994, -0.7701095342636108, -0.014125136658549309, 1.3576127290725708, 0.5479140877723694, -0.5023638010025024, -0.9015858769416809, -0.9157133102416992, 0.900974690914154, 1.8598474264144897, -0.021122481673955917, 0.08203208446502686, 0.8920275568962097, 0.6729273796081543, -1.375799298286438, 0.06990566104650497, -0.7344920635223389, -0.8141228556632996, 1.6433125734329224, 2.033437728881836, -0.07604333758354187, -0.2410847693681717, -0.6676463484764099, -1.3301470279693604, 0.7598773837089539, -0.00853029265999794, 0.22334782779216766, 0.6629513502120972, -0.6625383496284485, 1.116226077079773, 0.8095552921295166, 0.9705526232719421, 0.1094619482755661, 0.35787758231163025, 0.3754671812057495, -0.3863525092601776, -1.140406847000122, -0.2852673828601837, -1.1330896615982056, -2.435976982116699, 0.4834345281124115, -0.19143417477607727, -1.4495011568069458, -0.01759437471628189, -1.0336651802062988, 0.9272955060005188, -0.6567375063896179, -1.0748889446258545, -1.6131857633590698, 0.24910084903240204, -0.07557418197393417, 0.9480872750282288, -1.606046438217163, -0.2007243037223816, 1.1957019567489624, 0.9138715267181396, -0.5759009122848511, 0.9562267661094666, 0.30622634291648865, 0.9959542751312256, 0.8424429893493652, -0.4277079999446869, 0.422775536775589, 0.14917682111263275, -1.3566406965255737, 0.45771047472953796, 1.1713666915893555, 0.24133290350437164, 1.4270457029342651, -0.54068922996521, 0.0951819196343422, 0.4433325529098511, -0.5313228964805603, -0.45488011837005615, -0.5749456286430359, 0.6314616799354553, 0.012980022467672825, -0.9807648062705994, -0.0007581626996397972, -0.1469745934009552, -0.22092697024345398, 0.1932087391614914, -1.4693516492843628, -0.23198719322681427, -0.4160749018192291, -0.5592090487480164, -1.2544642686843872, -0.013527505099773407, 1.343866229057312, -0.7796776294708252, -0.16745568811893463, 0.4682304561138153, 0.45961374044418335, 0.5752325654029846, 0.6005712151527405, -0.6575595736503601, -0.4528651833534241, -0.228838711977005, -0.3973396420478821, 0.26960834860801697, 1.2818349599838257, -0.1375041902065277, -1.0063681602478027, 0.6847097873687744, -0.41802698373794556, 0.14211377501487732, 1.9831733703613281, 0.02150784805417061, -0.7148911952972412, 0.3187248706817627, -0.7053133249282837, 1.8482977151870728, 1.675158143043518, 1.3364295959472656, -0.18218499422073364, -0.8047447204589844, 0.6639197468757629, -0.3516418933868408, -0.3548682928085327, 0.9362668395042419, 0.4866197109222412, -0.19660161435604095, -1.4664579629898071, 0.5719548463821411, 1.3942116498947144, -0.9486986994743347, -0.7738670706748962, 0.14047981798648834, -0.8238973617553711, 1.1370673179626465, 0.6099739670753479, 0.328607439994812, 0.2875026762485504, 1.6226282119750977, 0.7205039262771606, -0.4815573990345001, 0.563764750957489, 0.5909664034843445, -0.18201260268688202, -2.1705188751220703, -1.1500426530838013, 0.31612446904182434, -0.35782864689826965, -1.5758235454559326, 1.3956186771392822, -1.1339242458343506, -1.0315159559249878, 0.5072672367095947, 0.08110117167234421, 1.3383082151412964, 0.3114650845527649, 1.648997187614441, 2.0889251232147217, 0.8420161008834839, 0.3794105052947998, 1.3755548000335693, -0.07650502771139145, -0.4487808644771576, 1.8433712720870972, -0.4618767499923706, 0.5426786541938782, 1.089926838874817, -0.3182179033756256, -1.1042717695236206, -0.7911389470100403, -1.2513911724090576, -0.6459348201751709, 1.2475306987762451, 0.09066168963909149, -1.081392526626587, 0.2316349446773529, 1.6011322736740112, 0.1376684606075287, -0.3529459536075592, 0.5778787732124329, 0.4191730320453644, -0.7480821013450623, -0.10941608995199203, -0.928644061088562, 0.5105281472206116, -0.18630234897136688, -0.2973567843437195, 0.3007565438747406, 0.5160714387893677, 1.2484965324401855, -0.050564710050821304, 0.05384092032909393, 1.1778547763824463, -1.427366018295288, 1.5760067701339722, -0.6175474524497986, 0.27616626024246216, -2.4324448108673096, 1.4685887098312378, -0.7343661785125732, 1.9737025499343872, -2.5978713035583496, 0.40142935514450073, -0.567909836769104, -0.4129313826560974, 0.2869563102722168, -0.34367576241493225, 0.1281847506761551, -0.16300810873508453, -1.0194892883300781, -0.09153100848197937, -0.7364159226417542, 0.5525622963905334, 1.18093740940094, 1.3800753355026245, -1.1299694776535034, -0.23723971843719482, -1.7571663856506348, -0.16413240134716034, -0.7754256129264832, 0.25467467308044434, -2.0257279872894287, -0.21182966232299805, -1.8895068168640137, -2.32369065284729, -1.3549457788467407, -0.838148295879364, 1.0296061038970947, 0.1705603003501892, -0.9063529968261719, 1.0506391525268555, -0.40734973549842834, -1.8453750610351562, 1.1185017824172974, -2.17745304107666 ]
https://github.com/huggingface/datasets/issues/4430
Add ability to load newer, cleaner version of Multi-News
Awesome! Thanks for the detailed help, that was straightforward with your instruction. However, I think I am being blocked by this issue: https://github.com/huggingface/datasets/issues/4428
**Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`?
734
23
Add ability to load newer, cleaner version of Multi-News **Is your feature request related to a problem? Please describe.** The [Multi-News dataloader points to the original version of the Multi-News dataset](https://github.com/huggingface/datasets/blob/12540dd75015678ec6019f258d811ee107439a73/datasets/multi_news/multi_news.py#L47), but this has [known errors in it](https://github.com/Alex-Fabbri/Multi-News/issues/11). There exists a [newer version which fixes some of these issues](https://drive.google.com/open?id=1jwBzXBVv8sfnFrlzPnSUBHEEAbpIUnFq). Unfortunately I don't think you can just replace this old URL with the new one, otherwise this could lead to issues with reproducibility. **Describe the solution you'd like** Add a new version to the Multi-News dataloader that points to the updated dataset which has fixes for some known issues. **Describe alternatives you've considered** Replace the current URL to the original version to the dataset with the URL to the version with fixes. **Additional context** Would be happy to make a PR for this, could someone maybe point me to another dataloader that has multiple versions so I can see how this is handled in `datasets`? Awesome! Thanks for the detailed help, that was straightforward with your instruction. However, I think I am being blocked by this issue: https://github.com/huggingface/datasets/issues/4428
[ -1.2194616794586182, -0.9319692850112915, -0.8157703280448914, 1.3914005756378174, -0.18372423946857452, -1.2347460985183716, 0.16416895389556885, -0.9961899518966675, 1.614700436592102, -0.7028098106384277, 0.30891329050064087, -1.6747461557388306, -0.01014271005988121, -0.5255749821662903, -0.7969495058059692, -0.8319565057754517, -0.38965246081352234, -0.8614820837974548, 0.8873662352561951, 2.541124105453491, 1.17304527759552, -1.441247582435608, 2.714601516723633, 0.6896505355834961, -0.16448743641376495, -1.0013304948806763, 0.49774810671806335, 0.0885423868894577, -1.1893094778060913, -0.44017964601516724, -0.906194806098938, -0.012759038247168064, -0.5819459557533264, -0.46766477823257446, 0.09282761067152023, 0.32970574498176575, -0.17154914140701294, -0.3405655026435852, -0.6559454798698425, -0.7105357050895691, 0.5150588154792786, -0.3528595268726349, 0.8997185826301575, -0.28934621810913086, 1.8154635429382324, -0.6005284190177917, 0.3264901340007782, 0.7824265360832214, 1.3457057476043701, 0.1781989336013794, -0.04799078404903412, 0.27988946437835693, 0.32986071705818176, -0.04333740472793579, 0.4199780821800232, 1.2302793264389038, 0.6390929818153381, 0.4777219891548157, 0.6732906103134155, -2.213132381439209, 1.3462474346160889, -1.0641697645187378, 0.35783421993255615, 1.3577139377593994, -0.9805182814598083, 0.433186799287796, -1.8436598777770996, -0.06434258818626404, 0.5537198185920715, -2.3180150985717773, 0.16126608848571777, -1.3038171529769897, -0.6066699624061584, 0.9109200239181519, 0.1597261279821396, -1.316763997077942, 0.24178887903690338, -0.5494370460510254, 1.0613747835159302, 0.4347626268863678, 1.1957893371582031, -1.7769438028335571, -0.043828293681144714, -0.23628272116184235, 0.13549663126468658, -1.3372228145599365, -1.6218936443328857, 0.5685627460479736, 0.622447669506073, 0.5866783857345581, -0.11868729442358017, 0.9389111399650574, -0.9843804240226746, 0.9282359480857849, -0.9440374970436096, -1.5951615571975708, -1.412308931350708, -2.2376508712768555, -2.1903235912323, 0.860427975654602, -0.4760953485965729, -0.5006094574928284, 1.9962388277053833, -1.0238285064697266, -1.7751761674880981, 1.1527408361434937, 0.3108728229999542, 0.04563885182142258, 2.393470525741577, 0.22472497820854187, -0.7091295719146729, 0.35966330766677856, -0.7382807731628418, 0.8899561762809753, -0.39462846517562866, 1.360599398612976, 0.5027207136154175, -0.9988975524902344, 1.6647255420684814, -0.44069942831993103, 0.48798254132270813, -0.6707789301872253, -0.6083816289901733, -0.7968493103981018, 0.34281429648399353, 1.8717340230941772, -0.33332329988479614, 1.6252621412277222, -0.3961910605430603, -1.578324794769287, -1.5002143383026123, 0.930910587310791, 0.5584797263145447, -0.8939511775970459, 0.05596727505326271, -0.39736807346343994, 0.10158418118953705, -0.0031900014728307724, 1.1551616191864014, 1.2233680486679077, 0.6327745914459229, -0.2872006297111511, -0.8967551589012146, 0.20880869030952454, -0.1451883167028427, -0.6239959597587585, -1.859069585800171, -0.36207860708236694, 0.24857817590236664, 0.6724936962127686, -1.272422194480896, 1.7344706058502197, 0.8842993378639221, 1.9422788619995117, 0.9821769595146179, -0.4499146044254303, 1.5413398742675781, -0.013119280338287354, 1.8206672668457031, -0.5543050169944763, 0.662833034992218, -0.26329904794692993, -1.10700261592865, 0.825578510761261, -0.3144579827785492, -2.0291848182678223, -0.7187327146530151, -0.8125592470169067, -0.27462002635002136, -0.6930335164070129, 0.9015121459960938, -0.30654239654541016, -1.3523141145706177, 0.27610230445861816, -0.6217385530471802, 0.15570712089538574, -1.209086537361145, 0.25604763627052307, 0.7739194631576538, -0.5985533595085144, -0.034942373633384705, -0.23543910682201385, -1.3038920164108276, -0.5029553771018982, 0.2917116582393646, 1.884551763534546, -0.6128261685371399, 1.0095937252044678, 0.931860089302063, -0.7086626887321472, 0.010628032498061657, 0.32673364877700806, -0.2886115312576294, 0.913092851638794, -1.0723764896392822, -0.4493268132209778, 0.9984034895896912, -0.15668274462223053, -0.5273168087005615, 1.4784884452819824, 0.7915959358215332, -0.9250684976577759, -0.33533433079719543, -0.24059011042118073, -0.8677313923835754, -0.03205542266368866, -1.6246339082717896, -0.24057428538799286, 0.25088605284690857, -1.4438245296478271, -0.4992308020591736, -0.27388641238212585, 1.3104958534240723, -0.12855269014835358, 1.3836113214492798, -0.31603097915649414, -0.29447582364082336, -0.42379218339920044, -0.42565226554870605, 0.1335434466600418, -0.2035292387008667, -0.6802597641944885, 0.23756806552410126, -0.8128466606140137, 0.3595160245895386, 1.4633855819702148, 0.4342981278896332, 0.08360222727060318, 0.5376778841018677, 1.102108359336853, 0.3519865870475769, -0.009442228823900223, -0.8584277033805847, -1.5620200634002686, 1.9461314678192139, -1.5100046396255493, 1.9674521684646606, 0.8632818460464478, -0.0014522741548717022, -1.799280047416687, -1.812579870223999, 1.3994876146316528, 1.2460094690322876, 2.3980367183685303, 0.5533780455589294, 0.4251825213432312, -0.8156188130378723, -0.6803485751152039, 0.2971144914627075, -1.078540563583374, -0.7542786598205566, 0.13845039904117584, 2.3663368225097656, 1.7980284690856934, -0.5861287713050842, -0.20906049013137817, -1.0151726007461548, 1.3130937814712524, -0.13731756806373596, 0.14508876204490662, 2.0689988136291504, -0.29016295075416565, -1.0681157112121582, 1.258624792098999, -2.362940549850464, 0.1643586903810501, 1.9944812059402466, 0.34567561745643616, 0.03956034407019615, -1.436329960823059, -0.5751384496688843, -0.30843251943588257, -0.4087224006652832, -1.254608154296875, 0.53205406665802, -0.2569073438644409, -0.8605295419692993, -1.5396007299423218, 0.04297463595867157, -1.1259177923202515, -1.6642240285873413, 0.45006275177001953, 1.8641102313995361, 2.062488317489624, -0.7221681475639343, 1.4402862787246704, -0.2822326123714447, 0.08467231690883636, 1.2415305376052856, 1.20150887966156, 3.11724591255188, 1.9063231945037842, -1.2193797826766968, 0.6084854006767273, -0.1807919144630432, -0.5139690637588501, 1.0925445556640625, -1.0254138708114624, 1.2531261444091797, -0.20824527740478516, -1.220881462097168, -1.1957743167877197, 1.0483927726745605, 0.5243493914604187, 0.005226473324000835, -0.5342223644256592, 1.2626069784164429, 0.12186464667320251, 1.2688223123550415, 0.5543492436408997, -0.38843226432800293, 0.5328925848007202, -0.4297802448272705, -0.5501481294631958, 1.6972512006759644, 0.135511115193367, -1.484033226966858, -2.384345054626465, -0.2209484577178955, -0.8307155966758728, 0.016939256340265274, -0.6558610796928406, -1.0385438203811646, 1.596472144126892, 0.4144558608531952, -1.3073076009750366, -0.27708709239959717, -0.44808313250541687, -0.6561661958694458, 2.5835649967193604, -1.5000661611557007, -0.22453022003173828, -0.9721322655677795, -0.4862227141857147, 1.5384713411331177, -1.2133210897445679, -0.1621222347021103, -1.0205998420715332, -0.6680082678794861, -1.2993801832199097, -0.558384358882904, -0.05523611232638359, -0.8133902549743652, 0.748121440410614, 0.04947429522871971, -1.0286405086517334, -0.2609619200229645, -0.8636656403541565, 0.8468576669692993, -0.1547490507364273, 0.23369024693965912, 1.8930606842041016, 0.43144577741622925, -0.3765089213848114, 0.7573357820510864, 1.1901867389678955, 0.6011068224906921, -0.6538806557655334, 0.17754945158958435, -0.6109568476676941, 0.26720720529556274, -1.389868974685669, 0.2972555160522461, -2.904693365097046, 0.7409939169883728, -0.01778152771294117, -0.06236403435468674, 0.018117133527994156, -1.2557786703109741, 1.1306675672531128, 2.555776596069336, -1.2253657579421997, 0.37179243564605713, 0.3953200876712799, 1.1185740232467651, -1.6367881298065186, 0.27842068672180176, -0.42479515075683594, 2.135558605194092, 0.1938858926296234, 1.1257485151290894, -0.6085334420204163, -2.152447462081909, 0.5099753737449646, -1.1235283613204956, -1.080640196800232, 0.7334363460540771, -0.8371136784553528, 0.14103317260742188, -1.517933964729309, -0.19016242027282715, -0.9207582473754883, -1.2586301565170288, 0.8088643550872803, 0.10275457799434662, 0.4650241434574127, -0.6228656768798828, 0.27917394042015076, -2.1114797592163086, -1.391119360923767, -0.16210442781448364, -0.9597155451774597, 0.5492302179336548, -0.28591346740722656, 0.7039108872413635, -0.07862976938486099, 0.1664724498987198, 0.2468758076429367, 1.3564780950546265, 3.391007423400879, 0.24242906272411346, 0.4177003502845764, -0.11735986918210983, -0.8827602863311768, 1.458603024482727, 1.0128458738327026, 0.005687658675014973, -0.5573909282684326, -0.987177312374115, 1.2758196592330933, 1.9273484945297241, 1.0326272249221802, 0.15338802337646484, -0.8255228996276855, -0.6061363220214844, 0.04583830386400223, 0.2519732713699341, 0.5002334117889404, 0.9680062532424927, 0.0030538858845829964, 0.1905830353498459, 1.4136958122253418, 1.2910640239715576, -0.42529624700546265, 0.4820280075073242, -0.9111737608909607, -0.45099300146102905, 0.38542672991752625, 0.3042724132537842, 0.003946318291127682, 0.42568719387054443, -1.0714246034622192, -0.3128703236579895, -0.3571339547634125, -1.0613291263580322, -0.7049576640129089, -0.44200044870376587, -0.38594579696655273, 1.6281851530075073, 0.056002531200647354, -0.4270240068435669, 0.004911280237138271, -0.7564106583595276, -0.14762428402900696, -1.0858690738677979, 0.20713622868061066, -0.09009132534265518, -0.055939048528671265, -0.12402411550283432, 1.767509937286377, -0.8609169125556946, -2.1029744148254395, 0.23554149270057678, 0.3380177915096283, -0.4787428379058838, 0.16982433199882507, 1.6520501375198364, 0.4709704518318176, 1.4532415866851807, 1.3120566606521606, 0.9717941880226135, -0.566408097743988, -1.2015681266784668, 0.7202339172363281, 0.9774715900421143, -1.4028748273849487, 0.8042169809341431, -0.030057616531848907, -0.5181204080581665, 0.7421523928642273, 1.352347493171692, 0.4292466640472412, -1.9845138788223267, 0.8344131708145142, -0.8397302627563477, 0.7731630206108093, 0.6476618051528931, 0.7607685327529907, 0.24654047191143036, 0.8924971222877502, -1.3331843614578247, -1.145226240158081, -0.8154049515724182, -0.5721765756607056, 2.0046725273132324, -0.1971861869096756, 0.5489590764045715, -0.18709883093833923, -1.312538504600525, -0.11337531358003616, 0.7293336987495422, 0.42667073011398315, -0.4108656942844391, 0.8628290295600891, -0.6385939121246338, -1.0862444639205933, -1.3213646411895752, -0.35621148347854614, -0.9336864352226257, -0.90260910987854, 0.9873400330543518, 0.8953559994697571, 0.3444609045982361, 1.896573781967163, 0.5558546185493469, 0.16661009192466736, -2.653795003890991, 0.8623909950256348, 0.347271203994751, -0.030733760446310043, 1.0350526571273804, 0.23497460782527924, 1.121211290359497, 0.04943753033876419, 0.5008617043495178, -2.3386082649230957, 2.209158420562744, -0.23700691759586334, 0.8084670901298523, -0.008923269808292389, -0.21283023059368134, 1.1582342386245728, 0.5500299334526062, 0.5830942988395691, -1.1426657438278198, 0.6677079200744629, -0.6264891624450684, 1.1586865186691284, 0.9810823798179626, -0.7711797952651978, -0.0005191229283809662, 1.3785643577575684, 0.5579149723052979, -0.4672928750514984, -0.9164713621139526, -0.8630318641662598, 0.9192392826080322, 1.82473623752594, 0.0319816879928112, 0.03974815458059311, 0.861471951007843, 0.7002499103546143, -1.3612172603607178, 0.15099258720874786, -0.7207962870597839, -0.8311172127723694, 1.6339725255966187, 1.9992960691452026, -0.05453961715102196, -0.22785630822181702, -0.6739763617515564, -1.2874327898025513, 0.7310224771499634, 0.019011422991752625, 0.18460343778133392, 0.7240043878555298, -0.6771405339241028, 1.155645489692688, 0.7708428502082825, 0.9299463629722595, 0.08159037679433823, 0.354679137468338, 0.3132927119731903, -0.3605917990207672, -1.1636171340942383, -0.31994906067848206, -1.1803761720657349, -2.457392692565918, 0.43040961027145386, -0.2566169500350952, -1.4585927724838257, -0.019573286175727844, -1.017979621887207, 0.9142669439315796, -0.6719464063644409, -1.1265544891357422, -1.6275508403778076, 0.24501581490039825, -0.10667410492897034, 0.9391047954559326, -1.625401496887207, -0.15601412951946259, 1.1946266889572144, 0.8860442638397217, -0.5529613494873047, 0.9993346333503723, 0.29565298557281494, 0.926110029220581, 0.8317165374755859, -0.4723742604255676, 0.42340287566185, 0.19753843545913696, -1.4119173288345337, 0.48063555359840393, 1.1255799531936646, 0.2559176981449127, 1.387492060661316, -0.5335323214530945, 0.10198207199573517, 0.4451700448989868, -0.5066486597061157, -0.47981271147727966, -0.5798820853233337, 0.652065634727478, 0.022931072860956192, -0.9773104786872864, 0.07966486364603043, -0.11832264810800552, -0.19484052062034607, 0.22233442962169647, -1.552849292755127, -0.31597262620925903, -0.4504040777683258, -0.5065127015113831, -1.2935994863510132, -0.00563071807846427, 1.3613526821136475, -0.7746307849884033, -0.15708011388778687, 0.48937031626701355, 0.5191556215286255, 0.5751577019691467, 0.6237497329711914, -0.5694150328636169, -0.44603922963142395, -0.2893577218055725, -0.35276928544044495, 0.24451832473278046, 1.1542540788650513, -0.2048165649175644, -0.9922798275947571, 0.7124093770980835, -0.4379194974899292, 0.12279024720191956, 1.9752812385559082, 0.047514658421278, -0.7486340999603271, 0.38805514574050903, -0.6907037496566772, 1.8055431842803955, 1.6380283832550049, 1.3546565771102905, -0.1269916296005249, -0.8164910674095154, 0.6251140832901001, -0.2693934440612793, -0.3506791591644287, 0.9731369614601135, 0.512160062789917, -0.15530896186828613, -1.4332071542739868, 0.5468990802764893, 1.4029943943023682, -0.9120227694511414, -0.797877311706543, 0.09242811799049377, -0.8629379272460938, 1.1050993204116821, 0.5873154401779175, 0.36464041471481323, 0.24038702249526978, 1.5999881029129028, 0.6481063365936279, -0.5213006138801575, 0.5517982244491577, 0.5231519341468811, -0.1954852044582367, -2.1409075260162354, -1.1632133722305298, 0.2456190139055252, -0.348413348197937, -1.5657051801681519, 1.3404234647750854, -1.1479833126068115, -0.9722175598144531, 0.49579718708992004, 0.10214882344007492, 1.3529027700424194, 0.24070890247821808, 1.692598819732666, 2.0936129093170166, 0.8082202076911926, 0.3203319311141968, 1.3806304931640625, -0.02729448303580284, -0.4230364263057709, 1.8650004863739014, -0.4537951350212097, 0.5963560938835144, 1.0762755870819092, -0.39743658900260925, -1.1262102127075195, -0.8128830790519714, -1.1780725717544556, -0.6156994104385376, 1.1978565454483032, 0.09944373369216919, -1.0955582857131958, 0.1982298344373703, 1.5659366846084595, 0.13975025713443756, -0.3140626549720764, 0.5701761245727539, 0.45189961791038513, -0.7133738398551941, -0.07424166798591614, -0.9693254828453064, 0.5011007189750671, -0.16530631482601166, -0.2567930817604065, 0.2957346737384796, 0.5337347984313965, 1.1870996952056885, -0.03534131869673729, 0.04641770198941231, 1.2306969165802002, -1.436895489692688, 1.5405466556549072, -0.5598598718643188, 0.2719551920890808, -2.4444570541381836, 1.4549165964126587, -0.6974478363990784, 1.9243927001953125, -2.6068239212036133, 0.3735184967517853, -0.6450717449188232, -0.3871011734008789, 0.3640884757041931, -0.3391861915588379, 0.17001836001873016, -0.18897099792957306, -0.9788100123405457, -0.0905861109495163, -0.7894845604896545, 0.5089956521987915, 1.2339438199996948, 1.3798538446426392, -1.095576286315918, -0.24249239265918732, -1.7770503759384155, -0.16296347975730896, -0.7200027108192444, 0.3182617723941803, -2.05900502204895, -0.17973582446575165, -1.909957766532898, -2.34692645072937, -1.3663909435272217, -0.8415204286575317, 1.0141856670379639, 0.20412667095661163, -0.9394327998161316, 1.037978172302246, -0.42425665259361267, -1.7812353372573853, 1.0635160207748413, -2.153139591217041 ]
https://github.com/huggingface/datasets/issues/4426
Add loading variable number of columns for different splits
Hi! Indeed the column is missing, but you shouldn't get an error? Have you made some modifications (locally) to the loading script? I've opened a PR to add the missing columns to the script.
**Is your feature request related to a problem? Please describe.** The original dataset `blended_skill_talk` consists of different sets of columns for the different splits: (test/valid) splits have additional data column `label_candidates` that the (train) doesn't have. When loading such data, an exception occurs at table.py:cast_table_to_schema, because of mismatched columns.
735
34
Add loading variable number of columns for different splits **Is your feature request related to a problem? Please describe.** The original dataset `blended_skill_talk` consists of different sets of columns for the different splits: (test/valid) splits have additional data column `label_candidates` that the (train) doesn't have. When loading such data, an exception occurs at table.py:cast_table_to_schema, because of mismatched columns. Hi! Indeed the column is missing, but you shouldn't get an error? Have you made some modifications (locally) to the loading script? I've opened a PR to add the missing columns to the script.
[ -1.2764463424682617, -0.8829978108406067, -0.8159398436546326, 1.4775567054748535, -0.26980313658714294, -1.220168948173523, 0.01623070053756237, -1.0036959648132324, 1.6371570825576782, -0.7398834824562073, 0.38720226287841797, -1.617210865020752, 0.12332852929830551, -0.4808494746685028, -0.7978182435035706, -0.8478438258171082, -0.4718148708343506, -0.7885523438453674, 1.0476787090301514, 2.464529275894165, 1.1499463319778442, -1.46802818775177, 2.7831623554229736, 0.7149159908294678, -0.08380309492349625, -1.0176191329956055, 0.48070836067199707, 0.03266210854053497, -1.1041089296340942, -0.4985230267047882, -0.8950541615486145, -0.17913219332695007, -0.5422340035438538, -0.5484739542007446, -0.08639572560787201, 0.3431309759616852, -0.3000588119029999, -0.37039804458618164, -0.4888060688972473, -0.7091957330703735, 0.4823911190032959, -0.3556700348854065, 0.8857493996620178, -0.43450960516929626, 1.8214200735092163, -0.3418612480163574, 0.3668195307254791, 0.639696478843689, 1.511403203010559, 0.27150607109069824, -0.13277243077754974, 0.3325464427471161, 0.40763571858406067, -0.12087241560220718, 0.49829840660095215, 1.203570008277893, 0.5642558336257935, 0.6887044310569763, 0.6898825168609619, -2.273501396179199, 1.428674578666687, -1.1477218866348267, 0.24463248252868652, 1.3684875965118408, -1.0605225563049316, 0.3217294216156006, -1.749946117401123, -0.02908318303525448, 0.4726063907146454, -2.343245267868042, 0.23319599032402039, -1.149702548980713, -0.5768673419952393, 0.9846856594085693, 0.3293018341064453, -1.3593788146972656, 0.11103931814432144, -0.4151553809642792, 1.012881875038147, 0.4173413813114166, 1.0880531072616577, -1.6372370719909668, 0.10435164719820023, -0.37932199239730835, 0.11348984390497208, -1.3827413320541382, -1.4855161905288696, 0.6832787990570068, 0.6509037613868713, 0.5328612327575684, -0.04823547974228859, 0.9223588705062866, -1.078026294708252, 0.9079589247703552, -1.0406949520111084, -1.5375921726226807, -1.372259259223938, -2.2846531867980957, -2.284085988998413, 0.838577389717102, -0.4603201150894165, -0.5879461169242859, 1.9703307151794434, -1.0316098928451538, -1.7062695026397705, 1.235702633857727, 0.3094218373298645, 0.049581486731767654, 2.395085334777832, 0.11375600844621658, -0.6192389130592346, 0.31462782621383667, -0.7671124935150146, 0.9515990614891052, -0.48461878299713135, 1.4926446676254272, 0.5393730998039246, -1.048616647720337, 1.715759515762329, -0.35177674889564514, 0.6455889940261841, -0.46011248230934143, -0.6783171892166138, -0.8350094556808472, 0.3786391317844391, 1.9701392650604248, -0.2609342336654663, 1.5611541271209717, -0.5410738587379456, -1.5238797664642334, -1.571536660194397, 0.9806263446807861, 0.4766170084476471, -0.976684033870697, 0.20724493265151978, -0.3607775568962097, 0.11083630472421646, -0.06907086074352264, 1.1917717456817627, 1.2958799600601196, 0.7341877222061157, -0.24087640643119812, -0.9026346802711487, 0.09116211533546448, -0.08890566974878311, -0.7561339735984802, -1.8159115314483643, -0.39652493596076965, 0.012662272900342941, 0.6424499154090881, -1.0707496404647827, 1.664341926574707, 0.9787796139717102, 1.9825729131698608, 0.9703004956245422, -0.26621443033218384, 1.5249320268630981, -0.055445797741413116, 1.81839120388031, -0.582614004611969, 0.5658825635910034, -0.39811742305755615, -1.088536024093628, 0.836823046207428, -0.3009818196296692, -2.12004017829895, -0.8122240304946899, -0.8216564655303955, -0.2873374819755554, -0.6785885095596313, 0.9365235567092896, -0.3758176267147064, -1.2757960557937622, 0.18180525302886963, -0.6793076395988464, 0.1696857511997223, -1.1846801042556763, 0.3500567078590393, 0.8399603962898254, -0.6830629706382751, -0.029097693040966988, -0.21472609043121338, -1.1814128160476685, -0.5720719695091248, 0.35990023612976074, 1.920673131942749, -0.758044421672821, 0.9017149806022644, 1.0247160196304321, -0.6883342266082764, -0.03988175466656685, 0.2739354372024536, -0.23568475246429443, 0.7674860954284668, -0.9961008429527283, -0.5102885961532593, 1.22860586643219, -0.1957944929599762, -0.5775119662284851, 1.433554768562317, 0.7134637236595154, -1.052233099937439, -0.0844283401966095, -0.1548859179019928, -0.8785411715507507, -0.01895708218216896, -1.6315046548843384, -0.15360817313194275, 0.23146367073059082, -1.5576313734054565, -0.5421746373176575, -0.07414624840021133, 1.3524044752120972, -0.08873021602630615, 1.326900601387024, -0.37311163544654846, -0.32703137397766113, -0.3365868926048279, -0.3949044942855835, 0.14286983013153076, -0.1794503927230835, -0.5458279252052307, 0.13570624589920044, -0.7689563632011414, 0.4172605574131012, 1.4731178283691406, 0.33012932538986206, 0.0950913205742836, 0.5900769829750061, 1.0901497602462769, 0.34926819801330566, 0.05520255118608475, -0.8557935357093811, -1.5206066370010376, 1.9155539274215698, -1.4718459844589233, 2.04243540763855, 0.763688325881958, -0.14954793453216553, -1.7858469486236572, -1.875545620918274, 1.2815744876861572, 1.2403287887573242, 2.1815714836120605, 0.5544469356536865, 0.3413609564304352, -0.8680850863456726, -0.608580470085144, 0.3447621464729309, -1.152841329574585, -0.7154905200004578, -0.00028628017753362656, 2.2273497581481934, 1.7882747650146484, -0.5697555541992188, -0.17164015769958496, -1.0012812614440918, 1.4686217308044434, -0.2171696424484253, 0.2646554708480835, 1.933212399482727, -0.33934497833251953, -1.215076208114624, 1.3214836120605469, -2.364819288253784, 0.14313557744026184, 2.032627820968628, 0.44054555892944336, -0.014454104006290436, -1.4803588390350342, -0.620428204536438, -0.08985355496406555, -0.4315924644470215, -1.3501085042953491, 0.45103004574775696, -0.3500045835971832, -0.770726203918457, -1.381190538406372, 0.10721466690301895, -1.1917774677276611, -1.5895198583602905, 0.37763750553131104, 1.852763056755066, 1.9484463930130005, -0.5623198747634888, 1.5527793169021606, -0.19597801566123962, 0.08250080049037933, 1.3731191158294678, 1.1638777256011963, 2.960643768310547, 1.9112393856048584, -1.1211581230163574, 0.6242527961730957, -0.19346728920936584, -0.4669961631298065, 1.1418843269348145, -1.1291862726211548, 1.2778557538986206, -0.06733556091785431, -1.0955889225006104, -1.213908076286316, 0.9250603914260864, 0.4674781262874603, 0.08146127313375473, -0.4259876608848572, 1.2356557846069336, 0.08105964213609695, 1.1752320528030396, 0.5043846964836121, -0.38660433888435364, 0.5719475150108337, -0.40650245547294617, -0.6663085222244263, 1.6348127126693726, 0.3085038959980011, -1.4051146507263184, -2.295017957687378, -0.19629064202308655, -0.6636015176773071, 0.03624856472015381, -0.5898418426513672, -0.9788307547569275, 1.6545889377593994, 0.34436631202697754, -1.243042230606079, -0.30177992582321167, -0.48011350631713867, -0.6584896445274353, 2.745981216430664, -1.4568334817886353, -0.2918291389942169, -0.8854362368583679, -0.5759443640708923, 1.6848454475402832, -1.244011402130127, -0.1960565745830536, -0.9795526266098022, -0.5062494277954102, -1.2357033491134644, -0.5545850992202759, -0.011370304971933365, -0.8551889061927795, 0.8899192214012146, 0.16669178009033203, -1.0876891613006592, -0.42466315627098083, -0.7441321015357971, 0.7602371573448181, -0.18854409456253052, 0.338327556848526, 1.886132836341858, 0.3710708022117615, -0.4159677028656006, 0.8245248198509216, 1.2073816061019897, 0.519994854927063, -0.5124996900558472, 0.36481109261512756, -0.4726870357990265, 0.4160130023956299, -1.2322216033935547, 0.3672809600830078, -2.987931251525879, 0.5611307621002197, -0.13156503438949585, -0.06185941398143768, -0.06729981303215027, -1.3856943845748901, 1.011932134628296, 2.5657660961151123, -1.160372018814087, 0.4702655076980591, 0.21570688486099243, 1.1438837051391602, -1.5975947380065918, 0.42890962958335876, -0.43351101875305176, 2.0672435760498047, 0.20671242475509644, 1.1409238576889038, -0.6186034083366394, -2.2662124633789062, 0.6286976337432861, -1.1817142963409424, -1.2250137329101562, 0.6606457233428955, -0.9072256684303284, 0.09019333869218826, -1.5326529741287231, -0.23078924417495728, -0.929151713848114, -1.2255598306655884, 0.7838784456253052, 0.34193405508995056, 0.3443719744682312, -0.6107131242752075, 0.25448480248451233, -2.1507585048675537, -1.386298418045044, -0.18087920546531677, -0.9754481911659241, 0.5366460084915161, -0.46736398339271545, 0.5995016098022461, -0.1366485357284546, 0.08753276616334915, 0.2543502449989319, 1.4513192176818848, 3.3987739086151123, 0.09707102924585342, 0.44064608216285706, -0.3328954577445984, -0.8727453947067261, 1.4883272647857666, 0.9980508089065552, 0.06050236523151398, -0.6301334500312805, -0.914526641368866, 1.2773873805999756, 1.9611952304840088, 0.8917444944381714, 0.010804735124111176, -0.8400724530220032, -0.41723453998565674, -0.09258198738098145, 0.30942413210868835, 0.5458855032920837, 0.9892179369926453, -0.044439177960157394, 0.050865523517131805, 1.274920105934143, 1.3014367818832397, -0.46015432476997375, 0.38236281275749207, -0.7703317403793335, -0.3356308341026306, 0.42652007937431335, 0.3613766133785248, -0.09909304231405258, 0.35112088918685913, -0.9276437759399414, -0.23294788599014282, -0.28545984625816345, -1.0548863410949707, -0.7138079404830933, -0.42884698510169983, -0.4148782789707184, 1.7626008987426758, 0.16783452033996582, -0.614713191986084, -0.12232784926891327, -0.7840880751609802, -0.2003558874130249, -1.0233441591262817, 0.18228936195373535, -0.08843231201171875, -0.09449782222509384, -0.05367781221866608, 1.8094197511672974, -1.0495409965515137, -2.20631742477417, 0.34443023800849915, 0.2577337622642517, -0.22750699520111084, 0.25428006052970886, 1.5454118251800537, 0.48453399538993835, 1.4762810468673706, 1.3978499174118042, 0.9091140627861023, -0.7302007675170898, -1.33306086063385, 0.6237215399742126, 0.9299206137657166, -1.4669690132141113, 0.7068741917610168, 0.03381907194852829, -0.38904425501823425, 0.7647878527641296, 1.3043289184570312, 0.5758076310157776, -1.9871771335601807, 0.8746200203895569, -1.03188157081604, 0.9140488505363464, 0.6893012523651123, 0.6080156564712524, 0.28355059027671814, 0.9108994603157043, -1.123104453086853, -1.2437556982040405, -0.9275834560394287, -0.861072301864624, 1.8952988386154175, -0.3407939672470093, 0.6381674408912659, -0.04828966408967972, -1.3392010927200317, -0.11093902587890625, 0.7054979205131531, 0.3385330140590668, -0.3249143064022064, 0.84331876039505, -0.6874940991401672, -1.111328363418579, -1.5402449369430542, -0.484225869178772, -0.9555118083953857, -0.9308217167854309, 1.0259473323822021, 0.7758866548538208, 0.16706058382987976, 1.9345401525497437, 0.5673152804374695, 0.2521659731864929, -2.659637212753296, 0.8633738160133362, 0.3161371052265167, 0.0029167598113417625, 0.8609407544136047, 0.33878999948501587, 0.9350476264953613, -0.011224761605262756, 0.5061595439910889, -2.4258129596710205, 2.360330581665039, -0.2978145480155945, 0.7196710705757141, -0.048956722021102905, -0.1889958679676056, 1.061795949935913, 0.5803861618041992, 0.5451856851577759, -1.0931118726730347, 0.6521035432815552, -0.597054660320282, 1.2931954860687256, 0.9554181694984436, -0.6410548686981201, 0.009332336485385895, 1.3406387567520142, 0.5532621145248413, -0.535904049873352, -0.9063705205917358, -0.8791580200195312, 0.937186062335968, 1.8327057361602783, -0.042085692286491394, 0.04134850203990936, 0.7238225340843201, 0.6147693395614624, -1.1951124668121338, 0.10526419430971146, -0.7666547894477844, -0.7973531484603882, 1.544712781906128, 2.1491477489471436, -0.1450563371181488, -0.08628174662590027, -0.7417875528335571, -1.2737480401992798, 0.6037498116493225, 0.06682609766721725, 0.08765437453985214, 0.5837660431861877, -0.6465647220611572, 1.237263798713684, 0.8141317367553711, 0.8875083327293396, 0.00623359065502882, 0.5460244417190552, 0.43152886629104614, -0.2728528380393982, -1.1419752836227417, -0.3568817377090454, -1.1009973287582397, -2.5656540393829346, 0.3814939558506012, -0.39198362827301025, -1.4062001705169678, -0.08646409958600998, -1.1206138134002686, 0.8199885487556458, -0.4700108468532562, -1.124046802520752, -1.5756181478500366, 0.0930074006319046, 0.06597049534320831, 0.937267541885376, -1.589376449584961, -0.1510070264339447, 1.2189744710922241, 0.9271400570869446, -0.8009281158447266, 1.01291823387146, 0.35209041833877563, 1.1314003467559814, 0.6649583578109741, -0.5773812532424927, 0.5783964395523071, 0.03564195707440376, -1.2661707401275635, 0.5734468102455139, 1.2017273902893066, 0.10578323900699615, 1.4456936120986938, -0.5105582475662231, -0.039889827370643616, 0.5458076596260071, -0.6457988023757935, -0.5818913578987122, -0.5841553211212158, 0.7686132788658142, -0.02865580841898918, -0.8030688762664795, 0.10823175311088562, -0.09008614718914032, -0.22471556067466736, 0.1848733127117157, -1.450368881225586, -0.2977556884288788, -0.45357516407966614, -0.4323703348636627, -1.3291661739349365, -0.045838724821805954, 1.294834017753601, -0.6858097314834595, -0.18712133169174194, 0.5552298426628113, 0.538314163684845, 0.552541196346283, 0.5787726044654846, -0.7115344405174255, -0.38839879631996155, -0.17855051159858704, -0.32721832394599915, 0.28840112686157227, 1.3353255987167358, -0.22136959433555603, -0.9760064482688904, 0.7296114563941956, -0.28775250911712646, -0.079553984105587, 1.8594276905059814, 0.058720655739307404, -0.7621709704399109, 0.29692238569259644, -0.7136127352714539, 1.8943039178848267, 1.5829263925552368, 1.2665772438049316, -0.17522308230400085, -0.824726939201355, 0.7632036805152893, -0.19163858890533447, -0.2754359245300293, 0.7728668451309204, 0.5371835231781006, -0.2759629189968109, -1.4564106464385986, 0.7039680480957031, 1.1143356561660767, -0.9301180243492126, -0.7925086617469788, -0.006716827861964703, -0.7055396437644958, 1.1580300331115723, 0.6815547943115234, 0.4075896441936493, 0.3621898591518402, 1.6614481210708618, 0.6044567823410034, -0.4283653497695923, 0.48187196254730225, 0.6025941371917725, -0.2072565257549286, -2.109110116958618, -1.091020107269287, 0.27230602502822876, -0.559361457824707, -1.4805186986923218, 1.344530701637268, -1.0662776231765747, -1.0050026178359985, 0.43809664249420166, 0.10555239021778107, 1.4699381589889526, 0.3173658549785614, 1.6743395328521729, 1.9794681072235107, 1.0073106288909912, 0.4268381893634796, 1.452323317527771, -0.14929145574569702, -0.4659423530101776, 1.9139268398284912, -0.39242663979530334, 0.5137477517127991, 1.12545907497406, -0.2613278925418854, -1.013548731803894, -0.687102735042572, -1.1753110885620117, -0.7064829468727112, 1.1093580722808838, 0.09026330709457397, -1.1162807941436768, 0.17315801978111267, 1.477758765220642, 0.28103914856910706, -0.15775227546691895, 0.42707544565200806, 0.3777931332588196, -0.7798296213150024, -0.11890754848718643, -0.9876658916473389, 0.48227658867836, -0.3905433416366577, -0.44505584239959717, 0.314560204744339, 0.42414945363998413, 1.278684139251709, -0.14820870757102966, 0.09914831817150116, 1.1214550733566284, -1.5929268598556519, 1.4686546325683594, -0.6122700572013855, 0.2416382133960724, -2.330207586288452, 1.3583202362060547, -0.6366888880729675, 2.045529365539551, -2.7477943897247314, 0.4855024218559265, -0.759367823600769, -0.357365220785141, 0.5128725171089172, -0.27871397137641907, 0.023380126804113388, -0.1668788492679596, -0.995714008808136, 0.051397789269685745, -0.6484684348106384, 0.47931408882141113, 1.1968965530395508, 1.327347993850708, -1.06816565990448, -0.2319486439228058, -1.709204912185669, -0.18227934837341309, -0.6475273966789246, 0.2801045775413513, -2.1581380367279053, -0.29476189613342285, -1.9940983057022095, -2.1970629692077637, -1.2675498723983765, -0.7932263612747192, 1.1448628902435303, 0.14167189598083496, -0.7797612547874451, 1.1755683422088623, -0.3374122977256775, -1.7347809076309204, 1.0829280614852905, -2.0230846405029297 ]
https://github.com/huggingface/datasets/issues/4422
Cannot load timit_asr data set
@bhaddow we have also made a fix so that you don't have to convert to uppercase the file extensions of the LDC data. Would you mind checking if it works OK now for you and reporting if there are any issues? Thanks.
## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
736
42
Cannot load timit_asr data set ## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 @bhaddow we have also made a fix so that you don't have to convert to uppercase the file extensions of the LDC data. Would you mind checking if it works OK now for you and reporting if there are any issues? Thanks.
[ -1.1837247610092163, -0.8474887609481812, -0.6922659873962402, 1.4369356632232666, -0.15332162380218506, -1.2181499004364014, 0.1325828731060028, -1.1016066074371338, 1.7100945711135864, -0.7949490547180176, 0.30553558468818665, -1.6701350212097168, 0.055153898894786835, -0.5547013282775879, -0.7315844893455505, -0.931979238986969, -0.3944986164569855, -0.6398984789848328, 0.9657966494560242, 2.450371265411377, 1.151017189025879, -1.4119683504104614, 2.673043727874756, 0.6612988114356995, -0.1647970974445343, -0.9433715343475342, 0.5517135858535767, 0.035485733300447464, -1.3968312740325928, -0.3738270401954651, -0.9166742563247681, -0.09120302647352219, -0.590631902217865, -0.5387864112854004, 0.053857069462537766, 0.3862551152706146, -0.3347547650337219, -0.4643176794052124, -0.4813796281814575, -0.828024685382843, 0.4678574800491333, -0.3572622835636139, 0.8884122967720032, -0.42215120792388916, 1.8361179828643799, -0.5519228577613831, 0.5136492848396301, 0.773769199848175, 1.3080826997756958, 0.1961347609758377, -0.013277674093842506, 0.3342309892177582, 0.36614990234375, 0.06084977090358734, 0.47089913487434387, 1.1102160215377808, 0.6059584617614746, 0.5215973258018494, 0.6727531552314758, -2.1796133518218994, 1.3357672691345215, -0.9783326983451843, 0.2972903549671173, 1.3418521881103516, -1.0078736543655396, 0.3267962336540222, -1.801835060119629, -0.0698399469256401, 0.4706069231033325, -2.2536563873291016, 0.25258001685142517, -1.2905879020690918, -0.5509228110313416, 1.0310524702072144, 0.33108794689178467, -1.1990090608596802, 0.09884417057037354, -0.34007593989372253, 0.9882494807243347, 0.5021164417266846, 1.1963788270950317, -1.6759743690490723, -0.05810362845659256, -0.314314067363739, 0.13624034821987152, -1.2961320877075195, -1.499323844909668, 0.5046760439872742, 0.698387622833252, 0.56353360414505, -0.042629919946193695, 0.972281813621521, -0.9312968850135803, 0.8373396396636963, -0.9067485928535461, -1.7554298639297485, -1.317653775215149, -2.2660725116729736, -2.378276824951172, 0.753288984298706, -0.43911269307136536, -0.42141783237457275, 2.0841877460479736, -1.050674319267273, -1.8211690187454224, 1.1022324562072754, 0.27636489272117615, -0.0629597008228302, 2.3511791229248047, 0.18976595997810364, -0.6930983662605286, 0.493852436542511, -0.7414113283157349, 0.6963106989860535, -0.45202329754829407, 1.2567428350448608, 0.42705610394477844, -1.0408436059951782, 1.5370663404464722, -0.43128857016563416, 0.5555089712142944, -0.705051064491272, -0.4846075475215912, -0.7432187795639038, 0.2712567150592804, 1.9495675563812256, -0.2728414237499237, 1.5498428344726562, -0.2117854505777359, -1.5861278772354126, -1.5508557558059692, 0.8469886183738708, 0.514301061630249, -0.7164479494094849, 0.14814099669456482, -0.20529793202877045, 0.057509928941726685, 0.0013146530836820602, 1.0299923419952393, 1.2762316465377808, 0.8085781931877136, -0.310316801071167, -0.884117603302002, 0.2289046049118042, -0.03618428483605385, -0.6846707463264465, -1.730265498161316, -0.31589481234550476, 0.1215449646115303, 0.6350331902503967, -1.2623244524002075, 1.747933030128479, 0.8819398283958435, 1.8995274305343628, 1.0379257202148438, -0.3461233973503113, 1.5483535528182983, 0.11566787213087082, 1.9467823505401611, -0.36761564016342163, 0.6365556120872498, -0.4050590991973877, -1.163954496383667, 0.8196229934692383, -0.33966854214668274, -2.018043041229248, -0.674073338508606, -0.8857110142707825, -0.12470505386590958, -0.7723069190979004, 0.9965064525604248, -0.1956666260957718, -1.3951958417892456, 0.2558823823928833, -0.6697983741760254, 0.14249692857265472, -1.30154550075531, 0.34451889991760254, 0.7953006625175476, -0.6431868672370911, 0.04662627354264259, -0.34227803349494934, -1.2965751886367798, -0.5105500817298889, 0.40045568346977234, 1.7665632963180542, -0.7188109159469604, 0.9618496894836426, 1.0097812414169312, -0.7389944195747375, -0.0683702901005745, 0.4112982749938965, -0.3306116759777069, 0.8605391979217529, -1.1114978790283203, -0.339669793844223, 1.1455990076065063, -0.17401325702667236, -0.6027830839157104, 1.4408848285675049, 0.6743176579475403, -0.974374532699585, -0.12607748806476593, -0.21475251019001007, -0.7923572659492493, -0.03832623362541199, -1.6609914302825928, -0.047228679060935974, 0.30970364809036255, -1.5736563205718994, -0.5234515070915222, -0.12462222576141357, 1.2193074226379395, -0.14053161442279816, 1.4159129858016968, -0.3246985077857971, -0.20939886569976807, -0.4519680440425873, -0.40750062465667725, 0.11688507348299026, -0.22553259134292603, -0.6462329030036926, 0.25465744733810425, -0.7619515061378479, 0.30634763836860657, 1.38810396194458, 0.3169587552547455, 0.05197010561823845, 0.5787956118583679, 1.1222625970840454, 0.35325735807418823, -0.15994523465633392, -0.8837202787399292, -1.564461350440979, 2.025303363800049, -1.3974863290786743, 1.9901576042175293, 0.7259481549263, -0.059509728103876114, -1.8512715101242065, -1.9043031930923462, 1.4354535341262817, 1.1275529861450195, 2.356218099594116, 0.6243801712989807, 0.4946727752685547, -0.8346349596977234, -0.6588960289955139, 0.3575644791126251, -0.9912063479423523, -0.7733246088027954, 0.13315056264400482, 2.4234542846679688, 1.6601728200912476, -0.43224242329597473, -0.17857123911380768, -0.9988926649093628, 1.4358866214752197, -0.15665611624717712, 0.14801427721977234, 1.9673460721969604, -0.225364089012146, -1.0868932008743286, 1.238457441329956, -2.2988393306732178, 0.172525554895401, 2.0116076469421387, 0.20335635542869568, 0.055412404239177704, -1.3873558044433594, -0.7198443412780762, -0.20125122368335724, -0.43586084246635437, -1.1977792978286743, 0.4726557731628418, -0.2844885289669037, -0.6938133835792542, -1.434542179107666, 0.1855011284351349, -1.1151880025863647, -1.705593466758728, 0.19720612466335297, 1.886396050453186, 1.9548678398132324, -0.7385789752006531, 1.533907413482666, -0.21675242483615875, 0.22361363470554352, 1.2439099550247192, 1.084986686706543, 3.1606857776641846, 1.9408239126205444, -1.2896690368652344, 0.7191603779792786, -0.05758526921272278, -0.4239449203014374, 1.213097095489502, -1.1684592962265015, 1.3017163276672363, -0.20749704539775848, -1.235513687133789, -1.2021780014038086, 0.9501667022705078, 0.49069079756736755, 0.10727878659963608, -0.5149495005607605, 1.205222487449646, 0.045376721769571304, 1.3837041854858398, 0.4963601231575012, -0.34844955801963806, 0.6300303339958191, -0.4313715994358063, -0.5235082507133484, 1.6291942596435547, 0.1658984124660492, -1.3452941179275513, -2.333306312561035, -0.22866199910640717, -0.8282975554466248, 0.009643812663853168, -0.6198769211769104, -0.9842529892921448, 1.5639097690582275, 0.48882606625556946, -1.1809169054031372, -0.26340195536613464, -0.373930424451828, -0.6807528138160706, 2.684014081954956, -1.4882951974868774, -0.16256913542747498, -0.9892621636390686, -0.6323383450508118, 1.5996023416519165, -1.2218337059020996, -0.20234964787960052, -1.0059195756912231, -0.5958165526390076, -1.3075809478759766, -0.5569945573806763, -0.029670927673578262, -0.9228531718254089, 0.7808248996734619, 0.16403277218341827, -1.2436450719833374, -0.30979490280151367, -0.9456482529640198, 0.8161565661430359, -0.07210124284029007, 0.20397688448429108, 1.8168476819992065, 0.4493007957935333, -0.3731728792190552, 0.6634482145309448, 1.1346412897109985, 0.5944287180900574, -0.6859902143478394, 0.29515349864959717, -0.741912841796875, 0.3131873905658722, -1.314247727394104, 0.2771872282028198, -2.816754102706909, 0.6358445882797241, -0.04032132402062416, -0.06304406374692917, -0.052362289279699326, -1.3120671510696411, 1.0537526607513428, 2.608794689178467, -1.1887818574905396, 0.5801818370819092, 0.338758260011673, 1.1900951862335205, -1.5612001419067383, 0.2781457304954529, -0.4738350808620453, 2.1238555908203125, 0.11616768687963486, 1.1535371541976929, -0.4399612247943878, -2.3280301094055176, 0.5520797371864319, -1.2142821550369263, -1.2479991912841797, 0.8398292064666748, -0.8325346112251282, 0.019132539629936218, -1.2847169637680054, -0.16541226208209991, -0.8239495754241943, -1.1971572637557983, 0.7000640630722046, 0.10075228661298752, 0.5413540601730347, -0.6030958294868469, 0.35195502638816833, -2.232542037963867, -1.353614330291748, -0.20150023698806763, -0.8969166278839111, 0.42716342210769653, -0.32062071561813354, 0.742142379283905, -0.20033228397369385, 0.02101830020546913, 0.3531768321990967, 1.3637458086013794, 3.338210105895996, 0.13170087337493896, 0.3803345859050751, -0.1770317554473877, -0.9838855266571045, 1.4455550909042358, 0.9204267859458923, -0.20721721649169922, -0.6075359582901001, -1.081398367881775, 1.2253473997116089, 1.9687079191207886, 1.07417893409729, 0.029894307255744934, -0.8155331611633301, -0.7484354972839355, 0.05849842727184296, 0.11293049156665802, 0.5369889736175537, 0.9162889122962952, 0.10372938215732574, 0.1337365210056305, 1.4233880043029785, 1.1905773878097534, -0.30271080136299133, 0.35718584060668945, -0.7724989056587219, -0.4743429720401764, 0.5351063013076782, 0.43352025747299194, 0.012554056011140347, 0.27090778946876526, -1.0246498584747314, -0.1501144915819168, -0.42234140634536743, -0.9447911381721497, -0.7454298138618469, -0.4692848026752472, -0.3613678514957428, 1.7662559747695923, 0.06483688950538635, -0.5360076427459717, -0.038711126893758774, -0.785872220993042, -0.0032866555266082287, -1.0565776824951172, 0.3348691463470459, -0.14960584044456482, -0.013068011030554771, -0.05865892395377159, 1.8066233396530151, -1.0315523147583008, -2.095125913619995, 0.28448379039764404, 0.1824842244386673, -0.3264859616756439, 0.15774866938591003, 1.626592993736267, 0.5424188375473022, 1.3895787000656128, 1.4455275535583496, 0.9863920211791992, -0.7028940916061401, -1.2967112064361572, 0.6309353709220886, 1.0413936376571655, -1.4124904870986938, 0.7170155644416809, 0.095549076795578, -0.5548341274261475, 0.5843982100486755, 1.2698909044265747, 0.4045913815498352, -1.9953101873397827, 0.7501141428947449, -0.9151760935783386, 0.742421567440033, 0.7276452779769897, 0.7491850852966309, 0.13108649849891663, 0.8257690072059631, -1.2575478553771973, -1.0798988342285156, -0.6775662899017334, -0.6630175113677979, 1.9376965761184692, -0.3070599436759949, 0.5394106507301331, -0.21460846066474915, -1.3535064458847046, -0.036079589277505875, 0.6800976395606995, 0.35191306471824646, -0.44400647282600403, 0.7578393816947937, -0.6323865652084351, -1.1524864435195923, -1.458068609237671, -0.48538142442703247, -1.0696234703063965, -0.8892553448677063, 1.0319513082504272, 0.8666296005249023, 0.28191253542900085, 1.8464562892913818, 0.6169198751449585, 0.17344169318675995, -2.681011199951172, 0.8360973596572876, 0.3499453663825989, -0.048033591359853745, 0.8401606678962708, 0.348258376121521, 1.0405898094177246, -0.03218435123562813, 0.5406598448753357, -2.3460092544555664, 2.3489041328430176, -0.2416827380657196, 0.6747459173202515, -0.000603958498686552, -0.12857908010482788, 1.030373215675354, 0.5871997475624084, 0.5922644138336182, -1.107376217842102, 0.690930187702179, -0.6520224809646606, 1.2383586168289185, 0.8703857660293579, -0.8682273030281067, -0.06318999826908112, 1.31037175655365, 0.44724658131599426, -0.5247244238853455, -0.9719243049621582, -0.9621458053588867, 0.9934605360031128, 1.8111265897750854, -0.031682852655649185, 0.07469542324542999, 0.8673228025436401, 0.683017909526825, -1.3800029754638672, 0.06501877307891846, -0.7601184844970703, -0.7621869444847107, 1.6132574081420898, 2.0151925086975098, -0.023005466908216476, -0.2126450538635254, -0.8057647943496704, -1.3202544450759888, 0.8210938572883606, 0.09496743232011795, 0.1257350593805313, 0.6314057111740112, -0.651468813419342, 1.1593464612960815, 0.8973220586776733, 0.9805434346199036, 0.2113770842552185, 0.2215234637260437, 0.305654376745224, -0.35577642917633057, -1.2322232723236084, -0.21515555679798126, -1.0145303010940552, -2.552039623260498, 0.5300241708755493, -0.2039709836244583, -1.47250497341156, -0.023186951875686646, -0.9941835999488831, 0.8814930319786072, -0.530981719493866, -1.116773009300232, -1.494614601135254, 0.17747816443443298, -0.17605499923229218, 0.9018111824989319, -1.564870834350586, -0.1162644550204277, 1.2388797998428345, 1.034671664237976, -0.6675904393196106, 1.0506478548049927, 0.17150546610355377, 0.970045804977417, 0.9018481373786926, -0.42798304557800293, 0.46142035722732544, 0.18453757464885712, -1.3613851070404053, 0.3999766409397125, 1.1943156719207764, 0.18108995258808136, 1.5025142431259155, -0.7011367082595825, 0.009060562588274479, 0.39575302600860596, -0.38058945536613464, -0.4471665322780609, -0.7505672574043274, 0.6739399433135986, 0.026695184409618378, -0.9650933742523193, 0.06141761690378189, -0.07095136493444443, -0.12605059146881104, 0.17898936569690704, -1.4696953296661377, -0.15355604887008667, -0.36107340455055237, -0.6742485761642456, -1.2514255046844482, -0.016682498157024384, 1.3474096059799194, -0.8011885285377502, -0.07920815795660019, 0.46969321370124817, 0.3479916453361511, 0.5325095653533936, 0.600745439529419, -0.7125803828239441, -0.32704102993011475, -0.2714649736881256, -0.3683755099773407, 0.32169637084007263, 1.3314764499664307, -0.12849849462509155, -0.947413980960846, 0.6629521250724792, -0.3138303756713867, 0.1334618479013443, 2.0303030014038086, 0.12717698514461517, -0.8162440657615662, 0.3322810232639313, -0.723394513130188, 1.929498314857483, 1.7366009950637817, 1.4067401885986328, -0.07226357609033585, -1.0053749084472656, 0.6028838753700256, -0.36488375067710876, -0.3801668882369995, 0.9592223167419434, 0.4854288697242737, -0.18679487705230713, -1.3604469299316406, 0.6345297694206238, 1.217344880104065, -0.8446792960166931, -0.8633569478988647, 0.08748156577348709, -0.7568270564079285, 1.0239696502685547, 0.7782315611839294, 0.42330145835876465, 0.2642347514629364, 1.6529417037963867, 0.8243736624717712, -0.5665238499641418, 0.6251051425933838, 0.44204288721084595, -0.09385276585817337, -1.9872294664382935, -1.1266582012176514, 0.3690166473388672, -0.5366625785827637, -1.6108031272888184, 1.457198977470398, -1.2256556749343872, -0.9359526038169861, 0.5430170893669128, 0.0667305439710617, 1.4101942777633667, 0.28374168276786804, 1.5815834999084473, 2.016068696975708, 0.8785746097564697, 0.37438932061195374, 1.307223916053772, -0.16756443679332733, -0.3485364615917206, 1.8136461973190308, -0.5212571024894714, 0.4761720895767212, 1.1231365203857422, -0.3885183334350586, -0.9799569845199585, -0.8548147678375244, -1.1676725149154663, -0.749009370803833, 1.0949089527130127, 0.06881745904684067, -1.0321682691574097, 0.2812452018260956, 1.639632225036621, 0.030673544853925705, -0.24685628712177277, 0.7057393193244934, 0.3278416395187378, -0.8122056126594543, -0.12390878051519394, -0.9650735855102539, 0.5326238870620728, -0.17363965511322021, -0.39939868450164795, 0.34253790974617004, 0.44471579790115356, 1.2929670810699463, 0.05933697521686554, 0.09122458845376968, 1.3395813703536987, -1.3203662633895874, 1.4370592832565308, -0.7119829654693604, 0.24107997119426727, -2.3574304580688477, 1.3912813663482666, -0.8015919327735901, 1.8124489784240723, -2.666642189025879, 0.41195806860923767, -0.5623221397399902, -0.397530734539032, 0.3135225772857666, -0.3502456843852997, 0.16576658189296722, -0.21267813444137573, -1.1315079927444458, -0.19594481587409973, -0.7868759036064148, 0.5596985220909119, 1.1095024347305298, 1.3604023456573486, -1.0458483695983887, -0.26085755228996277, -1.7456512451171875, -0.15281711518764496, -0.5976458787918091, 0.40388596057891846, -1.9146075248718262, -0.21691012382507324, -1.944839596748352, -2.4817612171173096, -1.36930251121521, -0.8277698159217834, 1.1322799921035767, 0.07369495928287506, -0.9066535234451294, 1.129142165184021, -0.36520811915397644, -1.862810492515564, 1.152613639831543, -2.1914620399475098 ]
https://github.com/huggingface/datasets/issues/4422
Cannot load timit_asr data set
Hi @albertvillanova -It loads fine on a copy of the data from deepai - although I have to remove the copies of the .WAV files (with extension .WAV,wav). On a copy of the data that was obtained from the LDC, the glob still fails to find the files. The LDC copy looks like it was copied from CD, in 2004, so the structure may be different to a current download.
## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
736
70
Cannot load timit_asr data set ## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Hi @albertvillanova -It loads fine on a copy of the data from deepai - although I have to remove the copies of the .WAV files (with extension .WAV,wav). On a copy of the data that was obtained from the LDC, the glob still fails to find the files. The LDC copy looks like it was copied from CD, in 2004, so the structure may be different to a current download.
[ -1.156241536140442, -0.8419229984283447, -0.7138243317604065, 1.4349277019500732, -0.1881553828716278, -1.2273964881896973, 0.15037231147289276, -1.0678300857543945, 1.7100861072540283, -0.7829369306564331, 0.2938389778137207, -1.6766438484191895, 0.08719868957996368, -0.5211159586906433, -0.7749524712562561, -0.8972103595733643, -0.40867432951927185, -0.6504642367362976, 0.9753823280334473, 2.459317922592163, 1.1629658937454224, -1.4046494960784912, 2.680008888244629, 0.635419487953186, -0.10806092619895935, -0.9400445222854614, 0.555748701095581, 0.03678647801280022, -1.4035916328430176, -0.37998849153518677, -0.9084832072257996, -0.06594103574752808, -0.5930454134941101, -0.5423761606216431, 0.049477577209472656, 0.39163368940353394, -0.31010901927948, -0.48686426877975464, -0.49210527539253235, -0.8646193146705627, 0.4498674273490906, -0.36856958270072937, 0.9196852445602417, -0.40528446435928345, 1.8505382537841797, -0.5414658784866333, 0.4758879244327545, 0.7731838822364807, 1.3529242277145386, 0.18956518173217773, -0.0370536670088768, 0.34273597598075867, 0.382129430770874, 0.08331836760044098, 0.4682212471961975, 1.1375892162322998, 0.6071058511734009, 0.5229841470718384, 0.6855907440185547, -2.147041082382202, 1.377069354057312, -1.009634256362915, 0.3211706876754761, 1.3518147468566895, -1.032852053642273, 0.35253506898880005, -1.7777016162872314, -0.1332584023475647, 0.44782960414886475, -2.300957202911377, 0.19400647282600403, -1.312815546989441, -0.5516110062599182, 1.0160099267959595, 0.3099047541618347, -1.2196217775344849, 0.08493765443563461, -0.36045676469802856, 0.9678871631622314, 0.481209933757782, 1.2101483345031738, -1.6665401458740234, -0.017394986003637314, -0.2950745224952698, 0.15516707301139832, -1.279380202293396, -1.5331144332885742, 0.5240463614463806, 0.6820966601371765, 0.5416048765182495, -0.09926776587963104, 0.9884328246116638, -0.9517495632171631, 0.8292754292488098, -0.880027174949646, -1.743116855621338, -1.271242380142212, -2.285623073577881, -2.3665149211883545, 0.7754830121994019, -0.45710358023643494, -0.40761488676071167, 2.1172053813934326, -1.0492987632751465, -1.7940208911895752, 1.0873422622680664, 0.27338916063308716, -0.06990151852369308, 2.340106964111328, 0.16120128333568573, -0.6926277875900269, 0.46673327684402466, -0.7237359285354614, 0.7856217622756958, -0.4620596170425415, 1.2826279401779175, 0.456942081451416, -1.0461004972457886, 1.5277001857757568, -0.38840481638908386, 0.5187661647796631, -0.7000460624694824, -0.4456956386566162, -0.7137290835380554, 0.2679748833179474, 1.9145623445510864, -0.28185054659843445, 1.5658921003341675, -0.19748766720294952, -1.5885268449783325, -1.567492961883545, 0.8600365519523621, 0.527569591999054, -0.7233491539955139, 0.1325375884771347, -0.18585042655467987, 0.07767682522535324, 0.020314637571573257, 1.0634316205978394, 1.2673646211624146, 0.8097780346870422, -0.30122360587120056, -0.8822277188301086, 0.189967542886734, -0.018155507743358612, -0.6591060161590576, -1.7082288265228271, -0.3183266818523407, 0.07941102981567383, 0.6661482453346252, -1.2369377613067627, 1.787534236907959, 0.8721014261245728, 1.884483814239502, 1.043497920036316, -0.3363686501979828, 1.5667341947555542, 0.140946164727211, 1.9171605110168457, -0.4135061502456665, 0.6353150606155396, -0.4491484761238098, -1.18060302734375, 0.8391361236572266, -0.3117508292198181, -2.0036048889160156, -0.6437933444976807, -0.9032221436500549, -0.14672011137008667, -0.7382250428199768, 0.9895449876785278, -0.20201264321804047, -1.3715471029281616, 0.2209300696849823, -0.6635929346084595, 0.09643252938985825, -1.29401433467865, 0.33302462100982666, 0.7822351455688477, -0.6554978489875793, 0.06817842274904251, -0.33076390624046326, -1.3033207654953003, -0.5238681435585022, 0.411161869764328, 1.7777873277664185, -0.7142367959022522, 0.9948307275772095, 1.0092494487762451, -0.7684809565544128, -0.05790498107671738, 0.41523507237434387, -0.2994283139705658, 0.8522918820381165, -1.1168702840805054, -0.370832234621048, 1.1407623291015625, -0.2321092188358307, -0.5493286848068237, 1.4405789375305176, 0.6471595168113708, -0.972427487373352, -0.14438049495220184, -0.16582654416561127, -0.8312231302261353, -0.01504056341946125, -1.6395565271377563, -0.06052069365978241, 0.3194613754749298, -1.6065396070480347, -0.5055283904075623, -0.1583910435438156, 1.1881144046783447, -0.1367008090019226, 1.437395453453064, -0.27996572852134705, -0.22133643925189972, -0.44479313492774963, -0.41902732849121094, 0.13343198597431183, -0.2008119374513626, -0.6340965628623962, 0.2926190197467804, -0.7834777235984802, 0.3083336651325226, 1.4204957485198975, 0.3012557625770569, 0.03251414746046066, 0.5941584706306458, 1.1075494289398193, 0.38749247789382935, -0.15416158735752106, -0.8831362724304199, -1.5450538396835327, 2.0655038356781006, -1.4328694343566895, 1.9679819345474243, 0.7369951009750366, -0.023338859900832176, -1.8411040306091309, -1.9212923049926758, 1.4656648635864258, 1.1242109537124634, 2.3397011756896973, 0.6158133149147034, 0.44799819588661194, -0.7970508337020874, -0.6257376074790955, 0.36399102210998535, -1.0069299936294556, -0.773057758808136, 0.12610317766666412, 2.3907527923583984, 1.6509709358215332, -0.44328930974006653, -0.2006503790616989, -1.0156744718551636, 1.433709979057312, -0.15917502343654633, 0.12794993817806244, 1.963539958000183, -0.27177271246910095, -1.0771446228027344, 1.2155940532684326, -2.308234930038452, 0.16576306521892548, 2.0181171894073486, 0.22465327382087708, 0.02666527032852173, -1.3995379209518433, -0.6941007971763611, -0.20220692455768585, -0.45968419313430786, -1.1976275444030762, 0.5104437470436096, -0.3254479169845581, -0.7073265910148621, -1.448243498802185, 0.1892579197883606, -1.1071292161941528, -1.7320064306259155, 0.1902395784854889, 1.8878010511398315, 1.944281816482544, -0.7080608010292053, 1.5077725648880005, -0.23304280638694763, 0.19334685802459717, 1.237726092338562, 1.0897632837295532, 3.1516504287719727, 1.9488606452941895, -1.2831180095672607, 0.6915295124053955, -0.02296842262148857, -0.42581939697265625, 1.2317734956741333, -1.1498334407806396, 1.3070741891860962, -0.22454001009464264, -1.2656625509262085, -1.1762754917144775, 0.9239985942840576, 0.4580899775028229, 0.10429736226797104, -0.4550144374370575, 1.204454779624939, 0.04215599223971367, 1.3348690271377563, 0.5284808874130249, -0.33875471353530884, 0.6482177972793579, -0.44493600726127625, -0.501816987991333, 1.6055240631103516, 0.16301339864730835, -1.35575532913208, -2.3449788093566895, -0.23682409524917603, -0.8333154916763306, 0.057009100914001465, -0.6202578544616699, -0.9431797862052917, 1.569089651107788, 0.49287575483322144, -1.1504597663879395, -0.25621604919433594, -0.4200325012207031, -0.6652767062187195, 2.6457133293151855, -1.4836149215698242, -0.18456825613975525, -1.0182467699050903, -0.6195455193519592, 1.5569531917572021, -1.2361629009246826, -0.19439300894737244, -1.0049148797988892, -0.52414870262146, -1.336396336555481, -0.5964064002037048, -0.012773320078849792, -0.8992653489112854, 0.7836055159568787, 0.11682487279176712, -1.2316370010375977, -0.28685247898101807, -0.9335682988166809, 0.8098782896995544, -0.04575973004102707, 0.17873047292232513, 1.8577218055725098, 0.43374601006507874, -0.37651491165161133, 0.7144803404808044, 1.147979974746704, 0.6107907891273499, -0.6297887563705444, 0.3177517056465149, -0.7352809906005859, 0.3386230170726776, -1.333654761314392, 0.2509545087814331, -2.8050215244293213, 0.6362994909286499, -0.058991607278585434, -0.0652092918753624, -0.0488101951777935, -1.3176839351654053, 1.0216344594955444, 2.600849151611328, -1.190887212753296, 0.5668116807937622, 0.3170357346534729, 1.2146987915039062, -1.5536038875579834, 0.27509477734565735, -0.48561280965805054, 2.1147470474243164, 0.15351298451423645, 1.1502877473831177, -0.42610466480255127, -2.3298842906951904, 0.5702607035636902, -1.2337719202041626, -1.2306623458862305, 0.810588538646698, -0.8034536242485046, 0.005285576917231083, -1.2905205488204956, -0.16651944816112518, -0.7856037020683289, -1.2030600309371948, 0.6900599002838135, 0.06926890462636948, 0.5539693236351013, -0.6288310289382935, 0.3344019949436188, -2.2169461250305176, -1.3192230463027954, -0.2155429869890213, -0.9148330688476562, 0.44861531257629395, -0.3530455529689789, 0.716038703918457, -0.23665814101696014, 0.009102080948650837, 0.33283525705337524, 1.3962211608886719, 3.378462314605713, 0.11522543430328369, 0.35313379764556885, -0.18054187297821045, -0.9930053949356079, 1.4519838094711304, 0.9572203755378723, -0.2315564900636673, -0.6020324230194092, -1.130816102027893, 1.2030764818191528, 1.990540623664856, 1.0490448474884033, 0.02922830358147621, -0.7999585270881653, -0.7643454670906067, 0.03285274654626846, 0.1255815327167511, 0.5317972302436829, 0.9180564284324646, 0.1119316965341568, 0.10967718064785004, 1.4672030210494995, 1.1998745203018188, -0.29461726546287537, 0.37142252922058105, -0.7942913770675659, -0.46447622776031494, 0.5420152544975281, 0.438338041305542, -0.02304830029606819, 0.3264497220516205, -1.0278682708740234, -0.17422202229499817, -0.42524898052215576, -0.9698103666305542, -0.7217346429824829, -0.4014163911342621, -0.36829832196235657, 1.7670655250549316, 0.08378485590219498, -0.5672386288642883, -0.04352685436606407, -0.7929754853248596, 0.0035269679501652718, -1.0077192783355713, 0.35698190331459045, -0.16414819657802582, -0.0375160351395607, -0.07834310829639435, 1.8054341077804565, -1.020267128944397, -2.134967565536499, 0.2949686646461487, 0.1658620536327362, -0.3311938941478729, 0.16270175576210022, 1.629713773727417, 0.5350448489189148, 1.3754355907440186, 1.4796065092086792, 0.9689633846282959, -0.6752071976661682, -1.3130035400390625, 0.6301223635673523, 1.0079891681671143, -1.4401373863220215, 0.7004028558731079, 0.09619501233100891, -0.5424696803092957, 0.614228367805481, 1.2174793481826782, 0.39641961455345154, -2.040013313293457, 0.7730528712272644, -0.9149986505508423, 0.7418690323829651, 0.7199795246124268, 0.7490493655204773, 0.13593383133411407, 0.8003652095794678, -1.2299957275390625, -1.052973747253418, -0.6910013556480408, -0.6611181497573853, 1.922953724861145, -0.30068862438201904, 0.5503374338150024, -0.22324728965759277, -1.332138180732727, -0.0360976867377758, 0.6653453707695007, 0.31772181391716003, -0.4642081558704376, 0.7507812976837158, -0.6413323283195496, -1.1763821840286255, -1.461908221244812, -0.5336440801620483, -1.0668046474456787, -0.876456081867218, 1.038118839263916, 0.8219905495643616, 0.26463764905929565, 1.894250512123108, 0.6202700138092041, 0.16076308488845825, -2.687049388885498, 0.7886245250701904, 0.37859636545181274, -0.033476050943136215, 0.8622696399688721, 0.33725228905677795, 1.037449836730957, -0.060480620712041855, 0.5390169620513916, -2.34995174407959, 2.3561763763427734, -0.23712635040283203, 0.7116153240203857, 0.05080403387546539, -0.17163047194480896, 1.0350009202957153, 0.6099554896354675, 0.5822826623916626, -1.1049004793167114, 0.7236379384994507, -0.6696948409080505, 1.2544212341308594, 0.8921419382095337, -0.861933171749115, -0.07815279811620712, 1.3444719314575195, 0.47945934534072876, -0.4935155212879181, -0.9750438332557678, -0.9732363820075989, 0.9680745005607605, 1.8289097547531128, -0.04499238356947899, 0.09652943164110184, 0.8215187191963196, 0.7112606167793274, -1.3442926406860352, 0.08757993578910828, -0.7638910412788391, -0.7601677179336548, 1.6138192415237427, 1.9755258560180664, -0.012117868289351463, -0.19622810184955597, -0.8081955313682556, -1.3078861236572266, 0.7738778591156006, 0.11816845089197159, 0.07657144218683243, 0.6617023944854736, -0.6725966334342957, 1.1323758363723755, 0.9020612239837646, 0.9626520872116089, 0.22804024815559387, 0.2402212768793106, 0.2842697203159332, -0.33762145042419434, -1.210300087928772, -0.2162940353155136, -1.002049207687378, -2.5613324642181396, 0.5283344388008118, -0.22254148125648499, -1.517482876777649, 0.006600389257073402, -1.023960828781128, 0.8798428773880005, -0.5273289084434509, -1.1453113555908203, -1.513471245765686, 0.18654780089855194, -0.1844262033700943, 0.920558750629425, -1.5786904096603394, -0.14075681567192078, 1.2603529691696167, 0.9987573623657227, -0.7105606198310852, 1.0407081842422485, 0.1794174611568451, 1.0082533359527588, 0.9044867157936096, -0.4190260171890259, 0.4389963448047638, 0.20014625787734985, -1.3833458423614502, 0.4194353520870209, 1.1924784183502197, 0.14656323194503784, 1.4496301412582397, -0.6893816590309143, 0.03629748150706291, 0.42142602801322937, -0.38746407628059387, -0.46535712480545044, -0.6946527361869812, 0.676216721534729, -0.04915729910135269, -0.9301977157592773, 0.07141269743442535, -0.062272313982248306, -0.16362980008125305, 0.19390758872032166, -1.4591413736343384, -0.18061363697052002, -0.3622085154056549, -0.6497980356216431, -1.2689481973648071, -0.05562124401330948, 1.3516637086868286, -0.7749890685081482, -0.12424848228693008, 0.5051188468933105, 0.34400007128715515, 0.49795228242874146, 0.5759169459342957, -0.6944791674613953, -0.3356958329677582, -0.2141837626695633, -0.4179292321205139, 0.3373904228210449, 1.3528910875320435, -0.13003669679164886, -0.9610998034477234, 0.6824138760566711, -0.2730925679206848, 0.14106003940105438, 2.0050652027130127, 0.12664712965488434, -0.8101053833961487, 0.32885822653770447, -0.6960418820381165, 1.9029614925384521, 1.7550013065338135, 1.3572689294815063, -0.07810550928115845, -1.010994553565979, 0.6133504509925842, -0.36246904730796814, -0.37155818939208984, 0.9195154309272766, 0.4477677047252655, -0.17955587804317474, -1.3665502071380615, 0.6290544867515564, 1.2352956533432007, -0.8695477247238159, -0.8835785984992981, 0.06632324308156967, -0.7605743408203125, 1.0174710750579834, 0.7567588090896606, 0.4364745020866394, 0.23333190381526947, 1.672223687171936, 0.8212976455688477, -0.5272279977798462, 0.6503210663795471, 0.42758893966674805, -0.07630965113639832, -2.026442527770996, -1.105318546295166, 0.3511476516723633, -0.5318294763565063, -1.6135938167572021, 1.4436169862747192, -1.1942777633666992, -0.9153323173522949, 0.5410310626029968, 0.09008171409368515, 1.4238730669021606, 0.2767840325832367, 1.5778424739837646, 2.0411548614501953, 0.8629666566848755, 0.38130566477775574, 1.2887924909591675, -0.12942399084568024, -0.3705853223800659, 1.7819089889526367, -0.5007973313331604, 0.4894014596939087, 1.1468664407730103, -0.3818033039569855, -0.9823355078697205, -0.8352219462394714, -1.1534007787704468, -0.7284570932388306, 1.0847574472427368, 0.09902015328407288, -1.0360180139541626, 0.2833963632583618, 1.608973741531372, 0.07189688831567764, -0.2632724642753601, 0.6630914807319641, 0.3441528081893921, -0.7882512807846069, -0.15267959237098694, -0.9632198214530945, 0.5166149139404297, -0.22415930032730103, -0.41638627648353577, 0.37479671835899353, 0.43851974606513977, 1.2971445322036743, 0.06356048583984375, 0.09455354511737823, 1.3175042867660522, -1.3547369241714478, 1.457940936088562, -0.7364801168441772, 0.24150624871253967, -2.325695037841797, 1.3971333503723145, -0.8052671551704407, 1.8272969722747803, -2.6639881134033203, 0.4179309904575348, -0.5600518584251404, -0.37153878808021545, 0.29589930176734924, -0.3111380636692047, 0.19380494952201843, -0.20741090178489685, -1.1059191226959229, -0.16951486468315125, -0.7689924836158752, 0.5572935938835144, 1.1207919120788574, 1.3773579597473145, -1.0336260795593262, -0.28531643748283386, -1.7540984153747559, -0.1377168893814087, -0.5880917310714722, 0.3782963454723358, -1.9011257886886597, -0.22766098380088806, -1.9369288682937622, -2.466468095779419, -1.3526906967163086, -0.8381848335266113, 1.1328089237213135, 0.0755249634385109, -0.8622745871543884, 1.1162527799606323, -0.3683168888092041, -1.871260643005371, 1.1529828310012817, -2.2375357151031494 ]
https://github.com/huggingface/datasets/issues/4422
Cannot load timit_asr data set
Ah, if I change the train/ and test/ directories to TRAIN/ and TEST/ then it works!
## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
736
16
Cannot load timit_asr data set ## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Ah, if I change the train/ and test/ directories to TRAIN/ and TEST/ then it works!
[ -1.160415768623352, -0.8276440501213074, -0.6996052265167236, 1.4126214981079102, -0.15607823431491852, -1.2307761907577515, 0.12572939693927765, -1.0715129375457764, 1.6881154775619507, -0.7882421612739563, 0.31402501463890076, -1.6749687194824219, 0.0566939041018486, -0.5335093140602112, -0.7398825287818909, -0.9065276980400085, -0.383400559425354, -0.6220537424087524, 0.9644054174423218, 2.4593286514282227, 1.1609028577804565, -1.4360443353652954, 2.687068462371826, 0.6463475227355957, -0.13292951881885529, -0.9546924829483032, 0.5444188714027405, 0.03593491017818451, -1.3967463970184326, -0.356669545173645, -0.8894982933998108, -0.09720613062381744, -0.6051185727119446, -0.5402887463569641, 0.050847671926021576, 0.3923541009426117, -0.3377978801727295, -0.4706663191318512, -0.450161337852478, -0.8759005665779114, 0.48085418343544006, -0.3593955636024475, 0.9210201501846313, -0.4245679974555969, 1.8103604316711426, -0.5350398421287537, 0.5021812319755554, 0.7599945664405823, 1.3008790016174316, 0.1691587269306183, -0.01052744872868061, 0.3645388185977936, 0.36174511909484863, 0.10097023099660873, 0.47093939781188965, 1.137118935585022, 0.5968886613845825, 0.511684238910675, 0.6616474986076355, -2.154374837875366, 1.317085862159729, -0.9304963946342468, 0.29808661341667175, 1.3544734716415405, -1.0221447944641113, 0.3226740062236786, -1.7887768745422363, -0.11464423686265945, 0.47398602962493896, -2.274369239807129, 0.23684586584568024, -1.3122743368148804, -0.5356437563896179, 1.021970510482788, 0.33054178953170776, -1.2092028856277466, 0.07317741960287094, -0.3398445248603821, 0.9629137516021729, 0.5082647800445557, 1.192199945449829, -1.672116756439209, -0.05265455320477486, -0.28891995549201965, 0.14870816469192505, -1.3063539266586304, -1.5033767223358154, 0.4915564954280853, 0.6825190186500549, 0.6052171587944031, -0.051104843616485596, 0.9505728483200073, -0.9377109408378601, 0.8244165778160095, -0.9078989624977112, -1.7430371046066284, -1.300802230834961, -2.285834789276123, -2.376762628555298, 0.7813544869422913, -0.4315110146999359, -0.4049989879131317, 2.062328815460205, -1.0417369604110718, -1.8149327039718628, 1.087607741355896, 0.2856086790561676, -0.05269826948642731, 2.3496084213256836, 0.1758546680212021, -0.7249321341514587, 0.512653648853302, -0.7207286357879639, 0.7114048004150391, -0.45139366388320923, 1.2422481775283813, 0.47273382544517517, -1.0596073865890503, 1.5692328214645386, -0.4462806284427643, 0.5599360466003418, -0.7041218280792236, -0.4717999994754791, -0.7351287007331848, 0.2560102045536041, 1.9283379316329956, -0.2711194157600403, 1.5664094686508179, -0.19258172810077667, -1.5680800676345825, -1.5395280122756958, 0.839043915271759, 0.5007187128067017, -0.6986129879951477, 0.14070391654968262, -0.19351539015769958, 0.09057571738958359, -0.005354893393814564, 1.0271124839782715, 1.235926866531372, 0.8003575205802917, -0.28540241718292236, -0.8912609219551086, 0.2524418830871582, -0.01737116277217865, -0.6836974620819092, -1.7346004247665405, -0.30562785267829895, 0.1266838014125824, 0.644483745098114, -1.2498104572296143, 1.762172818183899, 0.8568741679191589, 1.9068266153335571, 1.0122902393341064, -0.32331332564353943, 1.556947112083435, 0.08962320536375046, 1.9568730592727661, -0.3420029282569885, 0.6356927752494812, -0.39036303758621216, -1.1524274349212646, 0.8231419324874878, -0.3383675515651703, -2.041332483291626, -0.6464031338691711, -0.9104247093200684, -0.10067953914403915, -0.7447757124900818, 1.010297417640686, -0.21340399980545044, -1.4101793766021729, 0.22604042291641235, -0.659384548664093, 0.14404059946537018, -1.3239597082138062, 0.30836939811706543, 0.7796136736869812, -0.6149764060974121, 0.02399406209588051, -0.3256818354129791, -1.3154094219207764, -0.5330315232276917, 0.39188840985298157, 1.8006049394607544, -0.7312211990356445, 0.9823557138442993, 0.9962688088417053, -0.7398332953453064, -0.06306426972150803, 0.4150350093841553, -0.3095114529132843, 0.8414843082427979, -1.1300729513168335, -0.324676513671875, 1.15241539478302, -0.20465342700481415, -0.5985199213027954, 1.4647620916366577, 0.70815509557724, -0.9969102740287781, -0.1210194081068039, -0.18391509354114532, -0.7720727324485779, -0.031077038496732712, -1.6666539907455444, -0.06039174273610115, 0.29936423897743225, -1.5641155242919922, -0.5031209588050842, -0.12376242876052856, 1.230184555053711, -0.15502530336380005, 1.4384937286376953, -0.32686924934387207, -0.21325217187404633, -0.4634200930595398, -0.45339980721473694, 0.10443638265132904, -0.21087677776813507, -0.6540259718894958, 0.2723183333873749, -0.7602035403251648, 0.30679699778556824, 1.3970441818237305, 0.3119056224822998, 0.07660601288080215, 0.594215452671051, 1.1170624494552612, 0.33860403299331665, -0.16386383771896362, -0.8772332072257996, -1.571293592453003, 2.044696569442749, -1.4029332399368286, 1.9753949642181396, 0.7006850242614746, -0.07378757745027542, -1.8336325883865356, -1.9170128107070923, 1.4492641687393188, 1.134012222290039, 2.3563201427459717, 0.6277055144309998, 0.49406811594963074, -0.8341881036758423, -0.6700748205184937, 0.3182790279388428, -0.9685462713241577, -0.7782465815544128, 0.1323985606431961, 2.409583806991577, 1.6494154930114746, -0.43459123373031616, -0.17319785058498383, -1.0136638879776, 1.4316891431808472, -0.1914883255958557, 0.18075384199619293, 1.970298171043396, -0.265800803899765, -1.0787668228149414, 1.2367899417877197, -2.2925031185150146, 0.19178219139575958, 2.0059518814086914, 0.2180095911026001, 0.0403020866215229, -1.3764622211456299, -0.7100180983543396, -0.20084793865680695, -0.47413867712020874, -1.180747389793396, 0.47565269470214844, -0.31230393052101135, -0.7133457064628601, -1.3986722230911255, 0.1861116737127304, -1.105085849761963, -1.7399368286132812, 0.19587579369544983, 1.8685091733932495, 1.9485013484954834, -0.7023428678512573, 1.5147156715393066, -0.2239668220281601, 0.22029483318328857, 1.2538514137268066, 1.123401165008545, 3.1590161323547363, 1.935074806213379, -1.279306173324585, 0.7370340824127197, -0.05655760318040848, -0.4160880744457245, 1.206301212310791, -1.1909215450286865, 1.2626941204071045, -0.23624210059642792, -1.276597499847412, -1.192869782447815, 0.9288191199302673, 0.4624408483505249, 0.1258792281150818, -0.4808822274208069, 1.2377190589904785, 0.05141877382993698, 1.3858057260513306, 0.52853924036026, -0.3312627077102661, 0.6235490441322327, -0.40822693705558777, -0.5091789960861206, 1.615941047668457, 0.15386492013931274, -1.3723222017288208, -2.36124587059021, -0.23850950598716736, -0.8656227588653564, -0.022719450294971466, -0.6301068663597107, -0.9906991124153137, 1.5901356935501099, 0.4860247075557709, -1.1342746019363403, -0.26241013407707214, -0.381954550743103, -0.6578569412231445, 2.697309970855713, -1.484696388244629, -0.17555925250053406, -0.9953520894050598, -0.6222904324531555, 1.617605209350586, -1.2238062620162964, -0.18271972239017487, -1.0136821269989014, -0.5930005311965942, -1.3303974866867065, -0.5344076156616211, -0.027852848172187805, -0.9280646443367004, 0.7917273640632629, 0.13233840465545654, -1.2429553270339966, -0.2800660729408264, -0.9679730534553528, 0.8055295944213867, -0.06445404142141342, 0.21666762232780457, 1.7978605031967163, 0.4456131160259247, -0.37019413709640503, 0.6856382489204407, 1.1501526832580566, 0.6122246980667114, -0.6811109185218811, 0.31248170137405396, -0.7316694855690002, 0.32098522782325745, -1.3386075496673584, 0.24768976867198944, -2.8155574798583984, 0.6695857644081116, -0.07080110907554626, -0.056754741817712784, -0.09478197246789932, -1.3276361227035522, 1.0271834135055542, 2.5949461460113525, -1.2057925462722778, 0.5884764790534973, 0.33811551332473755, 1.2052013874053955, -1.5539213418960571, 0.24139271676540375, -0.4962979853153229, 2.126124620437622, 0.1303623467683792, 1.1585233211517334, -0.4189307391643524, -2.3104591369628906, 0.5807690620422363, -1.2170994281768799, -1.2155598402023315, 0.8496280908584595, -0.8160005211830139, 0.0517604760825634, -1.277928352355957, -0.12908022105693817, -0.8228724002838135, -1.1860820055007935, 0.7021484375, 0.07810802757740021, 0.5585635304450989, -0.6097416877746582, 0.35414451360702515, -2.22625732421875, -1.3599064350128174, -0.21619340777397156, -0.9076637029647827, 0.45785871148109436, -0.32273221015930176, 0.7421431541442871, -0.19699439406394958, -0.0008201552554965019, 0.33133479952812195, 1.384558916091919, 3.3513004779815674, 0.11274725943803787, 0.35240066051483154, -0.16855840384960175, -0.9981411099433899, 1.4642877578735352, 0.9128546714782715, -0.22444520890712738, -0.5941787958145142, -1.0557737350463867, 1.2363277673721313, 1.9779284000396729, 1.0696699619293213, 0.02122839167714119, -0.8244554400444031, -0.7178383469581604, 0.06954598426818848, 0.1142568290233612, 0.5470232963562012, 0.9141128659248352, 0.09326069056987762, 0.11101081222295761, 1.4289299249649048, 1.2049546241760254, -0.2902854382991791, 0.3595048487186432, -0.7993234395980835, -0.4608185589313507, 0.5512024164199829, 0.4203515946865082, 0.028579406440258026, 0.3017883002758026, -1.0340696573257446, -0.15381662547588348, -0.38401806354522705, -0.972963273525238, -0.7339770793914795, -0.4702315926551819, -0.3817704916000366, 1.7913191318511963, 0.029766827821731567, -0.5336287021636963, -0.02064727433025837, -0.7890457510948181, -0.014474201947450638, -1.0349204540252686, 0.33733388781547546, -0.16733425855636597, -0.009403761476278305, -0.0700894296169281, 1.765891432762146, -1.043688416481018, -2.109483480453491, 0.2644345462322235, 0.21316981315612793, -0.3464755117893219, 0.13931885361671448, 1.6478056907653809, 0.5240031480789185, 1.3917535543441772, 1.4610196352005005, 0.9643336534500122, -0.7018389105796814, -1.2689059972763062, 0.6211148500442505, 1.0587704181671143, -1.4008694887161255, 0.7160742282867432, 0.09290111064910889, -0.5537409782409668, 0.5975542664527893, 1.2395720481872559, 0.40022391080856323, -2.0134177207946777, 0.7419337034225464, -0.8900890946388245, 0.7328134775161743, 0.7148756980895996, 0.7463147044181824, 0.15668338537216187, 0.8280380964279175, -1.2663002014160156, -1.0549756288528442, -0.6843664050102234, -0.6465499401092529, 1.916001319885254, -0.29102838039398193, 0.5202169418334961, -0.1901615560054779, -1.3253247737884521, -0.018312323838472366, 0.6930972337722778, 0.3255273997783661, -0.4189984202384949, 0.761008620262146, -0.6526793241500854, -1.1266255378723145, -1.453493356704712, -0.48996761441230774, -1.0689053535461426, -0.8794559836387634, 1.0362522602081299, 0.8334822654724121, 0.29150286316871643, 1.8720922470092773, 0.6429362297058105, 0.1704327017068863, -2.6726903915405273, 0.8162471055984497, 0.35662540793418884, -0.03691622614860535, 0.846315860748291, 0.324677973985672, 1.0597044229507446, -0.061667926609516144, 0.5720880031585693, -2.342811107635498, 2.3130757808685303, -0.25378507375717163, 0.6439909338951111, 0.022492755204439163, -0.11772540211677551, 1.0149521827697754, 0.588599681854248, 0.5676982402801514, -1.121204137802124, 0.7214193344116211, -0.6882069110870361, 1.2484393119812012, 0.847839891910553, -0.8892346024513245, -0.024064749479293823, 1.3051775693893433, 0.442291796207428, -0.48930224776268005, -0.9835712909698486, -0.9363330602645874, 1.0082378387451172, 1.7881627082824707, -0.043086860328912735, 0.06257364153862, 0.855395495891571, 0.7128989696502686, -1.3540350198745728, 0.055406056344509125, -0.7464775443077087, -0.73260098695755, 1.6321829557418823, 1.988325834274292, -0.021563874557614326, -0.1942831575870514, -0.8144360184669495, -1.2920994758605957, 0.8210198879241943, 0.10985004156827927, 0.08546333014965057, 0.6625644564628601, -0.6621687412261963, 1.1620515584945679, 0.8536149859428406, 0.9594615697860718, 0.19740962982177734, 0.2273699939250946, 0.2877036929130554, -0.3333808183670044, -1.2395645380020142, -0.23574204742908478, -1.0103037357330322, -2.5854554176330566, 0.5378227233886719, -0.23062744736671448, -1.4680029153823853, 0.0001849643886089325, -1.0170716047286987, 0.8817263245582581, -0.5520595908164978, -1.1378071308135986, -1.4761687517166138, 0.2035341113805771, -0.16084931790828705, 0.8700753450393677, -1.5762748718261719, -0.1406770795583725, 1.2700104713439941, 0.9942204356193542, -0.6849720478057861, 1.0463742017745972, 0.19278572499752045, 1.000464677810669, 0.8870953917503357, -0.43369466066360474, 0.5002650022506714, 0.17928780615329742, -1.385556697845459, 0.42774152755737305, 1.2119805812835693, 0.19380702078342438, 1.501789927482605, -0.6922072172164917, 0.04689766839146614, 0.39428701996803284, -0.3743022382259369, -0.5136857032775879, -0.7604907751083374, 0.6994743943214417, -0.003522333223372698, -1.0035749673843384, 0.043558940291404724, -0.061714448034763336, -0.12187885493040085, 0.1969602257013321, -1.4483954906463623, -0.1435992270708084, -0.3461475074291229, -0.6489099264144897, -1.2816917896270752, -0.0010659359395503998, 1.3294250965118408, -0.8101312518119812, -0.0999036356806755, 0.47184211015701294, 0.34170109033584595, 0.5185422897338867, 0.5907214283943176, -0.7041112184524536, -0.3350699245929718, -0.2626774311065674, -0.380403995513916, 0.33856987953186035, 1.3177357912063599, -0.13703714311122894, -0.9801971316337585, 0.6863337159156799, -0.3405485451221466, 0.14048996567726135, 1.9888415336608887, 0.12035700678825378, -0.8196920156478882, 0.34256061911582947, -0.7453668117523193, 1.9049121141433716, 1.7497906684875488, 1.3798964023590088, -0.06221245974302292, -0.9812834858894348, 0.5933083295822144, -0.36589840054512024, -0.3712862730026245, 0.9517359137535095, 0.4652324616909027, -0.18489393591880798, -1.361060380935669, 0.6345411539077759, 1.2230650186538696, -0.8353784084320068, -0.8974747061729431, 0.08230888098478317, -0.7795610427856445, 1.007494330406189, 0.7882052063941956, 0.4323742687702179, 0.2689253091812134, 1.6382476091384888, 0.808436930179596, -0.5407902598381042, 0.6102769374847412, 0.4290628433227539, -0.08530432730913162, -2.001978874206543, -1.101920247077942, 0.3624306917190552, -0.5336118936538696, -1.605494499206543, 1.4347492456436157, -1.2037454843521118, -0.9323766827583313, 0.5553929805755615, 0.0906471386551857, 1.4217817783355713, 0.30571019649505615, 1.599629521369934, 1.9998842477798462, 0.8881865739822388, 0.35038790106773376, 1.2896701097488403, -0.18054980039596558, -0.3479531705379486, 1.7991580963134766, -0.5115717053413391, 0.49014127254486084, 1.0976372957229614, -0.39840999245643616, -0.997484564781189, -0.8546839952468872, -1.1777571439743042, -0.7281045913696289, 1.0991840362548828, 0.11847420036792755, -1.068193793296814, 0.2639840543270111, 1.6162675619125366, 0.042069219052791595, -0.23353895545005798, 0.7080132365226746, 0.31728285551071167, -0.818644106388092, -0.11420074105262756, -0.9796665906906128, 0.5462478995323181, -0.1702749878168106, -0.3809676170349121, 0.3187304139137268, 0.4654849171638489, 1.3073724508285522, 0.05061720684170723, 0.10108911991119385, 1.350001335144043, -1.3200807571411133, 1.4222294092178345, -0.7756454348564148, 0.2371755987405777, -2.35048770904541, 1.3865506649017334, -0.8327627778053284, 1.8074063062667847, -2.6537113189697266, 0.4232018291950226, -0.5694417357444763, -0.3555782735347748, 0.31505608558654785, -0.3445984721183777, 0.16554343700408936, -0.18601574003696442, -1.1321864128112793, -0.18754065036773682, -0.8074018359184265, 0.5668296217918396, 1.1411993503570557, 1.3668354749679565, -1.046587586402893, -0.28021377325057983, -1.7751766443252563, -0.16333065927028656, -0.5957862138748169, 0.41273173689842224, -1.9344985485076904, -0.19088351726531982, -1.9561231136322021, -2.464651107788086, -1.3911693096160889, -0.8375057578086853, 1.1408568620681763, 0.09592371433973312, -0.8963347673416138, 1.1022720336914062, -0.36496007442474365, -1.8446382284164429, 1.1727958917617798, -2.2458138465881348 ]
https://github.com/huggingface/datasets/issues/4422
Cannot load timit_asr data set
Thanks for your investigation and report, @bhaddow. I'm adding another fix for the TRAIN/train and TEST/test directory names.
## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
736
18
Cannot load timit_asr data set ## Describe the bug I am trying to load the timit_asr data set. I have tried with a copy from the LDC, and a copy from deepai. In both cases they fail with a "duplicate key" error. With the LDC version I have to convert the file extensions all to upper-case before I can load it at all. ## Steps to reproduce the bug ```python timit = datasets.load_dataset("timit_asr", data_dir = "/path/to/dataset") # Sample code to reproduce the bug ``` ## Expected results The data set should load without error. It worked for me before the LDC url change. ## Actual results ``` datasets.keyhash.DuplicatedKeysError: FAILURE TO GENERATE DATASET ! Found duplicate Key: SA1 Keys should be unique and deterministic in nature ``` ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-90-generic-x86_64-with-glibc2.17 - Python version: 3.8.12 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Thanks for your investigation and report, @bhaddow. I'm adding another fix for the TRAIN/train and TEST/test directory names.
[ -1.1719908714294434, -0.8501750230789185, -0.6685650944709778, 1.416130781173706, -0.17881961166858673, -1.2307301759719849, 0.15319740772247314, -1.0948630571365356, 1.6881523132324219, -0.8027089238166809, 0.2997885048389435, -1.6775850057601929, 0.03337748721241951, -0.5227340459823608, -0.7312424182891846, -0.9205448031425476, -0.3948119282722473, -0.6256746649742126, 0.952004075050354, 2.461193799972534, 1.1657918691635132, -1.397531509399414, 2.679948568344116, 0.6630715727806091, -0.14645177125930786, -0.9637853503227234, 0.5542076230049133, 0.031345874071121216, -1.4141165018081665, -0.3350737988948822, -0.911893367767334, -0.10770584642887115, -0.6025280356407166, -0.5335912108421326, 0.049488481134176254, 0.39671239256858826, -0.32172727584838867, -0.4698410630226135, -0.4453129172325134, -0.8615800738334656, 0.4618184268474579, -0.36901336908340454, 0.91349196434021, -0.41456082463264465, 1.8025145530700684, -0.5497739315032959, 0.520283043384552, 0.7414993047714233, 1.303288221359253, 0.1863665133714676, -0.01831708662211895, 0.33258503675460815, 0.37229952216148376, 0.0941103920340538, 0.4538404941558838, 1.122853398323059, 0.6046064496040344, 0.5186010003089905, 0.6770535707473755, -2.163788080215454, 1.321918249130249, -0.9496332406997681, 0.308236300945282, 1.363876461982727, -1.0213830471038818, 0.3465128540992737, -1.785504698753357, -0.10869725793600082, 0.46516725420951843, -2.2502918243408203, 0.23472844064235687, -1.3175127506256104, -0.5488981008529663, 1.0238991975784302, 0.3155165910720825, -1.2091177701950073, 0.07048351317644119, -0.3463186025619507, 0.9883224964141846, 0.5092104077339172, 1.1600912809371948, -1.6791735887527466, -0.05284297838807106, -0.30803754925727844, 0.1408633291721344, -1.3072636127471924, -1.52777099609375, 0.5078917145729065, 0.7204412817955017, 0.6138505339622498, -0.04755672439932823, 0.9467738270759583, -0.9394411444664001, 0.8180105686187744, -0.9142033457756042, -1.7661300897598267, -1.2889403104782104, -2.282777786254883, -2.3608224391937256, 0.7548971772193909, -0.43236204981803894, -0.4143456518650055, 2.0920231342315674, -1.0227652788162231, -1.8139123916625977, 1.078283667564392, 0.25679633021354675, -0.06022968515753746, 2.35935378074646, 0.1807328760623932, -0.709129273891449, 0.4837513566017151, -0.7333136200904846, 0.6925432085990906, -0.4630979895591736, 1.2605723142623901, 0.4445478022098541, -1.0484687089920044, 1.5579173564910889, -0.4337545931339264, 0.5504116415977478, -0.7200609445571899, -0.4749697148799896, -0.7261114716529846, 0.24252155423164368, 1.9256492853164673, -0.2740044891834259, 1.5492991209030151, -0.1837647408246994, -1.5699635744094849, -1.5390548706054688, 0.8374810814857483, 0.49734485149383545, -0.7053267955780029, 0.12637054920196533, -0.1874978095293045, 0.0486755296587944, -0.011747331358492374, 1.0405421257019043, 1.2393583059310913, 0.8005695343017578, -0.30394408106803894, -0.8935506343841553, 0.24611765146255493, -0.01864974945783615, -0.7041469812393188, -1.7270315885543823, -0.2914521098136902, 0.11739368736743927, 0.6528473496437073, -1.2407039403915405, 1.762497067451477, 0.8488245606422424, 1.8914061784744263, 1.0263755321502686, -0.3330782949924469, 1.5326818227767944, 0.1131952777504921, 1.9458779096603394, -0.3811490833759308, 0.6557900309562683, -0.41041243076324463, -1.1511588096618652, 0.8303501009941101, -0.32816392183303833, -2.025214433670044, -0.626358151435852, -0.9139227271080017, -0.1138201579451561, -0.7597494125366211, 1.001837134361267, -0.19842323660850525, -1.4198367595672607, 0.22974328696727753, -0.6520889401435852, 0.1414925754070282, -1.3191665410995483, 0.3335011601448059, 0.7833411693572998, -0.5903109312057495, 0.038839004933834076, -0.33926311135292053, -1.3150709867477417, -0.5344786643981934, 0.4092622399330139, 1.7762060165405273, -0.7154403924942017, 0.9616214632987976, 1.0138121843338013, -0.7487842440605164, -0.060624949634075165, 0.40463683009147644, -0.3022083640098572, 0.8515269160270691, -1.110601544380188, -0.3324313461780548, 1.1493250131607056, -0.1968659609556198, -0.5997701287269592, 1.469530701637268, 0.7093639373779297, -0.9786396622657776, -0.14316682517528534, -0.19144119322299957, -0.7776169776916504, -0.03274189680814743, -1.676770567893982, -0.04826032742857933, 0.3141694962978363, -1.5624096393585205, -0.5141889452934265, -0.1425275206565857, 1.2409329414367676, -0.139182910323143, 1.4086767435073853, -0.3138623833656311, -0.22861868143081665, -0.46440553665161133, -0.4316510558128357, 0.12015867233276367, -0.22831255197525024, -0.6429179906845093, 0.25129324197769165, -0.7817238569259644, 0.3092266619205475, 1.430722713470459, 0.2950640916824341, 0.08214036375284195, 0.5976230502128601, 1.0993561744689941, 0.3523349165916443, -0.17724372446537018, -0.8795565366744995, -1.5569764375686646, 2.0372912883758545, -1.3979029655456543, 1.9822931289672852, 0.7002916932106018, -0.07867252081632614, -1.8635355234146118, -1.9220740795135498, 1.4426358938217163, 1.1460026502609253, 2.3450682163238525, 0.6374834775924683, 0.4956737756729126, -0.8408921360969543, -0.6514753103256226, 0.3218850791454315, -0.9748958349227905, -0.7691972851753235, 0.14541186392307281, 2.399912118911743, 1.6483981609344482, -0.45297929644584656, -0.17361211776733398, -1.0142723321914673, 1.434057593345642, -0.15825334191322327, 0.16667243838310242, 1.959794044494629, -0.2730674743652344, -1.0782634019851685, 1.2357488870620728, -2.300342082977295, 0.18525201082229614, 2.002551317214966, 0.21793127059936523, 0.056143149733543396, -1.3722425699234009, -0.7359395027160645, -0.21814092993736267, -0.4458253085613251, -1.18532133102417, 0.4683600664138794, -0.28097885847091675, -0.6827372312545776, -1.428023338317871, 0.19292052090168, -1.107174038887024, -1.7403075695037842, 0.19152185320854187, 1.8783481121063232, 1.9379746913909912, -0.7194467186927795, 1.531537413597107, -0.22431613504886627, 0.2236218899488449, 1.257304072380066, 1.10688316822052, 3.1295602321624756, 1.946700930595398, -1.256903052330017, 0.7594080567359924, -0.04697265103459358, -0.4075729548931122, 1.1915878057479858, -1.1580976247787476, 1.253187656402588, -0.2254222333431244, -1.2624412775039673, -1.196469783782959, 0.9344276189804077, 0.44202864170074463, 0.10891549289226532, -0.47978827357292175, 1.2162137031555176, 0.06405723839998245, 1.3965803384780884, 0.5272900462150574, -0.32960155606269836, 0.6403920650482178, -0.40744900703430176, -0.5109680891036987, 1.6222121715545654, 0.1756165474653244, -1.3574846982955933, -2.3503236770629883, -0.25261375308036804, -0.8402186632156372, -0.023095224052667618, -0.6200598478317261, -0.9924644827842712, 1.5982333421707153, 0.5095420479774475, -1.123517394065857, -0.26402997970581055, -0.3635122776031494, -0.6422058939933777, 2.6977407932281494, -1.510337233543396, -0.16839945316314697, -1.0059233903884888, -0.6240261197090149, 1.618476152420044, -1.2335666418075562, -0.1657436639070511, -1.016469120979309, -0.584443986415863, -1.3358862400054932, -0.5432493090629578, -0.014560329727828503, -0.9459009170532227, 0.7837265729904175, 0.13889682292938232, -1.2438918352127075, -0.29396942257881165, -0.969716489315033, 0.8244028687477112, -0.05945166200399399, 0.21896851062774658, 1.8207374811172485, 0.4553287625312805, -0.368378221988678, 0.6820287704467773, 1.1209561824798584, 0.612185537815094, -0.6826581358909607, 0.2921662926673889, -0.7287647128105164, 0.33209043741226196, -1.3320143222808838, 0.23678764700889587, -2.825474739074707, 0.6506971716880798, -0.06961630284786224, -0.05232994630932808, -0.08841738849878311, -1.3526757955551147, 1.0290290117263794, 2.60015606880188, -1.2003898620605469, 0.5722466111183167, 0.3397732973098755, 1.2190991640090942, -1.5506548881530762, 0.262600839138031, -0.45859724283218384, 2.106142997741699, 0.12352049350738525, 1.1586354970932007, -0.42384830117225647, -2.3192546367645264, 0.5787128806114197, -1.210124135017395, -1.2234618663787842, 0.8174057602882385, -0.8235063552856445, 0.02499542385339737, -1.2919185161590576, -0.15220658481121063, -0.8262497186660767, -1.184686303138733, 0.7106671929359436, 0.08208320289850235, 0.5441514253616333, -0.6271209716796875, 0.35326093435287476, -2.227740526199341, -1.3416818380355835, -0.2122724950313568, -0.8906985521316528, 0.4312050938606262, -0.31939151883125305, 0.7302078008651733, -0.19636023044586182, 0.02046409249305725, 0.3379995822906494, 1.3878231048583984, 3.3440189361572266, 0.10466371476650238, 0.3627091348171234, -0.16482768952846527, -1.0095247030258179, 1.462509036064148, 0.9102351069450378, -0.2257024198770523, -0.5884828567504883, -1.0563958883285522, 1.236005187034607, 1.9707359075546265, 1.039484977722168, 0.030626565217971802, -0.8237596154212952, -0.7164007425308228, 0.051732391119003296, 0.13369835913181305, 0.5377748608589172, 0.9281589984893799, 0.12054990231990814, 0.11212240904569626, 1.4438978433609009, 1.212036371231079, -0.30891263484954834, 0.36158156394958496, -0.8075194954872131, -0.4857862591743469, 0.5514575839042664, 0.4308212697505951, 0.014112927950918674, 0.2813582718372345, -1.049268126487732, -0.14963576197624207, -0.39605841040611267, -0.9495671391487122, -0.7537200450897217, -0.473111629486084, -0.3829294741153717, 1.7772048711776733, 0.05310510843992233, -0.5631400942802429, -0.018730025738477707, -0.7815110683441162, 0.0011501824483275414, -1.0315630435943604, 0.35157668590545654, -0.18100039660930634, -0.007620583288371563, -0.07544393837451935, 1.786108136177063, -1.0413204431533813, -2.095066785812378, 0.2781262993812561, 0.19791699945926666, -0.35381725430488586, 0.16004109382629395, 1.6321364641189575, 0.5448784232139587, 1.4038312435150146, 1.4576414823532104, 0.9656139612197876, -0.7064198851585388, -1.2916576862335205, 0.6300709247589111, 1.0367846488952637, -1.4002262353897095, 0.700271487236023, 0.11324527114629745, -0.5410074591636658, 0.5859209895133972, 1.2364140748977661, 0.3857812285423279, -2.0148863792419434, 0.7444235682487488, -0.9102975726127625, 0.731279194355011, 0.7229183912277222, 0.7606170177459717, 0.1453268975019455, 0.8219090104103088, -1.2548573017120361, -1.05172598361969, -0.6812173128128052, -0.6446922421455383, 1.9211628437042236, -0.31525108218193054, 0.5427122116088867, -0.20601089298725128, -1.3267476558685303, -0.018190843984484673, 0.6844107508659363, 0.3491761088371277, -0.4509258568286896, 0.7726117372512817, -0.633966326713562, -1.1437455415725708, -1.4246615171432495, -0.5076885223388672, -1.05353581905365, -0.9017728567123413, 1.0195237398147583, 0.8447141647338867, 0.31216952204704285, 1.8612821102142334, 0.6275829672813416, 0.171182319521904, -2.687171220779419, 0.8047658205032349, 0.33708518743515015, -0.04390125349164009, 0.8404514789581299, 0.32576319575309753, 1.0321943759918213, -0.0735127329826355, 0.5615020394325256, -2.3406689167022705, 2.3441765308380127, -0.2501163184642792, 0.6662390232086182, 0.014588150195777416, -0.11653386801481247, 1.0373692512512207, 0.5888945460319519, 0.5845691561698914, -1.1044560670852661, 0.7117061614990234, -0.684132993221283, 1.275394082069397, 0.8486839532852173, -0.876244843006134, -0.05931653827428818, 1.3199279308319092, 0.46780359745025635, -0.5095110535621643, -0.9928463101387024, -0.9589483141899109, 0.9853408336639404, 1.7955360412597656, -0.03953930735588074, 0.0676664188504219, 0.8377546668052673, 0.7115361094474792, -1.3625524044036865, 0.059221409261226654, -0.7492748498916626, -0.7133151888847351, 1.637178897857666, 1.9944602251052856, -0.01858491450548172, -0.18977060914039612, -0.799841582775116, -1.3051087856292725, 0.8298455476760864, 0.11249444633722305, 0.07762649655342102, 0.6760052442550659, -0.6469327211380005, 1.1503840684890747, 0.8517102003097534, 0.9692500829696655, 0.23057125508785248, 0.26447761058807373, 0.27227118611335754, -0.3512513041496277, -1.2369343042373657, -0.21046873927116394, -1.0195770263671875, -2.548247814178467, 0.538254976272583, -0.20572619140148163, -1.4766662120819092, -0.01521071046590805, -1.0164129734039307, 0.8847568035125732, -0.5573790669441223, -1.146448016166687, -1.4940909147262573, 0.19713327288627625, -0.1678791046142578, 0.8845943212509155, -1.5701260566711426, -0.11476633697748184, 1.2716341018676758, 1.0133893489837646, -0.6760416626930237, 1.0599220991134644, 0.18488501012325287, 1.017108678817749, 0.8889399766921997, -0.40353503823280334, 0.4810594618320465, 0.16039684414863586, -1.3702623844146729, 0.4378928244113922, 1.2058024406433105, 0.2005576491355896, 1.5050166845321655, -0.697895348072052, 0.04570431262254715, 0.3996335566043854, -0.3801664710044861, -0.4908839464187622, -0.7630025148391724, 0.6894139051437378, 0.009360923431813717, -0.9870492219924927, 0.030752401798963547, -0.06961826980113983, -0.12466412782669067, 0.20142768323421478, -1.467551827430725, -0.12584780156612396, -0.36540594696998596, -0.6591378450393677, -1.2648961544036865, -0.008134128525853157, 1.3494282960891724, -0.8084231019020081, -0.08814740926027298, 0.4859902560710907, 0.33070194721221924, 0.529822826385498, 0.5948120355606079, -0.7203898429870605, -0.3303844928741455, -0.265267014503479, -0.3704927861690521, 0.3441164195537567, 1.3391445875167847, -0.14745911955833435, -0.9707447290420532, 0.6949671506881714, -0.3216925263404846, 0.14348840713500977, 2.005078077316284, 0.12467871606349945, -0.8207604885101318, 0.3408666253089905, -0.729682445526123, 1.9289747476577759, 1.7533680200576782, 1.380550503730774, -0.07014983892440796, -0.9910939335823059, 0.5770149827003479, -0.35923126339912415, -0.3693227767944336, 0.9373305439949036, 0.47925838828086853, -0.2005685567855835, -1.3430111408233643, 0.6561607122421265, 1.232609748840332, -0.8484103679656982, -0.8915961384773254, 0.10332290828227997, -0.7674131393432617, 1.0111645460128784, 0.7703431248664856, 0.4247746169567108, 0.2691742777824402, 1.654179334640503, 0.8135294914245605, -0.5457812547683716, 0.58537358045578, 0.4397737383842468, -0.0983242467045784, -1.9770169258117676, -1.1195505857467651, 0.3498844504356384, -0.5600536465644836, -1.627533197402954, 1.449965000152588, -1.2178685665130615, -0.9263025522232056, 0.5533111691474915, 0.0991707369685173, 1.4346531629562378, 0.31887927651405334, 1.57509446144104, 1.9950987100601196, 0.892054557800293, 0.3789367079734802, 1.3140475749969482, -0.17143727838993073, -0.36252540349960327, 1.7990150451660156, -0.509296178817749, 0.479198694229126, 1.135414481163025, -0.40565693378448486, -0.9956783056259155, -0.867103099822998, -1.1580358743667603, -0.7272414565086365, 1.10250723361969, 0.12041717767715454, -1.0675016641616821, 0.27883726358413696, 1.6197257041931152, 0.026778455823659897, -0.24706722795963287, 0.7241302728652954, 0.31163015961647034, -0.8053044080734253, -0.10306016355752945, -0.9690861105918884, 0.5368936061859131, -0.1812688112258911, -0.3918127715587616, 0.33469539880752563, 0.45253294706344604, 1.3043365478515625, 0.03910445794463158, 0.11217648535966873, 1.3277016878128052, -1.3074898719787598, 1.4249815940856934, -0.7401648759841919, 0.23765113949775696, -2.3568167686462402, 1.3837865591049194, -0.8184689283370972, 1.8125754594802856, -2.6835217475891113, 0.4072681963443756, -0.567176342010498, -0.3653551936149597, 0.283728688955307, -0.3623117506504059, 0.1602845937013626, -0.16259218752384186, -1.136094093322754, -0.20241010189056396, -0.7993382811546326, 0.5541072487831116, 1.1265243291854858, 1.3614670038223267, -1.050069808959961, -0.26680880784988403, -1.7604196071624756, -0.14928561449050903, -0.5997028350830078, 0.42300647497177124, -1.9219720363616943, -0.21377858519554138, -1.9393866062164307, -2.4699087142944336, -1.3754554986953735, -0.8261253833770752, 1.1037356853485107, 0.05513489991426468, -0.8774212002754211, 1.1047618389129639, -0.38398483395576477, -1.8430702686309814, 1.175713062286377, -2.2423629760742188 ]
https://github.com/huggingface/datasets/issues/4420
Metric evaluation problems in multi-node, shared file system
If you call `metric.compute` in a distributed setup like yours, then `metric.compute` is called in each process. `metric.compute` first calls `metric.add_batch`, and it looks like your error appears at that stage. To make sure that all the processes have started writing their predictions/references at the same time, each process waits for process 0 to lock `slurm-{world_size}-0.arrow.lock`. Process 0 locks this file when `metric.add_batch` is called, so here when `metric.compute` is called. Therefore your error can happen when process 0 takes too much time to call `metric.compute` compared to process 3 (>100 seconds by default). I haven't tried running your code but could it be the case ? I guess it could also happen if you run multiple times the same distributed job at the same time with the same `experiment_id` because they would collide.
## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0
737
134
Metric evaluation problems in multi-node, shared file system ## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0 If you call `metric.compute` in a distributed setup like yours, then `metric.compute` is called in each process. `metric.compute` first calls `metric.add_batch`, and it looks like your error appears at that stage. To make sure that all the processes have started writing their predictions/references at the same time, each process waits for process 0 to lock `slurm-{world_size}-0.arrow.lock`. Process 0 locks this file when `metric.add_batch` is called, so here when `metric.compute` is called. Therefore your error can happen when process 0 takes too much time to call `metric.compute` compared to process 3 (>100 seconds by default). I haven't tried running your code but could it be the case ? I guess it could also happen if you run multiple times the same distributed job at the same time with the same `experiment_id` because they would collide.
[ -1.296735405921936, -0.898237943649292, -0.786631166934967, 1.4941779375076294, -0.16268455982208252, -1.243415117263794, 0.17101557552814484, -1.040987491607666, 1.7357490062713623, -0.7962110042572021, 0.2971554696559906, -1.6023008823394775, 0.09675242751836777, -0.6188485026359558, -0.7566505670547485, -0.8449321389198303, -0.3520471453666687, -0.7326327562332153, 1.0212289094924927, 2.5368292331695557, 1.303423523902893, -1.299533724784851, 2.7445642948150635, 0.7668829560279846, -0.27061134576797485, -0.9395747780799866, 0.47091981768608093, -0.05736588314175606, -1.277888298034668, -0.46126970648765564, -0.9297401905059814, -0.024585597217082977, -0.533450722694397, -0.5027673840522766, 0.0028469087556004524, 0.36731502413749695, -0.33792194724082947, -0.4516681432723999, -0.5784897804260254, -0.7877139449119568, 0.4791809916496277, -0.34861302375793457, 0.8894843459129333, -0.3108561635017395, 1.798550009727478, -0.6003484129905701, 0.38829100131988525, 0.7397727370262146, 1.3281831741333008, 0.1366948038339615, -0.09222977608442307, 0.3400720953941345, 0.33751019835472107, -0.0057227835059165955, 0.5111706852912903, 1.2149614095687866, 0.6313177347183228, 0.43247684836387634, 0.7413879036903381, -2.2275850772857666, 1.3126556873321533, -0.9920987486839294, 0.2896241545677185, 1.3470649719238281, -0.9659619927406311, 0.3498217761516571, -1.8487476110458374, -0.04275061935186386, 0.6120667457580566, -2.2636871337890625, 0.29149681329727173, -1.3383252620697021, -0.5669901967048645, 1.0051144361495972, 0.27276936173439026, -1.2572354078292847, 0.08622222393751144, -0.462263822555542, 1.0700962543487549, 0.46964919567108154, 1.0930589437484741, -1.76161789894104, -0.05344267934560776, -0.2665000259876251, 0.18086469173431396, -1.329526662826538, -1.5731045007705688, 0.5145358443260193, 0.6555036902427673, 0.5976969599723816, -0.10616478323936462, 1.0675731897354126, -0.9770481586456299, 0.8193318247795105, -0.901537299156189, -1.7540364265441895, -1.3920302391052246, -2.194899559020996, -2.184145212173462, 0.7022284865379333, -0.45809853076934814, -0.5334958434104919, 2.1164844036102295, -1.0174530744552612, -1.7711232900619507, 1.064071536064148, 0.21559181809425354, 0.003660903312265873, 2.3857390880584717, 0.21530495584011078, -0.7059417366981506, 0.4047938883304596, -0.6739565134048462, 0.7438317537307739, -0.436335027217865, 1.3152176141738892, 0.4306190013885498, -1.0956381559371948, 1.5913779735565186, -0.3918163776397705, 0.5616999268531799, -0.7053163647651672, -0.4596382677555084, -0.7636924982070923, 0.2972218692302704, 1.9216816425323486, -0.33916985988616943, 1.5335453748703003, -0.36925187706947327, -1.570312261581421, -1.6028646230697632, 0.9122076034545898, 0.5445980429649353, -0.7527026534080505, 0.17826950550079346, -0.3729276657104492, 0.12073012441396713, -0.0816434919834137, 1.0947290658950806, 1.3466839790344238, 0.7123373746871948, -0.2554154396057129, -0.7850877642631531, 0.21373727917671204, -0.08419563621282578, -0.6960259675979614, -1.7572965621948242, -0.3023975193500519, 0.15328986942768097, 0.6746102571487427, -1.2229970693588257, 1.8087650537490845, 0.8776248693466187, 1.8769216537475586, 1.023154377937317, -0.320329874753952, 1.5446470975875854, 0.053206201642751694, 1.86294424533844, -0.45325735211372375, 0.692952036857605, -0.3724135756492615, -1.173427939414978, 0.8601318597793579, -0.28408604860305786, -2.014439105987549, -0.7625234723091125, -0.7198396921157837, -0.19456440210342407, -0.8354343771934509, 0.894690752029419, -0.2657856047153473, -1.4152854681015015, 0.28458189964294434, -0.6740895509719849, 0.16316337883472443, -1.232635259628296, 0.29882216453552246, 0.6405011415481567, -0.6171579957008362, 0.10687798261642456, -0.23614943027496338, -1.247330665588379, -0.5264074802398682, 0.30575570464134216, 1.8485080003738403, -0.6807284951210022, 0.9397072792053223, 1.048743486404419, -0.7336850166320801, -0.03557669371366501, 0.3632987141609192, -0.2820141613483429, 0.8297500014305115, -1.1295344829559326, -0.393947958946228, 1.1868258714675903, -0.1833476722240448, -0.5931003093719482, 1.4280387163162231, 0.7170429825782776, -0.9627841711044312, -0.20118896663188934, -0.1967862844467163, -0.8103418946266174, 0.07018090039491653, -1.579406976699829, -0.13180230557918549, 0.397308886051178, -1.5007096529006958, -0.45455703139305115, -0.20982831716537476, 1.333138346672058, -0.20921823382377625, 1.4931905269622803, -0.2924762964248657, -0.17858260869979858, -0.29502928256988525, -0.3392088711261749, 0.11046139150857925, -0.14202086627483368, -0.6327154636383057, 0.1877158284187317, -0.7579355239868164, 0.36826372146606445, 1.3735815286636353, 0.3412446081638336, 0.08105015754699707, 0.508866548538208, 1.1155601739883423, 0.34267479181289673, -0.10987383872270584, -0.8899170160293579, -1.513645052909851, 1.9737070798873901, -1.4498748779296875, 2.0508439540863037, 0.7741246223449707, 0.018220793455839157, -1.7775757312774658, -1.9043854475021362, 1.3178503513336182, 1.1525299549102783, 2.3787081241607666, 0.535672664642334, 0.42911139130592346, -0.8025476932525635, -0.6889210343360901, 0.25949954986572266, -1.056203007698059, -0.8158528804779053, 0.19303283095359802, 2.4160284996032715, 1.7917293310165405, -0.41086795926094055, -0.26114150881767273, -1.061580777168274, 1.2669882774353027, -0.17375031113624573, 0.16287316381931305, 1.9370362758636475, -0.19463136792182922, -1.0529155731201172, 1.2688584327697754, -2.4002184867858887, 0.170949786901474, 2.055283546447754, 0.16836674511432648, 0.13554832339286804, -1.4061259031295776, -0.6378225088119507, -0.23933325707912445, -0.40698033571243286, -1.2958786487579346, 0.5196449756622314, -0.3135680556297302, -0.8285629153251648, -1.441110372543335, 0.1519099771976471, -1.1079751253128052, -1.6664255857467651, 0.23497982323169708, 1.9262051582336426, 2.036682605743408, -0.7380725145339966, 1.5378199815750122, -0.24593490362167358, 0.06326611340045929, 1.2388916015625, 1.3020211458206177, 3.1570796966552734, 1.869766116142273, -1.3343816995620728, 0.625044584274292, -0.2009945660829544, -0.39984384179115295, 1.1184887886047363, -1.1736578941345215, 1.2935422658920288, -0.15863308310508728, -1.2076776027679443, -1.2716377973556519, 1.0021820068359375, 0.5103248953819275, 0.05110247805714607, -0.4636589288711548, 1.2109019756317139, 0.046535246074199677, 1.3705836534500122, 0.5518001317977905, -0.40545740723609924, 0.60025954246521, -0.37961485981941223, -0.4754830300807953, 1.5725953578948975, 0.15692618489265442, -1.3329195976257324, -2.3255467414855957, -0.19322611391544342, -0.8810601830482483, 0.012513446621596813, -0.6211261749267578, -0.9967018961906433, 1.6943235397338867, 0.38902848958969116, -1.2762514352798462, -0.24421781301498413, -0.4045272171497345, -0.6113440990447998, 2.629392623901367, -1.4435898065567017, -0.19550423324108124, -1.0614228248596191, -0.6103923320770264, 1.6252268552780151, -1.1703182458877563, -0.22462020814418793, -0.9887969493865967, -0.5708717703819275, -1.329145073890686, -0.5608298182487488, -0.0063744233921170235, -0.9437716007232666, 0.8209325671195984, 0.19836050271987915, -1.1758317947387695, -0.34273675084114075, -0.8046068549156189, 0.8975199460983276, -0.07493352890014648, 0.16801738739013672, 1.8858489990234375, 0.37288475036621094, -0.33648499846458435, 0.777050256729126, 1.1157002449035645, 0.5418404936790466, -0.578534722328186, 0.24201685190200806, -0.6411670446395874, 0.3567371368408203, -1.3643773794174194, 0.3346725404262543, -2.8339715003967285, 0.6683588624000549, -0.12842632830142975, -0.0030344012193381786, -0.0398738831281662, -1.3322186470031738, 1.1107503175735474, 2.6955156326293945, -1.1681692600250244, 0.43670716881752014, 0.30068302154541016, 1.2024399042129517, -1.6220322847366333, 0.21673326194286346, -0.4476670026779175, 2.0797078609466553, 0.2048504799604416, 1.1995551586151123, -0.4441255033016205, -2.3332457542419434, 0.5654411315917969, -1.2239596843719482, -1.1323434114456177, 0.8517121076583862, -0.7566371560096741, 0.04536103829741478, -1.365788221359253, -0.32363978028297424, -0.8824050426483154, -1.1682673692703247, 0.7639139294624329, 0.1425333321094513, 0.5109161734580994, -0.6491782069206238, 0.3462383449077606, -2.134814500808716, -1.2160190343856812, -0.16664041578769684, -0.9362239837646484, 0.45583575963974, -0.3395879864692688, 0.6147753000259399, -0.1548738330602646, -0.010405643843114376, 0.3338283896446228, 1.447240948677063, 3.3900294303894043, 0.18039532005786896, 0.3177078068256378, -0.21959269046783447, -0.9369688034057617, 1.4309405088424683, 0.933340311050415, -0.12157081067562103, -0.5851618051528931, -1.0643008947372437, 1.1398614645004272, 1.9110329151153564, 0.9540061950683594, 0.141316220164299, -0.9213065505027771, -0.7894463539123535, -0.0866498351097107, 0.15488430857658386, 0.44477853178977966, 0.9616525173187256, 0.05751302093267441, 0.019719190895557404, 1.4781830310821533, 1.159281611442566, -0.42409026622772217, 0.4124910235404968, -0.8478191494941711, -0.47646260261535645, 0.459538072347641, 0.31353792548179626, -0.017868779599666595, 0.3563000559806824, -1.0116444826126099, -0.22963538765907288, -0.41396602988243103, -0.9275899529457092, -0.7629736661911011, -0.32443976402282715, -0.30440327525138855, 1.6224217414855957, 0.1239328607916832, -0.4410342872142792, -0.040842730551958084, -0.8453747034072876, -0.12862525880336761, -1.0626118183135986, 0.2640031576156616, -0.18461637198925018, -0.07217759639024734, -0.09636680781841278, 1.694205641746521, -0.9225834012031555, -2.051593065261841, 0.2366943657398224, 0.13403728604316711, -0.2821212112903595, 0.24920061230659485, 1.701782464981079, 0.6228538751602173, 1.4885151386260986, 1.3103333711624146, 0.9123961925506592, -0.6513437032699585, -1.289663553237915, 0.7246230244636536, 0.8987298607826233, -1.4618250131607056, 0.8000175952911377, -0.0736902579665184, -0.5019694566726685, 0.6115290522575378, 1.2514375448226929, 0.4622548818588257, -2.063819169998169, 0.7643533945083618, -1.0098092555999756, 0.7342700958251953, 0.693495512008667, 0.6889253854751587, 0.21852923929691315, 0.8429936170578003, -1.228632926940918, -1.180039644241333, -0.6601511836051941, -0.7257905602455139, 1.939916729927063, -0.29649561643600464, 0.5908938646316528, -0.1516297608613968, -1.3410059213638306, -0.10557746887207031, 0.6733989715576172, 0.38700374960899353, -0.4286113679409027, 0.7837465405464172, -0.6622730493545532, -1.0651236772537231, -1.346018671989441, -0.542682409286499, -0.9742518663406372, -0.9175695776939392, 1.0007556676864624, 0.8120678067207336, 0.2981298863887787, 1.935796856880188, 0.6130643486976624, 0.23830202221870422, -2.6603739261627197, 0.8814561367034912, 0.3260982036590576, -0.03735742345452309, 0.9839394688606262, 0.3537830114364624, 1.0666303634643555, 0.08979716897010803, 0.5058378577232361, -2.4149062633514404, 2.3115782737731934, -0.16046102344989777, 0.7054911851882935, -0.06214626878499985, -0.19108512997627258, 1.0858968496322632, 0.5119999647140503, 0.536394476890564, -1.0754477977752686, 0.7091380953788757, -0.6351762413978577, 1.2834407091140747, 0.8377601504325867, -0.8794649839401245, -0.0277642123401165, 1.3964333534240723, 0.4197244644165039, -0.5195739269256592, -0.8826538324356079, -0.9827603697776794, 0.893470287322998, 1.7605586051940918, -0.010405180044472218, 0.05065936967730522, 0.7645309567451477, 0.6636613607406616, -1.3809834718704224, 0.053460799157619476, -0.7692795991897583, -0.7349074482917786, 1.6642836332321167, 1.9984813928604126, -0.09951033443212509, -0.2302718609571457, -0.7865662574768066, -1.2683542966842651, 0.7540768384933472, -0.007074759807437658, 0.13441652059555054, 0.6296256184577942, -0.6920807957649231, 1.0906840562820435, 0.8974137306213379, 0.9985336661338806, 0.1427447497844696, 0.3803306221961975, 0.4230553209781647, -0.4417182505130768, -1.1716252565383911, -0.2410702258348465, -1.086464524269104, -2.5147886276245117, 0.4694387912750244, -0.17736124992370605, -1.4474605321884155, 0.04626300930976868, -0.9892327189445496, 0.8223909139633179, -0.6247978806495667, -1.1511708498001099, -1.4458751678466797, 0.2319227010011673, -0.12607675790786743, 0.9313404560089111, -1.5498989820480347, -0.09947220236063004, 1.2128684520721436, 0.9468358755111694, -0.6310320496559143, 0.9125134944915771, 0.19463379681110382, 1.0445419549942017, 0.9164772629737854, -0.40099066495895386, 0.5038579702377319, 0.03530776500701904, -1.3571157455444336, 0.46314242482185364, 1.1190850734710693, 0.2115364670753479, 1.5200461149215698, -0.5069965720176697, -0.013669553212821484, 0.41897323727607727, -0.5564319491386414, -0.49642229080200195, -0.5278658866882324, 0.6527290344238281, 0.016996704041957855, -0.9016609191894531, 0.029975000768899918, -0.07896718382835388, -0.2970147132873535, 0.2124631553888321, -1.4780042171478271, -0.1277632713317871, -0.34710493683815, -0.6298359036445618, -1.2875733375549316, 0.026413414627313614, 1.3143360614776611, -0.7477343082427979, -0.19799931347370148, 0.4692150354385376, 0.3530961275100708, 0.4680485427379608, 0.6370007395744324, -0.7103778719902039, -0.3945561945438385, -0.26823386549949646, -0.4210679233074188, 0.38459253311157227, 1.3095107078552246, -0.09267516434192657, -1.0491926670074463, 0.7157511115074158, -0.4219925105571747, 0.08920284360647202, 1.937273383140564, 0.0999821275472641, -0.7770594954490662, 0.28440040349960327, -0.7405832409858704, 1.9590882062911987, 1.7052613496780396, 1.2878930568695068, -0.18042513728141785, -0.9876534938812256, 0.6890316605567932, -0.42487260699272156, -0.32052338123321533, 0.9184109568595886, 0.41414758563041687, -0.21918822824954987, -1.4147491455078125, 0.6263736486434937, 1.281904697418213, -0.9011874794960022, -0.7757946252822876, 0.12646633386611938, -0.7617878317832947, 1.0510350465774536, 0.7178279161453247, 0.2915962040424347, 0.2867465019226074, 1.6456446647644043, 0.7763343453407288, -0.4341026544570923, 0.4929564297199249, 0.41795799136161804, -0.11829538643360138, -2.159857988357544, -1.0930455923080444, 0.2796191871166229, -0.3960854411125183, -1.5629533529281616, 1.3204567432403564, -1.1440719366073608, -0.9905489087104797, 0.5010926723480225, 0.127340629696846, 1.4130033254623413, 0.2966632843017578, 1.5942564010620117, 2.065819501876831, 0.873566746711731, 0.3680258095264435, 1.2102782726287842, -0.08388232439756393, -0.44091174006462097, 1.7856558561325073, -0.4811832010746002, 0.4940567910671234, 1.1277741193771362, -0.31754952669143677, -1.1212551593780518, -0.8329146504402161, -1.2339822053909302, -0.734185516834259, 1.1984434127807617, 0.12194120138883591, -1.0253469944000244, 0.29335829615592957, 1.6168173551559448, 0.062423042953014374, -0.2872254550457001, 0.6754661202430725, 0.49941930174827576, -0.7540431618690491, -0.09514662623405457, -0.7937979102134705, 0.5617873668670654, -0.11522653698921204, -0.35756736993789673, 0.40483954548835754, 0.4560375511646271, 1.3130531311035156, 0.007845665328204632, 0.06984740495681763, 1.1816197633743286, -1.3533958196640015, 1.538808822631836, -0.684821367263794, 0.32632189989089966, -2.3807337284088135, 1.412556767463684, -0.8048789501190186, 1.8985623121261597, -2.634653329849243, 0.43833473324775696, -0.5632678270339966, -0.41660165786743164, 0.29479044675827026, -0.3213178813457489, 0.1269928216934204, -0.13514980673789978, -1.093341588973999, -0.11781682074069977, -0.7075016498565674, 0.5838765501976013, 1.1719331741333008, 1.384377360343933, -1.115726351737976, -0.20199911296367645, -1.7703945636749268, -0.13443084061145782, -0.8029358983039856, 0.3057270646095276, -1.9712700843811035, -0.1424064040184021, -2.0130562782287598, -2.414170980453491, -1.30744469165802, -0.7597748041152954, 1.0722641944885254, 0.14368955790996552, -0.8058034181594849, 1.208678960800171, -0.3359648883342743, -1.7989155054092407, 1.0679649114608765, -2.1197891235351562 ]
https://github.com/huggingface/datasets/issues/4420
Metric evaluation problems in multi-node, shared file system
We've finally been able to isolate the problem, it wasn't a timing problem, but rather a file locking one. The locks produced by calling `flock` where not visible between nodes (so the master node couldn't check other node's locks nor the other way around). We are now having issues with the pre-processing in our runner script, but are not related with the rendezvous process during the evaluation phase. We will let you know about it once we address it. Our solution to the rendezvous is as follows: - We solved the problem by calling `lockf` instead of `flock`. - We had to change slightly the `_check_all_processes_locks` method so that the main process (i.e. process 0) didn't check it's own lock (because `lockf` permits recursive locks and thus checking it only replaced the current lock with a new one). We use a shared file system between nodes using GPFS in our cluster setup. Maybe the difference between the behavior we see with respect to your usage in multi-node executions comes from that fact. Which file system scheme do you use for the multi-node executions? `lockf` seems to work in more settings than `flock`, so maybe we could write a PR so you could test it in your environment.
## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0
737
207
Metric evaluation problems in multi-node, shared file system ## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0 We've finally been able to isolate the problem, it wasn't a timing problem, but rather a file locking one. The locks produced by calling `flock` where not visible between nodes (so the master node couldn't check other node's locks nor the other way around). We are now having issues with the pre-processing in our runner script, but are not related with the rendezvous process during the evaluation phase. We will let you know about it once we address it. Our solution to the rendezvous is as follows: - We solved the problem by calling `lockf` instead of `flock`. - We had to change slightly the `_check_all_processes_locks` method so that the main process (i.e. process 0) didn't check it's own lock (because `lockf` permits recursive locks and thus checking it only replaced the current lock with a new one). We use a shared file system between nodes using GPFS in our cluster setup. Maybe the difference between the behavior we see with respect to your usage in multi-node executions comes from that fact. Which file system scheme do you use for the multi-node executions? `lockf` seems to work in more settings than `flock`, so maybe we could write a PR so you could test it in your environment.
[ -1.296735405921936, -0.898237943649292, -0.786631166934967, 1.4941779375076294, -0.16268455982208252, -1.243415117263794, 0.17101557552814484, -1.040987491607666, 1.7357490062713623, -0.7962110042572021, 0.2971554696559906, -1.6023008823394775, 0.09675242751836777, -0.6188485026359558, -0.7566505670547485, -0.8449321389198303, -0.3520471453666687, -0.7326327562332153, 1.0212289094924927, 2.5368292331695557, 1.303423523902893, -1.299533724784851, 2.7445642948150635, 0.7668829560279846, -0.27061134576797485, -0.9395747780799866, 0.47091981768608093, -0.05736588314175606, -1.277888298034668, -0.46126970648765564, -0.9297401905059814, -0.024585597217082977, -0.533450722694397, -0.5027673840522766, 0.0028469087556004524, 0.36731502413749695, -0.33792194724082947, -0.4516681432723999, -0.5784897804260254, -0.7877139449119568, 0.4791809916496277, -0.34861302375793457, 0.8894843459129333, -0.3108561635017395, 1.798550009727478, -0.6003484129905701, 0.38829100131988525, 0.7397727370262146, 1.3281831741333008, 0.1366948038339615, -0.09222977608442307, 0.3400720953941345, 0.33751019835472107, -0.0057227835059165955, 0.5111706852912903, 1.2149614095687866, 0.6313177347183228, 0.43247684836387634, 0.7413879036903381, -2.2275850772857666, 1.3126556873321533, -0.9920987486839294, 0.2896241545677185, 1.3470649719238281, -0.9659619927406311, 0.3498217761516571, -1.8487476110458374, -0.04275061935186386, 0.6120667457580566, -2.2636871337890625, 0.29149681329727173, -1.3383252620697021, -0.5669901967048645, 1.0051144361495972, 0.27276936173439026, -1.2572354078292847, 0.08622222393751144, -0.462263822555542, 1.0700962543487549, 0.46964919567108154, 1.0930589437484741, -1.76161789894104, -0.05344267934560776, -0.2665000259876251, 0.18086469173431396, -1.329526662826538, -1.5731045007705688, 0.5145358443260193, 0.6555036902427673, 0.5976969599723816, -0.10616478323936462, 1.0675731897354126, -0.9770481586456299, 0.8193318247795105, -0.901537299156189, -1.7540364265441895, -1.3920302391052246, -2.194899559020996, -2.184145212173462, 0.7022284865379333, -0.45809853076934814, -0.5334958434104919, 2.1164844036102295, -1.0174530744552612, -1.7711232900619507, 1.064071536064148, 0.21559181809425354, 0.003660903312265873, 2.3857390880584717, 0.21530495584011078, -0.7059417366981506, 0.4047938883304596, -0.6739565134048462, 0.7438317537307739, -0.436335027217865, 1.3152176141738892, 0.4306190013885498, -1.0956381559371948, 1.5913779735565186, -0.3918163776397705, 0.5616999268531799, -0.7053163647651672, -0.4596382677555084, -0.7636924982070923, 0.2972218692302704, 1.9216816425323486, -0.33916985988616943, 1.5335453748703003, -0.36925187706947327, -1.570312261581421, -1.6028646230697632, 0.9122076034545898, 0.5445980429649353, -0.7527026534080505, 0.17826950550079346, -0.3729276657104492, 0.12073012441396713, -0.0816434919834137, 1.0947290658950806, 1.3466839790344238, 0.7123373746871948, -0.2554154396057129, -0.7850877642631531, 0.21373727917671204, -0.08419563621282578, -0.6960259675979614, -1.7572965621948242, -0.3023975193500519, 0.15328986942768097, 0.6746102571487427, -1.2229970693588257, 1.8087650537490845, 0.8776248693466187, 1.8769216537475586, 1.023154377937317, -0.320329874753952, 1.5446470975875854, 0.053206201642751694, 1.86294424533844, -0.45325735211372375, 0.692952036857605, -0.3724135756492615, -1.173427939414978, 0.8601318597793579, -0.28408604860305786, -2.014439105987549, -0.7625234723091125, -0.7198396921157837, -0.19456440210342407, -0.8354343771934509, 0.894690752029419, -0.2657856047153473, -1.4152854681015015, 0.28458189964294434, -0.6740895509719849, 0.16316337883472443, -1.232635259628296, 0.29882216453552246, 0.6405011415481567, -0.6171579957008362, 0.10687798261642456, -0.23614943027496338, -1.247330665588379, -0.5264074802398682, 0.30575570464134216, 1.8485080003738403, -0.6807284951210022, 0.9397072792053223, 1.048743486404419, -0.7336850166320801, -0.03557669371366501, 0.3632987141609192, -0.2820141613483429, 0.8297500014305115, -1.1295344829559326, -0.393947958946228, 1.1868258714675903, -0.1833476722240448, -0.5931003093719482, 1.4280387163162231, 0.7170429825782776, -0.9627841711044312, -0.20118896663188934, -0.1967862844467163, -0.8103418946266174, 0.07018090039491653, -1.579406976699829, -0.13180230557918549, 0.397308886051178, -1.5007096529006958, -0.45455703139305115, -0.20982831716537476, 1.333138346672058, -0.20921823382377625, 1.4931905269622803, -0.2924762964248657, -0.17858260869979858, -0.29502928256988525, -0.3392088711261749, 0.11046139150857925, -0.14202086627483368, -0.6327154636383057, 0.1877158284187317, -0.7579355239868164, 0.36826372146606445, 1.3735815286636353, 0.3412446081638336, 0.08105015754699707, 0.508866548538208, 1.1155601739883423, 0.34267479181289673, -0.10987383872270584, -0.8899170160293579, -1.513645052909851, 1.9737070798873901, -1.4498748779296875, 2.0508439540863037, 0.7741246223449707, 0.018220793455839157, -1.7775757312774658, -1.9043854475021362, 1.3178503513336182, 1.1525299549102783, 2.3787081241607666, 0.535672664642334, 0.42911139130592346, -0.8025476932525635, -0.6889210343360901, 0.25949954986572266, -1.056203007698059, -0.8158528804779053, 0.19303283095359802, 2.4160284996032715, 1.7917293310165405, -0.41086795926094055, -0.26114150881767273, -1.061580777168274, 1.2669882774353027, -0.17375031113624573, 0.16287316381931305, 1.9370362758636475, -0.19463136792182922, -1.0529155731201172, 1.2688584327697754, -2.4002184867858887, 0.170949786901474, 2.055283546447754, 0.16836674511432648, 0.13554832339286804, -1.4061259031295776, -0.6378225088119507, -0.23933325707912445, -0.40698033571243286, -1.2958786487579346, 0.5196449756622314, -0.3135680556297302, -0.8285629153251648, -1.441110372543335, 0.1519099771976471, -1.1079751253128052, -1.6664255857467651, 0.23497982323169708, 1.9262051582336426, 2.036682605743408, -0.7380725145339966, 1.5378199815750122, -0.24593490362167358, 0.06326611340045929, 1.2388916015625, 1.3020211458206177, 3.1570796966552734, 1.869766116142273, -1.3343816995620728, 0.625044584274292, -0.2009945660829544, -0.39984384179115295, 1.1184887886047363, -1.1736578941345215, 1.2935422658920288, -0.15863308310508728, -1.2076776027679443, -1.2716377973556519, 1.0021820068359375, 0.5103248953819275, 0.05110247805714607, -0.4636589288711548, 1.2109019756317139, 0.046535246074199677, 1.3705836534500122, 0.5518001317977905, -0.40545740723609924, 0.60025954246521, -0.37961485981941223, -0.4754830300807953, 1.5725953578948975, 0.15692618489265442, -1.3329195976257324, -2.3255467414855957, -0.19322611391544342, -0.8810601830482483, 0.012513446621596813, -0.6211261749267578, -0.9967018961906433, 1.6943235397338867, 0.38902848958969116, -1.2762514352798462, -0.24421781301498413, -0.4045272171497345, -0.6113440990447998, 2.629392623901367, -1.4435898065567017, -0.19550423324108124, -1.0614228248596191, -0.6103923320770264, 1.6252268552780151, -1.1703182458877563, -0.22462020814418793, -0.9887969493865967, -0.5708717703819275, -1.329145073890686, -0.5608298182487488, -0.0063744233921170235, -0.9437716007232666, 0.8209325671195984, 0.19836050271987915, -1.1758317947387695, -0.34273675084114075, -0.8046068549156189, 0.8975199460983276, -0.07493352890014648, 0.16801738739013672, 1.8858489990234375, 0.37288475036621094, -0.33648499846458435, 0.777050256729126, 1.1157002449035645, 0.5418404936790466, -0.578534722328186, 0.24201685190200806, -0.6411670446395874, 0.3567371368408203, -1.3643773794174194, 0.3346725404262543, -2.8339715003967285, 0.6683588624000549, -0.12842632830142975, -0.0030344012193381786, -0.0398738831281662, -1.3322186470031738, 1.1107503175735474, 2.6955156326293945, -1.1681692600250244, 0.43670716881752014, 0.30068302154541016, 1.2024399042129517, -1.6220322847366333, 0.21673326194286346, -0.4476670026779175, 2.0797078609466553, 0.2048504799604416, 1.1995551586151123, -0.4441255033016205, -2.3332457542419434, 0.5654411315917969, -1.2239596843719482, -1.1323434114456177, 0.8517121076583862, -0.7566371560096741, 0.04536103829741478, -1.365788221359253, -0.32363978028297424, -0.8824050426483154, -1.1682673692703247, 0.7639139294624329, 0.1425333321094513, 0.5109161734580994, -0.6491782069206238, 0.3462383449077606, -2.134814500808716, -1.2160190343856812, -0.16664041578769684, -0.9362239837646484, 0.45583575963974, -0.3395879864692688, 0.6147753000259399, -0.1548738330602646, -0.010405643843114376, 0.3338283896446228, 1.447240948677063, 3.3900294303894043, 0.18039532005786896, 0.3177078068256378, -0.21959269046783447, -0.9369688034057617, 1.4309405088424683, 0.933340311050415, -0.12157081067562103, -0.5851618051528931, -1.0643008947372437, 1.1398614645004272, 1.9110329151153564, 0.9540061950683594, 0.141316220164299, -0.9213065505027771, -0.7894463539123535, -0.0866498351097107, 0.15488430857658386, 0.44477853178977966, 0.9616525173187256, 0.05751302093267441, 0.019719190895557404, 1.4781830310821533, 1.159281611442566, -0.42409026622772217, 0.4124910235404968, -0.8478191494941711, -0.47646260261535645, 0.459538072347641, 0.31353792548179626, -0.017868779599666595, 0.3563000559806824, -1.0116444826126099, -0.22963538765907288, -0.41396602988243103, -0.9275899529457092, -0.7629736661911011, -0.32443976402282715, -0.30440327525138855, 1.6224217414855957, 0.1239328607916832, -0.4410342872142792, -0.040842730551958084, -0.8453747034072876, -0.12862525880336761, -1.0626118183135986, 0.2640031576156616, -0.18461637198925018, -0.07217759639024734, -0.09636680781841278, 1.694205641746521, -0.9225834012031555, -2.051593065261841, 0.2366943657398224, 0.13403728604316711, -0.2821212112903595, 0.24920061230659485, 1.701782464981079, 0.6228538751602173, 1.4885151386260986, 1.3103333711624146, 0.9123961925506592, -0.6513437032699585, -1.289663553237915, 0.7246230244636536, 0.8987298607826233, -1.4618250131607056, 0.8000175952911377, -0.0736902579665184, -0.5019694566726685, 0.6115290522575378, 1.2514375448226929, 0.4622548818588257, -2.063819169998169, 0.7643533945083618, -1.0098092555999756, 0.7342700958251953, 0.693495512008667, 0.6889253854751587, 0.21852923929691315, 0.8429936170578003, -1.228632926940918, -1.180039644241333, -0.6601511836051941, -0.7257905602455139, 1.939916729927063, -0.29649561643600464, 0.5908938646316528, -0.1516297608613968, -1.3410059213638306, -0.10557746887207031, 0.6733989715576172, 0.38700374960899353, -0.4286113679409027, 0.7837465405464172, -0.6622730493545532, -1.0651236772537231, -1.346018671989441, -0.542682409286499, -0.9742518663406372, -0.9175695776939392, 1.0007556676864624, 0.8120678067207336, 0.2981298863887787, 1.935796856880188, 0.6130643486976624, 0.23830202221870422, -2.6603739261627197, 0.8814561367034912, 0.3260982036590576, -0.03735742345452309, 0.9839394688606262, 0.3537830114364624, 1.0666303634643555, 0.08979716897010803, 0.5058378577232361, -2.4149062633514404, 2.3115782737731934, -0.16046102344989777, 0.7054911851882935, -0.06214626878499985, -0.19108512997627258, 1.0858968496322632, 0.5119999647140503, 0.536394476890564, -1.0754477977752686, 0.7091380953788757, -0.6351762413978577, 1.2834407091140747, 0.8377601504325867, -0.8794649839401245, -0.0277642123401165, 1.3964333534240723, 0.4197244644165039, -0.5195739269256592, -0.8826538324356079, -0.9827603697776794, 0.893470287322998, 1.7605586051940918, -0.010405180044472218, 0.05065936967730522, 0.7645309567451477, 0.6636613607406616, -1.3809834718704224, 0.053460799157619476, -0.7692795991897583, -0.7349074482917786, 1.6642836332321167, 1.9984813928604126, -0.09951033443212509, -0.2302718609571457, -0.7865662574768066, -1.2683542966842651, 0.7540768384933472, -0.007074759807437658, 0.13441652059555054, 0.6296256184577942, -0.6920807957649231, 1.0906840562820435, 0.8974137306213379, 0.9985336661338806, 0.1427447497844696, 0.3803306221961975, 0.4230553209781647, -0.4417182505130768, -1.1716252565383911, -0.2410702258348465, -1.086464524269104, -2.5147886276245117, 0.4694387912750244, -0.17736124992370605, -1.4474605321884155, 0.04626300930976868, -0.9892327189445496, 0.8223909139633179, -0.6247978806495667, -1.1511708498001099, -1.4458751678466797, 0.2319227010011673, -0.12607675790786743, 0.9313404560089111, -1.5498989820480347, -0.09947220236063004, 1.2128684520721436, 0.9468358755111694, -0.6310320496559143, 0.9125134944915771, 0.19463379681110382, 1.0445419549942017, 0.9164772629737854, -0.40099066495895386, 0.5038579702377319, 0.03530776500701904, -1.3571157455444336, 0.46314242482185364, 1.1190850734710693, 0.2115364670753479, 1.5200461149215698, -0.5069965720176697, -0.013669553212821484, 0.41897323727607727, -0.5564319491386414, -0.49642229080200195, -0.5278658866882324, 0.6527290344238281, 0.016996704041957855, -0.9016609191894531, 0.029975000768899918, -0.07896718382835388, -0.2970147132873535, 0.2124631553888321, -1.4780042171478271, -0.1277632713317871, -0.34710493683815, -0.6298359036445618, -1.2875733375549316, 0.026413414627313614, 1.3143360614776611, -0.7477343082427979, -0.19799931347370148, 0.4692150354385376, 0.3530961275100708, 0.4680485427379608, 0.6370007395744324, -0.7103778719902039, -0.3945561945438385, -0.26823386549949646, -0.4210679233074188, 0.38459253311157227, 1.3095107078552246, -0.09267516434192657, -1.0491926670074463, 0.7157511115074158, -0.4219925105571747, 0.08920284360647202, 1.937273383140564, 0.0999821275472641, -0.7770594954490662, 0.28440040349960327, -0.7405832409858704, 1.9590882062911987, 1.7052613496780396, 1.2878930568695068, -0.18042513728141785, -0.9876534938812256, 0.6890316605567932, -0.42487260699272156, -0.32052338123321533, 0.9184109568595886, 0.41414758563041687, -0.21918822824954987, -1.4147491455078125, 0.6263736486434937, 1.281904697418213, -0.9011874794960022, -0.7757946252822876, 0.12646633386611938, -0.7617878317832947, 1.0510350465774536, 0.7178279161453247, 0.2915962040424347, 0.2867465019226074, 1.6456446647644043, 0.7763343453407288, -0.4341026544570923, 0.4929564297199249, 0.41795799136161804, -0.11829538643360138, -2.159857988357544, -1.0930455923080444, 0.2796191871166229, -0.3960854411125183, -1.5629533529281616, 1.3204567432403564, -1.1440719366073608, -0.9905489087104797, 0.5010926723480225, 0.127340629696846, 1.4130033254623413, 0.2966632843017578, 1.5942564010620117, 2.065819501876831, 0.873566746711731, 0.3680258095264435, 1.2102782726287842, -0.08388232439756393, -0.44091174006462097, 1.7856558561325073, -0.4811832010746002, 0.4940567910671234, 1.1277741193771362, -0.31754952669143677, -1.1212551593780518, -0.8329146504402161, -1.2339822053909302, -0.734185516834259, 1.1984434127807617, 0.12194120138883591, -1.0253469944000244, 0.29335829615592957, 1.6168173551559448, 0.062423042953014374, -0.2872254550457001, 0.6754661202430725, 0.49941930174827576, -0.7540431618690491, -0.09514662623405457, -0.7937979102134705, 0.5617873668670654, -0.11522653698921204, -0.35756736993789673, 0.40483954548835754, 0.4560375511646271, 1.3130531311035156, 0.007845665328204632, 0.06984740495681763, 1.1816197633743286, -1.3533958196640015, 1.538808822631836, -0.684821367263794, 0.32632189989089966, -2.3807337284088135, 1.412556767463684, -0.8048789501190186, 1.8985623121261597, -2.634653329849243, 0.43833473324775696, -0.5632678270339966, -0.41660165786743164, 0.29479044675827026, -0.3213178813457489, 0.1269928216934204, -0.13514980673789978, -1.093341588973999, -0.11781682074069977, -0.7075016498565674, 0.5838765501976013, 1.1719331741333008, 1.384377360343933, -1.115726351737976, -0.20199911296367645, -1.7703945636749268, -0.13443084061145782, -0.8029358983039856, 0.3057270646095276, -1.9712700843811035, -0.1424064040184021, -2.0130562782287598, -2.414170980453491, -1.30744469165802, -0.7597748041152954, 1.0722641944885254, 0.14368955790996552, -0.8058034181594849, 1.208678960800171, -0.3359648883342743, -1.7989155054092407, 1.0679649114608765, -2.1197891235351562 ]
https://github.com/huggingface/datasets/issues/4420
Metric evaluation problems in multi-node, shared file system
Cool, I'm glad you managed to make evaluation work :) I'm not completely aware of the differences between lockf and flock, but I've read somewhere that flock is preferable over lockf in multithreading and multiprocessing situations. Here we definitely are in such a situation so unless it is super important I don't think we will switch to lockf
## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0
737
58
Metric evaluation problems in multi-node, shared file system ## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0 Cool, I'm glad you managed to make evaluation work :) I'm not completely aware of the differences between lockf and flock, but I've read somewhere that flock is preferable over lockf in multithreading and multiprocessing situations. Here we definitely are in such a situation so unless it is super important I don't think we will switch to lockf
[ -1.296735405921936, -0.898237943649292, -0.786631166934967, 1.4941779375076294, -0.16268455982208252, -1.243415117263794, 0.17101557552814484, -1.040987491607666, 1.7357490062713623, -0.7962110042572021, 0.2971554696559906, -1.6023008823394775, 0.09675242751836777, -0.6188485026359558, -0.7566505670547485, -0.8449321389198303, -0.3520471453666687, -0.7326327562332153, 1.0212289094924927, 2.5368292331695557, 1.303423523902893, -1.299533724784851, 2.7445642948150635, 0.7668829560279846, -0.27061134576797485, -0.9395747780799866, 0.47091981768608093, -0.05736588314175606, -1.277888298034668, -0.46126970648765564, -0.9297401905059814, -0.024585597217082977, -0.533450722694397, -0.5027673840522766, 0.0028469087556004524, 0.36731502413749695, -0.33792194724082947, -0.4516681432723999, -0.5784897804260254, -0.7877139449119568, 0.4791809916496277, -0.34861302375793457, 0.8894843459129333, -0.3108561635017395, 1.798550009727478, -0.6003484129905701, 0.38829100131988525, 0.7397727370262146, 1.3281831741333008, 0.1366948038339615, -0.09222977608442307, 0.3400720953941345, 0.33751019835472107, -0.0057227835059165955, 0.5111706852912903, 1.2149614095687866, 0.6313177347183228, 0.43247684836387634, 0.7413879036903381, -2.2275850772857666, 1.3126556873321533, -0.9920987486839294, 0.2896241545677185, 1.3470649719238281, -0.9659619927406311, 0.3498217761516571, -1.8487476110458374, -0.04275061935186386, 0.6120667457580566, -2.2636871337890625, 0.29149681329727173, -1.3383252620697021, -0.5669901967048645, 1.0051144361495972, 0.27276936173439026, -1.2572354078292847, 0.08622222393751144, -0.462263822555542, 1.0700962543487549, 0.46964919567108154, 1.0930589437484741, -1.76161789894104, -0.05344267934560776, -0.2665000259876251, 0.18086469173431396, -1.329526662826538, -1.5731045007705688, 0.5145358443260193, 0.6555036902427673, 0.5976969599723816, -0.10616478323936462, 1.0675731897354126, -0.9770481586456299, 0.8193318247795105, -0.901537299156189, -1.7540364265441895, -1.3920302391052246, -2.194899559020996, -2.184145212173462, 0.7022284865379333, -0.45809853076934814, -0.5334958434104919, 2.1164844036102295, -1.0174530744552612, -1.7711232900619507, 1.064071536064148, 0.21559181809425354, 0.003660903312265873, 2.3857390880584717, 0.21530495584011078, -0.7059417366981506, 0.4047938883304596, -0.6739565134048462, 0.7438317537307739, -0.436335027217865, 1.3152176141738892, 0.4306190013885498, -1.0956381559371948, 1.5913779735565186, -0.3918163776397705, 0.5616999268531799, -0.7053163647651672, -0.4596382677555084, -0.7636924982070923, 0.2972218692302704, 1.9216816425323486, -0.33916985988616943, 1.5335453748703003, -0.36925187706947327, -1.570312261581421, -1.6028646230697632, 0.9122076034545898, 0.5445980429649353, -0.7527026534080505, 0.17826950550079346, -0.3729276657104492, 0.12073012441396713, -0.0816434919834137, 1.0947290658950806, 1.3466839790344238, 0.7123373746871948, -0.2554154396057129, -0.7850877642631531, 0.21373727917671204, -0.08419563621282578, -0.6960259675979614, -1.7572965621948242, -0.3023975193500519, 0.15328986942768097, 0.6746102571487427, -1.2229970693588257, 1.8087650537490845, 0.8776248693466187, 1.8769216537475586, 1.023154377937317, -0.320329874753952, 1.5446470975875854, 0.053206201642751694, 1.86294424533844, -0.45325735211372375, 0.692952036857605, -0.3724135756492615, -1.173427939414978, 0.8601318597793579, -0.28408604860305786, -2.014439105987549, -0.7625234723091125, -0.7198396921157837, -0.19456440210342407, -0.8354343771934509, 0.894690752029419, -0.2657856047153473, -1.4152854681015015, 0.28458189964294434, -0.6740895509719849, 0.16316337883472443, -1.232635259628296, 0.29882216453552246, 0.6405011415481567, -0.6171579957008362, 0.10687798261642456, -0.23614943027496338, -1.247330665588379, -0.5264074802398682, 0.30575570464134216, 1.8485080003738403, -0.6807284951210022, 0.9397072792053223, 1.048743486404419, -0.7336850166320801, -0.03557669371366501, 0.3632987141609192, -0.2820141613483429, 0.8297500014305115, -1.1295344829559326, -0.393947958946228, 1.1868258714675903, -0.1833476722240448, -0.5931003093719482, 1.4280387163162231, 0.7170429825782776, -0.9627841711044312, -0.20118896663188934, -0.1967862844467163, -0.8103418946266174, 0.07018090039491653, -1.579406976699829, -0.13180230557918549, 0.397308886051178, -1.5007096529006958, -0.45455703139305115, -0.20982831716537476, 1.333138346672058, -0.20921823382377625, 1.4931905269622803, -0.2924762964248657, -0.17858260869979858, -0.29502928256988525, -0.3392088711261749, 0.11046139150857925, -0.14202086627483368, -0.6327154636383057, 0.1877158284187317, -0.7579355239868164, 0.36826372146606445, 1.3735815286636353, 0.3412446081638336, 0.08105015754699707, 0.508866548538208, 1.1155601739883423, 0.34267479181289673, -0.10987383872270584, -0.8899170160293579, -1.513645052909851, 1.9737070798873901, -1.4498748779296875, 2.0508439540863037, 0.7741246223449707, 0.018220793455839157, -1.7775757312774658, -1.9043854475021362, 1.3178503513336182, 1.1525299549102783, 2.3787081241607666, 0.535672664642334, 0.42911139130592346, -0.8025476932525635, -0.6889210343360901, 0.25949954986572266, -1.056203007698059, -0.8158528804779053, 0.19303283095359802, 2.4160284996032715, 1.7917293310165405, -0.41086795926094055, -0.26114150881767273, -1.061580777168274, 1.2669882774353027, -0.17375031113624573, 0.16287316381931305, 1.9370362758636475, -0.19463136792182922, -1.0529155731201172, 1.2688584327697754, -2.4002184867858887, 0.170949786901474, 2.055283546447754, 0.16836674511432648, 0.13554832339286804, -1.4061259031295776, -0.6378225088119507, -0.23933325707912445, -0.40698033571243286, -1.2958786487579346, 0.5196449756622314, -0.3135680556297302, -0.8285629153251648, -1.441110372543335, 0.1519099771976471, -1.1079751253128052, -1.6664255857467651, 0.23497982323169708, 1.9262051582336426, 2.036682605743408, -0.7380725145339966, 1.5378199815750122, -0.24593490362167358, 0.06326611340045929, 1.2388916015625, 1.3020211458206177, 3.1570796966552734, 1.869766116142273, -1.3343816995620728, 0.625044584274292, -0.2009945660829544, -0.39984384179115295, 1.1184887886047363, -1.1736578941345215, 1.2935422658920288, -0.15863308310508728, -1.2076776027679443, -1.2716377973556519, 1.0021820068359375, 0.5103248953819275, 0.05110247805714607, -0.4636589288711548, 1.2109019756317139, 0.046535246074199677, 1.3705836534500122, 0.5518001317977905, -0.40545740723609924, 0.60025954246521, -0.37961485981941223, -0.4754830300807953, 1.5725953578948975, 0.15692618489265442, -1.3329195976257324, -2.3255467414855957, -0.19322611391544342, -0.8810601830482483, 0.012513446621596813, -0.6211261749267578, -0.9967018961906433, 1.6943235397338867, 0.38902848958969116, -1.2762514352798462, -0.24421781301498413, -0.4045272171497345, -0.6113440990447998, 2.629392623901367, -1.4435898065567017, -0.19550423324108124, -1.0614228248596191, -0.6103923320770264, 1.6252268552780151, -1.1703182458877563, -0.22462020814418793, -0.9887969493865967, -0.5708717703819275, -1.329145073890686, -0.5608298182487488, -0.0063744233921170235, -0.9437716007232666, 0.8209325671195984, 0.19836050271987915, -1.1758317947387695, -0.34273675084114075, -0.8046068549156189, 0.8975199460983276, -0.07493352890014648, 0.16801738739013672, 1.8858489990234375, 0.37288475036621094, -0.33648499846458435, 0.777050256729126, 1.1157002449035645, 0.5418404936790466, -0.578534722328186, 0.24201685190200806, -0.6411670446395874, 0.3567371368408203, -1.3643773794174194, 0.3346725404262543, -2.8339715003967285, 0.6683588624000549, -0.12842632830142975, -0.0030344012193381786, -0.0398738831281662, -1.3322186470031738, 1.1107503175735474, 2.6955156326293945, -1.1681692600250244, 0.43670716881752014, 0.30068302154541016, 1.2024399042129517, -1.6220322847366333, 0.21673326194286346, -0.4476670026779175, 2.0797078609466553, 0.2048504799604416, 1.1995551586151123, -0.4441255033016205, -2.3332457542419434, 0.5654411315917969, -1.2239596843719482, -1.1323434114456177, 0.8517121076583862, -0.7566371560096741, 0.04536103829741478, -1.365788221359253, -0.32363978028297424, -0.8824050426483154, -1.1682673692703247, 0.7639139294624329, 0.1425333321094513, 0.5109161734580994, -0.6491782069206238, 0.3462383449077606, -2.134814500808716, -1.2160190343856812, -0.16664041578769684, -0.9362239837646484, 0.45583575963974, -0.3395879864692688, 0.6147753000259399, -0.1548738330602646, -0.010405643843114376, 0.3338283896446228, 1.447240948677063, 3.3900294303894043, 0.18039532005786896, 0.3177078068256378, -0.21959269046783447, -0.9369688034057617, 1.4309405088424683, 0.933340311050415, -0.12157081067562103, -0.5851618051528931, -1.0643008947372437, 1.1398614645004272, 1.9110329151153564, 0.9540061950683594, 0.141316220164299, -0.9213065505027771, -0.7894463539123535, -0.0866498351097107, 0.15488430857658386, 0.44477853178977966, 0.9616525173187256, 0.05751302093267441, 0.019719190895557404, 1.4781830310821533, 1.159281611442566, -0.42409026622772217, 0.4124910235404968, -0.8478191494941711, -0.47646260261535645, 0.459538072347641, 0.31353792548179626, -0.017868779599666595, 0.3563000559806824, -1.0116444826126099, -0.22963538765907288, -0.41396602988243103, -0.9275899529457092, -0.7629736661911011, -0.32443976402282715, -0.30440327525138855, 1.6224217414855957, 0.1239328607916832, -0.4410342872142792, -0.040842730551958084, -0.8453747034072876, -0.12862525880336761, -1.0626118183135986, 0.2640031576156616, -0.18461637198925018, -0.07217759639024734, -0.09636680781841278, 1.694205641746521, -0.9225834012031555, -2.051593065261841, 0.2366943657398224, 0.13403728604316711, -0.2821212112903595, 0.24920061230659485, 1.701782464981079, 0.6228538751602173, 1.4885151386260986, 1.3103333711624146, 0.9123961925506592, -0.6513437032699585, -1.289663553237915, 0.7246230244636536, 0.8987298607826233, -1.4618250131607056, 0.8000175952911377, -0.0736902579665184, -0.5019694566726685, 0.6115290522575378, 1.2514375448226929, 0.4622548818588257, -2.063819169998169, 0.7643533945083618, -1.0098092555999756, 0.7342700958251953, 0.693495512008667, 0.6889253854751587, 0.21852923929691315, 0.8429936170578003, -1.228632926940918, -1.180039644241333, -0.6601511836051941, -0.7257905602455139, 1.939916729927063, -0.29649561643600464, 0.5908938646316528, -0.1516297608613968, -1.3410059213638306, -0.10557746887207031, 0.6733989715576172, 0.38700374960899353, -0.4286113679409027, 0.7837465405464172, -0.6622730493545532, -1.0651236772537231, -1.346018671989441, -0.542682409286499, -0.9742518663406372, -0.9175695776939392, 1.0007556676864624, 0.8120678067207336, 0.2981298863887787, 1.935796856880188, 0.6130643486976624, 0.23830202221870422, -2.6603739261627197, 0.8814561367034912, 0.3260982036590576, -0.03735742345452309, 0.9839394688606262, 0.3537830114364624, 1.0666303634643555, 0.08979716897010803, 0.5058378577232361, -2.4149062633514404, 2.3115782737731934, -0.16046102344989777, 0.7054911851882935, -0.06214626878499985, -0.19108512997627258, 1.0858968496322632, 0.5119999647140503, 0.536394476890564, -1.0754477977752686, 0.7091380953788757, -0.6351762413978577, 1.2834407091140747, 0.8377601504325867, -0.8794649839401245, -0.0277642123401165, 1.3964333534240723, 0.4197244644165039, -0.5195739269256592, -0.8826538324356079, -0.9827603697776794, 0.893470287322998, 1.7605586051940918, -0.010405180044472218, 0.05065936967730522, 0.7645309567451477, 0.6636613607406616, -1.3809834718704224, 0.053460799157619476, -0.7692795991897583, -0.7349074482917786, 1.6642836332321167, 1.9984813928604126, -0.09951033443212509, -0.2302718609571457, -0.7865662574768066, -1.2683542966842651, 0.7540768384933472, -0.007074759807437658, 0.13441652059555054, 0.6296256184577942, -0.6920807957649231, 1.0906840562820435, 0.8974137306213379, 0.9985336661338806, 0.1427447497844696, 0.3803306221961975, 0.4230553209781647, -0.4417182505130768, -1.1716252565383911, -0.2410702258348465, -1.086464524269104, -2.5147886276245117, 0.4694387912750244, -0.17736124992370605, -1.4474605321884155, 0.04626300930976868, -0.9892327189445496, 0.8223909139633179, -0.6247978806495667, -1.1511708498001099, -1.4458751678466797, 0.2319227010011673, -0.12607675790786743, 0.9313404560089111, -1.5498989820480347, -0.09947220236063004, 1.2128684520721436, 0.9468358755111694, -0.6310320496559143, 0.9125134944915771, 0.19463379681110382, 1.0445419549942017, 0.9164772629737854, -0.40099066495895386, 0.5038579702377319, 0.03530776500701904, -1.3571157455444336, 0.46314242482185364, 1.1190850734710693, 0.2115364670753479, 1.5200461149215698, -0.5069965720176697, -0.013669553212821484, 0.41897323727607727, -0.5564319491386414, -0.49642229080200195, -0.5278658866882324, 0.6527290344238281, 0.016996704041957855, -0.9016609191894531, 0.029975000768899918, -0.07896718382835388, -0.2970147132873535, 0.2124631553888321, -1.4780042171478271, -0.1277632713317871, -0.34710493683815, -0.6298359036445618, -1.2875733375549316, 0.026413414627313614, 1.3143360614776611, -0.7477343082427979, -0.19799931347370148, 0.4692150354385376, 0.3530961275100708, 0.4680485427379608, 0.6370007395744324, -0.7103778719902039, -0.3945561945438385, -0.26823386549949646, -0.4210679233074188, 0.38459253311157227, 1.3095107078552246, -0.09267516434192657, -1.0491926670074463, 0.7157511115074158, -0.4219925105571747, 0.08920284360647202, 1.937273383140564, 0.0999821275472641, -0.7770594954490662, 0.28440040349960327, -0.7405832409858704, 1.9590882062911987, 1.7052613496780396, 1.2878930568695068, -0.18042513728141785, -0.9876534938812256, 0.6890316605567932, -0.42487260699272156, -0.32052338123321533, 0.9184109568595886, 0.41414758563041687, -0.21918822824954987, -1.4147491455078125, 0.6263736486434937, 1.281904697418213, -0.9011874794960022, -0.7757946252822876, 0.12646633386611938, -0.7617878317832947, 1.0510350465774536, 0.7178279161453247, 0.2915962040424347, 0.2867465019226074, 1.6456446647644043, 0.7763343453407288, -0.4341026544570923, 0.4929564297199249, 0.41795799136161804, -0.11829538643360138, -2.159857988357544, -1.0930455923080444, 0.2796191871166229, -0.3960854411125183, -1.5629533529281616, 1.3204567432403564, -1.1440719366073608, -0.9905489087104797, 0.5010926723480225, 0.127340629696846, 1.4130033254623413, 0.2966632843017578, 1.5942564010620117, 2.065819501876831, 0.873566746711731, 0.3680258095264435, 1.2102782726287842, -0.08388232439756393, -0.44091174006462097, 1.7856558561325073, -0.4811832010746002, 0.4940567910671234, 1.1277741193771362, -0.31754952669143677, -1.1212551593780518, -0.8329146504402161, -1.2339822053909302, -0.734185516834259, 1.1984434127807617, 0.12194120138883591, -1.0253469944000244, 0.29335829615592957, 1.6168173551559448, 0.062423042953014374, -0.2872254550457001, 0.6754661202430725, 0.49941930174827576, -0.7540431618690491, -0.09514662623405457, -0.7937979102134705, 0.5617873668670654, -0.11522653698921204, -0.35756736993789673, 0.40483954548835754, 0.4560375511646271, 1.3130531311035156, 0.007845665328204632, 0.06984740495681763, 1.1816197633743286, -1.3533958196640015, 1.538808822631836, -0.684821367263794, 0.32632189989089966, -2.3807337284088135, 1.412556767463684, -0.8048789501190186, 1.8985623121261597, -2.634653329849243, 0.43833473324775696, -0.5632678270339966, -0.41660165786743164, 0.29479044675827026, -0.3213178813457489, 0.1269928216934204, -0.13514980673789978, -1.093341588973999, -0.11781682074069977, -0.7075016498565674, 0.5838765501976013, 1.1719331741333008, 1.384377360343933, -1.115726351737976, -0.20199911296367645, -1.7703945636749268, -0.13443084061145782, -0.8029358983039856, 0.3057270646095276, -1.9712700843811035, -0.1424064040184021, -2.0130562782287598, -2.414170980453491, -1.30744469165802, -0.7597748041152954, 1.0722641944885254, 0.14368955790996552, -0.8058034181594849, 1.208678960800171, -0.3359648883342743, -1.7989155054092407, 1.0679649114608765, -2.1197891235351562 ]
https://github.com/huggingface/datasets/issues/4420
Metric evaluation problems in multi-node, shared file system
> * We had to change slightly the `_check_all_processes_locks` method so that the main process (i.e. process 0) didn't check it's own lock (because `lockf` permits recursive locks and thus checking it only replaced the current lock with a new one). Hi @panserbjorn , Can you share your `_check_all_processes_locks` function? thanks!
## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0
737
51
Metric evaluation problems in multi-node, shared file system ## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0 > * We had to change slightly the `_check_all_processes_locks` method so that the main process (i.e. process 0) didn't check it's own lock (because `lockf` permits recursive locks and thus checking it only replaced the current lock with a new one). Hi @panserbjorn , Can you share your `_check_all_processes_locks` function? thanks!
[ -1.296735405921936, -0.898237943649292, -0.786631166934967, 1.4941779375076294, -0.16268455982208252, -1.243415117263794, 0.17101557552814484, -1.040987491607666, 1.7357490062713623, -0.7962110042572021, 0.2971554696559906, -1.6023008823394775, 0.09675242751836777, -0.6188485026359558, -0.7566505670547485, -0.8449321389198303, -0.3520471453666687, -0.7326327562332153, 1.0212289094924927, 2.5368292331695557, 1.303423523902893, -1.299533724784851, 2.7445642948150635, 0.7668829560279846, -0.27061134576797485, -0.9395747780799866, 0.47091981768608093, -0.05736588314175606, -1.277888298034668, -0.46126970648765564, -0.9297401905059814, -0.024585597217082977, -0.533450722694397, -0.5027673840522766, 0.0028469087556004524, 0.36731502413749695, -0.33792194724082947, -0.4516681432723999, -0.5784897804260254, -0.7877139449119568, 0.4791809916496277, -0.34861302375793457, 0.8894843459129333, -0.3108561635017395, 1.798550009727478, -0.6003484129905701, 0.38829100131988525, 0.7397727370262146, 1.3281831741333008, 0.1366948038339615, -0.09222977608442307, 0.3400720953941345, 0.33751019835472107, -0.0057227835059165955, 0.5111706852912903, 1.2149614095687866, 0.6313177347183228, 0.43247684836387634, 0.7413879036903381, -2.2275850772857666, 1.3126556873321533, -0.9920987486839294, 0.2896241545677185, 1.3470649719238281, -0.9659619927406311, 0.3498217761516571, -1.8487476110458374, -0.04275061935186386, 0.6120667457580566, -2.2636871337890625, 0.29149681329727173, -1.3383252620697021, -0.5669901967048645, 1.0051144361495972, 0.27276936173439026, -1.2572354078292847, 0.08622222393751144, -0.462263822555542, 1.0700962543487549, 0.46964919567108154, 1.0930589437484741, -1.76161789894104, -0.05344267934560776, -0.2665000259876251, 0.18086469173431396, -1.329526662826538, -1.5731045007705688, 0.5145358443260193, 0.6555036902427673, 0.5976969599723816, -0.10616478323936462, 1.0675731897354126, -0.9770481586456299, 0.8193318247795105, -0.901537299156189, -1.7540364265441895, -1.3920302391052246, -2.194899559020996, -2.184145212173462, 0.7022284865379333, -0.45809853076934814, -0.5334958434104919, 2.1164844036102295, -1.0174530744552612, -1.7711232900619507, 1.064071536064148, 0.21559181809425354, 0.003660903312265873, 2.3857390880584717, 0.21530495584011078, -0.7059417366981506, 0.4047938883304596, -0.6739565134048462, 0.7438317537307739, -0.436335027217865, 1.3152176141738892, 0.4306190013885498, -1.0956381559371948, 1.5913779735565186, -0.3918163776397705, 0.5616999268531799, -0.7053163647651672, -0.4596382677555084, -0.7636924982070923, 0.2972218692302704, 1.9216816425323486, -0.33916985988616943, 1.5335453748703003, -0.36925187706947327, -1.570312261581421, -1.6028646230697632, 0.9122076034545898, 0.5445980429649353, -0.7527026534080505, 0.17826950550079346, -0.3729276657104492, 0.12073012441396713, -0.0816434919834137, 1.0947290658950806, 1.3466839790344238, 0.7123373746871948, -0.2554154396057129, -0.7850877642631531, 0.21373727917671204, -0.08419563621282578, -0.6960259675979614, -1.7572965621948242, -0.3023975193500519, 0.15328986942768097, 0.6746102571487427, -1.2229970693588257, 1.8087650537490845, 0.8776248693466187, 1.8769216537475586, 1.023154377937317, -0.320329874753952, 1.5446470975875854, 0.053206201642751694, 1.86294424533844, -0.45325735211372375, 0.692952036857605, -0.3724135756492615, -1.173427939414978, 0.8601318597793579, -0.28408604860305786, -2.014439105987549, -0.7625234723091125, -0.7198396921157837, -0.19456440210342407, -0.8354343771934509, 0.894690752029419, -0.2657856047153473, -1.4152854681015015, 0.28458189964294434, -0.6740895509719849, 0.16316337883472443, -1.232635259628296, 0.29882216453552246, 0.6405011415481567, -0.6171579957008362, 0.10687798261642456, -0.23614943027496338, -1.247330665588379, -0.5264074802398682, 0.30575570464134216, 1.8485080003738403, -0.6807284951210022, 0.9397072792053223, 1.048743486404419, -0.7336850166320801, -0.03557669371366501, 0.3632987141609192, -0.2820141613483429, 0.8297500014305115, -1.1295344829559326, -0.393947958946228, 1.1868258714675903, -0.1833476722240448, -0.5931003093719482, 1.4280387163162231, 0.7170429825782776, -0.9627841711044312, -0.20118896663188934, -0.1967862844467163, -0.8103418946266174, 0.07018090039491653, -1.579406976699829, -0.13180230557918549, 0.397308886051178, -1.5007096529006958, -0.45455703139305115, -0.20982831716537476, 1.333138346672058, -0.20921823382377625, 1.4931905269622803, -0.2924762964248657, -0.17858260869979858, -0.29502928256988525, -0.3392088711261749, 0.11046139150857925, -0.14202086627483368, -0.6327154636383057, 0.1877158284187317, -0.7579355239868164, 0.36826372146606445, 1.3735815286636353, 0.3412446081638336, 0.08105015754699707, 0.508866548538208, 1.1155601739883423, 0.34267479181289673, -0.10987383872270584, -0.8899170160293579, -1.513645052909851, 1.9737070798873901, -1.4498748779296875, 2.0508439540863037, 0.7741246223449707, 0.018220793455839157, -1.7775757312774658, -1.9043854475021362, 1.3178503513336182, 1.1525299549102783, 2.3787081241607666, 0.535672664642334, 0.42911139130592346, -0.8025476932525635, -0.6889210343360901, 0.25949954986572266, -1.056203007698059, -0.8158528804779053, 0.19303283095359802, 2.4160284996032715, 1.7917293310165405, -0.41086795926094055, -0.26114150881767273, -1.061580777168274, 1.2669882774353027, -0.17375031113624573, 0.16287316381931305, 1.9370362758636475, -0.19463136792182922, -1.0529155731201172, 1.2688584327697754, -2.4002184867858887, 0.170949786901474, 2.055283546447754, 0.16836674511432648, 0.13554832339286804, -1.4061259031295776, -0.6378225088119507, -0.23933325707912445, -0.40698033571243286, -1.2958786487579346, 0.5196449756622314, -0.3135680556297302, -0.8285629153251648, -1.441110372543335, 0.1519099771976471, -1.1079751253128052, -1.6664255857467651, 0.23497982323169708, 1.9262051582336426, 2.036682605743408, -0.7380725145339966, 1.5378199815750122, -0.24593490362167358, 0.06326611340045929, 1.2388916015625, 1.3020211458206177, 3.1570796966552734, 1.869766116142273, -1.3343816995620728, 0.625044584274292, -0.2009945660829544, -0.39984384179115295, 1.1184887886047363, -1.1736578941345215, 1.2935422658920288, -0.15863308310508728, -1.2076776027679443, -1.2716377973556519, 1.0021820068359375, 0.5103248953819275, 0.05110247805714607, -0.4636589288711548, 1.2109019756317139, 0.046535246074199677, 1.3705836534500122, 0.5518001317977905, -0.40545740723609924, 0.60025954246521, -0.37961485981941223, -0.4754830300807953, 1.5725953578948975, 0.15692618489265442, -1.3329195976257324, -2.3255467414855957, -0.19322611391544342, -0.8810601830482483, 0.012513446621596813, -0.6211261749267578, -0.9967018961906433, 1.6943235397338867, 0.38902848958969116, -1.2762514352798462, -0.24421781301498413, -0.4045272171497345, -0.6113440990447998, 2.629392623901367, -1.4435898065567017, -0.19550423324108124, -1.0614228248596191, -0.6103923320770264, 1.6252268552780151, -1.1703182458877563, -0.22462020814418793, -0.9887969493865967, -0.5708717703819275, -1.329145073890686, -0.5608298182487488, -0.0063744233921170235, -0.9437716007232666, 0.8209325671195984, 0.19836050271987915, -1.1758317947387695, -0.34273675084114075, -0.8046068549156189, 0.8975199460983276, -0.07493352890014648, 0.16801738739013672, 1.8858489990234375, 0.37288475036621094, -0.33648499846458435, 0.777050256729126, 1.1157002449035645, 0.5418404936790466, -0.578534722328186, 0.24201685190200806, -0.6411670446395874, 0.3567371368408203, -1.3643773794174194, 0.3346725404262543, -2.8339715003967285, 0.6683588624000549, -0.12842632830142975, -0.0030344012193381786, -0.0398738831281662, -1.3322186470031738, 1.1107503175735474, 2.6955156326293945, -1.1681692600250244, 0.43670716881752014, 0.30068302154541016, 1.2024399042129517, -1.6220322847366333, 0.21673326194286346, -0.4476670026779175, 2.0797078609466553, 0.2048504799604416, 1.1995551586151123, -0.4441255033016205, -2.3332457542419434, 0.5654411315917969, -1.2239596843719482, -1.1323434114456177, 0.8517121076583862, -0.7566371560096741, 0.04536103829741478, -1.365788221359253, -0.32363978028297424, -0.8824050426483154, -1.1682673692703247, 0.7639139294624329, 0.1425333321094513, 0.5109161734580994, -0.6491782069206238, 0.3462383449077606, -2.134814500808716, -1.2160190343856812, -0.16664041578769684, -0.9362239837646484, 0.45583575963974, -0.3395879864692688, 0.6147753000259399, -0.1548738330602646, -0.010405643843114376, 0.3338283896446228, 1.447240948677063, 3.3900294303894043, 0.18039532005786896, 0.3177078068256378, -0.21959269046783447, -0.9369688034057617, 1.4309405088424683, 0.933340311050415, -0.12157081067562103, -0.5851618051528931, -1.0643008947372437, 1.1398614645004272, 1.9110329151153564, 0.9540061950683594, 0.141316220164299, -0.9213065505027771, -0.7894463539123535, -0.0866498351097107, 0.15488430857658386, 0.44477853178977966, 0.9616525173187256, 0.05751302093267441, 0.019719190895557404, 1.4781830310821533, 1.159281611442566, -0.42409026622772217, 0.4124910235404968, -0.8478191494941711, -0.47646260261535645, 0.459538072347641, 0.31353792548179626, -0.017868779599666595, 0.3563000559806824, -1.0116444826126099, -0.22963538765907288, -0.41396602988243103, -0.9275899529457092, -0.7629736661911011, -0.32443976402282715, -0.30440327525138855, 1.6224217414855957, 0.1239328607916832, -0.4410342872142792, -0.040842730551958084, -0.8453747034072876, -0.12862525880336761, -1.0626118183135986, 0.2640031576156616, -0.18461637198925018, -0.07217759639024734, -0.09636680781841278, 1.694205641746521, -0.9225834012031555, -2.051593065261841, 0.2366943657398224, 0.13403728604316711, -0.2821212112903595, 0.24920061230659485, 1.701782464981079, 0.6228538751602173, 1.4885151386260986, 1.3103333711624146, 0.9123961925506592, -0.6513437032699585, -1.289663553237915, 0.7246230244636536, 0.8987298607826233, -1.4618250131607056, 0.8000175952911377, -0.0736902579665184, -0.5019694566726685, 0.6115290522575378, 1.2514375448226929, 0.4622548818588257, -2.063819169998169, 0.7643533945083618, -1.0098092555999756, 0.7342700958251953, 0.693495512008667, 0.6889253854751587, 0.21852923929691315, 0.8429936170578003, -1.228632926940918, -1.180039644241333, -0.6601511836051941, -0.7257905602455139, 1.939916729927063, -0.29649561643600464, 0.5908938646316528, -0.1516297608613968, -1.3410059213638306, -0.10557746887207031, 0.6733989715576172, 0.38700374960899353, -0.4286113679409027, 0.7837465405464172, -0.6622730493545532, -1.0651236772537231, -1.346018671989441, -0.542682409286499, -0.9742518663406372, -0.9175695776939392, 1.0007556676864624, 0.8120678067207336, 0.2981298863887787, 1.935796856880188, 0.6130643486976624, 0.23830202221870422, -2.6603739261627197, 0.8814561367034912, 0.3260982036590576, -0.03735742345452309, 0.9839394688606262, 0.3537830114364624, 1.0666303634643555, 0.08979716897010803, 0.5058378577232361, -2.4149062633514404, 2.3115782737731934, -0.16046102344989777, 0.7054911851882935, -0.06214626878499985, -0.19108512997627258, 1.0858968496322632, 0.5119999647140503, 0.536394476890564, -1.0754477977752686, 0.7091380953788757, -0.6351762413978577, 1.2834407091140747, 0.8377601504325867, -0.8794649839401245, -0.0277642123401165, 1.3964333534240723, 0.4197244644165039, -0.5195739269256592, -0.8826538324356079, -0.9827603697776794, 0.893470287322998, 1.7605586051940918, -0.010405180044472218, 0.05065936967730522, 0.7645309567451477, 0.6636613607406616, -1.3809834718704224, 0.053460799157619476, -0.7692795991897583, -0.7349074482917786, 1.6642836332321167, 1.9984813928604126, -0.09951033443212509, -0.2302718609571457, -0.7865662574768066, -1.2683542966842651, 0.7540768384933472, -0.007074759807437658, 0.13441652059555054, 0.6296256184577942, -0.6920807957649231, 1.0906840562820435, 0.8974137306213379, 0.9985336661338806, 0.1427447497844696, 0.3803306221961975, 0.4230553209781647, -0.4417182505130768, -1.1716252565383911, -0.2410702258348465, -1.086464524269104, -2.5147886276245117, 0.4694387912750244, -0.17736124992370605, -1.4474605321884155, 0.04626300930976868, -0.9892327189445496, 0.8223909139633179, -0.6247978806495667, -1.1511708498001099, -1.4458751678466797, 0.2319227010011673, -0.12607675790786743, 0.9313404560089111, -1.5498989820480347, -0.09947220236063004, 1.2128684520721436, 0.9468358755111694, -0.6310320496559143, 0.9125134944915771, 0.19463379681110382, 1.0445419549942017, 0.9164772629737854, -0.40099066495895386, 0.5038579702377319, 0.03530776500701904, -1.3571157455444336, 0.46314242482185364, 1.1190850734710693, 0.2115364670753479, 1.5200461149215698, -0.5069965720176697, -0.013669553212821484, 0.41897323727607727, -0.5564319491386414, -0.49642229080200195, -0.5278658866882324, 0.6527290344238281, 0.016996704041957855, -0.9016609191894531, 0.029975000768899918, -0.07896718382835388, -0.2970147132873535, 0.2124631553888321, -1.4780042171478271, -0.1277632713317871, -0.34710493683815, -0.6298359036445618, -1.2875733375549316, 0.026413414627313614, 1.3143360614776611, -0.7477343082427979, -0.19799931347370148, 0.4692150354385376, 0.3530961275100708, 0.4680485427379608, 0.6370007395744324, -0.7103778719902039, -0.3945561945438385, -0.26823386549949646, -0.4210679233074188, 0.38459253311157227, 1.3095107078552246, -0.09267516434192657, -1.0491926670074463, 0.7157511115074158, -0.4219925105571747, 0.08920284360647202, 1.937273383140564, 0.0999821275472641, -0.7770594954490662, 0.28440040349960327, -0.7405832409858704, 1.9590882062911987, 1.7052613496780396, 1.2878930568695068, -0.18042513728141785, -0.9876534938812256, 0.6890316605567932, -0.42487260699272156, -0.32052338123321533, 0.9184109568595886, 0.41414758563041687, -0.21918822824954987, -1.4147491455078125, 0.6263736486434937, 1.281904697418213, -0.9011874794960022, -0.7757946252822876, 0.12646633386611938, -0.7617878317832947, 1.0510350465774536, 0.7178279161453247, 0.2915962040424347, 0.2867465019226074, 1.6456446647644043, 0.7763343453407288, -0.4341026544570923, 0.4929564297199249, 0.41795799136161804, -0.11829538643360138, -2.159857988357544, -1.0930455923080444, 0.2796191871166229, -0.3960854411125183, -1.5629533529281616, 1.3204567432403564, -1.1440719366073608, -0.9905489087104797, 0.5010926723480225, 0.127340629696846, 1.4130033254623413, 0.2966632843017578, 1.5942564010620117, 2.065819501876831, 0.873566746711731, 0.3680258095264435, 1.2102782726287842, -0.08388232439756393, -0.44091174006462097, 1.7856558561325073, -0.4811832010746002, 0.4940567910671234, 1.1277741193771362, -0.31754952669143677, -1.1212551593780518, -0.8329146504402161, -1.2339822053909302, -0.734185516834259, 1.1984434127807617, 0.12194120138883591, -1.0253469944000244, 0.29335829615592957, 1.6168173551559448, 0.062423042953014374, -0.2872254550457001, 0.6754661202430725, 0.49941930174827576, -0.7540431618690491, -0.09514662623405457, -0.7937979102134705, 0.5617873668670654, -0.11522653698921204, -0.35756736993789673, 0.40483954548835754, 0.4560375511646271, 1.3130531311035156, 0.007845665328204632, 0.06984740495681763, 1.1816197633743286, -1.3533958196640015, 1.538808822631836, -0.684821367263794, 0.32632189989089966, -2.3807337284088135, 1.412556767463684, -0.8048789501190186, 1.8985623121261597, -2.634653329849243, 0.43833473324775696, -0.5632678270339966, -0.41660165786743164, 0.29479044675827026, -0.3213178813457489, 0.1269928216934204, -0.13514980673789978, -1.093341588973999, -0.11781682074069977, -0.7075016498565674, 0.5838765501976013, 1.1719331741333008, 1.384377360343933, -1.115726351737976, -0.20199911296367645, -1.7703945636749268, -0.13443084061145782, -0.8029358983039856, 0.3057270646095276, -1.9712700843811035, -0.1424064040184021, -2.0130562782287598, -2.414170980453491, -1.30744469165802, -0.7597748041152954, 1.0722641944885254, 0.14368955790996552, -0.8058034181594849, 1.208678960800171, -0.3359648883342743, -1.7989155054092407, 1.0679649114608765, -2.1197891235351562 ]
https://github.com/huggingface/datasets/issues/4420
Metric evaluation problems in multi-node, shared file system
``` def _check_all_processes_locks(self): expected_lock_file_names = [ os.path.join(self.data_dir, f"{self.experiment_id}-{self.num_process}-{process_id}.arrow.lock") for process_id in range(self.num_process) ] #for expected_lock_file_name in expected_lock_file_names: # OUR CHANGE process 0 shouldn't check its own lock for expected_lock_file_name in expected_lock_file_names[1:]: nofilelock = FileFreeLock(expected_lock_file_name) try: nofilelock.acquire(timeout=self.timeout) except Timeout: raise ValueError( f"Expected to find locked file {expected_lock_file_name} from process {self.process_id} but it doesn't exist." ) else: nofilelock.release() ``` ### Changed files: - metric.py file in the datasets library - filelock.py file in the datasets/utils library. Changes we made: 1. We changed the flock for lockf flock and lockf both perform a lock over a file (like the lock for writing). The difference is that flock only works in local file systems, but if you have a shared file system (like what we have in the clusters) the flock fails to “see” the lock of another node. The only disadvantage we had was that a single process couldn’t detect it’s own lock so we did the second change. 2. We prevented the process 0 (which is the one that coordinates the rendezvous) from checking its own lock on its arrow because it didn't work with lockf (as stated in the previous change). 3. We made a second rendezvous so that all the process had the results of the metrics (other than the loss) and not only the process 0. What happened was that only process 0 computed the metric and that didn’t present any problem if you are using the loss. However, if you are using another metric, the only process which had the information to choose the best checkpoint at evaluation time was the process 0. But since the evaluation was performed over all processes, every process except the process 0 chose a bad check point (bad meaning it wasn’t the best one) because they didn’t have the information of the metric of the best checkpoint. The consequence was that the evaluation was different from what would result if using only the best checkpoint, because each process chose a different checkpoint to run the evaluation and thus the numbers were often worse than the numbers that would be obtained if all processes choose the best checkpoint (correct one) to perform the evaluation of their samples. We performed a second rendezvous so that all processes had the same best_metric and best_model as process 0 after the evaluation cycle.
## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0
737
386
Metric evaluation problems in multi-node, shared file system ## Describe the bug Metric evaluation fails in multi-node within a shared file system, because the master process cannot find the lock files from other nodes. (This issue was originally mentioned in the transformers repo https://github.com/huggingface/transformers/issues/17412) ## Steps to reproduce the bug 1. clone [this huggingface model](https://huggingface.co/PereLluis13/wav2vec2-xls-r-300m-ca-lm) and replace the `run_speech_recognition_ctc.py` script with the version in the gist [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71#file-run_speech_recognition_ctc-py). 2. Setup the `venv` according to the requirements of the model file plus `datasets==2.0.0`, `transformers==4.18.0` and `torch==1.9.0` 3. Launch the runner in a distributed environment which has a shared file system for two nodes, preferably with SLURM. Example [here](https://gist.github.com/gullabi/3f66094caa8db1c1e615dd35bd67ec71) Specifically for the datasets, for the distributed setup the `load_metric` is called as: ``` process_id=int(os.environ["RANK"]) num_process=int(os.environ["WORLD_SIZE"]) eval_metrics = {metric: load_metric(metric, process_id=process_id, num_process=num_process, experiment_id="slurm") for metric in data_args.eval_metrics} ``` ## Expected results The training should not fail, due to the failure of the `Metric.compute()` step. ## Actual results For the test I am executing the world size is 4, with 2 GPUs in 2 nodes. However the process is not finding the necessary lock files ``` File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 841, in <module> main() File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 792, in main train_result = trainer.train(resume_from_checkpoint=checkpoint) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1497, in train self._maybe_log_save_evaluate(tr_loss, model, trial, epoch, ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 1624, in _maybe_log_save_evaluate metrics = self.evaluate(ignore_keys=ignore_keys_for_eval) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2291, in evaluate metric_key_prefix=metric_key_prefix, File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/transformers/trainer.py", line 2535, in evaluation_loop metrics = self.compute_metrics(EvalPrediction(predictions=all_preds, label_ids=all_labels)) File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in compute_metrics metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/speech/asr/wav2vec2-xls-r-300m-ca-lm/run_speech_recognition_ctc.py", line 742, in <dictcomp> metrics = {k: v.compute(predictions=pred_str, references=label_str) for k, v in eval_metrics.items()} File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 419, in compute self.add_batch(**inputs) File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 465, in add_batch self._init_writer() File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 552, in _init_writer self._check_rendez_vous() # wait for master to be ready and to let everyone go File "/gpfs/projects/bsc88/projects/speech-tech-resources/venv_amd_speech/lib/python3.7/site-packages/datasets/metric.py", line 342, in _check_rendez_vous ) from None ValueError: Expected to find locked file /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock from process 3 but it doesn't exist. ``` When I look at the cache directory, I can see all the lock files in principle: ``` /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-0.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-1.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-2.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-3.arrow.lock /home/bsc88/bsc88474/.cache/huggingface/metrics/wer/default/slurm-4-rdv.lock ``` I see that there was another related issue here https://github.com/huggingface/datasets/issues/1942, but it seems to have resolved via https://github.com/huggingface/datasets/pull/1966. Let me know if there is problem with how I am calling the `load_metric` or whether I need to make changes to the `.compute()` steps. ## Environment info - `datasets` version: 2.0.0 - Platform: Linux-4.18.0-147.8.1.el8_1.x86_64-x86_64-with-centos-8.1.1911-Core - Python version: 3.7.4 - PyArrow version: 7.0.0 - Pandas version: 1.3.0 ``` def _check_all_processes_locks(self): expected_lock_file_names = [ os.path.join(self.data_dir, f"{self.experiment_id}-{self.num_process}-{process_id}.arrow.lock") for process_id in range(self.num_process) ] #for expected_lock_file_name in expected_lock_file_names: # OUR CHANGE process 0 shouldn't check its own lock for expected_lock_file_name in expected_lock_file_names[1:]: nofilelock = FileFreeLock(expected_lock_file_name) try: nofilelock.acquire(timeout=self.timeout) except Timeout: raise ValueError( f"Expected to find locked file {expected_lock_file_name} from process {self.process_id} but it doesn't exist." ) else: nofilelock.release() ``` ### Changed files: - metric.py file in the datasets library - filelock.py file in the datasets/utils library. Changes we made: 1. We changed the flock for lockf flock and lockf both perform a lock over a file (like the lock for writing). The difference is that flock only works in local file systems, but if you have a shared file system (like what we have in the clusters) the flock fails to “see” the lock of another node. The only disadvantage we had was that a single process couldn’t detect it’s own lock so we did the second change. 2. We prevented the process 0 (which is the one that coordinates the rendezvous) from checking its own lock on its arrow because it didn't work with lockf (as stated in the previous change). 3. We made a second rendezvous so that all the process had the results of the metrics (other than the loss) and not only the process 0. What happened was that only process 0 computed the metric and that didn’t present any problem if you are using the loss. However, if you are using another metric, the only process which had the information to choose the best checkpoint at evaluation time was the process 0. But since the evaluation was performed over all processes, every process except the process 0 chose a bad check point (bad meaning it wasn’t the best one) because they didn’t have the information of the metric of the best checkpoint. The consequence was that the evaluation was different from what would result if using only the best checkpoint, because each process chose a different checkpoint to run the evaluation and thus the numbers were often worse than the numbers that would be obtained if all processes choose the best checkpoint (correct one) to perform the evaluation of their samples. We performed a second rendezvous so that all processes had the same best_metric and best_model as process 0 after the evaluation cycle.
[ -1.296735405921936, -0.898237943649292, -0.786631166934967, 1.4941779375076294, -0.16268455982208252, -1.243415117263794, 0.17101557552814484, -1.040987491607666, 1.7357490062713623, -0.7962110042572021, 0.2971554696559906, -1.6023008823394775, 0.09675242751836777, -0.6188485026359558, -0.7566505670547485, -0.8449321389198303, -0.3520471453666687, -0.7326327562332153, 1.0212289094924927, 2.5368292331695557, 1.303423523902893, -1.299533724784851, 2.7445642948150635, 0.7668829560279846, -0.27061134576797485, -0.9395747780799866, 0.47091981768608093, -0.05736588314175606, -1.277888298034668, -0.46126970648765564, -0.9297401905059814, -0.024585597217082977, -0.533450722694397, -0.5027673840522766, 0.0028469087556004524, 0.36731502413749695, -0.33792194724082947, -0.4516681432723999, -0.5784897804260254, -0.7877139449119568, 0.4791809916496277, -0.34861302375793457, 0.8894843459129333, -0.3108561635017395, 1.798550009727478, -0.6003484129905701, 0.38829100131988525, 0.7397727370262146, 1.3281831741333008, 0.1366948038339615, -0.09222977608442307, 0.3400720953941345, 0.33751019835472107, -0.0057227835059165955, 0.5111706852912903, 1.2149614095687866, 0.6313177347183228, 0.43247684836387634, 0.7413879036903381, -2.2275850772857666, 1.3126556873321533, -0.9920987486839294, 0.2896241545677185, 1.3470649719238281, -0.9659619927406311, 0.3498217761516571, -1.8487476110458374, -0.04275061935186386, 0.6120667457580566, -2.2636871337890625, 0.29149681329727173, -1.3383252620697021, -0.5669901967048645, 1.0051144361495972, 0.27276936173439026, -1.2572354078292847, 0.08622222393751144, -0.462263822555542, 1.0700962543487549, 0.46964919567108154, 1.0930589437484741, -1.76161789894104, -0.05344267934560776, -0.2665000259876251, 0.18086469173431396, -1.329526662826538, -1.5731045007705688, 0.5145358443260193, 0.6555036902427673, 0.5976969599723816, -0.10616478323936462, 1.0675731897354126, -0.9770481586456299, 0.8193318247795105, -0.901537299156189, -1.7540364265441895, -1.3920302391052246, -2.194899559020996, -2.184145212173462, 0.7022284865379333, -0.45809853076934814, -0.5334958434104919, 2.1164844036102295, -1.0174530744552612, -1.7711232900619507, 1.064071536064148, 0.21559181809425354, 0.003660903312265873, 2.3857390880584717, 0.21530495584011078, -0.7059417366981506, 0.4047938883304596, -0.6739565134048462, 0.7438317537307739, -0.436335027217865, 1.3152176141738892, 0.4306190013885498, -1.0956381559371948, 1.5913779735565186, -0.3918163776397705, 0.5616999268531799, -0.7053163647651672, -0.4596382677555084, -0.7636924982070923, 0.2972218692302704, 1.9216816425323486, -0.33916985988616943, 1.5335453748703003, -0.36925187706947327, -1.570312261581421, -1.6028646230697632, 0.9122076034545898, 0.5445980429649353, -0.7527026534080505, 0.17826950550079346, -0.3729276657104492, 0.12073012441396713, -0.0816434919834137, 1.0947290658950806, 1.3466839790344238, 0.7123373746871948, -0.2554154396057129, -0.7850877642631531, 0.21373727917671204, -0.08419563621282578, -0.6960259675979614, -1.7572965621948242, -0.3023975193500519, 0.15328986942768097, 0.6746102571487427, -1.2229970693588257, 1.8087650537490845, 0.8776248693466187, 1.8769216537475586, 1.023154377937317, -0.320329874753952, 1.5446470975875854, 0.053206201642751694, 1.86294424533844, -0.45325735211372375, 0.692952036857605, -0.3724135756492615, -1.173427939414978, 0.8601318597793579, -0.28408604860305786, -2.014439105987549, -0.7625234723091125, -0.7198396921157837, -0.19456440210342407, -0.8354343771934509, 0.894690752029419, -0.2657856047153473, -1.4152854681015015, 0.28458189964294434, -0.6740895509719849, 0.16316337883472443, -1.232635259628296, 0.29882216453552246, 0.6405011415481567, -0.6171579957008362, 0.10687798261642456, -0.23614943027496338, -1.247330665588379, -0.5264074802398682, 0.30575570464134216, 1.8485080003738403, -0.6807284951210022, 0.9397072792053223, 1.048743486404419, -0.7336850166320801, -0.03557669371366501, 0.3632987141609192, -0.2820141613483429, 0.8297500014305115, -1.1295344829559326, -0.393947958946228, 1.1868258714675903, -0.1833476722240448, -0.5931003093719482, 1.4280387163162231, 0.7170429825782776, -0.9627841711044312, -0.20118896663188934, -0.1967862844467163, -0.8103418946266174, 0.07018090039491653, -1.579406976699829, -0.13180230557918549, 0.397308886051178, -1.5007096529006958, -0.45455703139305115, -0.20982831716537476, 1.333138346672058, -0.20921823382377625, 1.4931905269622803, -0.2924762964248657, -0.17858260869979858, -0.29502928256988525, -0.3392088711261749, 0.11046139150857925, -0.14202086627483368, -0.6327154636383057, 0.1877158284187317, -0.7579355239868164, 0.36826372146606445, 1.3735815286636353, 0.3412446081638336, 0.08105015754699707, 0.508866548538208, 1.1155601739883423, 0.34267479181289673, -0.10987383872270584, -0.8899170160293579, -1.513645052909851, 1.9737070798873901, -1.4498748779296875, 2.0508439540863037, 0.7741246223449707, 0.018220793455839157, -1.7775757312774658, -1.9043854475021362, 1.3178503513336182, 1.1525299549102783, 2.3787081241607666, 0.535672664642334, 0.42911139130592346, -0.8025476932525635, -0.6889210343360901, 0.25949954986572266, -1.056203007698059, -0.8158528804779053, 0.19303283095359802, 2.4160284996032715, 1.7917293310165405, -0.41086795926094055, -0.26114150881767273, -1.061580777168274, 1.2669882774353027, -0.17375031113624573, 0.16287316381931305, 1.9370362758636475, -0.19463136792182922, -1.0529155731201172, 1.2688584327697754, -2.4002184867858887, 0.170949786901474, 2.055283546447754, 0.16836674511432648, 0.13554832339286804, -1.4061259031295776, -0.6378225088119507, -0.23933325707912445, -0.40698033571243286, -1.2958786487579346, 0.5196449756622314, -0.3135680556297302, -0.8285629153251648, -1.441110372543335, 0.1519099771976471, -1.1079751253128052, -1.6664255857467651, 0.23497982323169708, 1.9262051582336426, 2.036682605743408, -0.7380725145339966, 1.5378199815750122, -0.24593490362167358, 0.06326611340045929, 1.2388916015625, 1.3020211458206177, 3.1570796966552734, 1.869766116142273, -1.3343816995620728, 0.625044584274292, -0.2009945660829544, -0.39984384179115295, 1.1184887886047363, -1.1736578941345215, 1.2935422658920288, -0.15863308310508728, -1.2076776027679443, -1.2716377973556519, 1.0021820068359375, 0.5103248953819275, 0.05110247805714607, -0.4636589288711548, 1.2109019756317139, 0.046535246074199677, 1.3705836534500122, 0.5518001317977905, -0.40545740723609924, 0.60025954246521, -0.37961485981941223, -0.4754830300807953, 1.5725953578948975, 0.15692618489265442, -1.3329195976257324, -2.3255467414855957, -0.19322611391544342, -0.8810601830482483, 0.012513446621596813, -0.6211261749267578, -0.9967018961906433, 1.6943235397338867, 0.38902848958969116, -1.2762514352798462, -0.24421781301498413, -0.4045272171497345, -0.6113440990447998, 2.629392623901367, -1.4435898065567017, -0.19550423324108124, -1.0614228248596191, -0.6103923320770264, 1.6252268552780151, -1.1703182458877563, -0.22462020814418793, -0.9887969493865967, -0.5708717703819275, -1.329145073890686, -0.5608298182487488, -0.0063744233921170235, -0.9437716007232666, 0.8209325671195984, 0.19836050271987915, -1.1758317947387695, -0.34273675084114075, -0.8046068549156189, 0.8975199460983276, -0.07493352890014648, 0.16801738739013672, 1.8858489990234375, 0.37288475036621094, -0.33648499846458435, 0.777050256729126, 1.1157002449035645, 0.5418404936790466, -0.578534722328186, 0.24201685190200806, -0.6411670446395874, 0.3567371368408203, -1.3643773794174194, 0.3346725404262543, -2.8339715003967285, 0.6683588624000549, -0.12842632830142975, -0.0030344012193381786, -0.0398738831281662, -1.3322186470031738, 1.1107503175735474, 2.6955156326293945, -1.1681692600250244, 0.43670716881752014, 0.30068302154541016, 1.2024399042129517, -1.6220322847366333, 0.21673326194286346, -0.4476670026779175, 2.0797078609466553, 0.2048504799604416, 1.1995551586151123, -0.4441255033016205, -2.3332457542419434, 0.5654411315917969, -1.2239596843719482, -1.1323434114456177, 0.8517121076583862, -0.7566371560096741, 0.04536103829741478, -1.365788221359253, -0.32363978028297424, -0.8824050426483154, -1.1682673692703247, 0.7639139294624329, 0.1425333321094513, 0.5109161734580994, -0.6491782069206238, 0.3462383449077606, -2.134814500808716, -1.2160190343856812, -0.16664041578769684, -0.9362239837646484, 0.45583575963974, -0.3395879864692688, 0.6147753000259399, -0.1548738330602646, -0.010405643843114376, 0.3338283896446228, 1.447240948677063, 3.3900294303894043, 0.18039532005786896, 0.3177078068256378, -0.21959269046783447, -0.9369688034057617, 1.4309405088424683, 0.933340311050415, -0.12157081067562103, -0.5851618051528931, -1.0643008947372437, 1.1398614645004272, 1.9110329151153564, 0.9540061950683594, 0.141316220164299, -0.9213065505027771, -0.7894463539123535, -0.0866498351097107, 0.15488430857658386, 0.44477853178977966, 0.9616525173187256, 0.05751302093267441, 0.019719190895557404, 1.4781830310821533, 1.159281611442566, -0.42409026622772217, 0.4124910235404968, -0.8478191494941711, -0.47646260261535645, 0.459538072347641, 0.31353792548179626, -0.017868779599666595, 0.3563000559806824, -1.0116444826126099, -0.22963538765907288, -0.41396602988243103, -0.9275899529457092, -0.7629736661911011, -0.32443976402282715, -0.30440327525138855, 1.6224217414855957, 0.1239328607916832, -0.4410342872142792, -0.040842730551958084, -0.8453747034072876, -0.12862525880336761, -1.0626118183135986, 0.2640031576156616, -0.18461637198925018, -0.07217759639024734, -0.09636680781841278, 1.694205641746521, -0.9225834012031555, -2.051593065261841, 0.2366943657398224, 0.13403728604316711, -0.2821212112903595, 0.24920061230659485, 1.701782464981079, 0.6228538751602173, 1.4885151386260986, 1.3103333711624146, 0.9123961925506592, -0.6513437032699585, -1.289663553237915, 0.7246230244636536, 0.8987298607826233, -1.4618250131607056, 0.8000175952911377, -0.0736902579665184, -0.5019694566726685, 0.6115290522575378, 1.2514375448226929, 0.4622548818588257, -2.063819169998169, 0.7643533945083618, -1.0098092555999756, 0.7342700958251953, 0.693495512008667, 0.6889253854751587, 0.21852923929691315, 0.8429936170578003, -1.228632926940918, -1.180039644241333, -0.6601511836051941, -0.7257905602455139, 1.939916729927063, -0.29649561643600464, 0.5908938646316528, -0.1516297608613968, -1.3410059213638306, -0.10557746887207031, 0.6733989715576172, 0.38700374960899353, -0.4286113679409027, 0.7837465405464172, -0.6622730493545532, -1.0651236772537231, -1.346018671989441, -0.542682409286499, -0.9742518663406372, -0.9175695776939392, 1.0007556676864624, 0.8120678067207336, 0.2981298863887787, 1.935796856880188, 0.6130643486976624, 0.23830202221870422, -2.6603739261627197, 0.8814561367034912, 0.3260982036590576, -0.03735742345452309, 0.9839394688606262, 0.3537830114364624, 1.0666303634643555, 0.08979716897010803, 0.5058378577232361, -2.4149062633514404, 2.3115782737731934, -0.16046102344989777, 0.7054911851882935, -0.06214626878499985, -0.19108512997627258, 1.0858968496322632, 0.5119999647140503, 0.536394476890564, -1.0754477977752686, 0.7091380953788757, -0.6351762413978577, 1.2834407091140747, 0.8377601504325867, -0.8794649839401245, -0.0277642123401165, 1.3964333534240723, 0.4197244644165039, -0.5195739269256592, -0.8826538324356079, -0.9827603697776794, 0.893470287322998, 1.7605586051940918, -0.010405180044472218, 0.05065936967730522, 0.7645309567451477, 0.6636613607406616, -1.3809834718704224, 0.053460799157619476, -0.7692795991897583, -0.7349074482917786, 1.6642836332321167, 1.9984813928604126, -0.09951033443212509, -0.2302718609571457, -0.7865662574768066, -1.2683542966842651, 0.7540768384933472, -0.007074759807437658, 0.13441652059555054, 0.6296256184577942, -0.6920807957649231, 1.0906840562820435, 0.8974137306213379, 0.9985336661338806, 0.1427447497844696, 0.3803306221961975, 0.4230553209781647, -0.4417182505130768, -1.1716252565383911, -0.2410702258348465, -1.086464524269104, -2.5147886276245117, 0.4694387912750244, -0.17736124992370605, -1.4474605321884155, 0.04626300930976868, -0.9892327189445496, 0.8223909139633179, -0.6247978806495667, -1.1511708498001099, -1.4458751678466797, 0.2319227010011673, -0.12607675790786743, 0.9313404560089111, -1.5498989820480347, -0.09947220236063004, 1.2128684520721436, 0.9468358755111694, -0.6310320496559143, 0.9125134944915771, 0.19463379681110382, 1.0445419549942017, 0.9164772629737854, -0.40099066495895386, 0.5038579702377319, 0.03530776500701904, -1.3571157455444336, 0.46314242482185364, 1.1190850734710693, 0.2115364670753479, 1.5200461149215698, -0.5069965720176697, -0.013669553212821484, 0.41897323727607727, -0.5564319491386414, -0.49642229080200195, -0.5278658866882324, 0.6527290344238281, 0.016996704041957855, -0.9016609191894531, 0.029975000768899918, -0.07896718382835388, -0.2970147132873535, 0.2124631553888321, -1.4780042171478271, -0.1277632713317871, -0.34710493683815, -0.6298359036445618, -1.2875733375549316, 0.026413414627313614, 1.3143360614776611, -0.7477343082427979, -0.19799931347370148, 0.4692150354385376, 0.3530961275100708, 0.4680485427379608, 0.6370007395744324, -0.7103778719902039, -0.3945561945438385, -0.26823386549949646, -0.4210679233074188, 0.38459253311157227, 1.3095107078552246, -0.09267516434192657, -1.0491926670074463, 0.7157511115074158, -0.4219925105571747, 0.08920284360647202, 1.937273383140564, 0.0999821275472641, -0.7770594954490662, 0.28440040349960327, -0.7405832409858704, 1.9590882062911987, 1.7052613496780396, 1.2878930568695068, -0.18042513728141785, -0.9876534938812256, 0.6890316605567932, -0.42487260699272156, -0.32052338123321533, 0.9184109568595886, 0.41414758563041687, -0.21918822824954987, -1.4147491455078125, 0.6263736486434937, 1.281904697418213, -0.9011874794960022, -0.7757946252822876, 0.12646633386611938, -0.7617878317832947, 1.0510350465774536, 0.7178279161453247, 0.2915962040424347, 0.2867465019226074, 1.6456446647644043, 0.7763343453407288, -0.4341026544570923, 0.4929564297199249, 0.41795799136161804, -0.11829538643360138, -2.159857988357544, -1.0930455923080444, 0.2796191871166229, -0.3960854411125183, -1.5629533529281616, 1.3204567432403564, -1.1440719366073608, -0.9905489087104797, 0.5010926723480225, 0.127340629696846, 1.4130033254623413, 0.2966632843017578, 1.5942564010620117, 2.065819501876831, 0.873566746711731, 0.3680258095264435, 1.2102782726287842, -0.08388232439756393, -0.44091174006462097, 1.7856558561325073, -0.4811832010746002, 0.4940567910671234, 1.1277741193771362, -0.31754952669143677, -1.1212551593780518, -0.8329146504402161, -1.2339822053909302, -0.734185516834259, 1.1984434127807617, 0.12194120138883591, -1.0253469944000244, 0.29335829615592957, 1.6168173551559448, 0.062423042953014374, -0.2872254550457001, 0.6754661202430725, 0.49941930174827576, -0.7540431618690491, -0.09514662623405457, -0.7937979102134705, 0.5617873668670654, -0.11522653698921204, -0.35756736993789673, 0.40483954548835754, 0.4560375511646271, 1.3130531311035156, 0.007845665328204632, 0.06984740495681763, 1.1816197633743286, -1.3533958196640015, 1.538808822631836, -0.684821367263794, 0.32632189989089966, -2.3807337284088135, 1.412556767463684, -0.8048789501190186, 1.8985623121261597, -2.634653329849243, 0.43833473324775696, -0.5632678270339966, -0.41660165786743164, 0.29479044675827026, -0.3213178813457489, 0.1269928216934204, -0.13514980673789978, -1.093341588973999, -0.11781682074069977, -0.7075016498565674, 0.5838765501976013, 1.1719331741333008, 1.384377360343933, -1.115726351737976, -0.20199911296367645, -1.7703945636749268, -0.13443084061145782, -0.8029358983039856, 0.3057270646095276, -1.9712700843811035, -0.1424064040184021, -2.0130562782287598, -2.414170980453491, -1.30744469165802, -0.7597748041152954, 1.0722641944885254, 0.14368955790996552, -0.8058034181594849, 1.208678960800171, -0.3359648883342743, -1.7989155054092407, 1.0679649114608765, -2.1197891235351562 ]
https://github.com/huggingface/datasets/issues/4419
Update `unittest` assertions over tuples from `assertEqual` to `assertTupleEqual`
Hi! If the only goal is to improve readability, it's better to use `assertTupleEqual` than `assertSequenceEqual` for Python tuples. Also, note that this function is called internally by `assertEqual`, but I guess we can accept a PR to be more verbose.
**Is your feature request related to a problem? Please describe.** So this is more a readability improvement rather than a proposal, wouldn't it be better to use `assertTupleEqual` over the tuples rather than `assertEqual`? As `unittest` added that function in `v3.1`, as detailed at https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTupleEqual, so maybe it's worth updating. Find an example of an `assertEqual` over a tuple in 🤗 `datasets` unit tests over an `ArrowDataset` at https://github.com/huggingface/datasets/blob/0bb47271910c8a0b628dba157988372307fca1d2/tests/test_arrow_dataset.py#L570 **Describe the solution you'd like** Start slowly replacing all the `assertEqual` statements with `assertTupleEqual` if the assertion is done over a Python tuple, as we're doing with the Python lists using `assertListEqual` rather than `assertEqual`. **Additional context** If so, please let me know and I'll try to go over the tests and create a PR if applicable, otherwise, if you consider this should stay as `assertEqual` rather than `assertSequenceEqual` feel free to close this issue! Thanks 🤗
738
41
Update `unittest` assertions over tuples from `assertEqual` to `assertTupleEqual` **Is your feature request related to a problem? Please describe.** So this is more a readability improvement rather than a proposal, wouldn't it be better to use `assertTupleEqual` over the tuples rather than `assertEqual`? As `unittest` added that function in `v3.1`, as detailed at https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTupleEqual, so maybe it's worth updating. Find an example of an `assertEqual` over a tuple in 🤗 `datasets` unit tests over an `ArrowDataset` at https://github.com/huggingface/datasets/blob/0bb47271910c8a0b628dba157988372307fca1d2/tests/test_arrow_dataset.py#L570 **Describe the solution you'd like** Start slowly replacing all the `assertEqual` statements with `assertTupleEqual` if the assertion is done over a Python tuple, as we're doing with the Python lists using `assertListEqual` rather than `assertEqual`. **Additional context** If so, please let me know and I'll try to go over the tests and create a PR if applicable, otherwise, if you consider this should stay as `assertEqual` rather than `assertSequenceEqual` feel free to close this issue! Thanks 🤗 Hi! If the only goal is to improve readability, it's better to use `assertTupleEqual` than `assertSequenceEqual` for Python tuples. Also, note that this function is called internally by `assertEqual`, but I guess we can accept a PR to be more verbose.
[ -1.116553783416748, -0.9112460613250732, -0.8649086356163025, 1.4501208066940308, -0.19018885493278503, -1.2500250339508057, 0.19434139132499695, -1.0835415124893188, 1.7768430709838867, -0.7135490775108337, 0.33594778180122375, -1.6550893783569336, 0.054975397884845734, -0.6349916458129883, -0.8552742600440979, -0.7511624693870544, -0.40270212292671204, -0.9339082837104797, 0.9374333024024963, 2.4647157192230225, 1.186602234840393, -1.3621166944503784, 2.621493339538574, 0.6759606599807739, -0.2502754330635071, -1.0031344890594482, 0.40760552883148193, -0.11186935007572174, -1.144963026046753, -0.4861889183521271, -0.8135077953338623, -0.11213354766368866, -0.5291910767555237, -0.6746707558631897, -0.03714142367243767, 0.46153104305267334, -0.3454214632511139, -0.4798126816749573, -0.4080270826816559, -0.7678146362304688, 0.48039522767066956, -0.4138031005859375, 0.9556864500045776, -0.33734163641929626, 1.8242590427398682, -0.4791315793991089, 0.4392886161804199, 0.7184146642684937, 1.4155348539352417, 0.20420561730861664, -0.03408364951610565, 0.22580526769161224, 0.43790656328201294, -0.08327826857566833, 0.5078957676887512, 1.2801679372787476, 0.6610521674156189, 0.6311557292938232, 0.7571665644645691, -2.2461438179016113, 1.3482199907302856, -1.0891826152801514, 0.28237590193748474, 1.365828275680542, -0.862663984298706, 0.3971738815307617, -1.8947433233261108, 0.11284539103507996, 0.5081555247306824, -2.2047808170318604, 0.3018914461135864, -1.3088065385818481, -0.48212355375289917, 0.9751864075660706, 0.3009200096130371, -1.2982209920883179, 0.2459854632616043, -0.2424120455980301, 1.0260528326034546, 0.34427410364151, 1.0575270652770996, -1.760011076927185, -0.09851439297199249, -0.33954083919525146, 0.06789132952690125, -1.285659909248352, -1.5089731216430664, 0.5077656507492065, 0.6156566739082336, 0.584104061126709, -0.11488638073205948, 1.0708229541778564, -0.9476948380470276, 0.825307309627533, -0.9489248991012573, -1.694922924041748, -1.3185323476791382, -2.0857625007629395, -2.2532503604888916, 0.8072109818458557, -0.4944683611392975, -0.5154488682746887, 1.945369839668274, -0.9572848081588745, -1.8705003261566162, 1.148369550704956, 0.42678505182266235, -0.061324343085289, 2.3197412490844727, 0.21978166699409485, -0.6968001127243042, 0.3651048243045807, -0.6987700462341309, 0.8606269955635071, -0.49420037865638733, 1.4761137962341309, 0.5126278400421143, -1.0225982666015625, 1.6101844310760498, -0.414168119430542, 0.6295380592346191, -0.7919531464576721, -0.5158279538154602, -0.8796754479408264, 0.46163561940193176, 1.9432568550109863, -0.40563541650772095, 1.446536660194397, -0.41705742478370667, -1.5622751712799072, -1.514143705368042, 0.9868904948234558, 0.449603408575058, -0.8019556999206543, 0.13343369960784912, -0.4202783405780792, 0.149182990193367, -0.12644223868846893, 1.1383161544799805, 1.2158128023147583, 0.7296745777130127, -0.330166757106781, -0.9017419219017029, 0.2873857915401459, -0.05321548879146576, -0.7136995196342468, -1.85404372215271, -0.328993022441864, 0.15152345597743988, 0.5391907691955566, -1.133514642715454, 1.6876906156539917, 0.8236417174339294, 1.992537498474121, 1.0564069747924805, -0.3738292157649994, 1.5479687452316284, -0.04641582816839218, 1.9137935638427734, -0.503908634185791, 0.6493834257125854, -0.28913649916648865, -1.051706075668335, 0.9644860029220581, -0.29813629388809204, -2.08719801902771, -0.7394742965698242, -0.8827250599861145, -0.25485363602638245, -0.703421950340271, 0.8741007447242737, -0.26928722858428955, -1.4171617031097412, 0.2419358342885971, -0.6131568551063538, 0.18311668932437897, -1.2792277336120605, 0.41353994607925415, 0.7378771305084229, -0.6200487017631531, -0.007431079167872667, -0.18866637349128723, -1.2460291385650635, -0.5046139359474182, 0.26873934268951416, 1.9588782787322998, -0.6832267045974731, 0.8816573023796082, 1.0740286111831665, -0.807248592376709, -0.04126959294080734, 0.3620186150074005, -0.29400181770324707, 0.8619059920310974, -0.9938350915908813, -0.3671581447124481, 1.0855718851089478, -0.036006174981594086, -0.5903612375259399, 1.443007230758667, 0.748970091342926, -1.0870718955993652, -0.1064997985959053, -0.222299724817276, -0.8041901588439941, 0.12480690330266953, -1.5762020349502563, -0.07018489390611649, 0.404269278049469, -1.4975632429122925, -0.518292248249054, -0.22979195415973663, 1.3147618770599365, -0.21926769614219666, 1.4133360385894775, -0.299016535282135, -0.1782483458518982, -0.31772416830062866, -0.41318827867507935, 0.1567094624042511, -0.243555948138237, -0.6473277807235718, 0.1877543330192566, -0.6934922337532043, 0.4239499866962433, 1.3589240312576294, 0.26835551857948303, -0.04573502391576767, 0.4664081335067749, 1.11354660987854, 0.40415817499160767, 0.04140384495258331, -0.9022814631462097, -1.503361701965332, 2.0224997997283936, -1.476378321647644, 1.935028314590454, 0.8014453053474426, -0.035460375249385834, -1.6223570108413696, -1.918509602546692, 1.4712443351745605, 1.1635571718215942, 2.3423635959625244, 0.6781998872756958, 0.34933048486709595, -0.8052386045455933, -0.7272130250930786, 0.36939558386802673, -1.0612869262695312, -0.7440799474716187, 0.04943082481622696, 2.4072582721710205, 1.8037208318710327, -0.5512906312942505, -0.3075212240219116, -1.006517767906189, 1.39959716796875, -0.1748666763305664, 0.13726189732551575, 2.0828020572662354, -0.2748340964317322, -1.1140118837356567, 1.2758039236068726, -2.3192014694213867, 0.1719595342874527, 1.9379712343215942, 0.22711709141731262, 0.10876656323671341, -1.435846209526062, -0.5744473934173584, -0.16319815814495087, -0.4388238191604614, -1.2593467235565186, 0.5608960390090942, -0.2934207320213318, -0.7151548862457275, -1.5147664546966553, 0.2576979398727417, -1.0924526453018188, -1.5849272012710571, 0.2389414757490158, 1.9255459308624268, 1.9503594636917114, -0.6845527291297913, 1.558916449546814, -0.28501251339912415, 0.09682172536849976, 1.2983967065811157, 1.3228267431259155, 3.1770288944244385, 1.8084449768066406, -1.249793529510498, 0.5816707611083984, -0.19596046209335327, -0.6089386940002441, 1.1659035682678223, -1.1377931833267212, 1.2117453813552856, -0.1367858350276947, -1.0625569820404053, -1.3044378757476807, 0.8731987476348877, 0.5745458006858826, 0.18610729277133942, -0.44511526823043823, 1.1923832893371582, 0.1389479786157608, 1.2075797319412231, 0.4305399954319, -0.3644314706325531, 0.7028127312660217, -0.4123597741127014, -0.49371328949928284, 1.564271330833435, 0.3054199814796448, -1.2417678833007812, -2.301710367202759, -0.15720826387405396, -0.8627085089683533, 0.12587444484233856, -0.5245427489280701, -0.9504753351211548, 1.69039785861969, 0.42756378650665283, -1.3075164556503296, -0.2601630389690399, -0.3102547824382782, -0.5288996696472168, 2.6077566146850586, -1.4194353818893433, -0.17940877377986908, -1.0149494409561157, -0.6189634799957275, 1.6449400186538696, -1.2347888946533203, -0.24010629951953888, -0.9981321096420288, -0.6418520212173462, -1.2711025476455688, -0.5857418179512024, -0.07515830546617508, -0.8233320116996765, 0.8833619356155396, 0.20882469415664673, -1.2657463550567627, -0.3087860345840454, -0.9231687188148499, 0.8435752987861633, -0.15843428671360016, 0.32562050223350525, 1.8774569034576416, 0.4231163561344147, -0.37215927243232727, 0.6685658097267151, 1.1505144834518433, 0.5383656024932861, -0.6469573378562927, 0.40682387351989746, -0.5802355408668518, 0.34652137756347656, -1.3787410259246826, 0.35372719168663025, -2.883512496948242, 0.6534516215324402, -0.06414932012557983, -0.006027652882039547, -0.07199972122907639, -1.3515254259109497, 1.1905794143676758, 2.5970711708068848, -1.15749990940094, 0.45304855704307556, 0.30773240327835083, 1.3239126205444336, -1.5731711387634277, 0.3081059753894806, -0.34450507164001465, 2.190310478210449, 0.1318211555480957, 1.0998612642288208, -0.4474027752876282, -2.3187546730041504, 0.558956503868103, -1.2321282625198364, -1.1553319692611694, 0.6673113703727722, -0.7377182245254517, -0.11600476503372192, -1.4146413803100586, -0.29098522663116455, -0.9225838780403137, -1.1841580867767334, 0.8951785564422607, 0.1460425853729248, 0.37788018584251404, -0.662859320640564, 0.35455384850502014, -2.05380916595459, -1.4212828874588013, -0.2719975709915161, -0.9203832149505615, 0.4831475615501404, -0.2492181956768036, 0.6592159867286682, -0.1488846242427826, 0.036870405077934265, 0.35511958599090576, 1.4588686227798462, 3.287844181060791, 0.20064187049865723, 0.45974260568618774, -0.17918652296066284, -0.978783130645752, 1.405619740486145, 0.9386457800865173, -0.023427573963999748, -0.521223247051239, -1.0817785263061523, 1.2688467502593994, 1.959160566329956, 1.0699771642684937, 0.021862410008907318, -0.7756326198577881, -0.7441771626472473, -0.054749175906181335, 0.18188098073005676, 0.41555553674697876, 0.8904544115066528, 0.1559658646583557, 0.06248202174901962, 1.230533480644226, 1.1341049671173096, -0.5261277556419373, 0.40549370646476746, -0.7897643446922302, -0.39363646507263184, 0.4587179720401764, 0.26948437094688416, 0.08590974658727646, 0.23909127712249756, -0.9961622953414917, -0.23398062586784363, -0.2668180465698242, -0.9058417081832886, -0.8260282874107361, -0.5120851397514343, -0.3709162771701813, 1.622371792793274, 0.11175279319286346, -0.49665582180023193, -0.037411369383335114, -0.848210334777832, 0.005630983039736748, -1.082289457321167, 0.16256657242774963, -0.15261806547641754, -0.2062021642923355, -0.09966962039470673, 1.7202520370483398, -0.8770127892494202, -2.0087287425994873, 0.26186108589172363, 0.23360204696655273, -0.5018711090087891, 0.2982332706451416, 1.6909078359603882, 0.6052988171577454, 1.460160493850708, 1.2919279336929321, 1.1148746013641357, -0.7494741678237915, -1.3046793937683105, 0.7062413692474365, 0.9682995676994324, -1.4058079719543457, 0.745991051197052, 0.2856553792953491, -0.4063752293586731, 0.7267072796821594, 1.2821593284606934, 0.3698676824569702, -2.096158504486084, 0.6757510900497437, -0.9354794025421143, 0.7465960383415222, 0.6770992279052734, 0.7215102910995483, 0.26774007081985474, 0.8008258938789368, -1.1473170518875122, -1.2043287754058838, -0.7629496455192566, -0.6635566353797913, 1.90373694896698, -0.15603753924369812, 0.566990077495575, -0.1379544883966446, -1.376126766204834, -0.12396343797445297, 0.7274040579795837, 0.444303959608078, -0.5313591361045837, 0.6806051731109619, -0.7057817578315735, -1.0954701900482178, -1.3845072984695435, -0.5331899523735046, -1.0272637605667114, -0.9744423031806946, 0.9467607736587524, 0.898689329624176, 0.29104459285736084, 1.9398632049560547, 0.6692385077476501, 0.14574307203292847, -2.6604063510894775, 0.852627694606781, 0.38748839497566223, -0.1572604924440384, 0.9783165454864502, 0.3904796540737152, 0.9993415474891663, -0.03965507820248604, 0.5392618179321289, -2.4852283000946045, 2.239710569381714, -0.24313971400260925, 0.5936573147773743, 0.024490827694535255, -0.31557220220565796, 1.1370619535446167, 0.4450947046279907, 0.5166116952896118, -1.1612346172332764, 0.6931610107421875, -0.7327901124954224, 1.3338850736618042, 0.7942941784858704, -0.8018059134483337, -0.011359280906617641, 1.2950191497802734, 0.454357385635376, -0.5348836183547974, -0.8401892781257629, -1.0449460744857788, 0.9159466624259949, 1.6468056440353394, -0.11958985030651093, -0.043233923614025116, 0.8113623857498169, 0.6754926443099976, -1.2676838636398315, 0.22038938105106354, -0.7698528170585632, -0.8586134910583496, 1.6599301099777222, 2.0534985065460205, -0.21879641711711884, -0.245618537068367, -0.8555479645729065, -1.1871531009674072, 0.7570620775222778, 0.10821111500263214, 0.04899878799915314, 0.5954878926277161, -0.6254969835281372, 1.1195073127746582, 0.9437955021858215, 0.8777279853820801, 0.15056142210960388, 0.42422163486480713, 0.4445241689682007, -0.40605294704437256, -1.1298695802688599, -0.27492231130599976, -1.1446950435638428, -2.673992156982422, 0.5638546943664551, -0.2077314853668213, -1.4219756126403809, -0.08383681625127792, -1.0400863885879517, 0.8404242396354675, -0.5759108662605286, -1.141742467880249, -1.5464164018630981, 0.2604198157787323, -0.02557685226202011, 0.8772979974746704, -1.563504934310913, -0.023651324212551117, 1.2459622621536255, 0.8877712488174438, -0.704407274723053, 0.9001556634902954, 0.23074939846992493, 1.041168212890625, 0.9399119019508362, -0.38949641585350037, 0.5278971791267395, 0.05974194407463074, -1.3807002305984497, 0.4532945454120636, 1.2441880702972412, 0.17603644728660583, 1.416085124015808, -0.5619004368782043, 0.026452867314219475, 0.34135475754737854, -0.5260316133499146, -0.5003086924552917, -0.5825448036193848, 0.7065441608428955, 0.028745735064148903, -0.9161902070045471, 0.2691420912742615, -0.04625312238931656, -0.0632188469171524, 0.22849984467029572, -1.5565966367721558, -0.244083970785141, -0.2948046922683716, -0.5683579444885254, -1.2218058109283447, -0.10834770649671555, 1.4148622751235962, -0.6031538844108582, -0.2732856273651123, 0.5619320869445801, 0.42648372054100037, 0.49441245198249817, 0.605286717414856, -0.5474563241004944, -0.4353885054588318, -0.25476887822151184, -0.3983396887779236, 0.28724610805511475, 1.3719807863235474, -0.08073972165584564, -0.9105952382087708, 0.7505691647529602, -0.4795762002468109, -0.046021535992622375, 1.8362962007522583, 0.046283021569252014, -0.8363747596740723, 0.3015177547931671, -0.6138656139373779, 1.87257719039917, 1.7938803434371948, 1.2364165782928467, -0.05650804936885834, -0.9802755117416382, 0.6223555207252502, -0.3418309688568115, -0.45299598574638367, 1.0177593231201172, 0.4310796856880188, -0.24980595707893372, -1.335486650466919, 0.5654395818710327, 1.2893846035003662, -0.8618149757385254, -0.996934711933136, 0.04966060817241669, -0.8367288708686829, 1.0732216835021973, 0.6689571738243103, 0.40608328580856323, 0.2163534015417099, 1.5999367237091064, 0.7561724781990051, -0.42186787724494934, 0.6971821784973145, 0.45786431431770325, -0.22164489328861237, -2.059446334838867, -1.2201805114746094, 0.14303594827651978, -0.509425699710846, -1.6054612398147583, 1.3763148784637451, -1.1151732206344604, -1.0405266284942627, 0.5192001461982727, 0.1768244057893753, 1.5383893251419067, 0.31176936626434326, 1.5791857242584229, 2.0676605701446533, 0.7980261445045471, 0.3026898503303528, 1.299748420715332, -0.20768488943576813, -0.5631709694862366, 1.8816832304000854, -0.4781656861305237, 0.5356376767158508, 1.071646809577942, -0.2625659704208374, -1.0238332748413086, -0.8585503101348877, -1.2375861406326294, -0.8145512938499451, 1.252909779548645, 0.09387936443090439, -1.1526925563812256, 0.3447261452674866, 1.7072471380233765, 0.04751531779766083, -0.3464166224002838, 0.6472392678260803, 0.4599166512489319, -0.8677874207496643, -0.045038044452667236, -1.0029741525650024, 0.5051690936088562, -0.1432207226753235, -0.3070642352104187, 0.4242135286331177, 0.5184955596923828, 1.2504812479019165, -0.03985249251127243, 0.13704778254032135, 1.01376473903656, -1.4551887512207031, 1.560486912727356, -0.6408973932266235, 0.21695935726165771, -2.353731155395508, 1.4145405292510986, -0.7783644199371338, 1.9719653129577637, -2.583280563354492, 0.34534889459609985, -0.5813506245613098, -0.46633678674697876, 0.36466196179389954, -0.3876227140426636, 0.2271696776151657, -0.2397194802761078, -1.1105903387069702, -0.042764149606227875, -0.7123509049415588, 0.5998300909996033, 1.1314910650253296, 1.4704527854919434, -1.0921943187713623, -0.32391101121902466, -1.8312543630599976, -0.118233323097229, -0.5616087317466736, 0.31614789366722107, -1.9938008785247803, -0.26737427711486816, -1.9545586109161377, -2.211059093475342, -1.29888117313385, -0.9145292639732361, 0.9976195693016052, 0.08560550957918167, -0.762688934803009, 1.065826177597046, -0.3955472409725189, -1.9297916889190674, 1.031126618385315, -2.0028858184814453 ]
https://github.com/huggingface/datasets/issues/4419
Update `unittest` assertions over tuples from `assertEqual` to `assertTupleEqual`
Hi @mariosasko, right! I'll update the issue title/desc with `assertTupleEqual` even though as you said it seems to be internally using `assertEqual` so I'm not sure whether it's worth it or not... https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTupleEqual
**Is your feature request related to a problem? Please describe.** So this is more a readability improvement rather than a proposal, wouldn't it be better to use `assertTupleEqual` over the tuples rather than `assertEqual`? As `unittest` added that function in `v3.1`, as detailed at https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTupleEqual, so maybe it's worth updating. Find an example of an `assertEqual` over a tuple in 🤗 `datasets` unit tests over an `ArrowDataset` at https://github.com/huggingface/datasets/blob/0bb47271910c8a0b628dba157988372307fca1d2/tests/test_arrow_dataset.py#L570 **Describe the solution you'd like** Start slowly replacing all the `assertEqual` statements with `assertTupleEqual` if the assertion is done over a Python tuple, as we're doing with the Python lists using `assertListEqual` rather than `assertEqual`. **Additional context** If so, please let me know and I'll try to go over the tests and create a PR if applicable, otherwise, if you consider this should stay as `assertEqual` rather than `assertSequenceEqual` feel free to close this issue! Thanks 🤗
738
33
Update `unittest` assertions over tuples from `assertEqual` to `assertTupleEqual` **Is your feature request related to a problem? Please describe.** So this is more a readability improvement rather than a proposal, wouldn't it be better to use `assertTupleEqual` over the tuples rather than `assertEqual`? As `unittest` added that function in `v3.1`, as detailed at https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTupleEqual, so maybe it's worth updating. Find an example of an `assertEqual` over a tuple in 🤗 `datasets` unit tests over an `ArrowDataset` at https://github.com/huggingface/datasets/blob/0bb47271910c8a0b628dba157988372307fca1d2/tests/test_arrow_dataset.py#L570 **Describe the solution you'd like** Start slowly replacing all the `assertEqual` statements with `assertTupleEqual` if the assertion is done over a Python tuple, as we're doing with the Python lists using `assertListEqual` rather than `assertEqual`. **Additional context** If so, please let me know and I'll try to go over the tests and create a PR if applicable, otherwise, if you consider this should stay as `assertEqual` rather than `assertSequenceEqual` feel free to close this issue! Thanks 🤗 Hi @mariosasko, right! I'll update the issue title/desc with `assertTupleEqual` even though as you said it seems to be internally using `assertEqual` so I'm not sure whether it's worth it or not... https://docs.python.org/3/library/unittest.html#unittest.TestCase.assertTupleEqual
[ -1.0990315675735474, -0.9252920746803284, -0.8535957336425781, 1.449284315109253, -0.16768282651901245, -1.2486900091171265, 0.17654210329055786, -1.0496658086776733, 1.7606346607208252, -0.688676118850708, 0.28223827481269836, -1.6498762369155884, 0.04486681520938873, -0.5800726413726807, -0.8611416220664978, -0.7573111057281494, -0.38195058703422546, -0.9294954538345337, 0.9403051733970642, 2.4760708808898926, 1.1912763118743896, -1.3514389991760254, 2.6461684703826904, 0.6908279061317444, -0.20979122817516327, -1.0256983041763306, 0.3995276987552643, -0.10557594150304794, -1.1975899934768677, -0.479322612285614, -0.8295366764068604, -0.094670370221138, -0.5400277972221375, -0.6713746786117554, -0.011542296968400478, 0.4723207652568817, -0.31093302369117737, -0.4596714973449707, -0.43943846225738525, -0.742652177810669, 0.4745069146156311, -0.40199634432792664, 0.9439333081245422, -0.33424943685531616, 1.8134000301361084, -0.4830302894115448, 0.4502992331981659, 0.7159560918807983, 1.3928704261779785, 0.20493394136428833, -0.049479611217975616, 0.23083467781543732, 0.45391494035720825, -0.030309181660413742, 0.5071493983268738, 1.294346809387207, 0.681331992149353, 0.6154853105545044, 0.7495326995849609, -2.2379307746887207, 1.347855806350708, -1.0707694292068481, 0.29992303252220154, 1.3622899055480957, -0.8632317781448364, 0.35629206895828247, -1.9195671081542969, 0.09807708114385605, 0.5030231475830078, -2.203026533126831, 0.2905970811843872, -1.3404698371887207, -0.44600704312324524, 0.9970641136169434, 0.29787933826446533, -1.2739100456237793, 0.23236055672168732, -0.25666695833206177, 1.0612280368804932, 0.3766055107116699, 1.0621694326400757, -1.7709834575653076, -0.1426740139722824, -0.29566457867622375, 0.06212165951728821, -1.263350486755371, -1.5423598289489746, 0.4948294162750244, 0.615295946598053, 0.6031527519226074, -0.12641917169094086, 1.0424389839172363, -0.9605380296707153, 0.8356285095214844, -0.9319856762886047, -1.7070014476776123, -1.3116042613983154, -2.108872652053833, -2.2808401584625244, 0.8053709268569946, -0.4958609342575073, -0.48107361793518066, 1.94712495803833, -0.9552451968193054, -1.8835738897323608, 1.1270525455474854, 0.41504761576652527, -0.023320775479078293, 2.3073978424072266, 0.23006364703178406, -0.7214310765266418, 0.366099089384079, -0.7024217247962952, 0.8487966060638428, -0.4731551706790924, 1.4819151163101196, 0.5159730911254883, -0.9750285744667053, 1.6281664371490479, -0.412512868642807, 0.6277217864990234, -0.7876014709472656, -0.5054929852485657, -0.8661233186721802, 0.43716081976890564, 1.968508005142212, -0.4183978736400604, 1.4439862966537476, -0.4065690338611603, -1.601987361907959, -1.5003430843353271, 0.9531159996986389, 0.45494958758354187, -0.8090115785598755, 0.0773627758026123, -0.43491366505622864, 0.16305410861968994, -0.1148948073387146, 1.142208218574524, 1.2188175916671753, 0.7632694244384766, -0.35484829545021057, -0.8987201452255249, 0.27591392397880554, -0.053425468504428864, -0.712853729724884, -1.8529752492904663, -0.32418495416641235, 0.1582757532596588, 0.5659258961677551, -1.1432799100875854, 1.702000617980957, 0.8144425749778748, 2.0080044269561768, 1.0409390926361084, -0.3700723350048065, 1.5483489036560059, -0.040351398289203644, 1.91576087474823, -0.5196233987808228, 0.633189857006073, -0.27938905358314514, -1.024357557296753, 0.9396744966506958, -0.27390649914741516, -2.055359363555908, -0.7128086090087891, -0.9048242568969727, -0.2437339574098587, -0.6987431049346924, 0.8561318516731262, -0.26645660400390625, -1.4054781198501587, 0.2268565148115158, -0.6269445419311523, 0.17562170326709747, -1.2733012437820435, 0.36693549156188965, 0.7485838532447815, -0.645811140537262, 0.009961763396859169, -0.16605429351329803, -1.2962045669555664, -0.5461078882217407, 0.29281631112098694, 1.9692014455795288, -0.6736576557159424, 0.8692959547042847, 1.080485463142395, -0.8214681148529053, 0.0009844619780778885, 0.39762893319129944, -0.30094772577285767, 0.8398385047912598, -1.0255869626998901, -0.3436085283756256, 1.0739223957061768, -0.07755875587463379, -0.6032476425170898, 1.4291555881500244, 0.7726477980613708, -1.0987794399261475, -0.1191004067659378, -0.23236556351184845, -0.809967041015625, 0.11618669331073761, -1.6109429597854614, -0.101836197078228, 0.38514837622642517, -1.5110143423080444, -0.545606791973114, -0.24391071498394012, 1.3440897464752197, -0.1965424120426178, 1.412157416343689, -0.292879194021225, -0.15585333108901978, -0.3150450885295868, -0.426710307598114, 0.16466720402240753, -0.28202691674232483, -0.6256574988365173, 0.20068004727363586, -0.7428042888641357, 0.39118292927742004, 1.3997092247009277, 0.28064608573913574, -0.06577109545469284, 0.4743856191635132, 1.1141142845153809, 0.39895033836364746, -0.00011383276432752609, -0.8881243467330933, -1.5144208669662476, 2.0252439975738525, -1.463955283164978, 1.9158490896224976, 0.7717213034629822, -0.050949208438396454, -1.6338505744934082, -1.9386179447174072, 1.4541301727294922, 1.1468350887298584, 2.366245746612549, 0.6822275519371033, 0.3774785101413727, -0.7953994870185852, -0.7405765652656555, 0.3680986762046814, -1.0287848711013794, -0.7646877765655518, 0.0590587854385376, 2.3962318897247314, 1.7999391555786133, -0.5685653686523438, -0.28786543011665344, -0.9861265420913696, 1.3917632102966309, -0.18029797077178955, 0.16256234049797058, 2.0738883018493652, -0.2514490783214569, -1.1013891696929932, 1.2738730907440186, -2.2947275638580322, 0.1957339346408844, 1.9510776996612549, 0.2183905392885208, 0.14380690455436707, -1.4670536518096924, -0.6210398077964783, -0.18337541818618774, -0.4378717839717865, -1.266959309577942, 0.5548631548881531, -0.3235566020011902, -0.7722132205963135, -1.5025709867477417, 0.24051205813884735, -1.0667997598648071, -1.6360552310943604, 0.2642827332019806, 1.9547349214553833, 1.9265499114990234, -0.6855941414833069, 1.5534576177597046, -0.2715483605861664, 0.0851837769150734, 1.2948564291000366, 1.3305307626724243, 3.1813268661499023, 1.8358341455459595, -1.2278552055358887, 0.6409428715705872, -0.1891646832227707, -0.5859301090240479, 1.142543077468872, -1.1281827688217163, 1.1534498929977417, -0.14289015531539917, -1.0665366649627686, -1.2772471904754639, 0.88807213306427, 0.5730633735656738, 0.15294288098812103, -0.4269888997077942, 1.1968891620635986, 0.10338954627513885, 1.2154737710952759, 0.44792890548706055, -0.4050811231136322, 0.6838921904563904, -0.4061536490917206, -0.5068172216415405, 1.5519696474075317, 0.29693886637687683, -1.2827014923095703, -2.305309534072876, -0.1813102662563324, -0.8622614145278931, 0.10267756134271622, -0.5165468454360962, -0.9588593244552612, 1.6713197231292725, 0.4642738401889801, -1.2838115692138672, -0.26079580187797546, -0.33675408363342285, -0.50560462474823, 2.598271369934082, -1.3800383806228638, -0.1715598702430725, -1.0034197568893433, -0.5956557989120483, 1.6505039930343628, -1.2173322439193726, -0.2703738808631897, -1.006659984588623, -0.6693022847175598, -1.2804241180419922, -0.6111727356910706, -0.05039173364639282, -0.794761598110199, 0.8540828227996826, 0.18909089267253876, -1.2490068674087524, -0.2811405062675476, -0.9345794320106506, 0.8411393761634827, -0.12693701684474945, 0.302621990442276, 1.898838996887207, 0.39474737644195557, -0.3893662393093109, 0.6348704695701599, 1.1254280805587769, 0.5473297834396362, -0.6246313452720642, 0.3864959478378296, -0.5795626044273376, 0.33809736371040344, -1.3901225328445435, 0.3406912386417389, -2.9106314182281494, 0.6893971562385559, -0.08967705070972443, 0.006729792803525925, -0.08112085610628128, -1.3714303970336914, 1.1913882493972778, 2.5960705280303955, -1.1809957027435303, 0.47329527139663696, 0.33492511510849, 1.3199899196624756, -1.5509427785873413, 0.313289076089859, -0.3477679491043091, 2.1859350204467773, 0.1490374654531479, 1.1015676259994507, -0.4421130418777466, -2.2843053340911865, 0.5714218616485596, -1.224359154701233, -1.1283092498779297, 0.6642379760742188, -0.7496554851531982, -0.08194603025913239, -1.4120712280273438, -0.2691553831100464, -0.9022774696350098, -1.203289270401001, 0.8935113549232483, 0.14650222659111023, 0.3614424765110016, -0.6450110673904419, 0.3498188853263855, -2.0363283157348633, -1.3904162645339966, -0.2733735740184784, -0.9364016652107239, 0.47329288721084595, -0.2561345398426056, 0.663471519947052, -0.14644674956798553, 0.0347004234790802, 0.3506462574005127, 1.4384143352508545, 3.2906124591827393, 0.1839030683040619, 0.421683132648468, -0.17047910392284393, -0.9927670359611511, 1.4026895761489868, 0.970116376876831, -0.0640547126531601, -0.5294461250305176, -1.0763059854507446, 1.258560299873352, 1.992634892463684, 1.080885648727417, 0.030944285914301872, -0.7799738645553589, -0.7420028448104858, -0.007980269379913807, 0.17730019986629486, 0.45285969972610474, 0.9085736870765686, 0.16729208827018738, 0.019235892221331596, 1.2495790719985962, 1.1479357481002808, -0.5123389959335327, 0.4235458970069885, -0.8197505474090576, -0.378418892621994, 0.43232327699661255, 0.2603384256362915, 0.0903073325753212, 0.21662549674510956, -1.0257431268692017, -0.2190001755952835, -0.2535848617553711, -0.8996803164482117, -0.8309059739112854, -0.5106759667396545, -0.3430517911911011, 1.61281156539917, 0.1359664350748062, -0.507771909236908, -0.028885453939437866, -0.8528233766555786, 0.006026968359947205, -1.0746897459030151, 0.2032327651977539, -0.18030425906181335, -0.15858975052833557, -0.10869458317756653, 1.709740400314331, -0.8582254648208618, -2.028085470199585, 0.2658279538154602, 0.24951304495334625, -0.5166411399841309, 0.30552154779434204, 1.7112666368484497, 0.6102936863899231, 1.436413288116455, 1.3005720376968384, 1.0914212465286255, -0.7384418249130249, -1.2924860715866089, 0.7086791396141052, 0.954752504825592, -1.4162112474441528, 0.7224687933921814, 0.2497149556875229, -0.39414528012275696, 0.7380831241607666, 1.2970725297927856, 0.33972376585006714, -2.0872554779052734, 0.7232909202575684, -0.9114884734153748, 0.7238280177116394, 0.6712871789932251, 0.7334555387496948, 0.2434997707605362, 0.8111690878868103, -1.145404577255249, -1.1721501350402832, -0.7734488248825073, -0.6487016081809998, 1.8764575719833374, -0.13041101396083832, 0.5191506743431091, -0.12199070304632187, -1.3710992336273193, -0.13458962738513947, 0.718756377696991, 0.44023212790489197, -0.5372254252433777, 0.7187747955322266, -0.654170036315918, -1.0797529220581055, -1.3595901727676392, -0.5506536364555359, -1.0217761993408203, -0.9779161214828491, 0.909382700920105, 0.8670162558555603, 0.32896578311920166, 1.9105024337768555, 0.6616265773773193, 0.16192206740379333, -2.6684694290161133, 0.8768702149391174, 0.4010324776172638, -0.14857420325279236, 0.9968838691711426, 0.37897804379463196, 1.0225087404251099, -0.07180095463991165, 0.5442076921463013, -2.449939250946045, 2.232776165008545, -0.2585617005825043, 0.6036697030067444, 0.03571499139070511, -0.31408441066741943, 1.1304086446762085, 0.4734901487827301, 0.5272445678710938, -1.1572996377944946, 0.7003986835479736, -0.745118260383606, 1.303004503250122, 0.7696523070335388, -0.8073787689208984, -0.03011023811995983, 1.2846609354019165, 0.449424684047699, -0.5095479488372803, -0.8484164476394653, -1.0316444635391235, 0.9184130430221558, 1.6322039365768433, -0.1323569118976593, -0.03227178379893303, 0.8314564824104309, 0.6467365622520447, -1.2518157958984375, 0.18787598609924316, -0.770210325717926, -0.8186842203140259, 1.6921989917755127, 2.04716420173645, -0.18356545269489288, -0.26204603910446167, -0.8631860017776489, -1.2079418897628784, 0.7142191529273987, 0.07142062485218048, 0.03675394505262375, 0.6142981648445129, -0.6185147166252136, 1.1232504844665527, 0.9000521898269653, 0.8912572860717773, 0.10183459520339966, 0.42450106143951416, 0.42917248606681824, -0.4228435754776001, -1.1766434907913208, -0.32076799869537354, -1.1538641452789307, -2.637824296951294, 0.5859696269035339, -0.16882039606571198, -1.4479095935821533, -0.057836681604385376, -1.0388513803482056, 0.8388000726699829, -0.5519044995307922, -1.1537446975708008, -1.523887038230896, 0.2811523377895355, -0.08594866842031479, 0.8703914284706116, -1.5545462369918823, -0.03858461230993271, 1.2876192331314087, 0.8776335716247559, -0.6922570466995239, 0.9226360321044922, 0.2477404624223709, 1.0788933038711548, 0.9236990809440613, -0.38689538836479187, 0.5222615003585815, 0.06316930055618286, -1.3698680400848389, 0.45751655101776123, 1.2468029260635376, 0.18289995193481445, 1.420519471168518, -0.5953095555305481, 0.06537795066833496, 0.35677629709243774, -0.5579858422279358, -0.5352552533149719, -0.5557869672775269, 0.7364057302474976, 0.005526399239897728, -0.9452700018882751, 0.2578216791152954, -0.07579288631677628, -0.039326488971710205, 0.21265465021133423, -1.5806573629379272, -0.26950013637542725, -0.2768861651420593, -0.5544730424880981, -1.214512586593628, -0.09189379960298538, 1.4038587808609009, -0.6497525572776794, -0.30046793818473816, 0.5842276811599731, 0.4317897856235504, 0.5082309246063232, 0.6027563214302063, -0.5555505156517029, -0.4059962034225464, -0.26558512449264526, -0.43123742938041687, 0.2665322721004486, 1.383280873298645, -0.04768684506416321, -0.9078694581985474, 0.7644052505493164, -0.4864261746406555, -0.04361432045698166, 1.8323866128921509, 0.021470194682478905, -0.8470501899719238, 0.28418511152267456, -0.6180335879325867, 1.879265546798706, 1.7937461137771606, 1.2311155796051025, -0.08868510276079178, -0.9654065370559692, 0.5980399250984192, -0.34103238582611084, -0.46705594658851624, 0.9761233329772949, 0.46584081649780273, -0.2456175833940506, -1.302966833114624, 0.5415050387382507, 1.2583404779434204, -0.8694104552268982, -0.979763388633728, 0.056309737265110016, -0.847353994846344, 1.0863659381866455, 0.7075801491737366, 0.39204078912734985, 0.2059132605791092, 1.606580376625061, 0.7593380808830261, -0.4432401657104492, 0.6617396473884583, 0.48295140266418457, -0.21999341249465942, -2.0676679611206055, -1.1991733312606812, 0.1538109928369522, -0.5114036202430725, -1.6138050556182861, 1.3616976737976074, -1.0977004766464233, -1.0208402872085571, 0.5291590690612793, 0.21823276579380035, 1.508118987083435, 0.31609413027763367, 1.62942373752594, 2.0524957180023193, 0.796733558177948, 0.31528258323669434, 1.3240065574645996, -0.1588367521762848, -0.5749968886375427, 1.87362539768219, -0.47906187176704407, 0.5733013153076172, 1.0844745635986328, -0.2934515178203583, -1.0109786987304688, -0.8593111038208008, -1.2253239154815674, -0.7832136750221252, 1.233867883682251, 0.08554566651582718, -1.172513484954834, 0.3192461431026459, 1.6912610530853271, 0.07635391503572464, -0.3694697618484497, 0.6660104990005493, 0.42092669010162354, -0.8234335780143738, -0.040678516030311584, -0.9975930452346802, 0.5100611448287964, -0.15113118290901184, -0.3505656123161316, 0.4124109447002411, 0.49061307311058044, 1.259020209312439, -0.013672255910933018, 0.1574125587940216, 1.0441811084747314, -1.4195992946624756, 1.565312147140503, -0.6551719307899475, 0.2568213939666748, -2.373422145843506, 1.4233856201171875, -0.8055483102798462, 1.9617589712142944, -2.5722923278808594, 0.32422831654548645, -0.5579168796539307, -0.4636431634426117, 0.32515013217926025, -0.3771516978740692, 0.21674494445323944, -0.19319194555282593, -1.1100800037384033, -0.05522094666957855, -0.7174023389816284, 0.624014675617218, 1.1494661569595337, 1.4839377403259277, -1.0870126485824585, -0.31010180711746216, -1.8499046564102173, -0.12388713657855988, -0.5756981372833252, 0.35239720344543457, -1.9767694473266602, -0.2681125998497009, -1.9309308528900146, -2.2291033267974854, -1.3355003595352173, -0.9146102070808411, 1.0029361248016357, 0.10055039823055267, -0.7720085978507996, 1.0786510705947876, -0.38975217938423157, -1.9212721586227417, 0.9996414184570312, -2.0498275756835938 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
Hi ! As mentioned on the [forum](https://discuss.huggingface.co/t/how-to-wrap-a-generator-with-hf-dataset/18464), the simplest for now would be to define a [dataset script](https://huggingface.co/docs/datasets/dataset_script) which can contain your generator. But we can also explore adding something like `ds = Dataset.from_iterable(seqio_dataset)`
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
34
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ Hi ! As mentioned on the [forum](https://discuss.huggingface.co/t/how-to-wrap-a-generator-with-hf-dataset/18464), the simplest for now would be to define a [dataset script](https://huggingface.co/docs/datasets/dataset_script) which can contain your generator. But we can also explore adding something like `ds = Dataset.from_iterable(seqio_dataset)`
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
@lhoestq , hey i did as you instructed, but sadly i cannot get pass through the download_manager, as i dont have anything to download. i was skipping the ` def _split_generators(self, dl_manager):` function. but i cannot get around it. I get a `NotImplementedError: ` the following is my code for the same: ``` import datasets import functools import glob from datasets import load_from_disk import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry data_path = glob.glob("/home/stephen/Desktop/MEGA_CORPUS/COMBINED_CORPUS/*", recursive=False) def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_path=None): dataset = load_from_disk(dataset_path) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_path=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_path=dataset_path), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_path) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} _CITATION = "Not ready yet" _DESCRIPTION = "a custom seqio based mixed samples on a given temperature value, that again returns a dataset in HF dataset format well samples on the Mixture temperature" _HOMEPAGE = "ldcil.org" class CustomSeqio(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "text": datasets.Value("string"), } ), homepage="https://ldcil.org", citation=_CITATION,) def generate_examples(self): seqio_train_list = [] for lang in data_path: dataset_name = lang.split("/")[-1] dataset_shapes = None TaskRegistry.add( str(dataset_name), source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_path=lang), splits=("train", "test"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) seqio_train_dataset = seqio.get_mixture_or_task(dataset_name).get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) seqio_train_list.append(seqio_train_dataset) lang_name_list = [] for lang in data_path: lang_name = lang.split("/")[-1] lang_name_list.append(lang_name) seqio_mixture = seqio.MixtureRegistry.add( "seqio_mixture", lang_name_list, default_rate=0.7) seqio_mixture_dataset = seqio.get_mixture_or_task("seqio_mixture").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) for id, ex in enumerate(seqio_mixture_dataset): yield id, {"text": ex["targets"].numpy().decode()} ``` and i load it by: `seqio_mixture = load_dataset("seqio_loader")`
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
311
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ @lhoestq , hey i did as you instructed, but sadly i cannot get pass through the download_manager, as i dont have anything to download. i was skipping the ` def _split_generators(self, dl_manager):` function. but i cannot get around it. I get a `NotImplementedError: ` the following is my code for the same: ``` import datasets import functools import glob from datasets import load_from_disk import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry data_path = glob.glob("/home/stephen/Desktop/MEGA_CORPUS/COMBINED_CORPUS/*", recursive=False) def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_path=None): dataset = load_from_disk(dataset_path) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_path=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_path=dataset_path), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_path) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} _CITATION = "Not ready yet" _DESCRIPTION = "a custom seqio based mixed samples on a given temperature value, that again returns a dataset in HF dataset format well samples on the Mixture temperature" _HOMEPAGE = "ldcil.org" class CustomSeqio(datasets.GeneratorBasedBuilder): def _info(self): return datasets.DatasetInfo( description=_DESCRIPTION, features=datasets.Features( { "text": datasets.Value("string"), } ), homepage="https://ldcil.org", citation=_CITATION,) def generate_examples(self): seqio_train_list = [] for lang in data_path: dataset_name = lang.split("/")[-1] dataset_shapes = None TaskRegistry.add( str(dataset_name), source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_path=lang), splits=("train", "test"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) seqio_train_dataset = seqio.get_mixture_or_task(dataset_name).get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) seqio_train_list.append(seqio_train_dataset) lang_name_list = [] for lang in data_path: lang_name = lang.split("/")[-1] lang_name_list.append(lang_name) seqio_mixture = seqio.MixtureRegistry.add( "seqio_mixture", lang_name_list, default_rate=0.7) seqio_mixture_dataset = seqio.get_mixture_or_task("seqio_mixture").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) for id, ex in enumerate(seqio_mixture_dataset): yield id, {"text": ex["targets"].numpy().decode()} ``` and i load it by: `seqio_mixture = load_dataset("seqio_loader")`
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
@lhoestq , just to make things clear ... the following is my original code, thats not in the HF dataset loading script: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_from_disk from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils import glob TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_path=None): dataset = load_from_disk(dataset_path) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_path=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_path=dataset_path), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_path) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} data_path = glob.glob("/home/stephen/Desktop/MEGA_CORPUS/COMBINED_CORPUS/*", recursive=False) seqio_train_list = [] for lang in data_path: dataset_name = lang.split("/")[-1] dataset_shapes = None TaskRegistry.add( str(dataset_name), source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_path=lang), splits=("train", "test"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) seqio_train_dataset = seqio.get_mixture_or_task(dataset_name).get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) seqio_train_list.append(seqio_train_dataset) lang_name_list = [] for lang in data_path: lang_name = lang.split("/")[-1] lang_name_list.append(lang_name) seqio_mixture = seqio.MixtureRegistry.add( "seqio_mixture", lang_name_list, default_rate=0.7 ) seqio_mixture_dataset = seqio.get_mixture_or_task("seqio_mixture").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) for _, ex in zip(range(15), seqio_mixture_dataset): print(ex["targets"].numpy().decode()) ``` where the seqio_mixture_dataset is the generator that i wanted to be wrapped in HF dataset. also additionally, could you please tell me how do i set the `default_rate=0.7` args where `seqio_mixture` is defined to be made as a custom option in the HF load_dataset() method, maybe like this: `seqio_mixture_dataset = datasets.load_dataset("seqio_loader",temperature=0.5)`
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
264
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ @lhoestq , just to make things clear ... the following is my original code, thats not in the HF dataset loading script: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_from_disk from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils import glob TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_path=None): dataset = load_from_disk(dataset_path) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_path=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_path=dataset_path), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_path) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} data_path = glob.glob("/home/stephen/Desktop/MEGA_CORPUS/COMBINED_CORPUS/*", recursive=False) seqio_train_list = [] for lang in data_path: dataset_name = lang.split("/")[-1] dataset_shapes = None TaskRegistry.add( str(dataset_name), source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_path=lang), splits=("train", "test"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) seqio_train_dataset = seqio.get_mixture_or_task(dataset_name).get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) seqio_train_list.append(seqio_train_dataset) lang_name_list = [] for lang in data_path: lang_name = lang.split("/")[-1] lang_name_list.append(lang_name) seqio_mixture = seqio.MixtureRegistry.add( "seqio_mixture", lang_name_list, default_rate=0.7 ) seqio_mixture_dataset = seqio.get_mixture_or_task("seqio_mixture").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42) for _, ex in zip(range(15), seqio_mixture_dataset): print(ex["targets"].numpy().decode()) ``` where the seqio_mixture_dataset is the generator that i wanted to be wrapped in HF dataset. also additionally, could you please tell me how do i set the `default_rate=0.7` args where `seqio_mixture` is defined to be made as a custom option in the HF load_dataset() method, maybe like this: `seqio_mixture_dataset = datasets.load_dataset("seqio_loader",temperature=0.5)`
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
I like the idea of having `Dataset.from_iterable(iterable)` in the API. The only problem is that we also want to make this part cachable, which is tricky if `iterable` is a generator. Some resources on this issue: * https://github.com/uqfoundation/dill/issues/311 * https://stackoverflow.com/questions/7180212/why-cant-generators-be-pickled * https://github.com/tonyroberts/generator_tools - python package for pickling generators; pickles bytecode, so it creates version-specific dumps
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
55
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ I like the idea of having `Dataset.from_iterable(iterable)` in the API. The only problem is that we also want to make this part cachable, which is tricky if `iterable` is a generator. Some resources on this issue: * https://github.com/uqfoundation/dill/issues/311 * https://stackoverflow.com/questions/7180212/why-cant-generators-be-pickled * https://github.com/tonyroberts/generator_tools - python package for pickling generators; pickles bytecode, so it creates version-specific dumps
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
For the caching maybe we can have `Dataset.from_generator` as TF and pickle+hash the generator function (not the generator object itself) ? And then keep `Dataset.from_iterable` fo pickable objects like lists
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
30
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ For the caching maybe we can have `Dataset.from_generator` as TF and pickle+hash the generator function (not the generator object itself) ? And then keep `Dataset.from_iterable` fo pickable objects like lists
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
@lhoestq, @mariosasko do you too have any examples where the dataset is a generator and needs to be wrapped into hf dataset ?
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
23
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ @lhoestq, @mariosasko do you too have any examples where the dataset is a generator and needs to be wrapped into hf dataset ?
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
@lhoestq, following to my previous question ... what possibly could be done in this [link1](https://github.com/huggingface/datasets/issues/4417#issuecomment-1146627404) [link2](https://github.com/huggingface/datasets/issues/4417#issuecomment-1146627593) case? do you have any ideas?
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
22
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ @lhoestq, following to my previous question ... what possibly could be done in this [link1](https://github.com/huggingface/datasets/issues/4417#issuecomment-1146627404) [link2](https://github.com/huggingface/datasets/issues/4417#issuecomment-1146627593) case? do you have any ideas?
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
@lhoestq +1 for the `Dataset.from_generator` idea. Having thought about it, let's avoid adding `Dataset.from_iterable` to the API since dictionaries are technically iteralbles ("iterable" is a broad term in Python), and we already provide `Dataset.from_dict`. And for lists maybe we can add `Dataset.from_list` similar to `pa.Table.from_pylist`. WDYT?
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
46
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ @lhoestq +1 for the `Dataset.from_generator` idea. Having thought about it, let's avoid adding `Dataset.from_iterable` to the API since dictionaries are technically iteralbles ("iterable" is a broad term in Python), and we already provide `Dataset.from_dict`. And for lists maybe we can add `Dataset.from_list` similar to `pa.Table.from_pylist`. WDYT?
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
Hi @StephennFernandes! To fix the issues in the copied code, rename `generate_examples` to` _generate_examples` and add one level of indentation as this is a method of `GeneratorBasedBuilder` and define `_split_generators` as follows (again as a method of `GeneratorBasedBuilder): ```python def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={}, ), ] ``` And if you are feeling extra adventurous, you can try to use ArrowWriter to directly create a cache file: ```python from datasets import Dataset from datasets.arrow_writer import ArrowWriter writer = ArrowWriter(path="path/to/cache_file.arrow", writer_batch_size=1000) with writer: for ex in generator: writer.write(ex) writer.finalize() dset = Dataset.from_file("path/to/cache_file.arrow") ```
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
94
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ Hi @StephennFernandes! To fix the issues in the copied code, rename `generate_examples` to` _generate_examples` and add one level of indentation as this is a method of `GeneratorBasedBuilder` and define `_split_generators` as follows (again as a method of `GeneratorBasedBuilder): ```python def _split_generators(self, dl_manager): return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={}, ), ] ``` And if you are feeling extra adventurous, you can try to use ArrowWriter to directly create a cache file: ```python from datasets import Dataset from datasets.arrow_writer import ArrowWriter writer = ArrowWriter(path="path/to/cache_file.arrow", writer_batch_size=1000) with writer: for ex in generator: writer.write(ex) writer.finalize() dset = Dataset.from_file("path/to/cache_file.arrow") ```
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
I have a problem which I think is very similar: I would like to "stream" data to a HF Array (memory-mapped) Dataset, where the final size of the dataset is unknown, but could be much larger than what fits into memory. What I want to end up with is an Array Dataset which I can open using `Dataset.load_from_disk(dataset_path="somename")` and use e.g. as the training set. For this I would have thought there should be an API which allows me to open/create the dataset (and define the features etc), then write examples to the dataset, but I could not find a way to do this. I tried doing this and it looks like it works, but it feels very hacky and I am not sure if this might fail to update some of the fields in the json files which may turn out to be important: ``` from datasets import Dataset, Features, ClassLabel, Sequence, Value from datasets.arrow_writer import ArrowWriter # 1) define the features features = Features(dict( id=Value(dtype="string"), tokens=Sequence(feature=Value(dtype="string")), ner_tags=Sequence(feature=ClassLabel(names=['O', 'B-corporation', 'I-corporation', 'B-creative-work', 'I-creative-work', 'B-group', 'I-group', 'B-location', 'I-location', 'B-person', 'I-person', 'B-product', 'I-product'])), )) # 2) create empty dataset for examples with these features and store to disk empty = dict( id = [], tokens = [], ner_tags = [], ) ds = Dataset.from_dict(empty, features=features) ds.save_to_disk(dataset_path="debug_ds1") # 3) directly write all the examples to the arrow dataset with ArrowWriter(path="debug_ds1/dataset.arrow") as writer: writer.write(dict(id=0, tokens=["a", "b"], ner_tags=[0, 0])) writer.write(dict(id=1, tokens=["x", "y"], ner_tags=[1, 0])) writer.finalize() ds2 = Dataset.load_from_disk(dataset_path="debug_ds1") len(ds2) ``` Is there a cleaner/proper way to do this? I like the sound of `Dataset.from_iterable` or `Dataset.from_generator` (should not from iterable be able to handle from generator too as all generators are iterables?) but how would I define the features for me examples there?
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
288
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ I have a problem which I think is very similar: I would like to "stream" data to a HF Array (memory-mapped) Dataset, where the final size of the dataset is unknown, but could be much larger than what fits into memory. What I want to end up with is an Array Dataset which I can open using `Dataset.load_from_disk(dataset_path="somename")` and use e.g. as the training set. For this I would have thought there should be an API which allows me to open/create the dataset (and define the features etc), then write examples to the dataset, but I could not find a way to do this. I tried doing this and it looks like it works, but it feels very hacky and I am not sure if this might fail to update some of the fields in the json files which may turn out to be important: ``` from datasets import Dataset, Features, ClassLabel, Sequence, Value from datasets.arrow_writer import ArrowWriter # 1) define the features features = Features(dict( id=Value(dtype="string"), tokens=Sequence(feature=Value(dtype="string")), ner_tags=Sequence(feature=ClassLabel(names=['O', 'B-corporation', 'I-corporation', 'B-creative-work', 'I-creative-work', 'B-group', 'I-group', 'B-location', 'I-location', 'B-person', 'I-person', 'B-product', 'I-product'])), )) # 2) create empty dataset for examples with these features and store to disk empty = dict( id = [], tokens = [], ner_tags = [], ) ds = Dataset.from_dict(empty, features=features) ds.save_to_disk(dataset_path="debug_ds1") # 3) directly write all the examples to the arrow dataset with ArrowWriter(path="debug_ds1/dataset.arrow") as writer: writer.write(dict(id=0, tokens=["a", "b"], ner_tags=[0, 0])) writer.write(dict(id=1, tokens=["x", "y"], ner_tags=[1, 0])) writer.finalize() ds2 = Dataset.load_from_disk(dataset_path="debug_ds1") len(ds2) ``` Is there a cleaner/proper way to do this? I like the sound of `Dataset.from_iterable` or `Dataset.from_generator` (should not from iterable be able to handle from generator too as all generators are iterables?) but how would I define the features for me examples there?
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
Hi @johann-petrak! You can pass the features directly to ArrowWriter's initializer like so `ArrowWriter(..., features=features)`. And the reason why I prefer `Dataset.from_generator` over `Dataset.from_iterable` is mentioned in one of my previous comments.
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
32
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ Hi @johann-petrak! You can pass the features directly to ArrowWriter's initializer like so `ArrowWriter(..., features=features)`. And the reason why I prefer `Dataset.from_generator` over `Dataset.from_iterable` is mentioned in one of my previous comments.
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
@mariosasko so at the moment we still have to create a fake `Dataset` first and then use `ArrowWriter` to write an actual dataset? I'm using the latest version of `datasets` on pypi but my final file is always empty. Is there anything wrong with the code below? ```python total = 0 with ArrowWriter(path=str(final_data_path), features=features) as writer: for batch in loader: for traj in batch: for generator in question_generators: for xi in generator(traj): # print(f"Question: {xi.question}, answer: {xi.answer}") total += 1 writer.write( { "id": f"qa_{total}", "question": xi.question, "answer": xi.answer, } ) writer.finalize() print(f"Total #questions = {total}") # this prints 402 ```
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
100
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ @mariosasko so at the moment we still have to create a fake `Dataset` first and then use `ArrowWriter` to write an actual dataset? I'm using the latest version of `datasets` on pypi but my final file is always empty. Is there anything wrong with the code below? ```python total = 0 with ArrowWriter(path=str(final_data_path), features=features) as writer: for batch in loader: for traj in batch: for generator in question_generators: for xi in generator(traj): # print(f"Question: {xi.question}, answer: {xi.answer}") total += 1 writer.write( { "id": f"qa_{total}", "question": xi.question, "answer": xi.answer, } ) writer.finalize() print(f"Total #questions = {total}") # this prints 402 ```
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
This works for me if I then (actually I also close the writer: `writer.close()`) open the Arrow file as a dataset using `ds=Dataset.from_file(final_data_path)` then `ds.save_to_disk(somedir)`. The Dataset created that way contains the expected examples.
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
34
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ This works for me if I then (actually I also close the writer: `writer.close()`) open the Arrow file as a dataset using `ds=Dataset.from_file(final_data_path)` then `ds.save_to_disk(somedir)`. The Dataset created that way contains the expected examples.
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
Oh thanks. That did the trick I believe. Shouldn't ArrowWriter have a context manager that does these operations?
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
18
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ Oh thanks. That did the trick I believe. Shouldn't ArrowWriter have a context manager that does these operations?
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
You can just use `Dataset.from_file` to get your dataset, no need to do an extra `save_to_disk` somewhere else ;)
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
19
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ You can just use `Dataset.from_file` to get your dataset, no need to do an extra `save_to_disk` somewhere else ;)
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
I was thinking that `save_to_disk` is necessary when one wants to re-use that dataset as a proper HF dataset later, no? At least what I wanted to achieve is create a dataset that can be opened like any other local or remote dataset.
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
43
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ I was thinking that `save_to_disk` is necessary when one wants to re-use that dataset as a proper HF dataset later, no? At least what I wanted to achieve is create a dataset that can be opened like any other local or remote dataset.
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4417
how to convert a dict generator into a huggingface dataset.
`save_to_disk`/`load_from_disk` is indeed more general, e.g. it supports datasets that consist in several files, and saves some extra info in a dataset_info.json file (description, citation, split sizes, etc.) If you have one single file it's fine to simply do `.from_file()`
### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_
739
40
how to convert a dict generator into a huggingface dataset. ### Link _No response_ ### Description Hey there, I have used seqio to get a well distributed mixture of samples from multiple dataset. However the resultant output from seqio is a python generator dict, which I cannot produce back into huggingface dataset. The generator contains all the samples needed for training the model but I cannot convert it into a huggingface dataset. The code looks like this: ``` for ex in seqio_data: print(ex[“text”]) ``` I need to convert the seqio_data (generator) into huggingface dataset. the complete seqio code goes here: ``` import functools import seqio import tensorflow as tf import t5.data from datasets import load_dataset from t5.data import postprocessors from t5.data import preprocessors from t5.evaluation import metrics from seqio import FunctionDataSource, utils TaskRegistry = seqio.TaskRegistry def gen_dataset(split, shuffle=False, seed=None, column="text", dataset_params=None): dataset = load_dataset(**dataset_params) if shuffle: if seed: dataset = dataset.shuffle(seed=seed) else: dataset = dataset.shuffle() while True: for item in dataset[str(split)]: yield item[column] def dataset_fn(split, shuffle_files, seed=None, dataset_params=None): return tf.data.Dataset.from_generator( functools.partial(gen_dataset, split, shuffle_files, seed, dataset_params=dataset_params), output_signature=tf.TensorSpec(shape=(), dtype=tf.string, name=dataset_name) ) @utils.map_over_dataset def target_to_key(x, key_map, target_key): """Assign the value from the dataset to target_key in key_map""" return {**key_map, target_key: x} dataset_name = 'oscar-corpus/OSCAR-2109' subset= 'mr' dataset_params = {"path": dataset_name, "language":subset, "use_auth_token":True} dataset_shapes = None TaskRegistry.add( "oscar_marathi_corpus", source=seqio.FunctionDataSource( dataset_fn=functools.partial(dataset_fn, dataset_params=dataset_params), splits=("train", "validation"), caching_permitted=False, num_input_examples=dataset_shapes, ), preprocessors=[ functools.partial( target_to_key, key_map={ "targets": None, }, target_key="targets")], output_features={"targets": seqio.Feature(vocabulary=seqio.PassThroughVocabulary, add_eos=False, dtype=tf.string, rank=0)}, metric_fns=[] ) dataset = seqio.get_mixture_or_task("oscar_marathi_corpus").get_dataset( sequence_length=None, split="train", shuffle=True, num_epochs=1, shard_info=seqio.ShardInfo(index=0, num_shards=10), use_cached=False, seed=42 ) for _, ex in zip(range(5), dataset): print(ex['targets'].numpy().decode()) ``` ### Owner _No response_ `save_to_disk`/`load_from_disk` is indeed more general, e.g. it supports datasets that consist in several files, and saves some extra info in a dataset_info.json file (description, citation, split sizes, etc.) If you have one single file it's fine to simply do `.from_file()`
[ -1.3015028238296509, -1.0357205867767334, -0.6703162789344788, 1.4338111877441406, -0.22309726476669312, -1.1640970706939697, 0.1949174553155899, -1.1030316352844238, 1.6951401233673096, -0.8631232976913452, 0.24740397930145264, -1.6498111486434937, 0.030330009758472443, -0.49047279357910156, -0.7420954704284668, -0.9641480445861816, -0.507309079170227, -0.7864165306091309, 1.1070629358291626, 2.366345167160034, 1.2133876085281372, -1.3247989416122437, 2.687296152114868, 0.6979261636734009, -0.14985471963882446, -1.0465646982192993, 0.5002682209014893, 0.05855157971382141, -1.2535240650177002, -0.4823530614376068, -0.9949750900268555, -0.08245997875928879, -0.5558872818946838, -0.5641554594039917, -0.05917789041996002, 0.3852660357952118, -0.31780144572257996, -0.3688493072986603, -0.5568568706512451, -0.810217022895813, 0.5098894834518433, -0.2866148352622986, 0.8740062117576599, -0.34395402669906616, 1.9180487394332886, -0.5783397555351257, 0.5629260540008545, 0.7172858119010925, 1.3019583225250244, 0.19209176301956177, -0.03241099789738655, 0.3086531162261963, 0.3819742500782013, 0.02412380278110504, 0.49053245782852173, 1.1275039911270142, 0.6487160921096802, 0.5696525573730469, 0.7035095691680908, -2.2293007373809814, 1.267005205154419, -1.0378917455673218, 0.49572473764419556, 1.3996238708496094, -0.8962831497192383, 0.37059181928634644, -1.7171101570129395, -0.08783545345067978, 0.5684773325920105, -2.2555930614471436, 0.28486114740371704, -1.3355015516281128, -0.5301041007041931, 1.0488934516906738, 0.3979993462562561, -1.1720926761627197, 0.18936407566070557, -0.4655781388282776, 1.0605874061584473, 0.4574877917766571, 1.0909723043441772, -1.7045180797576904, -0.044660720974206924, -0.3398928940296173, 0.13752764463424683, -1.2400740385055542, -1.5963736772537231, 0.5821865200996399, 0.6191454529762268, 0.548420786857605, -0.14844471216201782, 1.1286123991012573, -1.0623337030410767, 0.8620831370353699, -1.1175308227539062, -1.6026273965835571, -1.4282381534576416, -2.326691150665283, -2.34529709815979, 0.7621887922286987, -0.4446535110473633, -0.5295891761779785, 2.018934726715088, -1.0705113410949707, -1.721075415611267, 1.2557318210601807, 0.2237890064716339, 0.06641726195812225, 2.4102141857147217, 0.164893239736557, -0.7031635642051697, 0.5300137996673584, -0.831375002861023, 0.8311573266983032, -0.2481621503829956, 1.3704180717468262, 0.520022988319397, -1.0535234212875366, 1.5220853090286255, -0.36239728331565857, 0.5259475111961365, -0.5718446969985962, -0.587716281414032, -0.7698364853858948, 0.3002488315105438, 1.8850047588348389, -0.24965189397335052, 1.5818450450897217, -0.3953996002674103, -1.5830085277557373, -1.5762944221496582, 0.8705511093139648, 0.4867391884326935, -0.7944760918617249, 0.05129733309149742, -0.38781338930130005, 0.07595579326152802, -0.0547010712325573, 1.1531074047088623, 1.208309531211853, 0.7453932166099548, -0.43884822726249695, -0.7658142447471619, 0.07687656581401825, -0.1004113033413887, -0.7453746199607849, -1.6834077835083008, -0.3728296458721161, 0.06947185844182968, 0.6370728015899658, -1.137353777885437, 1.6642045974731445, 0.9466623663902283, 1.9169361591339111, 0.998837411403656, -0.38161998987197876, 1.4123210906982422, 0.1362672597169876, 1.7642035484313965, -0.6187260746955872, 0.6771181225776672, -0.2431919425725937, -1.2009528875350952, 0.8894799947738647, -0.2892311215400696, -2.1000263690948486, -0.8504298329353333, -0.6940258741378784, -0.1866699904203415, -0.7868382334709167, 0.917596161365509, -0.2839730679988861, -1.5992882251739502, 0.21487459540367126, -0.6883350014686584, 0.2171449214220047, -1.126252293586731, 0.3626967668533325, 0.7176316976547241, -0.6215647459030151, 0.028105370700359344, -0.20124836266040802, -1.2442829608917236, -0.3779282867908478, 0.3240884244441986, 1.8902615308761597, -0.7325794696807861, 0.8999548554420471, 1.0692232847213745, -0.7004625201225281, 0.04634075239300728, 0.21787118911743164, -0.18852604925632477, 0.8590907454490662, -1.0515782833099365, -0.4988824427127838, 1.230570912361145, -0.23608408868312836, -0.5564262866973877, 1.5142381191253662, 0.6847304105758667, -0.9827638268470764, -0.2118796706199646, -0.17032620310783386, -0.8832612633705139, -0.014252545312047005, -1.4917937517166138, -0.050197042524814606, 0.38408806920051575, -1.594399094581604, -0.48101291060447693, -0.23167014122009277, 1.3098856210708618, -0.1996179223060608, 1.3918547630310059, -0.3514210879802704, -0.19154399633407593, -0.34564122557640076, -0.30807429552078247, 0.24133086204528809, -0.24233728647232056, -0.5450940132141113, 0.16097386181354523, -0.8598114848136902, 0.3839351236820221, 1.3692245483398438, 0.4107344448566437, 0.02861800417304039, 0.4221547245979309, 1.121405839920044, 0.37520745396614075, -0.16810458898544312, -0.8158300518989563, -1.5512961149215698, 2.010010242462158, -1.4495818614959717, 1.9585933685302734, 0.6655430793762207, -0.020024128258228302, -1.803265929222107, -1.7759745121002197, 1.2831380367279053, 1.1615173816680908, 2.3417134284973145, 0.47871124744415283, 0.371611624956131, -0.8811133503913879, -0.6798701286315918, 0.2737404406070709, -1.0385907888412476, -0.6901710629463196, 0.14638429880142212, 2.322725772857666, 1.7932965755462646, -0.45049721002578735, -0.14239418506622314, -1.0202536582946777, 1.3994256258010864, -0.22251997888088226, 0.27154096961021423, 1.9796615839004517, -0.2791903018951416, -1.0726274251937866, 1.3845769166946411, -2.337939739227295, 0.09014007449150085, 1.9917097091674805, 0.24060827493667603, 0.12247917056083679, -1.3412365913391113, -0.5508908629417419, -0.30316564440727234, -0.44529590010643005, -1.3451136350631714, 0.4912712574005127, -0.31863173842430115, -0.7569132447242737, -1.4180010557174683, 0.19479605555534363, -1.1018038988113403, -1.6404918432235718, 0.3015190660953522, 1.8287725448608398, 2.011741876602173, -0.7131720185279846, 1.4803186655044556, -0.401371568441391, 0.1845504194498062, 1.2454476356506348, 1.2150110006332397, 3.0823655128479004, 1.9235881567001343, -1.295878291130066, 0.5986080765724182, -0.179236501455307, -0.5144285559654236, 1.241469383239746, -1.199503779411316, 1.3823823928833008, -0.11778052151203156, -1.2572208642959595, -1.2548084259033203, 1.0850729942321777, 0.4408695101737976, 0.15630748867988586, -0.5380988121032715, 1.2391788959503174, 0.0527501218020916, 1.3491716384887695, 0.486335813999176, -0.4166228175163269, 0.6010484099388123, -0.4988695979118347, -0.6095591187477112, 1.4356187582015991, 0.18262243270874023, -1.4414347410202026, -2.2623085975646973, -0.25999704003334045, -0.8374004364013672, 0.06346534192562103, -0.6107712388038635, -0.9703531265258789, 1.66939115524292, 0.3614470064640045, -1.3525875806808472, -0.2372310757637024, -0.28944605588912964, -0.5182536244392395, 2.7302474975585938, -1.2836604118347168, -0.2035035490989685, -0.9900912642478943, -0.6348384618759155, 1.6490788459777832, -1.2270562648773193, -0.3021627366542816, -1.0467079877853394, -0.6802988052368164, -1.2417802810668945, -0.5703552961349487, 0.06773547828197479, -1.0458037853240967, 0.7861994504928589, 0.1089257299900055, -1.150461196899414, -0.30913007259368896, -0.8501788973808289, 0.993630588054657, -0.10252212733030319, 0.19210578501224518, 1.839550495147705, 0.3416912257671356, -0.45348089933395386, 0.7475365996360779, 1.2485183477401733, 0.7168765664100647, -0.6767738461494446, 0.10865671187639236, -0.7296051979064941, 0.3466721773147583, -1.3010642528533936, 0.23131553828716278, -2.9217922687530518, 0.6931726932525635, 0.02444472163915634, -0.11147692054510117, -0.030613448470830917, -1.3651999235153198, 1.0803813934326172, 2.5634751319885254, -1.242055058479309, 0.4207230508327484, 0.40079912543296814, 1.1036115884780884, -1.578705072402954, 0.35232013463974, -0.4834539592266083, 2.088986396789551, 0.27278801798820496, 1.2708436250686646, -0.43926185369491577, -2.2613446712493896, 0.5956143140792847, -1.2702873945236206, -1.245613694190979, 0.8219386339187622, -0.9271392822265625, 0.2050866037607193, -1.4885058403015137, -0.3007579743862152, -0.8112472891807556, -1.2195709943771362, 0.7203810214996338, 0.21287083625793457, 0.43509572744369507, -0.5558107495307922, 0.38092899322509766, -2.2031166553497314, -1.303987979888916, -0.2620270550251007, -0.9814612865447998, 0.5140696167945862, -0.37942877411842346, 0.5670747756958008, -0.1431661695241928, 0.06431400775909424, 0.4563608765602112, 1.420646071434021, 3.4491984844207764, 0.2765766680240631, 0.29203617572784424, -0.09879785031080246, -0.9889222979545593, 1.475472092628479, 0.9301424622535706, -0.03624086081981659, -0.47760239243507385, -0.9572806358337402, 1.2095249891281128, 1.9403417110443115, 1.0222241878509521, -0.05358672887086868, -0.7854050993919373, -0.6364115476608276, 0.019897092133760452, 0.20749527215957642, 0.4715017080307007, 0.8952921032905579, 0.04760972037911415, 0.1257878839969635, 1.477595567703247, 1.1311556100845337, -0.3607255518436432, 0.4324716627597809, -0.8490983247756958, -0.5664396286010742, 0.4991297125816345, 0.29350584745407104, -0.010552658699452877, 0.4604382812976837, -1.023988962173462, -0.2277882993221283, -0.4500347077846527, -0.9278490543365479, -0.6901792287826538, -0.41668498516082764, -0.4516352415084839, 1.5338200330734253, 0.04012613743543625, -0.4696720540523529, 0.02417696639895439, -0.7047149538993835, -0.19248667359352112, -1.1018829345703125, 0.31905442476272583, -0.03581920638680458, -0.13530324399471283, -0.17479699850082397, 1.7430676221847534, -0.9196364283561707, -2.0446131229400635, 0.19285164773464203, 0.32269570231437683, -0.25600773096084595, 0.17779560387134552, 1.5998375415802002, 0.4226189851760864, 1.4285368919372559, 1.267655611038208, 1.004762053489685, -0.5452715158462524, -1.3461838960647583, 0.8108026385307312, 0.9111328125, -1.2856764793395996, 0.8528860807418823, -0.020908940583467484, -0.5755001902580261, 0.6885786652565002, 1.2190781831741333, 0.5373397469520569, -1.9281268119812012, 0.8029010891914368, -0.9518535137176514, 0.7900443077087402, 0.7093523144721985, 0.7101101875305176, 0.14897336065769196, 0.8954635858535767, -1.2669401168823242, -1.125140905380249, -0.6637077927589417, -0.6192523837089539, 1.9935612678527832, -0.3120589852333069, 0.660502552986145, -0.2739484906196594, -1.2785817384719849, -0.08147409558296204, 0.7077252864837646, 0.3360757827758789, -0.5835148692131042, 0.8791689872741699, -0.5894601941108704, -0.9959437847137451, -1.2727222442626953, -0.30483391880989075, -1.1174649000167847, -0.9212608337402344, 1.0856480598449707, 0.7803230881690979, 0.23305146396160126, 1.8074651956558228, 0.594301164150238, 0.3717425763607025, -2.591048002243042, 0.9016754627227783, 0.18147459626197815, -0.10799954831600189, 0.8413127660751343, 0.31537365913391113, 1.0180219411849976, 0.08683460205793381, 0.510909914970398, -2.3464486598968506, 2.2432425022125244, -0.19514940679073334, 0.688875675201416, -0.07220350205898285, -0.21542739868164062, 1.1714648008346558, 0.6770421266555786, 0.47309428453445435, -0.9940422177314758, 0.6948710680007935, -0.47985920310020447, 1.2049169540405273, 0.8910778760910034, -0.7825494408607483, -0.07925081253051758, 1.379384160041809, 0.526506245136261, -0.4577663838863373, -0.917359471321106, -0.9230772256851196, 0.9651302099227905, 1.675446629524231, -0.05887293443083763, -0.10150790959596634, 0.7976943254470825, 0.7231147289276123, -1.2633341550827026, 0.12530013918876648, -0.6623932123184204, -0.6902992129325867, 1.5998220443725586, 2.098689556121826, -0.18946246802806854, -0.22178931534290314, -0.6784740090370178, -1.2287651300430298, 0.7774184346199036, -0.10893785208463669, 0.12286999821662903, 0.5766443014144897, -0.6015375852584839, 1.0190298557281494, 0.916037917137146, 0.9201071858406067, 0.23894594609737396, 0.2585490643978119, 0.38165298104286194, -0.3234245181083679, -1.2459444999694824, -0.2208728939294815, -1.003393530845642, -2.6251513957977295, 0.4398424029350281, -0.2630094885826111, -1.4457101821899414, 0.0993502140045166, -1.098350167274475, 0.9915949702262878, -0.6177968382835388, -1.1118168830871582, -1.6453181505203247, 0.22080430388450623, 0.06257881224155426, 0.9110289216041565, -1.5638734102249146, -0.04108226299285889, 1.1634641885757446, 0.8339864015579224, -0.640109658241272, 0.9939952492713928, 0.28300246596336365, 1.0629342794418335, 0.7640601396560669, -0.462846577167511, 0.5970900058746338, 0.11880500614643097, -1.3803609609603882, 0.45660337805747986, 1.0934653282165527, 0.18672023713588715, 1.467679500579834, -0.5205581188201904, -0.009726149961352348, 0.505812406539917, -0.6668375134468079, -0.47765958309173584, -0.44384467601776123, 0.6528104543685913, 0.06550002098083496, -0.905154824256897, -0.04759549722075462, -0.09313935786485672, -0.38864681124687195, 0.2739255130290985, -1.5360901355743408, -0.2608177661895752, -0.5203986763954163, -0.610886812210083, -1.3287588357925415, -0.13256430625915527, 1.4701863527297974, -0.8161906003952026, -0.22018860280513763, 0.5372854471206665, 0.36506181955337524, 0.5538181662559509, 0.6802052855491638, -0.6275341510772705, -0.21734993159770966, -0.33647871017456055, -0.38300231099128723, 0.2476710081100464, 1.4088184833526611, -0.17667177319526672, -0.9914565682411194, 0.7453756332397461, -0.29243704676628113, 0.08285205811262131, 1.9202306270599365, 0.15261884033679962, -0.7843221426010132, 0.4022735059261322, -0.6865238547325134, 1.8134146928787231, 1.7441186904907227, 1.468261480331421, -0.20555131137371063, -0.896692156791687, 0.49246853590011597, -0.366723895072937, -0.38610681891441345, 0.8937810063362122, 0.47301530838012695, -0.13059020042419434, -1.4192383289337158, 0.8796035647392273, 1.2365493774414062, -0.8897320628166199, -0.8121110200881958, 0.22120974957942963, -0.8203107714653015, 1.1537580490112305, 0.62615966796875, 0.42326024174690247, 0.26854246854782104, 1.5753861665725708, 0.7679571509361267, -0.3647422194480896, 0.5257486701011658, 0.529615044593811, -0.11906697601079941, -2.106158971786499, -1.149442434310913, 0.36111539602279663, -0.6514593958854675, -1.5708354711532593, 1.3952707052230835, -1.188258409500122, -1.0342535972595215, 0.5691397190093994, 0.023972637951374054, 1.3719176054000854, 0.33704033493995667, 1.6297844648361206, 2.1060104370117188, 0.8113521337509155, 0.4088773727416992, 1.273192286491394, -0.056413035839796066, -0.3966624438762665, 1.8024187088012695, -0.41184791922569275, 0.5604157447814941, 1.1195049285888672, -0.3150245249271393, -1.0602940320968628, -0.7057951092720032, -1.2206958532333374, -0.697205126285553, 1.151724934577942, 0.058975547552108765, -1.112046718597412, 0.1885450780391693, 1.5559078454971313, 0.04737292230129242, -0.2855607867240906, 0.5730918645858765, 0.35511165857315063, -0.7331691980361938, -0.12041477113962173, -0.9255655407905579, 0.44432979822158813, -0.30021896958351135, -0.3546995520591736, 0.27941465377807617, 0.5229960083961487, 1.3748410940170288, -0.03551787510514259, 0.14104382693767548, 1.0750951766967773, -1.4283117055892944, 1.376216173171997, -0.6490914821624756, 0.32409659028053284, -2.4024744033813477, 1.3165526390075684, -0.6963232755661011, 1.8654505014419556, -2.7411580085754395, 0.4767892062664032, -0.6194393634796143, -0.5054651498794556, 0.37584996223449707, -0.40805119276046753, 0.1379733383655548, -0.11067195236682892, -1.0764447450637817, 0.06819523870944977, -0.7159566283226013, 0.6467663049697876, 1.0633556842803955, 1.413680911064148, -1.234033465385437, -0.35303565859794617, -1.681808352470398, -0.19324657320976257, -0.8480110168457031, 0.31779199838638306, -1.9982140064239502, -0.12795840203762054, -1.9145439863204956, -2.4076268672943115, -1.1753276586532593, -0.870648205280304, 1.117506504058838, 0.20327159762382507, -0.8683059215545654, 1.2051265239715576, -0.4271872341632843, -1.8914982080459595, 1.1117682456970215, -2.1622793674468994 ]
https://github.com/huggingface/datasets/issues/4413
Dataset Viewer issue for ett
Thanks for reporting @dgcnz. I have checked that the dataset works fine in streaming mode. Additionally, other datasets containing timestamps are properly rendered by the viewer: https://huggingface.co/datasets/blbooks I have tried to force the refresh of the preview, but the endpoint is not responsive: Connection timed out CC: @severo
### Link https://huggingface.co/datasets/ett ### Description Timestamp is not JSON serializable. ``` Status code: 500 Exception: Status500Error Message: Type is not JSON serializable: Timestamp ``` ### Owner No
740
48
Dataset Viewer issue for ett ### Link https://huggingface.co/datasets/ett ### Description Timestamp is not JSON serializable. ``` Status code: 500 Exception: Status500Error Message: Type is not JSON serializable: Timestamp ``` ### Owner No Thanks for reporting @dgcnz. I have checked that the dataset works fine in streaming mode. Additionally, other datasets containing timestamps are properly rendered by the viewer: https://huggingface.co/datasets/blbooks I have tried to force the refresh of the preview, but the endpoint is not responsive: Connection timed out CC: @severo
[ -1.0314679145812988, -0.9005600810050964, -0.9176818132400513, 1.5513386726379395, -0.1770905703306198, -1.3307656049728394, 0.11166801303625107, -1.0967140197753906, 1.6263986825942993, -0.6623027324676514, 0.28368499875068665, -1.6843788623809814, -0.12311188876628876, -0.5731545090675354, -0.6485713720321655, -1.0029069185256958, -0.44286149740219116, -0.7891847491264343, 1.0042011737823486, 2.5743415355682373, 1.2695422172546387, -1.4140489101409912, 2.5863616466522217, 0.7089754343032837, -0.2383432388305664, -1.1111763715744019, 0.6227386593818665, -0.012405509129166603, -1.2215416431427002, -0.5025388598442078, -0.9780767560005188, -0.1384917050600052, -0.535484790802002, -0.5122706890106201, -0.02105088345706463, 0.42592087388038635, -0.2649586498737335, -0.28586074709892273, -0.5371736288070679, -0.770638644695282, 0.4769172966480255, -0.2719602882862091, 0.9048405885696411, -0.499532014131546, 1.7845090627670288, -0.5936511754989624, 0.21909284591674805, 0.7363261580467224, 1.463659405708313, 0.15649016201496124, -0.10704748332500458, 0.27604416012763977, 0.3995537757873535, -0.005628671962767839, 0.3879449665546417, 1.1302341222763062, 0.5300152897834778, 0.4869529902935028, 0.6138818264007568, -2.186342477798462, 1.1730543375015259, -0.9853678941726685, 0.2323005348443985, 1.4353797435760498, -1.2101376056671143, 0.30439305305480957, -1.825697422027588, -0.0806385800242424, 0.5003724098205566, -2.217496395111084, 0.19549089670181274, -1.1356897354125977, -0.5723562836647034, 1.0685325860977173, 0.3404846787452698, -1.4165897369384766, 0.0666564404964447, -0.31089088320732117, 1.024492621421814, 0.5019832253456116, 1.2468637228012085, -1.7074201107025146, 0.07764475792646408, -0.3982323706150055, 0.0020671719685196877, -1.3202422857284546, -1.441625714302063, 0.4886363446712494, 0.6278161406517029, 0.7571383118629456, -0.07725915312767029, 0.827733039855957, -0.8738862872123718, 0.7284435629844666, -0.8282694816589355, -1.7645750045776367, -1.487002968788147, -2.2923619747161865, -2.3047211170196533, 0.7634155750274658, -0.5174871683120728, -0.5061234831809998, 1.9120123386383057, -0.9581568241119385, -1.792992115020752, 1.1100367307662964, 0.28679123520851135, 0.03315124288201332, 2.3747336864471436, 0.4004526138305664, -0.6793472766876221, 0.36432233452796936, -0.7502305507659912, 0.7849422097206116, -0.39168012142181396, 1.4234330654144287, 0.5349048376083374, -1.0629308223724365, 1.7448625564575195, -0.5307876467704773, 0.5415800213813782, -0.6398398280143738, -0.4773348569869995, -0.8239535093307495, 0.35970059037208557, 1.889038324356079, -0.45290282368659973, 1.5827555656433105, -0.2717037498950958, -1.5235846042633057, -1.5585452318191528, 0.8800125122070312, 0.37777096033096313, -0.8120855689048767, 0.20126663148403168, -0.37700894474983215, -0.03670448437333107, -0.09127511829137802, 1.0433979034423828, 1.2326632738113403, 0.6138788461685181, -0.2811133563518524, -0.9295958280563354, 0.3471201956272125, 0.09699612855911255, -0.7561296224594116, -1.8263942003250122, -0.38171201944351196, 0.0317312590777874, 0.6714047193527222, -1.1297399997711182, 1.632595419883728, 0.7976818084716797, 1.9973044395446777, 0.9038378000259399, -0.3552245795726776, 1.407299280166626, -0.055091653019189835, 1.8667778968811035, -0.5158476829528809, 0.6538081765174866, -0.17495693266391754, -1.2271595001220703, 0.8792338371276855, -0.414166659116745, -2.033710479736328, -0.7767135500907898, -0.8912399411201477, -0.10609367489814758, -0.7453853487968445, 1.0260157585144043, -0.2026716023683548, -1.357459545135498, 0.22507637739181519, -0.7280293107032776, 0.08424573391675949, -1.4160197973251343, 0.27641502022743225, 0.7981317639350891, -0.5652240514755249, -0.020741447806358337, -0.2411002814769745, -1.27925443649292, -0.4792376160621643, 0.30601516366004944, 1.931229591369629, -0.8014659881591797, 1.012829303741455, 0.9079094529151917, -0.7289300560951233, 0.1403292864561081, 0.3697587549686432, -0.309221088886261, 0.9222379922866821, -1.1259546279907227, -0.4055597484111786, 1.1429132223129272, -0.052186597138643265, -0.6683529615402222, 1.3994839191436768, 0.8874549269676208, -1.0174541473388672, -0.12274127453565598, -0.2622612416744232, -0.720104455947876, -0.027650058269500732, -1.6867960691452026, -0.05640639737248421, 0.1807689070701599, -1.3933581113815308, -0.5592880845069885, -0.1778600662946701, 1.4136168956756592, -0.14450250566005707, 1.329807996749878, -0.27171486616134644, -0.22790074348449707, -0.47500690817832947, -0.4115035831928253, 0.18206197023391724, -0.24333228170871735, -0.5029636025428772, 0.3869175910949707, -0.8463858962059021, 0.2883860468864441, 1.4024991989135742, 0.3018774092197418, 0.1206897720694542, 0.5720939636230469, 1.0640314817428589, 0.38738366961479187, -0.13226699829101562, -0.9273226261138916, -1.5217010974884033, 2.0357742309570312, -1.2965679168701172, 1.984474539756775, 0.7931967973709106, -0.042675673961639404, -1.8496243953704834, -1.964369535446167, 1.455042839050293, 1.2679407596588135, 2.3501217365264893, 0.7653395533561707, 0.36366820335388184, -0.9027542471885681, -0.6304174065589905, 0.34584376215934753, -1.1024574041366577, -0.6615086793899536, 0.1266792267560959, 2.34091854095459, 1.7636561393737793, -0.48138856887817383, -0.1590050607919693, -0.9725165367126465, 1.2238478660583496, -0.11786612868309021, 0.12908108532428741, 2.0460243225097656, -0.24533599615097046, -1.0099831819534302, 1.2408132553100586, -2.3202381134033203, 0.04729754477739334, 2.0601589679718018, 0.25408849120140076, 0.15703284740447998, -1.5552277565002441, -0.7685068845748901, -0.14048819243907928, -0.45127415657043457, -1.2374440431594849, 0.6322363615036011, -0.3472183644771576, -0.8709810972213745, -1.4839800596237183, 0.2761945426464081, -0.9850965738296509, -1.7164968252182007, 0.2612820267677307, 1.7769638299942017, 1.9652212858200073, -0.8581027984619141, 1.5951539278030396, -0.20593151450157166, 0.18415266275405884, 1.3503608703613281, 1.110683560371399, 3.0577073097229004, 2.0569005012512207, -1.2745025157928467, 0.8750956058502197, -0.027456630021333694, -0.43441757559776306, 1.215239405632019, -1.1594220399856567, 1.3082666397094727, -0.4271901547908783, -1.289961814880371, -1.242851734161377, 0.9490082263946533, 0.5014448761940002, 0.032451849430799484, -0.5614264011383057, 1.310846209526062, 0.014165976084768772, 1.300952434539795, 0.5361133217811584, -0.3842293918132782, 0.6133096814155579, -0.4327963590621948, -0.4016469120979309, 1.5444635152816772, 0.3343670070171356, -1.3610918521881104, -2.2902896404266357, -0.2633180618286133, -0.8922203183174133, -0.19077827036380768, -0.6207226514816284, -1.0299540758132935, 1.58563232421875, 0.4444083571434021, -1.2952364683151245, -0.4320661425590515, -0.3679293990135193, -0.5632562041282654, 2.661862373352051, -1.4934027194976807, -0.24254938960075378, -1.0216580629348755, -0.4647698700428009, 1.7338297367095947, -1.0906802415847778, -0.07183568924665451, -1.157323956489563, -0.7492169737815857, -1.3355079889297485, -0.5970446467399597, 0.11080095916986465, -0.8126808404922485, 0.8338173031806946, 0.11732000857591629, -1.1730462312698364, -0.22879859805107117, -0.8366222381591797, 0.8353509306907654, -0.10058432817459106, 0.3481106460094452, 1.9689536094665527, 0.43621182441711426, -0.4614447057247162, 0.6965519189834595, 1.0997941493988037, 0.5779286026954651, -0.7742758393287659, 0.3329717516899109, -0.6533540487289429, 0.18723134696483612, -1.3587270975112915, 0.18994185328483582, -2.920886278152466, 0.6869723796844482, -0.03776635229587555, -0.05532466247677803, -0.004653203301131725, -1.2647939920425415, 1.119543433189392, 2.538179397583008, -1.2009217739105225, 0.4407065510749817, 0.2689787745475769, 1.246137261390686, -1.5700253248214722, 0.18314363062381744, -0.5054240226745605, 2.160015344619751, 0.06112430617213249, 1.3005750179290771, -0.3656063675880432, -2.1187891960144043, 0.6896876692771912, -1.3582414388656616, -1.0133516788482666, 0.881877601146698, -0.842691957950592, 0.049576688557863235, -1.511447548866272, -0.05922132357954979, -0.8302672505378723, -1.3284717798233032, 0.8371737003326416, 0.15268297493457794, 0.5147506594657898, -0.5899178981781006, 0.42546501755714417, -2.02423357963562, -1.353674054145813, -0.2385326325893402, -0.9149200916290283, 0.2956380248069763, -0.3194349706172943, 0.7186007499694824, -0.2675188183784485, 0.0006288513541221619, 0.42061179876327515, 1.2291957139968872, 3.4853923320770264, 0.08034443110227585, 0.3255230784416199, -0.13426420092582703, -0.925233781337738, 1.5328304767608643, 1.0054645538330078, -0.05033329874277115, -0.6454882621765137, -0.9732752442359924, 1.234621286392212, 1.9730408191680908, 1.1082472801208496, 0.1044318899512291, -0.9521764516830444, -0.6287146806716919, -0.019323740154504776, 0.24231159687042236, 0.5293123126029968, 0.8325378894805908, -0.013812365010380745, -0.005434154532849789, 1.4289206266403198, 1.1087020635604858, -0.4028817415237427, 0.4186786115169525, -0.9471230506896973, -0.41915810108184814, 0.4642798602581024, 0.4024195671081543, 0.183348149061203, 0.4342776834964752, -1.0498912334442139, -0.28305894136428833, -0.34072145819664, -0.9574869871139526, -0.7315261363983154, -0.4712933599948883, -0.3430958092212677, 1.6186327934265137, 0.054484497755765915, -0.45630332827568054, -0.06385819613933563, -0.7962902784347534, -0.05487315356731415, -1.098315954208374, 0.3448959290981293, -0.12552322447299957, -0.07119997590780258, -0.026998411864042282, 1.772853970527649, -1.0632014274597168, -2.243553876876831, 0.38977253437042236, 0.34361422061920166, -0.3982427716255188, 0.15676817297935486, 1.53348708152771, 0.5104449391365051, 1.2972931861877441, 1.2653635740280151, 1.0733022689819336, -0.760094165802002, -1.2753336429595947, 0.605808675289154, 1.1377290487289429, -1.5453981161117554, 0.87602299451828, -0.08123549073934555, -0.4676171541213989, 0.6085505485534668, 1.283627986907959, 0.40824368596076965, -1.8395452499389648, 0.7940436601638794, -0.7572347521781921, 0.865493893623352, 0.6080910563468933, 0.7955849766731262, 0.21372416615486145, 0.712780237197876, -1.3075666427612305, -1.105509638786316, -0.7741022706031799, -0.6097871661186218, 1.8982821702957153, -0.08498051017522812, 0.5516595840454102, -0.11177881807088852, -1.3422236442565918, -0.03528634458780289, 0.6312472224235535, 0.3185473680496216, -0.42060884833335876, 0.8565645217895508, -0.5520796179771423, -1.0862163305282593, -1.3695762157440186, -0.37510281801223755, -0.9584506154060364, -0.987970769405365, 1.0832672119140625, 0.8235180377960205, 0.31446632742881775, 1.7982285022735596, 0.5942696928977966, 0.24188771843910217, -2.656566619873047, 0.9762163758277893, 0.3482379615306854, 0.12288623303174973, 0.929100751876831, 0.26981157064437866, 1.0688819885253906, -0.0672670304775238, 0.5021975636482239, -2.2953357696533203, 2.3271470069885254, -0.11636684834957123, 0.5606814026832581, 0.04111422598361969, -0.22753441333770752, 0.9856933355331421, 0.490368127822876, 0.510275661945343, -1.065593957901001, 0.7398312091827393, -0.6093682646751404, 1.162798285484314, 1.0015058517456055, -0.7364414930343628, -0.037738051265478134, 1.2543931007385254, 0.5609211325645447, -0.4284803569316864, -0.8834690451622009, -0.8357608318328857, 0.9676392078399658, 1.6431171894073486, 0.0077105676755309105, 0.07344355434179306, 0.901599645614624, 0.5707880258560181, -1.231444001197815, 0.030405700206756592, -0.7747436761856079, -0.6411728858947754, 1.628039002418518, 1.92836332321167, -0.14011599123477936, -0.15545004606246948, -0.890134334564209, -1.27822744846344, 0.8075932264328003, -0.03907843306660652, 0.16223105788230896, 0.7224116921424866, -0.6454325318336487, 1.2467478513717651, 0.683975875377655, 0.91436767578125, 0.11698053032159805, 0.36572137475013733, 0.31183433532714844, -0.2709403932094574, -1.2056968212127686, -0.3121987283229828, -1.0932950973510742, -2.427273750305176, 0.47885093092918396, -0.3243655860424042, -1.2319366931915283, 0.04109365865588188, -1.1288421154022217, 0.9855051636695862, -0.5884009003639221, -0.9474160075187683, -1.5042035579681396, 0.28107473254203796, -0.1958705484867096, 0.8800042867660522, -1.5938504934310913, -0.004411253146827221, 1.3823151588439941, 0.9323865175247192, -0.7941626310348511, 1.024876356124878, 0.1632530242204666, 1.1138285398483276, 0.8085212111473083, -0.22992315888404846, 0.45162662863731384, 0.12741030752658844, -1.3564332723617554, 0.5447965264320374, 1.094999074935913, 0.1546730101108551, 1.4713209867477417, -0.5471503138542175, 0.007854406721889973, 0.4115200340747833, -0.45643866062164307, -0.49701765179634094, -0.5808255076408386, 0.8005566000938416, 0.11380036920309067, -0.9989339709281921, 0.19569234549999237, -0.11098268628120422, -0.06560980528593063, 0.15750658512115479, -1.5357146263122559, -0.2582198977470398, -0.2622290849685669, -0.5237799286842346, -1.2621971368789673, -0.00867727492004633, 1.3462198972702026, -0.6306748390197754, -0.24226628243923187, 0.5955529808998108, 0.3001359701156616, 0.45616796612739563, 0.5625162124633789, -0.5687766075134277, -0.32212120294570923, -0.2822248637676239, -0.39527595043182373, 0.33127859234809875, 1.3360176086425781, -0.21084119379520416, -0.9999288320541382, 0.8440130949020386, -0.46828651428222656, -0.012778148986399174, 2.004812479019165, 0.13975317776203156, -0.9331952333450317, 0.28657853603363037, -0.5502710938453674, 1.9677923917770386, 1.631085991859436, 1.3372900485992432, -0.02700898051261902, -0.9256206750869751, 0.6852148175239563, -0.23176051676273346, -0.32262516021728516, 0.8487195372581482, 0.42006808519363403, -0.17216899991035461, -1.4742722511291504, 0.4717245101928711, 1.3168865442276, -1.0090478658676147, -0.8405656814575195, 0.10566919296979904, -0.7779743671417236, 0.8892799615859985, 0.8506913185119629, 0.5129318833351135, 0.2567921280860901, 1.4916303157806396, 0.7220079898834229, -0.3868260085582733, 0.39599984884262085, 0.4498486816883087, -0.10699335485696793, -1.9730823040008545, -1.0014759302139282, 0.4824121594429016, -0.4739340543746948, -1.5731364488601685, 1.2989054918289185, -1.2745180130004883, -0.8663948178291321, 0.49548980593681335, 0.10404133051633835, 1.4287946224212646, 0.2737012803554535, 1.629379153251648, 2.018165111541748, 0.8698607087135315, 0.1908513307571411, 1.325986385345459, -0.12305920571088791, -0.3916164040565491, 1.757721185684204, -0.46158167719841003, 0.4850287139415741, 1.0074483156204224, -0.4299476444721222, -1.071770191192627, -0.7876425981521606, -1.1495869159698486, -0.6423658728599548, 1.2400344610214233, 0.22221821546554565, -1.15163254737854, 0.17763455212116241, 1.4910426139831543, 0.04970536753535271, -0.24056842923164368, 0.6451472043991089, 0.43855947256088257, -0.8671877980232239, -0.003051282372325659, -0.8572359085083008, 0.45725777745246887, -0.20325683057308197, -0.3475414514541626, 0.39614278078079224, 0.46037694811820984, 1.2793115377426147, -0.046034593135118484, 0.16150639951229095, 1.2566957473754883, -1.3341714143753052, 1.550544023513794, -0.6141746044158936, 0.14157958328723907, -2.4205381870269775, 1.330309271812439, -0.712784469127655, 1.8017561435699463, -2.7379865646362305, 0.4219607710838318, -0.4806402921676636, -0.3641117513179779, 0.27758193016052246, -0.4412524104118347, 0.15724919736385345, -0.222159281373024, -1.1732889413833618, -0.08821830153465271, -0.7071853876113892, 0.5479462146759033, 1.1721352338790894, 1.3329579830169678, -1.0388380289077759, -0.3748705983161926, -1.8793761730194092, -0.15199923515319824, -0.6791037917137146, 0.3724730908870697, -2.0882067680358887, -0.1860281378030777, -1.8517929315567017, -2.399101495742798, -1.3602540493011475, -0.8540211915969849, 1.1061773300170898, 0.268903911113739, -0.9096423387527466, 1.0753891468048096, -0.3319612443447113, -1.780299425125122, 1.0115528106689453, -2.204765796661377 ]
https://github.com/huggingface/datasets/issues/4413
Dataset Viewer issue for ett
I've just resent the refresh of the preview to the new endpoint, without success. CC: @severo
### Link https://huggingface.co/datasets/ett ### Description Timestamp is not JSON serializable. ``` Status code: 500 Exception: Status500Error Message: Type is not JSON serializable: Timestamp ``` ### Owner No
740
16
Dataset Viewer issue for ett ### Link https://huggingface.co/datasets/ett ### Description Timestamp is not JSON serializable. ``` Status code: 500 Exception: Status500Error Message: Type is not JSON serializable: Timestamp ``` ### Owner No I've just resent the refresh of the preview to the new endpoint, without success. CC: @severo
[ -0.9769587516784668, -0.873382031917572, -1.0034666061401367, 1.5975143909454346, -0.20022521913051605, -1.302970051765442, 0.1512083113193512, -1.0736538171768188, 1.634488821029663, -0.6758905649185181, 0.30285242199897766, -1.6864056587219238, -0.21065029501914978, -0.5655634999275208, -0.6639452576637268, -0.9498385787010193, -0.453020304441452, -0.6274560689926147, 1.0560663938522339, 2.603952407836914, 1.270694613456726, -1.4089131355285645, 2.638690233230591, 0.7813325524330139, -0.15495355427265167, -1.0205419063568115, 0.5468318462371826, -0.0373912937939167, -1.1651995182037354, -0.49225160479545593, -0.9828662276268005, -0.16254200041294098, -0.47461751103401184, -0.5350423455238342, -0.09001485258340836, 0.46859434247016907, -0.2377156764268875, -0.5428482294082642, -0.4971740245819092, -0.7968519926071167, 0.3434126675128937, -0.3114103078842163, 0.8861637711524963, -0.452512264251709, 1.8182774782180786, -0.562975287437439, 0.27870526909828186, 0.7233298420906067, 1.4750291109085083, 0.1943291574716568, -0.1595216989517212, 0.36435216665267944, 0.43235376477241516, -0.061171140521764755, 0.4638803005218506, 1.1776148080825806, 0.5426241159439087, 0.5697904229164124, 0.597345769405365, -2.1184499263763428, 1.138893961906433, -0.9980586171150208, 0.17799118161201477, 1.3377621173858643, -1.276169776916504, 0.37506985664367676, -1.7348055839538574, -0.06488198786973953, 0.488823801279068, -2.119133234024048, 0.3368317484855652, -1.154744267463684, -0.6407068967819214, 1.0063282251358032, 0.43033137917518616, -1.5317050218582153, -0.07941374182701111, -0.2346843034029007, 1.0075932741165161, 0.4606624245643616, 1.3050451278686523, -1.6731311082839966, 0.19773593544960022, -0.45063045620918274, 0.056424159556627274, -1.2226799726486206, -1.4207648038864136, 0.4522762894630432, 0.6257547736167908, 0.7825973033905029, -0.12486843019723892, 0.7977014780044556, -0.8848497271537781, 0.704087495803833, -0.8387215733528137, -1.8093767166137695, -1.4240074157714844, -2.3012948036193848, -2.2986860275268555, 0.7392631769180298, -0.45217201113700867, -0.5163000822067261, 1.9596765041351318, -0.944028913974762, -1.8075813055038452, 1.148406744003296, 0.23996485769748688, -0.03997509181499481, 2.441340684890747, 0.4214610457420349, -0.6665472984313965, 0.2745624780654907, -0.8266945481300354, 0.8103440999984741, -0.5689867734909058, 1.4500247240066528, 0.546577513217926, -1.0872966051101685, 1.7830616235733032, -0.5235434770584106, 0.5962714552879333, -0.693475604057312, -0.4028228521347046, -0.7341740727424622, 0.34028360247612, 1.9913791418075562, -0.46841350197792053, 1.5784884691238403, -0.43940848112106323, -1.476762056350708, -1.5314005613327026, 0.9432878494262695, 0.3041257858276367, -0.7014182209968567, 0.36876392364501953, -0.31371206045150757, -0.09257571399211884, -0.12179459631443024, 0.9843450784683228, 1.273810625076294, 0.6257514357566833, -0.2627258896827698, -0.8784250020980835, 0.2859988510608673, 0.1900523602962494, -0.8029714226722717, -1.8107649087905884, -0.2885023355484009, -0.12276537716388702, 0.6396870017051697, -1.1650340557098389, 1.5840548276901245, 0.7125665545463562, 2.013932466506958, 0.9192714691162109, -0.40026819705963135, 1.3979804515838623, -0.029413525015115738, 1.8257381916046143, -0.4669973850250244, 0.5930909514427185, -0.13092519342899323, -1.1666311025619507, 0.8863782286643982, -0.3771212100982666, -1.9968690872192383, -0.7602192759513855, -0.828821063041687, -0.12758979201316833, -0.7160183191299438, 1.0016812086105347, -0.1990431845188141, -1.3709917068481445, 0.1728670448064804, -0.8504406213760376, 0.08276204019784927, -1.4218575954437256, 0.29590585827827454, 0.7455373406410217, -0.5025349855422974, 0.03209621459245682, -0.25790920853614807, -1.2674130201339722, -0.4482291340827942, 0.38205868005752563, 1.9875105619430542, -0.8615978360176086, 0.967566967010498, 0.8693597912788391, -0.7112496495246887, 0.10658752173185349, 0.3857254981994629, -0.2993684411048889, 0.8677133917808533, -1.1826900243759155, -0.41639280319213867, 1.2325280904769897, -0.08709781616926193, -0.6565258502960205, 1.4509743452072144, 0.8169344067573547, -1.1149719953536987, -0.05591415986418724, -0.24944621324539185, -0.8010536432266235, -0.006180529482662678, -1.768387794494629, -0.08312208205461502, 0.1302766054868698, -1.4243072271347046, -0.6371074914932251, -0.2711327373981476, 1.4553145170211792, 0.0015641683712601662, 1.3560081720352173, -0.2840520143508911, -0.1767108142375946, -0.35232725739479065, -0.3293269872665405, 0.263631135225296, -0.32812732458114624, -0.3922461271286011, 0.2841138541698456, -0.8342973589897156, 0.229124054312706, 1.4083784818649292, 0.3001193404197693, 0.12291892617940903, 0.5685457587242126, 0.9921330809593201, 0.40580856800079346, -0.14641039073467255, -0.8869439363479614, -1.4863886833190918, 2.0285325050354004, -1.2852758169174194, 1.995484709739685, 0.819212019443512, -0.007428817451000214, -1.842481017112732, -2.0297188758850098, 1.4158382415771484, 1.3070043325424194, 2.3527495861053467, 0.7770751714706421, 0.293235719203949, -0.8842601180076599, -0.6600164175033569, 0.20189864933490753, -1.088405728340149, -0.6747227907180786, 0.19627141952514648, 2.3392274379730225, 1.6930961608886719, -0.4422370195388794, -0.15111637115478516, -1.1219128370285034, 1.3015698194503784, -0.1749274581670761, 0.21233128011226654, 1.961691975593567, -0.21967685222625732, -0.9453768134117126, 1.1351648569107056, -2.2441186904907227, 0.09325437247753143, 2.029618263244629, 0.1806931346654892, 0.1302366405725479, -1.5921003818511963, -0.7963674664497375, -0.09739803522825241, -0.32185694575309753, -1.1916604042053223, 0.7002662420272827, -0.3636654019355774, -0.7782688736915588, -1.5096224546432495, 0.27602478861808777, -0.894865095615387, -1.631052851676941, 0.26786696910858154, 1.8945951461791992, 1.84026300907135, -0.9380602836608887, 1.6508949995040894, -0.16261036694049835, 0.11515510827302933, 1.3785372972488403, 1.037644863128662, 3.038280725479126, 2.0445644855499268, -1.269359827041626, 0.8649182319641113, -0.0014153462834656239, -0.477657675743103, 1.3118278980255127, -1.2680368423461914, 1.3256747722625732, -0.5343514680862427, -1.23324716091156, -1.1893603801727295, 0.8414872884750366, 0.5354350805282593, 0.04547110199928284, -0.523043692111969, 1.3393456935882568, -0.07888755202293396, 1.2928208112716675, 0.5822136998176575, -0.40982985496520996, 0.6582927107810974, -0.4216406047344208, -0.24152259528636932, 1.4930999279022217, 0.35332173109054565, -1.3473955392837524, -2.3554935455322266, -0.1366802304983139, -0.9500413537025452, -0.04103923588991165, -0.624982476234436, -1.011543869972229, 1.5559335947036743, 0.5105847120285034, -1.1987625360488892, -0.49153369665145874, -0.3898544907569885, -0.5554265379905701, 2.6676278114318848, -1.5788755416870117, -0.26792100071907043, -1.0321872234344482, -0.39218613505363464, 1.7914496660232544, -1.09859299659729, -0.09926212579011917, -1.1938910484313965, -0.5924727320671082, -1.3092557191848755, -0.6428627371788025, 0.17924675345420837, -0.759167492389679, 0.9088385105133057, 0.03703887388110161, -1.2464032173156738, -0.17988315224647522, -0.8308296203613281, 0.8169610500335693, -0.10622117668390274, 0.45683422684669495, 2.038684606552124, 0.42378994822502136, -0.44198811054229736, 0.7179609537124634, 1.103707194328308, 0.525680661201477, -0.7062144875526428, 0.4151638448238373, -0.6396545171737671, 0.2165762335062027, -1.3745925426483154, 0.1262018084526062, -2.9106671810150146, 0.6099810004234314, 0.0022389618679881096, -0.018000096082687378, -0.09108860045671463, -1.288604974746704, 1.1071522235870361, 2.5311546325683594, -1.2725038528442383, 0.4674319624900818, 0.21475781500339508, 1.389285683631897, -1.5689446926116943, 0.13350193202495575, -0.5371847152709961, 2.065566301345825, 0.10714119672775269, 1.2390460968017578, -0.3135359287261963, -2.150341033935547, 0.668677568435669, -1.3528577089309692, -1.0709483623504639, 0.8784162402153015, -0.763334333896637, -0.07184475660324097, -1.5320974588394165, -0.03661179170012474, -0.7281472086906433, -1.25117826461792, 0.7857543230056763, 0.26088717579841614, 0.5269621014595032, -0.6486096382141113, 0.4689180850982666, -2.0102927684783936, -1.4133862257003784, -0.3072942793369293, -0.8406561613082886, 0.29101812839508057, -0.35249993205070496, 0.6928110122680664, -0.4024992883205414, 0.031777046620845795, 0.4312269687652588, 1.1362581253051758, 3.458162307739258, 0.1598026156425476, 0.26581981778144836, -0.20552851259708405, -0.932209312915802, 1.586295485496521, 0.949860692024231, -0.020368043333292007, -0.6932294368743896, -0.9924741387367249, 1.2198387384414673, 1.9436919689178467, 1.0700708627700806, 0.10622040927410126, -0.9225064516067505, -0.5888735055923462, -0.11031520366668701, 0.2450847029685974, 0.35417500138282776, 0.8889593482017517, 0.040651340037584305, 0.004707333631813526, 1.3408843278884888, 1.1271439790725708, -0.4494546949863434, 0.48002779483795166, -0.9286608695983887, -0.3962242603302002, 0.5794516205787659, 0.3694612383842468, 0.0907062515616417, 0.31585535407066345, -0.9855784773826599, -0.3182397484779358, -0.37150460481643677, -0.9398446083068848, -0.7353602051734924, -0.36228594183921814, -0.3196546733379364, 1.6052442789077759, 0.09417260438203812, -0.5487970113754272, -0.1832459419965744, -0.7462108731269836, 0.06598056107759476, -0.9895176291465759, 0.2804732024669647, -0.17461931705474854, -0.09229273349046707, 0.05115850269794464, 1.7724236249923706, -1.1735906600952148, -2.314377784729004, 0.44574201107025146, 0.37505555152893066, -0.36556994915008545, 0.22694814205169678, 1.5425573587417603, 0.5251660346984863, 1.346996784210205, 1.292553424835205, 1.0122900009155273, -0.7933799028396606, -1.2076157331466675, 0.5206923484802246, 1.1642276048660278, -1.568881630897522, 0.7785081267356873, 0.024642478674650192, -0.39358338713645935, 0.579297661781311, 1.2498451471328735, 0.46469706296920776, -1.852095365524292, 0.7343902587890625, -0.7575287222862244, 0.9616707563400269, 0.6492384672164917, 0.8180443644523621, 0.23053596913814545, 0.6234443187713623, -1.193851351737976, -1.1124262809753418, -0.8216118216514587, -0.6252550482749939, 1.8898111581802368, -0.090728260576725, 0.5794180631637573, -0.1394156962633133, -1.3551887273788452, -0.06102829426527023, 0.5958656668663025, 0.3074910640716553, -0.513521671295166, 0.7227291464805603, -0.5066373348236084, -1.0996034145355225, -1.3897289037704468, -0.47324955463409424, -0.9455479979515076, -1.0629758834838867, 1.0932585000991821, 0.7566297054290771, 0.31839099526405334, 1.777777075767517, 0.5842626094818115, 0.19703498482704163, -2.533968210220337, 0.9408385157585144, 0.4522315561771393, 0.09423118084669113, 0.8989070653915405, 0.30834704637527466, 1.033843994140625, -0.044893428683280945, 0.5253781080245972, -2.2679107189178467, 2.3470189571380615, -0.13358372449874878, 0.5515993237495422, 0.003962252289056778, -0.16990403831005096, 0.9347657561302185, 0.5019127726554871, 0.4572819173336029, -1.0783544778823853, 0.6691011190414429, -0.5817264318466187, 1.2741506099700928, 0.8755823969841003, -0.7154535055160522, -0.04098541662096977, 1.2684135437011719, 0.48634156584739685, -0.4831436574459076, -0.8426821231842041, -0.8777115941047668, 0.9962831139564514, 1.647652268409729, 0.06733892112970352, 0.1614861637353897, 0.9410772323608398, 0.5472636818885803, -1.2469621896743774, 0.008593925274908543, -0.7852724194526672, -0.6285959482192993, 1.6665540933609009, 1.9843746423721313, -0.13210231065750122, -0.09947560727596283, -0.9012842178344727, -1.2103902101516724, 0.8159060478210449, -0.005074987653642893, 0.11600155383348465, 0.8390058279037476, -0.6226111054420471, 1.267946720123291, 0.5945523381233215, 0.822704017162323, 0.1697957068681717, 0.31566330790519714, 0.4344009757041931, -0.23509536683559418, -1.1908597946166992, -0.24092791974544525, -1.183968424797058, -2.3987176418304443, 0.4256303012371063, -0.3133489489555359, -1.2915146350860596, 0.06095125898718834, -1.1599652767181396, 0.9956849217414856, -0.6241657137870789, -0.9695020318031311, -1.5152997970581055, 0.18451867997646332, -0.1562679558992386, 0.8231484889984131, -1.6382708549499512, 0.008871237747371197, 1.3901861906051636, 0.9465839862823486, -0.8787709474563599, 1.0122357606887817, 0.187608003616333, 1.2400273084640503, 0.8636717200279236, -0.15738758444786072, 0.4079192876815796, 0.034052617847919464, -1.3174796104431152, 0.6323407292366028, 1.1985384225845337, 0.09327901899814606, 1.5423907041549683, -0.656324565410614, -0.021423853933811188, 0.45412877202033997, -0.427785187959671, -0.6278554797172546, -0.535709798336029, 0.7378741502761841, 0.015502520836889744, -0.9318280220031738, 0.13064813613891602, -0.0518588051199913, 0.03435227647423744, 0.21302993595600128, -1.5430080890655518, -0.1665668934583664, -0.255592405796051, -0.49687057733535767, -1.2477113008499146, -0.061017729341983795, 1.3401163816452026, -0.5426491498947144, -0.30015477538108826, 0.5406972169876099, 0.2748126983642578, 0.4491735100746155, 0.5390707850456238, -0.5259432196617126, -0.33916422724723816, -0.2539043724536896, -0.4692760109901428, 0.3713211119174957, 1.3945084810256958, -0.2783862352371216, -0.9718601107597351, 0.7702873349189758, -0.5798408389091492, 0.049123864620923996, 1.9892349243164062, 0.16971494257450104, -0.9469273686408997, 0.2531115710735321, -0.5580029487609863, 2.0188567638397217, 1.6407647132873535, 1.32318913936615, 0.003791489638388157, -0.9835889339447021, 0.7647997140884399, -0.22629378736019135, -0.4134388267993927, 0.6800522804260254, 0.32518303394317627, -0.2727738916873932, -1.3517236709594727, 0.4515095055103302, 1.318475365638733, -1.0003256797790527, -0.971415102481842, 0.05263849347829819, -0.7408531308174133, 0.8389986753463745, 0.904466450214386, 0.5002918839454651, 0.23700299859046936, 1.4992198944091797, 0.6713002920150757, -0.39880210161209106, 0.4592874050140381, 0.3596431314945221, 0.0035779783502221107, -1.9922358989715576, -0.9661043882369995, 0.4664307236671448, -0.43901753425598145, -1.5964068174362183, 1.3265305757522583, -1.2850828170776367, -0.9214843511581421, 0.5024061799049377, 0.18259790539741516, 1.4652265310287476, 0.2305220067501068, 1.5236238241195679, 2.0029828548431396, 0.9276137948036194, 0.2210070937871933, 1.2922252416610718, -0.14555317163467407, -0.4208413362503052, 1.795043706893921, -0.4510645568370819, 0.44966328144073486, 0.9940007328987122, -0.35620230436325073, -1.1299917697906494, -0.7243133783340454, -1.2523353099822998, -0.7242143750190735, 1.26474130153656, 0.20431378483772278, -1.1904081106185913, 0.15648047626018524, 1.481502890586853, 0.08307114988565445, -0.3139685392379761, 0.5682743191719055, 0.4408479928970337, -0.9095996022224426, -0.0020194402895867825, -0.8872673511505127, 0.4755878448486328, -0.28498050570487976, -0.37349674105644226, 0.38655388355255127, 0.49875470995903015, 1.3088527917861938, -0.032702598720788956, 0.2427859604358673, 1.3037406206130981, -1.3457316160202026, 1.6138617992401123, -0.7473241686820984, 0.13005377352237701, -2.4299778938293457, 1.387710690498352, -0.655958890914917, 1.7062945365905762, -2.847249984741211, 0.489160418510437, -0.3791700601577759, -0.2861179709434509, 0.27771833539009094, -0.3687935173511505, 0.1544317603111267, -0.24763436615467072, -1.2055606842041016, -0.07043276727199554, -0.7256195545196533, 0.47986799478530884, 1.1663058996200562, 1.267124056816101, -1.031633734703064, -0.33061137795448303, -1.8780922889709473, -0.1341710090637207, -0.674120306968689, 0.4202744662761688, -2.1212241649627686, -0.22837524116039276, -1.8442775011062622, -2.310454845428467, -1.256999135017395, -0.8132181763648987, 1.0523016452789307, 0.3153330385684967, -0.8986930251121521, 1.051645278930664, -0.3746682107448578, -1.8437432050704956, 0.9475695490837097, -2.1933467388153076 ]
https://github.com/huggingface/datasets/issues/4407
Dataset Viewer issue for conll2012_ontonotesv5
Thanks for reporting, @jiangwy99. I guess this could be addressed only once we fix our issue with irresponsive backend endpoint. CC: @severo
### Link https://huggingface.co/datasets/conll2012_ontonotesv5 ### Description Dataset viewer outage. ### Owner No
741
22
Dataset Viewer issue for conll2012_ontonotesv5 ### Link https://huggingface.co/datasets/conll2012_ontonotesv5 ### Description Dataset viewer outage. ### Owner No Thanks for reporting, @jiangwy99. I guess this could be addressed only once we fix our issue with irresponsive backend endpoint. CC: @severo
[ -1.2850680351257324, -0.981856107711792, -0.7875120043754578, 1.441593050956726, -0.3209223747253418, -1.2560113668441772, 0.2898831069469452, -0.8516969680786133, 1.6132209300994873, -0.7091885805130005, 0.1771763563156128, -1.7210839986801147, -0.14209821820259094, -0.562983512878418, -0.5910799503326416, -0.8962253928184509, -0.3516249358654022, -0.6896133422851562, 1.1788593530654907, 2.55893611907959, 1.10207998752594, -1.227427363395691, 2.7259864807128906, 0.8064537644386292, -0.32626765966415405, -1.0411295890808105, 0.6634334921836853, 0.02195781096816063, -1.3500003814697266, -0.45488014817237854, -1.1501421928405762, 0.013148038648068905, -0.39592936635017395, -0.4086209833621979, 0.03513656184077263, 0.4243663549423218, -0.07692091912031174, -0.3882935345172882, -0.47105279564857483, -0.7562347054481506, 0.3329199254512787, -0.370231956243515, 0.8496959209442139, -0.4077838063240051, 1.9421902894973755, -0.7345801591873169, 0.3717164099216461, 0.6972384452819824, 1.2161359786987305, 0.06248866394162178, -0.13435529172420502, 0.15742722153663635, 0.46197742223739624, -0.20571358501911163, 0.42804670333862305, 1.1668415069580078, 0.4275326728820801, 0.5046262145042419, 0.5505974292755127, -2.1108553409576416, 1.330210566520691, -0.9754428863525391, 0.30461302399635315, 1.5001550912857056, -1.206253170967102, 0.5308953523635864, -1.703216314315796, -0.07272464781999588, 0.5350117683410645, -2.0989267826080322, 0.34008362889289856, -1.2152247428894043, -0.6666580438613892, 0.8776419162750244, 0.35724014043807983, -1.4668656587600708, 0.06522813439369202, -0.49017879366874695, 1.1308648586273193, 0.41745316982269287, 1.2054470777511597, -1.587593913078308, 0.07682507485151291, -0.32741662859916687, -0.04341721534729004, -1.3578979969024658, -1.3942866325378418, 0.5719786286354065, 0.7564445734024048, 0.743924081325531, -0.05694842338562012, 0.8184731006622314, -0.9832363128662109, 0.7694808840751648, -0.7981783747673035, -1.6260195970535278, -1.428978681564331, -2.307021141052246, -2.2940711975097656, 0.8081162571907043, -0.43591341376304626, -0.5789899230003357, 1.8858472108840942, -1.1179009675979614, -1.7155500650405884, 1.339237928390503, 0.037974659353494644, -0.026683136820793152, 2.461244821548462, 0.4874515235424042, -0.5356324315071106, 0.3243376612663269, -0.7674849033355713, 0.7777408957481384, -0.6207241415977478, 1.3070610761642456, 0.5004774332046509, -0.9760514497756958, 1.6199660301208496, -0.45572036504745483, 0.6261434555053711, -0.6377127170562744, -0.5024721026420593, -0.8596557378768921, 0.36171963810920715, 1.9190362691879272, -0.482839435338974, 1.5552107095718384, -0.4733087718486786, -1.6385712623596191, -1.5182667970657349, 0.8401462435722351, 0.41328683495521545, -0.7831951379776001, 0.32805728912353516, -0.3103656768798828, 0.05354303494095802, 0.05126352608203888, 1.038202166557312, 1.2942278385162354, 0.6123990416526794, -0.2864396572113037, -0.746595561504364, 0.3417343497276306, 0.06633946299552917, -0.7861201167106628, -1.7387080192565918, -0.32997411489486694, -0.009916987270116806, 0.694517970085144, -1.2270053625106812, 1.6914478540420532, 0.7979854941368103, 1.935732364654541, 1.0710164308547974, -0.3038640320301056, 1.3772963285446167, -0.06773671507835388, 1.9495398998260498, -0.4903416931629181, 0.7016749382019043, -0.25617799162864685, -1.2028201818466187, 0.9395847320556641, -0.40125611424446106, -2.0122318267822266, -0.893817663192749, -0.7918545603752136, -0.1541653871536255, -0.7517402768135071, 0.9704885482788086, -0.2501964867115021, -1.5192972421646118, 0.1916491538286209, -0.6623945236206055, 0.3021387457847595, -1.3834410905838013, 0.2755369246006012, 0.6618921160697937, -0.4468006193637848, -0.011260105296969414, -0.25701647996902466, -1.38144052028656, -0.19149082899093628, 0.18871435523033142, 1.9493796825408936, -0.7846910357475281, 0.9252446293830872, 0.8886171579360962, -0.6849731802940369, 0.004748238250613213, 0.36489805579185486, -0.3743962049484253, 0.8207756280899048, -1.2579060792922974, -0.4011404812335968, 1.2485167980194092, -0.18084213137626648, -0.5574506521224976, 1.4184216260910034, 0.8262803554534912, -0.9307971000671387, -0.17065708339214325, -0.3585309386253357, -0.855022668838501, 0.01461098063737154, -1.7011017799377441, -0.1805087924003601, 0.2952272891998291, -1.3830379247665405, -0.5325049757957458, -0.2113497257232666, 1.3325376510620117, -0.04294542595744133, 1.4365655183792114, -0.344876766204834, -0.14705151319503784, -0.4772785007953644, -0.3803451955318451, 0.37137869000434875, -0.2592783272266388, -0.5765138864517212, 0.261300653219223, -0.8155817985534668, 0.128775954246521, 1.5504440069198608, 0.377777636051178, 0.15427906811237335, 0.5989043712615967, 0.9342102408409119, 0.34406208992004395, -0.14872020483016968, -0.9230552911758423, -1.6181292533874512, 2.00083065032959, -1.443808913230896, 1.8987163305282593, 0.7009629607200623, -0.04567117244005203, -1.8904640674591064, -2.034552574157715, 1.260282039642334, 1.3473628759384155, 2.3587229251861572, 0.4279876947402954, 0.44497349858283997, -0.7205092906951904, -0.7456001043319702, 0.1972024142742157, -1.2411184310913086, -0.7030687928199768, 0.21054981648921967, 2.2972705364227295, 1.7088383436203003, -0.5930537581443787, -0.19355663657188416, -1.1759470701217651, 1.0541194677352905, 0.10363077372312546, 0.07002697139978409, 2.0131025314331055, -0.36334481835365295, -0.9341138601303101, 1.0401065349578857, -2.358966827392578, 0.11710827052593231, 1.9786769151687622, 0.07614079862833023, 0.10943665355443954, -1.4830141067504883, -0.7361075282096863, -0.10754901170730591, -0.34742453694343567, -1.2882970571517944, 0.8203420639038086, -0.19302117824554443, -0.8008549809455872, -1.4697673320770264, 0.12276825308799744, -1.0617417097091675, -1.6536009311676025, 0.2705170214176178, 1.7986737489700317, 2.0618703365325928, -1.1109877824783325, 1.5095582008361816, -0.10928647220134735, 0.04263132065534592, 1.3326681852340698, 1.0890291929244995, 2.966953992843628, 2.0529839992523193, -1.3242465257644653, 0.9045997858047485, -0.14017362892627716, -0.3511925935745239, 1.1997934579849243, -1.1206533908843994, 1.2228885889053345, -0.4320628345012665, -1.2173165082931519, -1.1855924129486084, 0.847896933555603, 0.5111280083656311, 0.020405426621437073, -0.3368585407733917, 1.3662052154541016, 0.02969895303249359, 1.365217924118042, 0.5998881459236145, -0.4599572718143463, 0.6292757987976074, -0.4433639645576477, -0.2917160093784332, 1.5426957607269287, 0.24066247045993805, -1.4161409139633179, -2.1879656314849854, -0.17371205985546112, -0.9633553624153137, -0.163040891289711, -0.6291078925132751, -0.975571870803833, 1.4795328378677368, 0.6230859160423279, -1.1855367422103882, -0.3447994589805603, -0.23071177303791046, -0.5546306371688843, 2.7412195205688477, -1.5908422470092773, -0.23112544417381287, -0.9460236430168152, -0.3302341401576996, 1.7795846462249756, -1.1296133995056152, -0.31641897559165955, -1.0167732238769531, -0.6624298095703125, -1.2788790464401245, -0.531990110874176, 0.01689225062727928, -1.01502525806427, 0.6368860602378845, -0.11982016265392303, -1.2257626056671143, -0.21991348266601562, -0.8379235863685608, 0.8244529962539673, 0.0591915063560009, 0.4529556632041931, 1.986026406288147, 0.33121591806411743, -0.5712884664535522, 0.7652308344841003, 1.2640013694763184, 0.6046457290649414, -0.7827538251876831, 0.10263031721115112, -0.9016129374504089, 0.31432971358299255, -1.3311944007873535, 0.07148291915655136, -2.8545045852661133, 0.5261574387550354, -0.08030405640602112, -0.1449400931596756, -0.13770689070224762, -1.3426791429519653, 1.2199538946151733, 2.349229574203491, -1.2030055522918701, 0.5057925581932068, 0.295411616563797, 1.3778924942016602, -1.452719807624817, 0.43806323409080505, -0.458910197019577, 1.981689691543579, 0.31513383984565735, 1.2289886474609375, -0.33498212695121765, -2.0478641986846924, 0.7691957950592041, -1.2770355939865112, -0.9817100167274475, 0.7401266098022461, -0.9601317048072815, -0.02319001406431198, -1.3706573247909546, -0.22407549619674683, -0.8224524855613708, -1.3953518867492676, 0.6087347865104675, 0.19200575351715088, 0.4075580835342407, -0.6355810165405273, 0.3845261037349701, -2.093930959701538, -1.2151057720184326, -0.27835676074028015, -0.9708420038223267, 0.3107011318206787, -0.31123343110084534, 0.6466027498245239, -0.3348258137702942, 0.26373594999313354, 0.3515227437019348, 1.3048105239868164, 3.386861801147461, 0.2123597264289856, 0.3947086036205292, -0.18480508029460907, -0.878052294254303, 1.4186867475509644, 1.0724974870681763, -0.07553885877132416, -0.7582983374595642, -0.828849732875824, 1.4265356063842773, 1.8174742460250854, 1.0749492645263672, 0.21788406372070312, -0.8584708571434021, -0.5698269009590149, 0.012188197113573551, 0.20599818229675293, 0.28768622875213623, 0.8870058059692383, -0.020893126726150513, 0.13031518459320068, 1.4152319431304932, 1.1822082996368408, -0.5729497671127319, 0.4669649004936218, -0.9376314282417297, -0.18785764276981354, 0.5672919154167175, 0.43120458722114563, 0.006804578937590122, 0.2614342272281647, -1.0346838235855103, -0.3659534156322479, -0.15971343219280243, -0.9854234457015991, -0.8767269253730774, -0.23691363632678986, -0.37590906023979187, 1.6173561811447144, 0.14765200018882751, -0.5157318711280823, -0.08379784226417542, -0.696549654006958, -0.09103032201528549, -1.0293885469436646, 0.08444985002279282, -0.16399922966957092, -0.0005569597706198692, 0.048613645136356354, 1.9610178470611572, -1.0602904558181763, -2.2611236572265625, 0.2648122310638428, 0.26899632811546326, -0.2699544131755829, 0.023161500692367554, 1.7149547338485718, 0.47205570340156555, 1.422706961631775, 1.2395178079605103, 1.048990249633789, -0.8033263683319092, -1.3810347318649292, 0.6773694157600403, 1.0254827737808228, -1.571784257888794, 0.7700903415679932, -0.03187889978289604, -0.33466842770576477, 0.6232161521911621, 1.331587314605713, 0.38713470101356506, -1.9142166376113892, 0.7673794627189636, -0.9156046509742737, 0.8284022808074951, 0.66154545545578, 0.9411612153053284, 0.35019102692604065, 0.8741345405578613, -1.2795109748840332, -1.1982145309448242, -0.7213418483734131, -0.4879416525363922, 2.060051918029785, -0.15559865534305573, 0.6729885339736938, -0.022963184863328934, -1.0651592016220093, -0.05237685143947601, 0.8010047674179077, 0.06602858006954193, -0.44537532329559326, 0.9022150635719299, -0.5821133852005005, -1.0305349826812744, -1.3573517799377441, -0.5589305758476257, -0.9261698722839355, -0.9580627679824829, 1.077565312385559, 0.8774007558822632, 0.32391759753227234, 1.8972405195236206, 0.4893511235713959, 0.4181976318359375, -2.680415391921997, 0.9507572650909424, 0.18690361082553864, 0.15296940505504608, 0.8238692879676819, 0.23870064318180084, 1.0575464963912964, -0.06432965397834778, 0.43340039253234863, -2.4113528728485107, 2.3105437755584717, -0.3321935534477234, 0.6468677520751953, 0.027048543095588684, 0.025279104709625244, 1.1224170923233032, 0.5242463946342468, 0.684181809425354, -0.9905419945716858, 0.6678725481033325, -0.5398277640342712, 1.2859607934951782, 0.955607533454895, -0.8364635109901428, 0.0474022813141346, 1.2374191284179688, 0.47421231865882874, -0.3312402367591858, -0.9004095196723938, -0.75965416431427, 0.9528465270996094, 1.6440707445144653, 0.06699224561452866, 0.07487048953771591, 0.7924694418907166, 0.45354774594306946, -1.2170252799987793, -0.08196263015270233, -0.7306413054466248, -0.5605113506317139, 1.6062198877334595, 2.0833709239959717, -0.08308064192533493, -0.05549632012844086, -0.730682373046875, -1.169611930847168, 0.7553886771202087, -0.1212705671787262, 0.19484080374240875, 0.7326080799102783, -0.6241724491119385, 1.110231876373291, 0.5122827291488647, 0.8615716695785522, 0.25486570596694946, 0.28730249404907227, 0.46399247646331787, -0.147917240858078, -1.1146230697631836, -0.30813145637512207, -1.1732338666915894, -2.5804953575134277, 0.4602307677268982, -0.4496767520904541, -1.4627201557159424, 0.11948738992214203, -1.1087028980255127, 0.9703912734985352, -0.6192932724952698, -1.1334245204925537, -1.5355855226516724, 0.2652028501033783, -0.16475756466388702, 0.889225423336029, -1.649600863456726, -0.0738828182220459, 1.1434072256088257, 0.9531179070472717, -0.6971120834350586, 1.1766247749328613, 0.2946097254753113, 1.068781852722168, 0.7445365786552429, -0.15219062566757202, 0.4205284118652344, 0.004021250642836094, -1.302537202835083, 0.5492008924484253, 1.2664804458618164, 0.13824351131916046, 1.4554708003997803, -0.6300235390663147, 0.028287723660469055, 0.6141438484191895, -0.6662729382514954, -0.5995180010795593, -0.3157404661178589, 0.7209500074386597, 0.17663219571113586, -1.0330309867858887, -0.182414248585701, -0.21774493157863617, -0.2642895579338074, 0.2421981394290924, -1.5126965045928955, -0.28283050656318665, -0.367826372385025, -0.6235701441764832, -1.3238749504089355, 0.06160809472203255, 1.384508728981018, -0.7640707492828369, -0.313003808259964, 0.6556898951530457, 0.360432893037796, 0.4479803144931793, 0.5774155855178833, -0.696337103843689, -0.22302062809467316, -0.2867463529109955, -0.20490920543670654, 0.37952765822410583, 1.4535598754882812, -0.27030736207962036, -1.0412241220474243, 0.7693423628807068, -0.3966275453567505, 0.1104927584528923, 2.030256748199463, 0.31088268756866455, -0.8965652585029602, 0.27958768606185913, -0.7067795395851135, 2.000565528869629, 1.520218849182129, 1.397735834121704, 0.011664449237287045, -0.9444034099578857, 0.6406461596488953, -0.0981774777173996, -0.379345178604126, 0.7686437964439392, 0.3527672588825226, -0.28903520107269287, -1.4835426807403564, 0.5330434441566467, 1.2051546573638916, -0.8273684978485107, -0.8544682264328003, 0.035483747720718384, -0.7751961946487427, 1.118018388748169, 0.6805208325386047, 0.38192975521087646, 0.15206965804100037, 1.5901427268981934, 0.685651421546936, -0.5011966228485107, 0.3417833745479584, 0.4882888197898865, 0.09280642867088318, -2.1923367977142334, -0.8516841530799866, 0.3884000778198242, -0.39658644795417786, -1.528562307357788, 1.3491445779800415, -1.1342780590057373, -0.9664400219917297, 0.48968467116355896, 0.12731735408306122, 1.3810997009277344, 0.3581504821777344, 1.540160894393921, 1.8966103792190552, 0.986767053604126, 0.19173215329647064, 1.3847508430480957, -0.13954968750476837, -0.3977295458316803, 1.8633469343185425, -0.5020268559455872, 0.4039919078350067, 1.04396653175354, -0.48239338397979736, -1.0528000593185425, -0.6911473870277405, -0.9893909096717834, -0.6212592720985413, 1.186498761177063, 0.17369011044502258, -1.035438060760498, 0.19445708394050598, 1.3898192644119263, -0.10302885621786118, -0.37450966238975525, 0.5963998436927795, 0.4706554412841797, -0.707539975643158, -0.037834130227565765, -0.8021907806396484, 0.43837717175483704, -0.14447470009326935, -0.38584330677986145, 0.33007773756980896, 0.6114779114723206, 1.225952386856079, -0.11145216226577759, 0.11271939426660538, 1.2378376722335815, -1.5133253335952759, 1.531463623046875, -0.5933477282524109, 0.21874596178531647, -2.4803380966186523, 1.3810089826583862, -0.5986397862434387, 1.7330913543701172, -2.7709882259368896, 0.37768882513046265, -0.4253479540348053, -0.5130508542060852, 0.3524879515171051, -0.3335530161857605, 0.057813528925180435, -0.15670976042747498, -1.0711828470230103, 0.08721834421157837, -0.6745254397392273, 0.5791632533073425, 1.1083296537399292, 1.124712586402893, -1.1703537702560425, -0.25738173723220825, -1.8325845003128052, -0.03594273701310158, -0.7367462515830994, 0.2878456711769104, -2.063096284866333, -0.12266992032527924, -1.8852026462554932, -2.3526713848114014, -1.4015657901763916, -0.7320811152458191, 1.0980370044708252, 0.3975178301334381, -1.0517587661743164, 1.2011574506759644, -0.3792368471622467, -1.8194218873977661, 1.0681798458099365, -2.2139623165130615 ]
https://github.com/huggingface/datasets/issues/4407
Dataset Viewer issue for conll2012_ontonotesv5
Fixed, thanks for the patience. The issue was the amount of RAM allowed to extract the first rows of the dataset was not sufficient.
### Link https://huggingface.co/datasets/conll2012_ontonotesv5 ### Description Dataset viewer outage. ### Owner No
741
24
Dataset Viewer issue for conll2012_ontonotesv5 ### Link https://huggingface.co/datasets/conll2012_ontonotesv5 ### Description Dataset viewer outage. ### Owner No Fixed, thanks for the patience. The issue was the amount of RAM allowed to extract the first rows of the dataset was not sufficient.
[ -1.1939119100570679, -0.9299069046974182, -0.9715647101402283, 1.4413865804672241, -0.16316170990467072, -1.3876514434814453, 0.20913644134998322, -0.8522853255271912, 1.7164535522460938, -0.6820325255393982, 0.11149228364229202, -1.7893260717391968, -0.09193351119756699, -0.5104590654373169, -0.5858222842216492, -0.9711236953735352, -0.39357230067253113, -0.5991656184196472, 1.117515206336975, 2.608280897140503, 1.111912727355957, -1.173542857170105, 2.6736600399017334, 0.7204375863075256, -0.309417724609375, -0.9247058033943176, 0.6916100382804871, -0.06930708885192871, -1.2683850526809692, -0.5017372369766235, -1.0771406888961792, 0.1492510586977005, -0.45444127917289734, -0.4291211664676666, 0.0379616804420948, 0.4945419728755951, -0.1337040811777115, -0.39405614137649536, -0.4714182913303375, -0.8059813380241394, 0.181179478764534, -0.346382200717926, 0.8363372087478638, -0.4858410656452179, 1.9862713813781738, -0.5386165976524353, 0.34534788131713867, 0.7187063694000244, 1.2388372421264648, 0.06642100214958191, -0.09961660206317902, 0.19636544585227966, 0.4305950999259949, -0.11345258355140686, 0.34651219844818115, 1.1599911451339722, 0.3765240013599396, 0.49575695395469666, 0.6374623775482178, -2.1286745071411133, 1.4116770029067993, -0.9175249338150024, 0.2618805766105652, 1.4641494750976562, -1.2308706045150757, 0.5282673239707947, -1.6764106750488281, 0.03416220098733902, 0.47873419523239136, -2.234276533126831, 0.30547648668289185, -1.2709649801254272, -0.6511566042900085, 0.901137113571167, 0.44380590319633484, -1.4769561290740967, 0.06867057085037231, -0.5817098021507263, 1.1044456958770752, 0.6408134698867798, 1.3057628870010376, -1.7017865180969238, 0.09116094559431076, -0.3870842158794403, -0.08284687250852585, -1.4586282968521118, -1.449178695678711, 0.6563689112663269, 0.8157158493995667, 0.7022613883018494, -0.04166031256318092, 0.7977945804595947, -0.8934961557388306, 0.7377216815948486, -0.667182981967926, -1.8024834394454956, -1.3819419145584106, -2.2977569103240967, -2.3463785648345947, 0.8226272463798523, -0.4300313889980316, -0.5515400171279907, 1.89656662940979, -0.9892995953559875, -1.7486586570739746, 1.306272029876709, 0.09864450246095657, -0.10598932206630707, 2.4934744834899902, 0.469278484582901, -0.5522189736366272, 0.1968163549900055, -0.6276512742042542, 0.7837498188018799, -0.6898083686828613, 1.2619034051895142, 0.5167958736419678, -1.05499267578125, 1.6094059944152832, -0.4738685190677643, 0.6867174506187439, -0.6605386734008789, -0.529102623462677, -0.8817875981330872, 0.4001493752002716, 1.927059531211853, -0.5103299617767334, 1.5654022693634033, -0.4990406036376953, -1.578231930732727, -1.657806634902954, 0.9094206690788269, 0.29914209246635437, -0.7264919877052307, 0.3418062925338745, -0.16527141630649567, 0.041982222348451614, -0.01434609666466713, 1.0277001857757568, 1.2975902557373047, 0.5673705339431763, -0.2684786915779114, -0.7432392239570618, 0.35224011540412903, 0.043998751789331436, -0.7702285051345825, -1.7118172645568848, -0.3918572962284088, 0.07751704007387161, 0.7132561206817627, -1.2235950231552124, 1.5757472515106201, 0.8444761037826538, 1.9296891689300537, 1.08804190158844, -0.3063071370124817, 1.4027669429779053, -0.11488156020641327, 1.966940999031067, -0.4938574731349945, 0.48824256658554077, -0.22206857800483704, -1.2218384742736816, 0.8338823914527893, -0.3781577944755554, -2.0072200298309326, -0.9423670172691345, -0.794904351234436, -0.19190546870231628, -0.676798403263092, 0.9524368047714233, -0.23492112755775452, -1.4144207239151, 0.1754276007413864, -0.6682369709014893, 0.10858431458473206, -1.5020747184753418, 0.20900249481201172, 0.6471139788627625, -0.5964688062667847, -0.006551102735102177, -0.300959974527359, -1.4401761293411255, -0.28662246465682983, 0.25831305980682373, 1.9093670845031738, -0.7122729420661926, 0.9978904724121094, 0.8606407642364502, -0.7663981914520264, -0.041460584849119186, 0.40083977580070496, -0.2603539228439331, 0.9172652959823608, -1.2007379531860352, -0.45165368914604187, 1.3023247718811035, -0.24914026260375977, -0.5977872014045715, 1.3986353874206543, 0.7521427273750305, -0.9858191609382629, -0.11349567770957947, -0.35443490743637085, -0.8597828149795532, 0.04622422903776169, -1.697663426399231, -0.23072534799575806, 0.2364065796136856, -1.4425785541534424, -0.6632511019706726, -0.29771924018859863, 1.2566462755203247, 0.07924576848745346, 1.3807154893875122, -0.26994508504867554, -0.1848343461751938, -0.417949914932251, -0.40245911478996277, 0.2606901228427887, -0.2782640755176544, -0.5985265970230103, 0.24250942468643188, -0.8669090270996094, 0.15490581095218658, 1.4576232433319092, 0.4127688705921173, 0.16832947731018066, 0.7220122814178467, 0.9680396318435669, 0.35301241278648376, -0.2239319086074829, -0.9012097120285034, -1.602695345878601, 2.0279910564422607, -1.3087931871414185, 1.8332253694534302, 0.7466217875480652, -0.09673812240362167, -1.9118560552597046, -2.004220962524414, 1.3646067380905151, 1.2137213945388794, 2.332498788833618, 0.49307045340538025, 0.4849802553653717, -0.775765061378479, -0.8188400864601135, 0.14900490641593933, -1.1919869184494019, -0.7207913994789124, 0.17124758660793304, 2.3282201290130615, 1.7784392833709717, -0.5724005699157715, -0.19141103327274323, -1.2011290788650513, 0.980809211730957, 0.07759364694356918, -0.04972856491804123, 1.9080185890197754, -0.36525022983551025, -0.8174373507499695, 0.9803828001022339, -2.197875738143921, 0.0361194871366024, 1.9682027101516724, 0.0565209835767746, 0.11134662479162216, -1.4813584089279175, -0.8712397217750549, -0.10156969726085663, -0.3385642468929291, -1.2862052917480469, 0.6689072847366333, -0.2955467700958252, -0.8428717255592346, -1.454877257347107, 0.11527092009782791, -1.0543248653411865, -1.5184245109558105, 0.21730497479438782, 1.9081199169158936, 1.8341243267059326, -0.9653927087783813, 1.5098475217819214, -0.003790765069425106, -0.05017797276377678, 1.3622294664382935, 1.0856462717056274, 3.0821003913879395, 2.0239667892456055, -1.3175615072250366, 0.8385369181632996, 0.025272268801927567, -0.31924521923065186, 1.2065067291259766, -1.041622519493103, 1.339512825012207, -0.4386346936225891, -1.2704277038574219, -1.263397455215454, 0.8534085154533386, 0.4878576695919037, 0.004389265552163124, -0.42085200548171997, 1.4413758516311646, -0.10565366595983505, 1.3035097122192383, 0.629729151725769, -0.5741662383079529, 0.7000477313995361, -0.45382270216941833, -0.2509743273258209, 1.5193336009979248, 0.30141255259513855, -1.401738166809082, -2.1807186603546143, -0.19058609008789062, -0.9120786190032959, -0.12149795889854431, -0.7039525508880615, -0.9670683145523071, 1.546251654624939, 0.6104167103767395, -1.164427399635315, -0.42315688729286194, -0.3059375286102295, -0.6534853577613831, 2.692775011062622, -1.5529038906097412, -0.2406816929578781, -0.9416874051094055, -0.2683681547641754, 1.6672371625900269, -1.2319303750991821, -0.2996448874473572, -1.0941370725631714, -0.7256560921669006, -1.2231251001358032, -0.4668748378753662, 0.013073346577584743, -0.9188345670700073, 0.8487876057624817, -0.1743336021900177, -1.1973981857299805, -0.11767470091581345, -0.8348983526229858, 0.7578288912773132, -0.013782704249024391, 0.3657582402229309, 2.0618653297424316, 0.5659540891647339, -0.46123600006103516, 0.6785072088241577, 1.1424555778503418, 0.5861289501190186, -0.6753684878349304, 0.10756669193506241, -0.7925456762313843, 0.32569462060928345, -1.2986587285995483, 0.16084881126880646, -2.786325693130493, 0.479098916053772, -0.16860800981521606, -0.06918280571699142, -0.04868357256054878, -1.2485640048980713, 1.0127440690994263, 2.4274775981903076, -1.278700590133667, 0.40174949169158936, 0.2200474888086319, 1.279649257659912, -1.4506465196609497, 0.4520053267478943, -0.5434337258338928, 2.009133815765381, 0.15747186541557312, 1.1480720043182373, -0.36676937341690063, -1.8531981706619263, 0.6921982765197754, -1.2632431983947754, -1.0348786115646362, 0.8004342317581177, -0.861642599105835, -0.05004158988595009, -1.32590913772583, -0.19176290929317474, -0.7194654941558838, -1.399999737739563, 0.8332421779632568, 0.227438822388649, 0.5085955262184143, -0.4776119887828827, 0.3595905303955078, -2.0776865482330322, -1.2407214641571045, -0.33473876118659973, -0.9805338382720947, 0.36673396825790405, -0.3053181767463684, 0.6329749226570129, -0.30956214666366577, 0.22090788185596466, 0.2189352810382843, 1.2257168292999268, 3.3506927490234375, 0.12122584134340286, 0.255758672952652, -0.20520992577075958, -0.9162206053733826, 1.4658679962158203, 1.064393401145935, -0.07394987344741821, -0.7239392995834351, -0.9057257175445557, 1.4867366552352905, 1.8208353519439697, 1.1095540523529053, 0.3135387897491455, -0.7471355199813843, -0.5566586852073669, 0.0690406784415245, 0.18993090093135834, 0.4198341369628906, 0.8481273055076599, -0.034289248287677765, 0.13418839871883392, 1.4781520366668701, 1.2629916667938232, -0.39842739701271057, 0.5970544219017029, -0.8587132692337036, -0.23719023168087006, 0.5703269839286804, 0.4708179831504822, 0.03212033212184906, 0.23062148690223694, -1.090014100074768, -0.38346168398857117, -0.2740528881549835, -1.10908842086792, -0.7995098233222961, -0.22366802394390106, -0.3713242709636688, 1.6331850290298462, 0.1359851062297821, -0.540233850479126, -0.1082182452082634, -0.7745301127433777, -0.12808969616889954, -1.0866447687149048, 0.1996067464351654, -0.1593008041381836, 0.014639639295637608, 0.05124461278319359, 1.8804234266281128, -1.2315475940704346, -2.3881471157073975, 0.23144562542438507, 0.20315611362457275, -0.264875590801239, 0.049337711185216904, 1.5492162704467773, 0.451620489358902, 1.4703655242919922, 1.2234961986541748, 1.0263606309890747, -0.8988487124443054, -1.214321494102478, 0.49490687251091003, 0.9946233034133911, -1.5257052183151245, 0.8558099865913391, 0.03993561118841171, -0.4551321268081665, 0.7996646761894226, 1.263319492340088, 0.3898630142211914, -1.8824766874313354, 0.7997387647628784, -0.7813820838928223, 0.7047425508499146, 0.5807600021362305, 0.9519220590591431, 0.3779100775718689, 0.8261081576347351, -1.324961543083191, -1.2337028980255127, -0.6235603094100952, -0.4952162206172943, 2.0965583324432373, -0.054234396666288376, 0.6225693225860596, -0.0819973275065422, -1.1635570526123047, -0.06996641308069229, 0.744988203048706, 0.2814764976501465, -0.4121335446834564, 0.8598427772521973, -0.6069267988204956, -1.0495046377182007, -1.5351191759109497, -0.622696578502655, -0.8745213747024536, -0.868606448173523, 1.14581298828125, 0.9726037383079529, 0.30721572041511536, 1.881240963935852, 0.46547526121139526, 0.32461437582969666, -2.5831682682037354, 0.8602743148803711, 0.2804495096206665, 0.1989177167415619, 0.8473667502403259, 0.3747188448905945, 1.0098685026168823, -0.05400780960917473, 0.3898228108882904, -2.2413365840911865, 2.2707576751708984, -0.33078625798225403, 0.6434469223022461, -0.02874664217233658, -0.010744539089500904, 1.0287113189697266, 0.5448854565620422, 0.7570350766181946, -0.955467164516449, 0.6950019001960754, -0.5546190738677979, 1.2201814651489258, 1.1393382549285889, -0.8429692387580872, 0.04418843612074852, 1.3475972414016724, 0.5769587159156799, -0.24316763877868652, -0.9720190763473511, -0.7164671421051025, 0.9987655878067017, 1.6983352899551392, 0.08645449578762054, 0.1563989818096161, 0.8117660284042358, 0.3726744055747986, -1.349579095840454, 0.018342167139053345, -0.7715798020362854, -0.5198935270309448, 1.5088818073272705, 1.9729337692260742, -0.12409120053052902, -0.08742433786392212, -0.7929632067680359, -1.185321569442749, 0.6722950339317322, -0.08552148193120956, 0.07964465022087097, 0.8077600598335266, -0.7069657444953918, 1.1227554082870483, 0.5331947803497314, 0.8961198329925537, 0.13580574095249176, 0.23960992693901062, 0.5164792537689209, -0.17463204264640808, -1.2076011896133423, -0.27008697390556335, -1.0302969217300415, -2.5082149505615234, 0.47691425681114197, -0.5014981627464294, -1.5040817260742188, 0.06555762887001038, -1.1262524127960205, 1.0494732856750488, -0.5278752446174622, -1.2017544507980347, -1.5346769094467163, 0.1898546814918518, -0.12394802272319794, 0.8359838724136353, -1.6503934860229492, -0.10969989746809006, 1.2337853908538818, 0.9150083065032959, -0.7026668190956116, 1.0437874794006348, 0.30145981907844543, 1.1407809257507324, 0.7909290790557861, -0.14842209219932556, 0.28084683418273926, -0.09919667989015579, -1.4120707511901855, 0.5245450735092163, 1.190585732460022, 0.17343644797801971, 1.4710557460784912, -0.6340917348861694, -0.030759338289499283, 0.5740206241607666, -0.49138620495796204, -0.5774304270744324, -0.30489155650138855, 0.6758490204811096, 0.10198564827442169, -0.9379172325134277, -0.05891503393650055, -0.19574867188930511, -0.28487324714660645, 0.25044143199920654, -1.4707324504852295, -0.3555406630039215, -0.3383340537548065, -0.5636079907417297, -1.3376259803771973, 0.03369516134262085, 1.322716236114502, -0.697008490562439, -0.4510914385318756, 0.6293979287147522, 0.533703625202179, 0.4964371621608734, 0.5294228792190552, -0.5388554334640503, -0.15406347811222076, -0.35761958360671997, -0.3413209915161133, 0.33308011293411255, 1.517411708831787, -0.43757155537605286, -1.1332855224609375, 0.8096407055854797, -0.4030555486679077, -0.003822542726993561, 2.045079469680786, 0.32871484756469727, -0.9693087339401245, 0.2298511564731598, -0.6925627589225769, 1.934555172920227, 1.5343530178070068, 1.4174784421920776, 0.0015293089672923088, -0.8770148158073425, 0.6550328731536865, -0.028210915625095367, -0.4484178125858307, 0.8311843872070312, 0.44942790269851685, -0.2736265957355499, -1.5510092973709106, 0.5010207295417786, 1.2033690214157104, -0.9099371433258057, -0.8325389623641968, 0.016990404576063156, -0.8164039254188538, 1.0283197164535522, 0.8519276976585388, 0.4010283648967743, 0.12870395183563232, 1.5926579236984253, 0.6430066823959351, -0.4236755669116974, 0.37717992067337036, 0.4291691780090332, 0.09585000574588776, -2.1204676628112793, -0.871902346611023, 0.363696813583374, -0.3890374004840851, -1.5441884994506836, 1.344484567642212, -1.1932412385940552, -1.0724103450775146, 0.46093636751174927, 0.22056066989898682, 1.5257599353790283, 0.3242366313934326, 1.6303012371063232, 1.9142626523971558, 1.0843079090118408, 0.23276446759700775, 1.4574576616287231, -0.11816952377557755, -0.3397132456302643, 1.770979642868042, -0.4261414110660553, 0.44974008202552795, 1.1069252490997314, -0.4296901822090149, -1.047738790512085, -0.6114428043365479, -0.992235004901886, -0.5571373105049133, 1.244940996170044, 0.05935634672641754, -0.9359645247459412, 0.1824050098657608, 1.3962887525558472, 0.06823869049549103, -0.33926260471343994, 0.5212494134902954, 0.5380759239196777, -0.7072390913963318, -0.022494321689009666, -0.7945565581321716, 0.4298761487007141, -0.15072551369667053, -0.4037168622016907, 0.38669729232788086, 0.5475919246673584, 1.3870960474014282, -0.05682625621557236, 0.28112107515335083, 1.3774548768997192, -1.4093586206436157, 1.5063432455062866, -0.6397833228111267, 0.02462657541036606, -2.514439105987549, 1.505806565284729, -0.7406032085418701, 1.635398507118225, -2.7041609287261963, 0.46907663345336914, -0.43492546677589417, -0.3510586619377136, 0.3807006776332855, -0.339266300201416, -0.03607422113418579, -0.17701071500778198, -1.0464694499969482, 0.1849326193332672, -0.6633631587028503, 0.541438102722168, 1.272475004196167, 1.1432517766952515, -1.0484135150909424, -0.26653778553009033, -1.8628880977630615, -0.11781010031700134, -0.8571503162384033, 0.38932302594184875, -2.00954532623291, -0.11735265702009201, -1.7488282918930054, -2.5860989093780518, -1.385526180267334, -0.7822636365890503, 1.1197000741958618, 0.43926724791526794, -1.0778242349624634, 1.291717290878296, -0.3599991798400879, -1.869092345237732, 0.9970568418502808, -2.209040403366089 ]
https://github.com/huggingface/datasets/issues/4405
[TypeError: Couldn't cast array of type] Cannot process dataset in v2.2.2
And if the problem is that the way I am to construct the {Entity Type: list of spans} makes entity types without any spans hard to handle, is there a better way to meet the demand? Although I have verified that to make entity types without any spans to behave like `entity_chunk[label] = [[""]]` can perform normally, I still wonder if there is a more elegant way?
## Describe the bug I am trying to process the [conll2012_ontonotesv5](https://huggingface.co/datasets/conll2012_ontonotesv5) dataset in `datasets` v2.2.2 and am running into a type error when casting the features. ## Steps to reproduce the bug ```python import os from typing import ( List, Dict, ) from collections import ( defaultdict, ) from dataclasses import ( dataclass, ) from datasets import ( load_dataset, ) @dataclass class ConllConverter: path: str name: str cache_dir: str def __post_init__( self, ): self.dataset = load_dataset( path=self.path, name=self.name, cache_dir=self.cache_dir, ) def convert( self, ): class_label = self.dataset["train"].features["sentences"][0]["named_entities"].feature # label_set = list(set([ # label.split("-")[1] if label != "O" else label for label in class_label.names # ])) def prepare_chunk(token, entity): assert len(token) == len(entity) # Sequence length length = len(token) # Variable used entity_chunk = defaultdict(list) idx = flag = 0 # While loop while idx < length: if entity[idx] == "O": flag += 1 idx += 1 else: iob_tp, lab_tp = entity[idx].split("-") assert iob_tp == "B" idx += 1 while idx < length and entity[idx].startswith("I-"): idx += 1 entity_chunk[lab_tp].append(token[flag: idx]) flag = idx entity_chunk = dict(entity_chunk) # for label in label_set: # if label != "O" and label not in entity_chunk.keys(): # entity_chunk[label] = None return entity_chunk def prepare_features( batch: Dict[str, List], ) -> Dict[str, List]: sentence = [ sent for doc_sent in batch["sentences"] for sent in doc_sent ] feature = { "sentence": list(), } for sent in sentence: token = sent["words"] entity = class_label.int2str(sent["named_entities"]) entity_chunk = prepare_chunk(token, entity) sent_feat = { "token": token, "entity": entity, "entity_chunk": entity_chunk, } feature["sentence"].append(sent_feat) return feature column_names = self.dataset.column_names["train"] dataset = self.dataset.map( function=prepare_features, with_indices=False, batched=True, batch_size=3, remove_columns=column_names, num_proc=1, ) dataset.save_to_disk( dataset_dict_path=os.path.join("data", self.path, self.name) ) if __name__ == "__main__": converter = ConllConverter( path="conll2012_ontonotesv5", name="english_v4", cache_dir="cache", ) converter.convert() ``` ## Expected results I want to use the dataset to perform NER task and to change the label list into a {Entity Type: list of spans} format. ## Actual results <details> <summary>Traceback</summary> ```python Traceback (most recent call last): | 0/81 [00:00<?, ?ba/s] File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 532, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 499, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/fingerprint.py", line 458, in wrapper out = func(self, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2751, in _map_single writer.write_batch(batch) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 503, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 230, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 198, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1675, in wrapper return func(array, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1793, in cast_array_to_feature arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1793, in <listcomp> arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1675, in wrapper return func(array, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1844, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type struct<CARDINAL: list<item: list<item: string>>, DATE: list<item: list<item: string>>, EVENT: list<item: list<item: string>>, FAC: list<item: list<item: string>>, GPE: list<item: list<item: string>>, LANGUAGE: list<item: list<item: string>>, LAW: list<item: list<item: string>>, LOC: list<item: list<item: string>>, MONEY: list<item: list<item: string>>, NORP: list<item: list<item: string>>, ORDINAL: list<item: list<item: string>>, ORG: list<item: list<item: string>>, PERCENT: list<item: list<item: string>>, PERSON: list<item: list<item: string>>, QUANTITY: list<item: list<item: string>>, TIME: list<item: list<item: string>>, WORK_OF_ART: list<item: list<item: string>>> to {'CARDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'DATE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'EVENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'FAC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'GPE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LAW': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LOC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'MONEY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'NORP': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORG': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERCENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERSON': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PRODUCT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'QUANTITY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'TIME': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'WORK_OF_ART': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None)} """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home2/jiangwangyi/workspace/work/Entity/dataconverter.py", line 110, in <module> converter.convert() File "/home2/jiangwangyi/workspace/work/Entity/dataconverter.py", line 91, in convert dataset = self.dataset.map( File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/dataset_dict.py", line 770, in map { File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/dataset_dict.py", line 771, in <dictcomp> k: dataset.map( File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2459, in map transformed_shards[index] = async_result.get() File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/multiprocess/pool.py", line 771, in get raise self._value TypeError: Couldn't cast array of type struct<CARDINAL: list<item: list<item: string>>, DATE: list<item: list<item: string>>, EVENT: list<item: list<item: string>>, FAC: list<item: list<item: string>>, GPE: list<item: list<item: string>>, LANGUAGE: list<item: list<item: string>>, LAW: list<item: list<item: string>>, LOC: list<item: list<item: string>>, MONEY: list<item: list<item: string>>, NORP: list<item: list<item: string>>, ORDINAL: list<item: list<item: string>>, ORG: list<item: list<item: string>>, PERCENT: list<item: list<item: string>>, PERSON: list<item: list<item: string>>, QUANTITY: list<item: list<item: string>>, TIME: list<item: list<item: string>>, WORK_OF_ART: list<item: list<item: string>>> to {'CARDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'DATE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'EVENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'FAC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'GPE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LAW': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LOC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'MONEY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'NORP': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORG': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERCENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERSON': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PRODUCT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'QUANTITY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'TIME': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'WORK_OF_ART': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Ubuntu 18.04 - Python version: 3.9.7 - PyArrow version: 7.0.0
742
67
[TypeError: Couldn't cast array of type] Cannot process dataset in v2.2.2 ## Describe the bug I am trying to process the [conll2012_ontonotesv5](https://huggingface.co/datasets/conll2012_ontonotesv5) dataset in `datasets` v2.2.2 and am running into a type error when casting the features. ## Steps to reproduce the bug ```python import os from typing import ( List, Dict, ) from collections import ( defaultdict, ) from dataclasses import ( dataclass, ) from datasets import ( load_dataset, ) @dataclass class ConllConverter: path: str name: str cache_dir: str def __post_init__( self, ): self.dataset = load_dataset( path=self.path, name=self.name, cache_dir=self.cache_dir, ) def convert( self, ): class_label = self.dataset["train"].features["sentences"][0]["named_entities"].feature # label_set = list(set([ # label.split("-")[1] if label != "O" else label for label in class_label.names # ])) def prepare_chunk(token, entity): assert len(token) == len(entity) # Sequence length length = len(token) # Variable used entity_chunk = defaultdict(list) idx = flag = 0 # While loop while idx < length: if entity[idx] == "O": flag += 1 idx += 1 else: iob_tp, lab_tp = entity[idx].split("-") assert iob_tp == "B" idx += 1 while idx < length and entity[idx].startswith("I-"): idx += 1 entity_chunk[lab_tp].append(token[flag: idx]) flag = idx entity_chunk = dict(entity_chunk) # for label in label_set: # if label != "O" and label not in entity_chunk.keys(): # entity_chunk[label] = None return entity_chunk def prepare_features( batch: Dict[str, List], ) -> Dict[str, List]: sentence = [ sent for doc_sent in batch["sentences"] for sent in doc_sent ] feature = { "sentence": list(), } for sent in sentence: token = sent["words"] entity = class_label.int2str(sent["named_entities"]) entity_chunk = prepare_chunk(token, entity) sent_feat = { "token": token, "entity": entity, "entity_chunk": entity_chunk, } feature["sentence"].append(sent_feat) return feature column_names = self.dataset.column_names["train"] dataset = self.dataset.map( function=prepare_features, with_indices=False, batched=True, batch_size=3, remove_columns=column_names, num_proc=1, ) dataset.save_to_disk( dataset_dict_path=os.path.join("data", self.path, self.name) ) if __name__ == "__main__": converter = ConllConverter( path="conll2012_ontonotesv5", name="english_v4", cache_dir="cache", ) converter.convert() ``` ## Expected results I want to use the dataset to perform NER task and to change the label list into a {Entity Type: list of spans} format. ## Actual results <details> <summary>Traceback</summary> ```python Traceback (most recent call last): | 0/81 [00:00<?, ?ba/s] File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/multiprocess/pool.py", line 125, in worker result = (True, func(*args, **kwds)) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 532, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 499, in wrapper out: Union["Dataset", "DatasetDict"] = func(self, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/fingerprint.py", line 458, in wrapper out = func(self, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2751, in _map_single writer.write_batch(batch) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 503, in write_batch arrays.append(pa.array(typed_sequence)) File "pyarrow/array.pxi", line 230, in pyarrow.lib.array File "pyarrow/array.pxi", line 110, in pyarrow.lib._handle_arrow_array_protocol File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_writer.py", line 198, in __arrow_array__ out = cast_array_to_feature(out, type, allow_number_to_str=not self.trying_type) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1675, in wrapper return func(array, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1793, in cast_array_to_feature arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1793, in <listcomp> arrays = [_c(array.field(name), subfeature) for name, subfeature in feature.items()] File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1675, in wrapper return func(array, *args, **kwargs) File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/table.py", line 1844, in cast_array_to_feature raise TypeError(f"Couldn't cast array of type\n{array.type}\nto\n{feature}") TypeError: Couldn't cast array of type struct<CARDINAL: list<item: list<item: string>>, DATE: list<item: list<item: string>>, EVENT: list<item: list<item: string>>, FAC: list<item: list<item: string>>, GPE: list<item: list<item: string>>, LANGUAGE: list<item: list<item: string>>, LAW: list<item: list<item: string>>, LOC: list<item: list<item: string>>, MONEY: list<item: list<item: string>>, NORP: list<item: list<item: string>>, ORDINAL: list<item: list<item: string>>, ORG: list<item: list<item: string>>, PERCENT: list<item: list<item: string>>, PERSON: list<item: list<item: string>>, QUANTITY: list<item: list<item: string>>, TIME: list<item: list<item: string>>, WORK_OF_ART: list<item: list<item: string>>> to {'CARDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'DATE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'EVENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'FAC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'GPE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LAW': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LOC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'MONEY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'NORP': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORG': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERCENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERSON': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PRODUCT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'QUANTITY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'TIME': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'WORK_OF_ART': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None)} """ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/home2/jiangwangyi/workspace/work/Entity/dataconverter.py", line 110, in <module> converter.convert() File "/home2/jiangwangyi/workspace/work/Entity/dataconverter.py", line 91, in convert dataset = self.dataset.map( File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/dataset_dict.py", line 770, in map { File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/dataset_dict.py", line 771, in <dictcomp> k: dataset.map( File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/datasets/arrow_dataset.py", line 2459, in map transformed_shards[index] = async_result.get() File "/home2/jiangwangyi/miniconda3/lib/python3.9/site-packages/multiprocess/pool.py", line 771, in get raise self._value TypeError: Couldn't cast array of type struct<CARDINAL: list<item: list<item: string>>, DATE: list<item: list<item: string>>, EVENT: list<item: list<item: string>>, FAC: list<item: list<item: string>>, GPE: list<item: list<item: string>>, LANGUAGE: list<item: list<item: string>>, LAW: list<item: list<item: string>>, LOC: list<item: list<item: string>>, MONEY: list<item: list<item: string>>, NORP: list<item: list<item: string>>, ORDINAL: list<item: list<item: string>>, ORG: list<item: list<item: string>>, PERCENT: list<item: list<item: string>>, PERSON: list<item: list<item: string>>, QUANTITY: list<item: list<item: string>>, TIME: list<item: list<item: string>>, WORK_OF_ART: list<item: list<item: string>>> to {'CARDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'DATE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'EVENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'FAC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'GPE': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LAW': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'LOC': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'MONEY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'NORP': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORDINAL': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'ORG': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERCENT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PERSON': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'PRODUCT': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'QUANTITY': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'TIME': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None), 'WORK_OF_ART': Sequence(feature=Sequence(feature=Value(dtype='string', id=None), length=-1, id=None), length=-1, id=None)} ``` </details> ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Ubuntu 18.04 - Python version: 3.9.7 - PyArrow version: 7.0.0 And if the problem is that the way I am to construct the {Entity Type: list of spans} makes entity types without any spans hard to handle, is there a better way to meet the demand? Although I have verified that to make entity types without any spans to behave like `entity_chunk[label] = [[""]]` can perform normally, I still wonder if there is a more elegant way?
[ -1.2776706218719482, -0.9083784222602844, -0.7051625847816467, 1.6343886852264404, -0.16169071197509766, -1.157283902168274, 0.20256038010120392, -1.0726228952407837, 1.5959486961364746, -0.8021684885025024, 0.31201016902923584, -1.6006617546081543, 0.04314877837896347, -0.6633635759353638, -0.6771619319915771, -0.899860143661499, -0.4223330020904541, -0.6744662523269653, 1.13493812084198, 2.461057662963867, 1.298317551612854, -1.377691388130188, 2.7512335777282715, 0.7975085377693176, -0.1783415973186493, -1.0238146781921387, 0.5740895867347717, 0.044413089752197266, -1.2962961196899414, -0.40635979175567627, -1.0690460205078125, -0.143059641122818, -0.48820701241493225, -0.42212972044944763, -0.04608050733804703, 0.38778841495513916, -0.32472237944602966, -0.39617612957954407, -0.6207675933837891, -0.8103734850883484, 0.4553360342979431, -0.305169939994812, 0.8260263204574585, -0.2639235258102417, 1.862326979637146, -0.6645379066467285, 0.4117634892463684, 0.6706902980804443, 1.3326466083526611, 0.17563670873641968, -0.04655606672167778, 0.39455917477607727, 0.3647751212120056, 0.024327240884304047, 0.6122968792915344, 1.3159737586975098, 0.7098066210746765, 0.4908851087093353, 0.7534343004226685, -2.1437582969665527, 1.269284963607788, -1.1005685329437256, 0.3457885682582855, 1.3391987085342407, -1.0050418376922607, 0.41810551285743713, -1.6866945028305054, -0.14666645228862762, 0.6366727352142334, -2.2555224895477295, 0.31356698274612427, -1.3399066925048828, -0.6013574004173279, 1.007922887802124, 0.3809477388858795, -1.1983789205551147, 0.13490614295005798, -0.5181030631065369, 1.1282010078430176, 0.3099267780780792, 1.0500046014785767, -1.6359553337097168, 0.015433287248015404, -0.298360139131546, 0.1104772537946701, -1.2735438346862793, -1.5253111124038696, 0.7024730443954468, 0.7262535691261292, 0.5176371932029724, -0.13310816884040833, 1.1246871948242188, -1.0342148542404175, 0.8279206156730652, -1.0314898490905762, -1.7385929822921753, -1.5395959615707397, -2.290203809738159, -2.1343164443969727, 0.6964415311813354, -0.4188465178012848, -0.6040771007537842, 2.0879790782928467, -0.985420286655426, -1.6716632843017578, 1.0838279724121094, 0.14674825966358185, 0.06585900485515594, 2.426576614379883, 0.17787624895572662, -0.7740515470504761, 0.4968256652355194, -0.7947983741760254, 0.753462553024292, -0.2861863374710083, 1.358651876449585, 0.4080252945423126, -0.9945412278175354, 1.5608705282211304, -0.3202771842479706, 0.48071444034576416, -0.6765760779380798, -0.4609226584434509, -0.7123897671699524, 0.21788597106933594, 1.9764235019683838, -0.35252729058265686, 1.506261944770813, -0.24818803369998932, -1.5119688510894775, -1.5425137281417847, 0.8429522514343262, 0.38370752334594727, -0.7576364278793335, 0.0836213231086731, -0.49444231390953064, 0.12562230229377747, 0.0382813960313797, 1.2560480833053589, 1.3267481327056885, 0.6754558682441711, -0.3640522062778473, -0.7734024524688721, 0.11002208292484283, -0.017714213579893112, -0.7229304909706116, -1.7417254447937012, -0.3561350107192993, 0.07357963919639587, 0.6745659708976746, -1.1855674982070923, 1.7074999809265137, 0.901997447013855, 1.8321572542190552, 1.123317003250122, -0.33333820104599, 1.5716301202774048, 0.05321510508656502, 1.7727019786834717, -0.5260592699050903, 0.6393522024154663, -0.3093426525592804, -1.2551486492156982, 0.8305617570877075, -0.28990432620048523, -2.0672080516815186, -0.7974694967269897, -0.6745141744613647, -0.13437452912330627, -0.8934371471405029, 0.9819003343582153, -0.33943676948547363, -1.507042407989502, 0.21411308646202087, -0.8719545006752014, 0.16837072372436523, -1.1747159957885742, 0.3073151409626007, 0.7059356570243835, -0.5891952514648438, 0.04999767988920212, -0.23141776025295258, -1.1423534154891968, -0.4059518277645111, 0.29621046781539917, 1.7949234247207642, -0.7042679190635681, 0.8609637022018433, 1.1261075735092163, -0.6380259394645691, 0.07266215980052948, 0.28294533491134644, -0.2643764615058899, 0.9796693921089172, -1.0026040077209473, -0.5661658644676208, 1.156829833984375, -0.12345254421234131, -0.593422532081604, 1.494583249092102, 0.7233636379241943, -0.896342396736145, -0.2921508848667145, -0.12529690563678741, -0.9245719909667969, 0.053193915635347366, -1.5480170249938965, -0.18275952339172363, 0.5273032188415527, -1.5566999912261963, -0.4779287576675415, -0.18152360618114471, 1.4256197214126587, -0.16133926808834076, 1.5474966764450073, -0.36220023036003113, -0.17929640412330627, -0.23194296658039093, -0.36452585458755493, 0.1930885910987854, -0.23282353579998016, -0.582290530204773, 0.21805831789970398, -0.8185460567474365, 0.3122088611125946, 1.475968599319458, 0.3578614592552185, 0.10041530430316925, 0.5317850112915039, 1.1031538248062134, 0.4015757143497467, -0.11423595249652863, -0.8726402521133423, -1.5904279947280884, 1.9571528434753418, -1.3552862405776978, 2.1105823516845703, 0.8088672757148743, -0.019124889746308327, -1.7709969282150269, -1.905524492263794, 1.316658616065979, 1.1320432424545288, 2.351384162902832, 0.5027928352355957, 0.3866320252418518, -0.8335307836532593, -0.6674121022224426, 0.36698654294013977, -1.0491117238998413, -0.6665651202201843, 0.1814301759004593, 2.3996334075927734, 1.8778687715530396, -0.37365904450416565, -0.1920100599527359, -0.9630265831947327, 1.4568054676055908, -0.21017466485500336, 0.16120769083499908, 1.9868749380111694, -0.1210482269525528, -1.0629687309265137, 1.2771738767623901, -2.3503499031066895, 0.06950974464416504, 2.06321382522583, 0.3240792155265808, 0.09968195855617523, -1.4328683614730835, -0.5898099541664124, -0.3537948429584503, -0.42804354429244995, -1.3342839479446411, 0.42599231004714966, -0.24167828261852264, -0.7522664666175842, -1.384636640548706, 0.16887086629867554, -1.157326102256775, -1.6963908672332764, 0.2601594030857086, 1.8346960544586182, 2.0425362586975098, -0.766237199306488, 1.6051616668701172, -0.4124392569065094, 0.16177977621555328, 1.1474725008010864, 1.2908352613449097, 3.1015918254852295, 1.9240617752075195, -1.2940952777862549, 0.650495707988739, -0.20522548258304596, -0.4301922917366028, 1.1087182760238647, -1.2398954629898071, 1.3304662704467773, -0.1454896628856659, -1.2455445528030396, -1.1918983459472656, 1.02080500125885, 0.47303664684295654, -0.06811574846506119, -0.5675870180130005, 1.2399309873580933, 0.0699968934059143, 1.3507859706878662, 0.562161922454834, -0.3434508442878723, 0.5427966713905334, -0.3534289300441742, -0.4818367063999176, 1.5111583471298218, 0.23457400500774384, -1.3634403944015503, -2.208676815032959, -0.13871321082115173, -0.8157991766929626, 0.03898002952337265, -0.6796980500221252, -1.0241351127624512, 1.7860604524612427, 0.29849550127983093, -1.2652530670166016, -0.26314184069633484, -0.3842114508152008, -0.5164305567741394, 2.7001078128814697, -1.3473637104034424, -0.16807082295417786, -1.0252922773361206, -0.6738557815551758, 1.6179237365722656, -1.2228425741195679, -0.24802853167057037, -0.9141130447387695, -0.6134949922561646, -1.1907730102539062, -0.5947430729866028, 0.10319943726062775, -1.014088749885559, 0.7427186369895935, 0.05307614058256149, -1.2646033763885498, -0.34875938296318054, -0.7939683794975281, 0.9938586950302124, -0.2133968025445938, 0.13273024559020996, 1.9888547658920288, 0.20636853575706482, -0.43846002221107483, 0.8446463942527771, 1.1699230670928955, 0.6755568385124207, -0.6286596059799194, 0.22924038767814636, -0.6820855736732483, 0.32520705461502075, -1.2644504308700562, 0.3072834312915802, -2.852710247039795, 0.6424722671508789, -0.006676904391497374, 0.03519337624311447, 0.02199292927980423, -1.222975730895996, 1.07329523563385, 2.5900747776031494, -1.1965125799179077, 0.4346257448196411, 0.3164682984352112, 1.0965018272399902, -1.603946328163147, 0.31314224004745483, -0.4164252281188965, 2.024080276489258, 0.2603004574775696, 1.2778120040893555, -0.3802699148654938, -2.262057304382324, 0.6671040058135986, -1.3221768140792847, -1.0837602615356445, 0.7725791931152344, -0.8571209907531738, 0.1662285327911377, -1.4225826263427734, -0.3034302294254303, -0.8966279029846191, -1.1365920305252075, 0.5635180473327637, 0.1862190067768097, 0.394321084022522, -0.5518119931221008, 0.27158889174461365, -2.179813861846924, -1.3171740770339966, -0.15923550724983215, -1.0250433683395386, 0.49320361018180847, -0.42540442943573, 0.576731264591217, -0.1254826784133911, 0.00165480375289917, 0.32232362031936646, 1.4478923082351685, 3.2844409942626953, 0.20444194972515106, 0.2540628910064697, -0.2036592662334442, -0.9051260352134705, 1.4989761114120483, 0.8045026659965515, -0.07897718250751495, -0.5363438129425049, -1.0185844898223877, 1.3570014238357544, 1.831763505935669, 0.9593158960342407, 0.02888191118836403, -0.8542286157608032, -0.7966682314872742, -0.13447290658950806, 0.19588184356689453, 0.42043671011924744, 0.9846082925796509, 0.04665173962712288, 0.07128429412841797, 1.4602149724960327, 1.2046904563903809, -0.4463391602039337, 0.32490184903144836, -0.9526905417442322, -0.49272221326828003, 0.4149426519870758, 0.19665759801864624, -0.06226635351777077, 0.3637532889842987, -0.9960909485816956, -0.3197171092033386, -0.39215564727783203, -0.818633496761322, -0.7261157631874084, -0.29084154963493347, -0.37899425625801086, 1.5890042781829834, 0.1490287035703659, -0.5265843272209167, -0.06484317779541016, -0.7821350693702698, -0.20145665109157562, -1.089853048324585, 0.24989275634288788, -0.03731869161128998, -0.13348199427127838, -0.13385355472564697, 1.7158056497573853, -0.7989456653594971, -2.105687379837036, 0.24177832901477814, 0.14955219626426697, -0.24380363523960114, 0.20069795846939087, 1.6796883344650269, 0.5697651505470276, 1.3646118640899658, 1.2914202213287354, 0.9703356027603149, -0.5937230587005615, -1.3392744064331055, 0.7557163238525391, 0.9873305559158325, -1.4109917879104614, 0.8245276212692261, -0.1739572435617447, -0.46934929490089417, 0.5696646571159363, 1.2620904445648193, 0.5523940324783325, -2.0387301445007324, 0.7982152700424194, -1.0049248933792114, 0.7096170783042908, 0.7184114456176758, 0.5769663453102112, 0.1865699142217636, 0.8685338497161865, -1.2192199230194092, -1.1042810678482056, -0.6366302371025085, -0.690284252166748, 1.969713568687439, -0.3780864477157593, 0.5852810740470886, -0.31068480014801025, -1.31992506980896, -0.11734640598297119, 0.6633960008621216, 0.2709392309188843, -0.5890147089958191, 0.9188444018363953, -0.6835224628448486, -1.0668585300445557, -1.2483816146850586, -0.4243972599506378, -1.0039488077163696, -0.9651323556900024, 1.0426876544952393, 0.7740901112556458, 0.2946065366268158, 1.8925193548202515, 0.6162036061286926, 0.24655349552631378, -2.6185109615325928, 0.8930872082710266, 0.25127342343330383, -0.048034001141786575, 0.8558967709541321, 0.31205281615257263, 0.9701491594314575, 0.08638320863246918, 0.49452897906303406, -2.415977954864502, 2.374521493911743, -0.12131088972091675, 0.7676298022270203, -0.010873518884181976, -0.1421934962272644, 1.0250970125198364, 0.6565208435058594, 0.593152642250061, -0.9454929232597351, 0.5830905437469482, -0.599136233329773, 1.2712982892990112, 0.8869637250900269, -0.7375625967979431, -0.06606817245483398, 1.4082560539245605, 0.4430568814277649, -0.5729362368583679, -0.9490819573402405, -0.9814696311950684, 0.9472793936729431, 1.6859625577926636, 0.10451295971870422, 0.016884109005331993, 0.8701574802398682, 0.6736268401145935, -1.241184949874878, 0.008676489815115929, -0.6657241582870483, -0.7162972688674927, 1.615841269493103, 2.16222882270813, -0.3290320038795471, -0.22904226183891296, -0.6143364310264587, -1.3143069744110107, 0.804394006729126, -0.20630018413066864, 0.19026659429073334, 0.6354576945304871, -0.6195148229598999, 1.0510244369506836, 0.8176689743995667, 0.9587058424949646, 0.2171478569507599, 0.2193971425294876, 0.39200684428215027, -0.3606846332550049, -1.2306334972381592, -0.1913679987192154, -1.0454964637756348, -2.5286731719970703, 0.3630922734737396, -0.14983829855918884, -1.3531798124313354, 0.10937774181365967, -1.115936279296875, 0.9020593166351318, -0.6305509805679321, -1.0775281190872192, -1.5634989738464355, 0.24518181383609772, -0.007704394403845072, 0.954062819480896, -1.6063621044158936, -0.15363577008247375, 1.1967902183532715, 0.8740121722221375, -0.6558952927589417, 0.9562903046607971, 0.18710801005363464, 1.151437759399414, 0.8202329277992249, -0.3145543932914734, 0.5216963887214661, 0.09361867606639862, -1.3207550048828125, 0.49079033732414246, 1.1869921684265137, 0.15865947306156158, 1.55930757522583, -0.4220373034477234, -0.057077255100011826, 0.44771987199783325, -0.643064558506012, -0.4535353481769562, -0.5756142139434814, 0.5569121837615967, 0.03992864862084389, -0.9096055626869202, -0.14546534419059753, -0.02304917946457863, -0.302207887172699, 0.14663657546043396, -1.5148645639419556, -0.11455649137496948, -0.34093791246414185, -0.6816441416740417, -1.3212090730667114, -0.10034607350826263, 1.4158477783203125, -0.7844929099082947, -0.18486590683460236, 0.4261966645717621, 0.38514959812164307, 0.6163197159767151, 0.6174548864364624, -0.7539522051811218, -0.28014492988586426, -0.1844002902507782, -0.33910512924194336, 0.30060556530952454, 1.3711355924606323, -0.18712954223155975, -0.9261005520820618, 0.6097530722618103, -0.4197997748851776, 0.1145995706319809, 1.9528390169143677, 0.05059684067964554, -0.7314406633377075, 0.22978642582893372, -0.7005941271781921, 1.9653258323669434, 1.6610900163650513, 1.3425219058990479, -0.2723853886127472, -0.8585018515586853, 0.6543142199516296, -0.42965593934059143, -0.37083113193511963, 0.6841849088668823, 0.3285192847251892, -0.21337515115737915, -1.480175495147705, 0.7523091435432434, 1.2372204065322876, -0.8915802240371704, -0.801950216293335, 0.1472889631986618, -0.8148757219314575, 1.130367398262024, 0.6067113280296326, 0.3154125511646271, 0.3273621201515198, 1.6404222249984741, 0.7979670166969299, -0.4619120657444, 0.39760488271713257, 0.5807567238807678, -0.11518388986587524, -2.0703587532043457, -1.149396300315857, 0.3052680492401123, -0.5685965418815613, -1.6689223051071167, 1.340011715888977, -1.167496681213379, -1.005660057067871, 0.5000636577606201, 0.07602432370185852, 1.3259419202804565, 0.3112543821334839, 1.5400382280349731, 2.0157599449157715, 0.8334068655967712, 0.47717589139938354, 1.228800654411316, -0.17448867857456207, -0.4300526976585388, 1.7416913509368896, -0.43177545070648193, 0.614892840385437, 1.0814836025238037, -0.306263267993927, -1.1411161422729492, -0.6741989254951477, -1.393216848373413, -0.697079062461853, 1.2155526876449585, 0.09583014249801636, -1.0713586807250977, 0.1977270394563675, 1.53423011302948, 0.09949615597724915, -0.3338623344898224, 0.6126886606216431, 0.33241406083106995, -0.7343656420707703, -0.035441722720861435, -0.9744360446929932, 0.48942890763282776, -0.16254010796546936, -0.42216983437538147, 0.36532720923423767, 0.46710139513015747, 1.3353568315505981, -0.008027131669223309, 0.13327936828136444, 1.069364309310913, -1.471044898033142, 1.5252686738967896, -0.662091076374054, 0.3230244517326355, -2.41152286529541, 1.366778016090393, -0.7118083834648132, 2.0162572860717773, -2.685751438140869, 0.46892300248146057, -0.5809386968612671, -0.4958983063697815, 0.3009040355682373, -0.37130025029182434, 0.14232054352760315, -0.06395088136196136, -1.0671743154525757, -0.0008702334016561508, -0.6301465034484863, 0.5388901829719543, 1.147114634513855, 1.3538774251937866, -1.2227990627288818, -0.17989057302474976, -1.7607687711715698, -0.1424150913953781, -0.8639692664146423, 0.16842353343963623, -2.0088303089141846, -0.13530370593070984, -1.8713879585266113, -2.43815279006958, -1.1910851001739502, -0.8023121953010559, 1.0662888288497925, 0.1487637460231781, -0.859767735004425, 1.2961997985839844, -0.36274608969688416, -1.8151588439941406, 1.1030575037002563, -2.1706459522247314 ]
https://github.com/huggingface/datasets/issues/4404
Dataset should have a `.name` field
Hi! You can already use `dset.builder_name` and `dset.config_name` for that purpose. And when it comes to versioning, it's better to use `dset._fingerprint` than the `version` attribute as the former represents a deterministic hash that encodes all the mutable ops executed on a dataset, and the latter stays the same unless it's manually updated after each op.
**Is your feature request related to a problem? Please describe.** If building pipelines that can evaluate on more than one dataset, it would be nice to be able to log results of things like `Evaluating on {dataset.name}` or `results for {dataset.name} are: {results}` Without some way of concisely identifying a dataset from the dataset object, tools which might run on more than one dataset must be passed the dataset object _and_ the name/id of the dataset being used. **Describe the solution you'd like** The DatasetInfo class should have a `name` field which is the name of a dataset. then for a given dataset if it evolves in time the `version` can be updated but its different versions of the same dataset with a unique `name`. The name could then all be accessed by `dataset.name` **Describe alternatives you've considered** For my own purposes I am considering making `NamedDataset[Dataset]` where the subclass just has a .name field. **Additional context** My guess is that most usecases are not working with more than one dataset in a given pipeline so a name is not really needed. This has surprised me though as one of the advantages of a standard dataset interface is to be able to build pipelines which can be passed in a dataset and separate responsibilities of the dataset loading from the train or eval pipeline.
743
56
Dataset should have a `.name` field **Is your feature request related to a problem? Please describe.** If building pipelines that can evaluate on more than one dataset, it would be nice to be able to log results of things like `Evaluating on {dataset.name}` or `results for {dataset.name} are: {results}` Without some way of concisely identifying a dataset from the dataset object, tools which might run on more than one dataset must be passed the dataset object _and_ the name/id of the dataset being used. **Describe the solution you'd like** The DatasetInfo class should have a `name` field which is the name of a dataset. then for a given dataset if it evolves in time the `version` can be updated but its different versions of the same dataset with a unique `name`. The name could then all be accessed by `dataset.name` **Describe alternatives you've considered** For my own purposes I am considering making `NamedDataset[Dataset]` where the subclass just has a .name field. **Additional context** My guess is that most usecases are not working with more than one dataset in a given pipeline so a name is not really needed. This has surprised me though as one of the advantages of a standard dataset interface is to be able to build pipelines which can be passed in a dataset and separate responsibilities of the dataset loading from the train or eval pipeline. Hi! You can already use `dset.builder_name` and `dset.config_name` for that purpose. And when it comes to versioning, it's better to use `dset._fingerprint` than the `version` attribute as the former represents a deterministic hash that encodes all the mutable ops executed on a dataset, and the latter stays the same unless it's manually updated after each op.
[ -1.185567021369934, -0.9991443753242493, -0.7643559575080872, 1.2959009408950806, -0.20603379607200623, -1.3213136196136475, 0.1841513067483902, -1.135205626487732, 1.8852375745773315, -0.7788033485412598, 0.23080909252166748, -1.7729723453521729, 0.07234740257263184, -0.5692340731620789, -0.873010516166687, -0.8495221734046936, -0.4994378387928009, -0.8982868790626526, 0.9088253974914551, 2.4581472873687744, 1.068505883216858, -1.4779795408248901, 2.593632936477661, 0.6820748448371887, -0.15068766474723816, -0.9690878391265869, 0.46325594186782837, 0.058988701552152634, -1.3163200616836548, -0.4791834354400635, -0.7545473575592041, -0.02433762326836586, -0.5829036831855774, -0.6604142785072327, 0.0006328616291284561, 0.3861088156700134, -0.31961923837661743, -0.45442304015159607, -0.4885173738002777, -0.7106091380119324, 0.42444753646850586, -0.3330361247062683, 1.0322105884552002, -0.45833560824394226, 1.8428236246109009, -0.5348904728889465, 0.3478262424468994, 0.7128575444221497, 1.3426477909088135, 0.27792888879776, -0.010622303932905197, 0.22526131570339203, 0.4540087580680847, -0.05009012296795845, 0.4175131022930145, 1.1977571249008179, 0.6563760042190552, 0.562824010848999, 0.7269282937049866, -2.2474539279937744, 1.3929576873779297, -0.9945283532142639, 0.4104250967502594, 1.328651785850525, -0.857958197593689, 0.36683622002601624, -1.7405811548233032, -0.023547200486063957, 0.5690246820449829, -2.2533392906188965, 0.18512971699237823, -1.332410454750061, -0.5010643005371094, 0.9789942502975464, 0.27520665526390076, -1.1830374002456665, 0.2878261208534241, -0.40168923139572144, 1.0378679037094116, 0.5045397877693176, 1.290928840637207, -1.7253440618515015, -0.07730504870414734, -0.3274020254611969, 0.10515643656253815, -1.3719242811203003, -1.514715552330017, 0.5439525842666626, 0.6126434206962585, 0.534052312374115, -0.13966591656208038, 0.9890130758285522, -0.9456143975257874, 0.7269192337989807, -1.0273879766464233, -1.648045539855957, -1.3643754720687866, -2.079455852508545, -2.355431079864502, 0.8685070872306824, -0.4743131995201111, -0.5289263725280762, 1.96446692943573, -0.9885417819023132, -1.781612753868103, 1.0656764507293701, 0.2654865086078644, 0.02136923000216484, 2.2983651161193848, 0.12883360683918, -0.6698912382125854, 0.3493508994579315, -0.6464129090309143, 0.8230981230735779, -0.4310959577560425, 1.3861355781555176, 0.46182554960250854, -1.067443609237671, 1.5101557970046997, -0.47335100173950195, 0.6200372576713562, -0.6602072715759277, -0.5643709897994995, -0.7926281690597534, 0.4164144992828369, 1.8633718490600586, -0.34164127707481384, 1.6349562406539917, -0.3959525227546692, -1.598353624343872, -1.6322036981582642, 0.9224640727043152, 0.4831669330596924, -0.8260728716850281, 0.047683171927928925, -0.35228028893470764, 0.12038861215114594, -0.13231851160526276, 1.1465076208114624, 1.193398356437683, 0.7938883304595947, -0.34861332178115845, -0.8669969439506531, 0.2229350060224533, -0.17726358771324158, -0.7206529974937439, -1.7776979207992554, -0.307868093252182, 0.20228523015975952, 0.5666314959526062, -1.2025854587554932, 1.680881381034851, 0.8350310921669006, 1.9304076433181763, 0.9945212602615356, -0.3316023051738739, 1.434437870979309, 0.034772105515003204, 1.8036324977874756, -0.48971468210220337, 0.6703892946243286, -0.396893173456192, -1.0676546096801758, 0.8754041194915771, -0.3511923849582672, -2.0471208095550537, -0.7684187293052673, -0.8054181933403015, -0.160819411277771, -0.7611953020095825, 0.8920751810073853, -0.221893310546875, -1.4244263172149658, 0.2760644555091858, -0.6461202502250671, 0.14461137354373932, -1.1581950187683105, 0.30573275685310364, 0.803393542766571, -0.649469792842865, 0.04665134847164154, -0.20709334313869476, -1.3230626583099365, -0.5032986402511597, 0.2799052298069, 1.8115897178649902, -0.7567909359931946, 0.8746098279953003, 0.9596500992774963, -0.7398039698600769, -0.01405167393386364, 0.3187217712402344, -0.21798373758792877, 0.8300179839134216, -1.0526033639907837, -0.2662853002548218, 1.1009094715118408, -0.15867379307746887, -0.4949703812599182, 1.5183851718902588, 0.7009767293930054, -0.9565807580947876, -0.09689173102378845, -0.17391447722911835, -0.9069105982780457, -0.030921103432774544, -1.5397460460662842, -0.06373931467533112, 0.1861981749534607, -1.5737704038619995, -0.47399914264678955, -0.24319101870059967, 1.2386510372161865, -0.2269635796546936, 1.2616409063339233, -0.37371036410331726, -0.29309529066085815, -0.40685951709747314, -0.3088063597679138, 0.07543076574802399, -0.27356448769569397, -0.5932180285453796, 0.2613624632358551, -0.7786796689033508, 0.3357108235359192, 1.3663463592529297, 0.47658446431159973, -0.06426979601383209, 0.48073118925094604, 1.1587191820144653, 0.3273988664150238, -0.01772419363260269, -0.8242462873458862, -1.427492380142212, 1.9722535610198975, -1.450037956237793, 1.8733736276626587, 0.7424436211585999, -0.03393596410751343, -1.7547392845153809, -1.8822416067123413, 1.4008740186691284, 1.1769112348556519, 2.3442728519439697, 0.5473356246948242, 0.4112468659877777, -0.8086637854576111, -0.6584084033966064, 0.40233612060546875, -1.030962586402893, -0.7485775351524353, 0.14764539897441864, 2.3478410243988037, 1.7854238748550415, -0.5617990493774414, -0.22109343111515045, -1.0543265342712402, 1.4788087606430054, -0.10352995991706848, 0.17061494290828705, 2.0377867221832275, -0.3283276855945587, -1.1197670698165894, 1.279625415802002, -2.2931158542633057, 0.08457399904727936, 1.932579755783081, 0.24983395636081696, 0.058484744280576706, -1.3932750225067139, -0.6463083028793335, -0.24820223450660706, -0.39497822523117065, -1.1995975971221924, 0.5173213481903076, -0.24476274847984314, -0.6484970450401306, -1.6193747520446777, 0.23964831233024597, -1.136783480644226, -1.576436161994934, 0.254610151052475, 1.932871699333191, 1.9602885246276855, -0.632625937461853, 1.5640554428100586, -0.309779554605484, 0.15611428022384644, 1.3260606527328491, 1.126627802848816, 3.151916980743408, 1.927186131477356, -1.2176107168197632, 0.6218685507774353, -0.13141320645809174, -0.5075362324714661, 1.14164400100708, -1.1637376546859741, 1.3024002313613892, -0.19306685030460358, -1.1232377290725708, -1.2625377178192139, 0.9570784568786621, 0.5432839393615723, 0.13658258318901062, -0.4901007413864136, 1.203144907951355, 0.002906782552599907, 1.3728445768356323, 0.5102234482765198, -0.38734638690948486, 0.7142072916030884, -0.46899691224098206, -0.5648859143257141, 1.5957086086273193, 0.3020264208316803, -1.306270718574524, -2.352358341217041, -0.3249639570713043, -0.8382341861724854, 0.08037865161895752, -0.5036826133728027, -0.9698970913887024, 1.700186848640442, 0.4340333938598633, -1.3738300800323486, -0.2931954264640808, -0.3438129723072052, -0.6463271975517273, 2.643507480621338, -1.4719256162643433, -0.1563422530889511, -0.9383703470230103, -0.6046420335769653, 1.673221230506897, -1.2039238214492798, -0.20488084852695465, -1.051942229270935, -0.6025070548057556, -1.292772889137268, -0.553784966468811, -0.12428495287895203, -0.8609060049057007, 0.8824046850204468, 0.22270230948925018, -1.0988534688949585, -0.35022130608558655, -0.9176689982414246, 0.7473158836364746, -0.10295528173446655, 0.2803175151348114, 1.9360374212265015, 0.5122904777526855, -0.34211310744285583, 0.6080465912818909, 1.096652865409851, 0.5991225242614746, -0.6737323999404907, 0.22895577549934387, -0.7129780054092407, 0.274370938539505, -1.3926385641098022, 0.2544344961643219, -2.8129963874816895, 0.6198514699935913, -0.06831485033035278, -0.08681701123714447, 0.0032146302983164787, -1.316654086112976, 1.0805257558822632, 2.5787127017974854, -1.193833351135254, 0.3724031448364258, 0.30706849694252014, 1.1510270833969116, -1.6319772005081177, 0.3977219760417938, -0.3789844810962677, 2.140428304672241, 0.1959632933139801, 1.1531153917312622, -0.5240442752838135, -2.2592270374298096, 0.5081357955932617, -1.156011700630188, -1.240752100944519, 0.7899752259254456, -0.8113648295402527, 0.005814123898744583, -1.5331203937530518, -0.18838205933570862, -0.8424049019813538, -1.273524284362793, 0.835823655128479, 0.09400098025798798, 0.4435158967971802, -0.6824691295623779, 0.35337895154953003, -2.2076611518859863, -1.3885416984558105, -0.3343324363231659, -0.8943564295768738, 0.48835670948028564, -0.3205943703651428, 0.6809388399124146, -0.15245740115642548, 0.0751911848783493, 0.33822163939476013, 1.344889760017395, 3.4379260540008545, 0.2586617171764374, 0.368839830160141, -0.14576630294322968, -0.8742516040802002, 1.3478829860687256, 0.9407493472099304, -0.051552288234233856, -0.5652625560760498, -1.0604135990142822, 1.2542576789855957, 1.98317289352417, 1.033753752708435, 0.004655485972762108, -0.6978806853294373, -0.6843900680541992, 0.024096354842185974, 0.21187709271907806, 0.45211130380630493, 0.8025517463684082, 0.1608252227306366, 0.154250830411911, 1.3601326942443848, 1.2152951955795288, -0.4156610369682312, 0.4503028988838196, -0.7553279399871826, -0.546053409576416, 0.4942810535430908, 0.3972011208534241, -0.026762448251247406, 0.36127060651779175, -0.9862663745880127, -0.20174406468868256, -0.44828149676322937, -0.9896295070648193, -0.689527153968811, -0.5258346199989319, -0.35757309198379517, 1.7080196142196655, 0.05574655905365944, -0.5930929780006409, -0.14228355884552002, -0.7455736398696899, -0.0968916267156601, -1.0588462352752686, 0.3325916528701782, -0.07523858547210693, -0.13259927928447723, -0.09268505871295929, 1.7270393371582031, -0.9059738516807556, -1.9418537616729736, 0.2952919006347656, 0.2985031008720398, -0.4277692437171936, 0.2028808891773224, 1.5658140182495117, 0.4401724934577942, 1.4792639017105103, 1.3906846046447754, 0.9495137929916382, -0.6515049934387207, -1.3755805492401123, 0.5824661254882812, 0.8992787599563599, -1.395493984222412, 0.7649899125099182, 0.13372649252414703, -0.5695860385894775, 0.718062162399292, 1.2677810192108154, 0.40965980291366577, -2.0722663402557373, 0.7876340746879578, -0.8693761825561523, 0.6190480589866638, 0.7529404163360596, 0.7511922121047974, 0.21261434257030487, 0.7758077383041382, -1.2328097820281982, -1.2132450342178345, -0.7745509743690491, -0.6494100093841553, 1.981695294380188, -0.2604123055934906, 0.65672767162323, -0.11771723628044128, -1.3412991762161255, -0.14811380207538605, 0.762811541557312, 0.5200358033180237, -0.5075219869613647, 0.7249025702476501, -0.5876572132110596, -1.0904160737991333, -1.3798298835754395, -0.4284215271472931, -1.0494279861450195, -0.9145286679267883, 1.0299274921417236, 0.9351451396942139, 0.2994081377983093, 1.8980154991149902, 0.6601755023002625, 0.25593703985214233, -2.6784756183624268, 0.7625360488891602, 0.36764198541641235, -0.08384466171264648, 0.9437288641929626, 0.2771989405155182, 0.9303569197654724, 0.0007859328761696815, 0.6279207468032837, -2.440028190612793, 2.2738990783691406, -0.21185562014579773, 0.6505166292190552, -0.09599266946315765, -0.24705123901367188, 1.1518785953521729, 0.5315386652946472, 0.4905129075050354, -1.0860055685043335, 0.7440247535705566, -0.5400177836418152, 1.224408745765686, 0.9140308499336243, -0.7683575749397278, -0.06829208135604858, 1.328348159790039, 0.509162187576294, -0.48011064529418945, -0.90406733751297, -1.1099228858947754, 0.9005628228187561, 1.861095666885376, -0.10768187046051025, 0.004315207712352276, 0.9008842706680298, 0.7101501226425171, -1.2756938934326172, 0.2158336639404297, -0.8604261875152588, -0.7977703213691711, 1.5740888118743896, 2.025270462036133, -0.027099639177322388, -0.11804209649562836, -0.7348453998565674, -1.172168493270874, 0.8012491464614868, 0.15052349865436554, 0.14387518167495728, 0.6364326477050781, -0.6904845237731934, 1.151979684829712, 1.008301019668579, 0.9535791277885437, 0.2163776159286499, 0.35418668389320374, 0.348421573638916, -0.24143405258655548, -1.115978717803955, -0.16328184306621552, -1.0715748071670532, -2.4065089225769043, 0.5385749936103821, -0.18451233208179474, -1.487168788909912, -0.1438448131084442, -0.9558269381523132, 0.9165247678756714, -0.5401071310043335, -1.1794975996017456, -1.6461246013641357, 0.17198391258716583, 0.05840906873345375, 0.9842183589935303, -1.5781972408294678, -0.06179143115878105, 1.1780672073364258, 0.8609290719032288, -0.6576687097549438, 1.0289651155471802, 0.2589682638645172, 0.9569492936134338, 0.8953341245651245, -0.4200612008571625, 0.40486568212509155, 0.05663686618208885, -1.3269537687301636, 0.4857770800590515, 1.079571008682251, 0.1528061181306839, 1.4439328908920288, -0.7072624564170837, 0.04719941318035126, 0.4023571312427521, -0.4601192772388458, -0.3154865801334381, -0.620355486869812, 0.7182393670082092, 0.11584998667240143, -0.811945915222168, 0.13388699293136597, -0.09054625034332275, -0.1566973179578781, 0.20701536536216736, -1.414455533027649, -0.22492069005966187, -0.4281465709209442, -0.5539633631706238, -1.1115949153900146, -0.01729011721909046, 1.4915035963058472, -0.7028747797012329, -0.17540116608142853, 0.57170569896698, 0.5517485737800598, 0.5181096792221069, 0.6037550568580627, -0.6152253746986389, -0.3827870190143585, -0.24002359807491302, -0.3369130790233612, 0.2584120035171509, 1.3770705461502075, -0.1376771181821823, -0.9508371949195862, 0.8394081592559814, -0.4062378704547882, -0.04971877858042717, 1.9610737562179565, 0.11410310864448547, -0.7850236892700195, 0.3692043721675873, -0.7752531170845032, 1.916996717453003, 1.8834339380264282, 1.375706672668457, -0.01582186110317707, -1.0774102210998535, 0.5280556678771973, -0.2218105047941208, -0.4662376940250397, 1.0456722974777222, 0.4837607741355896, -0.21475180983543396, -1.432657241821289, 0.6196993589401245, 1.2554837465286255, -0.8933217525482178, -0.8049517869949341, 0.10468789935112, -0.7543632388114929, 1.0552648305892944, 0.6154624223709106, 0.4652394950389862, 0.20872919261455536, 1.6583210229873657, 0.7357265949249268, -0.32556986808776855, 0.5338749289512634, 0.5073442459106445, -0.10869364440441132, -2.1587793827056885, -1.2663828134536743, 0.31291526556015015, -0.47397568821907043, -1.542466402053833, 1.365706205368042, -1.1631802320480347, -0.9127892851829529, 0.4734034240245819, 0.007856540381908417, 1.5477501153945923, 0.39454326033592224, 1.548714280128479, 2.1788320541381836, 0.9394038915634155, 0.2834738790988922, 1.3848167657852173, -0.13797646760940552, -0.41071462631225586, 1.818514108657837, -0.526733934879303, 0.45299363136291504, 1.084120512008667, -0.32362642884254456, -1.0509674549102783, -0.7468979954719543, -1.1848756074905396, -0.6512895822525024, 1.1350668668746948, 0.01772294193506241, -1.1660521030426025, 0.32731688022613525, 1.5773648023605347, 0.04332944005727768, -0.25717058777809143, 0.47484683990478516, 0.44600552320480347, -0.8687530755996704, -0.11251755058765411, -0.9400117993354797, 0.5263978242874146, -0.2564147412776947, -0.3445693552494049, 0.38257521390914917, 0.48806294798851013, 1.3214247226715088, -0.026561656966805458, 0.06099231168627739, 1.188297152519226, -1.4672809839248657, 1.4750992059707642, -0.6100282669067383, 0.13989898562431335, -2.43489933013916, 1.5129162073135376, -0.7353274822235107, 1.9951553344726562, -2.699483871459961, 0.40262359380722046, -0.5908492803573608, -0.43672385811805725, 0.43179231882095337, -0.3695310950279236, 0.2084302008152008, -0.15847130119800568, -1.179962158203125, -0.07524445652961731, -0.7789608240127563, 0.5528614521026611, 1.0655708312988281, 1.4365620613098145, -1.1786240339279175, -0.40437495708465576, -1.679822325706482, -0.23691736161708832, -0.6560119390487671, 0.4042891263961792, -1.9649028778076172, -0.10940514504909515, -1.8885694742202759, -2.390511989593506, -1.3952077627182007, -0.772961437702179, 0.9941374063491821, 0.07273545861244202, -0.8951804637908936, 1.0819342136383057, -0.4502633810043335, -1.9151103496551514, 1.1127345561981201, -2.1080968379974365 ]
https://github.com/huggingface/datasets/issues/4404
Dataset should have a `.name` field
@mariosasko Can we make ._fingerprint not private? seems a critical component for tracking how a model was generated to ensure reproducibility.
**Is your feature request related to a problem? Please describe.** If building pipelines that can evaluate on more than one dataset, it would be nice to be able to log results of things like `Evaluating on {dataset.name}` or `results for {dataset.name} are: {results}` Without some way of concisely identifying a dataset from the dataset object, tools which might run on more than one dataset must be passed the dataset object _and_ the name/id of the dataset being used. **Describe the solution you'd like** The DatasetInfo class should have a `name` field which is the name of a dataset. then for a given dataset if it evolves in time the `version` can be updated but its different versions of the same dataset with a unique `name`. The name could then all be accessed by `dataset.name` **Describe alternatives you've considered** For my own purposes I am considering making `NamedDataset[Dataset]` where the subclass just has a .name field. **Additional context** My guess is that most usecases are not working with more than one dataset in a given pipeline so a name is not really needed. This has surprised me though as one of the advantages of a standard dataset interface is to be able to build pipelines which can be passed in a dataset and separate responsibilities of the dataset loading from the train or eval pipeline.
743
21
Dataset should have a `.name` field **Is your feature request related to a problem? Please describe.** If building pipelines that can evaluate on more than one dataset, it would be nice to be able to log results of things like `Evaluating on {dataset.name}` or `results for {dataset.name} are: {results}` Without some way of concisely identifying a dataset from the dataset object, tools which might run on more than one dataset must be passed the dataset object _and_ the name/id of the dataset being used. **Describe the solution you'd like** The DatasetInfo class should have a `name` field which is the name of a dataset. then for a given dataset if it evolves in time the `version` can be updated but its different versions of the same dataset with a unique `name`. The name could then all be accessed by `dataset.name` **Describe alternatives you've considered** For my own purposes I am considering making `NamedDataset[Dataset]` where the subclass just has a .name field. **Additional context** My guess is that most usecases are not working with more than one dataset in a given pipeline so a name is not really needed. This has surprised me though as one of the advantages of a standard dataset interface is to be able to build pipelines which can be passed in a dataset and separate responsibilities of the dataset loading from the train or eval pipeline. @mariosasko Can we make ._fingerprint not private? seems a critical component for tracking how a model was generated to ensure reproducibility.
[ -1.2089616060256958, -1.0006434917449951, -0.7498066425323486, 1.26154625415802, -0.20094797015190125, -1.2772287130355835, 0.18171274662017822, -1.1515034437179565, 1.834903597831726, -0.7694148421287537, 0.20409360527992249, -1.7879786491394043, 0.06594792753458023, -0.5812140703201294, -0.8592609763145447, -0.8286551237106323, -0.5254158973693848, -0.851873517036438, 0.8811540603637695, 2.5120019912719727, 1.0518831014633179, -1.4943679571151733, 2.5871918201446533, 0.7201143503189087, -0.14991609752178192, -0.9789541363716125, 0.4547489583492279, 0.1040169969201088, -1.2931286096572876, -0.4624152183532715, -0.7375604510307312, -0.049432266503572464, -0.5413947105407715, -0.6474230289459229, 0.0019316505640745163, 0.3722034990787506, -0.3089650273323059, -0.41877105832099915, -0.5254126191139221, -0.7000501751899719, 0.4029235243797302, -0.3414921164512634, 1.0221118927001953, -0.4497162401676178, 1.8578671216964722, -0.5623877048492432, 0.34965717792510986, 0.6798467040061951, 1.3585684299468994, 0.290340781211853, -0.003214116208255291, 0.2796163856983185, 0.41027912497520447, -0.03465452417731285, 0.4137805700302124, 1.168306589126587, 0.6202651858329773, 0.5278488993644714, 0.7043623924255371, -2.2355339527130127, 1.3743641376495361, -0.967122495174408, 0.4086839258670807, 1.383837103843689, -0.8481814861297607, 0.41916000843048096, -1.7143934965133667, -0.02075846493244171, 0.5729830265045166, -2.240405321121216, 0.1703733205795288, -1.320427417755127, -0.5308799147605896, 0.9662900567054749, 0.24549880623817444, -1.1954991817474365, 0.2838800549507141, -0.4338921904563904, 1.0341808795928955, 0.5009387731552124, 1.3019882440567017, -1.716482162475586, -0.09545895457267761, -0.33570000529289246, 0.09955907613039017, -1.3881208896636963, -1.4822564125061035, 0.5749582052230835, 0.634442150592804, 0.5342917442321777, -0.1153269037604332, 0.9270218014717102, -0.9556632041931152, 0.7477259039878845, -1.0507038831710815, -1.6483228206634521, -1.3972920179367065, -2.082836627960205, -2.3503329753875732, 0.8706815838813782, -0.4879663288593292, -0.5561761856079102, 1.925733208656311, -0.9937569499015808, -1.781478762626648, 1.0973042249679565, 0.25650107860565186, 0.037596091628074646, 2.3435494899749756, 0.11539339274168015, -0.6502929925918579, 0.3201938271522522, -0.6493847966194153, 0.77392578125, -0.43314382433891296, 1.4129775762557983, 0.4615617096424103, -1.0714209079742432, 1.5304157733917236, -0.5016817450523376, 0.6032716631889343, -0.6661592721939087, -0.5680407881736755, -0.7710824608802795, 0.44701817631721497, 1.8852097988128662, -0.30669763684272766, 1.643140196800232, -0.4058079421520233, -1.608599305152893, -1.630472183227539, 0.9291613101959229, 0.45830607414245605, -0.8634427189826965, 0.07855885475873947, -0.37503358721733093, 0.09104636311531067, -0.1054740846157074, 1.1281167268753052, 1.1659921407699585, 0.7704064249992371, -0.31128695607185364, -0.8677428364753723, 0.23646599054336548, -0.17724066972732544, -0.7611402869224548, -1.7907098531723022, -0.3289937973022461, 0.23700493574142456, 0.539699375629425, -1.2101691961288452, 1.6720733642578125, 0.8445239663124084, 1.9015529155731201, 0.9930117726325989, -0.3104592263698578, 1.4757251739501953, 0.02756105735898018, 1.795343041419983, -0.4888109266757965, 0.6944113373756409, -0.3848364055156708, -1.0600879192352295, 0.8164805769920349, -0.37332597374916077, -2.0926764011383057, -0.7873710989952087, -0.7879828214645386, -0.19781692326068878, -0.7764865756034851, 0.9101727604866028, -0.1750767081975937, -1.3985178470611572, 0.29177823662757874, -0.6464716792106628, 0.1579754799604416, -1.195847749710083, 0.32384607195854187, 0.8198310732841492, -0.6641964912414551, 0.010759522207081318, -0.22366048395633698, -1.3453935384750366, -0.5237809419631958, 0.2261517196893692, 1.7933214902877808, -0.7746475338935852, 0.7970043420791626, 0.9407584071159363, -0.70036381483078, 0.004311330616474152, 0.3231036067008972, -0.22461125254631042, 0.8187779188156128, -1.0207768678665161, -0.23569156229496002, 1.115485668182373, -0.16210056841373444, -0.4666871726512909, 1.5169053077697754, 0.7357882261276245, -0.9216794371604919, -0.09882790595293045, -0.2465144246816635, -0.9361317753791809, -0.0316811241209507, -1.5572601556777954, -0.07678541541099548, 0.10796024650335312, -1.5625180006027222, -0.47885364294052124, -0.22992399334907532, 1.2381223440170288, -0.1962934285402298, 1.2382311820983887, -0.409206360578537, -0.27699580788612366, -0.4317677319049835, -0.2911369204521179, 0.1144493967294693, -0.31223219633102417, -0.6260000467300415, 0.2524561882019043, -0.7937636971473694, 0.3470102548599243, 1.3796814680099487, 0.5538033843040466, -0.044114042073488235, 0.49187761545181274, 1.1124236583709717, 0.25472673773765564, -0.0463583879172802, -0.8308855891227722, -1.4569042921066284, 1.965218186378479, -1.4355182647705078, 1.8821741342544556, 0.7336624264717102, -0.04413196071982384, -1.7335660457611084, -1.8921949863433838, 1.3685917854309082, 1.2055809497833252, 2.340778350830078, 0.5083621740341187, 0.4178416132926941, -0.8051310777664185, -0.6362050771713257, 0.3684421181678772, -1.0563478469848633, -0.7467378377914429, 0.15265166759490967, 2.327083110809326, 1.800392985343933, -0.6448708176612854, -0.16753371059894562, -1.0577160120010376, 1.478344202041626, -0.1438164860010147, 0.15049481391906738, 2.06807279586792, -0.34193891286849976, -1.1163424253463745, 1.27480947971344, -2.3235483169555664, 0.06632007658481598, 1.9109125137329102, 0.263302206993103, 0.08276066184043884, -1.3713544607162476, -0.6781027913093567, -0.27368006110191345, -0.3324354588985443, -1.2020683288574219, 0.4800835847854614, -0.23531635105609894, -0.6283784508705139, -1.644167184829712, 0.22011344134807587, -1.1704487800598145, -1.5540423393249512, 0.29670020937919617, 1.8823357820510864, 1.9439970254898071, -0.6554334163665771, 1.530671238899231, -0.30109450221061707, 0.13757658004760742, 1.3308781385421753, 1.1198725700378418, 3.1533215045928955, 1.916648268699646, -1.1891367435455322, 0.6210266947746277, -0.15017010271549225, -0.5065892934799194, 1.1447703838348389, -1.1566317081451416, 1.313185453414917, -0.18851503729820251, -1.1061183214187622, -1.2744300365447998, 0.9688993096351624, 0.5675901770591736, 0.1384076625108719, -0.5130037069320679, 1.1828324794769287, -0.03667886182665825, 1.4329880475997925, 0.5093533992767334, -0.39808928966522217, 0.6707421541213989, -0.49119803309440613, -0.5319325923919678, 1.620658278465271, 0.30347925424575806, -1.3352943658828735, -2.374267816543579, -0.32723110914230347, -0.8175756931304932, 0.03570276126265526, -0.543244481086731, -0.9930105209350586, 1.7016785144805908, 0.4393519461154938, -1.3939893245697021, -0.3029821217060089, -0.32880279421806335, -0.629597544670105, 2.6814792156219482, -1.4920213222503662, -0.19421091675758362, -0.8999008536338806, -0.5906378626823425, 1.6901710033416748, -1.1938279867172241, -0.17021681368350983, -1.0515369176864624, -0.6559009552001953, -1.2942510843276978, -0.5551164746284485, -0.14594031870365143, -0.8792549967765808, 0.9185026288032532, 0.206354022026062, -1.1030733585357666, -0.3771570026874542, -0.934465765953064, 0.7520991563796997, -0.11010854691267014, 0.31495392322540283, 1.8888955116271973, 0.5412627458572388, -0.34002363681793213, 0.6293599605560303, 1.104301929473877, 0.607886552810669, -0.6681374311447144, 0.18250368535518646, -0.7210129499435425, 0.2698092758655548, -1.401604175567627, 0.27924618124961853, -2.86209774017334, 0.6229945421218872, -0.045621294528245926, -0.06432652473449707, 0.0011046314612030983, -1.3324847221374512, 1.1389158964157104, 2.615583658218384, -1.1902265548706055, 0.34474417567253113, 0.3149048388004303, 1.144219160079956, -1.6257290840148926, 0.4070875942707062, -0.3546243906021118, 2.1545820236206055, 0.19738154113292694, 1.1026383638381958, -0.5135926008224487, -2.2610573768615723, 0.49857041239738464, -1.1725188493728638, -1.220515251159668, 0.7848431468009949, -0.8235145807266235, -0.018909122794866562, -1.5688340663909912, -0.14675387740135193, -0.8552594780921936, -1.2598634958267212, 0.8570929765701294, 0.13384903967380524, 0.4398634433746338, -0.6898446679115295, 0.3592226803302765, -2.2247910499572754, -1.4094645977020264, -0.3593076765537262, -0.835301399230957, 0.463713675737381, -0.2907184064388275, 0.6694797873497009, -0.11170943081378937, 0.09490688890218735, 0.35252392292022705, 1.347609043121338, 3.399569034576416, 0.2748888432979584, 0.39977145195007324, -0.1293792575597763, -0.8432579040527344, 1.3375945091247559, 0.8945317268371582, -0.04971681162714958, -0.5534490942955017, -0.9914771914482117, 1.2786006927490234, 1.9451767206192017, 0.9944022297859192, 0.016468480229377747, -0.7002233266830444, -0.636374831199646, -0.0035298382863402367, 0.2488359808921814, 0.40633806586265564, 0.8177523016929626, 0.09781742095947266, 0.12789195775985718, 1.3895517587661743, 1.2568124532699585, -0.4605567455291748, 0.4706273376941681, -0.7484573125839233, -0.5731486082077026, 0.4924028813838959, 0.38919883966445923, 0.00011936109513044357, 0.3769732117652893, -0.9781173467636108, -0.21382002532482147, -0.39712250232696533, -1.0036662817001343, -0.6995527744293213, -0.5743659138679504, -0.3750315010547638, 1.695975422859192, 0.07057002931833267, -0.5773890614509583, -0.15691964328289032, -0.7660858035087585, -0.12348902225494385, -1.075006365776062, 0.33707672357559204, -0.026804376393556595, -0.1320571005344391, -0.10538557916879654, 1.756566047668457, -0.9129047989845276, -1.9419842958450317, 0.31692254543304443, 0.3047795593738556, -0.43500006198883057, 0.14690324664115906, 1.5898445844650269, 0.4105905294418335, 1.4962064027786255, 1.3501101732254028, 0.9642009139060974, -0.6311848163604736, -1.3706154823303223, 0.6177623271942139, 0.8939680457115173, -1.3874865770339966, 0.7779734134674072, 0.152369886636734, -0.5796211361885071, 0.7231924533843994, 1.251672387123108, 0.3927919566631317, -2.0144364833831787, 0.8117184638977051, -0.8964238166809082, 0.6369749307632446, 0.7390168905258179, 0.7148275375366211, 0.2085571140050888, 0.801510214805603, -1.2248148918151855, -1.214408278465271, -0.8424343466758728, -0.6157279014587402, 2.0087082386016846, -0.2505874037742615, 0.6169396638870239, -0.10114876925945282, -1.3361889123916626, -0.09405090659856796, 0.7676485776901245, 0.5307379961013794, -0.5009300708770752, 0.7855814695358276, -0.5871041417121887, -1.100387454032898, -1.3604044914245605, -0.39479702711105347, -1.0170282125473022, -0.8995456695556641, 1.051249384880066, 0.9810980558395386, 0.2766053080558777, 1.8571420907974243, 0.6165315508842468, 0.2370731383562088, -2.681251287460327, 0.7544434666633606, 0.33941850066185, -0.09188075363636017, 0.905422568321228, 0.24405550956726074, 0.8899363279342651, 0.027162037789821625, 0.590554416179657, -2.4237773418426514, 2.2392280101776123, -0.1915583610534668, 0.7035394906997681, -0.11312657594680786, -0.19582490622997284, 1.094378113746643, 0.5351502895355225, 0.4817817807197571, -1.0770258903503418, 0.7396489381790161, -0.5063433647155762, 1.2169650793075562, 0.9040935635566711, -0.7561244964599609, -0.060556698590517044, 1.2942242622375488, 0.5205987095832825, -0.4787946343421936, -0.9023369550704956, -1.0366848707199097, 0.9246712327003479, 1.8471235036849976, -0.08922753483057022, -0.03481142222881317, 0.897815465927124, 0.7409431338310242, -1.2666385173797607, 0.21186579763889313, -0.8449848890304565, -0.794399619102478, 1.5538381338119507, 2.0923821926116943, 0.0037042777985334396, -0.09371386468410492, -0.700984001159668, -1.1683681011199951, 0.8026325702667236, 0.1426953822374344, 0.1926581859588623, 0.6600049138069153, -0.674993634223938, 1.1379953622817993, 0.9912785291671753, 0.9935978055000305, 0.24184256792068481, 0.38694459199905396, 0.3420613408088684, -0.21322530508041382, -1.1077234745025635, -0.1947626918554306, -1.1024314165115356, -2.390604257583618, 0.5601680278778076, -0.2199617475271225, -1.5041661262512207, -0.09246383607387543, -0.9728882908821106, 0.9335517287254333, -0.5457898378372192, -1.1249794960021973, -1.658703327178955, 0.18617068231105804, 0.05144038051366806, 0.9384907484054565, -1.576149821281433, -0.027847856283187866, 1.1744080781936646, 0.8542550802230835, -0.6014748215675354, 1.0099650621414185, 0.31524524092674255, 1.0024410486221313, 0.9357141256332397, -0.4167519211769104, 0.39574334025382996, 0.04563732072710991, -1.3291330337524414, 0.46763166785240173, 1.073776125907898, 0.19857555627822876, 1.432852029800415, -0.7150360345840454, 0.05376909300684929, 0.409668892621994, -0.49315693974494934, -0.3048568069934845, -0.6039611101150513, 0.7224273681640625, 0.1543503850698471, -0.843953013420105, 0.07233499735593796, -0.10950462520122528, -0.17732803523540497, 0.22676461935043335, -1.4055694341659546, -0.2338574081659317, -0.4118228554725647, -0.5352713465690613, -1.1033965349197388, -0.03557315841317177, 1.5253335237503052, -0.7511788606643677, -0.1341305822134018, 0.5839342474937439, 0.5705429315567017, 0.5743600130081177, 0.6504708528518677, -0.6319617033004761, -0.3620297610759735, -0.24374742805957794, -0.2979812026023865, 0.2175702005624771, 1.3650761842727661, -0.15102322399616241, -0.9163113832473755, 0.8435426354408264, -0.4043106436729431, -0.045768044888973236, 1.9850928783416748, 0.14080701768398285, -0.8197788596153259, 0.36807525157928467, -0.784575879573822, 1.921288013458252, 1.8559225797653198, 1.3882640600204468, -0.0015706750564277172, -1.096673607826233, 0.5513421893119812, -0.23355330526828766, -0.46454885601997375, 1.0075440406799316, 0.5461914539337158, -0.21558459103107452, -1.4147751331329346, 0.6408378481864929, 1.249403953552246, -0.8862006664276123, -0.7665422558784485, 0.08419081568717957, -0.7697421908378601, 1.039509654045105, 0.6515990495681763, 0.4347372055053711, 0.20892146229743958, 1.6742836236953735, 0.69765704870224, -0.37021857500076294, 0.45138147473335266, 0.5410066843032837, -0.09751726686954498, -2.119769334793091, -1.2942607402801514, 0.31385931372642517, -0.4157871603965759, -1.509698748588562, 1.3149025440216064, -1.185495138168335, -0.8979624509811401, 0.4714103937149048, 0.040081750601530075, 1.5398279428482056, 0.39803069829940796, 1.5801465511322021, 2.1903247833251953, 0.9746861457824707, 0.23722165822982788, 1.4094890356063843, -0.09446465969085693, -0.41605544090270996, 1.8301708698272705, -0.4601244032382965, 0.4552915692329407, 1.1056139469146729, -0.3242965638637543, -1.0533771514892578, -0.7577782869338989, -1.1365834474563599, -0.6400877237319946, 1.1878492832183838, 0.0504273921251297, -1.1705429553985596, 0.27600476145744324, 1.5967813730239868, 0.015120229683816433, -0.2900735139846802, 0.4430987536907196, 0.4589538872241974, -0.8435387015342712, -0.10533495992422104, -0.9695326685905457, 0.4932556450366974, -0.2680787444114685, -0.3234671652317047, 0.3785749077796936, 0.5294622778892517, 1.2942911386489868, -0.0031618038192391396, 0.09048634767532349, 1.1958502531051636, -1.5029559135437012, 1.43450129032135, -0.60066819190979, 0.15776565670967102, -2.4434332847595215, 1.5539977550506592, -0.7592560648918152, 1.9881389141082764, -2.7075719833374023, 0.40283092856407166, -0.603450357913971, -0.4610590934753418, 0.3996223211288452, -0.3834151029586792, 0.21972714364528656, -0.12236008793115616, -1.1700925827026367, -0.08928334712982178, -0.7693164944648743, 0.5415599346160889, 1.060962200164795, 1.3977922201156616, -1.2058422565460205, -0.4393717050552368, -1.6548547744750977, -0.26889023184776306, -0.7051584720611572, 0.3839190900325775, -1.9486141204833984, -0.11777392774820328, -1.871469259262085, -2.3940768241882324, -1.418854832649231, -0.7738421559333801, 0.9697942137718201, 0.07561203837394714, -0.9004542231559753, 1.0844855308532715, -0.47033408284187317, -1.9073423147201538, 1.1562610864639282, -2.1021454334259033 ]
https://github.com/huggingface/datasets/issues/4401
"NonMatchingChecksumError" when importing 'spider' dataset
Thanks for reporting, @OmarAlaaeldein. Datasets hosted at Google Drive give problems quite often due to a change in their service: - #3786 Related to: - #3906 I'm having a look.
## Describe the bug When importing 'spider' dataset [https://huggingface.co/datasets/spider] an error occurs ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('spider') ``` ## Expected results Dataset object ## Actual results NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/uc?export=download&id=1_AckYkinAnhqmRQtGsQgUKAnTHxxX5J0'] ## Environment info - `datasets` version: 2.2.2 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.11 - PyArrow version: 6.0.1 - Pandas version: 1.3.5
744
30
"NonMatchingChecksumError" when importing 'spider' dataset ## Describe the bug When importing 'spider' dataset [https://huggingface.co/datasets/spider] an error occurs ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('spider') ``` ## Expected results Dataset object ## Actual results NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/uc?export=download&id=1_AckYkinAnhqmRQtGsQgUKAnTHxxX5J0'] ## Environment info - `datasets` version: 2.2.2 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.11 - PyArrow version: 6.0.1 - Pandas version: 1.3.5 Thanks for reporting, @OmarAlaaeldein. Datasets hosted at Google Drive give problems quite often due to a change in their service: - #3786 Related to: - #3906 I'm having a look.
[ -1.1710469722747803, -0.9565684795379639, -0.7705387473106384, 1.4677512645721436, -0.15006573498249054, -1.2126446962356567, 0.06637823581695557, -1.0337589979171753, 1.6611558198928833, -0.7478260397911072, 0.20828019082546234, -1.7033292055130005, -0.014847198501229286, -0.5805351734161377, -0.7054471969604492, -0.8614358901977539, -0.3371719419956207, -0.6179494857788086, 1.0464421510696411, 2.471463680267334, 1.118109941482544, -1.3461343050003052, 2.703903913497925, 0.7069466710090637, -0.2583736181259155, -0.9914973378181458, 0.5903661847114563, 0.05740709230303764, -1.323896884918213, -0.34234046936035156, -0.933195948600769, -0.03401544317603111, -0.5181869268417358, -0.5452218651771545, 0.07884585857391357, 0.4041377604007721, -0.29101890325546265, -0.4052547514438629, -0.4708055853843689, -0.7657845616340637, 0.4232393205165863, -0.39935508370399475, 0.9221453070640564, -0.3341091573238373, 1.753375768661499, -0.6010835766792297, 0.4094306528568268, 0.7174246907234192, 1.3273260593414307, 0.10823000222444534, 0.07874968647956848, 0.37716108560562134, 0.366268128156662, -0.014173747971653938, 0.5242777466773987, 1.1034636497497559, 0.5843873620033264, 0.40380623936653137, 0.7410429120063782, -2.2353405952453613, 1.2543308734893799, -0.9390323758125305, 0.2924761474132538, 1.373296856880188, -0.9471889138221741, 0.40176060795783997, -1.7045574188232422, -0.014512929134070873, 0.5628408789634705, -2.2877037525177, 0.31529510021209717, -1.2856625318527222, -0.45806822180747986, 0.9751116037368774, 0.3633103668689728, -1.148965835571289, 0.10960268974304199, -0.4866359233856201, 1.0495959520339966, 0.4797319173812866, 1.148342490196228, -1.678176760673523, -0.003582802601158619, -0.2524896264076233, 0.08050888776779175, -1.3888360261917114, -1.4484511613845825, 0.5293537378311157, 0.6591046452522278, 0.6470252275466919, -0.05141483247280121, 0.9014486074447632, -0.9820060133934021, 0.7029582858085632, -1.0303536653518677, -1.7892727851867676, -1.3779528141021729, -2.388566017150879, -2.301325798034668, 0.7132934927940369, -0.3843396306037903, -0.4665336310863495, 2.001398801803589, -0.9938994646072388, -1.852837085723877, 1.1653757095336914, 0.2778230607509613, -0.0002749953418970108, 2.32373046875, 0.28115028142929077, -0.7577254176139832, 0.5046337842941284, -0.8062326908111572, 0.7400304675102234, -0.44701921939849854, 1.3505115509033203, 0.4983025789260864, -0.9746147990226746, 1.533602237701416, -0.5069345235824585, 0.6085718870162964, -0.7071858048439026, -0.44377267360687256, -0.7764506340026855, 0.29262545704841614, 1.9304622411727905, -0.3427707254886627, 1.5566506385803223, -0.3045139014720917, -1.4804989099502563, -1.4833283424377441, 0.7880122661590576, 0.538217306137085, -0.7308152914047241, 0.18104638159275055, -0.3257930874824524, 0.08066117018461227, -0.12391836941242218, 1.095679759979248, 1.2171002626419067, 0.675288200378418, -0.2803730368614197, -0.9546555876731873, 0.19840529561042786, -0.07554436475038528, -0.733143150806427, -1.850456953048706, -0.3228100836277008, 0.2347274273633957, 0.605699360370636, -1.2935843467712402, 1.628709077835083, 0.8766598105430603, 1.9239751100540161, 0.9945385456085205, -0.31949105858802795, 1.479793667793274, 0.05937034264206886, 1.8778318166732788, -0.45334503054618835, 0.7333958148956299, -0.3253977596759796, -1.1336286067962646, 0.7776855230331421, -0.4167386591434479, -2.0482451915740967, -0.7143755555152893, -0.9335180521011353, -0.1544943004846573, -0.8071216344833374, 0.9775053262710571, -0.25138434767723083, -1.3588848114013672, 0.2636769413948059, -0.8598400950431824, 0.1737825870513916, -1.3167136907577515, 0.21640551090240479, 0.7606173753738403, -0.5070270299911499, -0.004658369813114405, -0.27684998512268066, -1.3516029119491577, -0.4405871331691742, 0.402130126953125, 1.8148810863494873, -0.852935254573822, 0.9862448573112488, 0.9447542428970337, -0.671030580997467, 0.0070304786786437035, 0.35138264298439026, -0.34183651208877563, 0.9058459401130676, -0.9852379560470581, -0.4726310074329376, 1.1585841178894043, -0.20305193960666656, -0.665189266204834, 1.498781442642212, 0.8307693600654602, -1.0154448747634888, -0.22814960777759552, -0.1891455054283142, -0.7986770272254944, -0.0746348574757576, -1.71975839138031, -0.13087478280067444, 0.28613269329071045, -1.4570766687393188, -0.4875424802303314, -0.2209390550851822, 1.3405771255493164, -0.07710820436477661, 1.3914936780929565, -0.2853469252586365, -0.19564390182495117, -0.4220926761627197, -0.47698211669921875, 0.20175550878047943, -0.3115043044090271, -0.6788986325263977, 0.2540696859359741, -0.7695199847221375, 0.3640247583389282, 1.3674707412719727, 0.3526112735271454, 0.06918983161449432, 0.5666587352752686, 1.0745511054992676, 0.3391365706920624, -0.05298599228262901, -0.9189333915710449, -1.6508816480636597, 1.9947307109832764, -1.4357028007507324, 1.9952120780944824, 0.713239848613739, -0.06631840765476227, -1.8173694610595703, -1.957478642463684, 1.3976869583129883, 1.166817545890808, 2.2876908779144287, 0.6086629033088684, 0.45351913571357727, -0.85187166929245, -0.7111067175865173, 0.20881904661655426, -0.9622772932052612, -0.7341615557670593, 0.12299176305532455, 2.391240358352661, 1.7927262783050537, -0.4135866165161133, -0.18778927624225616, -1.0474445819854736, 1.4344112873077393, -0.14874932169914246, 0.23551082611083984, 2.0287041664123535, -0.18639004230499268, -1.0050009489059448, 1.2510991096496582, -2.372868061065674, 0.2100885957479477, 1.9796990156173706, 0.23219171166419983, 0.12620389461517334, -1.3955751657485962, -0.8245710730552673, -0.27312666177749634, -0.36280202865600586, -1.2476061582565308, 0.5931541919708252, -0.2370835840702057, -0.8645718097686768, -1.4105290174484253, 0.16197936236858368, -1.1055307388305664, -1.7034385204315186, 0.2815249562263489, 1.8509325981140137, 2.077613353729248, -0.7716960310935974, 1.4709686040878296, -0.25187358260154724, 0.2223569005727768, 1.35135018825531, 1.162600040435791, 3.1604480743408203, 1.9734883308410645, -1.3170585632324219, 0.7934950590133667, -0.08620123565196991, -0.480899453163147, 1.2582451105117798, -1.101803183555603, 1.2299225330352783, -0.25437477231025696, -1.2407160997390747, -1.285164713859558, 0.8698099851608276, 0.5062128901481628, 0.05614000931382179, -0.5367249846458435, 1.2584890127182007, 0.006904168985784054, 1.4125858545303345, 0.5949115753173828, -0.3416654169559479, 0.5989971160888672, -0.3952198326587677, -0.45827189087867737, 1.5482969284057617, 0.12445815652608871, -1.4546834230422974, -2.3334953784942627, -0.35413625836372375, -0.8360658884048462, -0.1172645092010498, -0.5695352554321289, -1.1083881855010986, 1.588923692703247, 0.49648618698120117, -1.1646660566329956, -0.24656400084495544, -0.33606407046318054, -0.5082597136497498, 2.740039110183716, -1.4941506385803223, -0.24232569336891174, -1.0361815690994263, -0.4698132276535034, 1.6364953517913818, -1.1781641244888306, -0.21403174102306366, -1.0970745086669922, -0.6181666254997253, -1.361936092376709, -0.5532482862472534, -0.09140671044588089, -0.9044697880744934, 0.8463448286056519, 0.1479971557855606, -1.1482570171356201, -0.21168677508831024, -0.9895946383476257, 0.9108486771583557, -0.11077730357646942, 0.21151626110076904, 1.9286657571792603, 0.4507327675819397, -0.3525231182575226, 0.6979802250862122, 1.161565899848938, 0.6235499382019043, -0.766584575176239, 0.19019141793251038, -0.7278792262077332, 0.26808783411979675, -1.4004055261611938, 0.1562640368938446, -2.9054696559906006, 0.57524174451828, 0.03489489480853081, -0.030582811683416367, -0.047713398933410645, -1.2689677476882935, 1.1223666667938232, 2.5520358085632324, -1.215527892112732, 0.5409820675849915, 0.2866041660308838, 1.1918152570724487, -1.5580791234970093, 0.2677100598812103, -0.40166789293289185, 2.104398727416992, 0.20057831704616547, 1.2739030122756958, -0.40212446451187134, -2.2673470973968506, 0.6614112854003906, -1.3190277814865112, -1.0749399662017822, 0.7916818857192993, -0.7854371666908264, 0.15220582485198975, -1.4811575412750244, -0.14165733754634857, -0.8445734977722168, -1.3027552366256714, 0.6305990219116211, 0.10859107971191406, 0.47802770137786865, -0.5331406593322754, 0.4278465211391449, -2.2175261974334717, -1.360973596572876, -0.2324369102716446, -0.9268524050712585, 0.48350074887275696, -0.2901037633419037, 0.7268130779266357, -0.16815237700939178, 0.0239737406373024, 0.24524588882923126, 1.3753336668014526, 3.3883066177368164, 0.1365654468536377, 0.30846521258354187, -0.13491345942020416, -0.988423228263855, 1.3664875030517578, 1.0447032451629639, -0.18131478130817413, -0.5044479966163635, -0.9630212783813477, 1.2896459102630615, 1.9327895641326904, 1.0701717138290405, 0.020678594708442688, -0.8703649044036865, -0.7758175134658813, 0.05649332329630852, 0.18498627841472626, 0.5211427807807922, 0.8659206032752991, 0.06781415641307831, 0.08891590684652328, 1.437244176864624, 1.196143627166748, -0.3705979585647583, 0.40035587549209595, -0.8858728408813477, -0.3996274471282959, 0.5692364573478699, 0.32158195972442627, 0.006327376700937748, 0.37730398774147034, -1.070906162261963, -0.26209157705307007, -0.31220677495002747, -0.8907763957977295, -0.7032065987586975, -0.4411208927631378, -0.3617545962333679, 1.6140695810317993, 0.11604266613721848, -0.45458295941352844, -0.1013457328081131, -0.7398778796195984, -0.04959005489945412, -1.049126148223877, 0.34391486644744873, -0.18771813809871674, 0.009811465628445148, -0.15137413144111633, 1.7325700521469116, -1.0216575860977173, -2.0092928409576416, 0.18782930076122284, 0.3407759368419647, -0.3734169602394104, 0.14492222666740417, 1.6203315258026123, 0.5725275874137878, 1.353698968887329, 1.318504810333252, 0.9762901067733765, -0.6675824522972107, -1.3331798315048218, 0.5936524271965027, 1.010162115097046, -1.4266413450241089, 0.77313631772995, -0.018387068063020706, -0.5842000842094421, 0.6756106615066528, 1.4024150371551514, 0.4304366111755371, -1.9291082620620728, 0.7233513593673706, -0.9343910813331604, 0.8100695610046387, 0.7732734680175781, 0.8225159049034119, 0.223393052816391, 0.7491176128387451, -1.335780143737793, -1.0704865455627441, -0.8120346069335938, -0.5670020580291748, 1.9584635496139526, -0.2803632616996765, 0.45283082127571106, -0.15847857296466827, -1.296203851699829, -0.06662309169769287, 0.6832069754600525, 0.33684712648391724, -0.37760648131370544, 0.7881836891174316, -0.6374838948249817, -1.139471411705017, -1.3371803760528564, -0.4452887773513794, -0.9077004790306091, -0.9409486651420593, 1.0075912475585938, 0.8443804979324341, 0.39517340064048767, 1.8874179124832153, 0.6716375946998596, 0.2363787144422531, -2.6249287128448486, 0.8835431933403015, 0.2346464991569519, -0.0016869381070137024, 0.7914049625396729, 0.22556141018867493, 1.0781042575836182, -0.0757317990064621, 0.5760083198547363, -2.3777761459350586, 2.164372205734253, -0.2358638495206833, 0.6111189126968384, -0.06281442195177078, -0.032751310616731644, 1.0337764024734497, 0.5075336694717407, 0.5481569766998291, -1.0609736442565918, 0.7668463587760925, -0.5902792811393738, 1.217885136604309, 0.8699083924293518, -0.810806155204773, -0.0820164754986763, 1.3275762796401978, 0.4667852818965912, -0.45675623416900635, -0.9221406579017639, -0.9586829543113708, 0.977041482925415, 1.7399457693099976, -0.09542065858840942, -0.0075687868520617485, 0.9438820481300354, 0.6622795462608337, -1.3822941780090332, 0.03307186812162399, -0.7142625451087952, -0.5557433366775513, 1.7431988716125488, 2.06632399559021, -0.1489708572626114, -0.14816442131996155, -0.7831772565841675, -1.2122188806533813, 0.721667468547821, 0.04836531728506088, 0.03229163587093353, 0.6678704619407654, -0.5524515509605408, 1.1523267030715942, 0.7745459675788879, 0.8788631558418274, 0.1429881602525711, 0.273831844329834, 0.28427839279174805, -0.24782176315784454, -1.2826340198516846, -0.30028706789016724, -1.0346118211746216, -2.4351844787597656, 0.5125366449356079, -0.24523316323757172, -1.475481390953064, 0.03795180097222328, -1.0155280828475952, 0.9325119256973267, -0.620738685131073, -1.0870157480239868, -1.4951403141021729, 0.2196827232837677, -0.13946081697940826, 0.8555271029472351, -1.5978996753692627, 0.0022521009668707848, 1.392803430557251, 0.8814128637313843, -0.6420091390609741, 1.1013481616973877, 0.3168739974498749, 1.0627248287200928, 0.8247512578964233, -0.30098313093185425, 0.5166012644767761, 0.14789098501205444, -1.325735092163086, 0.4956054091453552, 1.1851582527160645, 0.2528606355190277, 1.4839712381362915, -0.6523090600967407, 0.0076215313747525215, 0.4431292414665222, -0.4881342649459839, -0.4491049349308014, -0.6424970030784607, 0.7502307295799255, 0.16286276280879974, -0.9680141806602478, 0.004692369140684605, -0.08119720220565796, -0.22562022507190704, 0.23438028991222382, -1.5010440349578857, -0.1678292155265808, -0.3481057584285736, -0.7191624045372009, -1.2231535911560059, -0.014627253636717796, 1.337855339050293, -0.7978346347808838, -0.18125425279140472, 0.5180975198745728, 0.29925769567489624, 0.5353965163230896, 0.66261887550354, -0.631700873374939, -0.3302992284297943, -0.24918386340141296, -0.2754661738872528, 0.3120085895061493, 1.3180079460144043, -0.10098152607679367, -1.0975990295410156, 0.7053177952766418, -0.46706193685531616, 0.09912541508674622, 1.9825482368469238, 0.07068187743425369, -0.8538281321525574, 0.3402734398841858, -0.747999906539917, 1.985884428024292, 1.6197491884231567, 1.3373316526412964, -0.0936669409275055, -0.9808362722396851, 0.5875989198684692, -0.1891932636499405, -0.3544623553752899, 0.9031520485877991, 0.5078363418579102, -0.20619052648544312, -1.352731466293335, 0.5633888840675354, 1.2891674041748047, -0.9670636653900146, -0.8564491868019104, 0.13931424915790558, -0.8647848963737488, 1.0880078077316284, 0.7966582179069519, 0.37044304609298706, 0.24964965879917145, 1.630443811416626, 0.7551259994506836, -0.5634099245071411, 0.5001793503761292, 0.4850417971611023, -0.17861995100975037, -1.9989286661148071, -0.9958548545837402, 0.3718986213207245, -0.4303153157234192, -1.6160682439804077, 1.3756155967712402, -1.1219778060913086, -0.8373979330062866, 0.5312546491622925, 0.132113978266716, 1.3267526626586914, 0.2982010245323181, 1.5805686712265015, 2.0152692794799805, 0.8837174773216248, 0.3133658170700073, 1.3077809810638428, -0.20792275667190552, -0.44547581672668457, 1.7398875951766968, -0.4686402678489685, 0.5656923651695251, 1.0066696405410767, -0.36681678891181946, -1.1082900762557983, -0.7782084941864014, -1.2386540174484253, -0.5898221135139465, 1.212877869606018, 0.19068409502506256, -1.1629769802093506, 0.20025093853473663, 1.5112751722335815, 0.14159978926181793, -0.32849329710006714, 0.6994717717170715, 0.3759606182575226, -0.8471822142601013, -0.04222555086016655, -1.0313860177993774, 0.4727841317653656, -0.1404450237751007, -0.2231568694114685, 0.25663119554519653, 0.5210443139076233, 1.2975568771362305, 0.05231944099068642, 0.1918983906507492, 1.3085604906082153, -1.3217459917068481, 1.4868429899215698, -0.6900382041931152, 0.28340500593185425, -2.373328447341919, 1.3509104251861572, -0.7977957725524902, 1.9129021167755127, -2.6744394302368164, 0.3962639272212982, -0.569745659828186, -0.40529921650886536, 0.23960842192173004, -0.35955822467803955, 0.14520037174224854, -0.10273656249046326, -1.2018465995788574, -0.06715493649244308, -0.8482234477996826, 0.5866369605064392, 1.1941570043563843, 1.3285208940505981, -1.2103502750396729, -0.20625795423984528, -1.7402898073196411, -0.28202542662620544, -0.822431743144989, 0.38675564527511597, -1.9141736030578613, -0.07694219797849655, -1.8786669969558716, -2.391953468322754, -1.3437219858169556, -0.7846611738204956, 1.1353729963302612, 0.07650720328092575, -0.9302726984024048, 1.0573281049728394, -0.4012046456336975, -1.7698330879211426, 1.1232898235321045, -2.1684629917144775 ]
https://github.com/huggingface/datasets/issues/4401
"NonMatchingChecksumError" when importing 'spider' dataset
We have made a Pull Request to replace the Google Drive URL. This fix will be accessible in our next `datasets` library release. In the meantime, once the PR merged into master, you can get this fix by installing our library from the GitHub master branch: ```shell pip install git+https://github.com/huggingface/datasets#egg=datasets ``` Then, if you had previously tried to load the data and got the checksum error, you should force the redownload of the data (before the fix, you just downloaded and cached the virus scan warning page, instead of the data file): ```shell load_dataset("...", download_mode="force_redownload") ```
## Describe the bug When importing 'spider' dataset [https://huggingface.co/datasets/spider] an error occurs ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('spider') ``` ## Expected results Dataset object ## Actual results NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/uc?export=download&id=1_AckYkinAnhqmRQtGsQgUKAnTHxxX5J0'] ## Environment info - `datasets` version: 2.2.2 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.11 - PyArrow version: 6.0.1 - Pandas version: 1.3.5
744
96
"NonMatchingChecksumError" when importing 'spider' dataset ## Describe the bug When importing 'spider' dataset [https://huggingface.co/datasets/spider] an error occurs ## Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset('spider') ``` ## Expected results Dataset object ## Actual results NonMatchingChecksumError: Checksums didn't match for dataset source files: ['https://drive.google.com/uc?export=download&id=1_AckYkinAnhqmRQtGsQgUKAnTHxxX5J0'] ## Environment info - `datasets` version: 2.2.2 - Platform: Windows-10-10.0.19041-SP0 - Python version: 3.7.11 - PyArrow version: 6.0.1 - Pandas version: 1.3.5 We have made a Pull Request to replace the Google Drive URL. This fix will be accessible in our next `datasets` library release. In the meantime, once the PR merged into master, you can get this fix by installing our library from the GitHub master branch: ```shell pip install git+https://github.com/huggingface/datasets#egg=datasets ``` Then, if you had previously tried to load the data and got the checksum error, you should force the redownload of the data (before the fix, you just downloaded and cached the virus scan warning page, instead of the data file): ```shell load_dataset("...", download_mode="force_redownload") ```
[ -1.1545201539993286, -0.9278689622879028, -0.7589576840400696, 1.4778592586517334, -0.1574467569589615, -1.1967514753341675, 0.1386193186044693, -1.039510726928711, 1.6828014850616455, -0.7490813732147217, 0.24172963201999664, -1.7095623016357422, -0.0428280346095562, -0.5962608456611633, -0.7438052296638489, -0.8652383685112, -0.395198792219162, -0.7094799280166626, 1.0239390134811401, 2.4189064502716064, 1.201421856880188, -1.3258280754089355, 2.6834449768066406, 0.6565027832984924, -0.1992669254541397, -0.9653652906417847, 0.5635358095169067, 0.011566915549337864, -1.2965118885040283, -0.43451523780822754, -0.9326868057250977, -0.07122296839952469, -0.5570331811904907, -0.5766999125480652, 0.04952147603034973, 0.4371802508831024, -0.3709811270236969, -0.4436180293560028, -0.5209863781929016, -0.8001484274864197, 0.4336874783039093, -0.34667038917541504, 0.9210768938064575, -0.31487125158309937, 1.8537954092025757, -0.5918503403663635, 0.4345739781856537, 0.7624526619911194, 1.3116421699523926, 0.15469391644001007, 0.07174262404441833, 0.3210395574569702, 0.3584662973880768, -0.010344170965254307, 0.5490762591362, 1.1506388187408447, 0.5992913842201233, 0.4566207528114319, 0.7315108776092529, -2.2516472339630127, 1.2399958372116089, -1.037470817565918, 0.2995666265487671, 1.3671108484268188, -0.9297963976860046, 0.37613412737846375, -1.7898341417312622, 0.025583215057849884, 0.49528568983078003, -2.291195869445801, 0.29966384172439575, -1.3343853950500488, -0.43214619159698486, 1.020443081855774, 0.30713167786598206, -1.210103154182434, 0.13912257552146912, -0.3850897550582886, 1.0729480981826782, 0.43538644909858704, 1.1895477771759033, -1.7040377855300903, -0.07048744708299637, -0.29650935530662537, 0.08572576940059662, -1.3014605045318604, -1.5209859609603882, 0.5017740726470947, 0.6770324110984802, 0.5847843289375305, -0.158769428730011, 1.0721592903137207, -0.9511743783950806, 0.7656106352806091, -0.9976363778114319, -1.7634761333465576, -1.4006931781768799, -2.2779297828674316, -2.2994985580444336, 0.7428721189498901, -0.4660907983779907, -0.4707758128643036, 2.025723457336426, -0.9762952327728271, -1.8415831327438354, 1.1665962934494019, 0.3728410303592682, -0.04414802044630051, 2.31856632232666, 0.2803495526313782, -0.7363435626029968, 0.4578969478607178, -0.7622324228286743, 0.7557258605957031, -0.35415175557136536, 1.3713122606277466, 0.49326086044311523, -1.0747606754302979, 1.5619752407073975, -0.4612194299697876, 0.5970507860183716, -0.7135093808174133, -0.45358288288116455, -0.7519255876541138, 0.27344444394111633, 1.8971329927444458, -0.388846218585968, 1.5711278915405273, -0.28780391812324524, -1.5069303512573242, -1.5072757005691528, 0.8768641352653503, 0.5139842629432678, -0.7381078600883484, 0.11409737914800644, -0.28395068645477295, 0.0890374407172203, -0.10085173696279526, 1.1337229013442993, 1.2293888330459595, 0.7097325325012207, -0.3374924659729004, -0.8569173216819763, 0.22022899985313416, -0.10046026855707169, -0.7243909239768982, -1.7837415933609009, -0.37943747639656067, 0.20587797462940216, 0.5585858821868896, -1.2562835216522217, 1.651379942893982, 0.8886287808418274, 1.899253487586975, 0.9939922094345093, -0.3904067277908325, 1.4881805181503296, 0.08411061763763428, 1.8995639085769653, -0.4910999834537506, 0.6617199778556824, -0.3199128806591034, -1.1800998449325562, 0.8109340071678162, -0.32819315791130066, -2.0325405597686768, -0.7262985110282898, -0.9285633563995361, -0.1719980388879776, -0.726582407951355, 0.923204779624939, -0.2839272618293762, -1.412234902381897, 0.23157623410224915, -0.7595575451850891, 0.11479974538087845, -1.2982944250106812, 0.24977098405361176, 0.7610317468643188, -0.5998690724372864, -0.010853058658540249, -0.26289641857147217, -1.3055177927017212, -0.42781832814216614, 0.40322548151016235, 1.792724370956421, -0.7784064412117004, 1.0144727230072021, 1.0186868906021118, -0.7685018181800842, 0.0022313836961984634, 0.2916659116744995, -0.3441336452960968, 0.9276381134986877, -0.9997025728225708, -0.5337540507316589, 1.1623541116714478, -0.15626636147499084, -0.6910322308540344, 1.4731550216674805, 0.7515705823898315, -0.995117723941803, -0.20640626549720764, -0.17699815332889557, -0.8227255344390869, -0.0015748757869005203, -1.618717074394226, -0.09241420775651932, 0.33687201142311096, -1.4897445440292358, -0.5322610139846802, -0.24196138978004456, 1.3505910634994507, -0.13957971334457397, 1.4426722526550293, -0.2923593521118164, -0.2289499044418335, -0.43676885962486267, -0.40917107462882996, 0.1381656974554062, -0.2591197192668915, -0.6362854838371277, 0.23501959443092346, -0.766708493232727, 0.37481942772865295, 1.348917007446289, 0.3566904664039612, 0.004492324776947498, 0.571949303150177, 1.122349739074707, 0.3652202785015106, -0.012800963595509529, -0.9309359788894653, -1.5892114639282227, 1.9450294971466064, -1.420684576034546, 1.9875131845474243, 0.6929891109466553, -0.01919380947947502, -1.8184479475021362, -1.9243054389953613, 1.3869565725326538, 1.1855974197387695, 2.346296787261963, 0.5707417726516724, 0.46738201379776, -0.813143789768219, -0.684626042842865, 0.2665102183818817, -1.0072174072265625, -0.7117041945457458, 0.17641863226890564, 2.374825954437256, 1.7612407207489014, -0.4567798674106598, -0.22270788252353668, -1.0450780391693115, 1.442973256111145, -0.17082646489143372, 0.2108062207698822, 2.0234358310699463, -0.21223309636116028, -1.0170414447784424, 1.2903975248336792, -2.342585802078247, 0.1834135800600052, 1.9783893823623657, 0.2812001705169678, 0.07714583724737167, -1.4040980339050293, -0.7324618101119995, -0.2316039651632309, -0.4710600972175598, -1.278525710105896, 0.6007541418075562, -0.26264432072639465, -0.8097001910209656, -1.4025753736495972, 0.11565525084733963, -1.0620394945144653, -1.6968344449996948, 0.23447781801223755, 1.8913480043411255, 1.9723628759384155, -0.754508912563324, 1.51860773563385, -0.30621886253356934, 0.17676663398742676, 1.313242793083191, 1.170616865158081, 3.1731350421905518, 1.9611787796020508, -1.33791184425354, 0.7116948962211609, -0.06089288368821144, -0.4888022243976593, 1.2497758865356445, -1.1051239967346191, 1.2711012363433838, -0.2641013264656067, -1.229577660560608, -1.2702518701553345, 0.9426499009132385, 0.5397946238517761, 0.09202214330434799, -0.5275893211364746, 1.2237765789031982, 0.06756115704774857, 1.332826018333435, 0.5882452130317688, -0.3853721022605896, 0.6538114547729492, -0.39762964844703674, -0.503331184387207, 1.5677757263183594, 0.17029443383216858, -1.3451546430587769, -2.3240227699279785, -0.2979993224143982, -0.8373883962631226, -0.019855961203575134, -0.5701503157615662, -1.00815749168396, 1.6254445314407349, 0.4909687042236328, -1.2601150274276733, -0.2839294970035553, -0.37182560563087463, -0.559879720211029, 2.712674856185913, -1.419216275215149, -0.1833353042602539, -1.0042905807495117, -0.5407874584197998, 1.6243736743927002, -1.1617625951766968, -0.24647662043571472, -1.1073251962661743, -0.6373918056488037, -1.3440102338790894, -0.6137246489524841, 0.0072802091017365456, -0.8810507655143738, 0.8564019799232483, 0.10721046477556229, -1.173630714416504, -0.2757161855697632, -0.9383752346038818, 0.9335311055183411, -0.13400916755199432, 0.19191338121891022, 1.9224523305892944, 0.48876675963401794, -0.36532723903656006, 0.7003110647201538, 1.1288259029388428, 0.6351581811904907, -0.6896965503692627, 0.2809077501296997, -0.709166407585144, 0.2373567819595337, -1.383658528327942, 0.1757168471813202, -2.8777596950531006, 0.6164301633834839, 0.019910044968128204, 0.0181448794901371, -0.03708518669009209, -1.2731126546859741, 1.0623682737350464, 2.5507254600524902, -1.203479290008545, 0.4695049226284027, 0.34644827246665955, 1.1793066263198853, -1.5991981029510498, 0.2856364846229553, -0.43281856179237366, 2.0612523555755615, 0.1322423815727234, 1.2525941133499146, -0.43910109996795654, -2.239042282104492, 0.5610523223876953, -1.289113998413086, -1.1858978271484375, 0.8971316814422607, -0.790561854839325, 0.13847003877162933, -1.4326188564300537, -0.18744789063930511, -0.8161067366600037, -1.2923812866210938, 0.7287197709083557, 0.09845457971096039, 0.4572407901287079, -0.5656070113182068, 0.4176477789878845, -2.1577515602111816, -1.3657488822937012, -0.24043843150138855, -0.9227054119110107, 0.4557945132255554, -0.2613123953342438, 0.7290230393409729, -0.154726043343544, 0.030617907643318176, 0.28341543674468994, 1.3792965412139893, 3.36881947517395, 0.1656458079814911, 0.3168931305408478, -0.10127953439950943, -0.9802069664001465, 1.423142910003662, 1.0178759098052979, -0.15566159784793854, -0.5055755972862244, -1.0358853340148926, 1.2257198095321655, 1.908016324043274, 1.0900135040283203, 0.024044036865234375, -0.8641894459724426, -0.7788291573524475, 0.030279409140348434, 0.1726025491952896, 0.5015113353729248, 0.8378346562385559, 0.1275361329317093, 0.14661821722984314, 1.3908690214157104, 1.1850320100784302, -0.39000222086906433, 0.4191369414329529, -0.864979088306427, -0.4838443398475647, 0.5477458834648132, 0.3269009590148926, -0.002992822788655758, 0.32646262645721436, -1.0450671911239624, -0.3176884651184082, -0.3772619366645813, -0.9512911438941956, -0.6853710412979126, -0.427529901266098, -0.3464127480983734, 1.601428747177124, 0.07530489563941956, -0.45683449506759644, -0.022946001961827278, -0.7463170289993286, -0.06116741523146629, -1.086003303527832, 0.3316687047481537, -0.18785104155540466, -0.07164765149354935, -0.11441469937562943, 1.6872756481170654, -0.9987941980361938, -2.0169196128845215, 0.19646607339382172, 0.3447967767715454, -0.3481222689151764, 0.1780119240283966, 1.6073763370513916, 0.516457736492157, 1.3719656467437744, 1.304429531097412, 0.9823041558265686, -0.6540772914886475, -1.305906891822815, 0.6038492321968079, 1.0747722387313843, -1.393083095550537, 0.7639374732971191, 0.033549290150403976, -0.5534231662750244, 0.6761876940727234, 1.3400726318359375, 0.40894708037376404, -1.9751778841018677, 0.7337849140167236, -0.8590322136878967, 0.7539699077606201, 0.7154272794723511, 0.7932468056678772, 0.16829875111579895, 0.7413071393966675, -1.2910611629486084, -1.131058931350708, -0.7156187891960144, -0.5814356207847595, 1.9377825260162354, -0.20917469263076782, 0.5069136619567871, -0.19640886783599854, -1.346569538116455, -0.06715907901525497, 0.6879147291183472, 0.404031366109848, -0.46838751435279846, 0.7722203135490417, -0.6311743259429932, -1.0800964832305908, -1.4000489711761475, -0.3943050801753998, -1.036088466644287, -0.9361273050308228, 0.9899143576622009, 0.8741562962532043, 0.35314255952835083, 1.8326750993728638, 0.6632133722305298, 0.23244455456733704, -2.629864454269409, 0.911498486995697, 0.30719050765037537, -0.07575257867574692, 0.8150410056114197, 0.2727208733558655, 1.0512531995773315, -0.07093668729066849, 0.5751318335533142, -2.3846495151519775, 2.2418055534362793, -0.2324899435043335, 0.5967497825622559, -0.010850310325622559, -0.20021744072437286, 1.0483235120773315, 0.49411213397979736, 0.5517334342002869, -1.0797629356384277, 0.740052342414856, -0.5812433958053589, 1.1945559978485107, 0.8982014060020447, -0.8141845464706421, -0.0862952172756195, 1.3795669078826904, 0.5274214744567871, -0.4419422149658203, -0.9185694456100464, -0.9792779684066772, 0.9844760894775391, 1.7260130643844604, -0.05425914376974106, -0.02312203124165535, 0.9194713830947876, 0.6637738943099976, -1.3614699840545654, 0.15062366425991058, -0.7614732384681702, -0.6855812072753906, 1.6919829845428467, 2.0417115688323975, -0.16613471508026123, -0.20437702536582947, -0.79667067527771, -1.189239263534546, 0.7193547487258911, 0.06350154429674149, 0.10580413788557053, 0.6802330613136292, -0.6435759663581848, 1.146384835243225, 0.7868044972419739, 0.8953544497489929, 0.17751072347164154, 0.3186645209789276, 0.28867489099502563, -0.27596229314804077, -1.312543511390686, -0.22281695902347565, -0.985790491104126, -2.5318210124969482, 0.5161788463592529, -0.19122274219989777, -1.442029595375061, 0.03566176816821098, -1.0192861557006836, 0.9423184990882874, -0.617572009563446, -1.140698790550232, -1.5295755863189697, 0.22101256251335144, -0.06262176483869553, 0.8806878924369812, -1.6109305620193481, -0.02258053421974182, 1.3345144987106323, 0.919374406337738, -0.6821173429489136, 1.0039536952972412, 0.25783422589302063, 1.0332605838775635, 0.8510382771492004, -0.3390227258205414, 0.5161741971969604, 0.10859651863574982, -1.3906444311141968, 0.4696815013885498, 1.1539338827133179, 0.22771091759204865, 1.5182744264602661, -0.6377897262573242, 0.010851732455193996, 0.4266810119152069, -0.493778258562088, -0.4968290328979492, -0.6644368171691895, 0.6613050103187561, 0.06944772601127625, -0.9523801207542419, 0.1101788803935051, -0.03353505954146385, -0.21267282962799072, 0.19046619534492493, -1.493573546409607, -0.1536373645067215, -0.3366406261920929, -0.6772850751876831, -1.23045814037323, -0.013224171474575996, 1.345659852027893, -0.7824670076370239, -0.2318200320005417, 0.49169522523880005, 0.2562454044818878, 0.5380484461784363, 0.6568527221679688, -0.6400958299636841, -0.32608336210250854, -0.2741777002811432, -0.3506017029285431, 0.2863227128982544, 1.3797574043273926, -0.12436548620462418, -0.9740927219390869, 0.7116286754608154, -0.413274884223938, 0.056147992610931396, 1.9750826358795166, 0.14167159795761108, -0.8410142064094543, 0.31943488121032715, -0.6952570676803589, 1.9049824476242065, 1.6926696300506592, 1.3559584617614746, -0.12199604511260986, -0.9568687677383423, 0.6079903841018677, -0.30782029032707214, -0.39946502447128296, 0.9920727014541626, 0.43661701679229736, -0.15569064021110535, -1.3767776489257812, 0.6349300742149353, 1.36381995677948, -0.9342983961105347, -0.8371968269348145, 0.12851472198963165, -0.8319852948188782, 1.0388054847717285, 0.7605748772621155, 0.3792373538017273, 0.2281286120414734, 1.5645067691802979, 0.7653123140335083, -0.4644263684749603, 0.5783112645149231, 0.5438664555549622, -0.16117291152477264, -2.0425877571105957, -1.1231791973114014, 0.37354302406311035, -0.5042290091514587, -1.6112529039382935, 1.3957184553146362, -1.0736033916473389, -0.9562596082687378, 0.5473474860191345, 0.10195354372262955, 1.415157437324524, 0.2791048288345337, 1.5520747900009155, 2.0393760204315186, 0.8806233406066895, 0.3287479281425476, 1.3000413179397583, -0.11910421401262283, -0.4360795021057129, 1.7962377071380615, -0.4859335422515869, 0.507087767124176, 1.0394858121871948, -0.33862584829330444, -1.0879653692245483, -0.7811112999916077, -1.2919615507125854, -0.6380186080932617, 1.210459589958191, 0.12906628847122192, -1.1147054433822632, 0.2493695765733719, 1.568650722503662, 0.16629809141159058, -0.35174497961997986, 0.7677837610244751, 0.3816215991973877, -0.8192225694656372, -0.005595508962869644, -0.9433763027191162, 0.4817288815975189, -0.12644529342651367, -0.2680701017379761, 0.25514331459999084, 0.499697208404541, 1.357287883758545, 0.012024118565022945, 0.1468009203672409, 1.1961857080459595, -1.3065465688705444, 1.493128776550293, -0.691106379032135, 0.25381335616111755, -2.4212989807128906, 1.4068117141723633, -0.8199405074119568, 1.8255985975265503, -2.6321840286254883, 0.4388524293899536, -0.5362677574157715, -0.40807774662971497, 0.3086942136287689, -0.42549026012420654, 0.14053311944007874, -0.1410728096961975, -1.1640067100524902, -0.07827477902173996, -0.7816735506057739, 0.6375496983528137, 1.1572579145431519, 1.3916807174682617, -1.2111748456954956, -0.26759418845176697, -1.7427469491958618, -0.20909900963306427, -0.7012234926223755, 0.44608017802238464, -1.9399652481079102, -0.14812999963760376, -1.8654663562774658, -2.4206881523132324, -1.2671700716018677, -0.8250851035118103, 1.1225206851959229, 0.10813162475824356, -0.8997644782066345, 1.1273913383483887, -0.38155320286750793, -1.8701841831207275, 1.1128809452056885, -2.164586305618286 ]
https://github.com/huggingface/datasets/issues/4400
load dataset wikitext-2-raw-v1 failed. Could not reach wikitext-2-raw-v1.py.
I tried in this way. ```python from datasets import load_dataset dataset = load_dataset(path="wikitext", name="wikitext-103-v1", split="train") ```
## Describe the bug Could not reach wikitext-2-raw-v1.py ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("wikitext-2-raw-v1") ``` ## Expected results Download `wikitext-2-raw-v1` dataset successfully. ## Actual results ``` File "load_datasets.py", line 13, in <module> load_dataset("wikitext-2-raw-v1") File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1715, in load_dataset **config_kwargs, File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1536, in load_dataset_builder data_files=data_files, File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1282, in dataset_module_factory raise e1 from None File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1224, in dataset_module_factory dynamic_modules_path=dynamic_modules_path, File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 559, in get_module local_path = self.download_loading_script(revision) File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 539, in download_loading_script return cached_path(file_path, download_config=download_config) File "/root/miniconda3/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 246, in cached_path download_desc=download_config.download_desc, File "/root/miniconda3/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 582, in get_from_cache raise ConnectionError(f"Couldn't reach {url} ({repr(head_error)})") ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.2.2/datasets/wikitext-2-raw-v1/wikitext-2-raw-v1.py (ReadTimeout(ReadTimeoutError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Read timed out. (read timeout=100)",),)) ``` I tried to download wikitext-2-raw-v1.py by chrome and got: ![image](https://user-images.githubusercontent.com/20658907/170171595-0ca9f1da-c05a-4b57-861e-9530bfa3bdb9.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: CentOS 7 - Python version: 3.6 - PyArrow version: 3.0.0
745
16
load dataset wikitext-2-raw-v1 failed. Could not reach wikitext-2-raw-v1.py. ## Describe the bug Could not reach wikitext-2-raw-v1.py ## Steps to reproduce the bug ```python from datasets import load_dataset load_dataset("wikitext-2-raw-v1") ``` ## Expected results Download `wikitext-2-raw-v1` dataset successfully. ## Actual results ``` File "load_datasets.py", line 13, in <module> load_dataset("wikitext-2-raw-v1") File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1715, in load_dataset **config_kwargs, File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1536, in load_dataset_builder data_files=data_files, File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1282, in dataset_module_factory raise e1 from None File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 1224, in dataset_module_factory dynamic_modules_path=dynamic_modules_path, File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 559, in get_module local_path = self.download_loading_script(revision) File "/root/miniconda3/lib/python3.6/site-packages/datasets/load.py", line 539, in download_loading_script return cached_path(file_path, download_config=download_config) File "/root/miniconda3/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 246, in cached_path download_desc=download_config.download_desc, File "/root/miniconda3/lib/python3.6/site-packages/datasets/utils/file_utils.py", line 582, in get_from_cache raise ConnectionError(f"Couldn't reach {url} ({repr(head_error)})") ConnectionError: Couldn't reach https://raw.githubusercontent.com/huggingface/datasets/2.2.2/datasets/wikitext-2-raw-v1/wikitext-2-raw-v1.py (ReadTimeout(ReadTimeoutError("HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Read timed out. (read timeout=100)",),)) ``` I tried to download wikitext-2-raw-v1.py by chrome and got: ![image](https://user-images.githubusercontent.com/20658907/170171595-0ca9f1da-c05a-4b57-861e-9530bfa3bdb9.png) ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: CentOS 7 - Python version: 3.6 - PyArrow version: 3.0.0 I tried in this way. ```python from datasets import load_dataset dataset = load_dataset(path="wikitext", name="wikitext-103-v1", split="train") ```
[ -1.1996337175369263, -0.9032848477363586, -0.6468993425369263, 1.289390206336975, -0.08532208204269409, -1.3186538219451904, 0.16563428938388824, -1.0458660125732422, 1.508165717124939, -0.8441731333732605, 0.17531053721904755, -1.7008812427520752, -0.12451083958148956, -0.4970904588699341, -0.6195635199546814, -0.9492757320404053, -0.3604140281677246, -0.9493564963340759, 1.07772696018219, 2.4764413833618164, 1.2711551189422607, -1.22251558303833, 2.7895030975341797, 0.6615618467330933, -0.30836179852485657, -0.9344221949577332, 0.48534759879112244, 0.06451757252216339, -1.1728599071502686, -0.41931211948394775, -0.9271231293678284, -0.04282114654779434, -0.5972420573234558, -0.40826502442359924, 0.10634654015302658, 0.5008894205093384, -0.32273632287979126, -0.29161566495895386, -0.6563573479652405, -0.7355136275291443, 0.5431622266769409, -0.35709086060523987, 1.0316342115402222, -0.36806952953338623, 1.7442435026168823, -0.5834897756576538, 0.4507734477519989, 0.719909131526947, 1.1956621408462524, 0.15262235701084137, 0.15736839175224304, 0.23821063339710236, 0.2721153795719147, -0.01541442796587944, 0.5586671233177185, 1.2165591716766357, 0.5812050700187683, 0.5653187036514282, 0.6474252939224243, -2.2012572288513184, 1.3091440200805664, -0.8497074842453003, 0.2510713040828705, 1.3541284799575806, -0.8441876769065857, 0.38446342945098877, -1.7770185470581055, -0.13643984496593475, 0.5583977103233337, -2.281113386154175, 0.2647705078125, -1.313841700553894, -0.5243919491767883, 0.9156358242034912, 0.41962867975234985, -1.1936473846435547, 0.15398305654525757, -0.4256683886051178, 1.137027621269226, 0.5080692768096924, 1.1306644678115845, -1.6641680002212524, -0.028278496116399765, -0.20085833966732025, 0.026689983904361725, -1.2340686321258545, -1.6915186643600464, 0.538774311542511, 0.5415089130401611, 0.8453587889671326, -0.08904790878295898, 1.0018936395645142, -1.1111990213394165, 0.8320625424385071, -1.0735316276550293, -1.5817852020263672, -1.3600934743881226, -2.5076446533203125, -2.42525577545166, 0.8333289623260498, -0.5312359929084778, -0.5151355266571045, 2.0409340858459473, -1.041512131690979, -1.7526183128356934, 1.043874740600586, 0.23037920892238617, -0.023085113614797592, 2.3204972743988037, 0.2905732989311218, -0.7985824346542358, 0.4880169630050659, -0.7351964712142944, 0.8517923355102539, -0.28649234771728516, 1.327166199684143, 0.6231736540794373, -1.0267701148986816, 1.5561273097991943, -0.5619983077049255, 0.6728864312171936, -0.6194432973861694, -0.5232431292533875, -0.8180913925170898, 0.241176575422287, 1.8043832778930664, -0.306814044713974, 1.5291831493377686, -0.20963236689567566, -1.6079827547073364, -1.5303665399551392, 0.8976002931594849, 0.500703752040863, -0.8671826124191284, 0.0625479593873024, -0.472822904586792, 0.11923956871032715, 0.09060892462730408, 1.1501684188842773, 1.2395676374435425, 0.761496901512146, -0.37223660945892334, -0.8153814077377319, 0.20555104315280914, -0.13196876645088196, -0.6983147263526917, -1.7933073043823242, -0.3033751845359802, 0.17741155624389648, 0.5706307888031006, -1.2313272953033447, 1.8538810014724731, 0.8999574780464172, 2.0503041744232178, 0.8885971307754517, -0.3686924874782562, 1.4900219440460205, -0.09026824682950974, 1.8741657733917236, -0.4200032949447632, 0.6288525462150574, -0.3541053831577301, -1.203367829322815, 0.7911259531974792, -0.40281447768211365, -2.004141092300415, -0.7754144668579102, -0.8225293755531311, -0.10859334468841553, -0.7794649004936218, 0.8360671401023865, -0.2579845190048218, -1.591439127922058, 0.04117651656270027, -0.6061573624610901, 0.1368502974510193, -1.3708802461624146, 0.20677517354488373, 0.652016282081604, -0.7700836062431335, -0.07376476377248764, -0.2610807716846466, -1.2906880378723145, -0.49752792716026306, 0.3525143563747406, 1.9440034627914429, -0.6270886063575745, 0.9593884348869324, 1.0379809141159058, -0.7453393340110779, 0.12126801908016205, 0.1971741020679474, -0.30872100591659546, 0.713932454586029, -1.1341105699539185, -0.36074936389923096, 1.2239893674850464, -0.21647454798221588, -0.6750231385231018, 1.4108079671859741, 0.7905676364898682, -1.139218807220459, -0.23253990709781647, -0.26980939507484436, -0.8294768333435059, -0.012192409485578537, -1.519951343536377, -0.1377803236246109, 0.35235458612442017, -1.3572578430175781, -0.4131445586681366, -0.22296588122844696, 1.3302518129348755, -0.23429477214813232, 1.3913092613220215, -0.3577220141887665, -0.21473422646522522, -0.34847837686538696, -0.4987078011035919, 0.22420208156108856, -0.12176772207021713, -0.5943634510040283, 0.19899015128612518, -0.7532116174697876, 0.16607274115085602, 1.5652602910995483, 0.29823657870292664, 0.15008537471294403, 0.4184717833995819, 1.1115363836288452, 0.36600837111473083, -0.1037590354681015, -0.8545672297477722, -1.5438735485076904, 1.9323841333389282, -1.4823552370071411, 1.8764500617980957, 0.6949056386947632, -0.09145087748765945, -1.8489222526550293, -1.846987247467041, 1.2128230333328247, 1.168660283088684, 2.356799840927124, 0.5301529169082642, 0.4227098226547241, -0.741615891456604, -0.8074420094490051, 0.3302288353443146, -0.9990439414978027, -0.5957677960395813, 0.17475898563861847, 2.3007588386535645, 1.7511488199234009, -0.5474903583526611, -0.3147326409816742, -0.8690086007118225, 1.2860084772109985, -0.2981353998184204, 0.2531055808067322, 2.111902952194214, -0.36923837661743164, -0.9570853114128113, 1.3584346771240234, -2.35966420173645, 0.3489214777946472, 2.0980215072631836, 0.308832049369812, 0.15534554421901703, -1.4166208505630493, -0.6875343918800354, -0.3608826994895935, -0.5200347304344177, -1.2942347526550293, 0.6031023263931274, -0.3367668390274048, -0.8745533227920532, -1.4394279718399048, 0.10451584309339523, -1.1135700941085815, -1.80647611618042, 0.3355447053909302, 1.9829999208450317, 2.120414972305298, -0.8740077614784241, 1.3075181245803833, -0.2802940309047699, 0.07902748137712479, 1.306708574295044, 1.2960106134414673, 3.116837501525879, 1.8497331142425537, -1.2754075527191162, 0.7309250831604004, -0.23457719385623932, -0.47421810030937195, 1.1003576517105103, -1.0363277196884155, 1.1337873935699463, -0.22303850948810577, -1.2468373775482178, -1.243006944656372, 1.064916729927063, 0.4284459054470062, 0.006180738098919392, -0.4471571743488312, 1.2686114311218262, 0.08506033569574356, 1.428471565246582, 0.6503030061721802, -0.48320600390434265, 0.562350869178772, -0.3519885540008545, -0.5902921557426453, 1.6556025743484497, 0.23925623297691345, -1.5977965593338013, -2.4077885150909424, -0.31691181659698486, -1.003951072692871, -0.01996089518070221, -0.6085768938064575, -1.0167882442474365, 1.598642110824585, 0.4824051260948181, -1.0880471467971802, -0.19135607779026031, -0.2709292769432068, -0.4034968316555023, 2.708883285522461, -1.3006147146224976, -0.08530290424823761, -0.8597908020019531, -0.5506088733673096, 1.6454670429229736, -1.2359012365341187, -0.21340540051460266, -1.0668195486068726, -0.6161129474639893, -1.2903766632080078, -0.416826993227005, 0.03249204531311989, -0.9504576325416565, 0.7907493710517883, 0.14979958534240723, -1.1266568899154663, -0.29701054096221924, -0.9986037015914917, 1.0655649900436401, -0.0668659508228302, 0.2633854150772095, 1.8330127000808716, 0.3715723156929016, -0.413753479719162, 0.791557788848877, 1.274094820022583, 0.5977602005004883, -0.7083376049995422, -0.018796224147081375, -0.6996638774871826, 0.30147507786750793, -1.3233835697174072, 0.1683218628168106, -3.0331857204437256, 0.739482581615448, -0.2292311191558838, -0.19909442961215973, -0.13769114017486572, -1.423989176750183, 1.0301624536514282, 2.5230019092559814, -1.190144658088684, 0.5080518126487732, 0.40665486454963684, 1.1477402448654175, -1.565719485282898, 0.24296259880065918, -0.5333427786827087, 1.9880324602127075, 0.13068009912967682, 1.1834989786148071, -0.5371350049972534, -2.179070472717285, 0.6211849451065063, -1.168280839920044, -0.9854172468185425, 0.8561460971832275, -0.9006467461585999, 0.31388527154922485, -1.3343859910964966, -0.15587656199932098, -0.843499481678009, -1.2307233810424805, 0.6702972054481506, 0.11416541039943695, 0.4575181305408478, -0.5504500269889832, 0.3540509343147278, -2.2191460132598877, -1.4085760116577148, -0.1721668541431427, -0.919084370136261, 0.5685099959373474, -0.4252523183822632, 0.5421602129936218, -0.06896129995584488, 0.11561055481433868, 0.27358388900756836, 1.5292296409606934, 3.357739210128784, 0.06219048425555229, 0.1486000418663025, -0.046883489936590195, -1.1458483934402466, 1.4265352487564087, 0.8903263807296753, -0.14050379395484924, -0.6368715167045593, -0.9438000321388245, 1.2493325471878052, 1.9525432586669922, 1.1727203130722046, 0.03250570967793465, -0.8540886640548706, -0.6946918368339539, 0.06944210082292557, 0.2244354635477066, 0.5748209357261658, 1.0143707990646362, -0.053747016936540604, 0.0802161768078804, 1.4847663640975952, 1.146122694015503, -0.289829283952713, 0.45856887102127075, -0.9906929731369019, -0.39352843165397644, 0.43878281116485596, 0.1828921139240265, 0.11737622320652008, 0.45984336733818054, -1.1033605337142944, -0.3057326078414917, -0.2655675411224365, -0.8422293066978455, -0.8384401798248291, -0.43310946226119995, -0.48440322279930115, 1.5953540802001953, 0.06833601742982864, -0.5413199663162231, 0.13048027455806732, -0.6505874395370483, -0.17618311941623688, -1.0895038843154907, 0.1996614784002304, -0.12856744229793549, -0.10952060669660568, -0.17371731996536255, 1.6874706745147705, -1.0158339738845825, -2.087554931640625, 0.2039431780576706, 0.36783236265182495, -0.30209484696388245, 0.13608130812644958, 1.675942301750183, 0.4824863076210022, 1.33350670337677, 1.2837072610855103, 0.9841945171356201, -0.5981520414352417, -1.2443478107452393, 0.7214837074279785, 0.9635744690895081, -1.315021276473999, 0.8653090596199036, -0.2098332941532135, -0.5259918570518494, 0.6405465602874756, 1.3678680658340454, 0.40224698185920715, -1.9505631923675537, 0.9935979247093201, -0.9475523233413696, 0.7819392085075378, 0.7938178181648254, 0.7383496761322021, 0.1893918365240097, 0.8648008108139038, -1.261404037475586, -1.1243031024932861, -0.6443227529525757, -0.6149677634239197, 1.8490182161331177, -0.2322530895471573, 0.5759523510932922, -0.2040281593799591, -1.0911356210708618, -0.024073876440525055, 0.7289240956306458, 0.4404680132865906, -0.35543739795684814, 0.8359639644622803, -0.5870440006256104, -0.9211943745613098, -1.3018763065338135, -0.3456329107284546, -1.1374738216400146, -0.8348736763000488, 0.9614690542221069, 0.7769227027893066, 0.5229591131210327, 1.9156546592712402, 0.651517391204834, 0.37311625480651855, -2.6631133556365967, 0.8455396294593811, 0.2599917948246002, -0.03037816286087036, 0.8286803364753723, 0.2739211916923523, 1.1700903177261353, -0.01435794122517109, 0.6093739867210388, -2.3098766803741455, 2.208178758621216, -0.28089025616645813, 0.5434353351593018, 0.04386083409190178, -0.15934649109840393, 1.11323881149292, 0.6172066926956177, 0.52762371301651, -1.1553281545639038, 0.6891950368881226, -0.5473074913024902, 1.0764679908752441, 0.9402899742126465, -0.9434627890586853, 0.14106813073158264, 1.4190129041671753, 0.5106693506240845, -0.40194031596183777, -0.9978577494621277, -0.8591379523277283, 0.9373872876167297, 1.6408288478851318, -0.09965706616640091, -0.007127521559596062, 0.7961070537567139, 0.7121217846870422, -1.2508174180984497, 0.07439626753330231, -0.6509783864021301, -0.609470009803772, 1.7375210523605347, 2.0530056953430176, -0.08727340400218964, -0.1787703037261963, -0.7599806189537048, -1.2636725902557373, 0.8370627164840698, -0.03778291121125221, -0.026858031749725342, 0.7457388043403625, -0.6931228041648865, 1.0887936353683472, 0.5716657042503357, 0.9358722567558289, 0.10360092669725418, 0.23913805186748505, 0.3370226323604584, -0.32960033416748047, -1.200199007987976, -0.29992029070854187, -1.066736102104187, -2.5943639278411865, 0.3257744610309601, -0.33069053292274475, -1.5012097358703613, 0.015657126903533936, -1.0347824096679688, 0.8945754766464233, -0.589104175567627, -1.112183928489685, -1.4462401866912842, 0.3752632141113281, -0.15257343649864197, 0.9056065678596497, -1.6767363548278809, -0.23031635582447052, 1.2572804689407349, 0.8994462490081787, -0.5565835237503052, 1.0052951574325562, 0.2912420630455017, 0.9375659227371216, 0.7215017676353455, -0.42290884256362915, 0.6555489301681519, -0.02402052842080593, -1.3739674091339111, 0.4254240393638611, 1.3004792928695679, 0.15877802670001984, 1.3771165609359741, -0.4284692406654358, 0.14818894863128662, 0.43352213501930237, -0.6860224008560181, -0.5659741163253784, -0.4426475167274475, 0.7719665765762329, 0.062456998974084854, -1.0693399906158447, -0.14701642096042633, -0.07620609551668167, -0.24956142902374268, 0.30379951000213623, -1.4241642951965332, -0.34015700221061707, -0.3762689232826233, -0.4449513256549835, -1.431933879852295, 0.027980942279100418, 1.2809574604034424, -0.8646206259727478, -0.21572935581207275, 0.4681902229785919, 0.36553946137428284, 0.5298537015914917, 0.5843374729156494, -0.810393214225769, -0.15817590057849884, -0.4122534990310669, -0.2256028652191162, 0.2826867997646332, 1.2352697849273682, -0.06620797514915466, -0.9743922352790833, 0.6930784583091736, -0.2824229598045349, 0.22316958010196686, 2.003476619720459, 0.11501120030879974, -0.7714219689369202, 0.3581290543079376, -0.7751511335372925, 1.7175174951553345, 1.7218272686004639, 1.2867974042892456, -0.08364839106798172, -0.7286699414253235, 0.48980364203453064, -0.3078286051750183, -0.3026280701160431, 0.9065446257591248, 0.4254220724105835, -0.16046670079231262, -1.3812291622161865, 0.7131606340408325, 1.3295758962631226, -0.6902992725372314, -0.7860553860664368, 0.07202970236539841, -0.9029099941253662, 1.2468945980072021, 0.5744692087173462, 0.3619216978549957, 0.2553415894508362, 1.5493122339248657, 0.7490094304084778, -0.45007699728012085, 0.49651530385017395, 0.4566163420677185, -0.2006399780511856, -2.073122978210449, -1.0589631795883179, 0.2702266275882721, -0.4156339168548584, -1.5933696031570435, 1.4622818231582642, -1.1268357038497925, -1.029815673828125, 0.5902988314628601, 0.16407395899295807, 1.318035364151001, 0.39980995655059814, 1.6913607120513916, 2.1659398078918457, 0.9978868365287781, 0.42950791120529175, 1.257205843925476, -0.1130957081913948, -0.3714931011199951, 1.806043028831482, -0.3719169497489929, 0.4703240990638733, 0.9916169047355652, -0.43874213099479675, -1.0994871854782104, -0.9097127914428711, -1.1186065673828125, -0.5767202377319336, 1.116560459136963, 0.12357325851917267, -1.031982183456421, 0.21525520086288452, 1.5862420797348022, 0.06728725880384445, -0.24518953263759613, 0.7690908312797546, 0.3060024678707123, -0.7356346845626831, -0.08022722601890564, -0.9492537379264832, 0.5451382994651794, -0.14194950461387634, -0.3582985997200012, 0.1923578381538391, 0.5625360012054443, 1.3151681423187256, -0.05319048464298248, 0.12186454236507416, 1.176376223564148, -1.3555625677108765, 1.4280366897583008, -0.6234767436981201, 0.2914677858352661, -2.4207937717437744, 1.3816156387329102, -0.8059383034706116, 1.8930847644805908, -2.538633108139038, 0.4960939586162567, -0.4247826039791107, -0.5424506664276123, 0.24630379676818848, -0.48793715238571167, 0.10941222310066223, -0.08256307989358902, -0.9729945063591003, -0.01579108089208603, -0.774596631526947, 0.6342825889587402, 1.1668237447738647, 1.4929451942443848, -1.130387306213379, -0.2708323001861572, -1.6688661575317383, -0.09325536340475082, -0.7423470616340637, 0.3763883709907532, -1.9046639204025269, -0.19937211275100708, -1.9148048162460327, -2.371629476547241, -1.3363101482391357, -0.9068119525909424, 1.1436878442764282, 0.1779743880033493, -0.908228874206543, 1.1954340934753418, -0.33096662163734436, -1.813600778579712, 1.1904720067977905, -2.2099497318267822 ]
https://github.com/huggingface/datasets/issues/4399
LocalDatasetModuleFactoryWithoutScript extracts invalid builder name
Ok, so ``` os.path.basename("/home/user/") ``` gives `''` while ``` os.path.basename("/home/user") ``` gives `user`. The code should check if the last char is a slash.
## Describe the bug Trying to load a local dataset raises an error indicating that the config builder has to have a name. No error should be reported, since the call is completly valid. ## Steps to reproduce the bug ```python load_dataset("./data/some-dataset/", name="some-name") ``` ## Expected results The dataset should be loaded. ## Actual results ``` Traceback (most recent call last): File "train_lquad.py", line 19, in <module> load(tokenize_target_function, tokenize_target_function, {}, tokenizer) File "train_lquad.py", line 14, in load dataset = load_dataset("./data/lquad/", name="lquad") File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1708, in load_dataset builder_instance = load_dataset_builder( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1560, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 269, in __init__ self.config, self.config_id = self._create_builder_config( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 403, in _create_builder_config raise ValueError(f"BuilderConfig must have a name, got {builder_config.name}") ValueError: BuilderConfig must have a name, got ``` ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-348.20.1.el8_5.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.6 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 The error is probably in line 795 in load.py: ``` builder_kwargs = { "hash": hash, "data_files": data_files, "name": os.path.basename(self.path), "base_path": self.path, **builder_kwargs, } ``` `os.path.basename` for a directory returns an empty string, rather than the name of the directory.
746
24
LocalDatasetModuleFactoryWithoutScript extracts invalid builder name ## Describe the bug Trying to load a local dataset raises an error indicating that the config builder has to have a name. No error should be reported, since the call is completly valid. ## Steps to reproduce the bug ```python load_dataset("./data/some-dataset/", name="some-name") ``` ## Expected results The dataset should be loaded. ## Actual results ``` Traceback (most recent call last): File "train_lquad.py", line 19, in <module> load(tokenize_target_function, tokenize_target_function, {}, tokenizer) File "train_lquad.py", line 14, in load dataset = load_dataset("./data/lquad/", name="lquad") File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1708, in load_dataset builder_instance = load_dataset_builder( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1560, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 269, in __init__ self.config, self.config_id = self._create_builder_config( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 403, in _create_builder_config raise ValueError(f"BuilderConfig must have a name, got {builder_config.name}") ValueError: BuilderConfig must have a name, got ``` ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-348.20.1.el8_5.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.6 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 The error is probably in line 795 in load.py: ``` builder_kwargs = { "hash": hash, "data_files": data_files, "name": os.path.basename(self.path), "base_path": self.path, **builder_kwargs, } ``` `os.path.basename` for a directory returns an empty string, rather than the name of the directory. Ok, so ``` os.path.basename("/home/user/") ``` gives `''` while ``` os.path.basename("/home/user") ``` gives `user`. The code should check if the last char is a slash.
[ -1.2028781175613403, -0.8265863060951233, -0.6873316764831543, 1.4000132083892822, -0.1345987319946289, -1.1803244352340698, 0.1908228099346161, -1.0973252058029175, 1.5438079833984375, -0.7364124655723572, 0.1868392527103424, -1.6111446619033813, -0.06320741027593613, -0.5651378631591797, -0.6759361624717712, -0.9025902152061462, -0.39164555072784424, -0.7902257442474365, 1.0296825170516968, 2.487766981124878, 1.2549939155578613, -1.3041956424713135, 2.7914435863494873, 0.6390030980110168, -0.21419689059257507, -0.9676055312156677, 0.6308166980743408, 0.04305354878306389, -1.240092158317566, -0.4653174579143524, -0.9154608249664307, -0.04669426754117012, -0.5761438608169556, -0.3823773264884949, 0.0441695973277092, 0.44772765040397644, -0.33042189478874207, -0.25750645995140076, -0.6929980516433716, -0.7901734113693237, 0.519203245639801, -0.38001549243927, 0.9770554304122925, -0.3547755479812622, 1.7602859735488892, -0.5813354849815369, 0.46075183153152466, 0.6933238506317139, 1.219090461730957, 0.2284962683916092, 0.15412180125713348, 0.30749356746673584, 0.41688841581344604, 0.07946371287107468, 0.6392685174942017, 1.1690642833709717, 0.56711745262146, 0.5002123117446899, 0.5998960733413696, -2.18310284614563, 1.3155099153518677, -0.8196660280227661, 0.18917334079742432, 1.3260844945907593, -0.8514448404312134, 0.34123775362968445, -1.7922937870025635, -0.07200309634208679, 0.6125773191452026, -2.2843592166900635, 0.2655792534351349, -1.3409067392349243, -0.6193897724151611, 0.8658521175384521, 0.40839827060699463, -1.1475615501403809, 0.18318761885166168, -0.5013024210929871, 1.0843385457992554, 0.43179258704185486, 1.1540244817733765, -1.6489945650100708, -0.07947719842195511, -0.1415427029132843, 0.09436936676502228, -1.248711109161377, -1.6420382261276245, 0.5737923979759216, 0.6028723120689392, 0.6197402477264404, -0.15156246721744537, 1.0008338689804077, -1.1128716468811035, 0.8013877868652344, -1.0362553596496582, -1.658380389213562, -1.4075748920440674, -2.4183578491210938, -2.373138427734375, 0.8610283732414246, -0.5647507309913635, -0.5082853436470032, 1.9643632173538208, -0.9632652997970581, -1.7170910835266113, 0.9745275974273682, 0.2981402575969696, 0.07678195834159851, 2.3544628620147705, 0.18574480712413788, -0.6598615646362305, 0.3942524790763855, -0.7522504925727844, 0.8040303587913513, -0.3321676254272461, 1.3141218423843384, 0.5241565704345703, -0.964839518070221, 1.5664056539535522, -0.4750521779060364, 0.6203843951225281, -0.6383661031723022, -0.4721118211746216, -0.7643309831619263, 0.21416111290454865, 1.9308760166168213, -0.347348690032959, 1.6273115873336792, -0.2584211230278015, -1.6093932390213013, -1.5964275598526, 0.8542545437812805, 0.4808853268623352, -0.8197492361068726, 0.058861441910266876, -0.48806682229042053, 0.2549930512905121, -0.026780106127262115, 1.1542937755584717, 1.2597531080245972, 0.7611219882965088, -0.3262040317058563, -0.8173245191574097, 0.16970105469226837, -0.2162102907896042, -0.7435429692268372, -1.7555186748504639, -0.2893736958503723, 0.18061405420303345, 0.5858840346336365, -1.252764344215393, 1.8374888896942139, 0.8672817945480347, 1.9203875064849854, 0.9766493439674377, -0.3664045035839081, 1.5537115335464478, -0.000029334798455238342, 1.8367866277694702, -0.5669357776641846, 0.5320956110954285, -0.4080727994441986, -1.1264381408691406, 0.8236958980560303, -0.3220381438732147, -1.9900208711624146, -0.8313091993331909, -0.7623572945594788, -0.16829520463943481, -0.7102705240249634, 0.8465367555618286, -0.3057140111923218, -1.4902857542037964, 0.10090137273073196, -0.7024317383766174, 0.1323128342628479, -1.2727344036102295, 0.24316416680812836, 0.7341380715370178, -0.680880606174469, -0.050884149968624115, -0.24313318729400635, -1.2025583982467651, -0.49302008748054504, 0.28886064887046814, 2.02348256111145, -0.5933732986450195, 0.9136450886726379, 1.0164076089859009, -0.7861262559890747, 0.0832977443933487, 0.22578398883342743, -0.29666244983673096, 0.7217889428138733, -1.1328668594360352, -0.4676826000213623, 1.1933749914169312, -0.19482851028442383, -0.6421909928321838, 1.44327712059021, 0.8442043662071228, -1.107750654220581, -0.2949770390987396, -0.18378177285194397, -0.8530451655387878, -0.016082607209682465, -1.502540111541748, -0.16266751289367676, 0.31034016609191895, -1.50314462184906, -0.4098217487335205, -0.17882363498210907, 1.2665387392044067, -0.23334935307502747, 1.4878164529800415, -0.3125954866409302, -0.20861373841762543, -0.26530787348747253, -0.5269898176193237, 0.12669481337070465, -0.1556241661310196, -0.5637996196746826, 0.18089736998081207, -0.794235348701477, 0.2441561073064804, 1.5033038854599, 0.2882803976535797, 0.07705441862344742, 0.4578641355037689, 1.053911805152893, 0.4148836135864258, -0.08626816421747208, -0.8482734560966492, -1.4954156875610352, 1.9366226196289062, -1.3796696662902832, 1.906697392463684, 0.7568116784095764, -0.06589122116565704, -1.7982468605041504, -1.8641971349716187, 1.2287230491638184, 1.1297982931137085, 2.4116218090057373, 0.4616731107234955, 0.4147651195526123, -0.7569975256919861, -0.8210340738296509, 0.3808630108833313, -0.9429711103439331, -0.6251653432846069, 0.163836270570755, 2.3733489513397217, 1.8370559215545654, -0.5798714756965637, -0.2949051856994629, -0.9445824027061462, 1.31382417678833, -0.17936402559280396, 0.2683071494102478, 2.0396206378936768, -0.3053693175315857, -1.0355883836746216, 1.265379548072815, -2.363186836242676, 0.27017655968666077, 2.0270700454711914, 0.2955285310745239, 0.14434373378753662, -1.4257296323776245, -0.6846207976341248, -0.3183918297290802, -0.472160667181015, -1.2488155364990234, 0.4977308213710785, -0.2098982036113739, -0.8696646690368652, -1.435667872428894, 0.06854970753192902, -1.2074642181396484, -1.7883206605911255, 0.2953086793422699, 1.9471557140350342, 2.0685977935791016, -0.8502804040908813, 1.3972492218017578, -0.2880425453186035, 0.03220352903008461, 1.321642518043518, 1.351190209388733, 3.0814969539642334, 1.9023139476776123, -1.3132911920547485, 0.7764808535575867, -0.2909530997276306, -0.46118712425231934, 1.1741716861724854, -1.1558667421340942, 1.1161669492721558, -0.2060176581144333, -1.2360035181045532, -1.244027853012085, 1.0490411520004272, 0.49160733819007874, 0.000005258247256278992, -0.4531483054161072, 1.2546991109848022, 0.12425035238265991, 1.3933707475662231, 0.6720216274261475, -0.42866209149360657, 0.6028761863708496, -0.35670167207717896, -0.542587399482727, 1.7138054370880127, 0.23008465766906738, -1.4841198921203613, -2.37800669670105, -0.3326514959335327, -1.0534008741378784, -0.059944067150354385, -0.5765217542648315, -1.0410763025283813, 1.6625856161117554, 0.3717992603778839, -1.24184250831604, -0.2794544994831085, -0.28901082277297974, -0.5134517550468445, 2.6916956901550293, -1.271517038345337, -0.09025175869464874, -0.9216997623443604, -0.5714266300201416, 1.6118438243865967, -1.2227028608322144, -0.22063812613487244, -1.0654189586639404, -0.6055530905723572, -1.2856980562210083, -0.38002684712409973, -0.003233670722693205, -0.9465264678001404, 0.8081836700439453, 0.19924496114253998, -1.1118050813674927, -0.3469584882259369, -0.8683404326438904, 1.0651437044143677, -0.07289112359285355, 0.14242476224899292, 1.8101989030838013, 0.3179028630256653, -0.43702569603919983, 0.7640734314918518, 1.2287684679031372, 0.5469129681587219, -0.7079354524612427, 0.08105260878801346, -0.7474573254585266, 0.40620920062065125, -1.4184238910675049, 0.15848414599895477, -2.920257806777954, 0.7634247541427612, -0.28428030014038086, -0.18582291901111603, -0.12530405819416046, -1.3333667516708374, 1.052032470703125, 2.607323169708252, -1.1484040021896362, 0.44350388646125793, 0.45712438225746155, 1.1427987813949585, -1.6459931135177612, 0.3312406539916992, -0.4804363548755646, 2.022696018218994, 0.24414534866809845, 1.1354808807373047, -0.47514769434928894, -2.2031145095825195, 0.5717465877532959, -1.1594334840774536, -1.0251351594924927, 0.7997655272483826, -0.8604956269264221, 0.28103184700012207, -1.421938419342041, -0.18460068106651306, -0.8826291561126709, -1.2968908548355103, 0.6705799698829651, 0.11109267920255661, 0.40908917784690857, -0.5496201515197754, 0.3613676428794861, -2.2040374279022217, -1.3431404829025269, -0.19142957031726837, -0.9640162587165833, 0.5682830810546875, -0.45781657099723816, 0.6010457277297974, -0.05194389820098877, 0.09332085400819778, 0.31966227293014526, 1.4217644929885864, 3.4479212760925293, 0.14307980239391327, 0.145536407828331, -0.1112096756696701, -1.0469974279403687, 1.4226210117340088, 0.8544263243675232, -0.10770843178033829, -0.5667060613632202, -1.0707199573516846, 1.2955857515335083, 2.019082546234131, 1.137293815612793, 0.12684498727321625, -0.7559127807617188, -0.684068500995636, 0.013814774341881275, 0.13099125027656555, 0.47365835309028625, 0.9507197737693787, -0.057832472026348114, 0.06609645485877991, 1.3670992851257324, 1.243273377418518, -0.19214604794979095, 0.34199315309524536, -0.9385931491851807, -0.37926775217056274, 0.4426150619983673, 0.1771736890077591, 0.07394053041934967, 0.511930525302887, -1.0630860328674316, -0.3258633315563202, -0.33302587270736694, -0.8375119566917419, -0.7530977725982666, -0.468662291765213, -0.43747326731681824, 1.6074491739273071, 0.07079379260540009, -0.5260635018348694, 0.020654410123825073, -0.6423169374465942, -0.16818061470985413, -1.1519516706466675, 0.12214072048664093, -0.05185592547059059, -0.08588042855262756, -0.13777154684066772, 1.7011624574661255, -0.9278213381767273, -2.1536970138549805, 0.21414169669151306, 0.2639714479446411, -0.26551055908203125, 0.25735002756118774, 1.7409331798553467, 0.5266939401626587, 1.3590078353881836, 1.256569266319275, 0.9837665557861328, -0.621155858039856, -1.2314577102661133, 0.7515765428543091, 0.9193322062492371, -1.3041579723358154, 0.9037038087844849, -0.17698997259140015, -0.5160325765609741, 0.65127032995224, 1.1981654167175293, 0.3640420436859131, -1.993317723274231, 0.9041943550109863, -0.9320111274719238, 0.6856173276901245, 0.6928281784057617, 0.7453606724739075, 0.18128539621829987, 0.8849654197692871, -1.232480525970459, -1.2094054222106934, -0.6902853846549988, -0.6130391359329224, 1.87545645236969, -0.27217555046081543, 0.5506517291069031, -0.21262496709823608, -1.1743983030319214, -0.05950014665722847, 0.854413628578186, 0.34072253108024597, -0.5123538970947266, 0.8461682796478271, -0.6240532398223877, -0.8949415683746338, -1.2279906272888184, -0.3731451630592346, -1.1563800573349, -0.8465357422828674, 1.0855998992919922, 0.8056256175041199, 0.461477130651474, 1.9637647867202759, 0.6324039697647095, 0.3471621870994568, -2.662868022918701, 0.8439827561378479, 0.2616441249847412, -0.08606759458780289, 0.9031925201416016, 0.24855004251003265, 1.1314030885696411, -0.027189217507839203, 0.6294007897377014, -2.331881284713745, 2.269944429397583, -0.20697787404060364, 0.6674926280975342, 0.06648406386375427, -0.2079995721578598, 1.1507577896118164, 0.6247897744178772, 0.5472503900527954, -1.120568037033081, 0.6503299474716187, -0.4989947974681854, 1.0538852214813232, 0.9498584866523743, -0.8931148648262024, 0.10854382812976837, 1.4651808738708496, 0.4970802366733551, -0.48209816217422485, -0.9276779890060425, -0.7975512146949768, 1.0131654739379883, 1.7100918292999268, -0.02726827561855316, -0.03535357117652893, 0.8844542503356934, 0.6507212519645691, -1.2549699544906616, 0.0757182240486145, -0.7045211791992188, -0.5795788168907166, 1.7097612619400024, 2.0598864555358887, -0.10423267632722855, -0.15298743546009064, -0.7489596605300903, -1.3264358043670654, 0.7531586289405823, 0.020752552896738052, 0.09737298637628555, 0.7417480945587158, -0.6551311016082764, 1.078123927116394, 0.5903550982475281, 1.0743426084518433, 0.0781891718506813, 0.2836691439151764, 0.44210565090179443, -0.3934955298900604, -1.1489406824111938, -0.3583904206752777, -1.0704766511917114, -2.5863471031188965, 0.5000067353248596, -0.2634173035621643, -1.4817805290222168, -0.004692502785474062, -1.051969051361084, 0.9193409085273743, -0.5643702745437622, -1.0611097812652588, -1.422084927558899, 0.3445385694503784, -0.18202923238277435, 0.9511143565177917, -1.6953074932098389, -0.21998175978660583, 1.2971997261047363, 0.8126088976860046, -0.5580281615257263, 0.994777500629425, 0.2886415421962738, 0.9503325819969177, 0.7886026501655579, -0.3879257142543793, 0.6483649015426636, -0.04952511563897133, -1.3208189010620117, 0.3852006793022156, 1.2415070533752441, 0.14307871460914612, 1.402353286743164, -0.4824824929237366, 0.12753072381019592, 0.41635289788246155, -0.6784994006156921, -0.5131458044052124, -0.4148283302783966, 0.6499983072280884, 0.028452131897211075, -1.0258628129959106, -0.20096136629581451, -0.05384019389748573, -0.245744526386261, 0.1863211691379547, -1.3171154260635376, -0.22815687954425812, -0.3467898368835449, -0.42509207129478455, -1.3789421319961548, 0.03264158219099045, 1.280700445175171, -0.8196809887886047, -0.19595123827457428, 0.3998631536960602, 0.3372628092765808, 0.6006247997283936, 0.4817943572998047, -0.7871711850166321, -0.23045030236244202, -0.327252596616745, -0.3047664165496826, 0.2960169315338135, 1.3186887502670288, -0.11122588813304901, -1.0219470262527466, 0.6845235228538513, -0.30710741877555847, 0.19898952543735504, 2.0317859649658203, 0.03287825360894203, -0.6464587450027466, 0.34973329305648804, -0.7332068085670471, 1.703393578529358, 1.7943984270095825, 1.3544659614562988, -0.054277848452329636, -0.8052186369895935, 0.5085152387619019, -0.34000563621520996, -0.2969019114971161, 0.926983654499054, 0.3801562190055847, -0.23822961747646332, -1.4528944492340088, 0.5826756954193115, 1.2890769243240356, -0.7524842619895935, -0.720525324344635, 0.09096468240022659, -0.8953868746757507, 1.2667216062545776, 0.5193533301353455, 0.2730368971824646, 0.24509279429912567, 1.5213640928268433, 0.7389331459999084, -0.4698652923107147, 0.5778948068618774, 0.5568442344665527, -0.20572836697101593, -2.1144468784332275, -1.1067124605178833, 0.4054628014564514, -0.4469400644302368, -1.6390005350112915, 1.402577519416809, -1.125098705291748, -1.068037509918213, 0.5320329666137695, 0.1276903748512268, 1.3001145124435425, 0.3609740138053894, 1.697530746459961, 2.196502923965454, 0.8630480766296387, 0.41932234168052673, 1.189647912979126, -0.1337839961051941, -0.44597044587135315, 1.8169916868209839, -0.3908003568649292, 0.5262012481689453, 0.9337330460548401, -0.37274137139320374, -1.0503485202789307, -0.8750216960906982, -1.17110276222229, -0.6295521259307861, 1.2061878442764282, 0.057662174105644226, -1.0127556324005127, 0.16889917850494385, 1.6125621795654297, 0.06381320208311081, -0.2712530791759491, 0.7456188797950745, 0.3432299494743347, -0.7479451298713684, -0.0843762755393982, -0.9057112336158752, 0.4891291558742523, -0.09830673784017563, -0.2998710572719574, 0.25793275237083435, 0.5356984734535217, 1.3214439153671265, -0.08715959638357162, 0.12741559743881226, 1.1748356819152832, -1.3295358419418335, 1.5701196193695068, -0.6081964373588562, 0.23014797270298004, -2.4062647819519043, 1.4058862924575806, -0.7502681016921997, 1.9151004552841187, -2.562180757522583, 0.48792311549186707, -0.5374580025672913, -0.4652043879032135, 0.28836753964424133, -0.4125797748565674, 0.1411101520061493, -0.1636987179517746, -0.9609574675559998, 0.02842061221599579, -0.764417290687561, 0.6000393033027649, 1.1115134954452515, 1.4883702993392944, -1.1831163167953491, -0.29709482192993164, -1.7383321523666382, -0.1147812008857727, -0.7885301113128662, 0.2827950417995453, -1.980361819267273, -0.15029758214950562, -1.975823998451233, -2.371713161468506, -1.4439986944198608, -0.8539489507675171, 1.0064870119094849, 0.1854073852300644, -0.9051251411437988, 1.15800142288208, -0.3727509081363678, -1.9500855207443237, 1.2242259979248047, -2.188385009765625 ]
https://github.com/huggingface/datasets/issues/4399
LocalDatasetModuleFactoryWithoutScript extracts invalid builder name
I came through the same issue , just removing the last slash in the dataset path fixed it for me, may be this repo moderators could accept this as an accepted answer atleast if this could not be integrated > The fix is: > > ``` > "name": os.path.basename(self.path[:-1] if self.path[-1] == "/" else self.path) > ``` @apohllo consider making a pull request on this Thanks for the amazing contributions from huggingface people !!
## Describe the bug Trying to load a local dataset raises an error indicating that the config builder has to have a name. No error should be reported, since the call is completly valid. ## Steps to reproduce the bug ```python load_dataset("./data/some-dataset/", name="some-name") ``` ## Expected results The dataset should be loaded. ## Actual results ``` Traceback (most recent call last): File "train_lquad.py", line 19, in <module> load(tokenize_target_function, tokenize_target_function, {}, tokenizer) File "train_lquad.py", line 14, in load dataset = load_dataset("./data/lquad/", name="lquad") File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1708, in load_dataset builder_instance = load_dataset_builder( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1560, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 269, in __init__ self.config, self.config_id = self._create_builder_config( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 403, in _create_builder_config raise ValueError(f"BuilderConfig must have a name, got {builder_config.name}") ValueError: BuilderConfig must have a name, got ``` ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-348.20.1.el8_5.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.6 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 The error is probably in line 795 in load.py: ``` builder_kwargs = { "hash": hash, "data_files": data_files, "name": os.path.basename(self.path), "base_path": self.path, **builder_kwargs, } ``` `os.path.basename` for a directory returns an empty string, rather than the name of the directory.
746
74
LocalDatasetModuleFactoryWithoutScript extracts invalid builder name ## Describe the bug Trying to load a local dataset raises an error indicating that the config builder has to have a name. No error should be reported, since the call is completly valid. ## Steps to reproduce the bug ```python load_dataset("./data/some-dataset/", name="some-name") ``` ## Expected results The dataset should be loaded. ## Actual results ``` Traceback (most recent call last): File "train_lquad.py", line 19, in <module> load(tokenize_target_function, tokenize_target_function, {}, tokenizer) File "train_lquad.py", line 14, in load dataset = load_dataset("./data/lquad/", name="lquad") File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1708, in load_dataset builder_instance = load_dataset_builder( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1560, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 269, in __init__ self.config, self.config_id = self._create_builder_config( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 403, in _create_builder_config raise ValueError(f"BuilderConfig must have a name, got {builder_config.name}") ValueError: BuilderConfig must have a name, got ``` ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-348.20.1.el8_5.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.6 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 The error is probably in line 795 in load.py: ``` builder_kwargs = { "hash": hash, "data_files": data_files, "name": os.path.basename(self.path), "base_path": self.path, **builder_kwargs, } ``` `os.path.basename` for a directory returns an empty string, rather than the name of the directory. I came through the same issue , just removing the last slash in the dataset path fixed it for me, may be this repo moderators could accept this as an accepted answer atleast if this could not be integrated > The fix is: > > ``` > "name": os.path.basename(self.path[:-1] if self.path[-1] == "/" else self.path) > ``` @apohllo consider making a pull request on this Thanks for the amazing contributions from huggingface people !!
[ -1.2028781175613403, -0.8265863060951233, -0.6873316764831543, 1.4000132083892822, -0.1345987319946289, -1.1803244352340698, 0.1908228099346161, -1.0973252058029175, 1.5438079833984375, -0.7364124655723572, 0.1868392527103424, -1.6111446619033813, -0.06320741027593613, -0.5651378631591797, -0.6759361624717712, -0.9025902152061462, -0.39164555072784424, -0.7902257442474365, 1.0296825170516968, 2.487766981124878, 1.2549939155578613, -1.3041956424713135, 2.7914435863494873, 0.6390030980110168, -0.21419689059257507, -0.9676055312156677, 0.6308166980743408, 0.04305354878306389, -1.240092158317566, -0.4653174579143524, -0.9154608249664307, -0.04669426754117012, -0.5761438608169556, -0.3823773264884949, 0.0441695973277092, 0.44772765040397644, -0.33042189478874207, -0.25750645995140076, -0.6929980516433716, -0.7901734113693237, 0.519203245639801, -0.38001549243927, 0.9770554304122925, -0.3547755479812622, 1.7602859735488892, -0.5813354849815369, 0.46075183153152466, 0.6933238506317139, 1.219090461730957, 0.2284962683916092, 0.15412180125713348, 0.30749356746673584, 0.41688841581344604, 0.07946371287107468, 0.6392685174942017, 1.1690642833709717, 0.56711745262146, 0.5002123117446899, 0.5998960733413696, -2.18310284614563, 1.3155099153518677, -0.8196660280227661, 0.18917334079742432, 1.3260844945907593, -0.8514448404312134, 0.34123775362968445, -1.7922937870025635, -0.07200309634208679, 0.6125773191452026, -2.2843592166900635, 0.2655792534351349, -1.3409067392349243, -0.6193897724151611, 0.8658521175384521, 0.40839827060699463, -1.1475615501403809, 0.18318761885166168, -0.5013024210929871, 1.0843385457992554, 0.43179258704185486, 1.1540244817733765, -1.6489945650100708, -0.07947719842195511, -0.1415427029132843, 0.09436936676502228, -1.248711109161377, -1.6420382261276245, 0.5737923979759216, 0.6028723120689392, 0.6197402477264404, -0.15156246721744537, 1.0008338689804077, -1.1128716468811035, 0.8013877868652344, -1.0362553596496582, -1.658380389213562, -1.4075748920440674, -2.4183578491210938, -2.373138427734375, 0.8610283732414246, -0.5647507309913635, -0.5082853436470032, 1.9643632173538208, -0.9632652997970581, -1.7170910835266113, 0.9745275974273682, 0.2981402575969696, 0.07678195834159851, 2.3544628620147705, 0.18574480712413788, -0.6598615646362305, 0.3942524790763855, -0.7522504925727844, 0.8040303587913513, -0.3321676254272461, 1.3141218423843384, 0.5241565704345703, -0.964839518070221, 1.5664056539535522, -0.4750521779060364, 0.6203843951225281, -0.6383661031723022, -0.4721118211746216, -0.7643309831619263, 0.21416111290454865, 1.9308760166168213, -0.347348690032959, 1.6273115873336792, -0.2584211230278015, -1.6093932390213013, -1.5964275598526, 0.8542545437812805, 0.4808853268623352, -0.8197492361068726, 0.058861441910266876, -0.48806682229042053, 0.2549930512905121, -0.026780106127262115, 1.1542937755584717, 1.2597531080245972, 0.7611219882965088, -0.3262040317058563, -0.8173245191574097, 0.16970105469226837, -0.2162102907896042, -0.7435429692268372, -1.7555186748504639, -0.2893736958503723, 0.18061405420303345, 0.5858840346336365, -1.252764344215393, 1.8374888896942139, 0.8672817945480347, 1.9203875064849854, 0.9766493439674377, -0.3664045035839081, 1.5537115335464478, -0.000029334798455238342, 1.8367866277694702, -0.5669357776641846, 0.5320956110954285, -0.4080727994441986, -1.1264381408691406, 0.8236958980560303, -0.3220381438732147, -1.9900208711624146, -0.8313091993331909, -0.7623572945594788, -0.16829520463943481, -0.7102705240249634, 0.8465367555618286, -0.3057140111923218, -1.4902857542037964, 0.10090137273073196, -0.7024317383766174, 0.1323128342628479, -1.2727344036102295, 0.24316416680812836, 0.7341380715370178, -0.680880606174469, -0.050884149968624115, -0.24313318729400635, -1.2025583982467651, -0.49302008748054504, 0.28886064887046814, 2.02348256111145, -0.5933732986450195, 0.9136450886726379, 1.0164076089859009, -0.7861262559890747, 0.0832977443933487, 0.22578398883342743, -0.29666244983673096, 0.7217889428138733, -1.1328668594360352, -0.4676826000213623, 1.1933749914169312, -0.19482851028442383, -0.6421909928321838, 1.44327712059021, 0.8442043662071228, -1.107750654220581, -0.2949770390987396, -0.18378177285194397, -0.8530451655387878, -0.016082607209682465, -1.502540111541748, -0.16266751289367676, 0.31034016609191895, -1.50314462184906, -0.4098217487335205, -0.17882363498210907, 1.2665387392044067, -0.23334935307502747, 1.4878164529800415, -0.3125954866409302, -0.20861373841762543, -0.26530787348747253, -0.5269898176193237, 0.12669481337070465, -0.1556241661310196, -0.5637996196746826, 0.18089736998081207, -0.794235348701477, 0.2441561073064804, 1.5033038854599, 0.2882803976535797, 0.07705441862344742, 0.4578641355037689, 1.053911805152893, 0.4148836135864258, -0.08626816421747208, -0.8482734560966492, -1.4954156875610352, 1.9366226196289062, -1.3796696662902832, 1.906697392463684, 0.7568116784095764, -0.06589122116565704, -1.7982468605041504, -1.8641971349716187, 1.2287230491638184, 1.1297982931137085, 2.4116218090057373, 0.4616731107234955, 0.4147651195526123, -0.7569975256919861, -0.8210340738296509, 0.3808630108833313, -0.9429711103439331, -0.6251653432846069, 0.163836270570755, 2.3733489513397217, 1.8370559215545654, -0.5798714756965637, -0.2949051856994629, -0.9445824027061462, 1.31382417678833, -0.17936402559280396, 0.2683071494102478, 2.0396206378936768, -0.3053693175315857, -1.0355883836746216, 1.265379548072815, -2.363186836242676, 0.27017655968666077, 2.0270700454711914, 0.2955285310745239, 0.14434373378753662, -1.4257296323776245, -0.6846207976341248, -0.3183918297290802, -0.472160667181015, -1.2488155364990234, 0.4977308213710785, -0.2098982036113739, -0.8696646690368652, -1.435667872428894, 0.06854970753192902, -1.2074642181396484, -1.7883206605911255, 0.2953086793422699, 1.9471557140350342, 2.0685977935791016, -0.8502804040908813, 1.3972492218017578, -0.2880425453186035, 0.03220352903008461, 1.321642518043518, 1.351190209388733, 3.0814969539642334, 1.9023139476776123, -1.3132911920547485, 0.7764808535575867, -0.2909530997276306, -0.46118712425231934, 1.1741716861724854, -1.1558667421340942, 1.1161669492721558, -0.2060176581144333, -1.2360035181045532, -1.244027853012085, 1.0490411520004272, 0.49160733819007874, 0.000005258247256278992, -0.4531483054161072, 1.2546991109848022, 0.12425035238265991, 1.3933707475662231, 0.6720216274261475, -0.42866209149360657, 0.6028761863708496, -0.35670167207717896, -0.542587399482727, 1.7138054370880127, 0.23008465766906738, -1.4841198921203613, -2.37800669670105, -0.3326514959335327, -1.0534008741378784, -0.059944067150354385, -0.5765217542648315, -1.0410763025283813, 1.6625856161117554, 0.3717992603778839, -1.24184250831604, -0.2794544994831085, -0.28901082277297974, -0.5134517550468445, 2.6916956901550293, -1.271517038345337, -0.09025175869464874, -0.9216997623443604, -0.5714266300201416, 1.6118438243865967, -1.2227028608322144, -0.22063812613487244, -1.0654189586639404, -0.6055530905723572, -1.2856980562210083, -0.38002684712409973, -0.003233670722693205, -0.9465264678001404, 0.8081836700439453, 0.19924496114253998, -1.1118050813674927, -0.3469584882259369, -0.8683404326438904, 1.0651437044143677, -0.07289112359285355, 0.14242476224899292, 1.8101989030838013, 0.3179028630256653, -0.43702569603919983, 0.7640734314918518, 1.2287684679031372, 0.5469129681587219, -0.7079354524612427, 0.08105260878801346, -0.7474573254585266, 0.40620920062065125, -1.4184238910675049, 0.15848414599895477, -2.920257806777954, 0.7634247541427612, -0.28428030014038086, -0.18582291901111603, -0.12530405819416046, -1.3333667516708374, 1.052032470703125, 2.607323169708252, -1.1484040021896362, 0.44350388646125793, 0.45712438225746155, 1.1427987813949585, -1.6459931135177612, 0.3312406539916992, -0.4804363548755646, 2.022696018218994, 0.24414534866809845, 1.1354808807373047, -0.47514769434928894, -2.2031145095825195, 0.5717465877532959, -1.1594334840774536, -1.0251351594924927, 0.7997655272483826, -0.8604956269264221, 0.28103184700012207, -1.421938419342041, -0.18460068106651306, -0.8826291561126709, -1.2968908548355103, 0.6705799698829651, 0.11109267920255661, 0.40908917784690857, -0.5496201515197754, 0.3613676428794861, -2.2040374279022217, -1.3431404829025269, -0.19142957031726837, -0.9640162587165833, 0.5682830810546875, -0.45781657099723816, 0.6010457277297974, -0.05194389820098877, 0.09332085400819778, 0.31966227293014526, 1.4217644929885864, 3.4479212760925293, 0.14307980239391327, 0.145536407828331, -0.1112096756696701, -1.0469974279403687, 1.4226210117340088, 0.8544263243675232, -0.10770843178033829, -0.5667060613632202, -1.0707199573516846, 1.2955857515335083, 2.019082546234131, 1.137293815612793, 0.12684498727321625, -0.7559127807617188, -0.684068500995636, 0.013814774341881275, 0.13099125027656555, 0.47365835309028625, 0.9507197737693787, -0.057832472026348114, 0.06609645485877991, 1.3670992851257324, 1.243273377418518, -0.19214604794979095, 0.34199315309524536, -0.9385931491851807, -0.37926775217056274, 0.4426150619983673, 0.1771736890077591, 0.07394053041934967, 0.511930525302887, -1.0630860328674316, -0.3258633315563202, -0.33302587270736694, -0.8375119566917419, -0.7530977725982666, -0.468662291765213, -0.43747326731681824, 1.6074491739273071, 0.07079379260540009, -0.5260635018348694, 0.020654410123825073, -0.6423169374465942, -0.16818061470985413, -1.1519516706466675, 0.12214072048664093, -0.05185592547059059, -0.08588042855262756, -0.13777154684066772, 1.7011624574661255, -0.9278213381767273, -2.1536970138549805, 0.21414169669151306, 0.2639714479446411, -0.26551055908203125, 0.25735002756118774, 1.7409331798553467, 0.5266939401626587, 1.3590078353881836, 1.256569266319275, 0.9837665557861328, -0.621155858039856, -1.2314577102661133, 0.7515765428543091, 0.9193322062492371, -1.3041579723358154, 0.9037038087844849, -0.17698997259140015, -0.5160325765609741, 0.65127032995224, 1.1981654167175293, 0.3640420436859131, -1.993317723274231, 0.9041943550109863, -0.9320111274719238, 0.6856173276901245, 0.6928281784057617, 0.7453606724739075, 0.18128539621829987, 0.8849654197692871, -1.232480525970459, -1.2094054222106934, -0.6902853846549988, -0.6130391359329224, 1.87545645236969, -0.27217555046081543, 0.5506517291069031, -0.21262496709823608, -1.1743983030319214, -0.05950014665722847, 0.854413628578186, 0.34072253108024597, -0.5123538970947266, 0.8461682796478271, -0.6240532398223877, -0.8949415683746338, -1.2279906272888184, -0.3731451630592346, -1.1563800573349, -0.8465357422828674, 1.0855998992919922, 0.8056256175041199, 0.461477130651474, 1.9637647867202759, 0.6324039697647095, 0.3471621870994568, -2.662868022918701, 0.8439827561378479, 0.2616441249847412, -0.08606759458780289, 0.9031925201416016, 0.24855004251003265, 1.1314030885696411, -0.027189217507839203, 0.6294007897377014, -2.331881284713745, 2.269944429397583, -0.20697787404060364, 0.6674926280975342, 0.06648406386375427, -0.2079995721578598, 1.1507577896118164, 0.6247897744178772, 0.5472503900527954, -1.120568037033081, 0.6503299474716187, -0.4989947974681854, 1.0538852214813232, 0.9498584866523743, -0.8931148648262024, 0.10854382812976837, 1.4651808738708496, 0.4970802366733551, -0.48209816217422485, -0.9276779890060425, -0.7975512146949768, 1.0131654739379883, 1.7100918292999268, -0.02726827561855316, -0.03535357117652893, 0.8844542503356934, 0.6507212519645691, -1.2549699544906616, 0.0757182240486145, -0.7045211791992188, -0.5795788168907166, 1.7097612619400024, 2.0598864555358887, -0.10423267632722855, -0.15298743546009064, -0.7489596605300903, -1.3264358043670654, 0.7531586289405823, 0.020752552896738052, 0.09737298637628555, 0.7417480945587158, -0.6551311016082764, 1.078123927116394, 0.5903550982475281, 1.0743426084518433, 0.0781891718506813, 0.2836691439151764, 0.44210565090179443, -0.3934955298900604, -1.1489406824111938, -0.3583904206752777, -1.0704766511917114, -2.5863471031188965, 0.5000067353248596, -0.2634173035621643, -1.4817805290222168, -0.004692502785474062, -1.051969051361084, 0.9193409085273743, -0.5643702745437622, -1.0611097812652588, -1.422084927558899, 0.3445385694503784, -0.18202923238277435, 0.9511143565177917, -1.6953074932098389, -0.21998175978660583, 1.2971997261047363, 0.8126088976860046, -0.5580281615257263, 0.994777500629425, 0.2886415421962738, 0.9503325819969177, 0.7886026501655579, -0.3879257142543793, 0.6483649015426636, -0.04952511563897133, -1.3208189010620117, 0.3852006793022156, 1.2415070533752441, 0.14307871460914612, 1.402353286743164, -0.4824824929237366, 0.12753072381019592, 0.41635289788246155, -0.6784994006156921, -0.5131458044052124, -0.4148283302783966, 0.6499983072280884, 0.028452131897211075, -1.0258628129959106, -0.20096136629581451, -0.05384019389748573, -0.245744526386261, 0.1863211691379547, -1.3171154260635376, -0.22815687954425812, -0.3467898368835449, -0.42509207129478455, -1.3789421319961548, 0.03264158219099045, 1.280700445175171, -0.8196809887886047, -0.19595123827457428, 0.3998631536960602, 0.3372628092765808, 0.6006247997283936, 0.4817943572998047, -0.7871711850166321, -0.23045030236244202, -0.327252596616745, -0.3047664165496826, 0.2960169315338135, 1.3186887502670288, -0.11122588813304901, -1.0219470262527466, 0.6845235228538513, -0.30710741877555847, 0.19898952543735504, 2.0317859649658203, 0.03287825360894203, -0.6464587450027466, 0.34973329305648804, -0.7332068085670471, 1.703393578529358, 1.7943984270095825, 1.3544659614562988, -0.054277848452329636, -0.8052186369895935, 0.5085152387619019, -0.34000563621520996, -0.2969019114971161, 0.926983654499054, 0.3801562190055847, -0.23822961747646332, -1.4528944492340088, 0.5826756954193115, 1.2890769243240356, -0.7524842619895935, -0.720525324344635, 0.09096468240022659, -0.8953868746757507, 1.2667216062545776, 0.5193533301353455, 0.2730368971824646, 0.24509279429912567, 1.5213640928268433, 0.7389331459999084, -0.4698652923107147, 0.5778948068618774, 0.5568442344665527, -0.20572836697101593, -2.1144468784332275, -1.1067124605178833, 0.4054628014564514, -0.4469400644302368, -1.6390005350112915, 1.402577519416809, -1.125098705291748, -1.068037509918213, 0.5320329666137695, 0.1276903748512268, 1.3001145124435425, 0.3609740138053894, 1.697530746459961, 2.196502923965454, 0.8630480766296387, 0.41932234168052673, 1.189647912979126, -0.1337839961051941, -0.44597044587135315, 1.8169916868209839, -0.3908003568649292, 0.5262012481689453, 0.9337330460548401, -0.37274137139320374, -1.0503485202789307, -0.8750216960906982, -1.17110276222229, -0.6295521259307861, 1.2061878442764282, 0.057662174105644226, -1.0127556324005127, 0.16889917850494385, 1.6125621795654297, 0.06381320208311081, -0.2712530791759491, 0.7456188797950745, 0.3432299494743347, -0.7479451298713684, -0.0843762755393982, -0.9057112336158752, 0.4891291558742523, -0.09830673784017563, -0.2998710572719574, 0.25793275237083435, 0.5356984734535217, 1.3214439153671265, -0.08715959638357162, 0.12741559743881226, 1.1748356819152832, -1.3295358419418335, 1.5701196193695068, -0.6081964373588562, 0.23014797270298004, -2.4062647819519043, 1.4058862924575806, -0.7502681016921997, 1.9151004552841187, -2.562180757522583, 0.48792311549186707, -0.5374580025672913, -0.4652043879032135, 0.28836753964424133, -0.4125797748565674, 0.1411101520061493, -0.1636987179517746, -0.9609574675559998, 0.02842061221599579, -0.764417290687561, 0.6000393033027649, 1.1115134954452515, 1.4883702993392944, -1.1831163167953491, -0.29709482192993164, -1.7383321523666382, -0.1147812008857727, -0.7885301113128662, 0.2827950417995453, -1.980361819267273, -0.15029758214950562, -1.975823998451233, -2.371713161468506, -1.4439986944198608, -0.8539489507675171, 1.0064870119094849, 0.1854073852300644, -0.9051251411437988, 1.15800142288208, -0.3727509081363678, -1.9500855207443237, 1.2242259979248047, -2.188385009765625 ]
https://github.com/huggingface/datasets/issues/4399
LocalDatasetModuleFactoryWithoutScript extracts invalid builder name
@mariosasko here we go: https://github.com/huggingface/datasets/pull/4967 TBH I haven't tested it yet, but should work, since this is a basic change.
## Describe the bug Trying to load a local dataset raises an error indicating that the config builder has to have a name. No error should be reported, since the call is completly valid. ## Steps to reproduce the bug ```python load_dataset("./data/some-dataset/", name="some-name") ``` ## Expected results The dataset should be loaded. ## Actual results ``` Traceback (most recent call last): File "train_lquad.py", line 19, in <module> load(tokenize_target_function, tokenize_target_function, {}, tokenizer) File "train_lquad.py", line 14, in load dataset = load_dataset("./data/lquad/", name="lquad") File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1708, in load_dataset builder_instance = load_dataset_builder( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1560, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 269, in __init__ self.config, self.config_id = self._create_builder_config( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 403, in _create_builder_config raise ValueError(f"BuilderConfig must have a name, got {builder_config.name}") ValueError: BuilderConfig must have a name, got ``` ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-348.20.1.el8_5.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.6 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 The error is probably in line 795 in load.py: ``` builder_kwargs = { "hash": hash, "data_files": data_files, "name": os.path.basename(self.path), "base_path": self.path, **builder_kwargs, } ``` `os.path.basename` for a directory returns an empty string, rather than the name of the directory.
746
20
LocalDatasetModuleFactoryWithoutScript extracts invalid builder name ## Describe the bug Trying to load a local dataset raises an error indicating that the config builder has to have a name. No error should be reported, since the call is completly valid. ## Steps to reproduce the bug ```python load_dataset("./data/some-dataset/", name="some-name") ``` ## Expected results The dataset should be loaded. ## Actual results ``` Traceback (most recent call last): File "train_lquad.py", line 19, in <module> load(tokenize_target_function, tokenize_target_function, {}, tokenizer) File "train_lquad.py", line 14, in load dataset = load_dataset("./data/lquad/", name="lquad") File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1708, in load_dataset builder_instance = load_dataset_builder( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/load.py", line 1560, in load_dataset_builder builder_instance: DatasetBuilder = builder_cls( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 269, in __init__ self.config, self.config_id = self._create_builder_config( File "/net/pr2/scratch/people/plgapohl/python-3.8.6/lib/python3.8/site-packages/datasets/builder.py", line 403, in _create_builder_config raise ValueError(f"BuilderConfig must have a name, got {builder_config.name}") ValueError: BuilderConfig must have a name, got ``` ## Environment info - `datasets` version: 2.2.2 - Platform: Linux-4.18.0-348.20.1.el8_5.x86_64-x86_64-with-glibc2.2.5 - Python version: 3.8.6 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 The error is probably in line 795 in load.py: ``` builder_kwargs = { "hash": hash, "data_files": data_files, "name": os.path.basename(self.path), "base_path": self.path, **builder_kwargs, } ``` `os.path.basename` for a directory returns an empty string, rather than the name of the directory. @mariosasko here we go: https://github.com/huggingface/datasets/pull/4967 TBH I haven't tested it yet, but should work, since this is a basic change.
[ -1.2028781175613403, -0.8265863060951233, -0.6873316764831543, 1.4000132083892822, -0.1345987319946289, -1.1803244352340698, 0.1908228099346161, -1.0973252058029175, 1.5438079833984375, -0.7364124655723572, 0.1868392527103424, -1.6111446619033813, -0.06320741027593613, -0.5651378631591797, -0.6759361624717712, -0.9025902152061462, -0.39164555072784424, -0.7902257442474365, 1.0296825170516968, 2.487766981124878, 1.2549939155578613, -1.3041956424713135, 2.7914435863494873, 0.6390030980110168, -0.21419689059257507, -0.9676055312156677, 0.6308166980743408, 0.04305354878306389, -1.240092158317566, -0.4653174579143524, -0.9154608249664307, -0.04669426754117012, -0.5761438608169556, -0.3823773264884949, 0.0441695973277092, 0.44772765040397644, -0.33042189478874207, -0.25750645995140076, -0.6929980516433716, -0.7901734113693237, 0.519203245639801, -0.38001549243927, 0.9770554304122925, -0.3547755479812622, 1.7602859735488892, -0.5813354849815369, 0.46075183153152466, 0.6933238506317139, 1.219090461730957, 0.2284962683916092, 0.15412180125713348, 0.30749356746673584, 0.41688841581344604, 0.07946371287107468, 0.6392685174942017, 1.1690642833709717, 0.56711745262146, 0.5002123117446899, 0.5998960733413696, -2.18310284614563, 1.3155099153518677, -0.8196660280227661, 0.18917334079742432, 1.3260844945907593, -0.8514448404312134, 0.34123775362968445, -1.7922937870025635, -0.07200309634208679, 0.6125773191452026, -2.2843592166900635, 0.2655792534351349, -1.3409067392349243, -0.6193897724151611, 0.8658521175384521, 0.40839827060699463, -1.1475615501403809, 0.18318761885166168, -0.5013024210929871, 1.0843385457992554, 0.43179258704185486, 1.1540244817733765, -1.6489945650100708, -0.07947719842195511, -0.1415427029132843, 0.09436936676502228, -1.248711109161377, -1.6420382261276245, 0.5737923979759216, 0.6028723120689392, 0.6197402477264404, -0.15156246721744537, 1.0008338689804077, -1.1128716468811035, 0.8013877868652344, -1.0362553596496582, -1.658380389213562, -1.4075748920440674, -2.4183578491210938, -2.373138427734375, 0.8610283732414246, -0.5647507309913635, -0.5082853436470032, 1.9643632173538208, -0.9632652997970581, -1.7170910835266113, 0.9745275974273682, 0.2981402575969696, 0.07678195834159851, 2.3544628620147705, 0.18574480712413788, -0.6598615646362305, 0.3942524790763855, -0.7522504925727844, 0.8040303587913513, -0.3321676254272461, 1.3141218423843384, 0.5241565704345703, -0.964839518070221, 1.5664056539535522, -0.4750521779060364, 0.6203843951225281, -0.6383661031723022, -0.4721118211746216, -0.7643309831619263, 0.21416111290454865, 1.9308760166168213, -0.347348690032959, 1.6273115873336792, -0.2584211230278015, -1.6093932390213013, -1.5964275598526, 0.8542545437812805, 0.4808853268623352, -0.8197492361068726, 0.058861441910266876, -0.48806682229042053, 0.2549930512905121, -0.026780106127262115, 1.1542937755584717, 1.2597531080245972, 0.7611219882965088, -0.3262040317058563, -0.8173245191574097, 0.16970105469226837, -0.2162102907896042, -0.7435429692268372, -1.7555186748504639, -0.2893736958503723, 0.18061405420303345, 0.5858840346336365, -1.252764344215393, 1.8374888896942139, 0.8672817945480347, 1.9203875064849854, 0.9766493439674377, -0.3664045035839081, 1.5537115335464478, -0.000029334798455238342, 1.8367866277694702, -0.5669357776641846, 0.5320956110954285, -0.4080727994441986, -1.1264381408691406, 0.8236958980560303, -0.3220381438732147, -1.9900208711624146, -0.8313091993331909, -0.7623572945594788, -0.16829520463943481, -0.7102705240249634, 0.8465367555618286, -0.3057140111923218, -1.4902857542037964, 0.10090137273073196, -0.7024317383766174, 0.1323128342628479, -1.2727344036102295, 0.24316416680812836, 0.7341380715370178, -0.680880606174469, -0.050884149968624115, -0.24313318729400635, -1.2025583982467651, -0.49302008748054504, 0.28886064887046814, 2.02348256111145, -0.5933732986450195, 0.9136450886726379, 1.0164076089859009, -0.7861262559890747, 0.0832977443933487, 0.22578398883342743, -0.29666244983673096, 0.7217889428138733, -1.1328668594360352, -0.4676826000213623, 1.1933749914169312, -0.19482851028442383, -0.6421909928321838, 1.44327712059021, 0.8442043662071228, -1.107750654220581, -0.2949770390987396, -0.18378177285194397, -0.8530451655387878, -0.016082607209682465, -1.502540111541748, -0.16266751289367676, 0.31034016609191895, -1.50314462184906, -0.4098217487335205, -0.17882363498210907, 1.2665387392044067, -0.23334935307502747, 1.4878164529800415, -0.3125954866409302, -0.20861373841762543, -0.26530787348747253, -0.5269898176193237, 0.12669481337070465, -0.1556241661310196, -0.5637996196746826, 0.18089736998081207, -0.794235348701477, 0.2441561073064804, 1.5033038854599, 0.2882803976535797, 0.07705441862344742, 0.4578641355037689, 1.053911805152893, 0.4148836135864258, -0.08626816421747208, -0.8482734560966492, -1.4954156875610352, 1.9366226196289062, -1.3796696662902832, 1.906697392463684, 0.7568116784095764, -0.06589122116565704, -1.7982468605041504, -1.8641971349716187, 1.2287230491638184, 1.1297982931137085, 2.4116218090057373, 0.4616731107234955, 0.4147651195526123, -0.7569975256919861, -0.8210340738296509, 0.3808630108833313, -0.9429711103439331, -0.6251653432846069, 0.163836270570755, 2.3733489513397217, 1.8370559215545654, -0.5798714756965637, -0.2949051856994629, -0.9445824027061462, 1.31382417678833, -0.17936402559280396, 0.2683071494102478, 2.0396206378936768, -0.3053693175315857, -1.0355883836746216, 1.265379548072815, -2.363186836242676, 0.27017655968666077, 2.0270700454711914, 0.2955285310745239, 0.14434373378753662, -1.4257296323776245, -0.6846207976341248, -0.3183918297290802, -0.472160667181015, -1.2488155364990234, 0.4977308213710785, -0.2098982036113739, -0.8696646690368652, -1.435667872428894, 0.06854970753192902, -1.2074642181396484, -1.7883206605911255, 0.2953086793422699, 1.9471557140350342, 2.0685977935791016, -0.8502804040908813, 1.3972492218017578, -0.2880425453186035, 0.03220352903008461, 1.321642518043518, 1.351190209388733, 3.0814969539642334, 1.9023139476776123, -1.3132911920547485, 0.7764808535575867, -0.2909530997276306, -0.46118712425231934, 1.1741716861724854, -1.1558667421340942, 1.1161669492721558, -0.2060176581144333, -1.2360035181045532, -1.244027853012085, 1.0490411520004272, 0.49160733819007874, 0.000005258247256278992, -0.4531483054161072, 1.2546991109848022, 0.12425035238265991, 1.3933707475662231, 0.6720216274261475, -0.42866209149360657, 0.6028761863708496, -0.35670167207717896, -0.542587399482727, 1.7138054370880127, 0.23008465766906738, -1.4841198921203613, -2.37800669670105, -0.3326514959335327, -1.0534008741378784, -0.059944067150354385, -0.5765217542648315, -1.0410763025283813, 1.6625856161117554, 0.3717992603778839, -1.24184250831604, -0.2794544994831085, -0.28901082277297974, -0.5134517550468445, 2.6916956901550293, -1.271517038345337, -0.09025175869464874, -0.9216997623443604, -0.5714266300201416, 1.6118438243865967, -1.2227028608322144, -0.22063812613487244, -1.0654189586639404, -0.6055530905723572, -1.2856980562210083, -0.38002684712409973, -0.003233670722693205, -0.9465264678001404, 0.8081836700439453, 0.19924496114253998, -1.1118050813674927, -0.3469584882259369, -0.8683404326438904, 1.0651437044143677, -0.07289112359285355, 0.14242476224899292, 1.8101989030838013, 0.3179028630256653, -0.43702569603919983, 0.7640734314918518, 1.2287684679031372, 0.5469129681587219, -0.7079354524612427, 0.08105260878801346, -0.7474573254585266, 0.40620920062065125, -1.4184238910675049, 0.15848414599895477, -2.920257806777954, 0.7634247541427612, -0.28428030014038086, -0.18582291901111603, -0.12530405819416046, -1.3333667516708374, 1.052032470703125, 2.607323169708252, -1.1484040021896362, 0.44350388646125793, 0.45712438225746155, 1.1427987813949585, -1.6459931135177612, 0.3312406539916992, -0.4804363548755646, 2.022696018218994, 0.24414534866809845, 1.1354808807373047, -0.47514769434928894, -2.2031145095825195, 0.5717465877532959, -1.1594334840774536, -1.0251351594924927, 0.7997655272483826, -0.8604956269264221, 0.28103184700012207, -1.421938419342041, -0.18460068106651306, -0.8826291561126709, -1.2968908548355103, 0.6705799698829651, 0.11109267920255661, 0.40908917784690857, -0.5496201515197754, 0.3613676428794861, -2.2040374279022217, -1.3431404829025269, -0.19142957031726837, -0.9640162587165833, 0.5682830810546875, -0.45781657099723816, 0.6010457277297974, -0.05194389820098877, 0.09332085400819778, 0.31966227293014526, 1.4217644929885864, 3.4479212760925293, 0.14307980239391327, 0.145536407828331, -0.1112096756696701, -1.0469974279403687, 1.4226210117340088, 0.8544263243675232, -0.10770843178033829, -0.5667060613632202, -1.0707199573516846, 1.2955857515335083, 2.019082546234131, 1.137293815612793, 0.12684498727321625, -0.7559127807617188, -0.684068500995636, 0.013814774341881275, 0.13099125027656555, 0.47365835309028625, 0.9507197737693787, -0.057832472026348114, 0.06609645485877991, 1.3670992851257324, 1.243273377418518, -0.19214604794979095, 0.34199315309524536, -0.9385931491851807, -0.37926775217056274, 0.4426150619983673, 0.1771736890077591, 0.07394053041934967, 0.511930525302887, -1.0630860328674316, -0.3258633315563202, -0.33302587270736694, -0.8375119566917419, -0.7530977725982666, -0.468662291765213, -0.43747326731681824, 1.6074491739273071, 0.07079379260540009, -0.5260635018348694, 0.020654410123825073, -0.6423169374465942, -0.16818061470985413, -1.1519516706466675, 0.12214072048664093, -0.05185592547059059, -0.08588042855262756, -0.13777154684066772, 1.7011624574661255, -0.9278213381767273, -2.1536970138549805, 0.21414169669151306, 0.2639714479446411, -0.26551055908203125, 0.25735002756118774, 1.7409331798553467, 0.5266939401626587, 1.3590078353881836, 1.256569266319275, 0.9837665557861328, -0.621155858039856, -1.2314577102661133, 0.7515765428543091, 0.9193322062492371, -1.3041579723358154, 0.9037038087844849, -0.17698997259140015, -0.5160325765609741, 0.65127032995224, 1.1981654167175293, 0.3640420436859131, -1.993317723274231, 0.9041943550109863, -0.9320111274719238, 0.6856173276901245, 0.6928281784057617, 0.7453606724739075, 0.18128539621829987, 0.8849654197692871, -1.232480525970459, -1.2094054222106934, -0.6902853846549988, -0.6130391359329224, 1.87545645236969, -0.27217555046081543, 0.5506517291069031, -0.21262496709823608, -1.1743983030319214, -0.05950014665722847, 0.854413628578186, 0.34072253108024597, -0.5123538970947266, 0.8461682796478271, -0.6240532398223877, -0.8949415683746338, -1.2279906272888184, -0.3731451630592346, -1.1563800573349, -0.8465357422828674, 1.0855998992919922, 0.8056256175041199, 0.461477130651474, 1.9637647867202759, 0.6324039697647095, 0.3471621870994568, -2.662868022918701, 0.8439827561378479, 0.2616441249847412, -0.08606759458780289, 0.9031925201416016, 0.24855004251003265, 1.1314030885696411, -0.027189217507839203, 0.6294007897377014, -2.331881284713745, 2.269944429397583, -0.20697787404060364, 0.6674926280975342, 0.06648406386375427, -0.2079995721578598, 1.1507577896118164, 0.6247897744178772, 0.5472503900527954, -1.120568037033081, 0.6503299474716187, -0.4989947974681854, 1.0538852214813232, 0.9498584866523743, -0.8931148648262024, 0.10854382812976837, 1.4651808738708496, 0.4970802366733551, -0.48209816217422485, -0.9276779890060425, -0.7975512146949768, 1.0131654739379883, 1.7100918292999268, -0.02726827561855316, -0.03535357117652893, 0.8844542503356934, 0.6507212519645691, -1.2549699544906616, 0.0757182240486145, -0.7045211791992188, -0.5795788168907166, 1.7097612619400024, 2.0598864555358887, -0.10423267632722855, -0.15298743546009064, -0.7489596605300903, -1.3264358043670654, 0.7531586289405823, 0.020752552896738052, 0.09737298637628555, 0.7417480945587158, -0.6551311016082764, 1.078123927116394, 0.5903550982475281, 1.0743426084518433, 0.0781891718506813, 0.2836691439151764, 0.44210565090179443, -0.3934955298900604, -1.1489406824111938, -0.3583904206752777, -1.0704766511917114, -2.5863471031188965, 0.5000067353248596, -0.2634173035621643, -1.4817805290222168, -0.004692502785474062, -1.051969051361084, 0.9193409085273743, -0.5643702745437622, -1.0611097812652588, -1.422084927558899, 0.3445385694503784, -0.18202923238277435, 0.9511143565177917, -1.6953074932098389, -0.21998175978660583, 1.2971997261047363, 0.8126088976860046, -0.5580281615257263, 0.994777500629425, 0.2886415421962738, 0.9503325819969177, 0.7886026501655579, -0.3879257142543793, 0.6483649015426636, -0.04952511563897133, -1.3208189010620117, 0.3852006793022156, 1.2415070533752441, 0.14307871460914612, 1.402353286743164, -0.4824824929237366, 0.12753072381019592, 0.41635289788246155, -0.6784994006156921, -0.5131458044052124, -0.4148283302783966, 0.6499983072280884, 0.028452131897211075, -1.0258628129959106, -0.20096136629581451, -0.05384019389748573, -0.245744526386261, 0.1863211691379547, -1.3171154260635376, -0.22815687954425812, -0.3467898368835449, -0.42509207129478455, -1.3789421319961548, 0.03264158219099045, 1.280700445175171, -0.8196809887886047, -0.19595123827457428, 0.3998631536960602, 0.3372628092765808, 0.6006247997283936, 0.4817943572998047, -0.7871711850166321, -0.23045030236244202, -0.327252596616745, -0.3047664165496826, 0.2960169315338135, 1.3186887502670288, -0.11122588813304901, -1.0219470262527466, 0.6845235228538513, -0.30710741877555847, 0.19898952543735504, 2.0317859649658203, 0.03287825360894203, -0.6464587450027466, 0.34973329305648804, -0.7332068085670471, 1.703393578529358, 1.7943984270095825, 1.3544659614562988, -0.054277848452329636, -0.8052186369895935, 0.5085152387619019, -0.34000563621520996, -0.2969019114971161, 0.926983654499054, 0.3801562190055847, -0.23822961747646332, -1.4528944492340088, 0.5826756954193115, 1.2890769243240356, -0.7524842619895935, -0.720525324344635, 0.09096468240022659, -0.8953868746757507, 1.2667216062545776, 0.5193533301353455, 0.2730368971824646, 0.24509279429912567, 1.5213640928268433, 0.7389331459999084, -0.4698652923107147, 0.5778948068618774, 0.5568442344665527, -0.20572836697101593, -2.1144468784332275, -1.1067124605178833, 0.4054628014564514, -0.4469400644302368, -1.6390005350112915, 1.402577519416809, -1.125098705291748, -1.068037509918213, 0.5320329666137695, 0.1276903748512268, 1.3001145124435425, 0.3609740138053894, 1.697530746459961, 2.196502923965454, 0.8630480766296387, 0.41932234168052673, 1.189647912979126, -0.1337839961051941, -0.44597044587135315, 1.8169916868209839, -0.3908003568649292, 0.5262012481689453, 0.9337330460548401, -0.37274137139320374, -1.0503485202789307, -0.8750216960906982, -1.17110276222229, -0.6295521259307861, 1.2061878442764282, 0.057662174105644226, -1.0127556324005127, 0.16889917850494385, 1.6125621795654297, 0.06381320208311081, -0.2712530791759491, 0.7456188797950745, 0.3432299494743347, -0.7479451298713684, -0.0843762755393982, -0.9057112336158752, 0.4891291558742523, -0.09830673784017563, -0.2998710572719574, 0.25793275237083435, 0.5356984734535217, 1.3214439153671265, -0.08715959638357162, 0.12741559743881226, 1.1748356819152832, -1.3295358419418335, 1.5701196193695068, -0.6081964373588562, 0.23014797270298004, -2.4062647819519043, 1.4058862924575806, -0.7502681016921997, 1.9151004552841187, -2.562180757522583, 0.48792311549186707, -0.5374580025672913, -0.4652043879032135, 0.28836753964424133, -0.4125797748565674, 0.1411101520061493, -0.1636987179517746, -0.9609574675559998, 0.02842061221599579, -0.764417290687561, 0.6000393033027649, 1.1115134954452515, 1.4883702993392944, -1.1831163167953491, -0.29709482192993164, -1.7383321523666382, -0.1147812008857727, -0.7885301113128662, 0.2827950417995453, -1.980361819267273, -0.15029758214950562, -1.975823998451233, -2.371713161468506, -1.4439986944198608, -0.8539489507675171, 1.0064870119094849, 0.1854073852300644, -0.9051251411437988, 1.15800142288208, -0.3727509081363678, -1.9500855207443237, 1.2242259979248047, -2.188385009765625 ]
https://github.com/huggingface/datasets/issues/4398
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError`
It works if we either remove the `ds = ds.cast_column("id", Value("int32"))` line from the code above, or if instead calling `ds.remove_columns()` we remove the columns inside each mapping as `ds.map(..., remove_columns=[...])` instead of right after the mapping. Both of those solutions seem to fix the issue, so the root cause of it may be around that. Sorry I cannot provide you more insights, in case I get to fix it I'll submit a PR, in the meanwhile the code that I'm using as a workaround is the following: ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}, remove_columns=["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings, remove_columns=["inputs"]) ds.add_faiss_index(column="embeddings") ```
First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
747
138
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError` First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 It works if we either remove the `ds = ds.cast_column("id", Value("int32"))` line from the code above, or if instead calling `ds.remove_columns()` we remove the columns inside each mapping as `ds.map(..., remove_columns=[...])` instead of right after the mapping. Both of those solutions seem to fix the issue, so the root cause of it may be around that. Sorry I cannot provide you more insights, in case I get to fix it I'll submit a PR, in the meanwhile the code that I'm using as a workaround is the following: ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}, remove_columns=["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings, remove_columns=["inputs"]) ds.add_faiss_index(column="embeddings") ```
[ -1.1680415868759155, -0.8792570233345032, -0.8097088932991028, 1.465408205986023, -0.15524856746196747, -1.2498430013656616, 0.1826292723417282, -1.1586580276489258, 1.6909860372543335, -0.8691601157188416, 0.2797885835170746, -1.6516071557998657, 0.03781716525554657, -0.6238412261009216, -0.8026608824729919, -0.8771143555641174, -0.3825027048587799, -0.8625911474227905, 1.034237027168274, 2.510958433151245, 1.2297676801681519, -1.4212727546691895, 2.6668362617492676, 0.7876724600791931, -0.17925642430782318, -0.9701997637748718, 0.4774878919124603, -0.07300978899002075, -1.2995439767837524, -0.5320278406143188, -0.9236558675765991, -0.12917213141918182, -0.5998908877372742, -0.5602222084999084, -0.04478435218334198, 0.466178297996521, -0.3770187795162201, -0.48500415682792664, -0.516956090927124, -0.8935118317604065, 0.45489701628685, -0.3697527050971985, 1.0426751375198364, -0.32341957092285156, 1.8454396724700928, -0.5696669220924377, 0.4553123414516449, 0.7811222672462463, 1.3767530918121338, 0.25135886669158936, -0.027051962912082672, 0.24496082961559296, 0.36643290519714355, -0.09742869436740875, 0.47817742824554443, 1.1723848581314087, 0.6429916620254517, 0.5264539122581482, 0.7811227440834045, -2.209073543548584, 1.3283634185791016, -1.1212055683135986, 0.3125741481781006, 1.3398394584655762, -0.9232620000839233, 0.35530713200569153, -1.8409221172332764, -0.04794999212026596, 0.5048015713691711, -2.2408719062805176, 0.35270172357559204, -1.198723554611206, -0.52448570728302, 0.9469982385635376, 0.3383132219314575, -1.2351021766662598, 0.18378213047981262, -0.3814961016178131, 1.0120329856872559, 0.4282723665237427, 1.1133376359939575, -1.7296258211135864, -0.08745169639587402, -0.35716739296913147, 0.1378941386938095, -1.313019871711731, -1.523179292678833, 0.5518457293510437, 0.605636477470398, 0.5437207221984863, -0.14262937009334564, 1.1073637008666992, -1.0163201093673706, 0.807964026927948, -1.0202809572219849, -1.6888097524642944, -1.371545672416687, -2.1876797676086426, -2.260007858276367, 0.7285367250442505, -0.4628232717514038, -0.6006867289543152, 2.0737533569335938, -0.9651172161102295, -1.7083855867385864, 1.1596425771713257, 0.3214844763278961, -0.049029476940631866, 2.373769998550415, 0.1998046189546585, -0.6787766814231873, 0.4914361834526062, -0.7173924446105957, 0.8635140657424927, -0.54616379737854, 1.2961357831954956, 0.42214787006378174, -1.0902739763259888, 1.636196494102478, -0.3827129006385803, 0.6007490754127502, -0.7484650611877441, -0.4906313121318817, -0.7699405550956726, 0.38099703192710876, 1.8214212656021118, -0.2501315474510193, 1.4670969247817993, -0.3086020350456238, -1.5095305442810059, -1.6291877031326294, 0.970526933670044, 0.39554405212402344, -0.8124139904975891, 0.13465383648872375, -0.3684885799884796, 0.15782976150512695, -0.06190738081932068, 1.1416634321212769, 1.3450223207473755, 0.6930725574493408, -0.31915634870529175, -0.8570430278778076, 0.1586916446685791, -0.11783146858215332, -0.7938780188560486, -1.737525224685669, -0.3663841784000397, 0.12344426661729813, 0.5687447786331177, -1.2004339694976807, 1.8080369234085083, 0.8934147357940674, 1.946062684059143, 1.0478010177612305, -0.4123257100582123, 1.525565266609192, 0.12206114083528519, 1.8598628044128418, -0.4971785247325897, 0.6090929508209229, -0.4086287319660187, -1.1167151927947998, 0.9096271991729736, -0.33183297514915466, -2.040530204772949, -0.7055506706237793, -0.8121816515922546, -0.2843977212905884, -0.7247068285942078, 0.9625840187072754, -0.26181551814079285, -1.3946791887283325, 0.2536548972129822, -0.6740797758102417, 0.11080939322710037, -1.1985111236572266, 0.3764100968837738, 0.6900507211685181, -0.6033669710159302, 0.13223715126514435, -0.2420053333044052, -1.297228455543518, -0.5465628504753113, 0.2990711033344269, 1.8425251245498657, -0.7584207653999329, 0.8756577372550964, 1.054397702217102, -0.7330629825592041, -0.06704682111740112, 0.4008169174194336, -0.3619212508201599, 0.8372296690940857, -1.0821728706359863, -0.46613234281539917, 1.1323659420013428, -0.1926802396774292, -0.5251952409744263, 1.4324326515197754, 0.6824206709861755, -0.9701932072639465, -0.1354103684425354, -0.1098766177892685, -0.8400424718856812, 0.04628463089466095, -1.5634065866470337, -0.09717445820569992, 0.4031449556350708, -1.5419977903366089, -0.4852791726589203, -0.19569402933120728, 1.269660234451294, -0.2365425080060959, 1.4003463983535767, -0.38938236236572266, -0.15641845762729645, -0.33750608563423157, -0.38271504640579224, 0.10592702776193619, -0.2987098693847656, -0.6419743895530701, 0.15461096167564392, -0.650060772895813, 0.34933868050575256, 1.4717671871185303, 0.3432256281375885, -0.01041816733777523, 0.48018595576286316, 1.1696809530258179, 0.3498380780220032, 0.06162500008940697, -0.8271781206130981, -1.4342880249023438, 1.967140793800354, -1.5208553075790405, 1.9846534729003906, 0.8125905394554138, 0.014226523227989674, -1.75990629196167, -1.8943425416946411, 1.3652149438858032, 1.1495174169540405, 2.3588783740997314, 0.5939561724662781, 0.3696332275867462, -0.8156327605247498, -0.6200785636901855, 0.34943798184394836, -1.0360592603683472, -0.6973024606704712, 0.1267443299293518, 2.383938789367676, 1.7843323945999146, -0.4724126160144806, -0.22055263817310333, -1.011116862297058, 1.4561766386032104, -0.20443189144134521, 0.17726941406726837, 1.9919939041137695, -0.25277799367904663, -1.1098535060882568, 1.3102166652679443, -2.342790365219116, 0.18367987871170044, 2.032109498977661, 0.2713609039783478, 0.036728985607624054, -1.3414160013198853, -0.6405389308929443, -0.2103070616722107, -0.441605806350708, -1.165809988975525, 0.5006266832351685, -0.2765757143497467, -0.7000290751457214, -1.4520810842514038, 0.20830455422401428, -1.1180933713912964, -1.5959211587905884, 0.1951194703578949, 1.9030718803405762, 2.035160541534424, -0.7117879986763, 1.6127502918243408, -0.2578783631324768, 0.13707304000854492, 1.23307466506958, 1.2427740097045898, 3.1608293056488037, 1.8032374382019043, -1.2426961660385132, 0.5691202878952026, -0.2048296332359314, -0.5244908332824707, 1.135461688041687, -1.1732958555221558, 1.270234227180481, -0.08091412484645844, -1.1308438777923584, -1.2392287254333496, 0.8405537009239197, 0.41682884097099304, 0.13248594105243683, -0.4547938406467438, 1.1288689374923706, 0.1385032832622528, 1.2603048086166382, 0.5895243883132935, -0.2881980538368225, 0.5940454006195068, -0.41621363162994385, -0.55840665102005, 1.5480499267578125, 0.2800021171569824, -1.350250482559204, -2.22389817237854, -0.17693524062633514, -0.8150582909584045, 0.09197772294282913, -0.629514217376709, -1.0052404403686523, 1.7186381816864014, 0.3337585926055908, -1.2628121376037598, -0.2511681616306305, -0.38921913504600525, -0.637475848197937, 2.6829724311828613, -1.4271901845932007, -0.296942800283432, -0.9670082926750183, -0.6780769228935242, 1.6070092916488647, -1.2400926351547241, -0.2247592657804489, -0.9942878484725952, -0.4653331935405731, -1.2213689088821411, -0.5159617066383362, 0.032077401876449585, -0.8989997506141663, 0.8658077120780945, 0.3355327844619751, -1.2207776308059692, -0.29462000727653503, -0.8893851637840271, 0.8507475852966309, -0.14106114208698273, 0.2760968804359436, 1.8901376724243164, 0.4686763286590576, -0.43045830726623535, 0.7563672065734863, 1.164868712425232, 0.5920529961585999, -0.5442731380462646, 0.23707309365272522, -0.6762545704841614, 0.3289312422275543, -1.2619489431381226, 0.3273608088493347, -2.787400960922241, 0.5744395852088928, -0.036705829203128815, -0.11176503449678421, 0.005829406902194023, -1.386998176574707, 1.060998797416687, 2.5976641178131104, -1.1136412620544434, 0.47802743315696716, 0.2591785490512848, 1.2807234525680542, -1.626601219177246, 0.30054163932800293, -0.3828358054161072, 2.163886547088623, 0.1360241174697876, 1.121169090270996, -0.47346219420433044, -2.4419140815734863, 0.5054558515548706, -1.2709603309631348, -1.177917242050171, 0.7676634192466736, -0.8251368403434753, -0.022785646840929985, -1.4696415662765503, -0.2997506558895111, -0.8437348008155823, -1.184103012084961, 0.8247942924499512, 0.12242545932531357, 0.5033076405525208, -0.6201412677764893, 0.3113437294960022, -2.170116901397705, -1.4071333408355713, -0.26763978600502014, -0.8663448095321655, 0.4587896466255188, -0.361983060836792, 0.7342556715011597, -0.2515232264995575, 0.002570381388068199, 0.33079418540000916, 1.5682148933410645, 3.3387973308563232, 0.17424719035625458, 0.49084895849227905, -0.2892526388168335, -0.9618585705757141, 1.375130534172058, 0.8832011222839355, -0.06830121576786041, -0.6178821921348572, -1.0387412309646606, 1.2305572032928467, 1.953771948814392, 0.9180346131324768, -0.009746242314577103, -0.801651656627655, -0.6954050064086914, -0.09625629335641861, 0.18439139425754547, 0.45281144976615906, 0.9564453363418579, 0.10549909621477127, 0.0495910607278347, 1.4401417970657349, 1.2308427095413208, -0.503711462020874, 0.3667483627796173, -0.7546318769454956, -0.4420247972011566, 0.5350328087806702, 0.31572189927101135, -0.02288549393415451, 0.26334649324417114, -0.9537588357925415, -0.23352345824241638, -0.39831462502479553, -0.9387916922569275, -0.7127278447151184, -0.4652897119522095, -0.31804293394088745, 1.744202733039856, 0.16446341574192047, -0.5160936713218689, -0.05150487646460533, -0.7451398968696594, -0.06760483980178833, -1.1306285858154297, 0.25744733214378357, -0.11394936591386795, -0.17413018643856049, -0.05862133949995041, 1.7518236637115479, -0.920832633972168, -2.0311601161956787, 0.22036412358283997, 0.23060829937458038, -0.27487701177597046, 0.2208481729030609, 1.6327872276306152, 0.4951780438423157, 1.4435229301452637, 1.3805352449417114, 0.9474362134933472, -0.7321403622627258, -1.3935920000076294, 0.6594321727752686, 0.9550392031669617, -1.4116336107254028, 0.8461499214172363, 0.12322341650724411, -0.5055344104766846, 0.6225921511650085, 1.2791552543640137, 0.45712825655937195, -2.039384126663208, 0.8055149912834167, -1.0015703439712524, 0.8240098357200623, 0.65049147605896, 0.6547776460647583, 0.26920267939567566, 0.8191081285476685, -1.2449290752410889, -1.205759882926941, -0.7308353185653687, -0.7222681641578674, 1.9532647132873535, -0.2720341086387634, 0.620190441608429, -0.1133626401424408, -1.397499680519104, -0.099701426923275, 0.7032314538955688, 0.4012787342071533, -0.47808992862701416, 0.6907929182052612, -0.7461346983909607, -1.1192044019699097, -1.4219807386398315, -0.44819217920303345, -1.089920163154602, -0.901862382888794, 1.0526612997055054, 0.8554933071136475, 0.22292128205299377, 1.921772837638855, 0.7377045154571533, 0.26923835277557373, -2.565445899963379, 0.8414035439491272, 0.33080288767814636, -0.10386015474796295, 0.9031606912612915, 0.39967283606529236, 0.993261456489563, 0.027644388377666473, 0.5643225908279419, -2.4576456546783447, 2.3308491706848145, -0.2701195180416107, 0.720819354057312, -0.06903334707021713, -0.19796909391880035, 1.1321730613708496, 0.544460117816925, 0.47599563002586365, -1.0956432819366455, 0.6362325549125671, -0.61600661277771, 1.2186075448989868, 0.8820934891700745, -0.7951794266700745, 0.01188924815505743, 1.3034369945526123, 0.4714599847793579, -0.5518304109573364, -0.9081243276596069, -0.9759837985038757, 0.8972361087799072, 1.7383993864059448, -0.07041832059621811, 0.060486387461423874, 0.8798012137413025, 0.6746273040771484, -1.297579050064087, 0.1260533332824707, -0.7343600988388062, -0.8548518419265747, 1.6140128374099731, 2.0488970279693604, -0.22056260704994202, -0.17907091975212097, -0.7570090889930725, -1.2362866401672363, 0.8417743444442749, 0.025199823081493378, 0.10477354377508163, 0.478180855512619, -0.6617477536201477, 1.1214476823806763, 0.8882070779800415, 0.9556684494018555, 0.30688831210136414, 0.32180944085121155, 0.4402003288269043, -0.3756619393825531, -1.072201132774353, -0.16233617067337036, -1.067987322807312, -2.574246883392334, 0.5008992552757263, -0.18009597063064575, -1.4800657033920288, -0.011760780587792397, -0.96916663646698, 0.8861672282218933, -0.5579960942268372, -1.1586889028549194, -1.519717812538147, 0.20243269205093384, -0.06526263803243637, 0.9209072589874268, -1.6015547513961792, -0.13675203919410706, 1.1721869707107544, 0.9131801128387451, -0.7094452381134033, 0.960913896560669, 0.18138009309768677, 1.0506372451782227, 0.9099593162536621, -0.45257750153541565, 0.4286254942417145, 0.039095763117074966, -1.328344464302063, 0.4048194885253906, 1.177528738975525, 0.13512572646141052, 1.4018182754516602, -0.5422231554985046, 0.0028934134170413017, 0.36364227533340454, -0.46261465549468994, -0.4749325215816498, -0.5986391305923462, 0.6575047969818115, 0.005955809727311134, -0.8702903985977173, 0.04343155771493912, -0.004799989052116871, -0.27419957518577576, 0.1850019097328186, -1.47151780128479, -0.16812196373939514, -0.39516404271125793, -0.5788058042526245, -1.2749165296554565, -0.05171169713139534, 1.3598263263702393, -0.6360642313957214, -0.18864086270332336, 0.4925296902656555, 0.40583789348602295, 0.5127311944961548, 0.541376531124115, -0.666473388671875, -0.3926284611225128, -0.21681101620197296, -0.4097138047218323, 0.306802898645401, 1.3767672777175903, -0.12556956708431244, -0.8824862837791443, 0.7281273007392883, -0.36204755306243896, 0.035545870661735535, 1.9099732637405396, 0.08963288366794586, -0.8088982701301575, 0.29121947288513184, -0.6403401494026184, 1.9787604808807373, 1.802319049835205, 1.3456034660339355, -0.09427537024021149, -1.0193229913711548, 0.678299605846405, -0.3840791881084442, -0.31174179911613464, 0.8914532661437988, 0.33305734395980835, -0.2639237344264984, -1.4404376745224, 0.6781855225563049, 1.270895004272461, -0.8004160523414612, -0.8850547671318054, 0.12016584724187851, -0.7832534313201904, 1.0665714740753174, 0.6826046705245972, 0.4120457172393799, 0.2830754220485687, 1.6209328174591064, 0.7783448100090027, -0.45746299624443054, 0.6558285355567932, 0.5667833089828491, -0.13224434852600098, -2.078545331954956, -1.2288609743118286, 0.27261659502983093, -0.45783621072769165, -1.5913383960723877, 1.4491662979125977, -1.0766183137893677, -0.9811410903930664, 0.5346633791923523, 0.07465720176696777, 1.4135586023330688, 0.38566455245018005, 1.4685925245285034, 2.1255459785461426, 0.8162329196929932, 0.4566425681114197, 1.2500501871109009, -0.27340129017829895, -0.5174097418785095, 1.9147634506225586, -0.5043879151344299, 0.4406746029853821, 1.1300814151763916, -0.27385273575782776, -1.0714999437332153, -0.7604378461837769, -1.2453123331069946, -0.745734453201294, 1.2044851779937744, 0.04378198832273483, -1.031981110572815, 0.31603485345840454, 1.664815902709961, 0.059423189610242844, -0.37002649903297424, 0.5808481574058533, 0.4666515290737152, -0.8203710913658142, -0.07331287115812302, -0.906062662601471, 0.5576711893081665, -0.18112565577030182, -0.38410913944244385, 0.4968005418777466, 0.48180869221687317, 1.3002634048461914, -0.03647636994719505, 0.086637482047081, 1.022327184677124, -1.4926409721374512, 1.5094101428985596, -0.6898240447044373, 0.2260134220123291, -2.2886154651641846, 1.4540011882781982, -0.7198739051818848, 2.0047285556793213, -2.5643348693847656, 0.43622148036956787, -0.5466340184211731, -0.49539998173713684, 0.3822132647037506, -0.35326823592185974, 0.13589507341384888, -0.19324976205825806, -1.064759373664856, -0.0451698899269104, -0.6475625038146973, 0.5078004002571106, 1.0745973587036133, 1.3293768167495728, -1.0780494213104248, -0.31003254652023315, -1.7037012577056885, -0.12943528592586517, -0.6327816247940063, 0.2180011123418808, -1.9598191976547241, -0.22700786590576172, -1.9660879373550415, -2.262319564819336, -1.3565235137939453, -0.8170313239097595, 1.1086461544036865, 0.12321405857801437, -0.9508367776870728, 1.281745195388794, -0.4073769450187683, -1.8512874841690063, 1.1295195817947388, -2.072704315185547 ]
https://github.com/huggingface/datasets/issues/4398
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError`
FYI the main reason I want to use `dataset.remove_columns` rather than the function inside `dataset.map` is because according to the 🤗 Datasets documentation, it's faster. "🤗 Datasets also has a [Dataset.remove_columns()](https://huggingface.co/docs/datasets/v2.2.1/en/package_reference/main_classes#datasets.Dataset.remove_columns) method that is functionally identical, but faster, because it doesn’t copy the data of the remaining columns." More information at https://huggingface.co/docs/datasets/process#map
First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
747
52
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError` First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 FYI the main reason I want to use `dataset.remove_columns` rather than the function inside `dataset.map` is because according to the 🤗 Datasets documentation, it's faster. "🤗 Datasets also has a [Dataset.remove_columns()](https://huggingface.co/docs/datasets/v2.2.1/en/package_reference/main_classes#datasets.Dataset.remove_columns) method that is functionally identical, but faster, because it doesn’t copy the data of the remaining columns." More information at https://huggingface.co/docs/datasets/process#map
[ -1.1680415868759155, -0.8792570233345032, -0.8097088932991028, 1.465408205986023, -0.15524856746196747, -1.2498430013656616, 0.1826292723417282, -1.1586580276489258, 1.6909860372543335, -0.8691601157188416, 0.2797885835170746, -1.6516071557998657, 0.03781716525554657, -0.6238412261009216, -0.8026608824729919, -0.8771143555641174, -0.3825027048587799, -0.8625911474227905, 1.034237027168274, 2.510958433151245, 1.2297676801681519, -1.4212727546691895, 2.6668362617492676, 0.7876724600791931, -0.17925642430782318, -0.9701997637748718, 0.4774878919124603, -0.07300978899002075, -1.2995439767837524, -0.5320278406143188, -0.9236558675765991, -0.12917213141918182, -0.5998908877372742, -0.5602222084999084, -0.04478435218334198, 0.466178297996521, -0.3770187795162201, -0.48500415682792664, -0.516956090927124, -0.8935118317604065, 0.45489701628685, -0.3697527050971985, 1.0426751375198364, -0.32341957092285156, 1.8454396724700928, -0.5696669220924377, 0.4553123414516449, 0.7811222672462463, 1.3767530918121338, 0.25135886669158936, -0.027051962912082672, 0.24496082961559296, 0.36643290519714355, -0.09742869436740875, 0.47817742824554443, 1.1723848581314087, 0.6429916620254517, 0.5264539122581482, 0.7811227440834045, -2.209073543548584, 1.3283634185791016, -1.1212055683135986, 0.3125741481781006, 1.3398394584655762, -0.9232620000839233, 0.35530713200569153, -1.8409221172332764, -0.04794999212026596, 0.5048015713691711, -2.2408719062805176, 0.35270172357559204, -1.198723554611206, -0.52448570728302, 0.9469982385635376, 0.3383132219314575, -1.2351021766662598, 0.18378213047981262, -0.3814961016178131, 1.0120329856872559, 0.4282723665237427, 1.1133376359939575, -1.7296258211135864, -0.08745169639587402, -0.35716739296913147, 0.1378941386938095, -1.313019871711731, -1.523179292678833, 0.5518457293510437, 0.605636477470398, 0.5437207221984863, -0.14262937009334564, 1.1073637008666992, -1.0163201093673706, 0.807964026927948, -1.0202809572219849, -1.6888097524642944, -1.371545672416687, -2.1876797676086426, -2.260007858276367, 0.7285367250442505, -0.4628232717514038, -0.6006867289543152, 2.0737533569335938, -0.9651172161102295, -1.7083855867385864, 1.1596425771713257, 0.3214844763278961, -0.049029476940631866, 2.373769998550415, 0.1998046189546585, -0.6787766814231873, 0.4914361834526062, -0.7173924446105957, 0.8635140657424927, -0.54616379737854, 1.2961357831954956, 0.42214787006378174, -1.0902739763259888, 1.636196494102478, -0.3827129006385803, 0.6007490754127502, -0.7484650611877441, -0.4906313121318817, -0.7699405550956726, 0.38099703192710876, 1.8214212656021118, -0.2501315474510193, 1.4670969247817993, -0.3086020350456238, -1.5095305442810059, -1.6291877031326294, 0.970526933670044, 0.39554405212402344, -0.8124139904975891, 0.13465383648872375, -0.3684885799884796, 0.15782976150512695, -0.06190738081932068, 1.1416634321212769, 1.3450223207473755, 0.6930725574493408, -0.31915634870529175, -0.8570430278778076, 0.1586916446685791, -0.11783146858215332, -0.7938780188560486, -1.737525224685669, -0.3663841784000397, 0.12344426661729813, 0.5687447786331177, -1.2004339694976807, 1.8080369234085083, 0.8934147357940674, 1.946062684059143, 1.0478010177612305, -0.4123257100582123, 1.525565266609192, 0.12206114083528519, 1.8598628044128418, -0.4971785247325897, 0.6090929508209229, -0.4086287319660187, -1.1167151927947998, 0.9096271991729736, -0.33183297514915466, -2.040530204772949, -0.7055506706237793, -0.8121816515922546, -0.2843977212905884, -0.7247068285942078, 0.9625840187072754, -0.26181551814079285, -1.3946791887283325, 0.2536548972129822, -0.6740797758102417, 0.11080939322710037, -1.1985111236572266, 0.3764100968837738, 0.6900507211685181, -0.6033669710159302, 0.13223715126514435, -0.2420053333044052, -1.297228455543518, -0.5465628504753113, 0.2990711033344269, 1.8425251245498657, -0.7584207653999329, 0.8756577372550964, 1.054397702217102, -0.7330629825592041, -0.06704682111740112, 0.4008169174194336, -0.3619212508201599, 0.8372296690940857, -1.0821728706359863, -0.46613234281539917, 1.1323659420013428, -0.1926802396774292, -0.5251952409744263, 1.4324326515197754, 0.6824206709861755, -0.9701932072639465, -0.1354103684425354, -0.1098766177892685, -0.8400424718856812, 0.04628463089466095, -1.5634065866470337, -0.09717445820569992, 0.4031449556350708, -1.5419977903366089, -0.4852791726589203, -0.19569402933120728, 1.269660234451294, -0.2365425080060959, 1.4003463983535767, -0.38938236236572266, -0.15641845762729645, -0.33750608563423157, -0.38271504640579224, 0.10592702776193619, -0.2987098693847656, -0.6419743895530701, 0.15461096167564392, -0.650060772895813, 0.34933868050575256, 1.4717671871185303, 0.3432256281375885, -0.01041816733777523, 0.48018595576286316, 1.1696809530258179, 0.3498380780220032, 0.06162500008940697, -0.8271781206130981, -1.4342880249023438, 1.967140793800354, -1.5208553075790405, 1.9846534729003906, 0.8125905394554138, 0.014226523227989674, -1.75990629196167, -1.8943425416946411, 1.3652149438858032, 1.1495174169540405, 2.3588783740997314, 0.5939561724662781, 0.3696332275867462, -0.8156327605247498, -0.6200785636901855, 0.34943798184394836, -1.0360592603683472, -0.6973024606704712, 0.1267443299293518, 2.383938789367676, 1.7843323945999146, -0.4724126160144806, -0.22055263817310333, -1.011116862297058, 1.4561766386032104, -0.20443189144134521, 0.17726941406726837, 1.9919939041137695, -0.25277799367904663, -1.1098535060882568, 1.3102166652679443, -2.342790365219116, 0.18367987871170044, 2.032109498977661, 0.2713609039783478, 0.036728985607624054, -1.3414160013198853, -0.6405389308929443, -0.2103070616722107, -0.441605806350708, -1.165809988975525, 0.5006266832351685, -0.2765757143497467, -0.7000290751457214, -1.4520810842514038, 0.20830455422401428, -1.1180933713912964, -1.5959211587905884, 0.1951194703578949, 1.9030718803405762, 2.035160541534424, -0.7117879986763, 1.6127502918243408, -0.2578783631324768, 0.13707304000854492, 1.23307466506958, 1.2427740097045898, 3.1608293056488037, 1.8032374382019043, -1.2426961660385132, 0.5691202878952026, -0.2048296332359314, -0.5244908332824707, 1.135461688041687, -1.1732958555221558, 1.270234227180481, -0.08091412484645844, -1.1308438777923584, -1.2392287254333496, 0.8405537009239197, 0.41682884097099304, 0.13248594105243683, -0.4547938406467438, 1.1288689374923706, 0.1385032832622528, 1.2603048086166382, 0.5895243883132935, -0.2881980538368225, 0.5940454006195068, -0.41621363162994385, -0.55840665102005, 1.5480499267578125, 0.2800021171569824, -1.350250482559204, -2.22389817237854, -0.17693524062633514, -0.8150582909584045, 0.09197772294282913, -0.629514217376709, -1.0052404403686523, 1.7186381816864014, 0.3337585926055908, -1.2628121376037598, -0.2511681616306305, -0.38921913504600525, -0.637475848197937, 2.6829724311828613, -1.4271901845932007, -0.296942800283432, -0.9670082926750183, -0.6780769228935242, 1.6070092916488647, -1.2400926351547241, -0.2247592657804489, -0.9942878484725952, -0.4653331935405731, -1.2213689088821411, -0.5159617066383362, 0.032077401876449585, -0.8989997506141663, 0.8658077120780945, 0.3355327844619751, -1.2207776308059692, -0.29462000727653503, -0.8893851637840271, 0.8507475852966309, -0.14106114208698273, 0.2760968804359436, 1.8901376724243164, 0.4686763286590576, -0.43045830726623535, 0.7563672065734863, 1.164868712425232, 0.5920529961585999, -0.5442731380462646, 0.23707309365272522, -0.6762545704841614, 0.3289312422275543, -1.2619489431381226, 0.3273608088493347, -2.787400960922241, 0.5744395852088928, -0.036705829203128815, -0.11176503449678421, 0.005829406902194023, -1.386998176574707, 1.060998797416687, 2.5976641178131104, -1.1136412620544434, 0.47802743315696716, 0.2591785490512848, 1.2807234525680542, -1.626601219177246, 0.30054163932800293, -0.3828358054161072, 2.163886547088623, 0.1360241174697876, 1.121169090270996, -0.47346219420433044, -2.4419140815734863, 0.5054558515548706, -1.2709603309631348, -1.177917242050171, 0.7676634192466736, -0.8251368403434753, -0.022785646840929985, -1.4696415662765503, -0.2997506558895111, -0.8437348008155823, -1.184103012084961, 0.8247942924499512, 0.12242545932531357, 0.5033076405525208, -0.6201412677764893, 0.3113437294960022, -2.170116901397705, -1.4071333408355713, -0.26763978600502014, -0.8663448095321655, 0.4587896466255188, -0.361983060836792, 0.7342556715011597, -0.2515232264995575, 0.002570381388068199, 0.33079418540000916, 1.5682148933410645, 3.3387973308563232, 0.17424719035625458, 0.49084895849227905, -0.2892526388168335, -0.9618585705757141, 1.375130534172058, 0.8832011222839355, -0.06830121576786041, -0.6178821921348572, -1.0387412309646606, 1.2305572032928467, 1.953771948814392, 0.9180346131324768, -0.009746242314577103, -0.801651656627655, -0.6954050064086914, -0.09625629335641861, 0.18439139425754547, 0.45281144976615906, 0.9564453363418579, 0.10549909621477127, 0.0495910607278347, 1.4401417970657349, 1.2308427095413208, -0.503711462020874, 0.3667483627796173, -0.7546318769454956, -0.4420247972011566, 0.5350328087806702, 0.31572189927101135, -0.02288549393415451, 0.26334649324417114, -0.9537588357925415, -0.23352345824241638, -0.39831462502479553, -0.9387916922569275, -0.7127278447151184, -0.4652897119522095, -0.31804293394088745, 1.744202733039856, 0.16446341574192047, -0.5160936713218689, -0.05150487646460533, -0.7451398968696594, -0.06760483980178833, -1.1306285858154297, 0.25744733214378357, -0.11394936591386795, -0.17413018643856049, -0.05862133949995041, 1.7518236637115479, -0.920832633972168, -2.0311601161956787, 0.22036412358283997, 0.23060829937458038, -0.27487701177597046, 0.2208481729030609, 1.6327872276306152, 0.4951780438423157, 1.4435229301452637, 1.3805352449417114, 0.9474362134933472, -0.7321403622627258, -1.3935920000076294, 0.6594321727752686, 0.9550392031669617, -1.4116336107254028, 0.8461499214172363, 0.12322341650724411, -0.5055344104766846, 0.6225921511650085, 1.2791552543640137, 0.45712825655937195, -2.039384126663208, 0.8055149912834167, -1.0015703439712524, 0.8240098357200623, 0.65049147605896, 0.6547776460647583, 0.26920267939567566, 0.8191081285476685, -1.2449290752410889, -1.205759882926941, -0.7308353185653687, -0.7222681641578674, 1.9532647132873535, -0.2720341086387634, 0.620190441608429, -0.1133626401424408, -1.397499680519104, -0.099701426923275, 0.7032314538955688, 0.4012787342071533, -0.47808992862701416, 0.6907929182052612, -0.7461346983909607, -1.1192044019699097, -1.4219807386398315, -0.44819217920303345, -1.089920163154602, -0.901862382888794, 1.0526612997055054, 0.8554933071136475, 0.22292128205299377, 1.921772837638855, 0.7377045154571533, 0.26923835277557373, -2.565445899963379, 0.8414035439491272, 0.33080288767814636, -0.10386015474796295, 0.9031606912612915, 0.39967283606529236, 0.993261456489563, 0.027644388377666473, 0.5643225908279419, -2.4576456546783447, 2.3308491706848145, -0.2701195180416107, 0.720819354057312, -0.06903334707021713, -0.19796909391880035, 1.1321730613708496, 0.544460117816925, 0.47599563002586365, -1.0956432819366455, 0.6362325549125671, -0.61600661277771, 1.2186075448989868, 0.8820934891700745, -0.7951794266700745, 0.01188924815505743, 1.3034369945526123, 0.4714599847793579, -0.5518304109573364, -0.9081243276596069, -0.9759837985038757, 0.8972361087799072, 1.7383993864059448, -0.07041832059621811, 0.060486387461423874, 0.8798012137413025, 0.6746273040771484, -1.297579050064087, 0.1260533332824707, -0.7343600988388062, -0.8548518419265747, 1.6140128374099731, 2.0488970279693604, -0.22056260704994202, -0.17907091975212097, -0.7570090889930725, -1.2362866401672363, 0.8417743444442749, 0.025199823081493378, 0.10477354377508163, 0.478180855512619, -0.6617477536201477, 1.1214476823806763, 0.8882070779800415, 0.9556684494018555, 0.30688831210136414, 0.32180944085121155, 0.4402003288269043, -0.3756619393825531, -1.072201132774353, -0.16233617067337036, -1.067987322807312, -2.574246883392334, 0.5008992552757263, -0.18009597063064575, -1.4800657033920288, -0.011760780587792397, -0.96916663646698, 0.8861672282218933, -0.5579960942268372, -1.1586889028549194, -1.519717812538147, 0.20243269205093384, -0.06526263803243637, 0.9209072589874268, -1.6015547513961792, -0.13675203919410706, 1.1721869707107544, 0.9131801128387451, -0.7094452381134033, 0.960913896560669, 0.18138009309768677, 1.0506372451782227, 0.9099593162536621, -0.45257750153541565, 0.4286254942417145, 0.039095763117074966, -1.328344464302063, 0.4048194885253906, 1.177528738975525, 0.13512572646141052, 1.4018182754516602, -0.5422231554985046, 0.0028934134170413017, 0.36364227533340454, -0.46261465549468994, -0.4749325215816498, -0.5986391305923462, 0.6575047969818115, 0.005955809727311134, -0.8702903985977173, 0.04343155771493912, -0.004799989052116871, -0.27419957518577576, 0.1850019097328186, -1.47151780128479, -0.16812196373939514, -0.39516404271125793, -0.5788058042526245, -1.2749165296554565, -0.05171169713139534, 1.3598263263702393, -0.6360642313957214, -0.18864086270332336, 0.4925296902656555, 0.40583789348602295, 0.5127311944961548, 0.541376531124115, -0.666473388671875, -0.3926284611225128, -0.21681101620197296, -0.4097138047218323, 0.306802898645401, 1.3767672777175903, -0.12556956708431244, -0.8824862837791443, 0.7281273007392883, -0.36204755306243896, 0.035545870661735535, 1.9099732637405396, 0.08963288366794586, -0.8088982701301575, 0.29121947288513184, -0.6403401494026184, 1.9787604808807373, 1.802319049835205, 1.3456034660339355, -0.09427537024021149, -1.0193229913711548, 0.678299605846405, -0.3840791881084442, -0.31174179911613464, 0.8914532661437988, 0.33305734395980835, -0.2639237344264984, -1.4404376745224, 0.6781855225563049, 1.270895004272461, -0.8004160523414612, -0.8850547671318054, 0.12016584724187851, -0.7832534313201904, 1.0665714740753174, 0.6826046705245972, 0.4120457172393799, 0.2830754220485687, 1.6209328174591064, 0.7783448100090027, -0.45746299624443054, 0.6558285355567932, 0.5667833089828491, -0.13224434852600098, -2.078545331954956, -1.2288609743118286, 0.27261659502983093, -0.45783621072769165, -1.5913383960723877, 1.4491662979125977, -1.0766183137893677, -0.9811410903930664, 0.5346633791923523, 0.07465720176696777, 1.4135586023330688, 0.38566455245018005, 1.4685925245285034, 2.1255459785461426, 0.8162329196929932, 0.4566425681114197, 1.2500501871109009, -0.27340129017829895, -0.5174097418785095, 1.9147634506225586, -0.5043879151344299, 0.4406746029853821, 1.1300814151763916, -0.27385273575782776, -1.0714999437332153, -0.7604378461837769, -1.2453123331069946, -0.745734453201294, 1.2044851779937744, 0.04378198832273483, -1.031981110572815, 0.31603485345840454, 1.664815902709961, 0.059423189610242844, -0.37002649903297424, 0.5808481574058533, 0.4666515290737152, -0.8203710913658142, -0.07331287115812302, -0.906062662601471, 0.5576711893081665, -0.18112565577030182, -0.38410913944244385, 0.4968005418777466, 0.48180869221687317, 1.3002634048461914, -0.03647636994719505, 0.086637482047081, 1.022327184677124, -1.4926409721374512, 1.5094101428985596, -0.6898240447044373, 0.2260134220123291, -2.2886154651641846, 1.4540011882781982, -0.7198739051818848, 2.0047285556793213, -2.5643348693847656, 0.43622148036956787, -0.5466340184211731, -0.49539998173713684, 0.3822132647037506, -0.35326823592185974, 0.13589507341384888, -0.19324976205825806, -1.064759373664856, -0.0451698899269104, -0.6475625038146973, 0.5078004002571106, 1.0745973587036133, 1.3293768167495728, -1.0780494213104248, -0.31003254652023315, -1.7037012577056885, -0.12943528592586517, -0.6327816247940063, 0.2180011123418808, -1.9598191976547241, -0.22700786590576172, -1.9660879373550415, -2.262319564819336, -1.3565235137939453, -0.8170313239097595, 1.1086461544036865, 0.12321405857801437, -0.9508367776870728, 1.281745195388794, -0.4073769450187683, -1.8512874841690063, 1.1295195817947388, -2.072704315185547 ]
https://github.com/huggingface/datasets/issues/4398
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError`
Here I'm presenting all the scenarios so that you can further investigate the issue: - ✅ `cast_column` -> `map` with `remove_columns` -> `map` with `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}, remove_columns=["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings, remove_columns=["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ❌ `cast_column` -> `map` -> `remove_columns` -> `map` -> `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns(["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ❌ `cast_column` -> `map` with `remove_columns` -> `map` -> `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}, remove_columns=["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns(["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ✅ `cast_column` -> `map` -> `remove_columns` -> `map` with `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings, remove_columns=["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ✅ `map` -> `remove_columns` -> `map` -> `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns(["inputs"]) ds.add_faiss_index(column="embeddings") ```
First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
747
335
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError` First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 Here I'm presenting all the scenarios so that you can further investigate the issue: - ✅ `cast_column` -> `map` with `remove_columns` -> `map` with `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}, remove_columns=["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings, remove_columns=["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ❌ `cast_column` -> `map` -> `remove_columns` -> `map` -> `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns(["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ❌ `cast_column` -> `map` with `remove_columns` -> `map` -> `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}, remove_columns=["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns(["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ✅ `cast_column` -> `map` -> `remove_columns` -> `map` with `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings, remove_columns=["inputs"]) ds.add_faiss_index(column="embeddings") ``` - ✅ `map` -> `remove_columns` -> `map` -> `remove_columns` -> `add_faiss_index` ```python from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns(["inputs"]) ds.add_faiss_index(column="embeddings") ```
[ -1.1680415868759155, -0.8792570233345032, -0.8097088932991028, 1.465408205986023, -0.15524856746196747, -1.2498430013656616, 0.1826292723417282, -1.1586580276489258, 1.6909860372543335, -0.8691601157188416, 0.2797885835170746, -1.6516071557998657, 0.03781716525554657, -0.6238412261009216, -0.8026608824729919, -0.8771143555641174, -0.3825027048587799, -0.8625911474227905, 1.034237027168274, 2.510958433151245, 1.2297676801681519, -1.4212727546691895, 2.6668362617492676, 0.7876724600791931, -0.17925642430782318, -0.9701997637748718, 0.4774878919124603, -0.07300978899002075, -1.2995439767837524, -0.5320278406143188, -0.9236558675765991, -0.12917213141918182, -0.5998908877372742, -0.5602222084999084, -0.04478435218334198, 0.466178297996521, -0.3770187795162201, -0.48500415682792664, -0.516956090927124, -0.8935118317604065, 0.45489701628685, -0.3697527050971985, 1.0426751375198364, -0.32341957092285156, 1.8454396724700928, -0.5696669220924377, 0.4553123414516449, 0.7811222672462463, 1.3767530918121338, 0.25135886669158936, -0.027051962912082672, 0.24496082961559296, 0.36643290519714355, -0.09742869436740875, 0.47817742824554443, 1.1723848581314087, 0.6429916620254517, 0.5264539122581482, 0.7811227440834045, -2.209073543548584, 1.3283634185791016, -1.1212055683135986, 0.3125741481781006, 1.3398394584655762, -0.9232620000839233, 0.35530713200569153, -1.8409221172332764, -0.04794999212026596, 0.5048015713691711, -2.2408719062805176, 0.35270172357559204, -1.198723554611206, -0.52448570728302, 0.9469982385635376, 0.3383132219314575, -1.2351021766662598, 0.18378213047981262, -0.3814961016178131, 1.0120329856872559, 0.4282723665237427, 1.1133376359939575, -1.7296258211135864, -0.08745169639587402, -0.35716739296913147, 0.1378941386938095, -1.313019871711731, -1.523179292678833, 0.5518457293510437, 0.605636477470398, 0.5437207221984863, -0.14262937009334564, 1.1073637008666992, -1.0163201093673706, 0.807964026927948, -1.0202809572219849, -1.6888097524642944, -1.371545672416687, -2.1876797676086426, -2.260007858276367, 0.7285367250442505, -0.4628232717514038, -0.6006867289543152, 2.0737533569335938, -0.9651172161102295, -1.7083855867385864, 1.1596425771713257, 0.3214844763278961, -0.049029476940631866, 2.373769998550415, 0.1998046189546585, -0.6787766814231873, 0.4914361834526062, -0.7173924446105957, 0.8635140657424927, -0.54616379737854, 1.2961357831954956, 0.42214787006378174, -1.0902739763259888, 1.636196494102478, -0.3827129006385803, 0.6007490754127502, -0.7484650611877441, -0.4906313121318817, -0.7699405550956726, 0.38099703192710876, 1.8214212656021118, -0.2501315474510193, 1.4670969247817993, -0.3086020350456238, -1.5095305442810059, -1.6291877031326294, 0.970526933670044, 0.39554405212402344, -0.8124139904975891, 0.13465383648872375, -0.3684885799884796, 0.15782976150512695, -0.06190738081932068, 1.1416634321212769, 1.3450223207473755, 0.6930725574493408, -0.31915634870529175, -0.8570430278778076, 0.1586916446685791, -0.11783146858215332, -0.7938780188560486, -1.737525224685669, -0.3663841784000397, 0.12344426661729813, 0.5687447786331177, -1.2004339694976807, 1.8080369234085083, 0.8934147357940674, 1.946062684059143, 1.0478010177612305, -0.4123257100582123, 1.525565266609192, 0.12206114083528519, 1.8598628044128418, -0.4971785247325897, 0.6090929508209229, -0.4086287319660187, -1.1167151927947998, 0.9096271991729736, -0.33183297514915466, -2.040530204772949, -0.7055506706237793, -0.8121816515922546, -0.2843977212905884, -0.7247068285942078, 0.9625840187072754, -0.26181551814079285, -1.3946791887283325, 0.2536548972129822, -0.6740797758102417, 0.11080939322710037, -1.1985111236572266, 0.3764100968837738, 0.6900507211685181, -0.6033669710159302, 0.13223715126514435, -0.2420053333044052, -1.297228455543518, -0.5465628504753113, 0.2990711033344269, 1.8425251245498657, -0.7584207653999329, 0.8756577372550964, 1.054397702217102, -0.7330629825592041, -0.06704682111740112, 0.4008169174194336, -0.3619212508201599, 0.8372296690940857, -1.0821728706359863, -0.46613234281539917, 1.1323659420013428, -0.1926802396774292, -0.5251952409744263, 1.4324326515197754, 0.6824206709861755, -0.9701932072639465, -0.1354103684425354, -0.1098766177892685, -0.8400424718856812, 0.04628463089466095, -1.5634065866470337, -0.09717445820569992, 0.4031449556350708, -1.5419977903366089, -0.4852791726589203, -0.19569402933120728, 1.269660234451294, -0.2365425080060959, 1.4003463983535767, -0.38938236236572266, -0.15641845762729645, -0.33750608563423157, -0.38271504640579224, 0.10592702776193619, -0.2987098693847656, -0.6419743895530701, 0.15461096167564392, -0.650060772895813, 0.34933868050575256, 1.4717671871185303, 0.3432256281375885, -0.01041816733777523, 0.48018595576286316, 1.1696809530258179, 0.3498380780220032, 0.06162500008940697, -0.8271781206130981, -1.4342880249023438, 1.967140793800354, -1.5208553075790405, 1.9846534729003906, 0.8125905394554138, 0.014226523227989674, -1.75990629196167, -1.8943425416946411, 1.3652149438858032, 1.1495174169540405, 2.3588783740997314, 0.5939561724662781, 0.3696332275867462, -0.8156327605247498, -0.6200785636901855, 0.34943798184394836, -1.0360592603683472, -0.6973024606704712, 0.1267443299293518, 2.383938789367676, 1.7843323945999146, -0.4724126160144806, -0.22055263817310333, -1.011116862297058, 1.4561766386032104, -0.20443189144134521, 0.17726941406726837, 1.9919939041137695, -0.25277799367904663, -1.1098535060882568, 1.3102166652679443, -2.342790365219116, 0.18367987871170044, 2.032109498977661, 0.2713609039783478, 0.036728985607624054, -1.3414160013198853, -0.6405389308929443, -0.2103070616722107, -0.441605806350708, -1.165809988975525, 0.5006266832351685, -0.2765757143497467, -0.7000290751457214, -1.4520810842514038, 0.20830455422401428, -1.1180933713912964, -1.5959211587905884, 0.1951194703578949, 1.9030718803405762, 2.035160541534424, -0.7117879986763, 1.6127502918243408, -0.2578783631324768, 0.13707304000854492, 1.23307466506958, 1.2427740097045898, 3.1608293056488037, 1.8032374382019043, -1.2426961660385132, 0.5691202878952026, -0.2048296332359314, -0.5244908332824707, 1.135461688041687, -1.1732958555221558, 1.270234227180481, -0.08091412484645844, -1.1308438777923584, -1.2392287254333496, 0.8405537009239197, 0.41682884097099304, 0.13248594105243683, -0.4547938406467438, 1.1288689374923706, 0.1385032832622528, 1.2603048086166382, 0.5895243883132935, -0.2881980538368225, 0.5940454006195068, -0.41621363162994385, -0.55840665102005, 1.5480499267578125, 0.2800021171569824, -1.350250482559204, -2.22389817237854, -0.17693524062633514, -0.8150582909584045, 0.09197772294282913, -0.629514217376709, -1.0052404403686523, 1.7186381816864014, 0.3337585926055908, -1.2628121376037598, -0.2511681616306305, -0.38921913504600525, -0.637475848197937, 2.6829724311828613, -1.4271901845932007, -0.296942800283432, -0.9670082926750183, -0.6780769228935242, 1.6070092916488647, -1.2400926351547241, -0.2247592657804489, -0.9942878484725952, -0.4653331935405731, -1.2213689088821411, -0.5159617066383362, 0.032077401876449585, -0.8989997506141663, 0.8658077120780945, 0.3355327844619751, -1.2207776308059692, -0.29462000727653503, -0.8893851637840271, 0.8507475852966309, -0.14106114208698273, 0.2760968804359436, 1.8901376724243164, 0.4686763286590576, -0.43045830726623535, 0.7563672065734863, 1.164868712425232, 0.5920529961585999, -0.5442731380462646, 0.23707309365272522, -0.6762545704841614, 0.3289312422275543, -1.2619489431381226, 0.3273608088493347, -2.787400960922241, 0.5744395852088928, -0.036705829203128815, -0.11176503449678421, 0.005829406902194023, -1.386998176574707, 1.060998797416687, 2.5976641178131104, -1.1136412620544434, 0.47802743315696716, 0.2591785490512848, 1.2807234525680542, -1.626601219177246, 0.30054163932800293, -0.3828358054161072, 2.163886547088623, 0.1360241174697876, 1.121169090270996, -0.47346219420433044, -2.4419140815734863, 0.5054558515548706, -1.2709603309631348, -1.177917242050171, 0.7676634192466736, -0.8251368403434753, -0.022785646840929985, -1.4696415662765503, -0.2997506558895111, -0.8437348008155823, -1.184103012084961, 0.8247942924499512, 0.12242545932531357, 0.5033076405525208, -0.6201412677764893, 0.3113437294960022, -2.170116901397705, -1.4071333408355713, -0.26763978600502014, -0.8663448095321655, 0.4587896466255188, -0.361983060836792, 0.7342556715011597, -0.2515232264995575, 0.002570381388068199, 0.33079418540000916, 1.5682148933410645, 3.3387973308563232, 0.17424719035625458, 0.49084895849227905, -0.2892526388168335, -0.9618585705757141, 1.375130534172058, 0.8832011222839355, -0.06830121576786041, -0.6178821921348572, -1.0387412309646606, 1.2305572032928467, 1.953771948814392, 0.9180346131324768, -0.009746242314577103, -0.801651656627655, -0.6954050064086914, -0.09625629335641861, 0.18439139425754547, 0.45281144976615906, 0.9564453363418579, 0.10549909621477127, 0.0495910607278347, 1.4401417970657349, 1.2308427095413208, -0.503711462020874, 0.3667483627796173, -0.7546318769454956, -0.4420247972011566, 0.5350328087806702, 0.31572189927101135, -0.02288549393415451, 0.26334649324417114, -0.9537588357925415, -0.23352345824241638, -0.39831462502479553, -0.9387916922569275, -0.7127278447151184, -0.4652897119522095, -0.31804293394088745, 1.744202733039856, 0.16446341574192047, -0.5160936713218689, -0.05150487646460533, -0.7451398968696594, -0.06760483980178833, -1.1306285858154297, 0.25744733214378357, -0.11394936591386795, -0.17413018643856049, -0.05862133949995041, 1.7518236637115479, -0.920832633972168, -2.0311601161956787, 0.22036412358283997, 0.23060829937458038, -0.27487701177597046, 0.2208481729030609, 1.6327872276306152, 0.4951780438423157, 1.4435229301452637, 1.3805352449417114, 0.9474362134933472, -0.7321403622627258, -1.3935920000076294, 0.6594321727752686, 0.9550392031669617, -1.4116336107254028, 0.8461499214172363, 0.12322341650724411, -0.5055344104766846, 0.6225921511650085, 1.2791552543640137, 0.45712825655937195, -2.039384126663208, 0.8055149912834167, -1.0015703439712524, 0.8240098357200623, 0.65049147605896, 0.6547776460647583, 0.26920267939567566, 0.8191081285476685, -1.2449290752410889, -1.205759882926941, -0.7308353185653687, -0.7222681641578674, 1.9532647132873535, -0.2720341086387634, 0.620190441608429, -0.1133626401424408, -1.397499680519104, -0.099701426923275, 0.7032314538955688, 0.4012787342071533, -0.47808992862701416, 0.6907929182052612, -0.7461346983909607, -1.1192044019699097, -1.4219807386398315, -0.44819217920303345, -1.089920163154602, -0.901862382888794, 1.0526612997055054, 0.8554933071136475, 0.22292128205299377, 1.921772837638855, 0.7377045154571533, 0.26923835277557373, -2.565445899963379, 0.8414035439491272, 0.33080288767814636, -0.10386015474796295, 0.9031606912612915, 0.39967283606529236, 0.993261456489563, 0.027644388377666473, 0.5643225908279419, -2.4576456546783447, 2.3308491706848145, -0.2701195180416107, 0.720819354057312, -0.06903334707021713, -0.19796909391880035, 1.1321730613708496, 0.544460117816925, 0.47599563002586365, -1.0956432819366455, 0.6362325549125671, -0.61600661277771, 1.2186075448989868, 0.8820934891700745, -0.7951794266700745, 0.01188924815505743, 1.3034369945526123, 0.4714599847793579, -0.5518304109573364, -0.9081243276596069, -0.9759837985038757, 0.8972361087799072, 1.7383993864059448, -0.07041832059621811, 0.060486387461423874, 0.8798012137413025, 0.6746273040771484, -1.297579050064087, 0.1260533332824707, -0.7343600988388062, -0.8548518419265747, 1.6140128374099731, 2.0488970279693604, -0.22056260704994202, -0.17907091975212097, -0.7570090889930725, -1.2362866401672363, 0.8417743444442749, 0.025199823081493378, 0.10477354377508163, 0.478180855512619, -0.6617477536201477, 1.1214476823806763, 0.8882070779800415, 0.9556684494018555, 0.30688831210136414, 0.32180944085121155, 0.4402003288269043, -0.3756619393825531, -1.072201132774353, -0.16233617067337036, -1.067987322807312, -2.574246883392334, 0.5008992552757263, -0.18009597063064575, -1.4800657033920288, -0.011760780587792397, -0.96916663646698, 0.8861672282218933, -0.5579960942268372, -1.1586889028549194, -1.519717812538147, 0.20243269205093384, -0.06526263803243637, 0.9209072589874268, -1.6015547513961792, -0.13675203919410706, 1.1721869707107544, 0.9131801128387451, -0.7094452381134033, 0.960913896560669, 0.18138009309768677, 1.0506372451782227, 0.9099593162536621, -0.45257750153541565, 0.4286254942417145, 0.039095763117074966, -1.328344464302063, 0.4048194885253906, 1.177528738975525, 0.13512572646141052, 1.4018182754516602, -0.5422231554985046, 0.0028934134170413017, 0.36364227533340454, -0.46261465549468994, -0.4749325215816498, -0.5986391305923462, 0.6575047969818115, 0.005955809727311134, -0.8702903985977173, 0.04343155771493912, -0.004799989052116871, -0.27419957518577576, 0.1850019097328186, -1.47151780128479, -0.16812196373939514, -0.39516404271125793, -0.5788058042526245, -1.2749165296554565, -0.05171169713139534, 1.3598263263702393, -0.6360642313957214, -0.18864086270332336, 0.4925296902656555, 0.40583789348602295, 0.5127311944961548, 0.541376531124115, -0.666473388671875, -0.3926284611225128, -0.21681101620197296, -0.4097138047218323, 0.306802898645401, 1.3767672777175903, -0.12556956708431244, -0.8824862837791443, 0.7281273007392883, -0.36204755306243896, 0.035545870661735535, 1.9099732637405396, 0.08963288366794586, -0.8088982701301575, 0.29121947288513184, -0.6403401494026184, 1.9787604808807373, 1.802319049835205, 1.3456034660339355, -0.09427537024021149, -1.0193229913711548, 0.678299605846405, -0.3840791881084442, -0.31174179911613464, 0.8914532661437988, 0.33305734395980835, -0.2639237344264984, -1.4404376745224, 0.6781855225563049, 1.270895004272461, -0.8004160523414612, -0.8850547671318054, 0.12016584724187851, -0.7832534313201904, 1.0665714740753174, 0.6826046705245972, 0.4120457172393799, 0.2830754220485687, 1.6209328174591064, 0.7783448100090027, -0.45746299624443054, 0.6558285355567932, 0.5667833089828491, -0.13224434852600098, -2.078545331954956, -1.2288609743118286, 0.27261659502983093, -0.45783621072769165, -1.5913383960723877, 1.4491662979125977, -1.0766183137893677, -0.9811410903930664, 0.5346633791923523, 0.07465720176696777, 1.4135586023330688, 0.38566455245018005, 1.4685925245285034, 2.1255459785461426, 0.8162329196929932, 0.4566425681114197, 1.2500501871109009, -0.27340129017829895, -0.5174097418785095, 1.9147634506225586, -0.5043879151344299, 0.4406746029853821, 1.1300814151763916, -0.27385273575782776, -1.0714999437332153, -0.7604378461837769, -1.2453123331069946, -0.745734453201294, 1.2044851779937744, 0.04378198832273483, -1.031981110572815, 0.31603485345840454, 1.664815902709961, 0.059423189610242844, -0.37002649903297424, 0.5808481574058533, 0.4666515290737152, -0.8203710913658142, -0.07331287115812302, -0.906062662601471, 0.5576711893081665, -0.18112565577030182, -0.38410913944244385, 0.4968005418777466, 0.48180869221687317, 1.3002634048461914, -0.03647636994719505, 0.086637482047081, 1.022327184677124, -1.4926409721374512, 1.5094101428985596, -0.6898240447044373, 0.2260134220123291, -2.2886154651641846, 1.4540011882781982, -0.7198739051818848, 2.0047285556793213, -2.5643348693847656, 0.43622148036956787, -0.5466340184211731, -0.49539998173713684, 0.3822132647037506, -0.35326823592185974, 0.13589507341384888, -0.19324976205825806, -1.064759373664856, -0.0451698899269104, -0.6475625038146973, 0.5078004002571106, 1.0745973587036133, 1.3293768167495728, -1.0780494213104248, -0.31003254652023315, -1.7037012577056885, -0.12943528592586517, -0.6327816247940063, 0.2180011123418808, -1.9598191976547241, -0.22700786590576172, -1.9660879373550415, -2.262319564819336, -1.3565235137939453, -0.8170313239097595, 1.1086461544036865, 0.12321405857801437, -0.9508367776870728, 1.281745195388794, -0.4073769450187683, -1.8512874841690063, 1.1295195817947388, -2.072704315185547 ]
https://github.com/huggingface/datasets/issues/4398
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError`
So on, I've created #4411 so as to fix the bug with `remove_columns` under certain conditions before `add_faiss_index`, which means that the scenarios not working above are already working fine.
First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2
747
30
Calling `cast_column`/`remove_columns` and a sequence of `map` operations ends up making `faiss` fail with `ValueError` First of all, sorry in advance for the unclear title, but this bug is weird to explain (at least for me), so I tried my best to summarize all the information in this issue. ## Describe the bug Calling a certain combination of operations over a 🤗 `Dataset` and then trying to calculate the `faiss` index with `.add_faiss_index` ends up throwing an exception while trying to set the format back of a previously removed column. But this just happens over certain conditions... I'll present some scenarios below! ## Steps to reproduce the bug Assuming the following dataset named `sample.csv` with some IMDb data: ```csv id,title,summary 1877830,"The Batman","When a sadistic serial killer begins murdering key political figures in Gotham, Batman is forced to investigate the city's hidden corruption and question his family's involvement." 9419884,"Doctor Strange in the Multiverse of Madness","Doctor Strange teams up with a mysterious teenage girl from his dreams who can travel across multiverses, to battle multiple threats, including other-universe versions of himself, which threaten to wipe out millions across the multiverse. They seek help from Wanda the Scarlet Witch, Wong and others." 11138512,"The Northman","From visionary director Robert Eggers comes The Northman, an action-filled epic that follows a young Viking prince on his quest to avenge his father's murder." 1745960,"Top Gun: Maverick","After more than thirty years of service as one of the Navy's top aviators, Pete Mitchell is where he belongs, pushing the envelope as a courageous test pilot and dodging the advancement in rank that would ground him." ``` We'll be able to reproduce the bug using the following piece of code: ```python # Sample code to reproduce the bug from transformers import DPRContextEncoder, DPRContextEncoderTokenizer import torch torch.set_grad_enabled(False) ctx_encoder = DPRContextEncoder.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") ctx_tokenizer = DPRContextEncoderTokenizer.from_pretrained("facebook/dpr-ctx_encoder-single-nq-base") from datasets import load_dataset, Value ds = load_dataset("csv", data_files=["sample.csv"], split="train") ds = ds.cast_column("id", Value("int32")) # from `int64` to `int32` ds = ds.map(lambda x: {"inputs": f"{ctx_tokenizer.sep_token}".join(["title", "summary"])}) ds = ds.remove_columns(["title", "summary"]) def generate_embeddings(x): return {"embeddings": ctx_encoder(**ctx_tokenizer(x["inputs"], return_tensors="pt"))[0][0].numpy()} ds = ds.map(generate_embeddings) ds = ds.remove_columns("inputs") ds.add_faiss_index(column="embeddings") # It fails here! ``` The code above is an adaptation of https://huggingface.co/docs/datasets/faiss_es, for the sake of presenting the bug with a simple example. ## Expected results Ideally, the `faiss` index should be calculated over the 🤗 `Dataset` and no exception should be triggered. ## Actual results But what happens instead is that a `ValueError: Columns ['inputs'] not in the dataset. Current columns in the dataset: ['id', 'embeddings']`, which makes no sense as that column has been previously dropped. ## Environment info <!-- You can run the command `datasets-cli env` and copy-and-paste its output below. --> - `datasets` version: 2.2.2 - Platform: Linux-5.4.0-1074-azure-x86_64-with-glibc2.31 - Python version: 3.9.5 - PyArrow version: 8.0.0 - Pandas version: 1.4.2 So on, I've created #4411 so as to fix the bug with `remove_columns` under certain conditions before `add_faiss_index`, which means that the scenarios not working above are already working fine.
[ -1.1680415868759155, -0.8792570233345032, -0.8097088932991028, 1.465408205986023, -0.15524856746196747, -1.2498430013656616, 0.1826292723417282, -1.1586580276489258, 1.6909860372543335, -0.8691601157188416, 0.2797885835170746, -1.6516071557998657, 0.03781716525554657, -0.6238412261009216, -0.8026608824729919, -0.8771143555641174, -0.3825027048587799, -0.8625911474227905, 1.034237027168274, 2.510958433151245, 1.2297676801681519, -1.4212727546691895, 2.6668362617492676, 0.7876724600791931, -0.17925642430782318, -0.9701997637748718, 0.4774878919124603, -0.07300978899002075, -1.2995439767837524, -0.5320278406143188, -0.9236558675765991, -0.12917213141918182, -0.5998908877372742, -0.5602222084999084, -0.04478435218334198, 0.466178297996521, -0.3770187795162201, -0.48500415682792664, -0.516956090927124, -0.8935118317604065, 0.45489701628685, -0.3697527050971985, 1.0426751375198364, -0.32341957092285156, 1.8454396724700928, -0.5696669220924377, 0.4553123414516449, 0.7811222672462463, 1.3767530918121338, 0.25135886669158936, -0.027051962912082672, 0.24496082961559296, 0.36643290519714355, -0.09742869436740875, 0.47817742824554443, 1.1723848581314087, 0.6429916620254517, 0.5264539122581482, 0.7811227440834045, -2.209073543548584, 1.3283634185791016, -1.1212055683135986, 0.3125741481781006, 1.3398394584655762, -0.9232620000839233, 0.35530713200569153, -1.8409221172332764, -0.04794999212026596, 0.5048015713691711, -2.2408719062805176, 0.35270172357559204, -1.198723554611206, -0.52448570728302, 0.9469982385635376, 0.3383132219314575, -1.2351021766662598, 0.18378213047981262, -0.3814961016178131, 1.0120329856872559, 0.4282723665237427, 1.1133376359939575, -1.7296258211135864, -0.08745169639587402, -0.35716739296913147, 0.1378941386938095, -1.313019871711731, -1.523179292678833, 0.5518457293510437, 0.605636477470398, 0.5437207221984863, -0.14262937009334564, 1.1073637008666992, -1.0163201093673706, 0.807964026927948, -1.0202809572219849, -1.6888097524642944, -1.371545672416687, -2.1876797676086426, -2.260007858276367, 0.7285367250442505, -0.4628232717514038, -0.6006867289543152, 2.0737533569335938, -0.9651172161102295, -1.7083855867385864, 1.1596425771713257, 0.3214844763278961, -0.049029476940631866, 2.373769998550415, 0.1998046189546585, -0.6787766814231873, 0.4914361834526062, -0.7173924446105957, 0.8635140657424927, -0.54616379737854, 1.2961357831954956, 0.42214787006378174, -1.0902739763259888, 1.636196494102478, -0.3827129006385803, 0.6007490754127502, -0.7484650611877441, -0.4906313121318817, -0.7699405550956726, 0.38099703192710876, 1.8214212656021118, -0.2501315474510193, 1.4670969247817993, -0.3086020350456238, -1.5095305442810059, -1.6291877031326294, 0.970526933670044, 0.39554405212402344, -0.8124139904975891, 0.13465383648872375, -0.3684885799884796, 0.15782976150512695, -0.06190738081932068, 1.1416634321212769, 1.3450223207473755, 0.6930725574493408, -0.31915634870529175, -0.8570430278778076, 0.1586916446685791, -0.11783146858215332, -0.7938780188560486, -1.737525224685669, -0.3663841784000397, 0.12344426661729813, 0.5687447786331177, -1.2004339694976807, 1.8080369234085083, 0.8934147357940674, 1.946062684059143, 1.0478010177612305, -0.4123257100582123, 1.525565266609192, 0.12206114083528519, 1.8598628044128418, -0.4971785247325897, 0.6090929508209229, -0.4086287319660187, -1.1167151927947998, 0.9096271991729736, -0.33183297514915466, -2.040530204772949, -0.7055506706237793, -0.8121816515922546, -0.2843977212905884, -0.7247068285942078, 0.9625840187072754, -0.26181551814079285, -1.3946791887283325, 0.2536548972129822, -0.6740797758102417, 0.11080939322710037, -1.1985111236572266, 0.3764100968837738, 0.6900507211685181, -0.6033669710159302, 0.13223715126514435, -0.2420053333044052, -1.297228455543518, -0.5465628504753113, 0.2990711033344269, 1.8425251245498657, -0.7584207653999329, 0.8756577372550964, 1.054397702217102, -0.7330629825592041, -0.06704682111740112, 0.4008169174194336, -0.3619212508201599, 0.8372296690940857, -1.0821728706359863, -0.46613234281539917, 1.1323659420013428, -0.1926802396774292, -0.5251952409744263, 1.4324326515197754, 0.6824206709861755, -0.9701932072639465, -0.1354103684425354, -0.1098766177892685, -0.8400424718856812, 0.04628463089466095, -1.5634065866470337, -0.09717445820569992, 0.4031449556350708, -1.5419977903366089, -0.4852791726589203, -0.19569402933120728, 1.269660234451294, -0.2365425080060959, 1.4003463983535767, -0.38938236236572266, -0.15641845762729645, -0.33750608563423157, -0.38271504640579224, 0.10592702776193619, -0.2987098693847656, -0.6419743895530701, 0.15461096167564392, -0.650060772895813, 0.34933868050575256, 1.4717671871185303, 0.3432256281375885, -0.01041816733777523, 0.48018595576286316, 1.1696809530258179, 0.3498380780220032, 0.06162500008940697, -0.8271781206130981, -1.4342880249023438, 1.967140793800354, -1.5208553075790405, 1.9846534729003906, 0.8125905394554138, 0.014226523227989674, -1.75990629196167, -1.8943425416946411, 1.3652149438858032, 1.1495174169540405, 2.3588783740997314, 0.5939561724662781, 0.3696332275867462, -0.8156327605247498, -0.6200785636901855, 0.34943798184394836, -1.0360592603683472, -0.6973024606704712, 0.1267443299293518, 2.383938789367676, 1.7843323945999146, -0.4724126160144806, -0.22055263817310333, -1.011116862297058, 1.4561766386032104, -0.20443189144134521, 0.17726941406726837, 1.9919939041137695, -0.25277799367904663, -1.1098535060882568, 1.3102166652679443, -2.342790365219116, 0.18367987871170044, 2.032109498977661, 0.2713609039783478, 0.036728985607624054, -1.3414160013198853, -0.6405389308929443, -0.2103070616722107, -0.441605806350708, -1.165809988975525, 0.5006266832351685, -0.2765757143497467, -0.7000290751457214, -1.4520810842514038, 0.20830455422401428, -1.1180933713912964, -1.5959211587905884, 0.1951194703578949, 1.9030718803405762, 2.035160541534424, -0.7117879986763, 1.6127502918243408, -0.2578783631324768, 0.13707304000854492, 1.23307466506958, 1.2427740097045898, 3.1608293056488037, 1.8032374382019043, -1.2426961660385132, 0.5691202878952026, -0.2048296332359314, -0.5244908332824707, 1.135461688041687, -1.1732958555221558, 1.270234227180481, -0.08091412484645844, -1.1308438777923584, -1.2392287254333496, 0.8405537009239197, 0.41682884097099304, 0.13248594105243683, -0.4547938406467438, 1.1288689374923706, 0.1385032832622528, 1.2603048086166382, 0.5895243883132935, -0.2881980538368225, 0.5940454006195068, -0.41621363162994385, -0.55840665102005, 1.5480499267578125, 0.2800021171569824, -1.350250482559204, -2.22389817237854, -0.17693524062633514, -0.8150582909584045, 0.09197772294282913, -0.629514217376709, -1.0052404403686523, 1.7186381816864014, 0.3337585926055908, -1.2628121376037598, -0.2511681616306305, -0.38921913504600525, -0.637475848197937, 2.6829724311828613, -1.4271901845932007, -0.296942800283432, -0.9670082926750183, -0.6780769228935242, 1.6070092916488647, -1.2400926351547241, -0.2247592657804489, -0.9942878484725952, -0.4653331935405731, -1.2213689088821411, -0.5159617066383362, 0.032077401876449585, -0.8989997506141663, 0.8658077120780945, 0.3355327844619751, -1.2207776308059692, -0.29462000727653503, -0.8893851637840271, 0.8507475852966309, -0.14106114208698273, 0.2760968804359436, 1.8901376724243164, 0.4686763286590576, -0.43045830726623535, 0.7563672065734863, 1.164868712425232, 0.5920529961585999, -0.5442731380462646, 0.23707309365272522, -0.6762545704841614, 0.3289312422275543, -1.2619489431381226, 0.3273608088493347, -2.787400960922241, 0.5744395852088928, -0.036705829203128815, -0.11176503449678421, 0.005829406902194023, -1.386998176574707, 1.060998797416687, 2.5976641178131104, -1.1136412620544434, 0.47802743315696716, 0.2591785490512848, 1.2807234525680542, -1.626601219177246, 0.30054163932800293, -0.3828358054161072, 2.163886547088623, 0.1360241174697876, 1.121169090270996, -0.47346219420433044, -2.4419140815734863, 0.5054558515548706, -1.2709603309631348, -1.177917242050171, 0.7676634192466736, -0.8251368403434753, -0.022785646840929985, -1.4696415662765503, -0.2997506558895111, -0.8437348008155823, -1.184103012084961, 0.8247942924499512, 0.12242545932531357, 0.5033076405525208, -0.6201412677764893, 0.3113437294960022, -2.170116901397705, -1.4071333408355713, -0.26763978600502014, -0.8663448095321655, 0.4587896466255188, -0.361983060836792, 0.7342556715011597, -0.2515232264995575, 0.002570381388068199, 0.33079418540000916, 1.5682148933410645, 3.3387973308563232, 0.17424719035625458, 0.49084895849227905, -0.2892526388168335, -0.9618585705757141, 1.375130534172058, 0.8832011222839355, -0.06830121576786041, -0.6178821921348572, -1.0387412309646606, 1.2305572032928467, 1.953771948814392, 0.9180346131324768, -0.009746242314577103, -0.801651656627655, -0.6954050064086914, -0.09625629335641861, 0.18439139425754547, 0.45281144976615906, 0.9564453363418579, 0.10549909621477127, 0.0495910607278347, 1.4401417970657349, 1.2308427095413208, -0.503711462020874, 0.3667483627796173, -0.7546318769454956, -0.4420247972011566, 0.5350328087806702, 0.31572189927101135, -0.02288549393415451, 0.26334649324417114, -0.9537588357925415, -0.23352345824241638, -0.39831462502479553, -0.9387916922569275, -0.7127278447151184, -0.4652897119522095, -0.31804293394088745, 1.744202733039856, 0.16446341574192047, -0.5160936713218689, -0.05150487646460533, -0.7451398968696594, -0.06760483980178833, -1.1306285858154297, 0.25744733214378357, -0.11394936591386795, -0.17413018643856049, -0.05862133949995041, 1.7518236637115479, -0.920832633972168, -2.0311601161956787, 0.22036412358283997, 0.23060829937458038, -0.27487701177597046, 0.2208481729030609, 1.6327872276306152, 0.4951780438423157, 1.4435229301452637, 1.3805352449417114, 0.9474362134933472, -0.7321403622627258, -1.3935920000076294, 0.6594321727752686, 0.9550392031669617, -1.4116336107254028, 0.8461499214172363, 0.12322341650724411, -0.5055344104766846, 0.6225921511650085, 1.2791552543640137, 0.45712825655937195, -2.039384126663208, 0.8055149912834167, -1.0015703439712524, 0.8240098357200623, 0.65049147605896, 0.6547776460647583, 0.26920267939567566, 0.8191081285476685, -1.2449290752410889, -1.205759882926941, -0.7308353185653687, -0.7222681641578674, 1.9532647132873535, -0.2720341086387634, 0.620190441608429, -0.1133626401424408, -1.397499680519104, -0.099701426923275, 0.7032314538955688, 0.4012787342071533, -0.47808992862701416, 0.6907929182052612, -0.7461346983909607, -1.1192044019699097, -1.4219807386398315, -0.44819217920303345, -1.089920163154602, -0.901862382888794, 1.0526612997055054, 0.8554933071136475, 0.22292128205299377, 1.921772837638855, 0.7377045154571533, 0.26923835277557373, -2.565445899963379, 0.8414035439491272, 0.33080288767814636, -0.10386015474796295, 0.9031606912612915, 0.39967283606529236, 0.993261456489563, 0.027644388377666473, 0.5643225908279419, -2.4576456546783447, 2.3308491706848145, -0.2701195180416107, 0.720819354057312, -0.06903334707021713, -0.19796909391880035, 1.1321730613708496, 0.544460117816925, 0.47599563002586365, -1.0956432819366455, 0.6362325549125671, -0.61600661277771, 1.2186075448989868, 0.8820934891700745, -0.7951794266700745, 0.01188924815505743, 1.3034369945526123, 0.4714599847793579, -0.5518304109573364, -0.9081243276596069, -0.9759837985038757, 0.8972361087799072, 1.7383993864059448, -0.07041832059621811, 0.060486387461423874, 0.8798012137413025, 0.6746273040771484, -1.297579050064087, 0.1260533332824707, -0.7343600988388062, -0.8548518419265747, 1.6140128374099731, 2.0488970279693604, -0.22056260704994202, -0.17907091975212097, -0.7570090889930725, -1.2362866401672363, 0.8417743444442749, 0.025199823081493378, 0.10477354377508163, 0.478180855512619, -0.6617477536201477, 1.1214476823806763, 0.8882070779800415, 0.9556684494018555, 0.30688831210136414, 0.32180944085121155, 0.4402003288269043, -0.3756619393825531, -1.072201132774353, -0.16233617067337036, -1.067987322807312, -2.574246883392334, 0.5008992552757263, -0.18009597063064575, -1.4800657033920288, -0.011760780587792397, -0.96916663646698, 0.8861672282218933, -0.5579960942268372, -1.1586889028549194, -1.519717812538147, 0.20243269205093384, -0.06526263803243637, 0.9209072589874268, -1.6015547513961792, -0.13675203919410706, 1.1721869707107544, 0.9131801128387451, -0.7094452381134033, 0.960913896560669, 0.18138009309768677, 1.0506372451782227, 0.9099593162536621, -0.45257750153541565, 0.4286254942417145, 0.039095763117074966, -1.328344464302063, 0.4048194885253906, 1.177528738975525, 0.13512572646141052, 1.4018182754516602, -0.5422231554985046, 0.0028934134170413017, 0.36364227533340454, -0.46261465549468994, -0.4749325215816498, -0.5986391305923462, 0.6575047969818115, 0.005955809727311134, -0.8702903985977173, 0.04343155771493912, -0.004799989052116871, -0.27419957518577576, 0.1850019097328186, -1.47151780128479, -0.16812196373939514, -0.39516404271125793, -0.5788058042526245, -1.2749165296554565, -0.05171169713139534, 1.3598263263702393, -0.6360642313957214, -0.18864086270332336, 0.4925296902656555, 0.40583789348602295, 0.5127311944961548, 0.541376531124115, -0.666473388671875, -0.3926284611225128, -0.21681101620197296, -0.4097138047218323, 0.306802898645401, 1.3767672777175903, -0.12556956708431244, -0.8824862837791443, 0.7281273007392883, -0.36204755306243896, 0.035545870661735535, 1.9099732637405396, 0.08963288366794586, -0.8088982701301575, 0.29121947288513184, -0.6403401494026184, 1.9787604808807373, 1.802319049835205, 1.3456034660339355, -0.09427537024021149, -1.0193229913711548, 0.678299605846405, -0.3840791881084442, -0.31174179911613464, 0.8914532661437988, 0.33305734395980835, -0.2639237344264984, -1.4404376745224, 0.6781855225563049, 1.270895004272461, -0.8004160523414612, -0.8850547671318054, 0.12016584724187851, -0.7832534313201904, 1.0665714740753174, 0.6826046705245972, 0.4120457172393799, 0.2830754220485687, 1.6209328174591064, 0.7783448100090027, -0.45746299624443054, 0.6558285355567932, 0.5667833089828491, -0.13224434852600098, -2.078545331954956, -1.2288609743118286, 0.27261659502983093, -0.45783621072769165, -1.5913383960723877, 1.4491662979125977, -1.0766183137893677, -0.9811410903930664, 0.5346633791923523, 0.07465720176696777, 1.4135586023330688, 0.38566455245018005, 1.4685925245285034, 2.1255459785461426, 0.8162329196929932, 0.4566425681114197, 1.2500501871109009, -0.27340129017829895, -0.5174097418785095, 1.9147634506225586, -0.5043879151344299, 0.4406746029853821, 1.1300814151763916, -0.27385273575782776, -1.0714999437332153, -0.7604378461837769, -1.2453123331069946, -0.745734453201294, 1.2044851779937744, 0.04378198832273483, -1.031981110572815, 0.31603485345840454, 1.664815902709961, 0.059423189610242844, -0.37002649903297424, 0.5808481574058533, 0.4666515290737152, -0.8203710913658142, -0.07331287115812302, -0.906062662601471, 0.5576711893081665, -0.18112565577030182, -0.38410913944244385, 0.4968005418777466, 0.48180869221687317, 1.3002634048461914, -0.03647636994719505, 0.086637482047081, 1.022327184677124, -1.4926409721374512, 1.5094101428985596, -0.6898240447044373, 0.2260134220123291, -2.2886154651641846, 1.4540011882781982, -0.7198739051818848, 2.0047285556793213, -2.5643348693847656, 0.43622148036956787, -0.5466340184211731, -0.49539998173713684, 0.3822132647037506, -0.35326823592185974, 0.13589507341384888, -0.19324976205825806, -1.064759373664856, -0.0451698899269104, -0.6475625038146973, 0.5078004002571106, 1.0745973587036133, 1.3293768167495728, -1.0780494213104248, -0.31003254652023315, -1.7037012577056885, -0.12943528592586517, -0.6327816247940063, 0.2180011123418808, -1.9598191976547241, -0.22700786590576172, -1.9660879373550415, -2.262319564819336, -1.3565235137939453, -0.8170313239097595, 1.1086461544036865, 0.12321405857801437, -0.9508367776870728, 1.281745195388794, -0.4073769450187683, -1.8512874841690063, 1.1295195817947388, -2.072704315185547 ]
https://github.com/huggingface/datasets/issues/4394
trainer became extremely slow after reload dataset by `load_from_disk`
I tried to make the dataset much more smaller (100000 rows) , then the speed became `33.88it/s` from`8.62s/it`. It's nearly 200 times... Do you have any idea? Thank you!
## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ```
748
29
trainer became extremely slow after reload dataset by `load_from_disk` ## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ``` I tried to make the dataset much more smaller (100000 rows) , then the speed became `33.88it/s` from`8.62s/it`. It's nearly 200 times... Do you have any idea? Thank you!
[ -1.2635666131973267, -0.9664938449859619, -0.7665697336196899, 1.4278571605682373, -0.2425231784582138, -1.2443581819534302, 0.1611049920320511, -1.173553228378296, 1.627939224243164, -0.79868084192276, 0.25672364234924316, -1.6494767665863037, 0.0742473304271698, -0.5696834325790405, -0.7419762015342712, -0.8712430596351624, -0.3959881663322449, -0.8276002407073975, 1.1123402118682861, 2.4565823078155518, 1.1895809173583984, -1.4257380962371826, 2.6996665000915527, 0.6839629411697388, -0.25364410877227783, -1.0260924100875854, 0.4903641939163208, 0.11088471114635468, -1.2048099040985107, -0.43253690004348755, -0.8575772643089294, -0.07679221779108047, -0.6287283897399902, -0.46593648195266724, 0.0474066399037838, 0.4117501378059387, -0.2565525770187378, -0.37536758184432983, -0.5234019756317139, -0.6823866963386536, 0.4967089295387268, -0.3564761281013489, 0.9234473705291748, -0.30978715419769287, 1.7722944021224976, -0.6785880923271179, 0.4837760925292969, 0.71225905418396, 1.2254095077514648, 0.20471596717834473, 0.0013971924781799316, 0.28206580877304077, 0.39036232233047485, -0.06669790297746658, 0.4907982349395752, 1.1261649131774902, 0.6613450050354004, 0.5065482258796692, 0.7897656559944153, -2.1347780227661133, 1.3078452348709106, -1.0394011735916138, 0.41551393270492554, 1.3993632793426514, -0.9401551485061646, 0.43140333890914917, -1.775482177734375, -0.05854741483926773, 0.6402349472045898, -2.2056477069854736, 0.3113816976547241, -1.324613332748413, -0.6343154311180115, 0.9828763008117676, 0.3201545476913452, -1.2092881202697754, 0.15567363798618317, -0.5021933913230896, 1.0633296966552734, 0.3958689570426941, 1.1097815036773682, -1.6952574253082275, -0.09642120450735092, -0.21910886466503143, 0.10643672943115234, -1.3996965885162354, -1.5493367910385132, 0.6583179235458374, 0.5597317814826965, 0.5565009713172913, -0.12944528460502625, 0.9837348461151123, -1.0105621814727783, 0.8122264742851257, -1.0538734197616577, -1.6591155529022217, -1.4333279132843018, -2.313246250152588, -2.221510410308838, 0.7076055407524109, -0.528818666934967, -0.5907738208770752, 2.0742299556732178, -0.9795790910720825, -1.6451467275619507, 1.18022620677948, 0.32135075330734253, -0.0044914367608726025, 2.4328389167785645, 0.24512584507465363, -0.6563429236412048, 0.4652624726295471, -0.8806216716766357, 0.7205933928489685, -0.37531566619873047, 1.3300949335098267, 0.42437928915023804, -0.9941132068634033, 1.545865774154663, -0.40309637784957886, 0.6298642754554749, -0.7125284075737, -0.5733972787857056, -0.7973356246948242, 0.292998731136322, 1.920204997062683, -0.23067501187324524, 1.5072243213653564, -0.3733118176460266, -1.5992777347564697, -1.5468295812606812, 0.8937689661979675, 0.4814532995223999, -0.8235183954238892, 0.2055196911096573, -0.41118282079696655, 0.17883767187595367, -0.05730292201042175, 1.1255406141281128, 1.3061738014221191, 0.719225287437439, -0.3980885148048401, -0.8862772583961487, 0.16308338940143585, -0.13833972811698914, -0.7808759808540344, -1.879180908203125, -0.37091511487960815, 0.041208501905202866, 0.7203274369239807, -1.221016526222229, 1.7047719955444336, 0.8909240961074829, 1.905212640762329, 1.0245836973190308, -0.4722304940223694, 1.3465560674667358, 0.05991852283477783, 1.8050752878189087, -0.5821536183357239, 0.7129122614860535, -0.3775220513343811, -1.1171488761901855, 0.9559362530708313, -0.2843090891838074, -2.025240182876587, -0.7541293501853943, -0.8254588842391968, -0.19933772087097168, -0.7960374355316162, 0.8649311661720276, -0.2705724239349365, -1.5048425197601318, 0.3115934133529663, -0.6674646735191345, 0.21685560047626495, -1.221019983291626, 0.3448256254196167, 0.6343002319335938, -0.5502873659133911, 0.003313138149678707, -0.2599036693572998, -1.2681025266647339, -0.5369595885276794, 0.25153493881225586, 1.9070850610733032, -0.8053762912750244, 0.9813344478607178, 1.0559831857681274, -0.6590189337730408, -0.030357781797647476, 0.33015209436416626, -0.3037596344947815, 0.8336626291275024, -1.1097930669784546, -0.5117608308792114, 1.1275521516799927, -0.18879783153533936, -0.5157275199890137, 1.539884090423584, 0.7918153405189514, -1.0321967601776123, -0.23276738822460175, -0.21330951154232025, -0.84342360496521, 0.049932338297367096, -1.603679895401001, -0.13258926570415497, 0.4165616035461426, -1.5750995874404907, -0.5039754509925842, -0.1717752069234848, 1.3540327548980713, -0.22189924120903015, 1.4026750326156616, -0.38267964124679565, -0.2058759182691574, -0.3335579037666321, -0.35426199436187744, 0.2003554403781891, -0.22850258648395538, -0.5400823950767517, 0.16486668586730957, -0.8285292983055115, 0.30605125427246094, 1.4716957807540894, 0.33782416582107544, 0.07370582222938538, 0.4222625494003296, 1.064975619316101, 0.3415486812591553, 0.0021420782431960106, -0.8787394762039185, -1.5104566812515259, 1.9694663286209106, -1.5689338445663452, 2.028611660003662, 0.7768185138702393, -0.0650353729724884, -1.6524760723114014, -1.8658965826034546, 1.3425308465957642, 1.2121179103851318, 2.3658511638641357, 0.5649216175079346, 0.3317711353302002, -0.8295850157737732, -0.7054383158683777, 0.16685938835144043, -1.0474046468734741, -0.7049107551574707, 0.14748430252075195, 2.415879487991333, 1.7712230682373047, -0.5077150464057922, -0.08592721074819565, -0.9359625577926636, 1.4227734804153442, -0.20189687609672546, 0.26075780391693115, 2.032135009765625, -0.2906377911567688, -1.0530904531478882, 1.3034601211547852, -2.365598678588867, 0.15451204776763916, 1.9987989664077759, 0.29332220554351807, 0.0986548513174057, -1.2825509309768677, -0.5857897996902466, -0.39612656831741333, -0.44196826219558716, -1.2051838636398315, 0.49683427810668945, -0.19407512247562408, -0.7489386796951294, -1.45970618724823, 0.1493394821882248, -1.1637483835220337, -1.6579375267028809, 0.2775866985321045, 1.8766815662384033, 2.11716890335083, -0.7746111750602722, 1.5352052450180054, -0.43183761835098267, 0.1111312136054039, 1.2408069372177124, 1.2968558073043823, 3.062814712524414, 1.88592529296875, -1.2997952699661255, 0.6380833387374878, -0.17277897894382477, -0.5564365983009338, 1.1162654161453247, -1.1286650896072388, 1.2222808599472046, -0.12580442428588867, -1.1497935056686401, -1.2695618867874146, 1.0315215587615967, 0.5120494961738586, 0.09769118577241898, -0.5095610022544861, 1.1838055849075317, 0.06007087975740433, 1.4089769124984741, 0.507590115070343, -0.3174954652786255, 0.552624523639679, -0.43791627883911133, -0.46489542722702026, 1.6303513050079346, 0.1407897025346756, -1.4672341346740723, -2.3256988525390625, -0.3001067638397217, -0.8885358572006226, 0.04104778543114662, -0.6762688755989075, -1.0766628980636597, 1.6364394426345825, 0.37538856267929077, -1.2711864709854126, -0.3102007508277893, -0.23068493604660034, -0.6345463991165161, 2.6455137729644775, -1.373556137084961, -0.2219964563846588, -0.9302324652671814, -0.6407244801521301, 1.658880591392517, -1.2242544889450073, -0.24091631174087524, -1.0435479879379272, -0.5679293870925903, -1.197903037071228, -0.4515313506126404, 0.006173774600028992, -1.0457841157913208, 0.8357863426208496, 0.11724688112735748, -1.188279151916504, -0.34581631422042847, -0.8180503249168396, 0.9134239554405212, -0.09755541384220123, 0.25525766611099243, 1.7915772199630737, 0.2936245799064636, -0.3695102334022522, 0.7087831497192383, 1.1927015781402588, 0.6465712189674377, -0.7512306571006775, 0.07419564574956894, -0.6468588709831238, 0.37774598598480225, -1.2092010974884033, 0.29869115352630615, -2.9217052459716797, 0.6698604226112366, -0.0050506857223808765, 0.03216657415032387, -0.015908975154161453, -1.2967571020126343, 1.1441888809204102, 2.6578385829925537, -1.0870954990386963, 0.4865981936454773, 0.37134701013565063, 1.1925381422042847, -1.6067708730697632, 0.3056948184967041, -0.40518081188201904, 2.1130449771881104, 0.17234483361244202, 1.2894421815872192, -0.4544488191604614, -2.329920530319214, 0.5971026420593262, -1.2021586894989014, -1.1654388904571533, 0.760444700717926, -0.8316299915313721, 0.16879236698150635, -1.5172618627548218, -0.2691102623939514, -0.9128796458244324, -1.152445912361145, 0.6420978903770447, 0.12679412961006165, 0.39376312494277954, -0.6415957808494568, 0.3194372057914734, -2.229034662246704, -1.3629419803619385, -0.15005415678024292, -0.9372519254684448, 0.5620288252830505, -0.4305422902107239, 0.7125293612480164, -0.05405256897211075, 0.07658691704273224, 0.3751993179321289, 1.475351095199585, 3.3425815105438232, 0.24938876926898956, 0.320468008518219, -0.18024954199790955, -0.8835642337799072, 1.4247419834136963, 0.9037259221076965, -0.03400490805506706, -0.5275049209594727, -1.0301917791366577, 1.261226773262024, 1.971776008605957, 1.0106723308563232, -0.008448698557913303, -0.7907979488372803, -0.6139947772026062, -0.08449681848287582, 0.2101704478263855, 0.42454594373703003, 0.9460042119026184, 0.029321353882551193, 0.08059509098529816, 1.425718903541565, 1.163035273551941, -0.5188658833503723, 0.36813896894454956, -0.8888987898826599, -0.48929542303085327, 0.4753815531730652, 0.30425548553466797, -0.019740846008062363, 0.36269426345825195, -1.0082122087478638, -0.17862190306186676, -0.3179197311401367, -0.8331090211868286, -0.6760469675064087, -0.3854942321777344, -0.4046483635902405, 1.5561169385910034, 0.0643242672085762, -0.4642617106437683, -0.02837272733449936, -0.7951618432998657, -0.010158458724617958, -1.1696397066116333, 0.17379800975322723, -0.16424116492271423, -0.11296730488538742, -0.164652019739151, 1.7428826093673706, -0.8595350980758667, -1.999144434928894, 0.17830759286880493, 0.3242945075035095, -0.3489353656768799, 0.18692967295646667, 1.7159690856933594, 0.5717059969902039, 1.4799615144729614, 1.2585344314575195, 0.9899469017982483, -0.6483384370803833, -1.2904424667358398, 0.6782885789871216, 0.9873192310333252, -1.3147671222686768, 0.8497053980827332, -0.04578689858317375, -0.45553451776504517, 0.6149465441703796, 1.3280378580093384, 0.48555803298950195, -2.0647902488708496, 0.8759980797767639, -1.0322070121765137, 0.8639916777610779, 0.7564710378646851, 0.7226774096488953, 0.2583223581314087, 0.8504505157470703, -1.257388710975647, -1.0157921314239502, -0.800605058670044, -0.6767722964286804, 1.9696131944656372, -0.23160101473331451, 0.5522320866584778, -0.25586235523223877, -1.2442890405654907, -0.06360559165477753, 0.6724557876586914, 0.4596535563468933, -0.43661099672317505, 0.7657507061958313, -0.6051309108734131, -1.1130820512771606, -1.2549649477005005, -0.4056357741355896, -1.0408203601837158, -0.9224287867546082, 1.095947504043579, 0.7711902856826782, 0.37184977531433105, 1.8782289028167725, 0.6159118413925171, 0.18913158774375916, -2.580761671066284, 0.9377878904342651, 0.29024356603622437, -0.13215908408164978, 0.8225653171539307, 0.3780742883682251, 1.1246106624603271, 0.09690772742033005, 0.4723120331764221, -2.4668288230895996, 2.2970571517944336, -0.15259772539138794, 0.6155586838722229, 0.052517831325531006, -0.10368102043867111, 1.1777172088623047, 0.6498652100563049, 0.5352209806442261, -1.0242369174957275, 0.6951568722724915, -0.5536007285118103, 1.2890526056289673, 0.8110165596008301, -0.7486037611961365, -0.018434975296258926, 1.3547202348709106, 0.42187219858169556, -0.5691019296646118, -0.9728151559829712, -0.9016975164413452, 0.9655475616455078, 1.7206593751907349, -0.08114920556545258, -0.054915424436330795, 0.721206784248352, 0.7234201431274414, -1.250219464302063, 0.028060588985681534, -0.7378223538398743, -0.813932478427887, 1.6218000650405884, 2.0761077404022217, -0.21453000605106354, -0.15286199748516083, -0.7294376492500305, -1.2708498239517212, 0.8983981013298035, -0.10095410794019699, 0.16864143311977386, 0.6516170501708984, -0.5802074074745178, 1.0717825889587402, 0.8237237930297852, 0.8897423148155212, 0.1860794574022293, 0.26648378372192383, 0.3648306727409363, -0.3436196446418762, -1.0897026062011719, -0.22714097797870636, -1.102874517440796, -2.539562225341797, 0.39363205432891846, -0.20898988842964172, -1.3625482320785522, -0.0409708209335804, -0.9928081035614014, 0.9514351487159729, -0.585145115852356, -1.047162413597107, -1.5745065212249756, 0.2068277895450592, -0.028307350352406502, 0.9896652698516846, -1.6462849378585815, -0.13387331366539001, 1.1380969285964966, 0.7603046298027039, -0.6501918435096741, 1.0221754312515259, 0.23487965762615204, 0.9798087477684021, 0.8120247721672058, -0.35541290044784546, 0.5329022407531738, 0.03359796479344368, -1.3237481117248535, 0.5048353672027588, 1.2437241077423096, 0.11986710131168365, 1.476027011871338, -0.4786192774772644, 0.0375354066491127, 0.3565974831581116, -0.5253197550773621, -0.4898095726966858, -0.42068707942962646, 0.612031102180481, 0.01548803225159645, -0.9581257700920105, 0.031420692801475525, -0.10376613587141037, -0.3059614896774292, 0.33072179555892944, -1.4647048711776733, -0.15451961755752563, -0.4547736644744873, -0.5549842715263367, -1.2311235666275024, -0.028103122487664223, 1.456040382385254, -0.6435654759407043, -0.18622161448001862, 0.4277914762496948, 0.304446280002594, 0.5169821381568909, 0.7239847779273987, -0.6849845051765442, -0.34260129928588867, -0.2777342200279236, -0.3136900067329407, 0.30253857374191284, 1.2917406558990479, -0.17436622083187103, -0.9247771501541138, 0.6525057554244995, -0.29141849279403687, 0.05439694970846176, 1.9849447011947632, 0.15347778797149658, -0.7241231203079224, 0.33804500102996826, -0.7548670768737793, 1.9580594301223755, 1.730323076248169, 1.314848780632019, -0.17076176404953003, -0.9768242239952087, 0.5959305167198181, -0.3626864552497864, -0.4511834383010864, 0.8474853038787842, 0.3182803988456726, -0.29593002796173096, -1.414816975593567, 0.6583751440048218, 1.3209031820297241, -0.8111387491226196, -0.8670996427536011, 0.18100975453853607, -0.7900038957595825, 1.1252195835113525, 0.6322807669639587, 0.4484104514122009, 0.3005497455596924, 1.5846872329711914, 0.7266139388084412, -0.5485232472419739, 0.5108319520950317, 0.4752877354621887, -0.1334250271320343, -2.0494132041931152, -1.229480266571045, 0.3294757604598999, -0.6148508191108704, -1.6032174825668335, 1.4095466136932373, -1.1377946138381958, -1.0353411436080933, 0.6312301158905029, 0.11091785877943039, 1.3904681205749512, 0.3424155116081238, 1.6499841213226318, 2.0471532344818115, 0.868199348449707, 0.3945057988166809, 1.2419408559799194, -0.1762726753950119, -0.5211751461029053, 1.8349246978759766, -0.42539072036743164, 0.4428352117538452, 1.1309292316436768, -0.32458359003067017, -1.0792752504348755, -0.7781350612640381, -1.1543140411376953, -0.7079215049743652, 1.1385999917984009, 0.13184261322021484, -1.09017014503479, 0.1824728101491928, 1.6527636051177979, 0.055685631930828094, -0.36399465799331665, 0.6970903873443604, 0.4110146164894104, -0.9054844975471497, -0.09382147341966629, -0.9411347508430481, 0.5025455355644226, -0.23142006993293762, -0.2672550082206726, 0.31641584634780884, 0.5520159006118774, 1.3377156257629395, -0.03416261449456215, 0.16222454607486725, 1.0992717742919922, -1.4365440607070923, 1.4693269729614258, -0.646956205368042, 0.3217877745628357, -2.369053840637207, 1.4002525806427002, -0.6623741984367371, 1.9908705949783325, -2.652068614959717, 0.356325626373291, -0.6367565393447876, -0.4924353361129761, 0.22386431694030762, -0.361045777797699, 0.20832188427448273, -0.10145082324743271, -1.1445138454437256, 0.03716936707496643, -0.7328140139579773, 0.5593915581703186, 1.1155352592468262, 1.4099863767623901, -1.18272864818573, -0.29040318727493286, -1.6945980787277222, -0.17162591218948364, -0.7103679776191711, 0.29885566234588623, -2.003530263900757, -0.22495904564857483, -1.9261176586151123, -2.262002944946289, -1.3545759916305542, -0.8994823098182678, 1.0988881587982178, 0.13710275292396545, -0.9114202857017517, 1.1796938180923462, -0.40551167726516724, -1.7878646850585938, 1.1531827449798584, -2.0933990478515625 ]
https://github.com/huggingface/datasets/issues/4394
trainer became extremely slow after reload dataset by `load_from_disk`
Similar issue: https://github.com/huggingface/transformers/issues/8818 I changed `RandomSampler` to `SequentialSampler` in the `trainer.py`, but the speed didn't become faster.
## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ```
748
17
trainer became extremely slow after reload dataset by `load_from_disk` ## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ``` Similar issue: https://github.com/huggingface/transformers/issues/8818 I changed `RandomSampler` to `SequentialSampler` in the `trainer.py`, but the speed didn't become faster.
[ -1.2635666131973267, -0.9664938449859619, -0.7665697336196899, 1.4278571605682373, -0.2425231784582138, -1.2443581819534302, 0.1611049920320511, -1.173553228378296, 1.627939224243164, -0.79868084192276, 0.25672364234924316, -1.6494767665863037, 0.0742473304271698, -0.5696834325790405, -0.7419762015342712, -0.8712430596351624, -0.3959881663322449, -0.8276002407073975, 1.1123402118682861, 2.4565823078155518, 1.1895809173583984, -1.4257380962371826, 2.6996665000915527, 0.6839629411697388, -0.25364410877227783, -1.0260924100875854, 0.4903641939163208, 0.11088471114635468, -1.2048099040985107, -0.43253690004348755, -0.8575772643089294, -0.07679221779108047, -0.6287283897399902, -0.46593648195266724, 0.0474066399037838, 0.4117501378059387, -0.2565525770187378, -0.37536758184432983, -0.5234019756317139, -0.6823866963386536, 0.4967089295387268, -0.3564761281013489, 0.9234473705291748, -0.30978715419769287, 1.7722944021224976, -0.6785880923271179, 0.4837760925292969, 0.71225905418396, 1.2254095077514648, 0.20471596717834473, 0.0013971924781799316, 0.28206580877304077, 0.39036232233047485, -0.06669790297746658, 0.4907982349395752, 1.1261649131774902, 0.6613450050354004, 0.5065482258796692, 0.7897656559944153, -2.1347780227661133, 1.3078452348709106, -1.0394011735916138, 0.41551393270492554, 1.3993632793426514, -0.9401551485061646, 0.43140333890914917, -1.775482177734375, -0.05854741483926773, 0.6402349472045898, -2.2056477069854736, 0.3113816976547241, -1.324613332748413, -0.6343154311180115, 0.9828763008117676, 0.3201545476913452, -1.2092881202697754, 0.15567363798618317, -0.5021933913230896, 1.0633296966552734, 0.3958689570426941, 1.1097815036773682, -1.6952574253082275, -0.09642120450735092, -0.21910886466503143, 0.10643672943115234, -1.3996965885162354, -1.5493367910385132, 0.6583179235458374, 0.5597317814826965, 0.5565009713172913, -0.12944528460502625, 0.9837348461151123, -1.0105621814727783, 0.8122264742851257, -1.0538734197616577, -1.6591155529022217, -1.4333279132843018, -2.313246250152588, -2.221510410308838, 0.7076055407524109, -0.528818666934967, -0.5907738208770752, 2.0742299556732178, -0.9795790910720825, -1.6451467275619507, 1.18022620677948, 0.32135075330734253, -0.0044914367608726025, 2.4328389167785645, 0.24512584507465363, -0.6563429236412048, 0.4652624726295471, -0.8806216716766357, 0.7205933928489685, -0.37531566619873047, 1.3300949335098267, 0.42437928915023804, -0.9941132068634033, 1.545865774154663, -0.40309637784957886, 0.6298642754554749, -0.7125284075737, -0.5733972787857056, -0.7973356246948242, 0.292998731136322, 1.920204997062683, -0.23067501187324524, 1.5072243213653564, -0.3733118176460266, -1.5992777347564697, -1.5468295812606812, 0.8937689661979675, 0.4814532995223999, -0.8235183954238892, 0.2055196911096573, -0.41118282079696655, 0.17883767187595367, -0.05730292201042175, 1.1255406141281128, 1.3061738014221191, 0.719225287437439, -0.3980885148048401, -0.8862772583961487, 0.16308338940143585, -0.13833972811698914, -0.7808759808540344, -1.879180908203125, -0.37091511487960815, 0.041208501905202866, 0.7203274369239807, -1.221016526222229, 1.7047719955444336, 0.8909240961074829, 1.905212640762329, 1.0245836973190308, -0.4722304940223694, 1.3465560674667358, 0.05991852283477783, 1.8050752878189087, -0.5821536183357239, 0.7129122614860535, -0.3775220513343811, -1.1171488761901855, 0.9559362530708313, -0.2843090891838074, -2.025240182876587, -0.7541293501853943, -0.8254588842391968, -0.19933772087097168, -0.7960374355316162, 0.8649311661720276, -0.2705724239349365, -1.5048425197601318, 0.3115934133529663, -0.6674646735191345, 0.21685560047626495, -1.221019983291626, 0.3448256254196167, 0.6343002319335938, -0.5502873659133911, 0.003313138149678707, -0.2599036693572998, -1.2681025266647339, -0.5369595885276794, 0.25153493881225586, 1.9070850610733032, -0.8053762912750244, 0.9813344478607178, 1.0559831857681274, -0.6590189337730408, -0.030357781797647476, 0.33015209436416626, -0.3037596344947815, 0.8336626291275024, -1.1097930669784546, -0.5117608308792114, 1.1275521516799927, -0.18879783153533936, -0.5157275199890137, 1.539884090423584, 0.7918153405189514, -1.0321967601776123, -0.23276738822460175, -0.21330951154232025, -0.84342360496521, 0.049932338297367096, -1.603679895401001, -0.13258926570415497, 0.4165616035461426, -1.5750995874404907, -0.5039754509925842, -0.1717752069234848, 1.3540327548980713, -0.22189924120903015, 1.4026750326156616, -0.38267964124679565, -0.2058759182691574, -0.3335579037666321, -0.35426199436187744, 0.2003554403781891, -0.22850258648395538, -0.5400823950767517, 0.16486668586730957, -0.8285292983055115, 0.30605125427246094, 1.4716957807540894, 0.33782416582107544, 0.07370582222938538, 0.4222625494003296, 1.064975619316101, 0.3415486812591553, 0.0021420782431960106, -0.8787394762039185, -1.5104566812515259, 1.9694663286209106, -1.5689338445663452, 2.028611660003662, 0.7768185138702393, -0.0650353729724884, -1.6524760723114014, -1.8658965826034546, 1.3425308465957642, 1.2121179103851318, 2.3658511638641357, 0.5649216175079346, 0.3317711353302002, -0.8295850157737732, -0.7054383158683777, 0.16685938835144043, -1.0474046468734741, -0.7049107551574707, 0.14748430252075195, 2.415879487991333, 1.7712230682373047, -0.5077150464057922, -0.08592721074819565, -0.9359625577926636, 1.4227734804153442, -0.20189687609672546, 0.26075780391693115, 2.032135009765625, -0.2906377911567688, -1.0530904531478882, 1.3034601211547852, -2.365598678588867, 0.15451204776763916, 1.9987989664077759, 0.29332220554351807, 0.0986548513174057, -1.2825509309768677, -0.5857897996902466, -0.39612656831741333, -0.44196826219558716, -1.2051838636398315, 0.49683427810668945, -0.19407512247562408, -0.7489386796951294, -1.45970618724823, 0.1493394821882248, -1.1637483835220337, -1.6579375267028809, 0.2775866985321045, 1.8766815662384033, 2.11716890335083, -0.7746111750602722, 1.5352052450180054, -0.43183761835098267, 0.1111312136054039, 1.2408069372177124, 1.2968558073043823, 3.062814712524414, 1.88592529296875, -1.2997952699661255, 0.6380833387374878, -0.17277897894382477, -0.5564365983009338, 1.1162654161453247, -1.1286650896072388, 1.2222808599472046, -0.12580442428588867, -1.1497935056686401, -1.2695618867874146, 1.0315215587615967, 0.5120494961738586, 0.09769118577241898, -0.5095610022544861, 1.1838055849075317, 0.06007087975740433, 1.4089769124984741, 0.507590115070343, -0.3174954652786255, 0.552624523639679, -0.43791627883911133, -0.46489542722702026, 1.6303513050079346, 0.1407897025346756, -1.4672341346740723, -2.3256988525390625, -0.3001067638397217, -0.8885358572006226, 0.04104778543114662, -0.6762688755989075, -1.0766628980636597, 1.6364394426345825, 0.37538856267929077, -1.2711864709854126, -0.3102007508277893, -0.23068493604660034, -0.6345463991165161, 2.6455137729644775, -1.373556137084961, -0.2219964563846588, -0.9302324652671814, -0.6407244801521301, 1.658880591392517, -1.2242544889450073, -0.24091631174087524, -1.0435479879379272, -0.5679293870925903, -1.197903037071228, -0.4515313506126404, 0.006173774600028992, -1.0457841157913208, 0.8357863426208496, 0.11724688112735748, -1.188279151916504, -0.34581631422042847, -0.8180503249168396, 0.9134239554405212, -0.09755541384220123, 0.25525766611099243, 1.7915772199630737, 0.2936245799064636, -0.3695102334022522, 0.7087831497192383, 1.1927015781402588, 0.6465712189674377, -0.7512306571006775, 0.07419564574956894, -0.6468588709831238, 0.37774598598480225, -1.2092010974884033, 0.29869115352630615, -2.9217052459716797, 0.6698604226112366, -0.0050506857223808765, 0.03216657415032387, -0.015908975154161453, -1.2967571020126343, 1.1441888809204102, 2.6578385829925537, -1.0870954990386963, 0.4865981936454773, 0.37134701013565063, 1.1925381422042847, -1.6067708730697632, 0.3056948184967041, -0.40518081188201904, 2.1130449771881104, 0.17234483361244202, 1.2894421815872192, -0.4544488191604614, -2.329920530319214, 0.5971026420593262, -1.2021586894989014, -1.1654388904571533, 0.760444700717926, -0.8316299915313721, 0.16879236698150635, -1.5172618627548218, -0.2691102623939514, -0.9128796458244324, -1.152445912361145, 0.6420978903770447, 0.12679412961006165, 0.39376312494277954, -0.6415957808494568, 0.3194372057914734, -2.229034662246704, -1.3629419803619385, -0.15005415678024292, -0.9372519254684448, 0.5620288252830505, -0.4305422902107239, 0.7125293612480164, -0.05405256897211075, 0.07658691704273224, 0.3751993179321289, 1.475351095199585, 3.3425815105438232, 0.24938876926898956, 0.320468008518219, -0.18024954199790955, -0.8835642337799072, 1.4247419834136963, 0.9037259221076965, -0.03400490805506706, -0.5275049209594727, -1.0301917791366577, 1.261226773262024, 1.971776008605957, 1.0106723308563232, -0.008448698557913303, -0.7907979488372803, -0.6139947772026062, -0.08449681848287582, 0.2101704478263855, 0.42454594373703003, 0.9460042119026184, 0.029321353882551193, 0.08059509098529816, 1.425718903541565, 1.163035273551941, -0.5188658833503723, 0.36813896894454956, -0.8888987898826599, -0.48929542303085327, 0.4753815531730652, 0.30425548553466797, -0.019740846008062363, 0.36269426345825195, -1.0082122087478638, -0.17862190306186676, -0.3179197311401367, -0.8331090211868286, -0.6760469675064087, -0.3854942321777344, -0.4046483635902405, 1.5561169385910034, 0.0643242672085762, -0.4642617106437683, -0.02837272733449936, -0.7951618432998657, -0.010158458724617958, -1.1696397066116333, 0.17379800975322723, -0.16424116492271423, -0.11296730488538742, -0.164652019739151, 1.7428826093673706, -0.8595350980758667, -1.999144434928894, 0.17830759286880493, 0.3242945075035095, -0.3489353656768799, 0.18692967295646667, 1.7159690856933594, 0.5717059969902039, 1.4799615144729614, 1.2585344314575195, 0.9899469017982483, -0.6483384370803833, -1.2904424667358398, 0.6782885789871216, 0.9873192310333252, -1.3147671222686768, 0.8497053980827332, -0.04578689858317375, -0.45553451776504517, 0.6149465441703796, 1.3280378580093384, 0.48555803298950195, -2.0647902488708496, 0.8759980797767639, -1.0322070121765137, 0.8639916777610779, 0.7564710378646851, 0.7226774096488953, 0.2583223581314087, 0.8504505157470703, -1.257388710975647, -1.0157921314239502, -0.800605058670044, -0.6767722964286804, 1.9696131944656372, -0.23160101473331451, 0.5522320866584778, -0.25586235523223877, -1.2442890405654907, -0.06360559165477753, 0.6724557876586914, 0.4596535563468933, -0.43661099672317505, 0.7657507061958313, -0.6051309108734131, -1.1130820512771606, -1.2549649477005005, -0.4056357741355896, -1.0408203601837158, -0.9224287867546082, 1.095947504043579, 0.7711902856826782, 0.37184977531433105, 1.8782289028167725, 0.6159118413925171, 0.18913158774375916, -2.580761671066284, 0.9377878904342651, 0.29024356603622437, -0.13215908408164978, 0.8225653171539307, 0.3780742883682251, 1.1246106624603271, 0.09690772742033005, 0.4723120331764221, -2.4668288230895996, 2.2970571517944336, -0.15259772539138794, 0.6155586838722229, 0.052517831325531006, -0.10368102043867111, 1.1777172088623047, 0.6498652100563049, 0.5352209806442261, -1.0242369174957275, 0.6951568722724915, -0.5536007285118103, 1.2890526056289673, 0.8110165596008301, -0.7486037611961365, -0.018434975296258926, 1.3547202348709106, 0.42187219858169556, -0.5691019296646118, -0.9728151559829712, -0.9016975164413452, 0.9655475616455078, 1.7206593751907349, -0.08114920556545258, -0.054915424436330795, 0.721206784248352, 0.7234201431274414, -1.250219464302063, 0.028060588985681534, -0.7378223538398743, -0.813932478427887, 1.6218000650405884, 2.0761077404022217, -0.21453000605106354, -0.15286199748516083, -0.7294376492500305, -1.2708498239517212, 0.8983981013298035, -0.10095410794019699, 0.16864143311977386, 0.6516170501708984, -0.5802074074745178, 1.0717825889587402, 0.8237237930297852, 0.8897423148155212, 0.1860794574022293, 0.26648378372192383, 0.3648306727409363, -0.3436196446418762, -1.0897026062011719, -0.22714097797870636, -1.102874517440796, -2.539562225341797, 0.39363205432891846, -0.20898988842964172, -1.3625482320785522, -0.0409708209335804, -0.9928081035614014, 0.9514351487159729, -0.585145115852356, -1.047162413597107, -1.5745065212249756, 0.2068277895450592, -0.028307350352406502, 0.9896652698516846, -1.6462849378585815, -0.13387331366539001, 1.1380969285964966, 0.7603046298027039, -0.6501918435096741, 1.0221754312515259, 0.23487965762615204, 0.9798087477684021, 0.8120247721672058, -0.35541290044784546, 0.5329022407531738, 0.03359796479344368, -1.3237481117248535, 0.5048353672027588, 1.2437241077423096, 0.11986710131168365, 1.476027011871338, -0.4786192774772644, 0.0375354066491127, 0.3565974831581116, -0.5253197550773621, -0.4898095726966858, -0.42068707942962646, 0.612031102180481, 0.01548803225159645, -0.9581257700920105, 0.031420692801475525, -0.10376613587141037, -0.3059614896774292, 0.33072179555892944, -1.4647048711776733, -0.15451961755752563, -0.4547736644744873, -0.5549842715263367, -1.2311235666275024, -0.028103122487664223, 1.456040382385254, -0.6435654759407043, -0.18622161448001862, 0.4277914762496948, 0.304446280002594, 0.5169821381568909, 0.7239847779273987, -0.6849845051765442, -0.34260129928588867, -0.2777342200279236, -0.3136900067329407, 0.30253857374191284, 1.2917406558990479, -0.17436622083187103, -0.9247771501541138, 0.6525057554244995, -0.29141849279403687, 0.05439694970846176, 1.9849447011947632, 0.15347778797149658, -0.7241231203079224, 0.33804500102996826, -0.7548670768737793, 1.9580594301223755, 1.730323076248169, 1.314848780632019, -0.17076176404953003, -0.9768242239952087, 0.5959305167198181, -0.3626864552497864, -0.4511834383010864, 0.8474853038787842, 0.3182803988456726, -0.29593002796173096, -1.414816975593567, 0.6583751440048218, 1.3209031820297241, -0.8111387491226196, -0.8670996427536011, 0.18100975453853607, -0.7900038957595825, 1.1252195835113525, 0.6322807669639587, 0.4484104514122009, 0.3005497455596924, 1.5846872329711914, 0.7266139388084412, -0.5485232472419739, 0.5108319520950317, 0.4752877354621887, -0.1334250271320343, -2.0494132041931152, -1.229480266571045, 0.3294757604598999, -0.6148508191108704, -1.6032174825668335, 1.4095466136932373, -1.1377946138381958, -1.0353411436080933, 0.6312301158905029, 0.11091785877943039, 1.3904681205749512, 0.3424155116081238, 1.6499841213226318, 2.0471532344818115, 0.868199348449707, 0.3945057988166809, 1.2419408559799194, -0.1762726753950119, -0.5211751461029053, 1.8349246978759766, -0.42539072036743164, 0.4428352117538452, 1.1309292316436768, -0.32458359003067017, -1.0792752504348755, -0.7781350612640381, -1.1543140411376953, -0.7079215049743652, 1.1385999917984009, 0.13184261322021484, -1.09017014503479, 0.1824728101491928, 1.6527636051177979, 0.055685631930828094, -0.36399465799331665, 0.6970903873443604, 0.4110146164894104, -0.9054844975471497, -0.09382147341966629, -0.9411347508430481, 0.5025455355644226, -0.23142006993293762, -0.2672550082206726, 0.31641584634780884, 0.5520159006118774, 1.3377156257629395, -0.03416261449456215, 0.16222454607486725, 1.0992717742919922, -1.4365440607070923, 1.4693269729614258, -0.646956205368042, 0.3217877745628357, -2.369053840637207, 1.4002525806427002, -0.6623741984367371, 1.9908705949783325, -2.652068614959717, 0.356325626373291, -0.6367565393447876, -0.4924353361129761, 0.22386431694030762, -0.361045777797699, 0.20832188427448273, -0.10145082324743271, -1.1445138454437256, 0.03716936707496643, -0.7328140139579773, 0.5593915581703186, 1.1155352592468262, 1.4099863767623901, -1.18272864818573, -0.29040318727493286, -1.6945980787277222, -0.17162591218948364, -0.7103679776191711, 0.29885566234588623, -2.003530263900757, -0.22495904564857483, -1.9261176586151123, -2.262002944946289, -1.3545759916305542, -0.8994823098182678, 1.0988881587982178, 0.13710275292396545, -0.9114202857017517, 1.1796938180923462, -0.40551167726516724, -1.7878646850585938, 1.1531827449798584, -2.0933990478515625 ]
https://github.com/huggingface/datasets/issues/4394
trainer became extremely slow after reload dataset by `load_from_disk`
I changed ``` tokenized_datasets = load_from_disk( "/pathto/dataset" ) ``` to ``` tokenized_datasets = load_from_disk( "/pathto/dataset", keep_in_memory=True ) ``` and obtained normal speed. It's seems that the problem is on the os's speed limit.
## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ```
748
33
trainer became extremely slow after reload dataset by `load_from_disk` ## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ``` I changed ``` tokenized_datasets = load_from_disk( "/pathto/dataset" ) ``` to ``` tokenized_datasets = load_from_disk( "/pathto/dataset", keep_in_memory=True ) ``` and obtained normal speed. It's seems that the problem is on the os's speed limit.
[ -1.2635666131973267, -0.9664938449859619, -0.7665697336196899, 1.4278571605682373, -0.2425231784582138, -1.2443581819534302, 0.1611049920320511, -1.173553228378296, 1.627939224243164, -0.79868084192276, 0.25672364234924316, -1.6494767665863037, 0.0742473304271698, -0.5696834325790405, -0.7419762015342712, -0.8712430596351624, -0.3959881663322449, -0.8276002407073975, 1.1123402118682861, 2.4565823078155518, 1.1895809173583984, -1.4257380962371826, 2.6996665000915527, 0.6839629411697388, -0.25364410877227783, -1.0260924100875854, 0.4903641939163208, 0.11088471114635468, -1.2048099040985107, -0.43253690004348755, -0.8575772643089294, -0.07679221779108047, -0.6287283897399902, -0.46593648195266724, 0.0474066399037838, 0.4117501378059387, -0.2565525770187378, -0.37536758184432983, -0.5234019756317139, -0.6823866963386536, 0.4967089295387268, -0.3564761281013489, 0.9234473705291748, -0.30978715419769287, 1.7722944021224976, -0.6785880923271179, 0.4837760925292969, 0.71225905418396, 1.2254095077514648, 0.20471596717834473, 0.0013971924781799316, 0.28206580877304077, 0.39036232233047485, -0.06669790297746658, 0.4907982349395752, 1.1261649131774902, 0.6613450050354004, 0.5065482258796692, 0.7897656559944153, -2.1347780227661133, 1.3078452348709106, -1.0394011735916138, 0.41551393270492554, 1.3993632793426514, -0.9401551485061646, 0.43140333890914917, -1.775482177734375, -0.05854741483926773, 0.6402349472045898, -2.2056477069854736, 0.3113816976547241, -1.324613332748413, -0.6343154311180115, 0.9828763008117676, 0.3201545476913452, -1.2092881202697754, 0.15567363798618317, -0.5021933913230896, 1.0633296966552734, 0.3958689570426941, 1.1097815036773682, -1.6952574253082275, -0.09642120450735092, -0.21910886466503143, 0.10643672943115234, -1.3996965885162354, -1.5493367910385132, 0.6583179235458374, 0.5597317814826965, 0.5565009713172913, -0.12944528460502625, 0.9837348461151123, -1.0105621814727783, 0.8122264742851257, -1.0538734197616577, -1.6591155529022217, -1.4333279132843018, -2.313246250152588, -2.221510410308838, 0.7076055407524109, -0.528818666934967, -0.5907738208770752, 2.0742299556732178, -0.9795790910720825, -1.6451467275619507, 1.18022620677948, 0.32135075330734253, -0.0044914367608726025, 2.4328389167785645, 0.24512584507465363, -0.6563429236412048, 0.4652624726295471, -0.8806216716766357, 0.7205933928489685, -0.37531566619873047, 1.3300949335098267, 0.42437928915023804, -0.9941132068634033, 1.545865774154663, -0.40309637784957886, 0.6298642754554749, -0.7125284075737, -0.5733972787857056, -0.7973356246948242, 0.292998731136322, 1.920204997062683, -0.23067501187324524, 1.5072243213653564, -0.3733118176460266, -1.5992777347564697, -1.5468295812606812, 0.8937689661979675, 0.4814532995223999, -0.8235183954238892, 0.2055196911096573, -0.41118282079696655, 0.17883767187595367, -0.05730292201042175, 1.1255406141281128, 1.3061738014221191, 0.719225287437439, -0.3980885148048401, -0.8862772583961487, 0.16308338940143585, -0.13833972811698914, -0.7808759808540344, -1.879180908203125, -0.37091511487960815, 0.041208501905202866, 0.7203274369239807, -1.221016526222229, 1.7047719955444336, 0.8909240961074829, 1.905212640762329, 1.0245836973190308, -0.4722304940223694, 1.3465560674667358, 0.05991852283477783, 1.8050752878189087, -0.5821536183357239, 0.7129122614860535, -0.3775220513343811, -1.1171488761901855, 0.9559362530708313, -0.2843090891838074, -2.025240182876587, -0.7541293501853943, -0.8254588842391968, -0.19933772087097168, -0.7960374355316162, 0.8649311661720276, -0.2705724239349365, -1.5048425197601318, 0.3115934133529663, -0.6674646735191345, 0.21685560047626495, -1.221019983291626, 0.3448256254196167, 0.6343002319335938, -0.5502873659133911, 0.003313138149678707, -0.2599036693572998, -1.2681025266647339, -0.5369595885276794, 0.25153493881225586, 1.9070850610733032, -0.8053762912750244, 0.9813344478607178, 1.0559831857681274, -0.6590189337730408, -0.030357781797647476, 0.33015209436416626, -0.3037596344947815, 0.8336626291275024, -1.1097930669784546, -0.5117608308792114, 1.1275521516799927, -0.18879783153533936, -0.5157275199890137, 1.539884090423584, 0.7918153405189514, -1.0321967601776123, -0.23276738822460175, -0.21330951154232025, -0.84342360496521, 0.049932338297367096, -1.603679895401001, -0.13258926570415497, 0.4165616035461426, -1.5750995874404907, -0.5039754509925842, -0.1717752069234848, 1.3540327548980713, -0.22189924120903015, 1.4026750326156616, -0.38267964124679565, -0.2058759182691574, -0.3335579037666321, -0.35426199436187744, 0.2003554403781891, -0.22850258648395538, -0.5400823950767517, 0.16486668586730957, -0.8285292983055115, 0.30605125427246094, 1.4716957807540894, 0.33782416582107544, 0.07370582222938538, 0.4222625494003296, 1.064975619316101, 0.3415486812591553, 0.0021420782431960106, -0.8787394762039185, -1.5104566812515259, 1.9694663286209106, -1.5689338445663452, 2.028611660003662, 0.7768185138702393, -0.0650353729724884, -1.6524760723114014, -1.8658965826034546, 1.3425308465957642, 1.2121179103851318, 2.3658511638641357, 0.5649216175079346, 0.3317711353302002, -0.8295850157737732, -0.7054383158683777, 0.16685938835144043, -1.0474046468734741, -0.7049107551574707, 0.14748430252075195, 2.415879487991333, 1.7712230682373047, -0.5077150464057922, -0.08592721074819565, -0.9359625577926636, 1.4227734804153442, -0.20189687609672546, 0.26075780391693115, 2.032135009765625, -0.2906377911567688, -1.0530904531478882, 1.3034601211547852, -2.365598678588867, 0.15451204776763916, 1.9987989664077759, 0.29332220554351807, 0.0986548513174057, -1.2825509309768677, -0.5857897996902466, -0.39612656831741333, -0.44196826219558716, -1.2051838636398315, 0.49683427810668945, -0.19407512247562408, -0.7489386796951294, -1.45970618724823, 0.1493394821882248, -1.1637483835220337, -1.6579375267028809, 0.2775866985321045, 1.8766815662384033, 2.11716890335083, -0.7746111750602722, 1.5352052450180054, -0.43183761835098267, 0.1111312136054039, 1.2408069372177124, 1.2968558073043823, 3.062814712524414, 1.88592529296875, -1.2997952699661255, 0.6380833387374878, -0.17277897894382477, -0.5564365983009338, 1.1162654161453247, -1.1286650896072388, 1.2222808599472046, -0.12580442428588867, -1.1497935056686401, -1.2695618867874146, 1.0315215587615967, 0.5120494961738586, 0.09769118577241898, -0.5095610022544861, 1.1838055849075317, 0.06007087975740433, 1.4089769124984741, 0.507590115070343, -0.3174954652786255, 0.552624523639679, -0.43791627883911133, -0.46489542722702026, 1.6303513050079346, 0.1407897025346756, -1.4672341346740723, -2.3256988525390625, -0.3001067638397217, -0.8885358572006226, 0.04104778543114662, -0.6762688755989075, -1.0766628980636597, 1.6364394426345825, 0.37538856267929077, -1.2711864709854126, -0.3102007508277893, -0.23068493604660034, -0.6345463991165161, 2.6455137729644775, -1.373556137084961, -0.2219964563846588, -0.9302324652671814, -0.6407244801521301, 1.658880591392517, -1.2242544889450073, -0.24091631174087524, -1.0435479879379272, -0.5679293870925903, -1.197903037071228, -0.4515313506126404, 0.006173774600028992, -1.0457841157913208, 0.8357863426208496, 0.11724688112735748, -1.188279151916504, -0.34581631422042847, -0.8180503249168396, 0.9134239554405212, -0.09755541384220123, 0.25525766611099243, 1.7915772199630737, 0.2936245799064636, -0.3695102334022522, 0.7087831497192383, 1.1927015781402588, 0.6465712189674377, -0.7512306571006775, 0.07419564574956894, -0.6468588709831238, 0.37774598598480225, -1.2092010974884033, 0.29869115352630615, -2.9217052459716797, 0.6698604226112366, -0.0050506857223808765, 0.03216657415032387, -0.015908975154161453, -1.2967571020126343, 1.1441888809204102, 2.6578385829925537, -1.0870954990386963, 0.4865981936454773, 0.37134701013565063, 1.1925381422042847, -1.6067708730697632, 0.3056948184967041, -0.40518081188201904, 2.1130449771881104, 0.17234483361244202, 1.2894421815872192, -0.4544488191604614, -2.329920530319214, 0.5971026420593262, -1.2021586894989014, -1.1654388904571533, 0.760444700717926, -0.8316299915313721, 0.16879236698150635, -1.5172618627548218, -0.2691102623939514, -0.9128796458244324, -1.152445912361145, 0.6420978903770447, 0.12679412961006165, 0.39376312494277954, -0.6415957808494568, 0.3194372057914734, -2.229034662246704, -1.3629419803619385, -0.15005415678024292, -0.9372519254684448, 0.5620288252830505, -0.4305422902107239, 0.7125293612480164, -0.05405256897211075, 0.07658691704273224, 0.3751993179321289, 1.475351095199585, 3.3425815105438232, 0.24938876926898956, 0.320468008518219, -0.18024954199790955, -0.8835642337799072, 1.4247419834136963, 0.9037259221076965, -0.03400490805506706, -0.5275049209594727, -1.0301917791366577, 1.261226773262024, 1.971776008605957, 1.0106723308563232, -0.008448698557913303, -0.7907979488372803, -0.6139947772026062, -0.08449681848287582, 0.2101704478263855, 0.42454594373703003, 0.9460042119026184, 0.029321353882551193, 0.08059509098529816, 1.425718903541565, 1.163035273551941, -0.5188658833503723, 0.36813896894454956, -0.8888987898826599, -0.48929542303085327, 0.4753815531730652, 0.30425548553466797, -0.019740846008062363, 0.36269426345825195, -1.0082122087478638, -0.17862190306186676, -0.3179197311401367, -0.8331090211868286, -0.6760469675064087, -0.3854942321777344, -0.4046483635902405, 1.5561169385910034, 0.0643242672085762, -0.4642617106437683, -0.02837272733449936, -0.7951618432998657, -0.010158458724617958, -1.1696397066116333, 0.17379800975322723, -0.16424116492271423, -0.11296730488538742, -0.164652019739151, 1.7428826093673706, -0.8595350980758667, -1.999144434928894, 0.17830759286880493, 0.3242945075035095, -0.3489353656768799, 0.18692967295646667, 1.7159690856933594, 0.5717059969902039, 1.4799615144729614, 1.2585344314575195, 0.9899469017982483, -0.6483384370803833, -1.2904424667358398, 0.6782885789871216, 0.9873192310333252, -1.3147671222686768, 0.8497053980827332, -0.04578689858317375, -0.45553451776504517, 0.6149465441703796, 1.3280378580093384, 0.48555803298950195, -2.0647902488708496, 0.8759980797767639, -1.0322070121765137, 0.8639916777610779, 0.7564710378646851, 0.7226774096488953, 0.2583223581314087, 0.8504505157470703, -1.257388710975647, -1.0157921314239502, -0.800605058670044, -0.6767722964286804, 1.9696131944656372, -0.23160101473331451, 0.5522320866584778, -0.25586235523223877, -1.2442890405654907, -0.06360559165477753, 0.6724557876586914, 0.4596535563468933, -0.43661099672317505, 0.7657507061958313, -0.6051309108734131, -1.1130820512771606, -1.2549649477005005, -0.4056357741355896, -1.0408203601837158, -0.9224287867546082, 1.095947504043579, 0.7711902856826782, 0.37184977531433105, 1.8782289028167725, 0.6159118413925171, 0.18913158774375916, -2.580761671066284, 0.9377878904342651, 0.29024356603622437, -0.13215908408164978, 0.8225653171539307, 0.3780742883682251, 1.1246106624603271, 0.09690772742033005, 0.4723120331764221, -2.4668288230895996, 2.2970571517944336, -0.15259772539138794, 0.6155586838722229, 0.052517831325531006, -0.10368102043867111, 1.1777172088623047, 0.6498652100563049, 0.5352209806442261, -1.0242369174957275, 0.6951568722724915, -0.5536007285118103, 1.2890526056289673, 0.8110165596008301, -0.7486037611961365, -0.018434975296258926, 1.3547202348709106, 0.42187219858169556, -0.5691019296646118, -0.9728151559829712, -0.9016975164413452, 0.9655475616455078, 1.7206593751907349, -0.08114920556545258, -0.054915424436330795, 0.721206784248352, 0.7234201431274414, -1.250219464302063, 0.028060588985681534, -0.7378223538398743, -0.813932478427887, 1.6218000650405884, 2.0761077404022217, -0.21453000605106354, -0.15286199748516083, -0.7294376492500305, -1.2708498239517212, 0.8983981013298035, -0.10095410794019699, 0.16864143311977386, 0.6516170501708984, -0.5802074074745178, 1.0717825889587402, 0.8237237930297852, 0.8897423148155212, 0.1860794574022293, 0.26648378372192383, 0.3648306727409363, -0.3436196446418762, -1.0897026062011719, -0.22714097797870636, -1.102874517440796, -2.539562225341797, 0.39363205432891846, -0.20898988842964172, -1.3625482320785522, -0.0409708209335804, -0.9928081035614014, 0.9514351487159729, -0.585145115852356, -1.047162413597107, -1.5745065212249756, 0.2068277895450592, -0.028307350352406502, 0.9896652698516846, -1.6462849378585815, -0.13387331366539001, 1.1380969285964966, 0.7603046298027039, -0.6501918435096741, 1.0221754312515259, 0.23487965762615204, 0.9798087477684021, 0.8120247721672058, -0.35541290044784546, 0.5329022407531738, 0.03359796479344368, -1.3237481117248535, 0.5048353672027588, 1.2437241077423096, 0.11986710131168365, 1.476027011871338, -0.4786192774772644, 0.0375354066491127, 0.3565974831581116, -0.5253197550773621, -0.4898095726966858, -0.42068707942962646, 0.612031102180481, 0.01548803225159645, -0.9581257700920105, 0.031420692801475525, -0.10376613587141037, -0.3059614896774292, 0.33072179555892944, -1.4647048711776733, -0.15451961755752563, -0.4547736644744873, -0.5549842715263367, -1.2311235666275024, -0.028103122487664223, 1.456040382385254, -0.6435654759407043, -0.18622161448001862, 0.4277914762496948, 0.304446280002594, 0.5169821381568909, 0.7239847779273987, -0.6849845051765442, -0.34260129928588867, -0.2777342200279236, -0.3136900067329407, 0.30253857374191284, 1.2917406558990479, -0.17436622083187103, -0.9247771501541138, 0.6525057554244995, -0.29141849279403687, 0.05439694970846176, 1.9849447011947632, 0.15347778797149658, -0.7241231203079224, 0.33804500102996826, -0.7548670768737793, 1.9580594301223755, 1.730323076248169, 1.314848780632019, -0.17076176404953003, -0.9768242239952087, 0.5959305167198181, -0.3626864552497864, -0.4511834383010864, 0.8474853038787842, 0.3182803988456726, -0.29593002796173096, -1.414816975593567, 0.6583751440048218, 1.3209031820297241, -0.8111387491226196, -0.8670996427536011, 0.18100975453853607, -0.7900038957595825, 1.1252195835113525, 0.6322807669639587, 0.4484104514122009, 0.3005497455596924, 1.5846872329711914, 0.7266139388084412, -0.5485232472419739, 0.5108319520950317, 0.4752877354621887, -0.1334250271320343, -2.0494132041931152, -1.229480266571045, 0.3294757604598999, -0.6148508191108704, -1.6032174825668335, 1.4095466136932373, -1.1377946138381958, -1.0353411436080933, 0.6312301158905029, 0.11091785877943039, 1.3904681205749512, 0.3424155116081238, 1.6499841213226318, 2.0471532344818115, 0.868199348449707, 0.3945057988166809, 1.2419408559799194, -0.1762726753950119, -0.5211751461029053, 1.8349246978759766, -0.42539072036743164, 0.4428352117538452, 1.1309292316436768, -0.32458359003067017, -1.0792752504348755, -0.7781350612640381, -1.1543140411376953, -0.7079215049743652, 1.1385999917984009, 0.13184261322021484, -1.09017014503479, 0.1824728101491928, 1.6527636051177979, 0.055685631930828094, -0.36399465799331665, 0.6970903873443604, 0.4110146164894104, -0.9054844975471497, -0.09382147341966629, -0.9411347508430481, 0.5025455355644226, -0.23142006993293762, -0.2672550082206726, 0.31641584634780884, 0.5520159006118774, 1.3377156257629395, -0.03416261449456215, 0.16222454607486725, 1.0992717742919922, -1.4365440607070923, 1.4693269729614258, -0.646956205368042, 0.3217877745628357, -2.369053840637207, 1.4002525806427002, -0.6623741984367371, 1.9908705949783325, -2.652068614959717, 0.356325626373291, -0.6367565393447876, -0.4924353361129761, 0.22386431694030762, -0.361045777797699, 0.20832188427448273, -0.10145082324743271, -1.1445138454437256, 0.03716936707496643, -0.7328140139579773, 0.5593915581703186, 1.1155352592468262, 1.4099863767623901, -1.18272864818573, -0.29040318727493286, -1.6945980787277222, -0.17162591218948364, -0.7103679776191711, 0.29885566234588623, -2.003530263900757, -0.22495904564857483, -1.9261176586151123, -2.262002944946289, -1.3545759916305542, -0.8994823098182678, 1.0988881587982178, 0.13710275292396545, -0.9114202857017517, 1.1796938180923462, -0.40551167726516724, -1.7878646850585938, 1.1531827449798584, -2.0933990478515625 ]
https://github.com/huggingface/datasets/issues/4394
trainer became extremely slow after reload dataset by `load_from_disk`
Hi ! Currently `save_to_disk` saves one big Arrow file, which causes some slow downs. This has been discussed in #3735 and we'll implement sharding pretty soon to solve this For now you can try splitting and saving your dataset in several Arrow files. Then you can load them one by one and use `concatenate_datasets` to have your big dataset again and hopefully with a better speed
## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ```
748
66
trainer became extremely slow after reload dataset by `load_from_disk` ## Describe the bug Due to memory problem, I need to save my tokenized datasets locally by CPU and reload it by multi GPU for running training script. However, after I reload it by `load_from_disk` and start training, the speed is extremely slow. It says I need about 1500 hours with 8 A100 cards. Before this, I can run the whole script in one day with a single A100 card. Since I am try to pre-train a BERT, **my dataset is very large(29058165 rows)** ## Steps to reproduce the bug ```python tokenized_datasets.save_to_disk( "/pathto/dataset" ) tokenized_datasets = load_from_disk( "/pathto/dataset" ) trainer = Trainer( model=model, args=training_args, train_dataset=tokenized_datasets["train"] if training_args.do_train else None, eval_dataset=tokenized_datasets["validation"] if training_args.do_eval else None, tokenizer=tokenizer, data_collator=data_collator, ) train_result = trainer.train(resume_from_checkpoint=checkpoint) ``` ## Expected results Without the save and reload process, I only need about one day to run the whole script with one A100 card. ## Actual results ``` [INFO|trainer.py:1290] 2022-05-23 22:49:46,266 >> ***** Running training ***** [INFO|trainer.py:1291] 2022-05-23 22:49:46,266 >> Num examples = 29058165 [INFO|trainer.py:1292] 2022-05-23 22:49:46,266 >> Num Epochs = 5 [INFO|trainer.py:1293] 2022-05-23 22:49:46,266 >> Instantaneous batch size per device = 16 [INFO|trainer.py:1294] 2022-05-23 22:49:46,266 >> Total train batch size (w. parallel, distributed & accumulation) = 256 [INFO|trainer.py:1295] 2022-05-23 22:49:46,266 >> Gradient Accumulation steps = 2 [INFO|trainer.py:1296] 2022-05-23 22:49:46,266 >> Total optimization steps = 567540 0%| | 1/567540 [00:09<1544:49:04, 9.80s/it] 0%| | 2/567540 [00:17<1320:00:17, 8.37s/it] 0%| | 3/567540 [00:26<1393:10:17, 8.84s/it] 0%| | 4/567540 [00:34<1344:56:33, 8.53s/it] 0%| | 5/567540 [00:43<1359:36:12, 8.62s/it] ``` ## Environment info ``` torch 1.11.0+cu113 torchaudio 0.11.0+cu113 torchvision 0.12.0+cu113 transformers 4.18.0 datasets 2.2.2 ``` Hi ! Currently `save_to_disk` saves one big Arrow file, which causes some slow downs. This has been discussed in #3735 and we'll implement sharding pretty soon to solve this For now you can try splitting and saving your dataset in several Arrow files. Then you can load them one by one and use `concatenate_datasets` to have your big dataset again and hopefully with a better speed
[ -1.2635666131973267, -0.9664938449859619, -0.7665697336196899, 1.4278571605682373, -0.2425231784582138, -1.2443581819534302, 0.1611049920320511, -1.173553228378296, 1.627939224243164, -0.79868084192276, 0.25672364234924316, -1.6494767665863037, 0.0742473304271698, -0.5696834325790405, -0.7419762015342712, -0.8712430596351624, -0.3959881663322449, -0.8276002407073975, 1.1123402118682861, 2.4565823078155518, 1.1895809173583984, -1.4257380962371826, 2.6996665000915527, 0.6839629411697388, -0.25364410877227783, -1.0260924100875854, 0.4903641939163208, 0.11088471114635468, -1.2048099040985107, -0.43253690004348755, -0.8575772643089294, -0.07679221779108047, -0.6287283897399902, -0.46593648195266724, 0.0474066399037838, 0.4117501378059387, -0.2565525770187378, -0.37536758184432983, -0.5234019756317139, -0.6823866963386536, 0.4967089295387268, -0.3564761281013489, 0.9234473705291748, -0.30978715419769287, 1.7722944021224976, -0.6785880923271179, 0.4837760925292969, 0.71225905418396, 1.2254095077514648, 0.20471596717834473, 0.0013971924781799316, 0.28206580877304077, 0.39036232233047485, -0.06669790297746658, 0.4907982349395752, 1.1261649131774902, 0.6613450050354004, 0.5065482258796692, 0.7897656559944153, -2.1347780227661133, 1.3078452348709106, -1.0394011735916138, 0.41551393270492554, 1.3993632793426514, -0.9401551485061646, 0.43140333890914917, -1.775482177734375, -0.05854741483926773, 0.6402349472045898, -2.2056477069854736, 0.3113816976547241, -1.324613332748413, -0.6343154311180115, 0.9828763008117676, 0.3201545476913452, -1.2092881202697754, 0.15567363798618317, -0.5021933913230896, 1.0633296966552734, 0.3958689570426941, 1.1097815036773682, -1.6952574253082275, -0.09642120450735092, -0.21910886466503143, 0.10643672943115234, -1.3996965885162354, -1.5493367910385132, 0.6583179235458374, 0.5597317814826965, 0.5565009713172913, -0.12944528460502625, 0.9837348461151123, -1.0105621814727783, 0.8122264742851257, -1.0538734197616577, -1.6591155529022217, -1.4333279132843018, -2.313246250152588, -2.221510410308838, 0.7076055407524109, -0.528818666934967, -0.5907738208770752, 2.0742299556732178, -0.9795790910720825, -1.6451467275619507, 1.18022620677948, 0.32135075330734253, -0.0044914367608726025, 2.4328389167785645, 0.24512584507465363, -0.6563429236412048, 0.4652624726295471, -0.8806216716766357, 0.7205933928489685, -0.37531566619873047, 1.3300949335098267, 0.42437928915023804, -0.9941132068634033, 1.545865774154663, -0.40309637784957886, 0.6298642754554749, -0.7125284075737, -0.5733972787857056, -0.7973356246948242, 0.292998731136322, 1.920204997062683, -0.23067501187324524, 1.5072243213653564, -0.3733118176460266, -1.5992777347564697, -1.5468295812606812, 0.8937689661979675, 0.4814532995223999, -0.8235183954238892, 0.2055196911096573, -0.41118282079696655, 0.17883767187595367, -0.05730292201042175, 1.1255406141281128, 1.3061738014221191, 0.719225287437439, -0.3980885148048401, -0.8862772583961487, 0.16308338940143585, -0.13833972811698914, -0.7808759808540344, -1.879180908203125, -0.37091511487960815, 0.041208501905202866, 0.7203274369239807, -1.221016526222229, 1.7047719955444336, 0.8909240961074829, 1.905212640762329, 1.0245836973190308, -0.4722304940223694, 1.3465560674667358, 0.05991852283477783, 1.8050752878189087, -0.5821536183357239, 0.7129122614860535, -0.3775220513343811, -1.1171488761901855, 0.9559362530708313, -0.2843090891838074, -2.025240182876587, -0.7541293501853943, -0.8254588842391968, -0.19933772087097168, -0.7960374355316162, 0.8649311661720276, -0.2705724239349365, -1.5048425197601318, 0.3115934133529663, -0.6674646735191345, 0.21685560047626495, -1.221019983291626, 0.3448256254196167, 0.6343002319335938, -0.5502873659133911, 0.003313138149678707, -0.2599036693572998, -1.2681025266647339, -0.5369595885276794, 0.25153493881225586, 1.9070850610733032, -0.8053762912750244, 0.9813344478607178, 1.0559831857681274, -0.6590189337730408, -0.030357781797647476, 0.33015209436416626, -0.3037596344947815, 0.8336626291275024, -1.1097930669784546, -0.5117608308792114, 1.1275521516799927, -0.18879783153533936, -0.5157275199890137, 1.539884090423584, 0.7918153405189514, -1.0321967601776123, -0.23276738822460175, -0.21330951154232025, -0.84342360496521, 0.049932338297367096, -1.603679895401001, -0.13258926570415497, 0.4165616035461426, -1.5750995874404907, -0.5039754509925842, -0.1717752069234848, 1.3540327548980713, -0.22189924120903015, 1.4026750326156616, -0.38267964124679565, -0.2058759182691574, -0.3335579037666321, -0.35426199436187744, 0.2003554403781891, -0.22850258648395538, -0.5400823950767517, 0.16486668586730957, -0.8285292983055115, 0.30605125427246094, 1.4716957807540894, 0.33782416582107544, 0.07370582222938538, 0.4222625494003296, 1.064975619316101, 0.3415486812591553, 0.0021420782431960106, -0.8787394762039185, -1.5104566812515259, 1.9694663286209106, -1.5689338445663452, 2.028611660003662, 0.7768185138702393, -0.0650353729724884, -1.6524760723114014, -1.8658965826034546, 1.3425308465957642, 1.2121179103851318, 2.3658511638641357, 0.5649216175079346, 0.3317711353302002, -0.8295850157737732, -0.7054383158683777, 0.16685938835144043, -1.0474046468734741, -0.7049107551574707, 0.14748430252075195, 2.415879487991333, 1.7712230682373047, -0.5077150464057922, -0.08592721074819565, -0.9359625577926636, 1.4227734804153442, -0.20189687609672546, 0.26075780391693115, 2.032135009765625, -0.2906377911567688, -1.0530904531478882, 1.3034601211547852, -2.365598678588867, 0.15451204776763916, 1.9987989664077759, 0.29332220554351807, 0.0986548513174057, -1.2825509309768677, -0.5857897996902466, -0.39612656831741333, -0.44196826219558716, -1.2051838636398315, 0.49683427810668945, -0.19407512247562408, -0.7489386796951294, -1.45970618724823, 0.1493394821882248, -1.1637483835220337, -1.6579375267028809, 0.2775866985321045, 1.8766815662384033, 2.11716890335083, -0.7746111750602722, 1.5352052450180054, -0.43183761835098267, 0.1111312136054039, 1.2408069372177124, 1.2968558073043823, 3.062814712524414, 1.88592529296875, -1.2997952699661255, 0.6380833387374878, -0.17277897894382477, -0.5564365983009338, 1.1162654161453247, -1.1286650896072388, 1.2222808599472046, -0.12580442428588867, -1.1497935056686401, -1.2695618867874146, 1.0315215587615967, 0.5120494961738586, 0.09769118577241898, -0.5095610022544861, 1.1838055849075317, 0.06007087975740433, 1.4089769124984741, 0.507590115070343, -0.3174954652786255, 0.552624523639679, -0.43791627883911133, -0.46489542722702026, 1.6303513050079346, 0.1407897025346756, -1.4672341346740723, -2.3256988525390625, -0.3001067638397217, -0.8885358572006226, 0.04104778543114662, -0.6762688755989075, -1.0766628980636597, 1.6364394426345825, 0.37538856267929077, -1.2711864709854126, -0.3102007508277893, -0.23068493604660034, -0.6345463991165161, 2.6455137729644775, -1.373556137084961, -0.2219964563846588, -0.9302324652671814, -0.6407244801521301, 1.658880591392517, -1.2242544889450073, -0.24091631174087524, -1.0435479879379272, -0.5679293870925903, -1.197903037071228, -0.4515313506126404, 0.006173774600028992, -1.0457841157913208, 0.8357863426208496, 0.11724688112735748, -1.188279151916504, -0.34581631422042847, -0.8180503249168396, 0.9134239554405212, -0.09755541384220123, 0.25525766611099243, 1.7915772199630737, 0.2936245799064636, -0.3695102334022522, 0.7087831497192383, 1.1927015781402588, 0.6465712189674377, -0.7512306571006775, 0.07419564574956894, -0.6468588709831238, 0.37774598598480225, -1.2092010974884033, 0.29869115352630615, -2.9217052459716797, 0.6698604226112366, -0.0050506857223808765, 0.03216657415032387, -0.015908975154161453, -1.2967571020126343, 1.1441888809204102, 2.6578385829925537, -1.0870954990386963, 0.4865981936454773, 0.37134701013565063, 1.1925381422042847, -1.6067708730697632, 0.3056948184967041, -0.40518081188201904, 2.1130449771881104, 0.17234483361244202, 1.2894421815872192, -0.4544488191604614, -2.329920530319214, 0.5971026420593262, -1.2021586894989014, -1.1654388904571533, 0.760444700717926, -0.8316299915313721, 0.16879236698150635, -1.5172618627548218, -0.2691102623939514, -0.9128796458244324, -1.152445912361145, 0.6420978903770447, 0.12679412961006165, 0.39376312494277954, -0.6415957808494568, 0.3194372057914734, -2.229034662246704, -1.3629419803619385, -0.15005415678024292, -0.9372519254684448, 0.5620288252830505, -0.4305422902107239, 0.7125293612480164, -0.05405256897211075, 0.07658691704273224, 0.3751993179321289, 1.475351095199585, 3.3425815105438232, 0.24938876926898956, 0.320468008518219, -0.18024954199790955, -0.8835642337799072, 1.4247419834136963, 0.9037259221076965, -0.03400490805506706, -0.5275049209594727, -1.0301917791366577, 1.261226773262024, 1.971776008605957, 1.0106723308563232, -0.008448698557913303, -0.7907979488372803, -0.6139947772026062, -0.08449681848287582, 0.2101704478263855, 0.42454594373703003, 0.9460042119026184, 0.029321353882551193, 0.08059509098529816, 1.425718903541565, 1.163035273551941, -0.5188658833503723, 0.36813896894454956, -0.8888987898826599, -0.48929542303085327, 0.4753815531730652, 0.30425548553466797, -0.019740846008062363, 0.36269426345825195, -1.0082122087478638, -0.17862190306186676, -0.3179197311401367, -0.8331090211868286, -0.6760469675064087, -0.3854942321777344, -0.4046483635902405, 1.5561169385910034, 0.0643242672085762, -0.4642617106437683, -0.02837272733449936, -0.7951618432998657, -0.010158458724617958, -1.1696397066116333, 0.17379800975322723, -0.16424116492271423, -0.11296730488538742, -0.164652019739151, 1.7428826093673706, -0.8595350980758667, -1.999144434928894, 0.17830759286880493, 0.3242945075035095, -0.3489353656768799, 0.18692967295646667, 1.7159690856933594, 0.5717059969902039, 1.4799615144729614, 1.2585344314575195, 0.9899469017982483, -0.6483384370803833, -1.2904424667358398, 0.6782885789871216, 0.9873192310333252, -1.3147671222686768, 0.8497053980827332, -0.04578689858317375, -0.45553451776504517, 0.6149465441703796, 1.3280378580093384, 0.48555803298950195, -2.0647902488708496, 0.8759980797767639, -1.0322070121765137, 0.8639916777610779, 0.7564710378646851, 0.7226774096488953, 0.2583223581314087, 0.8504505157470703, -1.257388710975647, -1.0157921314239502, -0.800605058670044, -0.6767722964286804, 1.9696131944656372, -0.23160101473331451, 0.5522320866584778, -0.25586235523223877, -1.2442890405654907, -0.06360559165477753, 0.6724557876586914, 0.4596535563468933, -0.43661099672317505, 0.7657507061958313, -0.6051309108734131, -1.1130820512771606, -1.2549649477005005, -0.4056357741355896, -1.0408203601837158, -0.9224287867546082, 1.095947504043579, 0.7711902856826782, 0.37184977531433105, 1.8782289028167725, 0.6159118413925171, 0.18913158774375916, -2.580761671066284, 0.9377878904342651, 0.29024356603622437, -0.13215908408164978, 0.8225653171539307, 0.3780742883682251, 1.1246106624603271, 0.09690772742033005, 0.4723120331764221, -2.4668288230895996, 2.2970571517944336, -0.15259772539138794, 0.6155586838722229, 0.052517831325531006, -0.10368102043867111, 1.1777172088623047, 0.6498652100563049, 0.5352209806442261, -1.0242369174957275, 0.6951568722724915, -0.5536007285118103, 1.2890526056289673, 0.8110165596008301, -0.7486037611961365, -0.018434975296258926, 1.3547202348709106, 0.42187219858169556, -0.5691019296646118, -0.9728151559829712, -0.9016975164413452, 0.9655475616455078, 1.7206593751907349, -0.08114920556545258, -0.054915424436330795, 0.721206784248352, 0.7234201431274414, -1.250219464302063, 0.028060588985681534, -0.7378223538398743, -0.813932478427887, 1.6218000650405884, 2.0761077404022217, -0.21453000605106354, -0.15286199748516083, -0.7294376492500305, -1.2708498239517212, 0.8983981013298035, -0.10095410794019699, 0.16864143311977386, 0.6516170501708984, -0.5802074074745178, 1.0717825889587402, 0.8237237930297852, 0.8897423148155212, 0.1860794574022293, 0.26648378372192383, 0.3648306727409363, -0.3436196446418762, -1.0897026062011719, -0.22714097797870636, -1.102874517440796, -2.539562225341797, 0.39363205432891846, -0.20898988842964172, -1.3625482320785522, -0.0409708209335804, -0.9928081035614014, 0.9514351487159729, -0.585145115852356, -1.047162413597107, -1.5745065212249756, 0.2068277895450592, -0.028307350352406502, 0.9896652698516846, -1.6462849378585815, -0.13387331366539001, 1.1380969285964966, 0.7603046298027039, -0.6501918435096741, 1.0221754312515259, 0.23487965762615204, 0.9798087477684021, 0.8120247721672058, -0.35541290044784546, 0.5329022407531738, 0.03359796479344368, -1.3237481117248535, 0.5048353672027588, 1.2437241077423096, 0.11986710131168365, 1.476027011871338, -0.4786192774772644, 0.0375354066491127, 0.3565974831581116, -0.5253197550773621, -0.4898095726966858, -0.42068707942962646, 0.612031102180481, 0.01548803225159645, -0.9581257700920105, 0.031420692801475525, -0.10376613587141037, -0.3059614896774292, 0.33072179555892944, -1.4647048711776733, -0.15451961755752563, -0.4547736644744873, -0.5549842715263367, -1.2311235666275024, -0.028103122487664223, 1.456040382385254, -0.6435654759407043, -0.18622161448001862, 0.4277914762496948, 0.304446280002594, 0.5169821381568909, 0.7239847779273987, -0.6849845051765442, -0.34260129928588867, -0.2777342200279236, -0.3136900067329407, 0.30253857374191284, 1.2917406558990479, -0.17436622083187103, -0.9247771501541138, 0.6525057554244995, -0.29141849279403687, 0.05439694970846176, 1.9849447011947632, 0.15347778797149658, -0.7241231203079224, 0.33804500102996826, -0.7548670768737793, 1.9580594301223755, 1.730323076248169, 1.314848780632019, -0.17076176404953003, -0.9768242239952087, 0.5959305167198181, -0.3626864552497864, -0.4511834383010864, 0.8474853038787842, 0.3182803988456726, -0.29593002796173096, -1.414816975593567, 0.6583751440048218, 1.3209031820297241, -0.8111387491226196, -0.8670996427536011, 0.18100975453853607, -0.7900038957595825, 1.1252195835113525, 0.6322807669639587, 0.4484104514122009, 0.3005497455596924, 1.5846872329711914, 0.7266139388084412, -0.5485232472419739, 0.5108319520950317, 0.4752877354621887, -0.1334250271320343, -2.0494132041931152, -1.229480266571045, 0.3294757604598999, -0.6148508191108704, -1.6032174825668335, 1.4095466136932373, -1.1377946138381958, -1.0353411436080933, 0.6312301158905029, 0.11091785877943039, 1.3904681205749512, 0.3424155116081238, 1.6499841213226318, 2.0471532344818115, 0.868199348449707, 0.3945057988166809, 1.2419408559799194, -0.1762726753950119, -0.5211751461029053, 1.8349246978759766, -0.42539072036743164, 0.4428352117538452, 1.1309292316436768, -0.32458359003067017, -1.0792752504348755, -0.7781350612640381, -1.1543140411376953, -0.7079215049743652, 1.1385999917984009, 0.13184261322021484, -1.09017014503479, 0.1824728101491928, 1.6527636051177979, 0.055685631930828094, -0.36399465799331665, 0.6970903873443604, 0.4110146164894104, -0.9054844975471497, -0.09382147341966629, -0.9411347508430481, 0.5025455355644226, -0.23142006993293762, -0.2672550082206726, 0.31641584634780884, 0.5520159006118774, 1.3377156257629395, -0.03416261449456215, 0.16222454607486725, 1.0992717742919922, -1.4365440607070923, 1.4693269729614258, -0.646956205368042, 0.3217877745628357, -2.369053840637207, 1.4002525806427002, -0.6623741984367371, 1.9908705949783325, -2.652068614959717, 0.356325626373291, -0.6367565393447876, -0.4924353361129761, 0.22386431694030762, -0.361045777797699, 0.20832188427448273, -0.10145082324743271, -1.1445138454437256, 0.03716936707496643, -0.7328140139579773, 0.5593915581703186, 1.1155352592468262, 1.4099863767623901, -1.18272864818573, -0.29040318727493286, -1.6945980787277222, -0.17162591218948364, -0.7103679776191711, 0.29885566234588623, -2.003530263900757, -0.22495904564857483, -1.9261176586151123, -2.262002944946289, -1.3545759916305542, -0.8994823098182678, 1.0988881587982178, 0.13710275292396545, -0.9114202857017517, 1.1796938180923462, -0.40551167726516724, -1.7878646850585938, 1.1531827449798584, -2.0933990478515625 ]
https://github.com/huggingface/datasets/issues/4386
Bug for wiki_auto_asset_turk from GEM
Hi @StevenTang1998, We have fixed the issue: - #4389 The fix will be available in our next `datasets` library release. In the meantime, you can incorporate that fix by installing `datasets` from our GitHub repo: ``` pip install git+https://github.com/huggingface/datasets#egg=datasets ```
## Describe the bug The script of wiki_auto_asset_turk for GEM may be out of date. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('gem', 'wiki_auto_asset_turk') ``` ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/load.py", line 1731, in load_dataset builder_instance.download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 640, in download_and_prepare self._download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 1158, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 707, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/tangtianyi/.cache/huggingface/modules/datasets_modules/datasets/gem/982a54473b12c6a6e40d4356e025fb7172a5bb2065e655e2c1af51f2b3cf4ca1/gem.py", line 538, in _split_generators dl_dir = dl_manager.download_and_extract(_URLs[self.config.name]) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 416, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 294, in download downloaded_path_or_paths = map_nested( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 351, in map_nested mapped = [ File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 352, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 288, in _single_map_nested return function(data_struct) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 320, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 234, in cached_path output_path = get_from_cache( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 579, in get_from_cache raise FileNotFoundError(f"Couldn't find file at {url}") FileNotFoundError: Couldn't find file at https://github.com/facebookresearch/asset/raw/master/dataset/asset.test.orig ```
749
40
Bug for wiki_auto_asset_turk from GEM ## Describe the bug The script of wiki_auto_asset_turk for GEM may be out of date. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('gem', 'wiki_auto_asset_turk') ``` ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/load.py", line 1731, in load_dataset builder_instance.download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 640, in download_and_prepare self._download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 1158, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 707, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/tangtianyi/.cache/huggingface/modules/datasets_modules/datasets/gem/982a54473b12c6a6e40d4356e025fb7172a5bb2065e655e2c1af51f2b3cf4ca1/gem.py", line 538, in _split_generators dl_dir = dl_manager.download_and_extract(_URLs[self.config.name]) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 416, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 294, in download downloaded_path_or_paths = map_nested( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 351, in map_nested mapped = [ File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 352, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 288, in _single_map_nested return function(data_struct) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 320, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 234, in cached_path output_path = get_from_cache( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 579, in get_from_cache raise FileNotFoundError(f"Couldn't find file at {url}") FileNotFoundError: Couldn't find file at https://github.com/facebookresearch/asset/raw/master/dataset/asset.test.orig ``` Hi @StevenTang1998, We have fixed the issue: - #4389 The fix will be available in our next `datasets` library release. In the meantime, you can incorporate that fix by installing `datasets` from our GitHub repo: ``` pip install git+https://github.com/huggingface/datasets#egg=datasets ```
[ -1.2292745113372803, -0.9165666699409485, -0.6212963461875916, 1.4097907543182373, -0.144746795296669, -1.299035668373108, 0.15479356050491333, -1.068738341331482, 1.4854015111923218, -0.7518871426582336, 0.18796660006046295, -1.6018275022506714, -0.10583112388849258, -0.5439280271530151, -0.6773818731307983, -0.9057062864303589, -0.3360307216644287, -0.8805971741676331, 1.087376356124878, 2.504279613494873, 1.3178175687789917, -1.2867635488510132, 2.760023593902588, 0.6542350649833679, -0.29411882162094116, -0.9943097829818726, 0.5271174907684326, -0.04844844341278076, -1.1626487970352173, -0.44757431745529175, -0.9366795420646667, 0.004780779592692852, -0.5567246079444885, -0.30602994561195374, 0.024037573486566544, 0.510238528251648, -0.339403361082077, -0.2685405910015106, -0.635119616985321, -0.7335913777351379, 0.521899402141571, -0.3310243487358093, 0.9507428407669067, -0.29948070645332336, 1.723852276802063, -0.5728603005409241, 0.44268888235092163, 0.7353073358535767, 1.2366856336593628, 0.1517566591501236, 0.10835147649049759, 0.26236385107040405, 0.3410869240760803, -0.022014286369085312, 0.6064106822013855, 1.225897192955017, 0.5998005867004395, 0.5199782252311707, 0.6472358703613281, -2.2254836559295654, 1.27658212184906, -0.8289064764976501, 0.2123868763446808, 1.332103967666626, -0.7804931402206421, 0.30752137303352356, -1.7721571922302246, -0.027558915317058563, 0.6702327728271484, -2.2445194721221924, 0.3072591722011566, -1.3058949708938599, -0.45517560839653015, 0.861750602722168, 0.39480677247047424, -1.1889039278030396, 0.20342056453227997, -0.5315737128257751, 1.1786274909973145, 0.4513360261917114, 1.000473141670227, -1.7092363834381104, -0.12136530131101608, -0.10313765704631805, 0.09178171306848526, -1.3312739133834839, -1.6789907217025757, 0.5365355014801025, 0.5713229775428772, 0.7288457155227661, -0.03414584696292877, 1.0197664499282837, -1.1574453115463257, 0.816809892654419, -1.0420506000518799, -1.5601001977920532, -1.3917973041534424, -2.4615468978881836, -2.317514657974243, 0.7390514612197876, -0.49654456973075867, -0.5209229588508606, 2.0601043701171875, -1.0155189037322998, -1.7126405239105225, 1.045234203338623, 0.2674366533756256, 0.08284524828195572, 2.397759437561035, 0.21048028767108917, -0.7944780588150024, 0.4809207618236542, -0.6999250054359436, 0.7957437038421631, -0.27461540699005127, 1.2494735717773438, 0.5330044627189636, -1.025508165359497, 1.6004747152328491, -0.46873554587364197, 0.6377715468406677, -0.6094832420349121, -0.5023298859596252, -0.82105952501297, 0.25903192162513733, 1.8282619714736938, -0.3156563937664032, 1.5396552085876465, -0.29279759526252747, -1.57427179813385, -1.5629264116287231, 0.8771067261695862, 0.45904022455215454, -0.9065716862678528, 0.02408599480986595, -0.5566036701202393, 0.15960079431533813, -0.022997934371232986, 1.1677647829055786, 1.2847704887390137, 0.739405632019043, -0.35511595010757446, -0.8380876779556274, 0.21254460513591766, -0.2561664283275604, -0.6510409712791443, -1.773910641670227, -0.30808961391448975, 0.17405851185321808, 0.6157745718955994, -1.154891014099121, 1.8540542125701904, 0.8966699838638306, 2.011941432952881, 0.9564207792282104, -0.3663829565048218, 1.4697444438934326, -0.030145313590765, 1.8678311109542847, -0.5262833833694458, 0.6059020161628723, -0.32629629969596863, -1.1336069107055664, 0.9302575588226318, -0.40265801548957825, -1.9431694746017456, -0.8589992523193359, -0.676041841506958, -0.15369422733783722, -0.7003921270370483, 0.8381607532501221, -0.37416908144950867, -1.529075264930725, 0.08412269502878189, -0.7329421043395996, 0.22940616309642792, -1.2135796546936035, 0.22553427517414093, 0.7462959289550781, -0.7258164882659912, -0.06480074673891068, -0.2415846735239029, -1.2353335618972778, -0.4726000428199768, 0.3839186429977417, 2.0047333240509033, -0.5553317070007324, 0.9169157147407532, 1.0191385746002197, -0.7081822752952576, 0.14561498165130615, 0.176242858171463, -0.32139164209365845, 0.754565417766571, -1.1560059785842896, -0.4317890405654907, 1.2189693450927734, -0.3308575749397278, -0.7643005847930908, 1.4143906831741333, 0.8149241805076599, -1.123130202293396, -0.257308691740036, -0.18514218926429749, -0.8705086708068848, 0.03316940367221832, -1.4819464683532715, -0.16707845032215118, 0.45958995819091797, -1.4996588230133057, -0.32540950179100037, -0.17805978655815125, 1.4259840250015259, -0.19827212393283844, 1.4858235120773315, -0.38494282960891724, -0.11420711874961853, -0.22958441078662872, -0.5389297604560852, 0.2069973349571228, -0.23194551467895508, -0.5345003604888916, 0.1375063955783844, -0.7915127873420715, 0.2532970905303955, 1.5281010866165161, 0.27310022711753845, 0.10375797003507614, 0.4111511707305908, 1.1224600076675415, 0.3880797326564789, -0.053710147738456726, -0.8091999888420105, -1.56880784034729, 1.929160475730896, -1.410441517829895, 1.8841817378997803, 0.7674444913864136, -0.1296851933002472, -1.7745013236999512, -1.8773937225341797, 1.1818814277648926, 1.101701021194458, 2.329331159591675, 0.4339143633842468, 0.42097029089927673, -0.7561414837837219, -0.834791898727417, 0.3518247902393341, -1.0026988983154297, -0.5982123613357544, 0.12456459552049637, 2.3541407585144043, 1.8270657062530518, -0.51483553647995, -0.2999945878982544, -0.8340092301368713, 1.328364610671997, -0.26875782012939453, 0.2686291038990021, 2.0906784534454346, -0.26402920484542847, -1.013297438621521, 1.4248743057250977, -2.3850252628326416, 0.3403926193714142, 2.1526222229003906, 0.2581394910812378, 0.12888072431087494, -1.4030076265335083, -0.6588745713233948, -0.3361348807811737, -0.43799999356269836, -1.2895190715789795, 0.5647910237312317, -0.32099682092666626, -0.8215189576148987, -1.4001744985580444, 0.07298590242862701, -1.0899733304977417, -1.7596309185028076, 0.28700220584869385, 1.935624122619629, 2.082465648651123, -0.8152132630348206, 1.4506866931915283, -0.23710967600345612, 0.05484726279973984, 1.2050375938415527, 1.4307198524475098, 3.1332101821899414, 1.821894884109497, -1.3030258417129517, 0.7103684544563293, -0.2363978624343872, -0.47514790296554565, 1.1362181901931763, -1.170448899269104, 1.1225340366363525, -0.2194620966911316, -1.2494510412216187, -1.2369152307510376, 1.085575819015503, 0.4967370629310608, 0.017352476716041565, -0.4969932734966278, 1.3023135662078857, 0.09053675085306168, 1.352336049079895, 0.622636079788208, -0.42386874556541443, 0.5338805913925171, -0.39969563484191895, -0.6518515944480896, 1.6195871829986572, 0.20897330343723297, -1.5063332319259644, -2.3094162940979004, -0.31073570251464844, -0.882151186466217, -0.01604127697646618, -0.6284694671630859, -1.024066686630249, 1.6163138151168823, 0.40382686257362366, -1.1914578676223755, -0.2991313636302948, -0.23119446635246277, -0.4624343812465668, 2.6786446571350098, -1.2360190153121948, -0.08083140850067139, -0.9589908123016357, -0.5458860993385315, 1.6243575811386108, -1.2919255495071411, -0.27857035398483276, -1.0669677257537842, -0.6246521472930908, -1.2164051532745361, -0.3524817228317261, 0.01832018792629242, -0.9653536677360535, 0.7922986149787903, 0.20535919070243835, -1.1580122709274292, -0.2989170253276825, -0.8980277180671692, 1.0757967233657837, -0.12822453677654266, 0.24637196958065033, 1.7653387784957886, 0.2891283929347992, -0.3858753442764282, 0.8190575838088989, 1.1969609260559082, 0.6294699311256409, -0.6928796172142029, -0.048188697546720505, -0.6224916577339172, 0.3962021470069885, -1.3552879095077515, 0.27150121331214905, -2.9954302310943604, 0.7462294697761536, -0.22680984437465668, -0.18756818771362305, -0.12341269105672836, -1.3604520559310913, 1.0924690961837769, 2.5645313262939453, -1.2299449443817139, 0.5397403240203857, 0.44360440969467163, 1.1569536924362183, -1.6598248481750488, 0.3321117162704468, -0.5381070375442505, 2.0374093055725098, 0.1880710870027542, 1.241227388381958, -0.46185770630836487, -2.2016549110412598, 0.6685725450515747, -1.1891742944717407, -1.0262563228607178, 0.841092050075531, -0.9402965307235718, 0.34146639704704285, -1.3752387762069702, -0.21131590008735657, -0.9394795298576355, -1.2309339046478271, 0.6480324268341064, 0.08440685272216797, 0.37436020374298096, -0.5129379630088806, 0.3313646912574768, -2.1746747493743896, -1.3840299844741821, -0.1760820597410202, -1.0042721033096313, 0.587394118309021, -0.4415005147457123, 0.5452335476875305, -0.07990243285894394, 0.13847856223583221, 0.2330329418182373, 1.5705740451812744, 3.451429843902588, 0.14157088100910187, 0.15583941340446472, -0.11052656173706055, -1.0206000804901123, 1.4279556274414062, 0.8554146885871887, -0.14788472652435303, -0.6570506691932678, -1.0253851413726807, 1.3169516324996948, 1.9924979209899902, 1.0910736322402954, 0.08588336408138275, -0.8348272442817688, -0.7430694699287415, -0.000185500830411911, 0.1792929470539093, 0.577532172203064, 1.0117992162704468, -0.024719204753637314, 0.03695125877857208, 1.3817756175994873, 1.1715450286865234, -0.2741204798221588, 0.3634624481201172, -1.0138589143753052, -0.3921634256839752, 0.37957096099853516, 0.15524347126483917, 0.07720696926116943, 0.4878217279911041, -1.0584946870803833, -0.2495383471250534, -0.3580089211463928, -0.8090931177139282, -0.8166135549545288, -0.3986993134021759, -0.415871262550354, 1.5663299560546875, 0.1443752497434616, -0.5108583569526672, 0.055277176201343536, -0.599181592464447, -0.183334082365036, -1.1228454113006592, 0.17604555189609528, -0.10577678680419922, -0.13984644412994385, -0.15220871567726135, 1.5714530944824219, -0.945566713809967, -2.130680561065674, 0.16277746856212616, 0.35632333159446716, -0.27514728903770447, 0.16851039230823517, 1.7343025207519531, 0.4848576784133911, 1.3976885080337524, 1.2970184087753296, 0.9682215452194214, -0.6129883527755737, -1.2375898361206055, 0.7288194298744202, 0.9480592608451843, -1.3616552352905273, 0.9246598482131958, -0.20746809244155884, -0.5424492955207825, 0.7143135666847229, 1.3359906673431396, 0.43142813444137573, -2.0014235973358154, 0.9346019625663757, -1.0027475357055664, 0.7862666249275208, 0.7142679691314697, 0.7428892254829407, 0.23312222957611084, 0.8949836492538452, -1.2069833278656006, -1.2053841352462769, -0.6563243269920349, -0.6671076416969299, 1.8643909692764282, -0.37572211027145386, 0.5884020328521729, -0.10025585442781448, -1.1001601219177246, -0.1715484857559204, 0.8525837659835815, 0.38432228565216064, -0.40233245491981506, 0.9297806024551392, -0.6513785123825073, -0.9264447689056396, -1.2385753393173218, -0.42510882019996643, -1.0414671897888184, -0.8994477391242981, 0.9396490454673767, 0.7139281034469604, 0.481738805770874, 1.9418103694915771, 0.6062307357788086, 0.34300386905670166, -2.5848169326782227, 0.8316780924797058, 0.29743900895118713, -0.03982222452759743, 0.8825163841247559, 0.24037106335163116, 1.1390820741653442, 0.0601794570684433, 0.5861378312110901, -2.3861212730407715, 2.204035758972168, -0.19402055442333221, 0.5774847865104675, -0.03784584626555443, -0.2217676192522049, 1.1462864875793457, 0.638037383556366, 0.5367631912231445, -1.096699595451355, 0.7394421100616455, -0.5086766481399536, 1.0879852771759033, 0.8741906881332397, -0.9642517566680908, 0.11946352571249008, 1.4650976657867432, 0.4193612337112427, -0.48177310824394226, -0.9877868294715881, -0.8901007175445557, 0.899540901184082, 1.6418317556381226, -0.05031858757138252, -0.005173602607101202, 0.7796119451522827, 0.7042275667190552, -1.2052658796310425, -0.008062722161412239, -0.610320508480072, -0.6981511116027832, 1.7306417226791382, 2.0211353302001953, -0.1290701925754547, -0.22219493985176086, -0.7159857153892517, -1.326523780822754, 0.7682543396949768, -0.12821434438228607, 0.026014044880867004, 0.643679678440094, -0.6817408800125122, 1.0307129621505737, 0.5441434383392334, 1.006873369216919, -0.015583314932882786, 0.3034639060497284, 0.4858775734901428, -0.39937692880630493, -1.1749248504638672, -0.3720260560512543, -1.1394795179367065, -2.6334891319274902, 0.34715765714645386, -0.28598031401634216, -1.5093060731887817, 0.05358906835317612, -1.028643250465393, 0.8922698497772217, -0.631854772567749, -1.21442449092865, -1.4345455169677734, 0.3443264961242676, -0.12220941483974457, 0.9225862622261047, -1.6734570264816284, -0.272623747587204, 1.1871806383132935, 0.8201616406440735, -0.5536222457885742, 0.9666415452957153, 0.25282561779022217, 0.9529666304588318, 0.714187502861023, -0.4223191738128662, 0.6403346657752991, -0.05578522011637688, -1.3600986003875732, 0.4483242630958557, 1.3241808414459229, 0.1669255644083023, 1.4824283123016357, -0.442606657743454, 0.1348569393157959, 0.4256715178489685, -0.7256344556808472, -0.5265787243843079, -0.3388098478317261, 0.713519811630249, 0.03009635955095291, -0.9804624319076538, -0.17991505563259125, -0.1504683792591095, -0.35524117946624756, 0.1880059689283371, -1.463059902191162, -0.29786983132362366, -0.44238534569740295, -0.45073312520980835, -1.3890187740325928, 0.017738837748765945, 1.3341984748840332, -0.7543061971664429, -0.23877307772636414, 0.4248964190483093, 0.40870198607444763, 0.5714353919029236, 0.6229313611984253, -0.8105937242507935, -0.210044264793396, -0.41694220900535583, -0.25307774543762207, 0.3124757409095764, 1.2193535566329956, -0.029975995421409607, -0.9448915123939514, 0.6369118094444275, -0.3646770715713501, 0.17415563762187958, 1.9765883684158325, 0.015344127081334591, -0.6460859775543213, 0.3637143075466156, -0.7202191948890686, 1.7319092750549316, 1.6983925104141235, 1.232779622077942, -0.07781072705984116, -0.8172579407691956, 0.572418212890625, -0.23916485905647278, -0.3037301301956177, 0.885468065738678, 0.4372294843196869, -0.28505221009254456, -1.3756171464920044, 0.758391797542572, 1.177731990814209, -0.758511483669281, -0.7209757566452026, 0.07130500674247742, -0.936532199382782, 1.298354983329773, 0.48167702555656433, 0.34845811128616333, 0.3079584240913391, 1.6144099235534668, 0.7815042734146118, -0.4370172321796417, 0.48573583364486694, 0.535974383354187, -0.21681304275989532, -2.113708734512329, -1.022145390510559, 0.35431617498397827, -0.4430996775627136, -1.5907844305038452, 1.3763288259506226, -1.1262832880020142, -1.0786373615264893, 0.5434672832489014, 0.09912489354610443, 1.2725024223327637, 0.41180551052093506, 1.7267472743988037, 2.1425864696502686, 0.9206671714782715, 0.4264959394931793, 1.2385773658752441, -0.12125027924776077, -0.4950931966304779, 1.8795568943023682, -0.375914603471756, 0.4900699853897095, 1.0240944623947144, -0.40141648054122925, -1.124249815940857, -0.8095497488975525, -1.0893821716308594, -0.6339523792266846, 1.197749376296997, 0.07480452954769135, -1.0745950937271118, 0.20693325996398926, 1.5452966690063477, 0.1716693937778473, -0.17346397042274475, 0.6995304226875305, 0.3832313120365143, -0.7273908853530884, -0.11020313203334808, -0.8485086560249329, 0.5214893221855164, -0.15936751663684845, -0.2901088297367096, 0.2650551497936249, 0.5920221209526062, 1.3266414403915405, -0.15947000682353973, 0.14368197321891785, 1.128676414489746, -1.4416660070419312, 1.5328140258789062, -0.5779685974121094, 0.2705563008785248, -2.418365240097046, 1.351759910583496, -0.7184869647026062, 1.993140697479248, -2.489346504211426, 0.4271937608718872, -0.5239545106887817, -0.5215521454811096, 0.32025909423828125, -0.40579795837402344, 0.06535714119672775, -0.140767440199852, -0.9524327516555786, -0.06261281669139862, -0.6879167556762695, 0.6413301825523376, 1.208080768585205, 1.4137189388275146, -1.1178284883499146, -0.18376782536506653, -1.6926473379135132, -0.17871913313865662, -0.8607528805732727, 0.3389662206172943, -2.0023751258850098, -0.17601428925991058, -2.0376338958740234, -2.3096182346343994, -1.3355381488800049, -0.881476879119873, 1.0387191772460938, 0.23214903473854065, -0.948307454586029, 1.2454478740692139, -0.31859493255615234, -1.7743452787399292, 1.1404435634613037, -2.2457573413848877 ]
https://github.com/huggingface/datasets/issues/4386
Bug for wiki_auto_asset_turk from GEM
Thanks for your reply!! And the totto dataset has the same problem. The url should be change to [https://storage.googleapis.com/totto-public/totto_data.zip](https://storage.googleapis.com/totto-public/totto_data.zip).
## Describe the bug The script of wiki_auto_asset_turk for GEM may be out of date. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('gem', 'wiki_auto_asset_turk') ``` ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/load.py", line 1731, in load_dataset builder_instance.download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 640, in download_and_prepare self._download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 1158, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 707, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/tangtianyi/.cache/huggingface/modules/datasets_modules/datasets/gem/982a54473b12c6a6e40d4356e025fb7172a5bb2065e655e2c1af51f2b3cf4ca1/gem.py", line 538, in _split_generators dl_dir = dl_manager.download_and_extract(_URLs[self.config.name]) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 416, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 294, in download downloaded_path_or_paths = map_nested( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 351, in map_nested mapped = [ File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 352, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 288, in _single_map_nested return function(data_struct) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 320, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 234, in cached_path output_path = get_from_cache( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 579, in get_from_cache raise FileNotFoundError(f"Couldn't find file at {url}") FileNotFoundError: Couldn't find file at https://github.com/facebookresearch/asset/raw/master/dataset/asset.test.orig ```
749
19
Bug for wiki_auto_asset_turk from GEM ## Describe the bug The script of wiki_auto_asset_turk for GEM may be out of date. ## Steps to reproduce the bug ```python import datasets datasets.load_dataset('gem', 'wiki_auto_asset_turk') ``` ## Actual results ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/load.py", line 1731, in load_dataset builder_instance.download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 640, in download_and_prepare self._download_and_prepare( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 1158, in _download_and_prepare super()._download_and_prepare(dl_manager, verify_infos, check_duplicate_keys=verify_infos) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/builder.py", line 707, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/tangtianyi/.cache/huggingface/modules/datasets_modules/datasets/gem/982a54473b12c6a6e40d4356e025fb7172a5bb2065e655e2c1af51f2b3cf4ca1/gem.py", line 538, in _split_generators dl_dir = dl_manager.download_and_extract(_URLs[self.config.name]) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 416, in download_and_extract return self.extract(self.download(url_or_urls)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 294, in download downloaded_path_or_paths = map_nested( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 351, in map_nested mapped = [ File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 352, in <listcomp> _single_map_nested((function, obj, types, None, True, None)) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 288, in _single_map_nested return function(data_struct) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 320, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 234, in cached_path output_path = get_from_cache( File "/home/tangtianyi/miniconda3/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 579, in get_from_cache raise FileNotFoundError(f"Couldn't find file at {url}") FileNotFoundError: Couldn't find file at https://github.com/facebookresearch/asset/raw/master/dataset/asset.test.orig ``` Thanks for your reply!! And the totto dataset has the same problem. The url should be change to [https://storage.googleapis.com/totto-public/totto_data.zip](https://storage.googleapis.com/totto-public/totto_data.zip).
[ -1.2292745113372803, -0.9165666699409485, -0.6212963461875916, 1.4097907543182373, -0.144746795296669, -1.299035668373108, 0.15479356050491333, -1.068738341331482, 1.4854015111923218, -0.7518871426582336, 0.18796660006046295, -1.6018275022506714, -0.10583112388849258, -0.5439280271530151, -0.6773818731307983, -0.9057062864303589, -0.3360307216644287, -0.8805971741676331, 1.087376356124878, 2.504279613494873, 1.3178175687789917, -1.2867635488510132, 2.760023593902588, 0.6542350649833679, -0.29411882162094116, -0.9943097829818726, 0.5271174907684326, -0.04844844341278076, -1.1626487970352173, -0.44757431745529175, -0.9366795420646667, 0.004780779592692852, -0.5567246079444885, -0.30602994561195374, 0.024037573486566544, 0.510238528251648, -0.339403361082077, -0.2685405910015106, -0.635119616985321, -0.7335913777351379, 0.521899402141571, -0.3310243487358093, 0.9507428407669067, -0.29948070645332336, 1.723852276802063, -0.5728603005409241, 0.44268888235092163, 0.7353073358535767, 1.2366856336593628, 0.1517566591501236, 0.10835147649049759, 0.26236385107040405, 0.3410869240760803, -0.022014286369085312, 0.6064106822013855, 1.225897192955017, 0.5998005867004395, 0.5199782252311707, 0.6472358703613281, -2.2254836559295654, 1.27658212184906, -0.8289064764976501, 0.2123868763446808, 1.332103967666626, -0.7804931402206421, 0.30752137303352356, -1.7721571922302246, -0.027558915317058563, 0.6702327728271484, -2.2445194721221924, 0.3072591722011566, -1.3058949708938599, -0.45517560839653015, 0.861750602722168, 0.39480677247047424, -1.1889039278030396, 0.20342056453227997, -0.5315737128257751, 1.1786274909973145, 0.4513360261917114, 1.000473141670227, -1.7092363834381104, -0.12136530131101608, -0.10313765704631805, 0.09178171306848526, -1.3312739133834839, -1.6789907217025757, 0.5365355014801025, 0.5713229775428772, 0.7288457155227661, -0.03414584696292877, 1.0197664499282837, -1.1574453115463257, 0.816809892654419, -1.0420506000518799, -1.5601001977920532, -1.3917973041534424, -2.4615468978881836, -2.317514657974243, 0.7390514612197876, -0.49654456973075867, -0.5209229588508606, 2.0601043701171875, -1.0155189037322998, -1.7126405239105225, 1.045234203338623, 0.2674366533756256, 0.08284524828195572, 2.397759437561035, 0.21048028767108917, -0.7944780588150024, 0.4809207618236542, -0.6999250054359436, 0.7957437038421631, -0.27461540699005127, 1.2494735717773438, 0.5330044627189636, -1.025508165359497, 1.6004747152328491, -0.46873554587364197, 0.6377715468406677, -0.6094832420349121, -0.5023298859596252, -0.82105952501297, 0.25903192162513733, 1.8282619714736938, -0.3156563937664032, 1.5396552085876465, -0.29279759526252747, -1.57427179813385, -1.5629264116287231, 0.8771067261695862, 0.45904022455215454, -0.9065716862678528, 0.02408599480986595, -0.5566036701202393, 0.15960079431533813, -0.022997934371232986, 1.1677647829055786, 1.2847704887390137, 0.739405632019043, -0.35511595010757446, -0.8380876779556274, 0.21254460513591766, -0.2561664283275604, -0.6510409712791443, -1.773910641670227, -0.30808961391448975, 0.17405851185321808, 0.6157745718955994, -1.154891014099121, 1.8540542125701904, 0.8966699838638306, 2.011941432952881, 0.9564207792282104, -0.3663829565048218, 1.4697444438934326, -0.030145313590765, 1.8678311109542847, -0.5262833833694458, 0.6059020161628723, -0.32629629969596863, -1.1336069107055664, 0.9302575588226318, -0.40265801548957825, -1.9431694746017456, -0.8589992523193359, -0.676041841506958, -0.15369422733783722, -0.7003921270370483, 0.8381607532501221, -0.37416908144950867, -1.529075264930725, 0.08412269502878189, -0.7329421043395996, 0.22940616309642792, -1.2135796546936035, 0.22553427517414093, 0.7462959289550781, -0.7258164882659912, -0.06480074673891068, -0.2415846735239029, -1.2353335618972778, -0.4726000428199768, 0.3839186429977417, 2.0047333240509033, -0.5553317070007324, 0.9169157147407532, 1.0191385746002197, -0.7081822752952576, 0.14561498165130615, 0.176242858171463, -0.32139164209365845, 0.754565417766571, -1.1560059785842896, -0.4317890405654907, 1.2189693450927734, -0.3308575749397278, -0.7643005847930908, 1.4143906831741333, 0.8149241805076599, -1.123130202293396, -0.257308691740036, -0.18514218926429749, -0.8705086708068848, 0.03316940367221832, -1.4819464683532715, -0.16707845032215118, 0.45958995819091797, -1.4996588230133057, -0.32540950179100037, -0.17805978655815125, 1.4259840250015259, -0.19827212393283844, 1.4858235120773315, -0.38494282960891724, -0.11420711874961853, -0.22958441078662872, -0.5389297604560852, 0.2069973349571228, -0.23194551467895508, -0.5345003604888916, 0.1375063955783844, -0.7915127873420715, 0.2532970905303955, 1.5281010866165161, 0.27310022711753845, 0.10375797003507614, 0.4111511707305908, 1.1224600076675415, 0.3880797326564789, -0.053710147738456726, -0.8091999888420105, -1.56880784034729, 1.929160475730896, -1.410441517829895, 1.8841817378997803, 0.7674444913864136, -0.1296851933002472, -1.7745013236999512, -1.8773937225341797, 1.1818814277648926, 1.101701021194458, 2.329331159591675, 0.4339143633842468, 0.42097029089927673, -0.7561414837837219, -0.834791898727417, 0.3518247902393341, -1.0026988983154297, -0.5982123613357544, 0.12456459552049637, 2.3541407585144043, 1.8270657062530518, -0.51483553647995, -0.2999945878982544, -0.8340092301368713, 1.328364610671997, -0.26875782012939453, 0.2686291038990021, 2.0906784534454346, -0.26402920484542847, -1.013297438621521, 1.4248743057250977, -2.3850252628326416, 0.3403926193714142, 2.1526222229003906, 0.2581394910812378, 0.12888072431087494, -1.4030076265335083, -0.6588745713233948, -0.3361348807811737, -0.43799999356269836, -1.2895190715789795, 0.5647910237312317, -0.32099682092666626, -0.8215189576148987, -1.4001744985580444, 0.07298590242862701, -1.0899733304977417, -1.7596309185028076, 0.28700220584869385, 1.935624122619629, 2.082465648651123, -0.8152132630348206, 1.4506866931915283, -0.23710967600345612, 0.05484726279973984, 1.2050375938415527, 1.4307198524475098, 3.1332101821899414, 1.821894884109497, -1.3030258417129517, 0.7103684544563293, -0.2363978624343872, -0.47514790296554565, 1.1362181901931763, -1.170448899269104, 1.1225340366363525, -0.2194620966911316, -1.2494510412216187, -1.2369152307510376, 1.085575819015503, 0.4967370629310608, 0.017352476716041565, -0.4969932734966278, 1.3023135662078857, 0.09053675085306168, 1.352336049079895, 0.622636079788208, -0.42386874556541443, 0.5338805913925171, -0.39969563484191895, -0.6518515944480896, 1.6195871829986572, 0.20897330343723297, -1.5063332319259644, -2.3094162940979004, -0.31073570251464844, -0.882151186466217, -0.01604127697646618, -0.6284694671630859, -1.024066686630249, 1.6163138151168823, 0.40382686257362366, -1.1914578676223755, -0.2991313636302948, -0.23119446635246277, -0.4624343812465668, 2.6786446571350098, -1.2360190153121948, -0.08083140850067139, -0.9589908123016357, -0.5458860993385315, 1.6243575811386108, -1.2919255495071411, -0.27857035398483276, -1.0669677257537842, -0.6246521472930908, -1.2164051532745361, -0.3524817228317261, 0.01832018792629242, -0.9653536677360535, 0.7922986149787903, 0.20535919070243835, -1.1580122709274292, -0.2989170253276825, -0.8980277180671692, 1.0757967233657837, -0.12822453677654266, 0.24637196958065033, 1.7653387784957886, 0.2891283929347992, -0.3858753442764282, 0.8190575838088989, 1.1969609260559082, 0.6294699311256409, -0.6928796172142029, -0.048188697546720505, -0.6224916577339172, 0.3962021470069885, -1.3552879095077515, 0.27150121331214905, -2.9954302310943604, 0.7462294697761536, -0.22680984437465668, -0.18756818771362305, -0.12341269105672836, -1.3604520559310913, 1.0924690961837769, 2.5645313262939453, -1.2299449443817139, 0.5397403240203857, 0.44360440969467163, 1.1569536924362183, -1.6598248481750488, 0.3321117162704468, -0.5381070375442505, 2.0374093055725098, 0.1880710870027542, 1.241227388381958, -0.46185770630836487, -2.2016549110412598, 0.6685725450515747, -1.1891742944717407, -1.0262563228607178, 0.841092050075531, -0.9402965307235718, 0.34146639704704285, -1.3752387762069702, -0.21131590008735657, -0.9394795298576355, -1.2309339046478271, 0.6480324268341064, 0.08440685272216797, 0.37436020374298096, -0.5129379630088806, 0.3313646912574768, -2.1746747493743896, -1.3840299844741821, -0.1760820597410202, -1.0042721033096313, 0.587394118309021, -0.4415005147457123, 0.5452335476875305, -0.07990243285894394, 0.13847856223583221, 0.2330329418182373, 1.5705740451812744, 3.451429843902588, 0.14157088100910187, 0.15583941340446472, -0.11052656173706055, -1.0206000804901123, 1.4279556274414062, 0.8554146885871887, -0.14788472652435303, -0.6570506691932678, -1.0253851413726807, 1.3169516324996948, 1.9924979209899902, 1.0910736322402954, 0.08588336408138275, -0.8348272442817688, -0.7430694699287415, -0.000185500830411911, 0.1792929470539093, 0.577532172203064, 1.0117992162704468, -0.024719204753637314, 0.03695125877857208, 1.3817756175994873, 1.1715450286865234, -0.2741204798221588, 0.3634624481201172, -1.0138589143753052, -0.3921634256839752, 0.37957096099853516, 0.15524347126483917, 0.07720696926116943, 0.4878217279911041, -1.0584946870803833, -0.2495383471250534, -0.3580089211463928, -0.8090931177139282, -0.8166135549545288, -0.3986993134021759, -0.415871262550354, 1.5663299560546875, 0.1443752497434616, -0.5108583569526672, 0.055277176201343536, -0.599181592464447, -0.183334082365036, -1.1228454113006592, 0.17604555189609528, -0.10577678680419922, -0.13984644412994385, -0.15220871567726135, 1.5714530944824219, -0.945566713809967, -2.130680561065674, 0.16277746856212616, 0.35632333159446716, -0.27514728903770447, 0.16851039230823517, 1.7343025207519531, 0.4848576784133911, 1.3976885080337524, 1.2970184087753296, 0.9682215452194214, -0.6129883527755737, -1.2375898361206055, 0.7288194298744202, 0.9480592608451843, -1.3616552352905273, 0.9246598482131958, -0.20746809244155884, -0.5424492955207825, 0.7143135666847229, 1.3359906673431396, 0.43142813444137573, -2.0014235973358154, 0.9346019625663757, -1.0027475357055664, 0.7862666249275208, 0.7142679691314697, 0.7428892254829407, 0.23312222957611084, 0.8949836492538452, -1.2069833278656006, -1.2053841352462769, -0.6563243269920349, -0.6671076416969299, 1.8643909692764282, -0.37572211027145386, 0.5884020328521729, -0.10025585442781448, -1.1001601219177246, -0.1715484857559204, 0.8525837659835815, 0.38432228565216064, -0.40233245491981506, 0.9297806024551392, -0.6513785123825073, -0.9264447689056396, -1.2385753393173218, -0.42510882019996643, -1.0414671897888184, -0.8994477391242981, 0.9396490454673767, 0.7139281034469604, 0.481738805770874, 1.9418103694915771, 0.6062307357788086, 0.34300386905670166, -2.5848169326782227, 0.8316780924797058, 0.29743900895118713, -0.03982222452759743, 0.8825163841247559, 0.24037106335163116, 1.1390820741653442, 0.0601794570684433, 0.5861378312110901, -2.3861212730407715, 2.204035758972168, -0.19402055442333221, 0.5774847865104675, -0.03784584626555443, -0.2217676192522049, 1.1462864875793457, 0.638037383556366, 0.5367631912231445, -1.096699595451355, 0.7394421100616455, -0.5086766481399536, 1.0879852771759033, 0.8741906881332397, -0.9642517566680908, 0.11946352571249008, 1.4650976657867432, 0.4193612337112427, -0.48177310824394226, -0.9877868294715881, -0.8901007175445557, 0.899540901184082, 1.6418317556381226, -0.05031858757138252, -0.005173602607101202, 0.7796119451522827, 0.7042275667190552, -1.2052658796310425, -0.008062722161412239, -0.610320508480072, -0.6981511116027832, 1.7306417226791382, 2.0211353302001953, -0.1290701925754547, -0.22219493985176086, -0.7159857153892517, -1.326523780822754, 0.7682543396949768, -0.12821434438228607, 0.026014044880867004, 0.643679678440094, -0.6817408800125122, 1.0307129621505737, 0.5441434383392334, 1.006873369216919, -0.015583314932882786, 0.3034639060497284, 0.4858775734901428, -0.39937692880630493, -1.1749248504638672, -0.3720260560512543, -1.1394795179367065, -2.6334891319274902, 0.34715765714645386, -0.28598031401634216, -1.5093060731887817, 0.05358906835317612, -1.028643250465393, 0.8922698497772217, -0.631854772567749, -1.21442449092865, -1.4345455169677734, 0.3443264961242676, -0.12220941483974457, 0.9225862622261047, -1.6734570264816284, -0.272623747587204, 1.1871806383132935, 0.8201616406440735, -0.5536222457885742, 0.9666415452957153, 0.25282561779022217, 0.9529666304588318, 0.714187502861023, -0.4223191738128662, 0.6403346657752991, -0.05578522011637688, -1.3600986003875732, 0.4483242630958557, 1.3241808414459229, 0.1669255644083023, 1.4824283123016357, -0.442606657743454, 0.1348569393157959, 0.4256715178489685, -0.7256344556808472, -0.5265787243843079, -0.3388098478317261, 0.713519811630249, 0.03009635955095291, -0.9804624319076538, -0.17991505563259125, -0.1504683792591095, -0.35524117946624756, 0.1880059689283371, -1.463059902191162, -0.29786983132362366, -0.44238534569740295, -0.45073312520980835, -1.3890187740325928, 0.017738837748765945, 1.3341984748840332, -0.7543061971664429, -0.23877307772636414, 0.4248964190483093, 0.40870198607444763, 0.5714353919029236, 0.6229313611984253, -0.8105937242507935, -0.210044264793396, -0.41694220900535583, -0.25307774543762207, 0.3124757409095764, 1.2193535566329956, -0.029975995421409607, -0.9448915123939514, 0.6369118094444275, -0.3646770715713501, 0.17415563762187958, 1.9765883684158325, 0.015344127081334591, -0.6460859775543213, 0.3637143075466156, -0.7202191948890686, 1.7319092750549316, 1.6983925104141235, 1.232779622077942, -0.07781072705984116, -0.8172579407691956, 0.572418212890625, -0.23916485905647278, -0.3037301301956177, 0.885468065738678, 0.4372294843196869, -0.28505221009254456, -1.3756171464920044, 0.758391797542572, 1.177731990814209, -0.758511483669281, -0.7209757566452026, 0.07130500674247742, -0.936532199382782, 1.298354983329773, 0.48167702555656433, 0.34845811128616333, 0.3079584240913391, 1.6144099235534668, 0.7815042734146118, -0.4370172321796417, 0.48573583364486694, 0.535974383354187, -0.21681304275989532, -2.113708734512329, -1.022145390510559, 0.35431617498397827, -0.4430996775627136, -1.5907844305038452, 1.3763288259506226, -1.1262832880020142, -1.0786373615264893, 0.5434672832489014, 0.09912489354610443, 1.2725024223327637, 0.41180551052093506, 1.7267472743988037, 2.1425864696502686, 0.9206671714782715, 0.4264959394931793, 1.2385773658752441, -0.12125027924776077, -0.4950931966304779, 1.8795568943023682, -0.375914603471756, 0.4900699853897095, 1.0240944623947144, -0.40141648054122925, -1.124249815940857, -0.8095497488975525, -1.0893821716308594, -0.6339523792266846, 1.197749376296997, 0.07480452954769135, -1.0745950937271118, 0.20693325996398926, 1.5452966690063477, 0.1716693937778473, -0.17346397042274475, 0.6995304226875305, 0.3832313120365143, -0.7273908853530884, -0.11020313203334808, -0.8485086560249329, 0.5214893221855164, -0.15936751663684845, -0.2901088297367096, 0.2650551497936249, 0.5920221209526062, 1.3266414403915405, -0.15947000682353973, 0.14368197321891785, 1.128676414489746, -1.4416660070419312, 1.5328140258789062, -0.5779685974121094, 0.2705563008785248, -2.418365240097046, 1.351759910583496, -0.7184869647026062, 1.993140697479248, -2.489346504211426, 0.4271937608718872, -0.5239545106887817, -0.5215521454811096, 0.32025909423828125, -0.40579795837402344, 0.06535714119672775, -0.140767440199852, -0.9524327516555786, -0.06261281669139862, -0.6879167556762695, 0.6413301825523376, 1.208080768585205, 1.4137189388275146, -1.1178284883499146, -0.18376782536506653, -1.6926473379135132, -0.17871913313865662, -0.8607528805732727, 0.3389662206172943, -2.0023751258850098, -0.17601428925991058, -2.0376338958740234, -2.3096182346343994, -1.3355381488800049, -0.881476879119873, 1.0387191772460938, 0.23214903473854065, -0.948307454586029, 1.2454478740692139, -0.31859493255615234, -1.7743452787399292, 1.1404435634613037, -2.2457573413848877 ]