html_url
stringlengths
51
51
comments
stringlengths
67
24.7k
title
stringlengths
6
280
body
stringlengths
51
36.2k
comment_length
int64
16
1.45k
text
stringlengths
190
38.3k
embeddings
sequence
https://github.com/huggingface/datasets/issues/5798
Although until we've switched to all the steps in `load_dataset` to use `datasets.parallel`, I would require the user to explicitly say which step should use Spark. Maybe something like this, but I'm not sure yet: ```python from datasets.parallel import parallel_backend with parallel_backend("spark", steps=["download"]): ds = load_dataset(...) ``` for now some steps can be NotImplemented: ```python from datasets.parallel import parallel_backend with parallel_backend("spark", steps=["download", "prepare"]): # NotImplementedError: the "prepare" step that converts the raw data files to Arrow is not compatible with the "spark" backend yet ``` This way we can progressively roll out Spark support for the other data loading/processing steps without breaking changes between `datasets` versions
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
106
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Although until we've switched to all the steps in `load_dataset` to use `datasets.parallel`, I would require the user to explicitly say which step should use Spark. Maybe something like this, but I'm not sure yet: ```python from datasets.parallel import parallel_backend with parallel_backend("spark", steps=["download"]): ds = load_dataset(...) ``` for now some steps can be NotImplemented: ```python from datasets.parallel import parallel_backend with parallel_backend("spark", steps=["download", "prepare"]): # NotImplementedError: the "prepare" step that converts the raw data files to Arrow is not compatible with the "spark" backend yet ``` This way we can progressively roll out Spark support for the other data loading/processing steps without breaking changes between `datasets` versions
[ -0.5912810564041138, -0.166444331407547, -0.27467963099479675, 0.046704962849617004, -0.0372835174202919, 0.011108189821243286, 0.41554296016693115, 0.29097071290016174, 0.2725381851196289, 0.12648449838161469, -0.0580955408513546, 0.5138408541679382, -0.09657572209835052, 0.4409136176109314, -0.16690918803215027, -0.30863237380981445, 0.0009621158242225647, -0.050116121768951416, -0.187543585896492, 0.2230311930179596, -0.14380809664726257, 0.14601005613803864, 0.017124280333518982, -0.23760363459587097, -0.16460080444812775, -0.14712078869342804, -0.1587129533290863, 0.0829189270734787, -0.13573630154132843, -0.27376607060432434, 0.06214965134859085, 0.4651857614517212, 0.23447257280349731, 0.43713632225990295, -0.00009986860095523298, -0.11228922754526138, 0.2093181014060974, 0.09784701466560364, -0.2516072392463684, -0.2861062288284302, -0.06857562065124512, -0.4363410472869873, 0.15798065066337585, -0.2598287761211395, 0.0831776112318039, 0.11050885915756226, -0.03902807831764221, -0.15998712182044983, 0.3120105266571045, -0.20322448015213013, 0.2766134738922119, 0.19100551307201385, -0.1449568271636963, -0.06516692787408829, -0.0693458691239357, 0.13318954408168793, -0.11455866694450378, 0.28984057903289795, 0.431392103433609, -0.16727909445762634, -0.27661770582199097, 0.15214397013187408, -0.2787788510322571, 0.23233677446842194, 0.3267502784729004, -0.08650700747966766, 0.02670177072286606, -0.3903942406177521, -0.15598398447036743, 0.23725110292434692, 0.6642193794250488, -0.1765528917312622, -0.3924162983894348, -0.608048677444458, -0.2317371368408203, -0.08309526741504669, -0.08180300891399384, 0.08160974830389023, -0.22552675008773804, 0.010929460637271404, -0.17243361473083496, -0.2250371277332306, 0.12353888154029846, -0.09326821565628052, 0.07424994558095932, 0.4788505434989929, -0.03960387408733368, 0.022111814469099045, 0.36286675930023193, 0.1056997999548912, 0.1750561147928238, -0.24759872257709503, 0.2903008460998535, 0.027862723916769028, -0.40236473083496094, -0.06950465589761734, -0.07441096007823944, -0.2752041518688202, 0.20154373347759247, 0.3148689866065979, 0.19802910089492798, 0.025606613606214523, 0.08645627647638321, 0.21053871512413025, 0.1612965315580368, 0.06029771640896797, -0.08567050099372864, -0.004777345806360245, 0.22960405051708221, 0.08677493035793304, 0.19632244110107422, 0.051100414246320724, -0.07807004451751709, -0.2718517780303955, -0.3479374945163727, 0.2932437062263489, -0.12933951616287231, 0.2797110676765442, -0.1418665051460266, -0.3451871871948242, 0.286986768245697, -0.19177839159965515, -0.03733684495091438, 0.17055828869342804, -0.047903452068567276, 0.2941669523715973, -0.15092670917510986, 0.20194923877716064, 0.10693534463644028, -0.06996309012174606, -0.08523015677928925, -0.12644939124584198, -0.09706816077232361, 0.08397670090198517, 0.19080850481987, -0.1508578211069107, 0.2336960732936859, 0.12357203662395477, -0.012634329497814178, 0.13864371180534363, 0.34220176935195923, -0.025987137109041214, -0.3219047784805298, 0.09274759888648987, -0.0007804557681083679, 0.1047772467136383, 0.02376825548708439, 0.3700215518474579, -0.3153194487094879, 0.22660484910011292, -0.21880413591861725, -0.32606178522109985, -0.03612940013408661, 0.2635195553302765, -0.10457474738359451, -0.062345441430807114, -0.5695787072181702, 0.16503238677978516, 0.025352459400892258, -0.1392553746700287, 0.17019903659820557, 0.09523084759712219, -0.3503425717353821, -0.35096126794815063, 0.1866161972284317, 0.4631999135017395, -0.23837092518806458, -0.030916862189769745, -0.3382604122161865, -0.14587682485580444, 0.18463191390037537, 0.07730381190776825, -0.14995378255844116, 0.08388577401638031, -0.19916778802871704, 0.29036182165145874, 0.22584745287895203, -0.5421980619430542, -0.1442088484764099, 0.6365920901298523, -0.3185892701148987, 0.06588376313447952, 0.25498074293136597, 0.10225974023342133, 0.4436317980289459, -0.08593280613422394, 0.08270622789859772, 0.39425137639045715, -0.21605394780635834, 0.13542714715003967, -0.29410964250564575, -0.42739567160606384, 0.21533901989459991, 0.3411197066307068, 0.0746823251247406, -0.030845429748296738, -0.00181540846824646, -0.3797890245914459, 0.3540147542953491, 0.15561917424201965, 0.2787555456161499, -0.06023786589503288, -0.19210711121559143, 0.2670519948005676, -0.12444061040878296, -0.06518170982599258, -0.35422074794769287, 0.2631250321865082, 0.3535999357700348, -0.0735381692647934, 0.08817596733570099, -0.281150221824646, -0.1501663625240326, -0.12096497416496277, -0.0763307735323906, -0.06270618736743927, 0.18452179431915283, -0.20367851853370667, 0.001496627926826477, 0.05543737858533859, -0.10682974755764008, 0.4233764708042145, -0.04938114807009697, 0.07985280454158783, -0.10829595476388931, 0.2157001793384552, 0.007505700923502445, -0.058972567319869995, -0.02925041690468788, -0.11336252093315125, 0.019457178190350533, -0.09313784539699554, -0.03688927739858627, 0.2597469091415405, -0.08923162519931793, 0.372300922870636, 0.09042362868785858, 0.345684289932251, 0.39422497153282166, 0.26013800501823425, 0.1534927934408188, -0.11223073303699493, 0.016691293567419052, -0.1808982491493225, -0.1616862714290619, 0.32630640268325806, -0.4232254922389984, 0.07953186333179474, -0.1285323053598404, 0.09870569407939911, 0.03429926186800003, -0.011226311326026917, -0.013763826340436935, 0.15186849236488342, 0.07583905756473541, -0.08770031481981277, 0.20923775434494019, -0.050523556768894196, -0.24198830127716064, 0.173595130443573, -0.09682406485080719, 0.05359821766614914, 0.07860556244850159, 0.060189396142959595, 0.02780197374522686, 0.046708591282367706, 0.4093710482120514, 0.5860129594802856, 0.29845714569091797, 0.28920793533325195, 0.15433697402477264, -0.0782916471362114, 0.46701961755752563, -0.14581069350242615, 0.1114358901977539, 0.10325253009796143, 0.22988608479499817, 0.2993761897087097, -0.060140714049339294, 0.1216915175318718, 0.10895568132400513, -0.352572500705719, 0.27118366956710815, -0.010004278272390366, -0.056844498962163925, -0.08439992368221283, -0.03790583461523056, -0.1458025872707367, -0.0006049871444702148, 0.06440802663564682, 0.007145380601286888, -0.16343452036380768, -0.04105740785598755, 0.5243062973022461, -0.1848490834236145, 0.07036570459604263, -0.14027050137519836, 0.12544353306293488, -0.24557946622371674, -0.32286953926086426, -0.4668007791042328, -0.06612926721572876, 0.1045866459608078, 0.18696948885917664, 0.2810307443141937, -0.040738970041275024, 0.2493453025817871, 0.10369805246591568, -0.003541652113199234, -0.3066023290157318, 0.10859809815883636, -0.005211211740970612, -0.1471884846687317, 0.006510518491268158, 0.212336465716362, 0.01138165220618248, 0.0629313737154007, -0.3409155309200287, 0.021900437772274017, -0.06078166887164116, 0.009825661778450012, -0.3937434256076813, 0.17016497254371643, 0.07267674803733826, -0.15244635939598083, -0.22798199951648712, -0.6546697616577148, -0.5960096120834351, 0.3691806197166443, -0.13333074748516083, 0.15352332592010498, -0.43731632828712463, 0.15874741971492767, -0.2480846494436264, 0.26087886095046997, -0.302540123462677, 0.035888127982616425, -0.3585568070411682, 0.17476370930671692, -0.19888070225715637, -0.058262500911951065, -0.08770071715116501, 0.009645015001296997, 0.12141712009906769, 0.016432080417871475, -0.012300826609134674, -0.06754665076732635, -0.043140869587659836, 0.572054386138916, -0.16965608298778534, 0.047862567007541656, 0.36146271228790283, 0.17607498168945312, -0.06589668989181519, 0.09293995797634125, 0.0932205319404602, -0.13313588500022888, 0.053211163729429245, 0.01586911827325821, 0.1297728270292282, 0.21401651203632355, 0.2385716587305069, 0.9095566272735596, -0.17006558179855347, 0.062957264482975, 0.2668269872665405, 0.09268543124198914, -0.1895056813955307, 0.022593537345528603, -0.38843420147895813, -0.10427278280258179, -0.37184369564056396, -0.06981154531240463, 0.08171039074659348, -0.11761926859617233, -0.30225473642349243, -0.15497735142707825, -0.3217083811759949, -0.33909425139427185, -0.10697931051254272, 0.1717851310968399, -0.37870490550994873, 0.11284841597080231, -0.13363830745220184, -0.1177024394273758, -0.23128332197666168, 0.029181823134422302, -0.053439561277627945, 0.0933680385351181, 0.29025983810424805, -0.11707011610269547, 0.15316957235336304, 0.3862477242946625, -0.5473270416259766, 0.09961804747581482, 0.16294145584106445, -0.1790255606174469, -0.022032491862773895, -0.004007712006568909, 0.00771196186542511, -0.12703672051429749, 0.8689587116241455, -0.1585327684879303, -0.06177089735865593, -0.001141972839832306, -0.28218358755111694, 0.05570288747549057, -0.06939338892698288, 0.011423781514167786, -0.0240092221647501, 0.4161469042301178, 0.261921226978302, -0.21735656261444092, -0.2511601150035858, -0.15944810211658478, -0.15750904381275177, -0.031119156628847122, -0.26381492614746094, -0.05721493810415268, -0.05898899957537651, -0.5059733986854553, 0.1540917456150055, 0.38395270705223083, -0.02091532200574875, -0.34855180978775024, -0.18666934967041016, 0.07996655255556107, 0.14668753743171692, 0.10636329650878906, -0.022128812968730927, -0.012535057961940765, -0.13960720598697662, 0.2141115665435791, 0.23611538112163544, -0.056975241750478745, 0.11341296136379242, 0.14448556303977966, -0.1106586679816246, -0.04269762709736824, 0.1478261947631836, -0.03343958035111427, 0.15511569380760193, 0.1371781826019287, 0.03874754160642624, 0.058137085288763046, -0.07066471129655838, 0.06605613231658936, -0.505214512348175, -0.0034100711345672607, 0.10453744977712631, 0.09097400307655334, -0.16008585691452026, -0.5817767977714539, 0.38411781191825867, 0.11251577734947205, -0.12218077480792999, 0.3254828453063965, -0.2555762529373169, -0.048382822424173355, 0.23092526197433472, 0.07794705033302307, 0.723799467086792, 0.008898310363292694, 0.13180933892726898, -0.028713470324873924, -0.10145938396453857, 0.45720359683036804, -0.616083025932312, 0.21228036284446716, -0.2921298146247864, -0.01358446478843689, -0.04286303371191025, -0.0019158348441123962, 0.04336757957935333, 0.3826761543750763, -0.13995909690856934, 0.22250667214393616, 0.09916886687278748, -0.21908718347549438, -0.1569727510213852, 0.5530254244804382, -0.4159892201423645, -0.3795291483402252, 0.20790399610996246, 0.21769674122333527, -0.008835051208734512, 0.16770392656326294, -0.2258128672838211, -0.2943401336669922, 0.07310032844543457, -0.07002946734428406, -0.20372352004051208, -0.02893305942416191, -0.11508743464946747, 0.2748337388038635, -0.38658109307289124, -0.12781338393688202, 0.3416932225227356, 0.2485484629869461, -0.11845984309911728, -0.16891317069530487, -0.10895611345767975, 0.035136427730321884, -0.12071079015731812, 0.139504075050354, -0.030850738286972046, -0.2203860580921173, 0.18733489513397217, -0.19186261296272278, -0.3045053482055664, -0.18431493639945984, 0.006382010877132416, -0.37290245294570923, 0.031605228781700134, 0.14576484262943268, 0.11752337217330933, -0.21725055575370789, -0.15634673833847046, 0.07273748517036438, -0.13558097183704376, -0.09213276952505112, 0.17526520788669586, 0.03873679041862488, -0.18079909682273865, 0.25605201721191406, -0.17141330242156982, 0.07442957162857056, -0.033894237130880356, 0.39137548208236694, -0.04775211215019226, -0.19734494388103485, 0.07909859716892242, 0.1080610454082489, -0.2104274481534958, -0.19580677151679993, -0.06885379552841187, -0.07229390740394592, -0.11192942410707474, 0.10749172419309616, -0.24334697425365448, -0.0676490068435669, 0.042209990322589874, 0.09176409244537354, 0.32749485969543457, -0.02271828055381775, 0.018459230661392212, -0.14305700361728668, -0.26812589168548584, 0.14809784293174744, -0.17612773180007935, 0.20694376528263092, 0.12441407144069672, -0.1971699595451355, 0.1457834541797638, 0.1316048800945282, -0.40263432264328003, 0.18943101167678833, -0.023609131574630737, -0.09957314282655716, 0.5131860375404358, -0.12819987535476685, 0.004499804228544235, -0.012083347886800766, 0.12572771310806274, 0.1473170816898346, -0.18260592222213745, -0.2734566926956177, 0.021488070487976074, 0.07665731757879257, -0.0029952041804790497, 0.08296333253383636, 0.006542004644870758, -0.08144964277744293, -0.24982234835624695, -0.041471466422080994, 0.20181182026863098, -0.029690302908420563, -0.0715489536523819, -0.0040777288377285, 0.17856357991695404, 0.39878910779953003, -0.3209044933319092, 0.3594772517681122, 0.10343986749649048, -0.01999787986278534, -0.09760915488004684, 0.32127630710601807, 0.29108691215515137, -0.046328648924827576, -0.027063682675361633, -0.11151328682899475, 0.5095944404602051, 0.10899275541305542, 0.4052276015281677, 0.0387863963842392, -0.05451871082186699, -0.03986934944987297, 0.4196964204311371, 0.2136395424604416, 0.13633045554161072, -0.12916597723960876, 0.21404345333576202, 0.35299351811408997, -0.11423477530479431, -0.027499400079250336, 0.33901873230934143, 0.15309716761112213, 0.18731117248535156, 0.1328631341457367, 0.5263756513595581, 0.3034510016441345, -0.30665722489356995, 0.2158823162317276, 0.5781621932983398, -0.23319382965564728, 0.13183504343032837, 0.15773418545722961, -0.007809832692146301, 0.2048380970954895, 0.2553369998931885, 0.14115343987941742, 0.2569049298763275, 0.32617729902267456, -0.06456634402275085, 0.46081307530403137, 0.29029586911201477, 0.03786421939730644, 0.0704655647277832, -0.505420446395874, 0.04597462713718414, -0.1936139166355133, -0.06584562361240387, 0.07916700839996338, -0.006823934614658356, 0.46002131700515747, -0.19583892822265625, -0.2716929614543915, -0.19969363510608673, 0.23385988175868988, -0.14728295803070068, -0.02680356614291668, -0.0236147940158844, -0.26549917459487915, -0.11338489502668381, 0.006512828171253204, 0.1236940547823906, 0.0007299240678548813, 0.6659745573997498, 0.00165654718875885, 0.08127722889184952, -0.13928750157356262, -0.08524499833583832, 0.1356905996799469, 0.3005467653274536, -0.2711772322654724, -0.27892744541168213, 0.03636464476585388, -0.26265090703964233, -0.27958300709724426, 0.1997898668050766, 0.4409016966819763, 0.10941290855407715, -0.08456790447235107, -0.1842091977596283, -0.16472280025482178, 0.22402602434158325, -0.10331270843744278, 0.13032816350460052, 0.01044035516679287, 0.1691949963569641, 0.2068472057580948, 0.26190581917762756, -0.2152530699968338, 0.07652068883180618, 0.0032194331288337708, -0.23330286145210266, -0.11887969076633453, 0.1483379304409027, 0.1811024397611618, -0.17255085706710815, 0.0387812964618206, 0.1137004941701889, -0.2792321443557739, 0.0907817855477333, 0.3884413242340088, -0.21495388448238373, 0.0949888601899147, -0.0851927250623703, 0.11893158406019211, 0.09169583767652512, 0.2513090968132019, 0.1300962269306183, 0.1520395576953888, -0.3711610436439514, 0.11635234951972961, -0.5881932377815247, -0.10764571279287338, -0.02055543102324009, 0.12430243194103241, -0.2257893830537796, 0.1632901430130005, 0.13588863611221313, 0.140397310256958, -0.1645345240831375, -0.12562106549739838, 0.18005678057670593, 0.6080212593078613, -0.03448547422885895, 0.1877869963645935, -0.2795941233634949, 0.005800282582640648, 0.12939858436584473, -0.22310812771320343, 0.07040069997310638, -0.06400716304779053, 0.07396053522825241, -0.1568644493818283, -0.1206454336643219, 0.3040858805179596, -0.4066923260688782, 0.478637158870697, -0.04358059912919998, 0.39283785223960876, -0.15604448318481445, 0.031676821410655975, -0.13783973455429077, 0.004276446998119354, -0.19162708520889282, -0.14894911646842957, 0.13356532156467438, 0.09327922761440277, -0.2535760998725891, 0.3500276505947113, -0.43168914318084717, 0.22906234860420227, -0.0745738297700882, 0.1854623258113861, -0.2333030253648758, -0.22137117385864258, -0.00751911848783493, 0.03637686371803284, 0.11040924489498138, 0.3455454111099243, -0.011951016262173653, -0.014457259327173233, -0.41101861000061035, -0.20395427942276, 0.1784428209066391, -0.22741864621639252, -0.11657903343439102, -0.4872477054595947, 0.12919069826602936, 0.5329574942588806, 0.351164847612381, -0.28298047184944153, -0.10533412545919418, 0.15317876636981964, -0.02083495631814003, 0.1809699386358261, 0.27555471658706665, 0.11317721754312515, -0.29812920093536377, -0.128578782081604, -0.1657639443874359, -0.1970154345035553, -0.0409499928355217, -0.05820217728614807, -0.336965411901474 ]
https://github.com/huggingface/datasets/issues/5798
Sounds good! I like the partial rollout idea. So for example `map_nested` would call `parallel_map` under the hood if `num_proc != 1` or `parallel_backend` is specified right? I would be happy to start a PR next week to explore this path.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
41
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Sounds good! I like the partial rollout idea. So for example `map_nested` would call `parallel_map` under the hood if `num_proc != 1` or `parallel_backend` is specified right? I would be happy to start a PR next week to explore this path.
[ -0.44032394886016846, -0.35326239466667175, -0.26291581988334656, 0.15363097190856934, -0.07885220646858215, 0.00105227530002594, 0.3474459946155548, 0.23310305178165436, 0.2693675756454468, 0.03897140547633171, 0.1136862114071846, 0.5241246223449707, -0.06608068197965622, 0.5449793934822083, -0.09999494254589081, -0.3423255681991577, 0.016482055187225342, -0.08305515348911285, -0.038563698530197144, 0.2306310087442398, -0.16077762842178345, 0.2206304669380188, -0.06568066775798798, -0.2559341788291931, -0.19709661602973938, -0.17122167348861694, -0.25833961367607117, 0.10735016316175461, -0.14722801744937897, -0.2760109603404999, 0.05471163988113403, 0.37993407249450684, 0.2189318835735321, 0.40985560417175293, -0.00010608459706418216, -0.1971917450428009, 0.14492860436439514, 0.05346374958753586, -0.04666425660252571, -0.28679177165031433, -0.04256415367126465, -0.46726730465888977, 0.16565927863121033, -0.21566437184810638, 0.04211164265871048, 0.1173858642578125, -0.0019466541707515717, -0.030165232717990875, 0.22357429563999176, -0.2542208135128021, 0.20873281359672546, 0.12641799449920654, -0.09689022600650787, -0.018704814836382866, -0.12013892829418182, 0.21935555338859558, -0.11251431703567505, 0.42698904871940613, 0.6094268560409546, -0.26284554600715637, -0.2886025011539459, 0.07929835468530655, -0.25656336545944214, 0.2013823539018631, 0.3506181240081787, -0.10057021677494049, 0.06986790895462036, -0.5407268404960632, -0.26466554403305054, 0.21986156702041626, 0.6361536979675293, -0.16896885633468628, -0.30236661434173584, -0.5782842040061951, -0.25911012291908264, -0.02956007421016693, -0.11643082648515701, 0.09215869754552841, -0.29772013425827026, -0.004511642269790173, -0.1409006118774414, -0.2511790096759796, 0.12228387594223022, -0.12971659004688263, 0.05017218738794327, 0.548881471157074, -0.009693490341305733, 0.01674392819404602, 0.33309680223464966, 0.17484845221042633, 0.055102210491895676, -0.18956753611564636, 0.3340941369533539, 0.1028909832239151, -0.446346253156662, -0.10211995244026184, -0.05031224340200424, -0.33738353848457336, 0.24096587300300598, 0.27089235186576843, 0.19837886095046997, 0.0026050256565213203, -0.006052982062101364, 0.26705068349838257, 0.22784125804901123, 0.008921906352043152, -0.013120215386152267, -0.04831777513027191, 0.17823493480682373, 0.040006864815950394, 0.20434042811393738, 0.031101379543542862, -0.07181272655725479, -0.08243769407272339, -0.44242995977401733, 0.29727017879486084, -0.1340850293636322, 0.2810667157173157, -0.14873652160167694, -0.2455071210861206, 0.2690950632095337, -0.24819707870483398, -0.05908700451254845, 0.12486688792705536, -0.0298469178378582, 0.3464667797088623, -0.22722989320755005, 0.18776758015155792, 0.1267707198858261, -0.03644419461488724, -0.06454756110906601, -0.1643931120634079, -0.1686326265335083, 0.14371132850646973, 0.19587133824825287, -0.031006572768092155, 0.2807660400867462, 0.12507401406764984, 0.08336389064788818, 0.1255917251110077, 0.24576988816261292, -0.01486840471625328, -0.42076414823532104, 0.037966012954711914, -0.15975147485733032, 0.056171566247940063, 0.13047215342521667, 0.5296551585197449, -0.25187695026397705, 0.33028602600097656, -0.27548137307167053, -0.32725030183792114, -0.043118275701999664, 0.18639908730983734, -0.09279929846525192, -0.036614447832107544, -0.5256725549697876, 0.28873884677886963, 0.03781862184405327, -0.17375755310058594, 0.2257186770439148, 0.207490935921669, -0.39191848039627075, -0.3341267704963684, 0.1508086919784546, 0.43998295068740845, -0.23078642785549164, -0.03009086102247238, -0.21047212183475494, -0.13820108771324158, 0.15235233306884766, 0.16940933465957642, -0.14020512998104095, 0.10217343270778656, -0.19081535935401917, 0.34885847568511963, 0.20832687616348267, -0.5036733150482178, -0.1374664008617401, 0.7146610617637634, -0.3784220218658447, -0.0018866285681724548, 0.26504048705101013, 0.0690365880727768, 0.4765722155570984, -0.04413650557398796, 0.19663748145103455, 0.3093947768211365, -0.22180257737636566, 0.11168261617422104, -0.3900047540664673, -0.41117072105407715, 0.3143509328365326, 0.3560134172439575, 0.07605857402086258, 0.0852547436952591, 0.03499487787485123, -0.4194091856479645, 0.39892271161079407, 0.23488730192184448, 0.2723837196826935, -0.0864226371049881, -0.11475177109241486, 0.2864040732383728, -0.08699193596839905, -0.12780505418777466, -0.3279350697994232, 0.2603290379047394, 0.19987469911575317, -0.03240495175123215, 0.18541589379310608, -0.19582554697990417, -0.10441267490386963, -0.09929338097572327, -0.0046813637018203735, -0.09805506467819214, 0.1283862590789795, -0.282010018825531, -0.05090736970305443, 0.08721675723791122, -0.20530372858047485, 0.3894653022289276, -0.147825688123703, 0.04827865585684776, -0.03363523632287979, 0.28536587953567505, 0.05541856586933136, -0.09227512776851654, -0.0695638358592987, -0.05761998891830444, 0.01455517578870058, -0.10259655117988586, 0.035123832523822784, 0.14834097027778625, -0.08197860419750214, 0.2585717439651489, 0.14528919756412506, 0.3302549123764038, 0.47613123059272766, 0.17912447452545166, 0.18657343089580536, -0.16267025470733643, 0.04383416846394539, -0.310383677482605, -0.17111873626708984, 0.24881841242313385, -0.44419941306114197, 0.09972041100263596, -0.1625487208366394, 0.12524470686912537, -0.040430907160043716, 0.015514276921749115, -0.02679089829325676, 0.22243228554725647, 0.10656830668449402, 0.024001382291316986, 0.15297777950763702, -0.06152225285768509, -0.1992204189300537, 0.16027367115020752, -0.10760590434074402, 0.015039309859275818, 0.018513554707169533, 0.09507618844509125, 0.12381145358085632, 0.0027239620685577393, 0.4080792963504791, 0.4205968379974365, 0.3579755127429962, 0.2132197469472885, 0.05674846097826958, -0.03709529712796211, 0.5147225260734558, -0.08398881554603577, 0.013364996761083603, 0.12316597998142242, 0.20537236332893372, 0.3191242516040802, -0.06729800999164581, 0.13168594241142273, 0.15035581588745117, -0.3840070366859436, 0.3775303363800049, -0.011273995973169804, 0.00016221404075622559, -0.1479625403881073, 0.12527908384799957, -0.10021861642599106, -0.011004017665982246, 0.038382481783628464, -0.11314621567726135, -0.048982176929712296, -0.1018834337592125, 0.506808340549469, -0.06473928689956665, 0.040507636964321136, -0.08216200768947601, 0.21971945464611053, -0.3084262013435364, -0.31191086769104004, -0.4030129909515381, -0.0859336256980896, 0.17778706550598145, 0.13754919171333313, 0.21006184816360474, -0.060604192316532135, 0.24477262794971466, 0.1817859411239624, -0.06772322952747345, -0.26986369490623474, 0.061650753021240234, 0.037933602929115295, -0.2399955689907074, -0.08710689097642899, 0.20120437443256378, 0.046513404697179794, 0.042534589767456055, -0.33939942717552185, -0.014138519763946533, -0.04502815753221512, 0.011646687984466553, -0.43408674001693726, 0.20648805797100067, 0.0391109362244606, -0.09755025804042816, -0.2053229957818985, -0.6683670878410339, -0.5542353391647339, 0.5065881013870239, -0.09376808255910873, 0.17619387805461884, -0.5288083553314209, 0.11321498453617096, -0.25970736145973206, 0.24535536766052246, -0.42548152804374695, 0.010456833988428116, -0.41669416427612305, 0.017519650980830193, -0.13495683670043945, -0.012421265244483948, -0.10252977162599564, 0.08410083502531052, 0.0893263965845108, 0.02888549491763115, -0.050314560532569885, -0.11970394849777222, 0.07298843562602997, 0.6158259510993958, -0.17214936017990112, 0.014525825157761574, 0.39257559180259705, 0.1228678971529007, -0.00041345879435539246, 0.12654705345630646, 0.03251497447490692, -0.06647297739982605, 0.21916307508945465, 0.08695569634437561, 0.2985974848270416, 0.15680280327796936, 0.1834806501865387, 0.9409598708152771, -0.09517952799797058, 0.12388856709003448, 0.3284342586994171, 0.20589081943035126, -0.27888381481170654, 0.09804421663284302, -0.377843976020813, -0.05041481927037239, -0.31470030546188354, -0.11544780433177948, 0.08607847988605499, -0.08774399757385254, -0.39647653698921204, -0.1618937849998474, -0.43579599261283875, -0.19421207904815674, 0.042286261916160583, 0.21621541678905487, -0.38901451230049133, 0.2092800885438919, -0.2496897429227829, -0.16984210908412933, -0.25664499402046204, 0.06701986491680145, -0.0933004692196846, 0.06268281489610672, 0.372569739818573, -0.11909422278404236, 0.13274341821670532, 0.28735122084617615, -0.5576992034912109, 0.052114807069301605, 0.13963577151298523, -0.19976039230823517, -0.12605583667755127, 0.09580232203006744, 0.08103925734758377, -0.0730644017457962, 0.9292079210281372, -0.18418702483177185, -0.06849393993616104, -0.034494757652282715, -0.33497685194015503, 0.11251953989267349, -0.0810852199792862, 0.06560700386762619, 0.07956870645284653, 0.3831494152545929, 0.3901226818561554, -0.22083866596221924, -0.1779279112815857, -0.14750759303569794, -0.27435964345932007, 0.01477157324552536, -0.33727559447288513, -0.017778009176254272, -0.01568162441253662, -0.3989066481590271, 0.23431521654129028, 0.42898839712142944, -0.13497844338417053, -0.3131250739097595, -0.17397622764110565, 0.26050060987472534, 0.23320932686328888, 0.06594567745923996, -0.10978497564792633, -0.11640917509794235, -0.09555356204509735, 0.20133788883686066, 0.2253175675868988, -0.11387792229652405, 0.060893282294273376, 0.07442320883274078, -0.13233891129493713, -0.037772614508867264, 0.20560620725154877, -0.06237339228391647, 0.3208644390106201, 0.14711646735668182, 0.17042499780654907, 0.0634194016456604, -0.06756444275379181, 0.058379463851451874, -0.5625002384185791, -0.10828602313995361, 0.17010968923568726, -0.00531146302819252, -0.1183752566576004, -0.6330790519714355, 0.34512701630592346, 0.0617193803191185, -0.11669524013996124, 0.3565877676010132, -0.4219076335430145, -0.011716559529304504, 0.2692457139492035, 0.06778644025325775, 0.8357841968536377, 0.021100642159581184, 0.04738561436533928, -0.21183253824710846, 0.01419193297624588, 0.4182039201259613, -0.775256872177124, 0.24984142184257507, -0.31167861819267273, -0.06799247860908508, -0.14382922649383545, 0.03280511498451233, 0.018780948594212532, 0.37230733036994934, -0.19152364134788513, 0.2073632925748825, 0.1655651479959488, -0.17602412402629852, -0.07024642825126648, 0.46428173780441284, -0.3028262257575989, -0.33274829387664795, 0.1838981658220291, 0.14670796692371368, 0.01695072278380394, 0.1836213767528534, -0.23960082232952118, -0.3178584575653076, 0.04376339912414551, -0.07113733142614365, -0.3186464309692383, -0.10885707288980484, -0.13878846168518066, 0.30310574173927307, -0.3256676495075226, -0.0771908387541771, 0.40709179639816284, 0.33524206280708313, -0.1986793875694275, -0.23779761791229248, -0.15097129344940186, -0.027295423671603203, 0.005421444773674011, 0.10687430202960968, -0.044754959642887115, -0.17110727727413177, 0.13145816326141357, -0.2030145823955536, -0.4150487780570984, -0.13396018743515015, -0.04524734616279602, -0.30932947993278503, -0.2362854927778244, 0.2316531538963318, 0.14703992009162903, -0.23019596934318542, -0.0816853865981102, 0.09178268909454346, -0.09361600875854492, -0.07392233610153198, 0.11349529772996902, 0.14820130169391632, -0.2606748938560486, 0.33017319440841675, -0.09645365923643112, 0.0993681252002716, -0.05351773276925087, 0.35435056686401367, 0.029897138476371765, -0.15984772145748138, -0.07344961166381836, 0.13197320699691772, -0.19792169332504272, -0.16156677901744843, -0.08670336753129959, -0.13164512813091278, -0.05076385289430618, 0.014012835919857025, -0.14160209894180298, -0.1252874732017517, -0.021469635888934135, 0.1249636858701706, 0.3283790349960327, 0.00254075787961483, -0.02699141949415207, -0.18178753554821014, -0.26857373118400574, 0.11865969002246857, -0.26583755016326904, 0.10416232794523239, 0.07494679093360901, -0.19459670782089233, 0.25716400146484375, 0.15819106996059418, -0.33460259437561035, 0.17755363881587982, -0.08201795071363449, -0.07815010100603104, 0.5798004865646362, -0.110502228140831, -0.020770251750946045, 0.04461634159088135, 0.05333228409290314, 0.20923030376434326, -0.16534429788589478, -0.19033057987689972, 0.09209334850311279, 0.12946350872516632, 0.06466836482286453, 0.14662647247314453, -0.028790578246116638, -0.0750771090388298, -0.25867289304733276, -0.0016630999743938446, 0.16419778764247894, -0.05787237733602524, -0.044536180794239044, -0.013579271733760834, 0.1613742560148239, 0.45146360993385315, -0.2761848270893097, 0.46465182304382324, 0.1392665058374405, -0.029109518975019455, -0.058361224830150604, 0.25366002321243286, 0.3231959342956543, -0.005379050970077515, -0.04228930175304413, -0.07451032102108002, 0.49307700991630554, 0.16803649067878723, 0.4333038330078125, 0.13138996064662933, -0.026569008827209473, -0.09468192607164383, 0.4691772162914276, 0.19150948524475098, 0.12604478001594543, -0.072137251496315, 0.16934914886951447, 0.2965109646320343, -0.057335469871759415, -0.09018850326538086, 0.576251745223999, 0.17402303218841553, 0.13363823294639587, 0.16438589990139008, 0.6671757698059082, 0.2760595679283142, -0.32415562868118286, 0.16041436791419983, 0.711963415145874, -0.1737567037343979, 0.0924406424164772, 0.07735514640808105, 0.003182612359523773, 0.2343045473098755, 0.2550539970397949, 0.11749393492937088, 0.20897075533866882, 0.22712671756744385, 0.03591803088784218, 0.39329010248184204, 0.19973769783973694, 0.0032836738973855972, 0.08520518243312836, -0.4776079058647156, 0.1747177541255951, -0.16985833644866943, -0.04827335849404335, 0.09555746614933014, -0.049300793558359146, 0.4992576837539673, -0.26697665452957153, -0.22877101600170135, -0.17598247528076172, 0.22074127197265625, -0.16237133741378784, 0.08682937920093536, 0.05933563411235809, -0.2768326997756958, -0.10001473128795624, -0.048739321529865265, 0.1301037222146988, 0.02842501550912857, 0.8487269878387451, -0.05190601944923401, 0.040788330137729645, -0.07338499277830124, -0.1627136915922165, 0.14927783608436584, 0.2893606424331665, -0.3157337009906769, -0.2722625434398651, -0.07845179736614227, -0.24064897000789642, -0.2968011200428009, 0.18920692801475525, 0.35863280296325684, 0.1605949103832245, -0.09023314714431763, -0.17867077887058258, -0.15977886319160461, 0.2388494312763214, -0.07884697616100311, 0.16337403655052185, -0.02096748724579811, 0.24329085648059845, 0.13112646341323853, 0.17466548085212708, -0.14983536303043365, 0.06362240016460419, 0.08325320482254028, -0.2594830095767975, -0.17541921138763428, 0.10751855373382568, 0.10020676255226135, -0.2745744585990906, 0.05868227407336235, 0.06674626469612122, -0.28690969944000244, 0.04826105013489723, 0.30387958884239197, -0.24080832302570343, 0.07217323780059814, -0.030353590846061707, 0.08611075580120087, 0.0016827862709760666, 0.23069845139980316, 0.044437237083911896, 0.11889968067407608, -0.4273851215839386, 0.08209621906280518, -0.5036660432815552, -0.05057183653116226, 0.06604699790477753, 0.11454353481531143, -0.16728299856185913, 0.09548529982566833, 0.1886955052614212, 0.10802365839481354, -0.22965064644813538, -0.22698050737380981, 0.06931118667125702, 0.6727018356323242, -0.09919968247413635, 0.20654843747615814, -0.26851317286491394, 0.07758454978466034, 0.15228547155857086, -0.06237342953681946, 0.12180966138839722, 0.017001543194055557, -0.005463659763336182, -0.23480162024497986, -0.17890168726444244, 0.23443803191184998, -0.43059271574020386, 0.5109464526176453, -0.027385279536247253, 0.508211612701416, -0.11075153946876526, 0.026393085718154907, -0.038594264537096024, 0.028856731951236725, -0.11870134621858597, -0.09185482561588287, 0.07190263271331787, 0.06777052581310272, -0.33163946866989136, 0.13439083099365234, -0.45663008093833923, 0.2286130040884018, -0.05343234911561012, 0.11850006878376007, -0.2579410672187805, -0.30415311455726624, -0.04774799570441246, -0.06367017328739166, 0.15226992964744568, 0.33251625299453735, 0.013361825607717037, -0.09631358832120895, -0.2980719208717346, -0.09922346472740173, 0.08344310522079468, -0.2528723180294037, -0.13941100239753723, -0.47809576988220215, 0.14538472890853882, 0.35415220260620117, 0.35384127497673035, -0.32006222009658813, -0.2023688703775406, 0.1853642463684082, 0.029254812747240067, 0.09091787040233612, 0.2726040780544281, 0.05070386826992035, -0.3630285859107971, -0.13462236523628235, -0.25272494554519653, -0.24098345637321472, -0.04559604823589325, 0.023082435131072998, -0.3451007604598999 ]
https://github.com/huggingface/datasets/issues/5798
Awesome ! I think map_nested can call `parallel_map()` if num_proc > 1, and `parallel_map` can be responsible to use Pool.map by default or joblib.
Support parallelized downloading and processing in load_dataset with Spark
### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this.
24
Support parallelized downloading and processing in load_dataset with Spark ### Feature request When calling `load_dataset` for datasets that have multiple files, support using Spark to distribute the downloading and processing job to worker nodes when `cache_dir` is a cloud file system shared among nodes. ```python load_dataset(..., use_spark=True) ``` ### Motivation Further speed up `dl_manager.download` and `_prepare_split` by distributing the workloads to worker nodes. ### Your contribution I can submit a PR to support this. Awesome ! I think map_nested can call `parallel_map()` if num_proc > 1, and `parallel_map` can be responsible to use Pool.map by default or joblib.
[ -0.5496347546577454, -0.3451996445655823, -0.29482370615005493, 0.17065832018852234, -0.09436344355344772, 0.07892078161239624, 0.38517698645591736, 0.23603278398513794, 0.3873416781425476, 0.07343711704015732, -0.09123784303665161, 0.541654109954834, -0.010543912649154663, 0.45676907896995544, -0.13361825048923492, -0.2348460555076599, -0.0005400851368904114, -0.09328646212816238, -0.18242204189300537, 0.22193807363510132, -0.21540409326553345, 0.23722973465919495, -0.041796863079071045, -0.26881906390190125, -0.13229429721832275, -0.1779731661081314, -0.20000959932804108, 0.13348804414272308, -0.050484783947467804, -0.25005990266799927, 0.12009474635124207, 0.4132439196109772, 0.17127558588981628, 0.3718770146369934, -0.00010302511509507895, -0.12352485954761505, 0.16879267990589142, 0.04489783197641373, -0.07625056058168411, -0.24098271131515503, 0.013442069292068481, -0.4905427396297455, 0.155140221118927, -0.24816368520259857, 0.11434980481863022, 0.1607629656791687, 0.10200958698987961, -0.02758166193962097, 0.2778485417366028, -0.2691185772418976, 0.2507181763648987, 0.17220963537693024, -0.13355645537376404, -0.045713942497968674, -0.03784218057990074, 0.12399128079414368, -0.07630036771297455, 0.4116392731666565, 0.559304416179657, -0.2047894299030304, -0.3118879199028015, 0.09351509809494019, -0.32926350831985474, 0.17698149383068085, 0.3193099796772003, -0.09766343981027603, -0.019756857305765152, -0.5429940223693848, -0.21273520588874817, 0.24487033486366272, 0.5337305665016174, -0.1878441572189331, -0.2669146955013275, -0.5580707788467407, -0.2872156798839569, -0.003672592341899872, -0.009457018226385117, 0.10205915570259094, -0.2505187690258026, 0.00395604083314538, -0.12127447128295898, -0.20083245635032654, 0.15674066543579102, -0.12579646706581116, 0.1184505820274353, 0.5740053057670593, -0.009547485038638115, 0.023907022550702095, 0.3249717950820923, 0.16764026880264282, 0.07041426002979279, -0.18414407968521118, 0.31319788098335266, 0.11904355883598328, -0.4705602526664734, -0.08347323536872864, -0.1251228302717209, -0.35510697960853577, 0.19483298063278198, 0.17383912205696106, 0.2244986891746521, 0.034281790256500244, 0.0507584847509861, 0.3112284243106842, 0.19888287782669067, -0.05538121238350868, -0.04954535886645317, -0.03672534599900246, 0.17692279815673828, 0.08240902423858643, 0.0917028859257698, 0.02598382905125618, -0.03929543495178223, -0.09542524814605713, -0.3186718225479126, 0.3032075762748718, -0.19234728813171387, 0.3280510902404785, -0.14073504507541656, -0.28230196237564087, 0.23984050750732422, -0.17500562965869904, 0.009576093405485153, 0.18113566935062408, -0.031782638281583786, 0.26539990305900574, -0.19051100313663483, 0.17142221331596375, 0.12338844686746597, 0.004887774586677551, -0.0638882964849472, -0.08470816910266876, -0.008533701300621033, 0.13257019221782684, 0.18078233301639557, -0.08256059885025024, 0.315612256526947, 0.11718735098838806, 0.030082643032073975, 0.17243528366088867, 0.28674203157424927, -0.060365330427885056, -0.36667168140411377, 0.13036546111106873, -0.014158777892589569, 0.06517288833856583, 0.028133133426308632, 0.49489378929138184, -0.21250414848327637, 0.2692083716392517, -0.3078154921531677, -0.33635765314102173, 0.02759636379778385, 0.22443635761737823, -0.03050101548433304, -0.03139619529247284, -0.5500723123550415, 0.23421518504619598, 0.12674793601036072, -0.19176258146762848, 0.18578574061393738, 0.1523934155702591, -0.4659482538700104, -0.3551107347011566, 0.11396437138319016, 0.39948785305023193, -0.11586104333400726, -0.01217784732580185, -0.32378286123275757, -0.09451291710138321, 0.18739308416843414, 0.09578555822372437, -0.10264749079942703, 0.0686342716217041, -0.2001623511314392, 0.455821692943573, 0.16775420308113098, -0.45884037017822266, -0.19676482677459717, 0.6863695979118347, -0.30106860399246216, 0.035663142800331116, 0.2605801820755005, 0.12749388813972473, 0.5101171731948853, -0.09882715344429016, 0.09972706437110901, 0.32861146330833435, -0.15128275752067566, 0.10919564962387085, -0.32672634720802307, -0.3761211931705475, 0.22760026156902313, 0.2847198247909546, 0.09041792899370193, -0.002856343984603882, 0.01899910345673561, -0.31703484058380127, 0.37462273240089417, 0.2178843468427658, 0.29257839918136597, -0.04163100942969322, -0.20571556687355042, 0.22492483258247375, -0.12043885886669159, -0.15014557540416718, -0.39341166615486145, 0.29156693816185, 0.13786473870277405, -0.06628404557704926, 0.08888628333806992, -0.21354590356349945, -0.06290271878242493, -0.06526573747396469, -0.03647879511117935, -0.0957111120223999, 0.1673431396484375, -0.2638082504272461, -0.0031424686312675476, 0.02237904816865921, -0.16214552521705627, 0.39160069823265076, -0.12644270062446594, 0.07853716611862183, 0.0004208274185657501, 0.23069363832473755, 0.07160378992557526, -0.11223050951957703, -0.0911901518702507, -0.09041091799736023, 0.012991704046726227, -0.10509942471981049, 0.009115137159824371, 0.18703317642211914, -0.14664480090141296, 0.3033611476421356, 0.09340976923704147, 0.2355426698923111, 0.39395672082901, 0.2179238647222519, 0.12592947483062744, -0.1540033519268036, 0.041791900992393494, -0.2652541995048523, -0.11292655020952225, 0.2505817115306854, -0.40798187255859375, 0.09679078310728073, -0.13541460037231445, 0.08171860873699188, -0.014485277235507965, 0.03772270679473877, 0.07877983897924423, 0.18334759771823883, 0.10373926162719727, 0.0690494030714035, 0.19881385564804077, -0.006931629031896591, -0.20139557123184204, 0.22599245607852936, -0.07873993366956711, -0.022179801017045975, 0.05940059944987297, 0.11215108633041382, 0.17135754227638245, -0.029942601919174194, 0.3887616693973541, 0.4771013855934143, 0.3688652515411377, 0.23232416808605194, 0.18626318871974945, -0.02384238690137863, 0.4482157230377197, -0.13189247250556946, 0.08830276131629944, 0.07018662989139557, 0.1925625205039978, 0.27781638503074646, -0.034437503665685654, 0.046748656779527664, 0.010424785315990448, -0.3325135409832001, 0.31901782751083374, -0.021635930985212326, -0.0267488956451416, -0.1636972725391388, 0.1068844199180603, -0.08844486624002457, 0.024539370089769363, 0.17024053633213043, -0.11736760288476944, -0.10860398411750793, -0.10606421530246735, 0.6217306852340698, -0.09310972690582275, 0.04124806076288223, -0.028234142810106277, 0.08410580456256866, -0.19893479347229004, -0.2869300842285156, -0.4837873578071594, -0.014999262988567352, 0.18389937281608582, 0.15727464854717255, 0.23642157018184662, -0.09438104182481766, 0.18254192173480988, 0.16903629899024963, -0.019816316664218903, -0.28729555010795593, 0.18044665455818176, 0.008172082714736462, -0.23152998089790344, -0.0697077214717865, 0.15926022827625275, 0.1393461972475052, -0.0048909783363342285, -0.3260166347026825, 0.009813614189624786, -0.07366486638784409, -0.03263233229517937, -0.42717719078063965, 0.16876418888568878, 0.0637127161026001, -0.1643444001674652, -0.21309489011764526, -0.6887372732162476, -0.6113401651382446, 0.4056186079978943, -0.1229734718799591, 0.24758687615394592, -0.5334234833717346, 0.0575910359621048, -0.23100121319293976, 0.2785903513431549, -0.3704761862754822, -0.03732134774327278, -0.49010008573532104, 0.14418886601924896, -0.14365246891975403, -0.029913844540715218, -0.1668965071439743, -0.016967281699180603, 0.1416412740945816, 0.018410973250865936, -0.03867020457983017, -0.05617458373308182, -0.0013752765953540802, 0.5354111790657043, -0.1301032155752182, -0.01058848574757576, 0.3598950505256653, 0.1550392508506775, -0.017446622252464294, 0.07683050632476807, 0.12542235851287842, -0.01155281811952591, 0.21214833855628967, 0.01102498546242714, 0.27471983432769775, 0.208513081073761, 0.21309249103069305, 0.8019740581512451, -0.10608474910259247, 0.19569267332553864, 0.3693718910217285, 0.10228981822729111, -0.24584628641605377, 0.09498833864927292, -0.35080277919769287, -0.09809199720621109, -0.33942651748657227, -0.06225895881652832, 0.13675571978092194, -0.1139954924583435, -0.4247005581855774, -0.10465110838413239, -0.4212939143180847, -0.23398542404174805, -0.006674878299236298, 0.21958592534065247, -0.36028310656547546, 0.11928350478410721, -0.1758040189743042, -0.13525046408176422, -0.2223374843597412, 0.004776313900947571, -0.11646336317062378, 0.01987195760011673, 0.2816180884838104, -0.1401946097612381, 0.19752231240272522, 0.2695702612400055, -0.6405778527259827, 0.09414932131767273, 0.17903339862823486, -0.2352975606918335, -0.04996565729379654, 0.03733310103416443, 0.06339140236377716, -0.09483323991298676, 0.9150956869125366, -0.2194393426179886, 0.018688175827264786, -0.029431231319904327, -0.3614119589328766, 0.04738546907901764, -0.08629191666841507, 0.03884770721197128, -0.015814848244190216, 0.4003213942050934, 0.4201511740684509, -0.23969954252243042, -0.16573798656463623, -0.16168156266212463, -0.264514297246933, -0.02929633855819702, -0.3618432283401489, -0.07381755858659744, -0.12869520485401154, -0.41386163234710693, 0.21927005052566528, 0.40445995330810547, -0.04516531527042389, -0.2651338279247284, -0.23225681483745575, 0.22262704372406006, 0.1596849411725998, 0.08177991956472397, -0.04283471032977104, -0.11201643943786621, -0.0731760710477829, 0.19867292046546936, 0.28255459666252136, -0.09878430515527725, 0.049010470509529114, 0.14770731329917908, -0.14506393671035767, 0.04178161919116974, 0.13518615067005157, -0.06139634549617767, 0.2555350065231323, 0.07618030160665512, 0.0665881559252739, 0.06953395903110504, -0.029003847390413284, 0.003735797479748726, -0.46415507793426514, -0.051259782165288925, 0.13187789916992188, 0.07951086759567261, -0.10498921573162079, -0.6123862862586975, 0.3460277318954468, 0.0899619311094284, -0.06187405437231064, 0.3464401662349701, -0.6187500953674316, -0.0707215890288353, 0.26865577697753906, 0.041001662611961365, 0.7259033918380737, -0.06446991860866547, -0.022044356912374496, -0.15202775597572327, -0.002381645143032074, 0.35273459553718567, -0.7173054814338684, 0.2554537057876587, -0.3092949390411377, -0.09480826556682587, -0.09217741340398788, 0.02250359207391739, 0.013747809454798698, 0.4396534264087677, -0.20272338390350342, 0.18844234943389893, 0.19564534723758698, -0.08558481931686401, -0.1413818895816803, 0.45766061544418335, -0.34772536158561707, -0.37381666898727417, 0.14439497888088226, 0.17364126443862915, 0.037753865122795105, 0.1933925449848175, -0.20762324333190918, -0.3256606459617615, 0.08121198415756226, -0.07928009331226349, -0.20736554265022278, -0.05166396498680115, -0.13662680983543396, 0.3733535706996918, -0.3609391748905182, -0.00324229896068573, 0.24431398510932922, 0.36345934867858887, -0.33706146478652954, -0.24911914765834808, -0.05336901545524597, -0.010634360834956169, 0.008214522153139114, 0.17636212706565857, -0.026651225984096527, -0.19681233167648315, 0.1491258144378662, -0.18734005093574524, -0.34228795766830444, -0.1538776159286499, -0.023097408935427666, -0.3362704813480377, -0.08786015212535858, 0.22642971575260162, 0.08126319199800491, -0.1594506800174713, -0.1622014343738556, 0.02116699516773224, -0.16579467058181763, -0.09990663826465607, 0.14105793833732605, 0.04597337916493416, -0.20963190495967865, 0.30128294229507446, -0.1396796703338623, 0.01131574809551239, -0.08219468593597412, 0.41753727197647095, 0.028593841940164566, -0.047644197940826416, -0.006600650027394295, 0.11010383069515228, -0.16652356088161469, -0.16834789514541626, -0.035853102803230286, -0.15638196468353271, -0.022176288068294525, 0.1496436595916748, -0.20703908801078796, -0.15965446829795837, -0.06892596930265427, 0.03750934451818466, 0.30388566851615906, 0.04489216208457947, -0.06188695877790451, -0.21855300664901733, -0.31885814666748047, 0.12842603027820587, -0.2049521654844284, 0.1290362924337387, 0.10532136261463165, -0.16772189736366272, 0.21575960516929626, 0.11447664350271225, -0.36148732900619507, 0.19831854104995728, -0.14761587977409363, -0.14522603154182434, 0.5073050856590271, -0.07693101465702057, 0.08034375309944153, 0.07823383808135986, 0.09711593389511108, 0.2405562400817871, -0.18734556436538696, -0.22214552760124207, 0.06082729250192642, 0.08084574341773987, -0.0184678602963686, 0.13832712173461914, -0.032744474709033966, -0.05922031030058861, -0.2631453275680542, -0.08417503535747528, 0.17796486616134644, -0.13781657814979553, -0.06621210277080536, -0.005811017006635666, 0.20174190402030945, 0.3272535502910614, -0.34428369998931885, 0.4202243983745575, 0.046416640281677246, -0.04476144164800644, -0.1280481219291687, 0.3047664761543274, 0.3244289755821228, -0.018071137368679047, 0.04332074522972107, -0.12225370109081268, 0.4813380539417267, 0.039359044283628464, 0.41786739230155945, 0.1597806215286255, -0.07790056616067886, -0.013700470328330994, 0.44574010372161865, 0.20029699802398682, 0.18956393003463745, -0.11756321787834167, 0.07188184559345245, 0.3082466423511505, -0.1322040557861328, -0.013595778495073318, 0.5635218024253845, 0.17440557479858398, 0.22198209166526794, 0.16060423851013184, 0.571577250957489, 0.2710331082344055, -0.3816415071487427, 0.156744122505188, 0.6930432319641113, -0.19128179550170898, 0.07544068247079849, 0.11119047552347183, 0.06280869245529175, 0.26662376523017883, 0.2881518006324768, 0.09085336327552795, 0.24244287610054016, 0.3445037305355072, 0.062401145696640015, 0.4069882929325104, 0.2513327896595001, 0.05532790720462799, 0.13733911514282227, -0.5071679949760437, 0.10948006808757782, -0.08462991565465927, -0.08878648281097412, 0.12226337194442749, 0.006481017917394638, 0.4612543284893036, -0.28131476044654846, -0.311949223279953, -0.20150308310985565, 0.3216738998889923, -0.24960553646087646, 0.0022393837571144104, 0.11591777205467224, -0.29418542981147766, -0.10849808901548386, -0.010454684495925903, 0.19080038368701935, -0.020009752362966537, 0.7494776844978333, -0.05646703019738197, 0.09898623824119568, -0.0507647842168808, -0.1474885791540146, 0.1300574392080307, 0.2432326078414917, -0.30529895424842834, -0.22581706941127777, 0.0250166654586792, -0.24158987402915955, -0.26566532254219055, 0.1973113864660263, 0.3986050486564636, 0.10598251223564148, -0.09669031202793121, -0.13891229033470154, -0.15243136882781982, 0.21467766165733337, -0.12913984060287476, 0.1406705379486084, -0.04285021498799324, 0.25332170724868774, 0.17297051846981049, 0.19936443865299225, -0.19110500812530518, 0.005078721325844526, 0.12661266326904297, -0.1778562068939209, -0.0685691386461258, 0.08116784691810608, 0.10113941133022308, -0.24114596843719482, 0.026426583528518677, 0.00650767982006073, -0.33627671003341675, 0.06436885893344879, 0.3582233786582947, -0.283801794052124, 0.1124730035662651, -0.018345370888710022, 0.10649357736110687, 0.06019571051001549, 0.35110464692115784, -0.004138752818107605, 0.051522985100746155, -0.33040520548820496, 0.10662449896335602, -0.5381662845611572, -0.053764209151268005, 0.014107598923146725, 0.1717255860567093, -0.1990513801574707, 0.1384263038635254, 0.1170363575220108, 0.05826771259307861, -0.12707972526550293, -0.17752186954021454, 0.09213843196630478, 0.5921174883842468, -0.10395041108131409, 0.1892450749874115, -0.22415976226329803, 0.05267680436372757, 0.15567302703857422, -0.14754340052604675, 0.12128317356109619, -0.09708648920059204, 0.045237019658088684, -0.18803656101226807, -0.20413202047348022, 0.22442306578159332, -0.46411263942718506, 0.5218559503555298, -0.0466192364692688, 0.43622028827667236, -0.20675140619277954, 0.035022273659706116, 0.022499412298202515, 0.022376731038093567, -0.10805866122245789, -0.05630577355623245, 0.09971925616264343, 0.0899847149848938, -0.31913256645202637, 0.2357063591480255, -0.3978998363018036, 0.24749420583248138, -0.12335291504859924, 0.057529401034116745, -0.21025723218917847, -0.25586724281311035, -0.07632482796907425, -0.030275115743279457, 0.053884200751781464, 0.35049891471862793, -0.005935043096542358, -0.06937716901302338, -0.330180823802948, -0.18504028022289276, 0.11115354299545288, -0.2687694728374481, -0.1555686742067337, -0.46312999725341797, 0.09272274374961853, 0.38324421644210815, 0.39584964513778687, -0.24313685297966003, -0.14360857009887695, 0.17843474447727203, -0.01853800378739834, 0.07349242269992828, 0.2377612292766571, 0.09553639590740204, -0.2941362261772156, -0.1417420208454132, -0.25148260593414307, -0.20621258020401, -0.14880946278572083, 0.03077426552772522, -0.33391064405441284 ]
https://github.com/huggingface/datasets/issues/5797
Hi @haonan-li , thank you for the report! It seems to be a bug on the [`huggingface_hub`](https://github.com/huggingface/huggingface_hub) site, there is even no such dataset as `mbzuai/bactrian-x` on the Hub. I opened and [issue](https://github.com/huggingface/huggingface_hub/issues/1453) there.
load_dataset is case sentitive?
### Describe the bug load_dataset() function is case sensitive? ### Steps to reproduce the bug The following two code, get totally different behavior. 1. load_dataset('mbzuai/bactrian-x','en') 2. load_dataset('MBZUAI/Bactrian-X','en') ### Expected behavior Compare 1 and 2. 1 will download all 52 subsets, shell output: ```Downloading and preparing dataset json/MBZUAI--bactrian-X to xxx``` 2 will only download single subset, shell output ```Downloading and preparing dataset bactrian-x/en to xxx``` ### Environment info Python 3.10.11 datasets Version: 2.11.0
34
load_dataset is case sentitive? ### Describe the bug load_dataset() function is case sensitive? ### Steps to reproduce the bug The following two code, get totally different behavior. 1. load_dataset('mbzuai/bactrian-x','en') 2. load_dataset('MBZUAI/Bactrian-X','en') ### Expected behavior Compare 1 and 2. 1 will download all 52 subsets, shell output: ```Downloading and preparing dataset json/MBZUAI--bactrian-X to xxx``` 2 will only download single subset, shell output ```Downloading and preparing dataset bactrian-x/en to xxx``` ### Environment info Python 3.10.11 datasets Version: 2.11.0 Hi @haonan-li , thank you for the report! It seems to be a bug on the [`huggingface_hub`](https://github.com/huggingface/huggingface_hub) site, there is even no such dataset as `mbzuai/bactrian-x` on the Hub. I opened and [issue](https://github.com/huggingface/huggingface_hub/issues/1453) there.
[ -0.06685242056846619, -0.5496715307235718, -0.03464435786008835, 0.6700536608695984, 0.27767282724380493, 0.1026126891374588, 0.35231417417526245, 0.06252647936344147, 0.01295839250087738, 0.11858697235584259, -0.3184036314487457, 0.27620506286621094, 0.1577237844467163, -0.0058811381459236145, 0.2371375411748886, -0.09099188446998596, 0.20298179984092712, -0.011581644415855408, -0.09625518321990967, -0.22510725259780884, -0.11237987875938416, 0.31028708815574646, -0.32226765155792236, 0.11484082043170929, 0.02921833097934723, 0.07663269340991974, 0.008663289248943329, 0.3653796315193176, -0.1889386624097824, -0.41067931056022644, 0.5353389382362366, 0.19493688642978668, -0.05173769220709801, 0.2946670651435852, -0.000121170531201642, -0.002093076705932617, 0.4827682673931122, -0.22297674417495728, -0.2897511422634125, -0.3444228768348694, -0.40297019481658936, -0.0946115106344223, 0.21252897381782532, -0.07403388619422913, -0.038986608386039734, 0.14411576092243195, -0.05023251473903656, -0.13878226280212402, 0.2932927906513214, 0.2924002408981323, 0.12689031660556793, 0.47257012128829956, 0.06269104033708572, -0.03880947083234787, 0.09683612734079361, 0.05236015096306801, -0.20445501804351807, 0.14527755975723267, 0.37363293766975403, 0.3021319806575775, 0.1629197597503662, 0.026083197444677353, -0.0328899584710598, 0.014973532408475876, 0.047178011387586594, 0.12080123275518417, -0.3178800940513611, -0.24338345229625702, 0.1761009693145752, 0.40277886390686035, 0.5190694332122803, -0.2561666965484619, -0.48939281702041626, -0.37379220128059387, -0.16006678342819214, -0.23023270070552826, 0.4242006838321686, 0.41900646686553955, -0.05143870785832405, 0.030570946633815765, -0.10507426410913467, 0.2882627844810486, -0.14059826731681824, 0.10988210141658783, -0.10558226704597473, 0.1465519219636917, -0.38100335001945496, 0.2982538342475891, -0.08815954625606537, 0.002129204571247101, 0.13504789769649506, -0.4712432026863098, 0.12159685045480728, 0.12130004912614822, -0.16103169322013855, 0.06464995443820953, 0.16014117002487183, 0.3912031352519989, 0.19972246885299683, 0.06039724498987198, 0.17943714559078217, 0.2535836696624756, -0.30028674006462097, 0.15353304147720337, 0.37464839220046997, 0.12686249613761902, 0.31407371163368225, 0.049822788685560226, 0.12686212360858917, 0.30332544445991516, -0.01333211362361908, 0.10926667600870132, -0.053482890129089355, 0.06380225718021393, -0.18078270554542542, -0.06077238544821739, 0.2798241972923279, -0.18650326132774353, -0.45522040128707886, -0.07040594518184662, 0.024750560522079468, -0.12341330200433731, 0.013266321271657944, 0.4334565997123718, 0.05143541842699051, -0.058432988822460175, -0.21869704127311707, 0.4040957987308502, -0.21893686056137085, -0.07741344720125198, -0.21039102971553802, -0.1534179151058197, 0.14728859066963196, -0.09974496811628342, 0.12600739300251007, -0.3828190863132477, 0.2948848605155945, 0.12559407949447632, -0.07070329040288925, -0.29993849992752075, -0.06130136922001839, -0.0809546411037445, 0.11022250354290009, 0.0940190851688385, 0.058507099747657776, 0.35489070415496826, 0.12858614325523376, -0.26205164194107056, -0.22749415040016174, 0.24100284278392792, -0.16492944955825806, 0.07143248617649078, 0.13669440150260925, 0.02987971529364586, -0.36717286705970764, 0.01213105209171772, -0.27765077352523804, 0.33952778577804565, -0.12322890013456345, -0.03700454905629158, 0.23306794464588165, 0.04996717721223831, -0.38452664017677307, -0.22117111086845398, 0.07397063821554184, 0.5885311365127563, -0.14837726950645447, -0.2930883765220642, 0.12871620059013367, -0.19272620975971222, 0.07160910964012146, 0.05101219192147255, -0.3135547637939453, 0.06680348515510559, -0.3090131878852844, 0.13901737332344055, 0.27900344133377075, -0.5562726855278015, -0.5413029193878174, -0.15532377362251282, -0.2006000280380249, 0.43721261620521545, 0.08428160846233368, -0.02698616310954094, -0.34670305252075195, -0.03681831806898117, -0.021351195871829987, 0.22912774980068207, 0.21756932139396667, 0.012382864952087402, 0.010647721588611603, -0.13356198370456696, 0.228554368019104, -0.005976952612400055, -0.3304954767227173, 0.16753943264484406, 0.1978202611207962, -0.01660572737455368, 0.5386756658554077, 0.05853977054357529, 0.03897576779127121, 0.2501102387905121, -0.08756685256958008, -0.042992252856492996, 0.04229080304503441, -0.09873253107070923, -0.3079257905483246, 0.28134042024612427, 0.05171374976634979, 0.02752208709716797, -0.0841289684176445, -0.0007275193929672241, -0.34073859453201294, -0.10026393830776215, -0.3431463837623596, -0.06314079463481903, 0.05160302296280861, 0.28437599539756775, 0.19137564301490784, 0.1652291715145111, -0.16491363942623138, 0.6269912719726562, 0.15447136759757996, 0.2550268769264221, -0.5645840764045715, 0.05044949799776077, 0.25915953516960144, -0.09077373147010803, 0.029945269227027893, -0.09992623329162598, 0.28706851601600647, -0.2505555748939514, -0.18085609376430511, 0.2117002308368683, 0.25297442078590393, 0.4940986931324005, -0.23742759227752686, -0.29130661487579346, 0.024738045409321785, 0.46908730268478394, -0.14837348461151123, 0.07235275208950043, 0.2933512032032013, 0.10276907682418823, -0.3114740550518036, 0.5724546313285828, 0.032131027430295944, -0.01013413816690445, 0.032318904995918274, -0.22348247468471527, 0.17605414986610413, 0.09027381241321564, -0.12283842265605927, -0.21610701084136963, 0.3325966000556946, -0.03524688631296158, 0.3479551076889038, 0.03266620635986328, -0.2660480737686157, 0.0013389848172664642, 0.4450557231903076, -0.2704318165779114, 0.12837152183055878, 0.12161868810653687, -0.10184076428413391, -0.0486932098865509, 0.2095080018043518, 0.1203392967581749, 0.5930083394050598, -0.02864515781402588, 0.016002831980586052, 0.1437598615884781, 0.29579833149909973, -0.0917925089597702, 0.34677672386169434, 0.21046893298625946, 0.014025852084159851, -0.0924294963479042, 0.3067842423915863, -0.08935478329658508, -0.4140111804008484, 0.21663109958171844, 0.09378083050251007, -0.1590796709060669, -0.5024929046630859, 0.0754169225692749, -0.28454551100730896, 0.12380650639533997, -0.21055084466934204, 0.0012647509574890137, -0.14881043136119843, 0.02692466229200363, -0.2512918710708618, 0.18311822414398193, -0.003461770713329315, -0.19207483530044556, 0.015928111970424652, 0.38479819893836975, -0.023775018751621246, -0.155034139752388, -0.28347718715667725, 0.19821174442768097, -0.29834696650505066, -0.05905267596244812, 0.0589568093419075, -0.12998169660568237, 0.11816427111625671, -0.4183194637298584, -0.021696820855140686, -0.049896083772182465, -0.2702426314353943, 0.298784077167511, -0.15049771964550018, 0.1899968832731247, 0.18615174293518066, -0.10379581153392792, -0.17929184436798096, 0.032252077013254166, 0.3016507625579834, 0.1684650182723999, -0.2308359444141388, 0.125311940908432, 0.23350772261619568, -0.01480386033654213, 0.07501029968261719, -0.20175883173942566, -0.3266605734825134, -0.21867413818836212, 0.635294497013092, 0.08102087676525116, 0.2348570078611374, -0.06298132240772247, -0.34730949997901917, -0.11842983961105347, -0.426653116941452, 0.23801551759243011, -0.26138269901275635, -0.5894554853439331, 0.15054818987846375, -0.3367564082145691, -0.505635142326355, -0.36722829937934875, 0.22108879685401917, 0.33808398246765137, -0.17793311178684235, -0.35011470317840576, -0.32862338423728943, -0.13222727179527283, 0.08068835735321045, -0.03395846113562584, 0.17096203565597534, 0.2811819612979889, 0.0024165138602256775, 0.07343615591526031, -0.3072589635848999, -0.3044965863227844, 0.040854450315237045, 0.18735630810260773, -0.11605922877788544, 0.022099114954471588, 0.0556526705622673, -0.07576210796833038, 0.06835252046585083, 0.47850045561790466, 0.18450897932052612, 0.6553211808204651, 0.04104684293270111, 0.23866353929042816, -0.24249084293842316, -0.18610629439353943, 0.09184078872203827, -0.009213291108608246, 0.11732947826385498, 0.3485296368598938, 0.0954064130783081, -0.03051568754017353, -0.28670716285705566, -0.4336441159248352, -0.3617013990879059, -0.25797003507614136, -0.0853320062160492, 0.19565153121948242, -0.20569345355033875, 0.24160248041152954, 0.13874705135822296, -0.3068118095397949, -0.07528705149888992, -0.04369518905878067, 0.1142059862613678, 0.24327480792999268, -0.05029141157865524, -0.31972259283065796, -0.08343061804771423, -0.27691274881362915, 0.21638143062591553, -0.030950646847486496, 0.4306927025318146, 0.05840851366519928, 0.012815997004508972, 0.17180775105953217, 0.08278703689575195, 0.7687722444534302, -0.09297680109739304, 0.43816328048706055, 0.031645603477954865, -0.22194257378578186, -0.8447713851928711, -0.03355032578110695, -0.3219839930534363, 0.2971303164958954, -0.1991768628358841, 0.5526583194732666, -0.27758491039276123, -0.17056629061698914, -0.17947271466255188, 0.23192541301250458, 0.0019202232360839844, -0.22764481604099274, -0.3755034804344177, -0.2634758949279785, -0.2549934387207031, 0.1125439926981926, -0.017032422125339508, 0.23461255431175232, 0.003775324672460556, -0.16170254349708557, 0.0003228038549423218, -0.014339186251163483, -0.08102293312549591, 0.08716557919979095, 0.19029060006141663, 0.04076781123876572, 0.22639653086662292, 0.16713836789131165, 0.052632465958595276, 0.01246308721601963, 0.8285439014434814, -0.12022027373313904, -0.6118664741516113, 0.02646563947200775, 0.012070052325725555, 0.07195665687322617, 0.4891388416290283, -0.15135324001312256, 0.11635182797908783, 0.002816455438733101, 0.09726817160844803, -0.6046720147132874, 0.07231931388378143, 0.4539662003517151, 0.2612953782081604, -0.2740536630153656, -0.3070765733718872, 0.4361323416233063, -0.09001230448484421, -0.19655750691890717, 0.4343245327472687, 0.5138424634933472, -0.30366337299346924, 0.2304110825061798, -0.31566786766052246, 0.896165132522583, 0.09233865141868591, 0.218168243765831, 0.15102197229862213, -0.36192256212234497, 0.5953710079193115, -0.019436098635196686, 0.0846574604511261, -0.2286270558834076, -0.22661586105823517, -0.11854858696460724, -0.2214677631855011, 0.17328326404094696, 0.16102968156337738, -0.03302011638879776, 0.2624855041503906, -0.24222081899642944, 0.40832728147506714, 0.173071026802063, 0.14271704852581024, -0.3010093867778778, -0.09196197986602783, -0.5805924534797668, 0.01604563742876053, 0.1665189564228058, 0.41335031390190125, 0.0919024795293808, -0.02319628745317459, -0.34212327003479004, -0.27051156759262085, -0.19005697965621948, 0.04032139480113983, -0.5286805629730225, -0.039057355374097824, 0.03073469176888466, -0.2533261179924011, 0.285311758518219, 0.4960590600967407, 0.2842599153518677, 0.1320292204618454, -0.20552054047584534, 0.28484949469566345, -0.2550429701805115, 0.35819411277770996, 0.05011413246393204, -0.3313907980918884, 0.1459556668996811, -0.024119365960359573, -0.261075884103775, -0.290157288312912, -0.17226293683052063, 0.09362567216157913, -0.044875115156173706, 0.3299775719642639, -0.07183177769184113, -0.4406532347202301, -0.3150085508823395, -0.2075652927160263, 0.26218193769454956, -0.3002639412879944, 0.02847839891910553, 0.11105631291866302, -0.10081011056900024, 0.10690617561340332, -0.10007954388856888, -0.2955191135406494, -0.11320827156305313, 0.7196226119995117, -0.08598130196332932, -0.11335504800081253, 0.3233219385147095, -0.055411823093891144, -0.047958116978406906, -0.10811536759138107, 0.12054786086082458, 0.5535900592803955, -0.5058072805404663, 0.24483636021614075, -0.058054301887750626, 0.03130725026130676, -0.2699321508407593, 0.22684499621391296, -0.13100731372833252, -0.06073436886072159, -0.07454094290733337, -0.323591411113739, 0.02133934199810028, -0.04190901294350624, 0.17688582837581635, -0.042328402400016785, 0.314689576625824, -0.18033474683761597, 0.011898867785930634, 0.03678224980831146, -0.19710978865623474, 0.14627480506896973, -0.15072205662727356, 0.00819537602365017, 0.19452333450317383, 0.1877056062221527, 0.2524915635585785, -0.19842348992824554, 0.07805588841438293, 0.31145960092544556, -0.119753897190094, -0.15054787695407867, -0.22339797019958496, 0.20653322339057922, -0.08878755569458008, -0.1102583259344101, 0.11404438316822052, -0.12458105385303497, -0.01717568375170231, -0.30813899636268616, 0.5262411832809448, 0.20730775594711304, 0.061622243374586105, -0.012569330632686615, 0.11965663731098175, 0.07172488421201706, -0.17103934288024902, 0.08450528979301453, -0.2966996729373932, 0.20489823818206787, 0.15539708733558655, 0.14472141861915588, -0.020091114565730095, 0.004970632493495941, -0.009665068238973618, 0.10329551994800568, 0.29921573400497437, 0.08412151038646698, 0.2037169486284256, -0.31413090229034424, -0.10632316768169403, -0.024220621213316917, 0.3265581727027893, 0.4721895456314087, -0.3414900600910187, -0.005355484783649445, 0.02563175931572914, 0.06898879259824753, -0.12475992739200592, -0.44583743810653687, 0.05507796257734299, -0.10966228693723679, 0.09306593984365463, 0.24013963341712952, 0.15699094533920288, -0.09776221215724945, -0.17269493639469147, -0.22694940865039825, 0.8319823741912842, 0.20549750328063965, 0.18503355979919434, 0.41394394636154175, -0.2203536331653595, 0.21930737793445587, 0.18786807358264923, 0.16783767938613892, 0.06564590334892273, 0.4868309497833252, 0.10710054636001587, 0.3570783734321594, 0.19778335094451904, 0.22744809091091156, 0.34529876708984375, -0.38180750608444214, 0.3403349220752716, 0.16081127524375916, -0.19174811244010925, 0.06155446171760559, -0.0639578327536583, 0.351868212223053, -0.18731406331062317, 0.03345015272498131, -0.18012818694114685, -0.08033615350723267, -0.13524559140205383, -0.3545086085796356, 0.0032612085342407227, -0.282497763633728, -0.11248143017292023, 0.1272478699684143, -0.289755642414093, -0.24413344264030457, 0.0602075532078743, 0.03186524286866188, 0.07714936882257462, -0.2976895570755005, -0.364101767539978, -0.002954946830868721, 0.12751740217208862, -0.3421699106693268, 0.38588747382164, 0.3369934856891632, -0.06253078579902649, 0.047216106206178665, 0.1263567954301834, 0.5186325311660767, 0.0951014831662178, 0.14814379811286926, 0.08744087815284729, 0.052567753940820694, -0.034344594925642014, -0.09076077491044998, 0.2905702590942383, 0.22423383593559265, 0.2965646982192993, 0.1929784119129181, 0.10059908032417297, 0.008170545101165771, -0.1695779412984848, 0.2291998416185379, 0.09185216575860977, -0.47159433364868164, 0.08557938039302826, -0.7005247473716736, 0.13678796589374542, -0.3169378638267517, -0.0339040644466877, -0.24353541433811188, 0.15277040004730225, 0.27243560552597046, 0.09699434041976929, 0.19307482242584229, -0.043204691261053085, 0.027281299233436584, 0.23519310355186462, 0.4779706597328186, -0.06616298109292984, 0.04643130674958229, -0.22494198381900787, -0.17701417207717896, -0.44367313385009766, 0.302525132894516, 0.3671667277812958, -0.04302969574928284, 0.039814505726099014, -0.047167494893074036, 0.09113872796297073, 0.010985314846038818, -0.02427028864622116, 0.10337379574775696, 0.11251947283744812, 0.2388634830713272, -0.1592831313610077, -0.14749053120613098, 0.13291428983211517, 0.19066911935806274, -0.04575110226869583, -0.2606152296066284, 0.4504382014274597, -0.22292834520339966, -0.11033275723457336, -0.31438779830932617, 0.1470840573310852, -0.0653754249215126, -0.2520640790462494, 0.4774796962738037, 0.3338257074356079, 0.3667219877243042, -0.265575110912323, -0.15531709790229797, -0.3206225037574768, -0.04341423884034157, -0.2076577991247177, 0.1877901554107666, -0.24128586053848267, 0.06786153465509415, -0.13064220547676086, -0.27477651834487915, -0.22277648746967316, 0.06715112924575806, -0.00007567554712295532, 0.3121071755886078, -0.02940540388226509, -0.07646803557872772, -0.11712048202753067, -0.05328383669257164, 0.13725365698337555, 0.15095534920692444, -0.0960480272769928, 0.06509063392877579, -0.16529741883277893, -0.4394141435623169, 0.5230992436408997, -0.24325081706047058, -0.32707107067108154, -0.03419630974531174, 0.315125048160553, -0.051055602729320526, -0.3348388075828552, -0.43303167819976807, 0.202226459980011, 0.3361356556415558, -0.03723239153623581, -0.30470705032348633, 0.42102938890457153, -0.06432740390300751, -0.10876807570457458, -0.006238512694835663, 0.21759751439094543, 0.3412408232688904, -0.24033555388450623, 0.24387355148792267, -0.32663366198539734 ]
https://github.com/huggingface/datasets/issues/5797
I think `load_dataset("mbzuai/bactrian-x")` shouldn't be loaded at all and raise an error but because of [this fallback](https://github.com/huggingface/datasets/blob/main/src/datasets/load.py#L1194) to packaged loaders when no other options are applicable, it loads the dataset with standard `json` loader instead of the custom loading script.
load_dataset is case sentitive?
### Describe the bug load_dataset() function is case sensitive? ### Steps to reproduce the bug The following two code, get totally different behavior. 1. load_dataset('mbzuai/bactrian-x','en') 2. load_dataset('MBZUAI/Bactrian-X','en') ### Expected behavior Compare 1 and 2. 1 will download all 52 subsets, shell output: ```Downloading and preparing dataset json/MBZUAI--bactrian-X to xxx``` 2 will only download single subset, shell output ```Downloading and preparing dataset bactrian-x/en to xxx``` ### Environment info Python 3.10.11 datasets Version: 2.11.0
40
load_dataset is case sentitive? ### Describe the bug load_dataset() function is case sensitive? ### Steps to reproduce the bug The following two code, get totally different behavior. 1. load_dataset('mbzuai/bactrian-x','en') 2. load_dataset('MBZUAI/Bactrian-X','en') ### Expected behavior Compare 1 and 2. 1 will download all 52 subsets, shell output: ```Downloading and preparing dataset json/MBZUAI--bactrian-X to xxx``` 2 will only download single subset, shell output ```Downloading and preparing dataset bactrian-x/en to xxx``` ### Environment info Python 3.10.11 datasets Version: 2.11.0 I think `load_dataset("mbzuai/bactrian-x")` shouldn't be loaded at all and raise an error but because of [this fallback](https://github.com/huggingface/datasets/blob/main/src/datasets/load.py#L1194) to packaged loaders when no other options are applicable, it loads the dataset with standard `json` loader instead of the custom loading script.
[ -0.1830030381679535, -0.206563338637352, -0.04697946831583977, 0.5480949282646179, 0.21820707619190216, 0.08676287531852722, 0.48070839047431946, 0.09932515770196915, 0.12416321039199829, 0.07165084034204483, -0.10154447704553604, 0.3830937147140503, 0.06103039160370827, -0.059567153453826904, 0.2094109058380127, -0.028068745508790016, 0.13580530881881714, 0.1031838208436966, -0.15798233449459076, -0.028327271342277527, -0.22420772910118103, 0.24372830986976624, -0.4207446277141571, 0.07734063267707825, 0.3310723900794983, 0.0493931844830513, 0.10530205070972443, 0.2917706370353699, -0.14384441077709198, -0.44940656423568726, 0.5246886014938354, 0.19447970390319824, 0.09372161328792572, 0.2991345226764679, -0.00011564944725250825, -0.03957800567150116, 0.5359722971916199, -0.26037436723709106, -0.414288192987442, -0.3295876085758209, -0.4826533794403076, -0.19385460019111633, 0.16327369213104248, -0.17110037803649902, 0.1294640600681305, -0.02787359431385994, -0.07082485407590866, -0.3417206406593323, 0.24778002500534058, 0.2720377743244171, 0.18476581573486328, 0.2624618411064148, -0.07941427081823349, -0.018086818978190422, 0.20589932799339294, -0.04252956807613373, -0.16881173849105835, 0.07307642698287964, 0.3863808512687683, 0.14553290605545044, 0.15948985517024994, -0.05861295759677887, -0.12364925444126129, -0.03433746099472046, -0.12087024748325348, 0.13480262458324432, -0.21504423022270203, -0.2001243680715561, 0.13539889454841614, 0.3397667109966278, 0.7126581072807312, -0.2420204132795334, -0.4296078681945801, -0.36212000250816345, -0.1472141444683075, -0.2964290380477905, 0.5123316049575806, 0.2818925082683563, -0.10034181922674179, 0.0026342603377997875, 0.04097292572259903, 0.34551334381103516, -0.1264275759458542, 0.12550416588783264, -0.1884550005197525, 0.11254574358463287, -0.368019163608551, 0.254783570766449, 0.025607595220208168, -0.00212126225233078, 0.18842186033725739, -0.4643803834915161, 0.025868354365229607, 0.13767124712467194, -0.1058797836303711, 0.01554473489522934, 0.10000936686992645, 0.04469108581542969, 0.16621822118759155, 0.0775911808013916, 0.24777041375637054, 0.21896705031394958, -0.2217116355895996, 0.15769842267036438, 0.38282498717308044, 0.18329499661922455, 0.25889065861701965, 0.05571220442652702, 0.26824912428855896, 0.46352407336235046, 0.020845770835876465, 0.1357395499944687, -0.12419713288545609, 0.0022063106298446655, 0.10599599778652191, -0.0614190436899662, 0.3988286852836609, -0.19752945005893707, -0.392945796251297, -0.03516164794564247, 0.11621681600809097, -0.18593409657478333, -0.08293680846691132, 0.33430740237236023, 0.0001828111708164215, 0.11225273460149765, -0.172662153840065, 0.29059919714927673, -0.08129164576530457, -0.12633202970027924, -0.11844287067651749, -0.2894110679626465, 0.1384347677230835, -0.06889813393354416, 0.14710447192192078, -0.1619868278503418, 0.2782894968986511, 0.19890061020851135, -0.20883582532405853, -0.18616023659706116, 0.06996963918209076, -0.06601361930370331, -0.014953698962926865, 0.13751736283302307, 0.008891977369785309, 0.21274107694625854, 0.13547033071517944, -0.2426169216632843, -0.16272878646850586, 0.3289268910884857, -0.18937769532203674, 0.02544882893562317, 0.11943282932043076, 0.141218364238739, -0.30885982513427734, -0.029211483895778656, -0.44521552324295044, 0.2250932902097702, 0.01606496050953865, -0.18017134070396423, 0.15979483723640442, -0.1822723150253296, -0.25338900089263916, -0.3241526484489441, 0.06363441795110703, 0.6062983870506287, -0.5462004542350769, -0.13864517211914062, -0.0685732439160347, -0.20305103063583374, 0.28931868076324463, -0.05984000116586685, -0.376404732465744, 0.004378946498036385, -0.3019331693649292, -0.09062715619802475, 0.4134864807128906, -0.3379374146461487, -0.5132608413696289, -0.0029861629009246826, -0.21259525418281555, 0.5513937473297119, 0.19480247795581818, -0.02671860344707966, -0.21813006699085236, -0.10421445965766907, -0.04092194885015488, 0.3494340479373932, 0.13183245062828064, 0.08935921639204025, 0.059037476778030396, -0.07456392794847488, 0.45177412033081055, 0.08986857533454895, -0.3706153929233551, 0.2132779359817505, 0.14174583554267883, -0.003940630704164505, 0.4112215042114258, -0.0555371418595314, -0.06157718598842621, 0.20337115228176117, -0.0890142023563385, -0.0864032730460167, 0.10397425293922424, -0.01247096061706543, -0.489045649766922, 0.2834194302558899, 0.10813989490270615, -0.04305211454629898, -0.14590737223625183, 0.046502530574798584, -0.22856943309307098, -0.06102508679032326, -0.41296112537384033, 0.013327453285455704, 0.08821024745702744, 0.44181373715400696, 0.004110224545001984, 0.1128683090209961, -0.17391064763069153, 0.4520847499370575, -0.010432161390781403, 0.15841840207576752, -0.41379034519195557, -0.16358104348182678, 0.19618462026119232, -0.017908988520503044, 0.01892019808292389, -0.19039291143417358, 0.16852419078350067, -0.3055543303489685, -0.24464979767799377, 0.23837077617645264, 0.45482945442199707, 0.3083280324935913, -0.3494284451007843, -0.32856351137161255, -0.09173597395420074, 0.5120561718940735, -0.07314145565032959, 0.15427373349666595, 0.3201800286769867, -0.04259505122900009, -0.3836704194545746, 0.5349050760269165, 0.013526739552617073, 0.07543548941612244, -0.011305645108222961, -0.30421182513237, 0.25249630212783813, 0.07188722491264343, -0.12621194124221802, -0.21793422102928162, 0.21656405925750732, -0.16217386722564697, 0.4012145400047302, 0.06462985277175903, -0.3153226971626282, 0.010562438517808914, 0.3979599177837372, -0.2648928165435791, 0.12752781808376312, 0.1419697403907776, 0.0411907434463501, -0.1463252305984497, 0.1817326694726944, 0.28856998682022095, 0.663209080696106, 0.039811212569475174, -0.05690751597285271, 0.07094923406839371, 0.283793568611145, -0.07508736848831177, 0.37121593952178955, 0.11946329474449158, 0.11162128299474716, -0.07081560045480728, 0.26883453130722046, -0.01572677493095398, -0.24474284052848816, 0.1024688333272934, 0.10686106234788895, -0.12704740464687347, -0.5131590366363525, 0.15316900610923767, -0.2981486916542053, 0.07087971270084381, -0.17003746330738068, 0.1513083577156067, 0.008791983127593994, -0.08332383632659912, -0.3065686821937561, 0.17047050595283508, -0.11576034128665924, -0.12763789296150208, -0.15466520190238953, 0.4315367341041565, 0.10775502771139145, -0.3390052914619446, -0.22401054203510284, 0.16415339708328247, -0.3347223699092865, 0.0292678065598011, 0.05202685296535492, -0.29271429777145386, 0.17294259369373322, -0.36493179202079773, -0.18255656957626343, -0.05216394364833832, -0.23970887064933777, 0.23636619746685028, -0.18883034586906433, 0.15959568321704865, 0.31820225715637207, -0.030647531151771545, 0.0322134867310524, 0.045917775481939316, 0.20374120771884918, 0.19654913246631622, -0.16736069321632385, 0.2081717848777771, 0.17753247916698456, 0.00611119344830513, -0.009972751140594482, -0.3838456869125366, -0.30313965678215027, -0.3424340784549713, 0.3070339262485504, 0.12589025497436523, 0.19057683646678925, 0.08070234954357147, -0.19353249669075012, -0.06263250857591629, -0.11008898168802261, 0.2837459444999695, -0.19523245096206665, -0.5376360416412354, 0.2168482542037964, -0.3275529146194458, -0.41637444496154785, -0.3473071753978729, 0.2762044668197632, 0.29556888341903687, 0.04381744563579559, -0.46799591183662415, -0.2449072301387787, -0.05813533812761307, 0.05264311283826828, -0.08017425984144211, 0.12587465345859528, 0.18334951996803284, 0.13872793316841125, 0.04700130224227905, -0.30177074670791626, -0.29305288195610046, 0.014513973146677017, 0.1129499226808548, 0.08444878458976746, 0.20388703048229218, 0.36239370703697205, -0.1330839842557907, 0.2656925618648529, 0.2702029347419739, 0.03770837560296059, 0.6261065006256104, 0.0389404222369194, 0.3042267858982086, -0.20153513550758362, -0.1468227505683899, -0.11044757068157196, -0.0006263777613639832, 0.12342455983161926, 0.21146434545516968, -0.09109869599342346, -0.2849608063697815, -0.2730686664581299, -0.25767451524734497, -0.2529523968696594, -0.12246779352426529, 0.06773902475833893, 0.026618465781211853, -0.17976261675357819, 0.15587611496448517, 0.10575982928276062, -0.23336577415466309, 0.014617584645748138, -0.038525938987731934, 0.04865943640470505, 0.29469719529151917, -0.06946751475334167, -0.27785593271255493, 0.20513954758644104, -0.08103661239147186, 0.250629723072052, -0.06909710168838501, 0.46648064255714417, 0.15101343393325806, -0.04454406723380089, 0.018735870718955994, 0.010657168924808502, 0.7269220352172852, -0.2348565012216568, 0.44667506217956543, 0.19734546542167664, -0.1980981081724167, -0.7622733116149902, -0.09996742010116577, -0.3406919538974762, 0.2882257401943207, -0.1817501187324524, 0.3986441195011139, -0.27593058347702026, -0.09798945486545563, -0.09729573130607605, 0.3378410339355469, -0.07093677669763565, -0.3443647027015686, -0.3141375184059143, -0.22058336436748505, -0.25067296624183655, 0.06339084357023239, -0.11828278005123138, 0.09190655499696732, -0.10202733427286148, -0.16530919075012207, -0.005876682698726654, 0.03055863082408905, -0.1648407131433487, 0.14882051944732666, 0.09848186373710632, -0.022314034402370453, 0.21552801132202148, 0.04171091690659523, 0.054456811398267746, 0.1317751407623291, 0.7718014717102051, -0.19287548959255219, -0.6650065183639526, -0.008880238980054855, 0.07810203731060028, 0.17305874824523926, 0.2944919466972351, -0.24653856456279755, -0.07040801644325256, 0.015100046992301941, -0.04466291144490242, -0.3869480788707733, 0.09139889478683472, 0.5084448456764221, 0.14055880904197693, -0.384176641702652, -0.5591737031936646, 0.4245834946632385, -0.04852762818336487, -0.2729032635688782, 0.4489906132221222, 0.2518649995326996, -0.3326141834259033, 0.38125312328338623, -0.33187544345855713, 0.6331075429916382, 0.078799769282341, 0.20987507700920105, 0.20094546675682068, -0.26335763931274414, 0.474825382232666, -0.045187871903181076, -0.025921951979398727, -0.22330641746520996, -0.08603489398956299, -0.05651590973138809, -0.2558888792991638, 0.1900603175163269, 0.1854393184185028, -0.09905991703271866, 0.38449496030807495, -0.3427141308784485, 0.29178935289382935, 0.26092565059661865, 0.11583243310451508, -0.08203664422035217, -0.1537875533103943, -0.5365632176399231, 0.07166072726249695, 0.1655804067850113, 0.16889923810958862, 0.04104037955403328, 0.04231654480099678, -0.11050014942884445, -0.2086937427520752, -0.09847764670848846, 0.22669675946235657, -0.40096089243888855, -0.015580670908093452, -0.0707363411784172, -0.306698739528656, 0.34090450406074524, 0.5019886493682861, 0.07775910198688507, 0.17036527395248413, -0.04909893870353699, 0.13130128383636475, -0.27440035343170166, 0.4457608759403229, 0.15247926115989685, -0.30842125415802, 0.29637426137924194, -0.01223946362733841, -0.12460784614086151, -0.2171122133731842, -0.29371240735054016, 0.019296318292617798, 0.06962405145168304, 0.24256330728530884, 0.07636784017086029, -0.5140822529792786, -0.30791303515434265, -0.35729020833969116, 0.2850286662578583, -0.3411528468132019, 0.06908649206161499, 0.08857382088899612, -0.07816818356513977, 0.15897299349308014, -0.19581732153892517, -0.26920515298843384, -0.04585396125912666, 0.5817400217056274, -0.08259277045726776, 0.03885146975517273, 0.3839074969291687, -0.0252092108130455, -0.013928674161434174, -0.13748271763324738, 0.08772784471511841, 0.4116775691509247, -0.3111788332462311, 0.326425164937973, -0.016763782128691673, -0.023535937070846558, -0.1275458186864853, 0.2664099633693695, -0.07561352849006653, -0.14213955402374268, -0.09291451424360275, -0.40898093581199646, -0.04020002484321594, -0.04369109123945236, 0.211977019906044, -0.024024151265621185, 0.44592463970184326, -0.4737766981124878, -0.0586685836315155, -0.07248085737228394, -0.239899680018425, 0.08272098749876022, -0.07063911110162735, 0.09421168267726898, 0.3217630684375763, 0.32481399178504944, 0.15175080299377441, -0.04453277960419655, 0.13482409715652466, 0.22150620818138123, -0.0709853544831276, -0.19835852086544037, -0.16198419034481049, 0.19236844778060913, -0.12248677015304565, -0.15046995878219604, 0.07803916931152344, -0.3234218955039978, -0.07882311195135117, -0.27865540981292725, 0.4761802852153778, 0.021149933338165283, 0.014095594175159931, -0.0016451962292194366, 0.019251596182584763, 0.10616373270750046, -0.19052600860595703, 0.2411610335111618, -0.43072980642318726, 0.1058831661939621, 0.140694260597229, 0.27451786398887634, -0.04124325141310692, -0.12989258766174316, -0.08593696355819702, 0.06801410019397736, 0.29883530735969543, 0.179122656583786, 0.30889374017715454, -0.41787299513816833, -0.0052149370312690735, 0.05757618322968483, 0.21971926093101501, 0.491514652967453, -0.405335396528244, -0.09859582781791687, 0.002565629780292511, 0.12222474813461304, -0.14859265089035034, -0.4336824119091034, -0.05044201761484146, -0.017986243590712547, 0.022158458828926086, 0.2936287820339203, 0.14077958464622498, -0.23828360438346863, -0.040239401161670685, -0.21928398311138153, 0.9042069911956787, 0.17938822507858276, 0.19753578305244446, 0.3638627231121063, -0.3787665367126465, 0.19921985268592834, 0.11470869183540344, 0.15757867693901062, 0.06096278503537178, 0.43628570437431335, 0.11886081099510193, 0.3036336898803711, 0.34565427899360657, 0.20254600048065186, 0.14696581661701202, -0.37683629989624023, 0.5309723615646362, 0.30342450737953186, -0.1573970913887024, 0.09550429880619049, 0.13561862707138062, 0.22077956795692444, -0.14196619391441345, 0.2043273150920868, -0.11399844288825989, -0.2006894052028656, -0.16026408970355988, -0.22396227717399597, -0.1721690446138382, -0.25725990533828735, 0.04964935779571533, 0.09535034000873566, -0.30732810497283936, -0.21786783635616302, 0.03860919550061226, -0.033851224929094315, 0.013941830024123192, -0.3060741424560547, -0.25721976161003113, -0.10241170227527618, 0.09777864813804626, -0.35070446133613586, 0.42962539196014404, 0.3161526322364807, 0.06632117927074432, 0.1797621250152588, -0.0010889768600463867, 0.5495749711990356, 0.255068302154541, 0.243304044008255, -0.04572879150509834, 0.08823806047439575, -0.07675261050462723, -0.16720519959926605, 0.2978030741214752, 0.07939156889915466, 0.23900671303272247, 0.32104960083961487, 0.1481197476387024, -0.02722827158868313, -0.15300412476062775, 0.3032359480857849, -0.1264873892068863, -0.43968793749809265, -0.018246926367282867, -0.43544861674308777, 0.07323097437620163, -0.283640593290329, 0.08195601403713226, -0.09630011022090912, 0.06331552565097809, 0.3596130907535553, 0.2122589498758316, 0.20160435140132904, 0.06512761116027832, 0.08321533352136612, 0.2557409703731537, 0.3974761664867401, -0.07416324317455292, -0.06877483427524567, -0.13007542490959167, -0.04498372972011566, -0.536141037940979, 0.3760696351528168, 0.3548833727836609, -0.06985799968242645, 0.05257768556475639, -0.1330566257238388, 0.282889723777771, 0.10866456478834152, -0.01972559094429016, 0.2215409278869629, 0.07240557670593262, 0.20592628419399261, -0.22066518664360046, -0.33323949575424194, 0.2064058482646942, 0.23716934025287628, -0.14727377891540527, -0.40309810638427734, 0.32584795355796814, -0.21341465413570404, 0.003346472978591919, -0.31577372550964355, 0.12174076586961746, -0.01800905168056488, -0.18604233860969543, 0.6237620711326599, 0.2856385111808777, 0.37561333179473877, -0.22317269444465637, -0.14574089646339417, -0.3199416995048523, -0.06543152034282684, -0.18379071354866028, 0.20322276651859283, -0.1945551633834839, -0.010680057108402252, -0.1262200027704239, -0.13924981653690338, -0.34210771322250366, 0.094060018658638, -0.12009822577238083, 0.327725350856781, -0.13468244671821594, -0.07300937920808792, -0.12594439089298248, -0.09715142846107483, 0.11506637930870056, -0.04243278503417969, -0.04719870164990425, 0.05992894619703293, -0.2105482518672943, -0.41215869784355164, 0.43221229314804077, -0.1284656822681427, -0.36971136927604675, 0.0006209984421730042, 0.21380998194217682, -0.20733937621116638, -0.10141661763191223, -0.32866930961608887, 0.2226029932498932, 0.4027585983276367, -0.16887570917606354, -0.27799832820892334, 0.32433825731277466, -0.03146971017122269, 0.056942448019981384, -0.03554605320096016, 0.23633675277233124, 0.21187596023082733, -0.21986347436904907, 0.07251264154911041, -0.33485764265060425 ]
https://github.com/huggingface/datasets/issues/5791
The issue with multichannel TIFF images has already been reported in Pillow (https://github.com/python-pillow/Pillow/issues/1888). We can't do much about it on our side. Still, to avoid the error, you can bypass the default Pillow decoding and define a custom one as follows: ```python import tifffile # pip install tifffile dset = dset.cast_column("image", datasets.Image(decode=False)) def decode_mutlichannel_tiff(batch): batch["image"] = [tifffile.imread(image["path"]) for image in batch["image"]] return batch dset.set_transform(decode_mutlichannel_tiff) ``` Regarding the annotations, in which format are they? In the COCO format? I think this is a bit too specific to have a built-in loader for it.
TIFF/TIF support
### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations
92
TIFF/TIF support ### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations The issue with multichannel TIFF images has already been reported in Pillow (https://github.com/python-pillow/Pillow/issues/1888). We can't do much about it on our side. Still, to avoid the error, you can bypass the default Pillow decoding and define a custom one as follows: ```python import tifffile # pip install tifffile dset = dset.cast_column("image", datasets.Image(decode=False)) def decode_mutlichannel_tiff(batch): batch["image"] = [tifffile.imread(image["path"]) for image in batch["image"]] return batch dset.set_transform(decode_mutlichannel_tiff) ``` Regarding the annotations, in which format are they? In the COCO format? I think this is a bit too specific to have a built-in loader for it.
[ -0.09125569462776184, -0.09425428509712219, -0.08832672238349915, 0.17105510830879211, 0.0741666778922081, 0.09101897478103638, 0.263895183801651, 0.053446702659130096, -0.12248209118843079, 0.07831980288028717, -0.28911247849464417, 0.5830967426300049, -0.15723805129528046, 0.2317831814289093, -0.13450661301612854, -0.2943647801876068, -0.04997863993048668, 0.17090074717998505, 0.027785765007138252, 0.25489866733551025, -0.26408833265304565, 0.08400348573923111, -0.060924626886844635, -0.006641298532485962, -0.3182683289051056, -0.04999621957540512, -0.2497580349445343, -0.03693176805973053, -0.223129540681839, -0.3622063100337982, 0.22674869000911713, 0.2626723051071167, 0.21170774102210999, 0.5138146281242371, -0.00011501318658702075, 0.11830447614192963, 0.16121557354927063, -0.2246556580066681, -0.08638376742601395, -0.22818011045455933, 0.21192121505737305, -0.31473129987716675, -0.021177908405661583, -0.2529948055744171, -0.050274185836315155, -0.21689502894878387, 0.060035549104213715, 0.10642816126346588, 0.46233081817626953, 0.08561994135379791, 0.09973195195198059, 0.03249969333410263, 0.3772774636745453, 0.22351549565792084, 0.38135895133018494, 0.5645873546600342, -0.2904675304889679, 0.33542293310165405, 0.45892342925071716, -0.03529229015111923, -0.040665607899427414, 0.47272950410842896, -0.3039092719554901, 0.03436553105711937, 0.3286070227622986, 0.035595376044511795, -0.2058473825454712, -0.297091007232666, -0.37008923292160034, 0.09332530945539474, 0.7099560499191284, -0.12986025214195251, -0.5906049013137817, -0.2793130576610565, 0.10552569478750229, -0.21974170207977295, 0.07488393038511276, 0.24037493765354156, -0.12546461820602417, 0.14164237678050995, 0.012196008116006851, 0.024776756763458252, -0.4371136426925659, 0.2924394905567169, -0.018091149628162384, -0.02133519947528839, -0.1001325324177742, 0.0998380035161972, 0.1631617546081543, -0.041979312896728516, 0.034250978380441666, -0.2566874921321869, 0.06031055003404617, 0.007769592106342316, -0.025029852986335754, -0.12193943560123444, 0.03502573445439339, -0.5376110672950745, 0.05413573235273361, 0.07287923246622086, 0.20188003778457642, 0.08079954981803894, -0.7073826789855957, 0.3500361442565918, 0.3180599510669708, -0.0849677100777626, -0.23213432729244232, 0.2387050837278366, 0.2992333769798279, 0.11643512547016144, 0.18692925572395325, -0.07431675493717194, -0.26161378622055054, 0.15837439894676208, -0.5507381558418274, -0.10150755941867828, -0.053965650498867035, -0.0079512819647789, -0.2238798439502716, -0.25776487588882446, -0.01733480393886566, -0.14699727296829224, -0.1080033928155899, 0.28178587555885315, -0.11934137344360352, 0.4220617711544037, 0.0387292206287384, 0.2702576220035553, 0.2533409297466278, -0.2568442225456238, 0.1616571992635727, 0.22217142581939697, 0.004222415387630463, -0.05182507634162903, 0.14604520797729492, -0.057109154760837555, 0.07057490199804306, -0.33731985092163086, 0.6779220700263977, 0.1426163762807846, 0.25410690903663635, -0.21432922780513763, 0.19145089387893677, 0.1235731989145279, -0.3430759310722351, -0.10869883000850677, 0.15624555945396423, -0.03678610920906067, -0.35427525639533997, 0.30721575021743774, -0.5138573050498962, 0.04691407084465027, -0.031942352652549744, -0.0015613650903105736, 0.0439852774143219, -0.03410147875547409, -0.3811231851577759, 0.25695177912712097, -0.2612224817276001, -0.16922743618488312, 0.0913628339767456, -0.17753291130065918, -0.2331124097108841, -0.42590487003326416, 0.09423793107271194, 0.18292182683944702, -0.3275330662727356, -0.17438025772571564, -0.019653361290693283, -0.26111581921577454, -0.03374402970075607, 0.1783674955368042, 0.016064874827861786, 0.03053225390613079, -0.11388940364122391, 0.02301463484764099, 0.33145225048065186, -0.5434366464614868, -0.19739943742752075, 0.3693557381629944, 0.16755251586437225, 0.4247554540634155, 0.06136957183480263, 0.4634893238544464, 0.3976593315601349, -0.2502809464931488, 0.43070319294929504, 0.16763176023960114, -0.0029204580932855606, 0.03861133009195328, 0.024941161274909973, -0.6265860795974731, 0.10704689472913742, 0.4008813500404358, -0.1982756406068802, -0.07066743075847626, 0.014078371226787567, -0.5257918834686279, 0.1225636899471283, -0.1525285542011261, -0.017430074512958527, -0.0920989066362381, 0.06273603439331055, 0.32559603452682495, -0.08302785456180573, 0.1191055178642273, -0.44144460558891296, 0.19979138672351837, 0.10133145749568939, 0.2914598286151886, -0.0707835704088211, -0.19372567534446716, -0.02572665736079216, 0.0767631009221077, -0.1464964896440506, -0.20603631436824799, 0.027813389897346497, 0.15495091676712036, 0.09526227414608002, 0.19068874418735504, -0.20645636320114136, 0.28835514187812805, -0.11680411547422409, 0.07439900189638138, 0.22829380631446838, 0.24013961851596832, 0.07738758623600006, -0.20439769327640533, 0.2865326404571533, 0.23324842751026154, -0.28489983081817627, -0.3320075273513794, 0.08250400424003601, 0.1746271848678589, 0.14335012435913086, 0.13540980219841003, -0.15797846019268036, 0.27670949697494507, 0.2565270662307739, -0.23429793119430542, -0.005051076412200928, 0.1430421769618988, 0.07549471408128738, -0.28072425723075867, -0.3485506772994995, 0.479436457157135, -0.07979731261730194, 0.02333717793226242, -0.19162054359912872, 0.07656362652778625, 0.2727929651737213, 0.1298363208770752, -0.2922861576080322, -0.15135183930397034, -0.23354247212409973, 0.0598779059946537, -0.17892810702323914, -0.33372604846954346, -0.33434778451919556, -0.1431063860654831, 0.03327718377113342, 0.017449215054512024, 0.05919107422232628, 0.3701359033584595, -0.0393153615295887, 0.1594730019569397, 0.1478566825389862, -0.1310359090566635, 0.4895886778831482, 0.21826274693012238, -0.15866880118846893, -0.18203574419021606, -0.06340571492910385, -0.05893237143754959, 0.06290136277675629, -0.1556439995765686, -0.08734484016895294, 0.17789632081985474, 0.2425869107246399, 0.010962586849927902, -0.20517197251319885, -0.2831013798713684, -0.29410746693611145, -0.05848688259720802, -0.10050811618566513, -0.04359912872314453, -0.08986040204763412, -0.702532172203064, 0.013989415019750595, -0.15916787087917328, -0.16293463110923767, -0.07650469243526459, 0.13370460271835327, 0.24626389145851135, -0.055385179817676544, 0.16599313914775848, -0.11917711794376373, 0.3664279580116272, -0.1565263867378235, -0.10668986290693283, -0.26069387793540955, -0.15050315856933594, -0.03500249236822128, 0.08973640203475952, 0.362882524728775, -0.36663490533828735, 0.4480080306529999, 0.10295778512954712, 0.03209085017442703, 0.009768575429916382, -0.27071356773376465, 0.2530370354652405, -0.1565781980752945, 0.08271220326423645, 0.11587701737880707, 0.34340396523475647, 0.1925939917564392, -0.266448438167572, 0.29978546500205994, 0.2666076719760895, -0.17741580307483673, -0.17122937738895416, 0.16626736521720886, -0.039685316383838654, -0.36472252011299133, -0.13148009777069092, -0.268322229385376, -0.36428672075271606, 0.4265090227127075, 0.23051974177360535, 0.21364015340805054, -0.2741343677043915, 0.4392930865287781, 0.0666283518075943, 0.06922398507595062, -0.004316173493862152, 0.07986533641815186, -0.42856770753860474, 0.5083626508712769, -0.0017328709363937378, -0.302623987197876, 0.12320160865783691, -0.012298759073019028, 0.0911741629242897, 0.02522391453385353, -0.506929874420166, -0.31774699687957764, 0.10941611230373383, 0.3228831887245178, 0.09434657543897629, -0.14582256972789764, -0.12459947168827057, 0.2186538279056549, -0.018190909177064896, -0.08839543163776398, -0.025747697800397873, -0.06791094690561295, 0.2521359324455261, -0.07776226103305817, 0.3512918949127197, -0.1688418835401535, 0.06431462615728378, 0.1371220052242279, 0.06769612431526184, -0.22499828040599823, 0.3709605634212494, 0.27186259627342224, 0.27219125628471375, -0.050523944199085236, -0.06798229366540909, 0.12654158473014832, -0.2754802703857422, 0.2793527841567993, 0.16321530938148499, 0.28154367208480835, -0.29878881573677063, -0.4836415946483612, 0.22083251178264618, -0.27656495571136475, -0.09626013040542603, 0.27345800399780273, -0.2396623194217682, 0.04300280287861824, -0.4434314966201782, -0.3658488988876343, -0.07920172810554504, -0.005783528089523315, 0.1421639323234558, 0.5839426517486572, 0.20130175352096558, -0.17430007457733154, -0.3346024751663208, 0.035963911563158035, -0.02906283736228943, 0.15966758131980896, 0.32828015089035034, -0.17826132476329803, -0.11172748357057571, 0.18711557984352112, -0.042151547968387604, -0.10996328294277191, 0.4643242359161377, -0.3196510672569275, -0.26198357343673706, 0.33630073070526123, 0.3827846348285675, 0.11116277426481247, -0.034444212913513184, -0.09949556738138199, -0.30670732259750366, 0.15780872106552124, 0.7220991253852844, -0.13480757176876068, -0.12275674939155579, -0.028401752933859825, 0.11495202034711838, -0.07597175240516663, 0.1157538890838623, -0.04864213243126869, -0.2737599313259125, -0.20248529314994812, -0.16437453031539917, 0.06682188808917999, -0.1378290057182312, 0.07813248783349991, -0.06494492292404175, 0.021960968151688576, 0.1466435194015503, 0.18485921621322632, 0.07763420045375824, -0.029967185109853745, -0.06860242038965225, -0.13305234909057617, 0.0990462452173233, 0.3212288022041321, 0.5977013111114502, 0.3010618984699249, -0.1653149127960205, -0.6825659275054932, -0.23705634474754333, -0.17725560069084167, 0.18629083037376404, 0.06007977947592735, 0.16737636923789978, 0.08598393201828003, -0.25895121693611145, -0.06402675807476044, -0.5110965371131897, 0.14805448055267334, 0.2761634588241577, -0.09405721724033356, -0.1452033817768097, -0.624642014503479, 0.2854674160480499, -0.05395759642124176, -0.038361161947250366, 0.7429099678993225, -0.28602755069732666, -0.16052407026290894, 0.22354930639266968, 0.41904836893081665, 1.166528582572937, -0.040366943925619125, 0.23689603805541992, 0.4221804440021515, -0.3501712679862976, 0.3965221643447876, -0.2819702625274658, 0.1534757763147354, -0.021577730774879456, -0.03371364250779152, -0.2447759360074997, -0.0601356104016304, 0.31551724672317505, 0.4663441479206085, -0.5156174898147583, -0.11525553464889526, 0.46957656741142273, -0.0959901213645935, 0.03358165919780731, 0.17049121856689453, -0.045987844467163086, -0.2977386713027954, 0.01462601125240326, 0.13791018724441528, 0.06783709675073624, 0.0592087022960186, -0.015324518084526062, -0.27585551142692566, -0.26268041133880615, -0.039136603474617004, -0.32099705934524536, 0.005165286362171173, -0.20159587264060974, 0.19006302952766418, 0.17864078283309937, -0.08205340802669525, 0.15466588735580444, 0.2300378978252411, -0.12791314721107483, -0.40147364139556885, -0.07051239162683487, -0.08611387759447098, -0.10709856450557709, 0.10325964540243149, -0.11471069604158401, -0.16961677372455597, 0.325107216835022, 0.024708077311515808, -0.291542649269104, 0.31048718094825745, 0.008851058781147003, -0.15629778802394867, 0.09976154565811157, 0.09797986596822739, 0.24594593048095703, -0.012377019971609116, -0.16018858551979065, 0.12299403548240662, -0.10004499554634094, 0.06620790809392929, 0.07266627252101898, 0.1549900323152542, 0.26559510827064514, 0.15967178344726562, -0.17576894164085388, 0.10860735177993774, -0.04832341521978378, 0.05797545239329338, 0.014604074880480766, -0.5438056588172913, 0.13342881202697754, 0.08936834335327148, -0.2041301429271698, -0.13118818402290344, 0.3517208695411682, -0.7199928760528564, -0.038238056004047394, 0.0870686024427414, 0.18945658206939697, -0.10169391334056854, -0.30973103642463684, 0.42115095257759094, 0.08061301708221436, 0.11885742843151093, -0.03735813498497009, -0.2227306365966797, -0.17331001162528992, 0.2706185281276703, -0.1033741682767868, 0.3371925950050354, -0.32199716567993164, -0.033711157739162445, 0.27240127325057983, 0.07990553975105286, -0.2275935411453247, 0.028316296637058258, 0.19969815015792847, -0.08189758658409119, 0.7567659616470337, 0.35630330443382263, 0.07229053229093552, 0.0787484347820282, 0.0030067078769207, -0.10542412102222443, -0.1944432556629181, -0.03633108735084534, -0.21977940201759338, 0.17725691199302673, 0.04440101608633995, -0.10081063956022263, -0.10572684556245804, -0.05567228049039841, -0.06277114152908325, -0.15600427985191345, 0.10864339768886566, -0.039068032056093216, -0.46305710077285767, 0.3066971004009247, -0.42384299635887146, 0.3526895344257355, -0.022863656282424927, 0.2676732540130615, 0.012796038761734962, 0.42836207151412964, 0.3744725286960602, -0.10190393030643463, 0.046730536967515945, -0.1430303156375885, -0.15809395909309387, 0.3748325705528259, -0.19649893045425415, -0.11437474936246872, 0.47678837180137634, 0.17806699872016907, 0.161798894405365, 0.004900272935628891, 0.03446463495492935, 0.09700606763362885, 0.0053401365876197815, 0.011969134211540222, 0.45420292019844055, 0.1043856143951416, -0.06516514718532562, -0.1574750542640686, 0.28915324807167053, -0.017464883625507355, 0.09624318778514862, 0.032775282859802246, -0.051209863275289536, 0.19984497129917145, -0.3786291778087616, -0.11876998096704483, 0.42248228192329407, 0.002072550356388092, 0.24834199249744415, 0.43195009231567383, 0.0640694797039032, 0.01631142571568489, -0.2622635066509247, 0.011116443201899529, 0.25318220257759094, -0.20858074724674225, 0.11934888362884521, 0.03890002518892288, -0.047401074320077896, -0.15676531195640564, 0.10734438896179199, -0.3920948803424835, -0.09407159686088562, 0.24614132940769196, 0.1846238523721695, 0.45203882455825806, 0.3031810224056244, 0.39259499311447144, 0.02690325677394867, -0.004853006452322006, -0.010919742286205292, 0.28892961144447327, 0.1433326005935669, -0.03174291551113129, -0.3399805426597595, -0.1589595079421997, -0.24254371225833893, 0.0893309935927391, 0.0878698080778122, 0.036415062844753265, 0.3706704378128052, 0.26740562915802, 0.09221566468477249, 0.09482134878635406, 0.10739991813898087, -0.0819026455283165, 0.4196247160434723, -0.09285537153482437, -0.24309968948364258, 0.5935029983520508, 0.09564219415187836, 0.19316118955612183, 0.1339033544063568, 0.42646756768226624, 0.2811865210533142, 0.23604436218738556, 0.021873794496059418, -0.5004192590713501, -0.03422357514500618, -0.07256656885147095, 0.19514402747154236, -0.08164206892251968, -0.33862829208374023, 0.29721587896347046, 0.0880059152841568, -0.0777612179517746, 0.1523805409669876, -0.10850945115089417, -0.03706806153059006, -0.21714144945144653, 0.14548112452030182, -0.309052050113678, -0.42670848965644836, 0.2009429633617401, -0.1508152186870575, -0.15153880417346954, -0.0683528482913971, 0.14021536707878113, -0.10827863961458206, 0.002931952476501465, 0.2569175958633423, 0.027791839092969894, -0.012285809963941574, 0.4262368381023407, 0.49028176069259644, 0.2576737105846405, 0.15316331386566162, -0.38650333881378174, -0.5506995320320129, -0.0019514411687850952, -0.02487092651426792, -0.3070363700389862, -0.16490966081619263, -0.08560594916343689, 0.445496141910553, 0.300114244222641, -0.011395595967769623, -0.3536761701107025, 0.19476917386054993, 0.36028027534484863, -0.282776415348053, 0.010832585394382477, 0.4590718150138855, 0.3408202826976776, -0.07474914193153381, -0.28732165694236755, -0.1079777255654335, 0.1441216766834259, 0.02457716315984726, -0.2015266865491867, 0.18410125374794006, -0.31822991371154785, 0.027403410524129868, 0.46300646662712097, -0.022354429587721825, 0.31599560379981995, -0.2107398509979248, -0.3058076500892639, 0.22468695044517517, 0.08023738861083984, 0.09934864938259125, 0.10232273489236832, 0.03189767152070999, 0.7356102466583252, -0.4591231942176819, 0.1533069759607315, -0.2655443251132965, 0.058448705822229385, 0.012992843985557556, -0.2595968544483185, -0.24948614835739136, 0.0343058779835701, -0.038995787501335144, -0.31390756368637085, -0.008690722286701202, 0.0996299535036087, 0.0884208232164383, -0.10026228427886963, -0.18584215641021729, 0.02066817134618759, 0.1377352625131607, -0.22458523511886597, -0.03996306285262108, -0.030546756461262703, -0.26603782176971436, -0.36099573969841003, 0.5688537359237671, -0.6477200984954834, 0.05058610439300537, 0.44653013348579407, 0.3487510681152344, -0.3438810110092163, 0.20403240621089935, 0.20626422762870789, -0.3343808948993683, -0.0768062099814415, 0.2525050938129425, -0.1356026828289032, 0.012002095580101013, -0.2297275960445404, -0.23312439024448395 ]
https://github.com/huggingface/datasets/issues/5791
This snippet is awesome! I know I probably should have gotten deeper in to the docs to find cast_column and set_transform, but perhaps a link ushering folks to that documentation or even this thread somewhere in https://huggingface.co/docs/datasets/image_load would be helpful? Thanks again for the snippet
TIFF/TIF support
### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations
45
TIFF/TIF support ### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations This snippet is awesome! I know I probably should have gotten deeper in to the docs to find cast_column and set_transform, but perhaps a link ushering folks to that documentation or even this thread somewhere in https://huggingface.co/docs/datasets/image_load would be helpful? Thanks again for the snippet
[ -0.2690482437610626, -0.22079499065876007, -0.06014011800289154, 0.20733270049095154, 0.3892035484313965, 0.03304615616798401, 0.18951678276062012, 0.14724472165107727, 0.09366878867149353, -0.004289157688617706, -0.22632211446762085, 0.38841766119003296, -0.08246496319770813, 0.5795052647590637, 0.06499923765659332, -0.4934104382991791, 0.00840102881193161, 0.1352771371603012, -0.13666106760501862, 0.20816966891288757, -0.3178008198738098, 0.14406131207942963, -0.15059201419353485, -0.03287019208073616, -0.30168384313583374, 0.16240359842777252, -0.1361473798751831, 0.0664324164390564, -0.30931490659713745, -0.13523906469345093, 0.058968402445316315, 0.17205053567886353, 0.1642802357673645, 0.5705054998397827, -0.00011705298675224185, 0.04180384427309036, 0.10335728526115417, -0.2236117720603943, -0.11066366732120514, -0.10560421645641327, 0.004739485681056976, -0.2644489109516144, -0.0895283967256546, -0.21668079495429993, -0.14073967933654785, -0.3360188901424408, 0.08816930651664734, 0.1764565259218216, 0.34693530201911926, -0.07233908027410507, 0.10343565791845322, 0.22251808643341064, 0.4390948414802551, 0.25252479314804077, 0.16219684481620789, 0.6075594425201416, -0.28789135813713074, 0.1525116264820099, 0.48958462476730347, 0.05342943221330643, 0.04150261729955673, 0.49756449460983276, -0.34961503744125366, -0.21886563301086426, 0.4474111497402191, 0.1512722223997116, -0.4624125361442566, -0.25456103682518005, -0.16205552220344543, 0.18423908948898315, 0.8050623536109924, -0.1221630647778511, -0.5839539766311646, -0.3574497103691101, 0.18816815316677094, -0.05799739062786102, 0.11901108920574188, 0.10325835645198822, 0.012941397726535797, 0.23399117588996887, -0.49591195583343506, -0.11127637326717377, -0.238372802734375, 0.20087695121765137, -0.12192633002996445, 0.013948295265436172, -0.10649998486042023, 0.08748301863670349, 0.09761953353881836, 0.0031746849417686462, -0.264995276927948, -0.19603006541728973, 0.10337164252996445, 0.09051375091075897, -0.06046665832400322, -0.2462492287158966, 0.1191311925649643, -0.16262273490428925, 0.015643157064914703, 0.1537121832370758, 0.10119393467903137, 0.13310348987579346, -0.6191985011100769, 0.262026846408844, 0.3123246133327484, 0.07331916689872742, -0.1962513029575348, 0.06127183139324188, 0.4304640591144562, 0.16945546865463257, 0.2074265480041504, -0.1456579715013504, -0.08114755153656006, 0.09090208262205124, -0.6053910851478577, -0.18086250126361847, 0.1657620221376419, -0.03943447768688202, -0.11256042122840881, -0.330464631319046, 0.06960943341255188, -0.21794530749320984, -0.10238995403051376, 0.3408575654029846, -0.11931375414133072, 0.4180873930454254, 0.10576604306697845, 0.2876955568790436, 0.2017401158809662, -0.33441606163978577, 0.06281799077987671, 0.05330619961023331, -0.04203702136874199, -0.01534474641084671, 0.087457075715065, -0.019863558933138847, -0.03974086046218872, -0.22259774804115295, 0.45453718304634094, 0.256536066532135, 0.12908682227134705, -0.024958107620477676, 0.055346325039863586, 0.3110032081604004, -0.3598240911960602, -0.06809276342391968, 0.19286136329174042, 0.17154166102409363, -0.3692949414253235, 0.3128691017627716, -0.4281816780567169, -0.0008991062641143799, -0.09068082273006439, 0.00022949092090129852, 0.037402644753456116, -0.07085196673870087, -0.4975965619087219, 0.33743491768836975, -0.2897581458091736, -0.21255487203598022, 0.277660995721817, -0.1656399965286255, -0.34127169847488403, -0.28800874948501587, 0.13936738669872284, 0.11591857671737671, -0.32028964161872864, -0.22799429297447205, 0.14885972440242767, -0.3640066981315613, -0.14576172828674316, 0.23975011706352234, -0.022169707342982292, -0.009365122765302658, -0.08440554887056351, 0.1875235140323639, 0.4615006446838379, -0.5288954377174377, -0.06225062161684036, 0.28698471188545227, -0.017853446304798126, 0.2910262644290924, 0.07414284348487854, 0.3843327462673187, 0.3543560206890106, -0.1342657059431076, 0.04989013448357582, 0.3962475657463074, -0.08597864955663681, 0.1895105540752411, 0.040868185460567474, -0.5426847338676453, -0.0009398330003023148, 0.438143789768219, -0.18415303528308868, 0.013676980510354042, 0.15022340416908264, -0.42075327038764954, 0.14803467690944672, -0.2245577573776245, 0.15314365923404694, -0.18650758266448975, 0.0669102892279625, 0.2555762827396393, 0.02807411178946495, -0.055831119418144226, -0.6966255307197571, 0.1567232310771942, 0.2373725175857544, 0.19100287556648254, -0.04107850790023804, -0.1898600161075592, 0.019210323691368103, 0.03610248118638992, -0.11604483425617218, -0.12669070065021515, -0.055158473551273346, 0.049927257001399994, 0.03482373058795929, 0.034478560090065, -0.35799384117126465, 0.1919914186000824, -0.171471506357193, 0.19233503937721252, -0.030548974871635437, 0.28889375925064087, 0.05577599257230759, -0.133278489112854, 0.13205288350582123, 0.10758145153522491, -0.2272283434867859, -0.3484332263469696, 0.08804793655872345, 0.22479958832263947, -0.024386165663599968, 0.26935526728630066, -0.03342149779200554, 0.5927124619483948, 0.3499299883842468, -0.2506285607814789, 0.13855424523353577, -0.13042771816253662, 0.058719124644994736, -0.34081411361694336, -0.4279441237449646, 0.41857603192329407, -0.28918078541755676, 0.04440402612090111, -0.1311511993408203, 0.02007155865430832, 0.23182560503482819, 0.05215691030025482, -0.16448679566383362, -0.11793690174818039, -0.176326721906662, 0.059251755475997925, -0.3324507772922516, -0.2487323135137558, -0.38996458053588867, -0.007615085691213608, 0.33421650528907776, -0.04785909131169319, 0.031644485890865326, 0.3934134542942047, -0.0014519058167934418, 0.039186738431453705, 0.2342473864555359, -0.16887223720550537, 0.5436802506446838, 0.21185769140720367, -0.08801659196615219, -0.1259741634130478, 0.05795584246516228, -0.030558204278349876, 0.11879312992095947, -0.277668297290802, -0.1103590875864029, 0.1296437829732895, 0.16722333431243896, 0.028112728148698807, -0.23820710182189941, -0.18765109777450562, -0.1386449933052063, -0.08932013064622879, -0.2169051319360733, -0.018309861421585083, 0.011124014854431152, -0.5717422962188721, -0.04204551503062248, -0.003061823546886444, -0.18994435667991638, -0.05040808767080307, 0.11834494769573212, 0.2947998344898224, -0.10972516238689423, 0.2599256634712219, -0.12101344764232635, 0.5565915703773499, -0.14995256066322327, -0.06346937268972397, -0.537831723690033, -0.0450618639588356, 0.10300526022911072, 0.059476420283317566, 0.2519647777080536, -0.3048429787158966, 0.3470897376537323, -0.02001059800386429, 0.07345536351203918, -0.27286508679389954, -0.43678897619247437, 0.3291413486003876, -0.3468989431858063, 0.10849277675151825, 0.29617658257484436, 0.45187798142433167, 0.1607566475868225, -0.19932126998901367, 0.3399302363395691, 0.06764938682317734, -0.28388911485671997, -0.15126830339431763, 0.14098820090293884, -0.016703378409147263, -0.4113943576812744, 0.07770009338855743, -0.018214289098978043, -0.46798205375671387, 0.5929116606712341, 0.05590967833995819, 0.0962272360920906, -0.22613075375556946, 0.40734678506851196, 0.05264536291360855, -0.1448708474636078, 0.1292148232460022, 0.03831379860639572, -0.36681991815567017, 0.4238072633743286, -0.004306718707084656, -0.29649779200553894, 0.05142275243997574, 0.2099466472864151, -0.04448152706027031, 0.1402750015258789, -0.4084102511405945, -0.5512473583221436, -0.007206309586763382, 0.4521280527114868, 0.17151492834091187, 0.10816926509141922, 0.03389723598957062, 0.1720491647720337, -0.021437659859657288, -0.18570655584335327, -0.18891167640686035, -0.3229849338531494, 0.3430824875831604, -0.11007969826459885, 0.36210161447525024, 0.05159991607069969, -0.05438168719410896, 0.24811679124832153, -0.04426432028412819, -0.20206236839294434, 0.42761772871017456, 0.22528612613677979, 0.3939325511455536, -0.16775813698768616, -0.16823190450668335, 0.23964394629001617, -0.1977054476737976, 0.26688551902770996, 0.14951112866401672, 0.27739205956459045, -0.05785060673952103, -0.43147242069244385, 0.13508960604667664, -0.2875523269176483, -0.03469318151473999, 0.3459649085998535, 0.01059584692120552, 0.019509505480527878, -0.3313325345516205, -0.23287543654441833, -0.06545291095972061, -0.017738040536642075, 0.16747532784938812, 0.681656539440155, 0.2828150987625122, -0.1465337872505188, -0.2709351181983948, -0.09569723904132843, -0.034997038543224335, 0.24423421919345856, 0.2939359247684479, -0.21918123960494995, -0.1702580749988556, 0.002842247486114502, 0.1847456991672516, -0.005389604717493057, 0.8504035472869873, -0.3805132806301117, -0.3771076798439026, 0.12191745638847351, 0.11072944104671478, 0.1151575967669487, 0.1302701085805893, 0.026296578347682953, -0.4148768186569214, 0.18069887161254883, 0.6506146192550659, -0.202279731631279, -0.30124756693840027, 0.3554226756095886, 0.12108641862869263, -0.042733654379844666, 0.06211091950535774, -0.059295326471328735, -0.2291770875453949, -0.3616160750389099, -0.19474521279335022, 0.053225673735141754, -0.21629902720451355, 0.041870228946208954, -0.011347576975822449, 0.0033508408814668655, 0.048918843269348145, -0.07250483334064484, 0.09237799048423767, -0.03791072592139244, 0.013666242361068726, -0.12038339674472809, 0.19636471569538116, 0.07338876277208328, 0.31926941871643066, 0.3466835618019104, -0.26168230175971985, -0.44821280241012573, -0.06993677467107773, -0.00131993368268013, 0.22867174446582794, 0.2704613208770752, 0.15625035762786865, 0.037314943969249725, -0.046519163995981216, 0.07584932446479797, -0.5676542520523071, 0.02705477923154831, 0.43602168560028076, -0.015854109078645706, -0.08321158587932587, -0.506999671459198, 0.37359529733657837, -0.09355634450912476, -0.055907875299453735, 0.6038818359375, 0.12489032745361328, -0.17732247710227966, 0.03502489626407623, 0.3051043450832367, 1.3263574838638306, -0.1084517389535904, 0.3507595360279083, 0.33828938007354736, -0.4435826539993286, 0.570095956325531, -0.3740285038948059, 0.0809943825006485, 0.00048332661390304565, -0.08879484236240387, -0.2767381966114044, -0.13300581276416779, 0.19595502316951752, 0.2915983200073242, -0.3485814332962036, -0.09627994149923325, 0.4478526711463928, 0.09308309853076935, -0.14234659075737, 0.18873339891433716, -0.16859513521194458, -0.24569441378116608, -0.22771260142326355, 0.09802547097206116, -0.08060160279273987, 0.11282555758953094, -0.07758471369743347, -0.18775568902492523, -0.13777488470077515, -0.09081217646598816, -0.31710606813430786, -0.1252100169658661, -0.012093044817447662, 0.01685904711484909, 0.3396899998188019, -0.19575923681259155, 0.1862812340259552, 0.22582755982875824, -0.07822006940841675, -0.443062424659729, -0.18151868879795074, -0.009151800535619259, -0.11855842173099518, 0.2830508053302765, -0.19188633561134338, -0.1530146598815918, 0.4280757009983063, 0.05508872866630554, -0.1691213697195053, 0.2110334038734436, -0.05429118871688843, -0.18236693739891052, -0.09448759257793427, 0.08651009202003479, -0.0063795773312449455, -0.2976914048194885, -0.08404070883989334, 0.07334206998348236, 0.13902193307876587, -0.0030167996883392334, 0.05019347369670868, 0.10434740036725998, 0.35480040311813354, 0.274165540933609, -0.011627300642430782, -0.009682491421699524, -0.16827598214149475, 0.2632487416267395, -0.13349254429340363, -0.5757545232772827, 0.08470161259174347, 0.22368818521499634, -0.35178688168525696, -0.09945160150527954, 0.17044001817703247, -0.1770867258310318, -0.3888033628463745, 0.06939590722322464, 0.253860205411911, -0.10703976452350616, -0.2828028202056885, 0.409488320350647, 0.0345006063580513, -0.07320521771907806, 0.03360535204410553, -0.20176851749420166, -0.12183511257171631, 0.5185590386390686, -0.04738644137978554, 0.34001868963241577, -0.31513601541519165, 0.024292971938848495, 0.37767523527145386, -0.028682393953204155, -0.2326796054840088, 0.047740451991558075, 0.18547844886779785, 0.030276931822299957, 1.0214731693267822, 0.2904333174228668, 0.13081252574920654, 0.030136149376630783, -0.007329706102609634, -0.25736483931541443, -0.3523314297199249, -0.003225717693567276, -0.19807308912277222, 0.20627078413963318, 0.05678077042102814, -0.26329654455184937, -0.1641506403684616, -0.09404412657022476, -0.11156158894300461, -0.24222174286842346, 0.21550410985946655, -0.04680607467889786, -0.2737847566604614, 0.17216412723064423, -0.21922238171100616, 0.17401567101478577, 0.04609159380197525, 0.19291529059410095, 0.10019667446613312, 0.4991941750049591, 0.31305116415023804, -0.05836440995335579, 0.0013623833656311035, -0.08066721260547638, -0.111414834856987, 0.4709318280220032, 0.0814209133386612, -0.13941046595573425, 0.5551770925521851, 0.331179141998291, 0.23145076632499695, 0.04869730770587921, 0.35860323905944824, 0.1342361718416214, -0.1065448597073555, -0.060781922191381454, 0.3185102343559265, 0.08674326539039612, 0.0479910746216774, -0.05746670812368393, 0.3616970479488373, 0.011846918612718582, 0.034275561571121216, -0.008322760462760925, -0.032809920608997345, 0.24043218791484833, -0.15290948748588562, -0.04323093220591545, 0.5378496646881104, -0.0778542160987854, 0.11505725979804993, 0.336728036403656, 0.006955109536647797, 0.04863942041993141, 0.07229582965373993, 0.1805892437696457, 0.1769740730524063, -0.2980876564979553, -0.009130842983722687, 0.008867477998137474, -0.34091103076934814, 0.09229324758052826, 0.1312793642282486, -0.4178357720375061, 0.09131544828414917, 0.18384277820587158, 0.04535631835460663, 0.13767212629318237, 0.1697036772966385, 0.4135728180408478, 0.08079470694065094, -0.0017399638891220093, -0.03893551230430603, 0.5387288331985474, 0.018122807145118713, 0.029781252145767212, -0.3856552839279175, -0.24029108881950378, -0.14700524508953094, 0.17212478816509247, -0.09370732307434082, 0.12135240435600281, 0.4263370931148529, 0.2744249701499939, 0.14785513281822205, -0.1581195890903473, 0.17536307871341705, -0.2662043869495392, 0.3903118968009949, -0.1057513877749443, -0.02215513400733471, 0.5040269494056702, 0.0714886412024498, 0.29783397912979126, 0.34523800015449524, 0.3572576642036438, 0.1928071826696396, 0.342098206281662, 0.013394992798566818, -0.4123798906803131, -0.05502994731068611, -0.18257185816764832, 0.3227722942829132, -0.030902884900569916, -0.2391129732131958, 0.10116079449653625, 0.0913396030664444, -0.049029089510440826, 0.10753609985113144, -0.2608543336391449, -0.05081924423575401, -0.21421338617801666, 0.14440326392650604, -0.2574862837791443, -0.4066067337989807, 0.06295642256736755, -0.21320728957653046, -0.06726593524217606, 0.1088503822684288, -0.03375463932752609, -0.1850135624408722, -0.027102436870336533, 0.14721468091011047, 0.01264164224267006, 0.3054214119911194, 0.33208125829696655, 0.47351738810539246, 0.12206780165433884, 0.1387455016374588, -0.19575954973697662, -0.5367038249969482, -0.07957068085670471, 0.28217044472694397, -0.11459566652774811, -0.04108423367142677, -0.06950663030147552, 0.4042549431324005, 0.12258122116327286, 0.15923351049423218, -0.5170120000839233, 0.1552353948354721, 0.24187295138835907, -0.06726398319005966, -0.12460748851299286, 0.37396687269210815, 0.26166385412216187, -0.1868848204612732, -0.07354971021413803, 0.12697146832942963, 0.03928951546549797, -0.05856027454137802, -0.3529626727104187, 0.23177051544189453, -0.35677072405815125, -0.18903909623622894, 0.2861388325691223, 0.04687923192977905, 0.40780526399612427, -0.2307896763086319, -0.27017512917518616, 0.16038551926612854, -0.18441538512706757, -0.09987379610538483, 0.14338111877441406, -0.08593675494194031, 0.5589125156402588, -0.3111332058906555, -0.04204597696661949, -0.34165599942207336, 0.04906674474477768, -0.03130759298801422, -0.09318496286869049, -0.24197635054588318, 0.016141243278980255, -0.1756749451160431, -0.3942258358001709, 0.18328607082366943, 0.067027248442173, 0.14991642534732819, -0.05047877877950668, -0.3927057385444641, -0.11389659345149994, 0.23697075247764587, -0.1960355043411255, -0.13791018724441528, -0.00802648812532425, -0.2508082091808319, -0.3508370816707611, 0.3116571307182312, -0.7520360350608826, 0.05058200657367706, 0.32873132824897766, 0.19777549803256989, -0.1575918346643448, 0.4316468834877014, 0.29461291432380676, -0.35397592186927795, -0.17526966333389282, 0.1440722644329071, -0.02662578783929348, 0.010750800371170044, -0.17038726806640625, -0.15391197800636292 ]
https://github.com/huggingface/datasets/issues/5791
Btw, we can close this issue as it should be addressed in Pillow rather than here.
TIFF/TIF support
### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations
16
TIFF/TIF support ### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations Btw, we can close this issue as it should be addressed in Pillow rather than here.
[ -0.23112329840660095, -0.06182199716567993, -0.1187916100025177, 0.075553759932518, 0.055008143186569214, 0.11775311827659607, 0.25062820315361023, 0.24310708045959473, -0.12346241623163223, 0.020366374403238297, -0.12221197038888931, 0.4725615978240967, -0.08182340860366821, 0.3631928861141205, -0.03944071754813194, -0.37924420833587646, -0.024112101644277573, 0.1725449413061142, 0.037361353635787964, 0.3021812438964844, -0.3242199718952179, -0.017579317092895508, -0.17851829528808594, -0.030843716114759445, -0.3788563311100006, 0.08078651130199432, -0.21521764993667603, -0.08662068843841553, -0.30385270714759827, -0.20356884598731995, 0.12770012021064758, 0.20320601761341095, 0.19180217385292053, 0.43893927335739136, -0.00011487986193969846, 0.038756608963012695, 0.2371891438961029, -0.15952199697494507, -0.008539438247680664, -0.12194132804870605, 0.05466049909591675, -0.27913808822631836, -0.16801542043685913, -0.2232964038848877, -0.0899462029337883, -0.35467565059661865, 0.15878081321716309, 0.1032773107290268, 0.3602914810180664, -0.04707406088709831, 0.11372187733650208, -0.02839691936969757, 0.44628241658210754, 0.23921483755111694, 0.3856203258037567, 0.7266914248466492, -0.2574537396430969, 0.17463509738445282, 0.5512329339981079, 0.02037651836872101, 0.06803858280181885, 0.43131402134895325, -0.35795557498931885, -0.12650932371616364, 0.2612548768520355, 0.04963492229580879, -0.3501986265182495, -0.2270415723323822, -0.24403508007526398, 0.07788379490375519, 0.8674672842025757, -0.08178611844778061, -0.5567525625228882, -0.24237436056137085, 0.18871909379959106, -0.0641293004155159, -0.0000957045704126358, 0.19331234693527222, -0.05406518280506134, 0.21810147166252136, -0.12814196944236755, -0.14604446291923523, -0.3669597804546356, 0.32229119539260864, -0.018139436841011047, 0.016803091391921043, -0.014666292816400528, 0.12242908775806427, 0.04354262351989746, 0.027878765016794205, -0.07548075914382935, -0.37647873163223267, 0.0940612405538559, -0.047638751566410065, -0.052425481379032135, -0.20883893966674805, 0.008130710572004318, -0.5367822647094727, 0.09868045151233673, 0.060764603316783905, 0.06649962067604065, 0.08264656364917755, -0.6399756073951721, 0.2914769649505615, 0.3286297917366028, -0.07456248998641968, -0.18615493178367615, 0.14105764031410217, 0.33366814255714417, 0.022402826696634293, 0.0982704758644104, -0.1243712455034256, -0.10509507358074188, 0.09062209725379944, -0.5749884247779846, -0.08408240228891373, 0.11777984350919724, -0.06934666633605957, -0.1404663771390915, -0.3208175301551819, -0.09997662901878357, -0.21140426397323608, -0.17276108264923096, 0.1534472554922104, -0.11825119704008102, 0.42720383405685425, -0.028940942138433456, 0.29231053590774536, 0.3376745581626892, -0.2806469202041626, 0.15660522878170013, 0.07070992141962051, -0.018248632550239563, -0.04865521565079689, 0.12961114943027496, -0.03045089915394783, -0.04383690282702446, -0.22605088353157043, 0.5458663702011108, 0.1613307148218155, 0.3748815357685089, -0.14968110620975494, 0.07333451509475708, 0.08019287884235382, -0.43266433477401733, -0.08229642361402512, 0.03561662882566452, 0.1269344538450241, -0.3113452196121216, 0.43383216857910156, -0.5271041393280029, 0.08902505040168762, -0.0317121297121048, 0.013775990344583988, 0.08725956082344055, -0.05209781602025032, -0.3379574418067932, 0.29445675015449524, -0.34728291630744934, -0.2975729703903198, 0.11984984576702118, -0.08440090715885162, -0.1823941171169281, -0.3503262400627136, 0.03278021514415741, 0.12441228330135345, -0.37589314579963684, -0.1855243593454361, -0.015986885875463486, -0.3100897967815399, 0.01817869395017624, 0.18099993467330933, -0.012836780399084091, -0.007357969880104065, -0.10130074620246887, 0.16357865929603577, 0.4654560089111328, -0.49102145433425903, -0.15590952336788177, 0.49874329566955566, -0.047835126519203186, 0.2887221872806549, 0.09551960229873657, 0.4952019155025482, 0.3691856265068054, -0.17115770280361176, 0.23611651360988617, 0.25077298283576965, -0.06317609548568726, 0.035464778542518616, -0.07900667935609818, -0.6362988352775574, 0.16214998066425323, 0.48464134335517883, -0.10794614255428314, -0.03644145280122757, 0.19442249834537506, -0.43891987204551697, 0.20728522539138794, -0.1632450520992279, 0.12036687135696411, -0.20111562311649323, 0.09551792591810226, 0.13183948397636414, -0.030500466004014015, -0.0343775600194931, -0.5118524432182312, 0.0925949364900589, 0.03533113747835159, 0.116855189204216, 0.022423621267080307, -0.18841058015823364, 0.07555776834487915, 0.011816002428531647, -0.08942481875419617, -0.09649399667978287, 0.0027516037225723267, 0.1326344609260559, -0.1062350869178772, 0.15571142733097076, -0.2214353233575821, 0.14574700593948364, -0.03738180920481682, 0.08401089161634445, 0.25755587220191956, 0.33205074071884155, 0.037979818880558014, -0.09571467339992523, 0.2791958749294281, 0.10630092769861221, -0.24931856989860535, -0.33673936128616333, 0.09781965613365173, 0.033988602459430695, 0.05738304182887077, 0.168249249458313, 0.07792948186397552, 0.3626673221588135, 0.3362674117088318, -0.25734445452690125, 0.08949695527553558, 0.025004316121339798, 0.015625055879354477, -0.388322651386261, -0.29353389143943787, 0.36259397864341736, -0.20735497772693634, 0.01919889636337757, -0.25254881381988525, 0.04494858533143997, 0.20393574237823486, 0.035607680678367615, -0.19329822063446045, -0.09692259132862091, -0.20258721709251404, 0.08805153518915176, -0.34244227409362793, -0.3184240460395813, -0.3232313394546509, -0.06787244230508804, 0.22438211739063263, 0.012498192489147186, 0.009691141545772552, 0.4032750427722931, -0.037068359553813934, 0.08208724856376648, 0.19683393836021423, -0.1431039571762085, 0.5618960857391357, 0.2524750530719757, -0.09294062852859497, -0.16434195637702942, 0.06997105479240417, -0.09395890682935715, 0.018399398773908615, -0.2431025207042694, -0.11607548594474792, 0.22643649578094482, 0.19551730155944824, 0.07276614010334015, -0.04888894408941269, -0.2810763716697693, -0.12616309523582458, -0.1337500363588333, 0.022519215941429138, -0.10498033463954926, -0.10006283968687057, -0.7291147708892822, 0.01906844973564148, -0.053674641996622086, -0.20182111859321594, -0.03253369405865669, 0.18761420249938965, 0.18085511028766632, -0.06750527769327164, 0.2214564085006714, -0.07732579112052917, 0.5331437587738037, -0.20905230939388275, -0.0973706915974617, -0.4050416350364685, -0.10915108025074005, 0.011137127876281738, 0.12664389610290527, 0.36271193623542786, -0.2571782171726227, 0.4565272927284241, 0.1495840847492218, 0.20716631412506104, -0.22995123267173767, -0.3302890658378601, 0.23002731800079346, -0.13345327973365784, 0.1631576120853424, 0.09045958518981934, 0.35014739632606506, 0.22091545164585114, -0.24416929483413696, 0.2445543259382248, 0.28134065866470337, -0.1473371982574463, -0.2549833059310913, 0.11547860503196716, -0.04090738669037819, -0.4050218462944031, 0.015634218230843544, -0.10798900574445724, -0.4264332056045532, 0.4970605671405792, 0.10617830604314804, 0.1401892453432083, -0.34715530276298523, 0.3780837953090668, 0.030188962817192078, -0.10097215324640274, -0.043498434126377106, 0.1642070859670639, -0.34759044647216797, 0.3915138244628906, -0.01760777458548546, -0.3172808885574341, 0.08443470299243927, 0.15700161457061768, 0.01773906871676445, 0.20103712379932404, -0.44306686520576477, -0.39825618267059326, 0.14641408622264862, 0.3136790990829468, 0.025011589750647545, -0.12605136632919312, -0.11203111708164215, 0.18135130405426025, -0.04968371242284775, -0.11001667380332947, -0.05298028886318207, -0.2132759839296341, 0.291053831577301, -0.05234026163816452, 0.3832511901855469, -0.24917906522750854, 0.08627159893512726, 0.16087892651557922, 0.04448671638965607, -0.24764850735664368, 0.39507365226745605, 0.43394529819488525, 0.26162710785865784, -0.06610849499702454, -0.13185521960258484, 0.21083857119083405, -0.20127148926258087, 0.27737969160079956, 0.18497878313064575, 0.3161010146141052, -0.20882773399353027, -0.4754848778247833, 0.059595368802547455, -0.2389647364616394, -0.02971085160970688, 0.31122535467147827, -0.15255776047706604, 0.14798927307128906, -0.3012722432613373, -0.34405022859573364, -0.08566314727067947, -0.05777980387210846, 0.1021505743265152, 0.7300731539726257, 0.3474317491054535, -0.1504187136888504, -0.30493536591529846, -0.0687803253531456, 0.06766942143440247, 0.2561931908130646, 0.3515799343585968, -0.14662927389144897, -0.21563556790351868, 0.2335992455482483, -0.0055397674441337585, 0.032124608755111694, 0.5856946110725403, -0.45303434133529663, -0.3654440641403198, 0.23352517187595367, 0.39135974645614624, 0.28766998648643494, 0.09163961559534073, -0.022296257317066193, -0.36418700218200684, 0.19284698367118835, 0.6658636927604675, -0.11910802125930786, -0.200788676738739, 0.040046367794275284, 0.14371979236602783, 0.04748176038265228, -0.05741935595870018, 0.06559660285711288, -0.12059557437896729, -0.23797965049743652, -0.2626979351043701, 0.0331239178776741, -0.2735343277454376, -0.02090117149055004, -0.17525401711463928, -0.11509052664041519, 0.1510249823331833, 0.05974936485290527, -0.03862909972667694, -0.08206680417060852, -0.09647190570831299, -0.17517812550067902, 0.013924453407526016, 0.25898826122283936, 0.5949481725692749, 0.10920298844575882, -0.05682958662509918, -0.4501301646232605, -0.17019271850585938, -0.22937268018722534, 0.188629612326622, 0.16229912638664246, 0.14992499351501465, 0.22975309193134308, -0.18015332520008087, 0.011625606566667557, -0.41931670904159546, 0.07004226744174957, 0.42084792256355286, -0.1085502952337265, -0.15930476784706116, -0.5289385914802551, 0.20714841783046722, -0.08337192982435226, -0.04724111407995224, 0.7608553171157837, -0.24916398525238037, -0.06985774636268616, 0.12187737226486206, 0.37956637144088745, 1.2811840772628784, 0.01860976219177246, 0.25433871150016785, 0.16888085007667542, -0.4685739278793335, 0.5408593416213989, -0.3116009831428528, 0.17551977932453156, 0.012342259287834167, -0.03797619789838791, -0.2597123980522156, -0.14129088819026947, 0.34917742013931274, 0.4683690071105957, -0.45930081605911255, -0.13974016904830933, 0.6112743616104126, 0.05723855271935463, 0.043217189610004425, 0.20508018136024475, -0.005475293844938278, -0.11573386192321777, 0.04571516439318657, 0.12340482324361801, -0.053622420877218246, 0.026935569941997528, -0.14091211557388306, -0.4083356261253357, -0.2042713463306427, -0.003305763006210327, -0.28635984659194946, -0.019302476197481155, -0.05717170983552933, 0.14270341396331787, 0.15538756549358368, -0.10200119018554688, 0.24401628971099854, 0.1575591266155243, -0.18215808272361755, -0.38009366393089294, -0.12116284668445587, -0.14260327816009521, -0.12768413126468658, 0.12047166377305984, -0.20793114602565765, -0.17938770353794098, 0.3009788990020752, -0.0074480026960372925, -0.33213669061660767, 0.271544873714447, -0.03269258886575699, -0.22432920336723328, -0.028204917907714844, 0.0789632648229599, 0.09830059111118317, -0.050556767731904984, -0.14614544808864594, 0.12395359575748444, -0.11489419639110565, 0.08271607756614685, 0.08656591176986694, 0.177010178565979, 0.40255388617515564, 0.2989363670349121, -0.024170108139514923, 0.0700259804725647, -0.14731575548648834, 0.04822206869721413, -0.01269456185400486, -0.6311401724815369, 0.052145641297101974, 0.07654893398284912, -0.24418850243091583, -0.12814854085445404, 0.32306647300720215, -0.5889968872070312, -0.1497182995080948, -0.024787859991192818, 0.2010347545146942, 0.028845086693763733, -0.27737218141555786, 0.18851707875728607, 0.028364136815071106, 0.08520280569791794, 0.0314888060092926, -0.20271813869476318, -0.02884601801633835, 0.3760276436805725, -0.24717028439044952, 0.29893171787261963, -0.388205349445343, 0.03722558543086052, 0.3158688545227051, 0.0024151820689439774, -0.21622848510742188, 0.1186055839061737, 0.2797955274581909, -0.0011186767369508743, 0.7878513336181641, 0.31755879521369934, -0.004078809171915054, 0.07129527628421783, -0.020930660888552666, -0.16279242932796478, -0.30084171891212463, -0.05000556632876396, -0.06889557093381882, 0.19155018031597137, 0.09568986296653748, -0.1516365110874176, -0.11581499874591827, -0.13848674297332764, -0.06308642029762268, -0.12039436399936676, 0.04852306842803955, -0.147709921002388, -0.4455939531326294, 0.28071117401123047, -0.3346638083457947, 0.22505253553390503, -0.05880052223801613, 0.27605903148651123, 0.06659136712551117, 0.501329779624939, 0.27446305751800537, -0.07455720007419586, 0.14983002841472626, -0.04582221806049347, -0.2974472939968109, 0.3140086531639099, -0.06648020446300507, -0.021461933851242065, 0.5610250234603882, 0.2521122694015503, 0.19105038046836853, 0.07935664802789688, 0.14955055713653564, 0.12407433986663818, -0.024614935740828514, 0.03285963088274002, 0.3402382433414459, 0.11677516996860504, 0.05158039927482605, -0.13624000549316406, 0.4437967836856842, 0.09189072251319885, 0.02674604207277298, -0.16150887310504913, 0.04057055711746216, 0.2518256902694702, -0.21352872252464294, -0.13968299329280853, 0.3257368206977844, -0.056201010942459106, 0.22740688920021057, 0.4946857690811157, 0.1930723339319229, 0.05818259343504906, -0.26492297649383545, 0.15949808061122894, 0.1423443704843521, -0.23413199186325073, 0.16259123384952545, 0.06364146620035172, -0.15714751183986664, -0.1276678889989853, 0.1492539644241333, -0.3670775890350342, -0.0478421188890934, 0.30958491563796997, 0.1469130516052246, 0.3167421221733093, 0.3103598654270172, 0.4236045181751251, 0.16021722555160522, -0.06249601021409035, 0.07220029830932617, 0.27180835604667664, 0.07564936578273773, 0.16275401413440704, -0.34835803508758545, -0.17886313796043396, -0.23939354717731476, 0.02198963612318039, -0.038488514721393585, 0.2630974352359772, 0.28699764609336853, 0.31289198994636536, 0.12036707997322083, 0.0204811692237854, 0.26177978515625, -0.14211735129356384, 0.3390800952911377, -0.11135664582252502, -0.29476237297058105, 0.5095102787017822, 0.08361795544624329, 0.3200622498989105, 0.2191428691148758, 0.27497372031211853, 0.26131507754325867, 0.286077618598938, -0.04943054914474487, -0.5432523488998413, -0.022793542593717575, -0.12794965505599976, 0.22946681082248688, 0.1337139755487442, -0.3921094536781311, 0.2837246060371399, 0.10219917446374893, -0.05196741968393326, 0.2800423204898834, -0.22879254817962646, -0.19039954245090485, -0.2663416862487793, 0.1223875880241394, -0.3131111264228821, -0.4615473747253418, 0.16030272841453552, -0.254952073097229, -0.07433740049600601, -0.011140678077936172, 0.12246869504451752, -0.11941210925579071, -0.0589655302464962, 0.1295596808195114, 0.01780780777335167, 0.002447228878736496, 0.29842686653137207, 0.39569854736328125, 0.2594960629940033, 0.12851077318191528, -0.33245766162872314, -0.5228019952774048, 0.03121175803244114, 0.09704847633838654, 0.014130674302577972, -0.11313481628894806, -0.16322803497314453, 0.40621936321258545, 0.22552233934402466, 0.09119069576263428, -0.49185746908187866, 0.14188247919082642, 0.33876651525497437, -0.329630047082901, -0.029497144743800163, 0.5892528295516968, 0.3152316212654114, -0.14780259132385254, -0.19304487109184265, 0.03780817613005638, 0.03614097088575363, -0.0027347728610038757, -0.3286595046520233, 0.1666090339422226, -0.294211745262146, 0.05138857662677765, 0.4520191252231598, 0.05654510110616684, 0.4311704933643341, -0.23218417167663574, -0.325099915266037, 0.1937975287437439, -0.024267787113785744, 0.07084041833877563, 0.0949469804763794, 0.019442036747932434, 0.6622052192687988, -0.3968660235404968, 0.027595143765211105, -0.2446078062057495, -0.073313407599926, -0.12008733302354813, -0.10732026398181915, -0.25704970955848694, -0.12425640970468521, -0.07584138214588165, -0.3175436556339264, 0.11602556705474854, 0.024173684418201447, 0.11287730932235718, -0.14444342255592346, -0.2804713249206543, 0.06707003712654114, 0.0996958464384079, -0.05295877903699875, -0.07697728276252747, -0.04759031906723976, -0.2352312058210373, -0.36757174134254456, 0.489779531955719, -0.5326865315437317, -0.07339794933795929, 0.48451799154281616, 0.34832432866096497, -0.12874221801757812, 0.23429498076438904, 0.27824148535728455, -0.3784734010696411, -0.11158826947212219, 0.13952678442001343, -0.14971283078193665, -0.016100458800792694, -0.17823496460914612, -0.16922366619110107 ]
https://github.com/huggingface/datasets/issues/5791
For sure, if image based stuff becomes a priority I think guiding folks to an image decoder section would be really helpful, but im just one dev :) and I know priorities gotta be balanced so no worries. Thanks again for the snippet, agreed we can close
TIFF/TIF support
### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations
47
TIFF/TIF support ### Feature request I currently have a dataset (with tiff and json files) where I have to do this: `wget path_to_data/images.zip && unzip images.zip` `wget path_to_data/annotations.zip && unzip annotations.zip` Would it make sense a contribution that supports these type of files? ### Motivation instead of using `load_dataset` have to use wget as these files are not supported for annotations with JSON and images with TIFF files. Additionally to this, the PIL formatting from datasets does not read correctly the image channels with TIFF format, besides multichannel adaptation might be necessary as well (as my data e.g has more than 3 channels) ### Your contribution 1. Support TIFF images over multi channel format 2. Support JSON annotations For sure, if image based stuff becomes a priority I think guiding folks to an image decoder section would be really helpful, but im just one dev :) and I know priorities gotta be balanced so no worries. Thanks again for the snippet, agreed we can close
[ -0.15254276990890503, 0.07172900438308716, -0.15877099335193634, 0.10493224114179611, 0.11246825754642487, 0.08468982577323914, 0.1971660852432251, 0.23639601469039917, -0.09306871891021729, 0.051802314817905426, -0.06518016755580902, 0.5075037479400635, -0.08832965791225433, 0.3829022943973541, -0.20058444142341614, -0.37073320150375366, -0.05350816249847412, 0.2420417070388794, 0.09748503565788269, 0.2652186155319214, -0.24317015707492828, -0.028882265090942383, -0.14497911930084229, -0.06861594319343567, -0.3280526101589203, 0.14616534113883972, -0.15780353546142578, -0.09165909886360168, -0.37630027532577515, -0.22885769605636597, 0.0356723815202713, 0.1587149202823639, 0.08582492172718048, 0.49788305163383484, -0.00010987526184180751, 0.030888527631759644, 0.28166139125823975, -0.09678170084953308, -0.10172249376773834, -0.054132357239723206, -0.08013728260993958, -0.2709638178348541, -0.18158897757530212, -0.13792870938777924, -0.13447725772857666, -0.4085659384727478, 0.1635863333940506, -0.014239192008972168, 0.3740392327308655, -0.09424525499343872, 0.15976086258888245, -0.08341673016548157, 0.48393723368644714, 0.3180478811264038, 0.29493990540504456, 0.769668698310852, -0.2953488528728485, 0.0759103000164032, 0.5269731283187866, 0.013254806399345398, -0.0024644285440444946, 0.5131551027297974, -0.3484332859516144, -0.14942513406276703, 0.31922367215156555, 0.01894761249423027, -0.30079948902130127, -0.30622148513793945, -0.15648777782917023, 0.03971315920352936, 0.8166924118995667, -0.016515610739588737, -0.5338512063026428, -0.26676681637763977, 0.17181986570358276, -0.06053115054965019, -0.04746369644999504, 0.15101315081119537, -0.12409640848636627, 0.22949562966823578, -0.17015807330608368, -0.12403741478919983, -0.3869364857673645, 0.24023300409317017, -0.1013830155134201, 0.04283615201711655, -0.04377147927880287, 0.10649941116571426, 0.007937753573060036, 0.06081230193376541, -0.12696263194084167, -0.36146631836891174, 0.1084129735827446, -0.02049272321164608, -0.014924580231308937, -0.2600974440574646, 0.06607131659984589, -0.5497098565101624, 0.05698125809431076, 0.08071783185005188, 0.0246700681746006, 0.04949469491839409, -0.6421796083450317, 0.2628641426563263, 0.3667861819267273, -0.0824456661939621, -0.15315096080303192, 0.1006229817867279, 0.32128193974494934, -0.03916032612323761, 0.13407309353351593, -0.1015256717801094, -0.10738751292228699, 0.11892995238304138, -0.5344011187553406, -0.015125940553843975, 0.20879411697387695, -0.0658072903752327, -0.2173917591571808, -0.22365784645080566, -0.06777295470237732, -0.18080034852027893, -0.18435004353523254, 0.07160520553588867, -0.06863030791282654, 0.48692458868026733, -0.07923908531665802, 0.27383384108543396, 0.3524310886859894, -0.2959916293621063, 0.09095306694507599, 0.005508553236722946, -0.04332926869392395, -0.056295327842235565, 0.04771128296852112, 0.07188727706670761, -0.07745929062366486, -0.1884813904762268, 0.4813981354236603, 0.08307384699583054, 0.4001374840736389, -0.1507066935300827, 0.06774178892374039, 0.13876572251319885, -0.41468361020088196, -0.047977183014154434, 0.08311086148023605, 0.08575868606567383, -0.27416449785232544, 0.40345174074172974, -0.43918168544769287, 0.1389617919921875, -0.10860548913478851, 0.06406497955322266, 0.07382602989673615, -0.0598190538585186, -0.30637699365615845, 0.32387739419937134, -0.3493455946445465, -0.2046699821949005, 0.1459021270275116, -0.006406620144844055, -0.1491324007511139, -0.3727318048477173, -0.013876102864742279, 0.08697311580181122, -0.42300674319267273, -0.09251958876848221, -0.08893851935863495, -0.3502920866012573, 0.11483222991228104, 0.15793167054653168, -0.05667771399021149, -0.05892126262187958, -0.00962502509355545, 0.16952314972877502, 0.4237467050552368, -0.548810601234436, -0.10519431531429291, 0.6102815866470337, -0.11483901739120483, 0.3097418248653412, 0.07000105082988739, 0.47430333495140076, 0.2863987386226654, -0.2284291535615921, 0.10904191434383392, 0.30450740456581116, -0.18785187602043152, 0.020030677318572998, -0.07838457822799683, -0.5904350876808167, 0.18194013833999634, 0.4949849545955658, -0.08666789531707764, -0.028394676744937897, 0.1546533852815628, -0.5091932415962219, 0.17978331446647644, -0.16027875244617462, 0.1634288877248764, -0.23222441971302032, 0.20974569022655487, 0.13372641801834106, 0.02091524377465248, -0.04618203639984131, -0.4428190588951111, 0.11746188998222351, 0.06745243072509766, 0.11598183214664459, -0.020348314195871353, -0.20921076834201813, 0.03625831753015518, -0.017322488129138947, -0.06743130087852478, -0.14437919855117798, 0.09453628957271576, 0.03657998517155647, -0.19560635089874268, 0.10434611886739731, -0.25554078817367554, 0.15693825483322144, -0.0495324470102787, 0.06676100939512253, 0.3346959948539734, 0.2755553126335144, -0.038674332201480865, -0.059440918266773224, 0.23540785908699036, 0.06912768632173538, -0.31531205773353577, -0.25713858008384705, 0.06606057286262512, 0.00960403773933649, 0.0930572897195816, 0.1741926521062851, 0.07756803184747696, 0.2860327959060669, 0.35472410917282104, -0.30635035037994385, 0.13205303251743317, -0.004490174353122711, 0.00461791455745697, -0.3815993070602417, -0.28544390201568604, 0.2529444098472595, -0.2971765697002411, 0.06656552851200104, -0.2762761414051056, 0.06053357571363449, 0.1671258509159088, 0.02529963105916977, -0.20903602242469788, -0.07467526197433472, -0.22099485993385315, 0.04745905101299286, -0.38458383083343506, -0.25299006700515747, -0.23080751299858093, 0.05158289521932602, 0.23316165804862976, 0.012412384152412415, -0.07328958809375763, 0.4128131568431854, 0.0029332712292671204, 0.07447898387908936, 0.161154642701149, -0.07242830842733383, 0.5299191474914551, 0.25710248947143555, -0.09268645197153091, -0.23968221247196198, 0.1300862729549408, -0.02938523143529892, -0.005335912108421326, -0.14242926239967346, -0.0425734743475914, 0.2681042551994324, 0.17901410162448883, 0.13658811151981354, 0.0645204558968544, -0.3552730679512024, -0.14838546514511108, -0.13808849453926086, 0.104943186044693, -0.07062535732984543, -0.04547429829835892, -0.726234495639801, 0.09495925903320312, -0.07243777066469193, -0.16571633517742157, -0.024567153304815292, 0.21381522715091705, 0.08103801310062408, -0.11183259636163712, 0.2663288712501526, -0.1012435108423233, 0.5416637659072876, -0.2511354088783264, -0.06580542027950287, -0.4338832497596741, -0.11654245853424072, -0.029105374589562416, 0.1722376048564911, 0.40080851316452026, -0.2390546202659607, 0.4733549654483795, 0.16100987792015076, 0.24206486344337463, -0.21213562786579132, -0.37999987602233887, 0.23624852299690247, -0.17967399954795837, 0.1500837802886963, 0.1128888875246048, 0.34238386154174805, 0.1940874457359314, -0.33430495858192444, 0.22179993987083435, 0.2895812392234802, -0.16490811109542847, -0.2783891558647156, 0.15866006910800934, -0.05813496559858322, -0.391038179397583, 0.1295352578163147, -0.07309485971927643, -0.4674588441848755, 0.4971197247505188, 0.13536712527275085, 0.15281561017036438, -0.2726452350616455, 0.3472179174423218, -0.00414523109793663, -0.03034793771803379, -0.006810147315263748, 0.09126417338848114, -0.3502875566482544, 0.30119842290878296, -0.01764637604355812, -0.27442657947540283, 0.07696749269962311, 0.1990990787744522, 0.17591087520122528, 0.22589176893234253, -0.4605397582054138, -0.30758535861968994, 0.13150738179683685, 0.25357869267463684, -0.0336790569126606, -0.1444370150566101, -0.11767874658107758, 0.2095406949520111, -0.10250856727361679, -0.13448619842529297, -0.007817663252353668, -0.26975488662719727, 0.2380124181509018, 0.01793750748038292, 0.32080352306365967, -0.1966845989227295, 0.09792127460241318, 0.2663416862487793, 0.037430696189403534, -0.17580297589302063, 0.32338228821754456, 0.5300779342651367, 0.3055989146232605, -0.021257761865854263, -0.13433268666267395, 0.24035023152828217, -0.14047189056873322, 0.18509161472320557, 0.1276031732559204, 0.317569375038147, -0.2956656813621521, -0.44002246856689453, 0.07762124389410019, -0.26850417256355286, -0.04751262068748474, 0.34230858087539673, -0.07577449828386307, 0.13112938404083252, -0.3787952661514282, -0.3000926971435547, -0.10219472646713257, -0.017392463982105255, 0.04675929993391037, 0.7051032185554504, 0.4141767621040344, -0.17740929126739502, -0.22949165105819702, -0.1468828022480011, 0.10511912405490875, 0.14352963864803314, 0.28755080699920654, -0.17190489172935486, -0.18807168304920197, 0.18935005366802216, 0.03476472571492195, 0.024245932698249817, 0.5277450084686279, -0.4379868507385254, -0.40932348370552063, 0.24816006422042847, 0.4155782461166382, 0.3327532708644867, 0.13010501861572266, 0.01178675889968872, -0.2713257670402527, 0.12170456349849701, 0.5603511333465576, -0.17588214576244354, -0.2739558219909668, 0.17410962283611298, 0.06269708275794983, 0.05018529295921326, -0.11006329953670502, -0.0010615065693855286, -0.11596853286027908, -0.251801997423172, -0.30055034160614014, 0.16662223637104034, -0.31588104367256165, 0.0014031976461410522, -0.20069049298763275, -0.1697860062122345, 0.14095787703990936, 0.12925966084003448, -0.04622288793325424, -0.15678466856479645, -0.07409226894378662, -0.11750014126300812, 0.0010535325855016708, 0.07719108462333679, 0.5963923931121826, 0.0957394614815712, -0.05059336498379707, -0.41679060459136963, -0.07752244174480438, -0.2773652970790863, 0.21735724806785583, 0.24613997340202332, 0.13322731852531433, 0.12659913301467896, -0.1465848684310913, 0.06008710712194443, -0.5099294185638428, 0.08972068130970001, 0.39312905073165894, -0.12608842551708221, -0.23401425778865814, -0.5132494568824768, 0.23778781294822693, -0.05704028904438019, -0.0902121365070343, 0.7635671496391296, -0.10184701532125473, -0.02724706381559372, 0.1450584977865219, 0.41777342557907104, 1.3181097507476807, -0.009722745046019554, 0.21139293909072876, 0.11818055063486099, -0.4660976529121399, 0.5993348956108093, -0.391319215297699, 0.16914328932762146, 0.08453059196472168, -0.052594803273677826, -0.23430907726287842, -0.11793547868728638, 0.28027603030204773, 0.4283691942691803, -0.37745317816734314, -0.20484836399555206, 0.5257489681243896, 0.06295797973871231, 0.06938855350017548, 0.27918291091918945, -0.03659561276435852, -0.1382165104150772, 0.15549829602241516, 0.1742870807647705, -0.11043775826692581, 0.09403350949287415, -0.11465822905302048, -0.45309382677078247, -0.23106825351715088, 0.04356209933757782, -0.3641618490219116, -0.08862972259521484, 0.005853351205587387, 0.16742613911628723, 0.1544269621372223, -0.16946378350257874, 0.3266972005367279, 0.12519484758377075, -0.13915148377418518, -0.3756920397281647, -0.09727711975574493, -0.10589034855365753, -0.08907796442508698, 0.14514195919036865, -0.1983514279127121, -0.2206665575504303, 0.30778974294662476, -0.07373598963022232, -0.2534717321395874, 0.30027198791503906, -0.0671444684267044, -0.19596312940120697, -0.16101431846618652, 0.08237699419260025, 0.13303740322589874, -0.04427404701709747, -0.019868336617946625, 0.1213374137878418, -0.06873083859682083, 0.1071544885635376, 0.13000334799289703, 0.1759764850139618, 0.3869117796421051, 0.30229729413986206, -0.005709278862923384, 0.08327750861644745, -0.12408120185136795, -0.05775861442089081, 0.062143467366695404, -0.7152299284934998, 0.004371177405118942, 0.022345781326293945, -0.28214290738105774, -0.17232298851013184, 0.19786310195922852, -0.5202935934066772, -0.1555684208869934, -0.02492954209446907, 0.15940992534160614, -0.020162433385849, -0.24732224643230438, 0.07122711837291718, 0.10708177089691162, 0.05932718887925148, 0.07176126539707184, -0.17216801643371582, -0.06009957194328308, 0.3233649730682373, -0.2539639472961426, 0.28562116622924805, -0.5484083294868469, 0.08402083814144135, 0.24550573527812958, 0.023960480466485023, -0.27736371755599976, 0.09614668786525726, 0.20394682884216309, 0.027942799031734467, 0.7031919360160828, 0.22697734832763672, -0.0491955392062664, 0.0789574384689331, 0.03305119276046753, -0.17499087750911713, -0.29048532247543335, -0.0745663195848465, -0.08562391251325607, 0.1821543574333191, 0.09860127419233322, -0.1852819323539734, -0.025138845667243004, -0.10030509531497955, -0.11610351502895355, -0.034977760165929794, 0.10716449469327927, -0.18734633922576904, -0.3793901205062866, 0.22147172689437866, -0.3033278286457062, 0.24653998017311096, 0.011679664254188538, 0.2581392526626587, 0.06070245802402496, 0.6933914422988892, 0.2704888582229614, -0.03091312199831009, 0.23281052708625793, -0.01761738210916519, -0.24878720939159393, 0.328478068113327, -0.09807800501585007, 0.023619767278432846, 0.5272921323776245, 0.26166823506355286, 0.23245657980442047, 0.10823604464530945, 0.15675358474254608, 0.15853774547576904, -0.07431571185588837, 0.056954674422740936, 0.3325638771057129, 0.196994349360466, 0.1306355893611908, -0.10072821378707886, 0.38405925035476685, 0.012533877044916153, 0.01668360084295273, -0.13836660981178284, 0.006052635610103607, 0.25517767667770386, -0.08950605243444443, -0.0897732749581337, 0.41727882623672485, -0.062357377260923386, 0.24127471446990967, 0.3964293897151947, 0.1323786824941635, -0.009280581027269363, -0.19267487525939941, 0.19266028702259064, 0.1595601588487625, -0.22410716116428375, 0.08289295434951782, 0.13307145237922668, -0.17223972082138062, -0.09033084660768509, 0.15756690502166748, -0.2821681499481201, -0.0132663669064641, 0.35104355216026306, 0.04027951508760452, 0.23215636610984802, 0.30754196643829346, 0.3566255569458008, 0.13528431951999664, -0.06038912385702133, 0.10514061897993088, 0.26405420899391174, 0.06398570537567139, 0.2491798996925354, -0.35509738326072693, -0.17946508526802063, -0.26326942443847656, -0.027394525706768036, -0.030916115269064903, 0.2416214942932129, 0.1959574669599533, 0.3190478980541229, 0.06616227328777313, 0.016528885811567307, 0.25605225563049316, -0.20090442895889282, 0.4672880470752716, -0.10144227743148804, -0.30645909905433655, 0.4803694784641266, 0.08337725698947906, 0.29206031560897827, 0.18490971624851227, 0.26749008893966675, 0.2573942542076111, 0.16259726881980896, -0.05674506723880768, -0.5131977796554565, -0.07904958724975586, -0.20941348373889923, 0.2762919068336487, 0.12147887051105499, -0.3061493933200836, 0.20659348368644714, 0.14317286014556885, -0.10796089470386505, 0.1690344512462616, -0.19387994706630707, -0.21432457864284515, -0.23805972933769226, 0.15337684750556946, -0.28332820534706116, -0.33895373344421387, 0.16796904802322388, -0.27835923433303833, -0.09249097108840942, -0.08601963520050049, 0.07544073462486267, -0.11419178545475006, -0.059987783432006836, 0.13803964853286743, 0.052616335451602936, -0.013941429555416107, 0.17641940712928772, 0.29709291458129883, 0.26882946491241455, 0.05522134527564049, -0.3145354390144348, -0.491646945476532, 0.040390919893980026, 0.0935305804014206, -0.016516484320163727, -0.12470371276140213, -0.05281569063663483, 0.2929919362068176, 0.28816619515419006, 0.15818746387958527, -0.46141692996025085, 0.10845286399126053, 0.30229702591896057, -0.30077505111694336, 0.018238376826047897, 0.5703773498535156, 0.26622146368026733, -0.11806800961494446, -0.13124899566173553, 0.040038712322711945, 0.0811384990811348, 0.061780788004398346, -0.33667075634002686, 0.1274442821741104, -0.1997285783290863, 0.07357960194349289, 0.40524721145629883, 0.06511407345533371, 0.34541627764701843, -0.17915582656860352, -0.4798056185245514, 0.13507504761219025, -0.029368475079536438, 0.056227151304483414, 0.09972821176052094, 0.07227835059165955, 0.599469006061554, -0.35728728771209717, -0.0061230952851474285, -0.30187609791755676, -0.07934214919805527, -0.11409727483987808, -0.06180019676685333, -0.35882866382598877, -0.0632740780711174, -0.09104790538549423, -0.22082282602787018, 0.07816191762685776, -0.008971529081463814, 0.17886021733283997, -0.10818687081336975, -0.3845818042755127, -0.009716354310512543, 0.16080820560455322, -0.03424566984176636, -0.12446404993534088, -0.011224202811717987, -0.1824294626712799, -0.3710179626941681, 0.5420430898666382, -0.4810994863510132, -0.05039078742265701, 0.4597422480583191, 0.2906506359577179, -0.11303364485502243, 0.25773751735687256, 0.317939430475235, -0.3965688943862915, -0.0888073518872261, 0.014334707520902157, -0.20121005177497864, -0.015527259558439255, -0.10075291991233826, -0.15029087662696838 ]
https://github.com/huggingface/datasets/issues/5786
Hi ! PyTorch may hang when calling `load_state_dict()` in a subprocess. To fix that, set the multiprocessing start method to "spawn". Since `datasets` uses `multiprocess`, you should do: ```python # Required to avoid issues with pytorch (otherwise hangs during load_state_dict in multiprocessing) import multiprocess.context as ctx ctx._force_start_method('spawn') ``` Also make sure to run your main code in `if __name__ == "__main__":` to avoid issues with python multiprocesing
Multiprocessing in a `filter` or `map` function with a Pytorch model
### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu
67
Multiprocessing in a `filter` or `map` function with a Pytorch model ### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu Hi ! PyTorch may hang when calling `load_state_dict()` in a subprocess. To fix that, set the multiprocessing start method to "spawn". Since `datasets` uses `multiprocess`, you should do: ```python # Required to avoid issues with pytorch (otherwise hangs during load_state_dict in multiprocessing) import multiprocess.context as ctx ctx._force_start_method('spawn') ``` Also make sure to run your main code in `if __name__ == "__main__":` to avoid issues with python multiprocesing
[ -0.09778323769569397, -0.3189750909805298, -0.0011930502951145172, 0.2662516236305237, 0.2876635789871216, -0.17286784946918488, 0.18067258596420288, 0.15307143330574036, 0.4758862853050232, 0.08115188777446747, -0.016057178378105164, 0.6568635702133179, -0.1272278130054474, -0.4012520909309387, -0.3529883921146393, -0.1492076814174652, -0.07706613838672638, -0.1229381263256073, 0.14425833523273468, 0.02866588532924652, -0.28169888257980347, 0.24186836183071136, -0.09911328554153442, 0.23431245982646942, -0.2512640058994293, -0.08100053668022156, 0.08168172091245651, -0.043187759816646576, 0.16990195214748383, -0.11269163340330124, 0.1131410300731659, 0.05934273079037666, -0.1227995976805687, 0.9353616237640381, -0.00012762061669491231, 0.021349243819713593, 0.08668816089630127, 0.019877776503562927, -0.04764612019062042, -0.30402615666389465, 0.3239411413669586, 0.28456997871398926, 0.3673229515552521, -0.18116775155067444, 0.1401054710149765, 0.41566571593284607, 0.014741754159331322, -0.29829999804496765, 0.49426931142807007, 0.06082380563020706, 0.1128750815987587, 0.34720900654792786, -0.2658363878726959, -0.08535933494567871, -0.30964380502700806, 0.3370766043663025, -0.09858476370573044, 0.36892083287239075, 0.2771861255168915, -0.2678222060203552, -0.20149677991867065, 0.4205917418003082, -0.29362112283706665, -0.08682514727115631, 0.14729824662208557, -0.26183071732521057, 0.32064154744148254, -0.6189651489257812, 0.14099696278572083, 0.040892742574214935, -0.5176493525505066, -0.03415582329034805, -0.1567881852388382, -0.27619749307632446, 0.04902227967977524, 0.17388421297073364, 0.021961040794849396, 0.1347855031490326, -0.3760126829147339, 0.005135823041200638, -0.18212592601776123, -0.07373052835464478, 0.0809829831123352, 0.13341063261032104, 0.271506667137146, 0.35636916756629944, -0.013999944552779198, 0.48192349076271057, 0.23509792983531952, 0.04307566583156586, -0.06164393201470375, -0.22257211804389954, 0.43745213747024536, -0.0019473284482955933, -0.3395535945892334, 0.35948848724365234, 0.2738471031188965, -0.09357248246669769, -0.18640992045402527, -0.3429257273674011, 0.006968170404434204, 0.1629793494939804, 0.5577451586723328, 0.1283750981092453, 0.1935071498155594, -0.13797515630722046, 0.02968868985772133, 0.2512725591659546, 0.1795225590467453, -0.19116760790348053, -0.3446064591407776, 0.1083492636680603, 0.011017423123121262, -0.23925785720348358, 0.07352028787136078, 0.08395485579967499, 0.19950741529464722, 0.011005572974681854, -0.08703511208295822, -0.13902245461940765, -0.26723384857177734, 0.04344527795910835, 0.40136611461639404, 0.3691451847553253, 0.14718317985534668, 0.505796492099762, 0.551234245300293, 0.02855467051267624, -0.3623717129230499, 0.0389343798160553, -0.08463306725025177, -0.15987302362918854, -0.25327396392822266, -0.049369268119335175, -0.03577129542827606, -0.18702787160873413, -0.024861304089426994, -0.02971840277314186, 0.385587215423584, -0.14169102907180786, 0.4539381265640259, -0.2694624364376068, 0.24967700242996216, 0.36863672733306885, -0.23998302221298218, 0.17703881859779358, 0.3516317903995514, 0.10455925762653351, -0.06364163756370544, 0.17583143711090088, -0.34571924805641174, -0.32997769117355347, 0.11898148059844971, 0.020167700946331024, 0.4128654897212982, 0.5470290184020996, 0.18676482141017914, 0.15880271792411804, 0.5563885569572449, -0.14710566401481628, 0.19502344727516174, -0.7049329280853271, -0.3499602973461151, -0.29664257168769836, 0.29432567954063416, 0.32737433910369873, 0.04972958564758301, -0.25172099471092224, -0.258432537317276, -0.05246315151453018, 0.29228001832962036, 0.2739129662513733, -0.2772478461265564, 0.09991040825843811, -0.0679268091917038, 0.08079192042350769, 0.41369038820266724, -0.11949510872364044, -0.14768607914447784, 0.4159523844718933, -0.34566450119018555, 0.22885364294052124, -0.020877808332443237, 0.11125321686267853, -0.14099985361099243, -0.1267256736755371, 0.6400110721588135, -0.13373051583766937, -0.3485316336154938, -0.05150846391916275, -0.22011643648147583, 0.08718447387218475, 0.23945778608322144, -0.0076242610812187195, 0.220200777053833, -0.0011072717607021332, -0.22233706712722778, -0.12773045897483826, 0.29907023906707764, -0.13719777762889862, -0.2710169553756714, 0.033512525260448456, 0.15137657523155212, 0.010563681833446026, 0.08870604634284973, -0.25814610719680786, 0.057998642325401306, 0.28651532530784607, -0.26198193430900574, -0.06999963521957397, -0.06380276381969452, -0.006804570555686951, 0.20783862471580505, 0.4254101812839508, -0.1945466548204422, -0.026740260422229767, 0.004780981689691544, 0.07287389039993286, -0.20466971397399902, -0.30377984046936035, -0.001881524920463562, 0.3201051950454712, -0.34335172176361084, -0.1283200979232788, -0.09429168701171875, 0.19232714176177979, -0.1774025857448578, -0.3731035888195038, -0.5019539594650269, -0.12048058211803436, 0.3584102392196655, 0.0773574560880661, -0.20770815014839172, 0.283285528421402, 0.1152978390455246, -0.4648163914680481, -0.2344794124364853, -0.2124493420124054, -0.08598390966653824, -0.2020009309053421, -0.023100880905985832, 0.41793152689933777, 0.11186610907316208, -0.31560349464416504, 0.21917113661766052, 0.12135769426822662, 0.2505854666233063, 0.5915064811706543, -0.08821521699428558, 0.1297479122877121, -0.002392292022705078, 0.20492033660411835, -0.1983502209186554, 0.16660454869270325, 0.42015525698661804, 0.04710671305656433, 0.10935743153095245, -0.07547320425510406, -0.37234431505203247, -0.09063047170639038, 0.23027436435222626, 0.13955193758010864, 0.10345830023288727, 0.0719514787197113, -0.08176237344741821, 0.1041334718465805, 0.06801974773406982, -0.29172950983047485, 0.5298343300819397, -0.005323318764567375, 0.014577766880393028, 0.037605635821819305, -0.17614513635635376, -0.02358153462409973, -0.028517208993434906, 0.2559939920902252, 0.1365666538476944, 0.10092446208000183, 0.16498500108718872, -0.06381341069936752, -0.14499786496162415, -0.24567075073719025, 0.06730958819389343, -0.31795862317085266, -0.21806932985782623, 0.5031405687332153, 0.07523342967033386, 0.15471073985099792, -0.015496939420700073, 0.23459824919700623, -0.2602387070655823, -0.11551639437675476, -0.19655047357082367, 0.4177095293998718, -0.08859644830226898, 0.17590901255607605, -0.11533095687627792, 0.102675661444664, 0.03061491996049881, -0.2325761467218399, -0.04211273044347763, -0.11973695456981659, -0.22050726413726807, -0.15793684124946594, 0.27860933542251587, -0.25142723321914673, 0.2248525619506836, 0.20717069506645203, -0.4721071720123291, 0.03403580188751221, -0.34287357330322266, 0.030264198780059814, -0.12066441774368286, 0.17743182182312012, 0.34547823667526245, -0.15794695913791656, -0.12827950716018677, -0.13308653235435486, 0.43370047211647034, -0.3636203110218048, 0.173935204744339, 0.1766970157623291, -0.018721457570791245, -0.11469897627830505, -0.28906261920928955, 0.014520246535539627, -0.2273748368024826, -0.23925983905792236, 0.2304242104291916, -0.2890270948410034, 0.09578372538089752, 0.000007405877113342285, 0.2663404047489166, 0.11982855200767517, -0.21502594649791718, 0.03148280084133148, -0.08790439367294312, -0.047590501606464386, 0.09067872166633606, -0.11274246871471405, -0.29397228360176086, -0.051893554627895355, 0.12367113679647446, 0.005277566611766815, 0.3400120735168457, -0.13847468793392181, 0.11711879074573517, -0.0665854662656784, 0.10870194435119629, -0.026339903473854065, -0.07642126083374023, 0.3217892050743103, 0.1763204038143158, -0.01616561785340309, -0.1839866191148758, -0.29655563831329346, 0.1169637143611908, 0.21557274460792542, 0.1644435077905655, -0.06266269087791443, 0.4343266487121582, 0.06995140016078949, 0.7695397138595581, -0.0394568145275116, -0.09072370827198029, -0.12927420437335968, 0.1938571184873581, -0.04492735490202904, 0.0078029874712228775, -0.423518568277359, -0.016675274819135666, -0.4538252651691437, -0.16708862781524658, -0.024342872202396393, 0.07000461965799332, -0.3909609913825989, -0.18592894077301025, -0.06673569977283478, 0.00848563015460968, -0.32097524404525757, 0.3422113358974457, -0.013867110013961792, 0.2662488520145416, -0.18893665075302124, 0.04214125871658325, -0.41688477993011475, 0.21492448449134827, -0.0706971287727356, -0.09657852351665497, 0.2663736343383789, -0.16341179609298706, 0.03905670344829559, -0.12189839035272598, -0.20727631449699402, 0.3339887261390686, 0.11956877261400223, 0.1923149675130844, -0.2272321879863739, -0.06917384266853333, 0.10824838280677795, -0.18421272933483124, 0.6484284996986389, -0.0029274560511112213, -0.13333788514137268, 0.531780481338501, -0.5801010727882385, -0.5742730498313904, 0.15886655449867249, -0.08814425021409988, 0.41301247477531433, 0.4341018795967102, -0.02252684161067009, -0.16007302701473236, -0.32826635241508484, -0.06267918646335602, 0.1483658254146576, -0.2606185972690582, -0.1114141196012497, -0.32577943801879883, -0.11110945791006088, -0.16446900367736816, 0.2498389631509781, 0.3032888174057007, 0.0565045028924942, -0.1254643052816391, 0.007574118673801422, -0.04471069946885109, -0.03577806428074837, -0.015337999910116196, -0.041015997529029846, 0.0016504935920238495, -0.025177722796797752, -0.012340977787971497, 0.21601876616477966, 0.2971676290035248, -0.016680579632520676, 0.28706666827201843, -0.3169786036014557, -0.15836751461029053, 0.27634191513061523, 0.18388332426548004, 0.29985374212265015, 0.45154234766960144, -0.143863707780838, -0.02051541954278946, 0.4614051878452301, 0.3507804572582245, 0.053976383060216904, 0.21094171702861786, 0.37904322147369385, -0.13672348856925964, -0.2782100439071655, -0.14182023704051971, -0.008312001824378967, 0.19370916485786438, -0.18671348690986633, 0.6959595680236816, -0.3839486241340637, -0.034504108130931854, 0.05250587314367294, 0.42828792333602905, 1.0696437358856201, -0.20226263999938965, 0.11139249056577682, -0.03224601596593857, -0.2792821526527405, 0.0857735276222229, -0.0024952441453933716, 0.3277420103549957, 0.010833531618118286, -0.21036852896213531, -0.039677467197179794, -0.29638370871543884, 0.10684457421302795, 0.14028537273406982, -0.025592446327209473, 0.2045881152153015, -0.24219170212745667, -0.013435868546366692, 0.18510419130325317, 0.12536610662937164, 0.2720050811767578, -0.21917849779129028, 0.07593837380409241, 0.03575979173183441, 0.011454936116933823, 0.10970956087112427, -0.17390185594558716, -0.05424454063177109, 0.48777368664741516, -0.4029272794723511, -0.0708618313074112, 0.25999313592910767, -0.7481939792633057, 0.19477254152297974, -0.29801613092422485, -0.18395014107227325, 0.28928065299987793, 0.09888257086277008, -0.4255048632621765, -0.15443924069404602, 0.03652947396039963, 0.06453350186347961, 0.27821797132492065, 0.15419825911521912, -0.15626323223114014, -0.17396873235702515, 0.15735535323619843, 0.07770723849534988, -0.0003765970468521118, -0.08369824290275574, -0.11757636070251465, -0.35620349645614624, -0.09442166984081268, 0.27996671199798584, 0.352932333946228, 0.05477634444832802, -0.14721405506134033, -0.011091362684965134, -0.253057062625885, -0.2155546396970749, 0.0236065536737442, -0.02039112150669098, -0.08918946981430054, 0.1257203221321106, -0.3199595808982849, -0.2536957859992981, 0.10948063433170319, 0.31806090474128723, 0.09297464042901993, -0.1414198875427246, 0.2928006947040558, 0.23682665824890137, -0.18477925658226013, -0.230861097574234, -0.33016932010650635, 0.09359703958034515, -0.4144970178604126, 0.46820756793022156, -0.1864909529685974, -0.09576111286878586, -0.026083193719387054, -0.04146302491426468, -0.04341549798846245, -0.047862324863672256, -0.24675793945789337, -0.04233958572149277, -0.49058595299720764, -0.11905317008495331, 0.028704024851322174, -0.055913735181093216, 0.06911083310842514, 0.08447548747062683, 0.1367945671081543, 0.1991872787475586, -0.1668109893798828, -0.20927271246910095, -0.15418271720409393, -0.011356823146343231, 0.1346164047718048, 0.11217907816171646, 0.11117728054523468, 0.11573871970176697, -0.06988483667373657, 0.3281692564487457, 0.1375999003648758, -0.1132919117808342, -0.11931061744689941, 0.19599826633930206, 0.16392989456653595, 0.07979962229728699, 0.2456611543893814, -0.29645001888275146, 0.16584685444831848, -0.1857224702835083, 0.12451260536909103, 0.2563347816467285, -0.2059324085712433, -0.08636078238487244, 0.049312394112348557, 0.04974367469549179, 0.01884566992521286, 0.25674012303352356, 0.025190021842718124, -0.08402933180332184, 0.14970791339874268, 0.10103634744882584, 0.43405240774154663, -0.0010554417967796326, -0.4105302691459656, -0.16812284290790558, -0.05622022971510887, 0.18033556640148163, 0.12164955586194992, -0.11497022956609726, -0.22929763793945312, -0.10786226391792297, 0.17456576228141785, 0.30534762144088745, -0.0030065588653087616, 0.18703976273536682, 0.05523207411170006, -0.02233799919486046, -0.16056454181671143, -0.012916259467601776, 0.22469890117645264, -0.09827777743339539, 0.07035468518733978, 0.08091408759355545, -0.30277472734451294, 0.32761943340301514, 0.16544991731643677, 0.19847486913204193, -0.10902035981416702, 0.013022266328334808, 0.26981911063194275, 0.4212973713874817, 0.3272182047367096, 0.35825884342193604, 0.3731761872768402, 0.003619084134697914, 0.15215396881103516, -0.12588617205619812, 0.11604270339012146, 0.5444135665893555, 0.1215285211801529, 0.05658240616321564, 0.30950605869293213, -0.15415647625923157, -0.04761257767677307, -0.14538130164146423, 0.09541361033916473, 0.14612695574760437, -0.5196988582611084, -0.14599654078483582, -0.391757994890213, -0.672614574432373, 0.041681498289108276, 0.47432222962379456, -0.21686860918998718, -0.051579318940639496, -0.18397697806358337, -0.0031551048159599304, 0.1496821641921997, -0.16499203443527222, 0.16508489847183228, 0.0678253322839737, 0.6268429756164551, 0.20559853315353394, 0.09371322393417358, -0.1989452838897705, -0.5609787106513977, 0.025383271276950836, 0.23709145188331604, -0.19779664278030396, -0.09414944052696228, 0.3188190758228302, 0.0666118711233139, -0.147653266787529, 0.11093250662088394, 0.3579283356666565, 0.4043870270252228, -0.5753968358039856, 0.010155096650123596, 0.23455661535263062, 0.10022183507680893, -0.17673936486244202, 0.06475278735160828, 0.01464221440255642, 0.29263630509376526, 0.17438311874866486, -0.01038983091711998, -0.15393489599227905, -0.10635534673929214, 0.03138306736946106, 0.30811432003974915, -0.1318584829568863, 0.6698080897331238, -0.12922364473342896, -0.19287431240081787, 0.08318926393985748, -0.06539137661457062, -0.23620319366455078, 0.24387110769748688, 0.5980789661407471, -0.07969541102647781, 0.07717622816562653, 0.018509671092033386, 0.011930879205465317, 0.042802225798368454, 0.3307930529117584, -0.2941420376300812, 0.26028937101364136, -0.3976747393608093, 0.1786998212337494, -0.41020724177360535, 0.23347321152687073, -0.2969263195991516, -0.0625617504119873, 0.06923860311508179, -0.124024897813797, 0.0948953777551651, -0.038126882165670395, 0.2451644390821457, -0.6951651573181152, 0.20811793208122253, 0.35978206992149353, -0.11782021820545197, -0.06418784707784653, -0.19291691482067108, -0.0027034133672714233, 0.3498792052268982, -0.34360820055007935, -0.04009811952710152, 0.08729106187820435, -0.024852804839611053, -0.11664368212223053, -0.3560090959072113, 0.1768588274717331, 0.12028954923152924, 0.25152745842933655, 0.17895963788032532, 0.4414612948894501, 0.09007558226585388, -0.14915400743484497, 0.25845077633857727, 0.12860435247421265, 0.11992938816547394, -0.032781995832920074, -0.00824522040784359, 0.4527892768383026, -0.34217318892478943, -0.16621527075767517, -0.6208341121673584, -0.12214246392250061, 0.006029188632965088, -0.24258708953857422, -0.15037724375724792, 0.1871567666530609, -0.019292369484901428, 0.022571247071027756, 0.10406172275543213, 0.5349797010421753, -0.010805731639266014, 0.17119881510734558, -0.5036360025405884, 0.06498672813177109, 0.6294061541557312, -0.5843209028244019, -0.5394695997238159, -0.22075307369232178, 0.29752978682518005, -0.40112578868865967, 0.041086018085479736, -0.3050130605697632, -0.33138152956962585, 0.2121238112449646, 0.008595086634159088, -0.30021899938583374, -0.024134840816259384, -0.13373443484306335, -0.1247793510556221, -0.10018274188041687, 0.1798277646303177, -0.1554066240787506, -0.08937326818704605, 0.20503383874893188, -0.2552962601184845 ]
https://github.com/huggingface/datasets/issues/5786
@lhoestq Hello, I also encountered this problem but maybe with another reason. Here is my code: ```python tokenizer = AutoTokenizer.from_pretrained(model_args.model_name_or_path, cache_dir=model_args.cache_dir, model_max_length=training_args.model_max_length) data = load_dataset("json", data_files=data_args.train_file, cache_dir=data_args.data_cache_dir) def func(samples): # main operation for sentence_value in samples: sentence_ids = tokenizer.encode(sentence_value, add_special_tokens=False, max_length=tokenizer.model_max_length, truncation=True) ... ... train_data = data["train"].shuffle().map(func, num_proc=os.cpu_count()) ``` It hangs after the progress reaches 100%. Could you help me point out the reason?
Multiprocessing in a `filter` or `map` function with a Pytorch model
### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu
64
Multiprocessing in a `filter` or `map` function with a Pytorch model ### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu @lhoestq Hello, I also encountered this problem but maybe with another reason. Here is my code: ```python tokenizer = AutoTokenizer.from_pretrained(model_args.model_name_or_path, cache_dir=model_args.cache_dir, model_max_length=training_args.model_max_length) data = load_dataset("json", data_files=data_args.train_file, cache_dir=data_args.data_cache_dir) def func(samples): # main operation for sentence_value in samples: sentence_ids = tokenizer.encode(sentence_value, add_special_tokens=False, max_length=tokenizer.model_max_length, truncation=True) ... ... train_data = data["train"].shuffle().map(func, num_proc=os.cpu_count()) ``` It hangs after the progress reaches 100%. Could you help me point out the reason?
[ -0.09778323769569397, -0.3189750909805298, -0.0011930502951145172, 0.2662516236305237, 0.2876635789871216, -0.17286784946918488, 0.18067258596420288, 0.15307143330574036, 0.4758862853050232, 0.08115188777446747, -0.016057178378105164, 0.6568635702133179, -0.1272278130054474, -0.4012520909309387, -0.3529883921146393, -0.1492076814174652, -0.07706613838672638, -0.1229381263256073, 0.14425833523273468, 0.02866588532924652, -0.28169888257980347, 0.24186836183071136, -0.09911328554153442, 0.23431245982646942, -0.2512640058994293, -0.08100053668022156, 0.08168172091245651, -0.043187759816646576, 0.16990195214748383, -0.11269163340330124, 0.1131410300731659, 0.05934273079037666, -0.1227995976805687, 0.9353616237640381, -0.00012762061669491231, 0.021349243819713593, 0.08668816089630127, 0.019877776503562927, -0.04764612019062042, -0.30402615666389465, 0.3239411413669586, 0.28456997871398926, 0.3673229515552521, -0.18116775155067444, 0.1401054710149765, 0.41566571593284607, 0.014741754159331322, -0.29829999804496765, 0.49426931142807007, 0.06082380563020706, 0.1128750815987587, 0.34720900654792786, -0.2658363878726959, -0.08535933494567871, -0.30964380502700806, 0.3370766043663025, -0.09858476370573044, 0.36892083287239075, 0.2771861255168915, -0.2678222060203552, -0.20149677991867065, 0.4205917418003082, -0.29362112283706665, -0.08682514727115631, 0.14729824662208557, -0.26183071732521057, 0.32064154744148254, -0.6189651489257812, 0.14099696278572083, 0.040892742574214935, -0.5176493525505066, -0.03415582329034805, -0.1567881852388382, -0.27619749307632446, 0.04902227967977524, 0.17388421297073364, 0.021961040794849396, 0.1347855031490326, -0.3760126829147339, 0.005135823041200638, -0.18212592601776123, -0.07373052835464478, 0.0809829831123352, 0.13341063261032104, 0.271506667137146, 0.35636916756629944, -0.013999944552779198, 0.48192349076271057, 0.23509792983531952, 0.04307566583156586, -0.06164393201470375, -0.22257211804389954, 0.43745213747024536, -0.0019473284482955933, -0.3395535945892334, 0.35948848724365234, 0.2738471031188965, -0.09357248246669769, -0.18640992045402527, -0.3429257273674011, 0.006968170404434204, 0.1629793494939804, 0.5577451586723328, 0.1283750981092453, 0.1935071498155594, -0.13797515630722046, 0.02968868985772133, 0.2512725591659546, 0.1795225590467453, -0.19116760790348053, -0.3446064591407776, 0.1083492636680603, 0.011017423123121262, -0.23925785720348358, 0.07352028787136078, 0.08395485579967499, 0.19950741529464722, 0.011005572974681854, -0.08703511208295822, -0.13902245461940765, -0.26723384857177734, 0.04344527795910835, 0.40136611461639404, 0.3691451847553253, 0.14718317985534668, 0.505796492099762, 0.551234245300293, 0.02855467051267624, -0.3623717129230499, 0.0389343798160553, -0.08463306725025177, -0.15987302362918854, -0.25327396392822266, -0.049369268119335175, -0.03577129542827606, -0.18702787160873413, -0.024861304089426994, -0.02971840277314186, 0.385587215423584, -0.14169102907180786, 0.4539381265640259, -0.2694624364376068, 0.24967700242996216, 0.36863672733306885, -0.23998302221298218, 0.17703881859779358, 0.3516317903995514, 0.10455925762653351, -0.06364163756370544, 0.17583143711090088, -0.34571924805641174, -0.32997769117355347, 0.11898148059844971, 0.020167700946331024, 0.4128654897212982, 0.5470290184020996, 0.18676482141017914, 0.15880271792411804, 0.5563885569572449, -0.14710566401481628, 0.19502344727516174, -0.7049329280853271, -0.3499602973461151, -0.29664257168769836, 0.29432567954063416, 0.32737433910369873, 0.04972958564758301, -0.25172099471092224, -0.258432537317276, -0.05246315151453018, 0.29228001832962036, 0.2739129662513733, -0.2772478461265564, 0.09991040825843811, -0.0679268091917038, 0.08079192042350769, 0.41369038820266724, -0.11949510872364044, -0.14768607914447784, 0.4159523844718933, -0.34566450119018555, 0.22885364294052124, -0.020877808332443237, 0.11125321686267853, -0.14099985361099243, -0.1267256736755371, 0.6400110721588135, -0.13373051583766937, -0.3485316336154938, -0.05150846391916275, -0.22011643648147583, 0.08718447387218475, 0.23945778608322144, -0.0076242610812187195, 0.220200777053833, -0.0011072717607021332, -0.22233706712722778, -0.12773045897483826, 0.29907023906707764, -0.13719777762889862, -0.2710169553756714, 0.033512525260448456, 0.15137657523155212, 0.010563681833446026, 0.08870604634284973, -0.25814610719680786, 0.057998642325401306, 0.28651532530784607, -0.26198193430900574, -0.06999963521957397, -0.06380276381969452, -0.006804570555686951, 0.20783862471580505, 0.4254101812839508, -0.1945466548204422, -0.026740260422229767, 0.004780981689691544, 0.07287389039993286, -0.20466971397399902, -0.30377984046936035, -0.001881524920463562, 0.3201051950454712, -0.34335172176361084, -0.1283200979232788, -0.09429168701171875, 0.19232714176177979, -0.1774025857448578, -0.3731035888195038, -0.5019539594650269, -0.12048058211803436, 0.3584102392196655, 0.0773574560880661, -0.20770815014839172, 0.283285528421402, 0.1152978390455246, -0.4648163914680481, -0.2344794124364853, -0.2124493420124054, -0.08598390966653824, -0.2020009309053421, -0.023100880905985832, 0.41793152689933777, 0.11186610907316208, -0.31560349464416504, 0.21917113661766052, 0.12135769426822662, 0.2505854666233063, 0.5915064811706543, -0.08821521699428558, 0.1297479122877121, -0.002392292022705078, 0.20492033660411835, -0.1983502209186554, 0.16660454869270325, 0.42015525698661804, 0.04710671305656433, 0.10935743153095245, -0.07547320425510406, -0.37234431505203247, -0.09063047170639038, 0.23027436435222626, 0.13955193758010864, 0.10345830023288727, 0.0719514787197113, -0.08176237344741821, 0.1041334718465805, 0.06801974773406982, -0.29172950983047485, 0.5298343300819397, -0.005323318764567375, 0.014577766880393028, 0.037605635821819305, -0.17614513635635376, -0.02358153462409973, -0.028517208993434906, 0.2559939920902252, 0.1365666538476944, 0.10092446208000183, 0.16498500108718872, -0.06381341069936752, -0.14499786496162415, -0.24567075073719025, 0.06730958819389343, -0.31795862317085266, -0.21806932985782623, 0.5031405687332153, 0.07523342967033386, 0.15471073985099792, -0.015496939420700073, 0.23459824919700623, -0.2602387070655823, -0.11551639437675476, -0.19655047357082367, 0.4177095293998718, -0.08859644830226898, 0.17590901255607605, -0.11533095687627792, 0.102675661444664, 0.03061491996049881, -0.2325761467218399, -0.04211273044347763, -0.11973695456981659, -0.22050726413726807, -0.15793684124946594, 0.27860933542251587, -0.25142723321914673, 0.2248525619506836, 0.20717069506645203, -0.4721071720123291, 0.03403580188751221, -0.34287357330322266, 0.030264198780059814, -0.12066441774368286, 0.17743182182312012, 0.34547823667526245, -0.15794695913791656, -0.12827950716018677, -0.13308653235435486, 0.43370047211647034, -0.3636203110218048, 0.173935204744339, 0.1766970157623291, -0.018721457570791245, -0.11469897627830505, -0.28906261920928955, 0.014520246535539627, -0.2273748368024826, -0.23925983905792236, 0.2304242104291916, -0.2890270948410034, 0.09578372538089752, 0.000007405877113342285, 0.2663404047489166, 0.11982855200767517, -0.21502594649791718, 0.03148280084133148, -0.08790439367294312, -0.047590501606464386, 0.09067872166633606, -0.11274246871471405, -0.29397228360176086, -0.051893554627895355, 0.12367113679647446, 0.005277566611766815, 0.3400120735168457, -0.13847468793392181, 0.11711879074573517, -0.0665854662656784, 0.10870194435119629, -0.026339903473854065, -0.07642126083374023, 0.3217892050743103, 0.1763204038143158, -0.01616561785340309, -0.1839866191148758, -0.29655563831329346, 0.1169637143611908, 0.21557274460792542, 0.1644435077905655, -0.06266269087791443, 0.4343266487121582, 0.06995140016078949, 0.7695397138595581, -0.0394568145275116, -0.09072370827198029, -0.12927420437335968, 0.1938571184873581, -0.04492735490202904, 0.0078029874712228775, -0.423518568277359, -0.016675274819135666, -0.4538252651691437, -0.16708862781524658, -0.024342872202396393, 0.07000461965799332, -0.3909609913825989, -0.18592894077301025, -0.06673569977283478, 0.00848563015460968, -0.32097524404525757, 0.3422113358974457, -0.013867110013961792, 0.2662488520145416, -0.18893665075302124, 0.04214125871658325, -0.41688477993011475, 0.21492448449134827, -0.0706971287727356, -0.09657852351665497, 0.2663736343383789, -0.16341179609298706, 0.03905670344829559, -0.12189839035272598, -0.20727631449699402, 0.3339887261390686, 0.11956877261400223, 0.1923149675130844, -0.2272321879863739, -0.06917384266853333, 0.10824838280677795, -0.18421272933483124, 0.6484284996986389, -0.0029274560511112213, -0.13333788514137268, 0.531780481338501, -0.5801010727882385, -0.5742730498313904, 0.15886655449867249, -0.08814425021409988, 0.41301247477531433, 0.4341018795967102, -0.02252684161067009, -0.16007302701473236, -0.32826635241508484, -0.06267918646335602, 0.1483658254146576, -0.2606185972690582, -0.1114141196012497, -0.32577943801879883, -0.11110945791006088, -0.16446900367736816, 0.2498389631509781, 0.3032888174057007, 0.0565045028924942, -0.1254643052816391, 0.007574118673801422, -0.04471069946885109, -0.03577806428074837, -0.015337999910116196, -0.041015997529029846, 0.0016504935920238495, -0.025177722796797752, -0.012340977787971497, 0.21601876616477966, 0.2971676290035248, -0.016680579632520676, 0.28706666827201843, -0.3169786036014557, -0.15836751461029053, 0.27634191513061523, 0.18388332426548004, 0.29985374212265015, 0.45154234766960144, -0.143863707780838, -0.02051541954278946, 0.4614051878452301, 0.3507804572582245, 0.053976383060216904, 0.21094171702861786, 0.37904322147369385, -0.13672348856925964, -0.2782100439071655, -0.14182023704051971, -0.008312001824378967, 0.19370916485786438, -0.18671348690986633, 0.6959595680236816, -0.3839486241340637, -0.034504108130931854, 0.05250587314367294, 0.42828792333602905, 1.0696437358856201, -0.20226263999938965, 0.11139249056577682, -0.03224601596593857, -0.2792821526527405, 0.0857735276222229, -0.0024952441453933716, 0.3277420103549957, 0.010833531618118286, -0.21036852896213531, -0.039677467197179794, -0.29638370871543884, 0.10684457421302795, 0.14028537273406982, -0.025592446327209473, 0.2045881152153015, -0.24219170212745667, -0.013435868546366692, 0.18510419130325317, 0.12536610662937164, 0.2720050811767578, -0.21917849779129028, 0.07593837380409241, 0.03575979173183441, 0.011454936116933823, 0.10970956087112427, -0.17390185594558716, -0.05424454063177109, 0.48777368664741516, -0.4029272794723511, -0.0708618313074112, 0.25999313592910767, -0.7481939792633057, 0.19477254152297974, -0.29801613092422485, -0.18395014107227325, 0.28928065299987793, 0.09888257086277008, -0.4255048632621765, -0.15443924069404602, 0.03652947396039963, 0.06453350186347961, 0.27821797132492065, 0.15419825911521912, -0.15626323223114014, -0.17396873235702515, 0.15735535323619843, 0.07770723849534988, -0.0003765970468521118, -0.08369824290275574, -0.11757636070251465, -0.35620349645614624, -0.09442166984081268, 0.27996671199798584, 0.352932333946228, 0.05477634444832802, -0.14721405506134033, -0.011091362684965134, -0.253057062625885, -0.2155546396970749, 0.0236065536737442, -0.02039112150669098, -0.08918946981430054, 0.1257203221321106, -0.3199595808982849, -0.2536957859992981, 0.10948063433170319, 0.31806090474128723, 0.09297464042901993, -0.1414198875427246, 0.2928006947040558, 0.23682665824890137, -0.18477925658226013, -0.230861097574234, -0.33016932010650635, 0.09359703958034515, -0.4144970178604126, 0.46820756793022156, -0.1864909529685974, -0.09576111286878586, -0.026083193719387054, -0.04146302491426468, -0.04341549798846245, -0.047862324863672256, -0.24675793945789337, -0.04233958572149277, -0.49058595299720764, -0.11905317008495331, 0.028704024851322174, -0.055913735181093216, 0.06911083310842514, 0.08447548747062683, 0.1367945671081543, 0.1991872787475586, -0.1668109893798828, -0.20927271246910095, -0.15418271720409393, -0.011356823146343231, 0.1346164047718048, 0.11217907816171646, 0.11117728054523468, 0.11573871970176697, -0.06988483667373657, 0.3281692564487457, 0.1375999003648758, -0.1132919117808342, -0.11931061744689941, 0.19599826633930206, 0.16392989456653595, 0.07979962229728699, 0.2456611543893814, -0.29645001888275146, 0.16584685444831848, -0.1857224702835083, 0.12451260536909103, 0.2563347816467285, -0.2059324085712433, -0.08636078238487244, 0.049312394112348557, 0.04974367469549179, 0.01884566992521286, 0.25674012303352356, 0.025190021842718124, -0.08402933180332184, 0.14970791339874268, 0.10103634744882584, 0.43405240774154663, -0.0010554417967796326, -0.4105302691459656, -0.16812284290790558, -0.05622022971510887, 0.18033556640148163, 0.12164955586194992, -0.11497022956609726, -0.22929763793945312, -0.10786226391792297, 0.17456576228141785, 0.30534762144088745, -0.0030065588653087616, 0.18703976273536682, 0.05523207411170006, -0.02233799919486046, -0.16056454181671143, -0.012916259467601776, 0.22469890117645264, -0.09827777743339539, 0.07035468518733978, 0.08091408759355545, -0.30277472734451294, 0.32761943340301514, 0.16544991731643677, 0.19847486913204193, -0.10902035981416702, 0.013022266328334808, 0.26981911063194275, 0.4212973713874817, 0.3272182047367096, 0.35825884342193604, 0.3731761872768402, 0.003619084134697914, 0.15215396881103516, -0.12588617205619812, 0.11604270339012146, 0.5444135665893555, 0.1215285211801529, 0.05658240616321564, 0.30950605869293213, -0.15415647625923157, -0.04761257767677307, -0.14538130164146423, 0.09541361033916473, 0.14612695574760437, -0.5196988582611084, -0.14599654078483582, -0.391757994890213, -0.672614574432373, 0.041681498289108276, 0.47432222962379456, -0.21686860918998718, -0.051579318940639496, -0.18397697806358337, -0.0031551048159599304, 0.1496821641921997, -0.16499203443527222, 0.16508489847183228, 0.0678253322839737, 0.6268429756164551, 0.20559853315353394, 0.09371322393417358, -0.1989452838897705, -0.5609787106513977, 0.025383271276950836, 0.23709145188331604, -0.19779664278030396, -0.09414944052696228, 0.3188190758228302, 0.0666118711233139, -0.147653266787529, 0.11093250662088394, 0.3579283356666565, 0.4043870270252228, -0.5753968358039856, 0.010155096650123596, 0.23455661535263062, 0.10022183507680893, -0.17673936486244202, 0.06475278735160828, 0.01464221440255642, 0.29263630509376526, 0.17438311874866486, -0.01038983091711998, -0.15393489599227905, -0.10635534673929214, 0.03138306736946106, 0.30811432003974915, -0.1318584829568863, 0.6698080897331238, -0.12922364473342896, -0.19287431240081787, 0.08318926393985748, -0.06539137661457062, -0.23620319366455078, 0.24387110769748688, 0.5980789661407471, -0.07969541102647781, 0.07717622816562653, 0.018509671092033386, 0.011930879205465317, 0.042802225798368454, 0.3307930529117584, -0.2941420376300812, 0.26028937101364136, -0.3976747393608093, 0.1786998212337494, -0.41020724177360535, 0.23347321152687073, -0.2969263195991516, -0.0625617504119873, 0.06923860311508179, -0.124024897813797, 0.0948953777551651, -0.038126882165670395, 0.2451644390821457, -0.6951651573181152, 0.20811793208122253, 0.35978206992149353, -0.11782021820545197, -0.06418784707784653, -0.19291691482067108, -0.0027034133672714233, 0.3498792052268982, -0.34360820055007935, -0.04009811952710152, 0.08729106187820435, -0.024852804839611053, -0.11664368212223053, -0.3560090959072113, 0.1768588274717331, 0.12028954923152924, 0.25152745842933655, 0.17895963788032532, 0.4414612948894501, 0.09007558226585388, -0.14915400743484497, 0.25845077633857727, 0.12860435247421265, 0.11992938816547394, -0.032781995832920074, -0.00824522040784359, 0.4527892768383026, -0.34217318892478943, -0.16621527075767517, -0.6208341121673584, -0.12214246392250061, 0.006029188632965088, -0.24258708953857422, -0.15037724375724792, 0.1871567666530609, -0.019292369484901428, 0.022571247071027756, 0.10406172275543213, 0.5349797010421753, -0.010805731639266014, 0.17119881510734558, -0.5036360025405884, 0.06498672813177109, 0.6294061541557312, -0.5843209028244019, -0.5394695997238159, -0.22075307369232178, 0.29752978682518005, -0.40112578868865967, 0.041086018085479736, -0.3050130605697632, -0.33138152956962585, 0.2121238112449646, 0.008595086634159088, -0.30021899938583374, -0.024134840816259384, -0.13373443484306335, -0.1247793510556221, -0.10018274188041687, 0.1798277646303177, -0.1554066240787506, -0.08937326818704605, 0.20503383874893188, -0.2552962601184845 ]
https://github.com/huggingface/datasets/issues/5786
@SkyAndCloud your issue doesn't seem related to the original post - could you open a new issue and provide more details ? (size of the dataset, number of cpus, how much time it took to run, `datasets` version)
Multiprocessing in a `filter` or `map` function with a Pytorch model
### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu
38
Multiprocessing in a `filter` or `map` function with a Pytorch model ### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu @SkyAndCloud your issue doesn't seem related to the original post - could you open a new issue and provide more details ? (size of the dataset, number of cpus, how much time it took to run, `datasets` version)
[ -0.09778323769569397, -0.3189750909805298, -0.0011930502951145172, 0.2662516236305237, 0.2876635789871216, -0.17286784946918488, 0.18067258596420288, 0.15307143330574036, 0.4758862853050232, 0.08115188777446747, -0.016057178378105164, 0.6568635702133179, -0.1272278130054474, -0.4012520909309387, -0.3529883921146393, -0.1492076814174652, -0.07706613838672638, -0.1229381263256073, 0.14425833523273468, 0.02866588532924652, -0.28169888257980347, 0.24186836183071136, -0.09911328554153442, 0.23431245982646942, -0.2512640058994293, -0.08100053668022156, 0.08168172091245651, -0.043187759816646576, 0.16990195214748383, -0.11269163340330124, 0.1131410300731659, 0.05934273079037666, -0.1227995976805687, 0.9353616237640381, -0.00012762061669491231, 0.021349243819713593, 0.08668816089630127, 0.019877776503562927, -0.04764612019062042, -0.30402615666389465, 0.3239411413669586, 0.28456997871398926, 0.3673229515552521, -0.18116775155067444, 0.1401054710149765, 0.41566571593284607, 0.014741754159331322, -0.29829999804496765, 0.49426931142807007, 0.06082380563020706, 0.1128750815987587, 0.34720900654792786, -0.2658363878726959, -0.08535933494567871, -0.30964380502700806, 0.3370766043663025, -0.09858476370573044, 0.36892083287239075, 0.2771861255168915, -0.2678222060203552, -0.20149677991867065, 0.4205917418003082, -0.29362112283706665, -0.08682514727115631, 0.14729824662208557, -0.26183071732521057, 0.32064154744148254, -0.6189651489257812, 0.14099696278572083, 0.040892742574214935, -0.5176493525505066, -0.03415582329034805, -0.1567881852388382, -0.27619749307632446, 0.04902227967977524, 0.17388421297073364, 0.021961040794849396, 0.1347855031490326, -0.3760126829147339, 0.005135823041200638, -0.18212592601776123, -0.07373052835464478, 0.0809829831123352, 0.13341063261032104, 0.271506667137146, 0.35636916756629944, -0.013999944552779198, 0.48192349076271057, 0.23509792983531952, 0.04307566583156586, -0.06164393201470375, -0.22257211804389954, 0.43745213747024536, -0.0019473284482955933, -0.3395535945892334, 0.35948848724365234, 0.2738471031188965, -0.09357248246669769, -0.18640992045402527, -0.3429257273674011, 0.006968170404434204, 0.1629793494939804, 0.5577451586723328, 0.1283750981092453, 0.1935071498155594, -0.13797515630722046, 0.02968868985772133, 0.2512725591659546, 0.1795225590467453, -0.19116760790348053, -0.3446064591407776, 0.1083492636680603, 0.011017423123121262, -0.23925785720348358, 0.07352028787136078, 0.08395485579967499, 0.19950741529464722, 0.011005572974681854, -0.08703511208295822, -0.13902245461940765, -0.26723384857177734, 0.04344527795910835, 0.40136611461639404, 0.3691451847553253, 0.14718317985534668, 0.505796492099762, 0.551234245300293, 0.02855467051267624, -0.3623717129230499, 0.0389343798160553, -0.08463306725025177, -0.15987302362918854, -0.25327396392822266, -0.049369268119335175, -0.03577129542827606, -0.18702787160873413, -0.024861304089426994, -0.02971840277314186, 0.385587215423584, -0.14169102907180786, 0.4539381265640259, -0.2694624364376068, 0.24967700242996216, 0.36863672733306885, -0.23998302221298218, 0.17703881859779358, 0.3516317903995514, 0.10455925762653351, -0.06364163756370544, 0.17583143711090088, -0.34571924805641174, -0.32997769117355347, 0.11898148059844971, 0.020167700946331024, 0.4128654897212982, 0.5470290184020996, 0.18676482141017914, 0.15880271792411804, 0.5563885569572449, -0.14710566401481628, 0.19502344727516174, -0.7049329280853271, -0.3499602973461151, -0.29664257168769836, 0.29432567954063416, 0.32737433910369873, 0.04972958564758301, -0.25172099471092224, -0.258432537317276, -0.05246315151453018, 0.29228001832962036, 0.2739129662513733, -0.2772478461265564, 0.09991040825843811, -0.0679268091917038, 0.08079192042350769, 0.41369038820266724, -0.11949510872364044, -0.14768607914447784, 0.4159523844718933, -0.34566450119018555, 0.22885364294052124, -0.020877808332443237, 0.11125321686267853, -0.14099985361099243, -0.1267256736755371, 0.6400110721588135, -0.13373051583766937, -0.3485316336154938, -0.05150846391916275, -0.22011643648147583, 0.08718447387218475, 0.23945778608322144, -0.0076242610812187195, 0.220200777053833, -0.0011072717607021332, -0.22233706712722778, -0.12773045897483826, 0.29907023906707764, -0.13719777762889862, -0.2710169553756714, 0.033512525260448456, 0.15137657523155212, 0.010563681833446026, 0.08870604634284973, -0.25814610719680786, 0.057998642325401306, 0.28651532530784607, -0.26198193430900574, -0.06999963521957397, -0.06380276381969452, -0.006804570555686951, 0.20783862471580505, 0.4254101812839508, -0.1945466548204422, -0.026740260422229767, 0.004780981689691544, 0.07287389039993286, -0.20466971397399902, -0.30377984046936035, -0.001881524920463562, 0.3201051950454712, -0.34335172176361084, -0.1283200979232788, -0.09429168701171875, 0.19232714176177979, -0.1774025857448578, -0.3731035888195038, -0.5019539594650269, -0.12048058211803436, 0.3584102392196655, 0.0773574560880661, -0.20770815014839172, 0.283285528421402, 0.1152978390455246, -0.4648163914680481, -0.2344794124364853, -0.2124493420124054, -0.08598390966653824, -0.2020009309053421, -0.023100880905985832, 0.41793152689933777, 0.11186610907316208, -0.31560349464416504, 0.21917113661766052, 0.12135769426822662, 0.2505854666233063, 0.5915064811706543, -0.08821521699428558, 0.1297479122877121, -0.002392292022705078, 0.20492033660411835, -0.1983502209186554, 0.16660454869270325, 0.42015525698661804, 0.04710671305656433, 0.10935743153095245, -0.07547320425510406, -0.37234431505203247, -0.09063047170639038, 0.23027436435222626, 0.13955193758010864, 0.10345830023288727, 0.0719514787197113, -0.08176237344741821, 0.1041334718465805, 0.06801974773406982, -0.29172950983047485, 0.5298343300819397, -0.005323318764567375, 0.014577766880393028, 0.037605635821819305, -0.17614513635635376, -0.02358153462409973, -0.028517208993434906, 0.2559939920902252, 0.1365666538476944, 0.10092446208000183, 0.16498500108718872, -0.06381341069936752, -0.14499786496162415, -0.24567075073719025, 0.06730958819389343, -0.31795862317085266, -0.21806932985782623, 0.5031405687332153, 0.07523342967033386, 0.15471073985099792, -0.015496939420700073, 0.23459824919700623, -0.2602387070655823, -0.11551639437675476, -0.19655047357082367, 0.4177095293998718, -0.08859644830226898, 0.17590901255607605, -0.11533095687627792, 0.102675661444664, 0.03061491996049881, -0.2325761467218399, -0.04211273044347763, -0.11973695456981659, -0.22050726413726807, -0.15793684124946594, 0.27860933542251587, -0.25142723321914673, 0.2248525619506836, 0.20717069506645203, -0.4721071720123291, 0.03403580188751221, -0.34287357330322266, 0.030264198780059814, -0.12066441774368286, 0.17743182182312012, 0.34547823667526245, -0.15794695913791656, -0.12827950716018677, -0.13308653235435486, 0.43370047211647034, -0.3636203110218048, 0.173935204744339, 0.1766970157623291, -0.018721457570791245, -0.11469897627830505, -0.28906261920928955, 0.014520246535539627, -0.2273748368024826, -0.23925983905792236, 0.2304242104291916, -0.2890270948410034, 0.09578372538089752, 0.000007405877113342285, 0.2663404047489166, 0.11982855200767517, -0.21502594649791718, 0.03148280084133148, -0.08790439367294312, -0.047590501606464386, 0.09067872166633606, -0.11274246871471405, -0.29397228360176086, -0.051893554627895355, 0.12367113679647446, 0.005277566611766815, 0.3400120735168457, -0.13847468793392181, 0.11711879074573517, -0.0665854662656784, 0.10870194435119629, -0.026339903473854065, -0.07642126083374023, 0.3217892050743103, 0.1763204038143158, -0.01616561785340309, -0.1839866191148758, -0.29655563831329346, 0.1169637143611908, 0.21557274460792542, 0.1644435077905655, -0.06266269087791443, 0.4343266487121582, 0.06995140016078949, 0.7695397138595581, -0.0394568145275116, -0.09072370827198029, -0.12927420437335968, 0.1938571184873581, -0.04492735490202904, 0.0078029874712228775, -0.423518568277359, -0.016675274819135666, -0.4538252651691437, -0.16708862781524658, -0.024342872202396393, 0.07000461965799332, -0.3909609913825989, -0.18592894077301025, -0.06673569977283478, 0.00848563015460968, -0.32097524404525757, 0.3422113358974457, -0.013867110013961792, 0.2662488520145416, -0.18893665075302124, 0.04214125871658325, -0.41688477993011475, 0.21492448449134827, -0.0706971287727356, -0.09657852351665497, 0.2663736343383789, -0.16341179609298706, 0.03905670344829559, -0.12189839035272598, -0.20727631449699402, 0.3339887261390686, 0.11956877261400223, 0.1923149675130844, -0.2272321879863739, -0.06917384266853333, 0.10824838280677795, -0.18421272933483124, 0.6484284996986389, -0.0029274560511112213, -0.13333788514137268, 0.531780481338501, -0.5801010727882385, -0.5742730498313904, 0.15886655449867249, -0.08814425021409988, 0.41301247477531433, 0.4341018795967102, -0.02252684161067009, -0.16007302701473236, -0.32826635241508484, -0.06267918646335602, 0.1483658254146576, -0.2606185972690582, -0.1114141196012497, -0.32577943801879883, -0.11110945791006088, -0.16446900367736816, 0.2498389631509781, 0.3032888174057007, 0.0565045028924942, -0.1254643052816391, 0.007574118673801422, -0.04471069946885109, -0.03577806428074837, -0.015337999910116196, -0.041015997529029846, 0.0016504935920238495, -0.025177722796797752, -0.012340977787971497, 0.21601876616477966, 0.2971676290035248, -0.016680579632520676, 0.28706666827201843, -0.3169786036014557, -0.15836751461029053, 0.27634191513061523, 0.18388332426548004, 0.29985374212265015, 0.45154234766960144, -0.143863707780838, -0.02051541954278946, 0.4614051878452301, 0.3507804572582245, 0.053976383060216904, 0.21094171702861786, 0.37904322147369385, -0.13672348856925964, -0.2782100439071655, -0.14182023704051971, -0.008312001824378967, 0.19370916485786438, -0.18671348690986633, 0.6959595680236816, -0.3839486241340637, -0.034504108130931854, 0.05250587314367294, 0.42828792333602905, 1.0696437358856201, -0.20226263999938965, 0.11139249056577682, -0.03224601596593857, -0.2792821526527405, 0.0857735276222229, -0.0024952441453933716, 0.3277420103549957, 0.010833531618118286, -0.21036852896213531, -0.039677467197179794, -0.29638370871543884, 0.10684457421302795, 0.14028537273406982, -0.025592446327209473, 0.2045881152153015, -0.24219170212745667, -0.013435868546366692, 0.18510419130325317, 0.12536610662937164, 0.2720050811767578, -0.21917849779129028, 0.07593837380409241, 0.03575979173183441, 0.011454936116933823, 0.10970956087112427, -0.17390185594558716, -0.05424454063177109, 0.48777368664741516, -0.4029272794723511, -0.0708618313074112, 0.25999313592910767, -0.7481939792633057, 0.19477254152297974, -0.29801613092422485, -0.18395014107227325, 0.28928065299987793, 0.09888257086277008, -0.4255048632621765, -0.15443924069404602, 0.03652947396039963, 0.06453350186347961, 0.27821797132492065, 0.15419825911521912, -0.15626323223114014, -0.17396873235702515, 0.15735535323619843, 0.07770723849534988, -0.0003765970468521118, -0.08369824290275574, -0.11757636070251465, -0.35620349645614624, -0.09442166984081268, 0.27996671199798584, 0.352932333946228, 0.05477634444832802, -0.14721405506134033, -0.011091362684965134, -0.253057062625885, -0.2155546396970749, 0.0236065536737442, -0.02039112150669098, -0.08918946981430054, 0.1257203221321106, -0.3199595808982849, -0.2536957859992981, 0.10948063433170319, 0.31806090474128723, 0.09297464042901993, -0.1414198875427246, 0.2928006947040558, 0.23682665824890137, -0.18477925658226013, -0.230861097574234, -0.33016932010650635, 0.09359703958034515, -0.4144970178604126, 0.46820756793022156, -0.1864909529685974, -0.09576111286878586, -0.026083193719387054, -0.04146302491426468, -0.04341549798846245, -0.047862324863672256, -0.24675793945789337, -0.04233958572149277, -0.49058595299720764, -0.11905317008495331, 0.028704024851322174, -0.055913735181093216, 0.06911083310842514, 0.08447548747062683, 0.1367945671081543, 0.1991872787475586, -0.1668109893798828, -0.20927271246910095, -0.15418271720409393, -0.011356823146343231, 0.1346164047718048, 0.11217907816171646, 0.11117728054523468, 0.11573871970176697, -0.06988483667373657, 0.3281692564487457, 0.1375999003648758, -0.1132919117808342, -0.11931061744689941, 0.19599826633930206, 0.16392989456653595, 0.07979962229728699, 0.2456611543893814, -0.29645001888275146, 0.16584685444831848, -0.1857224702835083, 0.12451260536909103, 0.2563347816467285, -0.2059324085712433, -0.08636078238487244, 0.049312394112348557, 0.04974367469549179, 0.01884566992521286, 0.25674012303352356, 0.025190021842718124, -0.08402933180332184, 0.14970791339874268, 0.10103634744882584, 0.43405240774154663, -0.0010554417967796326, -0.4105302691459656, -0.16812284290790558, -0.05622022971510887, 0.18033556640148163, 0.12164955586194992, -0.11497022956609726, -0.22929763793945312, -0.10786226391792297, 0.17456576228141785, 0.30534762144088745, -0.0030065588653087616, 0.18703976273536682, 0.05523207411170006, -0.02233799919486046, -0.16056454181671143, -0.012916259467601776, 0.22469890117645264, -0.09827777743339539, 0.07035468518733978, 0.08091408759355545, -0.30277472734451294, 0.32761943340301514, 0.16544991731643677, 0.19847486913204193, -0.10902035981416702, 0.013022266328334808, 0.26981911063194275, 0.4212973713874817, 0.3272182047367096, 0.35825884342193604, 0.3731761872768402, 0.003619084134697914, 0.15215396881103516, -0.12588617205619812, 0.11604270339012146, 0.5444135665893555, 0.1215285211801529, 0.05658240616321564, 0.30950605869293213, -0.15415647625923157, -0.04761257767677307, -0.14538130164146423, 0.09541361033916473, 0.14612695574760437, -0.5196988582611084, -0.14599654078483582, -0.391757994890213, -0.672614574432373, 0.041681498289108276, 0.47432222962379456, -0.21686860918998718, -0.051579318940639496, -0.18397697806358337, -0.0031551048159599304, 0.1496821641921997, -0.16499203443527222, 0.16508489847183228, 0.0678253322839737, 0.6268429756164551, 0.20559853315353394, 0.09371322393417358, -0.1989452838897705, -0.5609787106513977, 0.025383271276950836, 0.23709145188331604, -0.19779664278030396, -0.09414944052696228, 0.3188190758228302, 0.0666118711233139, -0.147653266787529, 0.11093250662088394, 0.3579283356666565, 0.4043870270252228, -0.5753968358039856, 0.010155096650123596, 0.23455661535263062, 0.10022183507680893, -0.17673936486244202, 0.06475278735160828, 0.01464221440255642, 0.29263630509376526, 0.17438311874866486, -0.01038983091711998, -0.15393489599227905, -0.10635534673929214, 0.03138306736946106, 0.30811432003974915, -0.1318584829568863, 0.6698080897331238, -0.12922364473342896, -0.19287431240081787, 0.08318926393985748, -0.06539137661457062, -0.23620319366455078, 0.24387110769748688, 0.5980789661407471, -0.07969541102647781, 0.07717622816562653, 0.018509671092033386, 0.011930879205465317, 0.042802225798368454, 0.3307930529117584, -0.2941420376300812, 0.26028937101364136, -0.3976747393608093, 0.1786998212337494, -0.41020724177360535, 0.23347321152687073, -0.2969263195991516, -0.0625617504119873, 0.06923860311508179, -0.124024897813797, 0.0948953777551651, -0.038126882165670395, 0.2451644390821457, -0.6951651573181152, 0.20811793208122253, 0.35978206992149353, -0.11782021820545197, -0.06418784707784653, -0.19291691482067108, -0.0027034133672714233, 0.3498792052268982, -0.34360820055007935, -0.04009811952710152, 0.08729106187820435, -0.024852804839611053, -0.11664368212223053, -0.3560090959072113, 0.1768588274717331, 0.12028954923152924, 0.25152745842933655, 0.17895963788032532, 0.4414612948894501, 0.09007558226585388, -0.14915400743484497, 0.25845077633857727, 0.12860435247421265, 0.11992938816547394, -0.032781995832920074, -0.00824522040784359, 0.4527892768383026, -0.34217318892478943, -0.16621527075767517, -0.6208341121673584, -0.12214246392250061, 0.006029188632965088, -0.24258708953857422, -0.15037724375724792, 0.1871567666530609, -0.019292369484901428, 0.022571247071027756, 0.10406172275543213, 0.5349797010421753, -0.010805731639266014, 0.17119881510734558, -0.5036360025405884, 0.06498672813177109, 0.6294061541557312, -0.5843209028244019, -0.5394695997238159, -0.22075307369232178, 0.29752978682518005, -0.40112578868865967, 0.041086018085479736, -0.3050130605697632, -0.33138152956962585, 0.2121238112449646, 0.008595086634159088, -0.30021899938583374, -0.024134840816259384, -0.13373443484306335, -0.1247793510556221, -0.10018274188041687, 0.1798277646303177, -0.1554066240787506, -0.08937326818704605, 0.20503383874893188, -0.2552962601184845 ]
https://github.com/huggingface/datasets/issues/5786
@lhoestq Hi, I just solved this problem. Because the input is extremely long and the tokenizer requests a large amount of memory, which leads to a OOM error and may eventually causes the hang. I didn't filter those too-long sentences because I thought `tokenizer` would stop once the length exceeds the `max_length`. However, it actually firstly complete the tokenization of entire sentence and then truncate it.
Multiprocessing in a `filter` or `map` function with a Pytorch model
### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu
66
Multiprocessing in a `filter` or `map` function with a Pytorch model ### Describe the bug I am trying to use a Pytorch model loaded on CPUs with multiple processes with a `.map` or a `.filter` method. Usually, when dealing with models that are non-pickable, creating a class such that the `map` function is the method `__call__`, and adding `reduce` helps to solve the problem. However, here, the command hangs without throwing an error. ### Steps to reproduce the bug ``` from datasets import Dataset import torch from torch import nn from torchvision import models ​ ​ class FilterFunction: #__slots__ = ("path_model", "model") # Doesn't change anything uncommented def __init__(self, path_model): self.path_model = path_model model = models.resnet50() model.fc = nn.Sequential( nn.Linear(2048, 512), nn.ReLU(), nn.Dropout(0.2), nn.Linear(512, 10), nn.LogSoftmax(dim=1) ) model.load_state_dict(torch.load(path_model, map_location=torch.device("cpu"))) model.eval() self.model = model def __call__(self, batch): return [True] * len(batch["id"]) # Comment this to have an error def __reduce__(self): return (self.__class__, (self.path_model,)) ​ ​ dataset = Dataset.from_dict({"id": [0, 1, 2, 4]}) ​ # Download (100 MB) at https://github.com/emiliantolo/pytorch_nsfw_model/raw/master/ResNet50_nsfw_model.pth path_model = "/fsx/hugo/nsfw_image/ResNet50_nsfw_model.pth" ​ filter_function = FilterFunction(path_model=path_model) ​ # Works filtered_dataset = dataset.filter(filter_function, num_proc=1, batched=True, batch_size=2) # Doesn't work filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2) ``` ### Expected behavior The command `filtered_dataset = dataset.filter(filter_function, num_proc=2, batched=True, batch_size=2)` should work and not hang. ### Environment info Datasets: 2.11.0 Pyarrow: 11.0.0 Ubuntu @lhoestq Hi, I just solved this problem. Because the input is extremely long and the tokenizer requests a large amount of memory, which leads to a OOM error and may eventually causes the hang. I didn't filter those too-long sentences because I thought `tokenizer` would stop once the length exceeds the `max_length`. However, it actually firstly complete the tokenization of entire sentence and then truncate it.
[ -0.09778323769569397, -0.3189750909805298, -0.0011930502951145172, 0.2662516236305237, 0.2876635789871216, -0.17286784946918488, 0.18067258596420288, 0.15307143330574036, 0.4758862853050232, 0.08115188777446747, -0.016057178378105164, 0.6568635702133179, -0.1272278130054474, -0.4012520909309387, -0.3529883921146393, -0.1492076814174652, -0.07706613838672638, -0.1229381263256073, 0.14425833523273468, 0.02866588532924652, -0.28169888257980347, 0.24186836183071136, -0.09911328554153442, 0.23431245982646942, -0.2512640058994293, -0.08100053668022156, 0.08168172091245651, -0.043187759816646576, 0.16990195214748383, -0.11269163340330124, 0.1131410300731659, 0.05934273079037666, -0.1227995976805687, 0.9353616237640381, -0.00012762061669491231, 0.021349243819713593, 0.08668816089630127, 0.019877776503562927, -0.04764612019062042, -0.30402615666389465, 0.3239411413669586, 0.28456997871398926, 0.3673229515552521, -0.18116775155067444, 0.1401054710149765, 0.41566571593284607, 0.014741754159331322, -0.29829999804496765, 0.49426931142807007, 0.06082380563020706, 0.1128750815987587, 0.34720900654792786, -0.2658363878726959, -0.08535933494567871, -0.30964380502700806, 0.3370766043663025, -0.09858476370573044, 0.36892083287239075, 0.2771861255168915, -0.2678222060203552, -0.20149677991867065, 0.4205917418003082, -0.29362112283706665, -0.08682514727115631, 0.14729824662208557, -0.26183071732521057, 0.32064154744148254, -0.6189651489257812, 0.14099696278572083, 0.040892742574214935, -0.5176493525505066, -0.03415582329034805, -0.1567881852388382, -0.27619749307632446, 0.04902227967977524, 0.17388421297073364, 0.021961040794849396, 0.1347855031490326, -0.3760126829147339, 0.005135823041200638, -0.18212592601776123, -0.07373052835464478, 0.0809829831123352, 0.13341063261032104, 0.271506667137146, 0.35636916756629944, -0.013999944552779198, 0.48192349076271057, 0.23509792983531952, 0.04307566583156586, -0.06164393201470375, -0.22257211804389954, 0.43745213747024536, -0.0019473284482955933, -0.3395535945892334, 0.35948848724365234, 0.2738471031188965, -0.09357248246669769, -0.18640992045402527, -0.3429257273674011, 0.006968170404434204, 0.1629793494939804, 0.5577451586723328, 0.1283750981092453, 0.1935071498155594, -0.13797515630722046, 0.02968868985772133, 0.2512725591659546, 0.1795225590467453, -0.19116760790348053, -0.3446064591407776, 0.1083492636680603, 0.011017423123121262, -0.23925785720348358, 0.07352028787136078, 0.08395485579967499, 0.19950741529464722, 0.011005572974681854, -0.08703511208295822, -0.13902245461940765, -0.26723384857177734, 0.04344527795910835, 0.40136611461639404, 0.3691451847553253, 0.14718317985534668, 0.505796492099762, 0.551234245300293, 0.02855467051267624, -0.3623717129230499, 0.0389343798160553, -0.08463306725025177, -0.15987302362918854, -0.25327396392822266, -0.049369268119335175, -0.03577129542827606, -0.18702787160873413, -0.024861304089426994, -0.02971840277314186, 0.385587215423584, -0.14169102907180786, 0.4539381265640259, -0.2694624364376068, 0.24967700242996216, 0.36863672733306885, -0.23998302221298218, 0.17703881859779358, 0.3516317903995514, 0.10455925762653351, -0.06364163756370544, 0.17583143711090088, -0.34571924805641174, -0.32997769117355347, 0.11898148059844971, 0.020167700946331024, 0.4128654897212982, 0.5470290184020996, 0.18676482141017914, 0.15880271792411804, 0.5563885569572449, -0.14710566401481628, 0.19502344727516174, -0.7049329280853271, -0.3499602973461151, -0.29664257168769836, 0.29432567954063416, 0.32737433910369873, 0.04972958564758301, -0.25172099471092224, -0.258432537317276, -0.05246315151453018, 0.29228001832962036, 0.2739129662513733, -0.2772478461265564, 0.09991040825843811, -0.0679268091917038, 0.08079192042350769, 0.41369038820266724, -0.11949510872364044, -0.14768607914447784, 0.4159523844718933, -0.34566450119018555, 0.22885364294052124, -0.020877808332443237, 0.11125321686267853, -0.14099985361099243, -0.1267256736755371, 0.6400110721588135, -0.13373051583766937, -0.3485316336154938, -0.05150846391916275, -0.22011643648147583, 0.08718447387218475, 0.23945778608322144, -0.0076242610812187195, 0.220200777053833, -0.0011072717607021332, -0.22233706712722778, -0.12773045897483826, 0.29907023906707764, -0.13719777762889862, -0.2710169553756714, 0.033512525260448456, 0.15137657523155212, 0.010563681833446026, 0.08870604634284973, -0.25814610719680786, 0.057998642325401306, 0.28651532530784607, -0.26198193430900574, -0.06999963521957397, -0.06380276381969452, -0.006804570555686951, 0.20783862471580505, 0.4254101812839508, -0.1945466548204422, -0.026740260422229767, 0.004780981689691544, 0.07287389039993286, -0.20466971397399902, -0.30377984046936035, -0.001881524920463562, 0.3201051950454712, -0.34335172176361084, -0.1283200979232788, -0.09429168701171875, 0.19232714176177979, -0.1774025857448578, -0.3731035888195038, -0.5019539594650269, -0.12048058211803436, 0.3584102392196655, 0.0773574560880661, -0.20770815014839172, 0.283285528421402, 0.1152978390455246, -0.4648163914680481, -0.2344794124364853, -0.2124493420124054, -0.08598390966653824, -0.2020009309053421, -0.023100880905985832, 0.41793152689933777, 0.11186610907316208, -0.31560349464416504, 0.21917113661766052, 0.12135769426822662, 0.2505854666233063, 0.5915064811706543, -0.08821521699428558, 0.1297479122877121, -0.002392292022705078, 0.20492033660411835, -0.1983502209186554, 0.16660454869270325, 0.42015525698661804, 0.04710671305656433, 0.10935743153095245, -0.07547320425510406, -0.37234431505203247, -0.09063047170639038, 0.23027436435222626, 0.13955193758010864, 0.10345830023288727, 0.0719514787197113, -0.08176237344741821, 0.1041334718465805, 0.06801974773406982, -0.29172950983047485, 0.5298343300819397, -0.005323318764567375, 0.014577766880393028, 0.037605635821819305, -0.17614513635635376, -0.02358153462409973, -0.028517208993434906, 0.2559939920902252, 0.1365666538476944, 0.10092446208000183, 0.16498500108718872, -0.06381341069936752, -0.14499786496162415, -0.24567075073719025, 0.06730958819389343, -0.31795862317085266, -0.21806932985782623, 0.5031405687332153, 0.07523342967033386, 0.15471073985099792, -0.015496939420700073, 0.23459824919700623, -0.2602387070655823, -0.11551639437675476, -0.19655047357082367, 0.4177095293998718, -0.08859644830226898, 0.17590901255607605, -0.11533095687627792, 0.102675661444664, 0.03061491996049881, -0.2325761467218399, -0.04211273044347763, -0.11973695456981659, -0.22050726413726807, -0.15793684124946594, 0.27860933542251587, -0.25142723321914673, 0.2248525619506836, 0.20717069506645203, -0.4721071720123291, 0.03403580188751221, -0.34287357330322266, 0.030264198780059814, -0.12066441774368286, 0.17743182182312012, 0.34547823667526245, -0.15794695913791656, -0.12827950716018677, -0.13308653235435486, 0.43370047211647034, -0.3636203110218048, 0.173935204744339, 0.1766970157623291, -0.018721457570791245, -0.11469897627830505, -0.28906261920928955, 0.014520246535539627, -0.2273748368024826, -0.23925983905792236, 0.2304242104291916, -0.2890270948410034, 0.09578372538089752, 0.000007405877113342285, 0.2663404047489166, 0.11982855200767517, -0.21502594649791718, 0.03148280084133148, -0.08790439367294312, -0.047590501606464386, 0.09067872166633606, -0.11274246871471405, -0.29397228360176086, -0.051893554627895355, 0.12367113679647446, 0.005277566611766815, 0.3400120735168457, -0.13847468793392181, 0.11711879074573517, -0.0665854662656784, 0.10870194435119629, -0.026339903473854065, -0.07642126083374023, 0.3217892050743103, 0.1763204038143158, -0.01616561785340309, -0.1839866191148758, -0.29655563831329346, 0.1169637143611908, 0.21557274460792542, 0.1644435077905655, -0.06266269087791443, 0.4343266487121582, 0.06995140016078949, 0.7695397138595581, -0.0394568145275116, -0.09072370827198029, -0.12927420437335968, 0.1938571184873581, -0.04492735490202904, 0.0078029874712228775, -0.423518568277359, -0.016675274819135666, -0.4538252651691437, -0.16708862781524658, -0.024342872202396393, 0.07000461965799332, -0.3909609913825989, -0.18592894077301025, -0.06673569977283478, 0.00848563015460968, -0.32097524404525757, 0.3422113358974457, -0.013867110013961792, 0.2662488520145416, -0.18893665075302124, 0.04214125871658325, -0.41688477993011475, 0.21492448449134827, -0.0706971287727356, -0.09657852351665497, 0.2663736343383789, -0.16341179609298706, 0.03905670344829559, -0.12189839035272598, -0.20727631449699402, 0.3339887261390686, 0.11956877261400223, 0.1923149675130844, -0.2272321879863739, -0.06917384266853333, 0.10824838280677795, -0.18421272933483124, 0.6484284996986389, -0.0029274560511112213, -0.13333788514137268, 0.531780481338501, -0.5801010727882385, -0.5742730498313904, 0.15886655449867249, -0.08814425021409988, 0.41301247477531433, 0.4341018795967102, -0.02252684161067009, -0.16007302701473236, -0.32826635241508484, -0.06267918646335602, 0.1483658254146576, -0.2606185972690582, -0.1114141196012497, -0.32577943801879883, -0.11110945791006088, -0.16446900367736816, 0.2498389631509781, 0.3032888174057007, 0.0565045028924942, -0.1254643052816391, 0.007574118673801422, -0.04471069946885109, -0.03577806428074837, -0.015337999910116196, -0.041015997529029846, 0.0016504935920238495, -0.025177722796797752, -0.012340977787971497, 0.21601876616477966, 0.2971676290035248, -0.016680579632520676, 0.28706666827201843, -0.3169786036014557, -0.15836751461029053, 0.27634191513061523, 0.18388332426548004, 0.29985374212265015, 0.45154234766960144, -0.143863707780838, -0.02051541954278946, 0.4614051878452301, 0.3507804572582245, 0.053976383060216904, 0.21094171702861786, 0.37904322147369385, -0.13672348856925964, -0.2782100439071655, -0.14182023704051971, -0.008312001824378967, 0.19370916485786438, -0.18671348690986633, 0.6959595680236816, -0.3839486241340637, -0.034504108130931854, 0.05250587314367294, 0.42828792333602905, 1.0696437358856201, -0.20226263999938965, 0.11139249056577682, -0.03224601596593857, -0.2792821526527405, 0.0857735276222229, -0.0024952441453933716, 0.3277420103549957, 0.010833531618118286, -0.21036852896213531, -0.039677467197179794, -0.29638370871543884, 0.10684457421302795, 0.14028537273406982, -0.025592446327209473, 0.2045881152153015, -0.24219170212745667, -0.013435868546366692, 0.18510419130325317, 0.12536610662937164, 0.2720050811767578, -0.21917849779129028, 0.07593837380409241, 0.03575979173183441, 0.011454936116933823, 0.10970956087112427, -0.17390185594558716, -0.05424454063177109, 0.48777368664741516, -0.4029272794723511, -0.0708618313074112, 0.25999313592910767, -0.7481939792633057, 0.19477254152297974, -0.29801613092422485, -0.18395014107227325, 0.28928065299987793, 0.09888257086277008, -0.4255048632621765, -0.15443924069404602, 0.03652947396039963, 0.06453350186347961, 0.27821797132492065, 0.15419825911521912, -0.15626323223114014, -0.17396873235702515, 0.15735535323619843, 0.07770723849534988, -0.0003765970468521118, -0.08369824290275574, -0.11757636070251465, -0.35620349645614624, -0.09442166984081268, 0.27996671199798584, 0.352932333946228, 0.05477634444832802, -0.14721405506134033, -0.011091362684965134, -0.253057062625885, -0.2155546396970749, 0.0236065536737442, -0.02039112150669098, -0.08918946981430054, 0.1257203221321106, -0.3199595808982849, -0.2536957859992981, 0.10948063433170319, 0.31806090474128723, 0.09297464042901993, -0.1414198875427246, 0.2928006947040558, 0.23682665824890137, -0.18477925658226013, -0.230861097574234, -0.33016932010650635, 0.09359703958034515, -0.4144970178604126, 0.46820756793022156, -0.1864909529685974, -0.09576111286878586, -0.026083193719387054, -0.04146302491426468, -0.04341549798846245, -0.047862324863672256, -0.24675793945789337, -0.04233958572149277, -0.49058595299720764, -0.11905317008495331, 0.028704024851322174, -0.055913735181093216, 0.06911083310842514, 0.08447548747062683, 0.1367945671081543, 0.1991872787475586, -0.1668109893798828, -0.20927271246910095, -0.15418271720409393, -0.011356823146343231, 0.1346164047718048, 0.11217907816171646, 0.11117728054523468, 0.11573871970176697, -0.06988483667373657, 0.3281692564487457, 0.1375999003648758, -0.1132919117808342, -0.11931061744689941, 0.19599826633930206, 0.16392989456653595, 0.07979962229728699, 0.2456611543893814, -0.29645001888275146, 0.16584685444831848, -0.1857224702835083, 0.12451260536909103, 0.2563347816467285, -0.2059324085712433, -0.08636078238487244, 0.049312394112348557, 0.04974367469549179, 0.01884566992521286, 0.25674012303352356, 0.025190021842718124, -0.08402933180332184, 0.14970791339874268, 0.10103634744882584, 0.43405240774154663, -0.0010554417967796326, -0.4105302691459656, -0.16812284290790558, -0.05622022971510887, 0.18033556640148163, 0.12164955586194992, -0.11497022956609726, -0.22929763793945312, -0.10786226391792297, 0.17456576228141785, 0.30534762144088745, -0.0030065588653087616, 0.18703976273536682, 0.05523207411170006, -0.02233799919486046, -0.16056454181671143, -0.012916259467601776, 0.22469890117645264, -0.09827777743339539, 0.07035468518733978, 0.08091408759355545, -0.30277472734451294, 0.32761943340301514, 0.16544991731643677, 0.19847486913204193, -0.10902035981416702, 0.013022266328334808, 0.26981911063194275, 0.4212973713874817, 0.3272182047367096, 0.35825884342193604, 0.3731761872768402, 0.003619084134697914, 0.15215396881103516, -0.12588617205619812, 0.11604270339012146, 0.5444135665893555, 0.1215285211801529, 0.05658240616321564, 0.30950605869293213, -0.15415647625923157, -0.04761257767677307, -0.14538130164146423, 0.09541361033916473, 0.14612695574760437, -0.5196988582611084, -0.14599654078483582, -0.391757994890213, -0.672614574432373, 0.041681498289108276, 0.47432222962379456, -0.21686860918998718, -0.051579318940639496, -0.18397697806358337, -0.0031551048159599304, 0.1496821641921997, -0.16499203443527222, 0.16508489847183228, 0.0678253322839737, 0.6268429756164551, 0.20559853315353394, 0.09371322393417358, -0.1989452838897705, -0.5609787106513977, 0.025383271276950836, 0.23709145188331604, -0.19779664278030396, -0.09414944052696228, 0.3188190758228302, 0.0666118711233139, -0.147653266787529, 0.11093250662088394, 0.3579283356666565, 0.4043870270252228, -0.5753968358039856, 0.010155096650123596, 0.23455661535263062, 0.10022183507680893, -0.17673936486244202, 0.06475278735160828, 0.01464221440255642, 0.29263630509376526, 0.17438311874866486, -0.01038983091711998, -0.15393489599227905, -0.10635534673929214, 0.03138306736946106, 0.30811432003974915, -0.1318584829568863, 0.6698080897331238, -0.12922364473342896, -0.19287431240081787, 0.08318926393985748, -0.06539137661457062, -0.23620319366455078, 0.24387110769748688, 0.5980789661407471, -0.07969541102647781, 0.07717622816562653, 0.018509671092033386, 0.011930879205465317, 0.042802225798368454, 0.3307930529117584, -0.2941420376300812, 0.26028937101364136, -0.3976747393608093, 0.1786998212337494, -0.41020724177360535, 0.23347321152687073, -0.2969263195991516, -0.0625617504119873, 0.06923860311508179, -0.124024897813797, 0.0948953777551651, -0.038126882165670395, 0.2451644390821457, -0.6951651573181152, 0.20811793208122253, 0.35978206992149353, -0.11782021820545197, -0.06418784707784653, -0.19291691482067108, -0.0027034133672714233, 0.3498792052268982, -0.34360820055007935, -0.04009811952710152, 0.08729106187820435, -0.024852804839611053, -0.11664368212223053, -0.3560090959072113, 0.1768588274717331, 0.12028954923152924, 0.25152745842933655, 0.17895963788032532, 0.4414612948894501, 0.09007558226585388, -0.14915400743484497, 0.25845077633857727, 0.12860435247421265, 0.11992938816547394, -0.032781995832920074, -0.00824522040784359, 0.4527892768383026, -0.34217318892478943, -0.16621527075767517, -0.6208341121673584, -0.12214246392250061, 0.006029188632965088, -0.24258708953857422, -0.15037724375724792, 0.1871567666530609, -0.019292369484901428, 0.022571247071027756, 0.10406172275543213, 0.5349797010421753, -0.010805731639266014, 0.17119881510734558, -0.5036360025405884, 0.06498672813177109, 0.6294061541557312, -0.5843209028244019, -0.5394695997238159, -0.22075307369232178, 0.29752978682518005, -0.40112578868865967, 0.041086018085479736, -0.3050130605697632, -0.33138152956962585, 0.2121238112449646, 0.008595086634159088, -0.30021899938583374, -0.024134840816259384, -0.13373443484306335, -0.1247793510556221, -0.10018274188041687, 0.1798277646303177, -0.1554066240787506, -0.08937326818704605, 0.20503383874893188, -0.2552962601184845 ]
https://github.com/huggingface/datasets/issues/5783
Hi! This looks like an Arrow bug, but it can be avoided by reducing the `writer_batch_size`. (`ds = ds.map(get_text_caption, writer_batch_size=100)` in Colab runs without issues)
Offset overflow while doing regex on a text column
### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0
25
Offset overflow while doing regex on a text column ### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0 Hi! This looks like an Arrow bug, but it can be avoided by reducing the `writer_batch_size`. (`ds = ds.map(get_text_caption, writer_batch_size=100)` in Colab runs without issues)
[ -0.051982492208480835, -0.4041005074977875, 0.039625491946935654, 0.47294285893440247, -0.07583805918693542, -0.14034049212932587, 0.4730936288833618, 0.07036614418029785, -0.31081461906433105, 0.12827281653881073, 0.3353617787361145, 0.36317771673202515, 0.036953557282686234, -0.02212691307067871, -0.24977917969226837, 0.004243534989655018, -0.0402800552546978, -0.04375298693776131, -0.19243963062763214, 0.04184911400079727, -0.11921005696058273, 0.06002309173345566, -0.49670660495758057, 0.13792181015014648, -0.17727090418338776, -0.18309782445430756, 0.27223077416419983, 0.04301467537879944, -0.07329170405864716, -0.2895943224430084, 0.5172644853591919, -0.3087437152862549, 0.17363938689231873, 0.07159090787172318, -0.0001292774686589837, -0.19132325053215027, 0.3413839638233185, 0.17801806330680847, 0.17475205659866333, 0.01958777755498886, -0.4109516739845276, 0.0002325102686882019, -0.07630613446235657, -0.05729341506958008, 0.5007085800170898, -0.003873296082019806, -0.2584441900253296, -0.44016218185424805, 0.22203688323497772, 0.5459546446800232, 0.024598101153969765, -0.15468725562095642, 0.051031939685344696, 0.34331250190734863, 0.2083228975534439, -0.09530162066221237, 0.03174509108066559, -0.13877125084400177, 0.13153788447380066, -0.08264240622520447, 0.04703785851597786, 0.43043333292007446, -0.30463749170303345, -0.22998429834842682, 0.12376366555690765, 0.15603327751159668, 0.07649118453264236, -0.007274990435689688, 0.08470281958580017, 0.16125108301639557, 0.3423193693161011, -0.13464568555355072, -0.18805596232414246, -0.26438772678375244, 0.14438867568969727, -0.0196184441447258, 0.38562852144241333, 0.13453055918216705, 0.06712569296360016, 0.23486226797103882, -0.3934384286403656, 0.18884813785552979, -0.19786472618579865, 0.036990150809288025, 0.039531439542770386, 0.07727320492267609, -0.06855349242687225, 0.10865898430347443, 0.10969717055559158, -0.10168278217315674, 0.26826170086860657, -0.23577488958835602, -0.2879582345485687, 0.24953536689281464, -0.2962331175804138, 0.19778825342655182, -0.15156883001327515, -0.444557785987854, 0.34036141633987427, 0.24485136568546295, 0.13951902091503143, -0.11897003650665283, -0.16179391741752625, 0.06301748752593994, 0.07925091683864594, 0.2883981168270111, -0.15785618126392365, 0.4721687436103821, -0.06845273077487946, -0.0452774278819561, 0.2087383270263672, 0.008321642875671387, -0.024378491565585136, -0.4002106487751007, 0.10062670707702637, -0.039743728935718536, 0.309303879737854, -0.10078366100788116, -0.3726489543914795, 0.3461654782295227, -0.5158780217170715, 0.13638366758823395, 0.051755860447883606, -0.26505720615386963, 0.0442219041287899, 0.02274143323302269, 0.04594375193119049, 0.19720737636089325, 0.21037501096725464, -0.16294702887535095, -0.08717705309391022, -0.18359780311584473, -0.16213949024677277, -0.07095125317573547, -0.13617751002311707, 0.12782074511051178, -0.10599999129772186, 0.2311970591545105, 0.16992971301078796, -0.09400776028633118, -0.18125516176223755, -0.28487539291381836, 0.4860990643501282, -0.012388190254569054, -0.2723524272441864, 0.1404155194759369, -0.050771549344062805, 0.060558170080184937, -0.12419921904802322, 0.32043081521987915, -0.37544843554496765, -0.23223179578781128, -0.27432677149772644, 0.04624549299478531, -0.06140544265508652, -0.056767046451568604, -0.4310033321380615, 0.13040925562381744, 0.4817490875720978, -0.04268915206193924, 0.2625555992126465, -0.07458025217056274, -0.04970535263419151, -0.03625793382525444, 0.16565874218940735, 0.2445128858089447, -0.5845516920089722, 0.3630417585372925, -0.042190276086330414, 0.483786016702652, 0.36461472511291504, 0.46898865699768066, -0.144893616437912, 0.07720336318016052, -0.21401172876358032, 0.11456142365932465, 0.06647216528654099, -0.23135177791118622, -0.48898857831954956, 0.013903327286243439, -0.1928512156009674, 0.010274171829223633, 0.2385924905538559, -0.2623150050640106, -0.015440473333001137, 0.008059151470661163, -0.04895443841814995, 0.46003299951553345, -0.04878516495227814, 0.1590425968170166, -0.2114659547805786, -0.37314552068710327, -0.14615465700626373, -0.08410836011171341, -0.16697649657726288, -0.27213412523269653, -0.12804898619651794, -0.6010196805000305, 0.011922799050807953, -0.036532819271087646, 0.11246175318956375, 0.4533744156360626, 0.2699833810329437, 0.06915344297885895, 0.22541454434394836, -0.3891218304634094, -0.09203383326530457, -0.13503575325012207, 0.25158941745758057, -0.10879980027675629, -0.20694729685783386, -0.2146909087896347, -0.1254701018333435, 0.19816498458385468, -0.09852400422096252, 0.3530743420124054, -0.061044834554195404, -0.2812758982181549, 0.12786050140857697, 0.019542470574378967, -0.1659514456987381, 0.5400465726852417, 0.0019396916031837463, 0.3127859830856323, -0.23039530217647552, 0.3213003873825073, -0.07501354068517685, -0.2805730104446411, -0.11069749295711517, 0.22805844247341156, 0.025133460760116577, -0.007459428161382675, -0.24902506172657013, 0.49606966972351074, 0.019421223551034927, -0.13446804881095886, -0.10095160454511642, -0.22453828155994415, 0.07560735195875168, -0.5994834899902344, 0.01029360480606556, 0.06688587367534637, 0.022597163915634155, 0.013287566602230072, -0.10145366191864014, 0.05975862219929695, -0.1921968013048172, 0.3630381226539612, -0.10273262858390808, -0.0021023228764533997, 0.03244858980178833, -0.0960930734872818, 0.030226461589336395, -0.1670747697353363, 0.028260840103030205, -0.01634342037141323, -0.1091209203004837, -0.06258629262447357, -0.22824998199939728, 0.13226357102394104, 0.21486610174179077, 0.2321675419807434, -0.2212236523628235, 0.3575029671192169, -0.34225547313690186, -0.012460067868232727, -0.08772680163383484, 0.22923487424850464, 0.30653345584869385, 0.26594096422195435, -0.0513286218047142, 0.008297597989439964, 0.06416298449039459, 0.08200101554393768, 0.2691379487514496, 0.2524194121360779, 0.00024219974875450134, 0.11346669495105743, 0.3624809980392456, 0.27085432410240173, -0.11312143504619598, -0.44414985179901123, 0.0634559914469719, 0.12527495622634888, -0.3119630515575409, 0.39605531096458435, -0.22763961553573608, -0.33346593379974365, -0.3195042908191681, -0.3771364092826843, 0.013799384236335754, -0.27135252952575684, -0.22879254817962646, 0.11622907966375351, -0.3087579011917114, 0.21952873468399048, 0.12017861008644104, 0.0959760844707489, 0.5347465872764587, -0.14480942487716675, -0.19851404428482056, -0.07422400265932083, -0.260113924741745, -0.1445472538471222, 0.30774909257888794, -0.06701628863811493, -0.10286851972341537, 0.24749282002449036, 0.23026758432388306, -0.1644512116909027, -0.3566996455192566, 0.059801168739795685, 0.1546744555234909, -0.07743100821971893, 0.3080354332923889, -0.2788167893886566, -0.5651155114173889, -0.41435766220092773, -0.10030564665794373, 0.30292659997940063, -0.14367112517356873, 0.3867766857147217, 0.18814817070960999, -0.05273342877626419, -0.1719820350408554, -0.08900170028209686, 0.3324849307537079, -0.22821056842803955, 0.07407426834106445, -0.40933728218078613, 0.06296463310718536, 0.4761696755886078, -0.05871452018618584, 0.08947356045246124, -0.16193559765815735, -0.09385767579078674, -0.09999370574951172, 0.18425323069095612, 0.3848535120487213, -0.005162332206964493, -0.17309539020061493, -0.14409759640693665, -0.276397705078125, -0.09785833209753036, 0.28378114104270935, -0.3376127779483795, -0.03308829292654991, -0.2823537588119507, -0.16102641820907593, -0.3925548195838928, 0.1976165622472763, 0.12930655479431152, 0.16754095256328583, 0.12420108914375305, -0.015483520925045013, -0.05823617801070213, 0.48090019822120667, 0.07239452749490738, -0.02596224844455719, 0.1290823221206665, 0.18792524933815002, 0.07032497227191925, -0.06497396528720856, 0.29476022720336914, -0.045184556394815445, 0.08139925450086594, 0.023269230499863625, -0.0418526716530323, -0.0888247862458229, -0.14503206312656403, -0.2783854901790619, 0.22191429138183594, 0.023312032222747803, -0.015088576823472977, 0.017478138208389282, 0.0402359738945961, 0.2292059361934662, 0.12327117472887039, -0.01846715807914734, -0.1870318353176117, 0.06142144650220871, -0.2711912989616394, 0.07136055827140808, 0.13651473820209503, -0.2040807604789734, -0.18123053014278412, -0.06900862604379654, -0.11859161406755447, -0.06050539016723633, 0.11153025925159454, -0.15202200412750244, -0.12774792313575745, -0.1587907373905182, 0.08270040154457092, 0.3843614459037781, 0.4363153874874115, 0.2953725755214691, 0.17372313141822815, 0.010750725865364075, 0.024017509073019028, 0.17610058188438416, 0.5297781825065613, -0.2828321158885956, -0.23608475923538208, -0.20109641551971436, 0.24641481041908264, -0.5318865180015564, -0.09996412694454193, -0.16409605741500854, -0.12716951966285706, 0.42409154772758484, 0.3544619083404541, -0.12059631198644638, 0.1501067578792572, 0.8325552344322205, 0.05673971399664879, 0.06284242868423462, -0.08426330983638763, -0.0798577219247818, -0.3310703635215759, 0.05758017301559448, 0.23499028384685516, 0.36809518933296204, 0.5058440566062927, 0.3398270606994629, -0.20061731338500977, -0.28798404335975647, -0.09257598221302032, -0.18567544221878052, -0.11429987847805023, 0.5679924488067627, -0.289119154214859, 0.19217467308044434, -0.11894717067480087, -0.006453340873122215, 0.36489343643188477, 0.21908390522003174, 0.050332505255937576, -0.28118112683296204, -0.3139546513557434, -0.33757367730140686, 0.5702787041664124, 0.06151239573955536, -0.10744335502386093, 0.027210183441638947, 0.11290159821510315, 0.09739849716424942, 0.08504058420658112, 0.08588046580553055, 0.017940040677785873, 0.2522967457771301, -0.15331099927425385, -0.24860575795173645, 0.29089319705963135, 0.16449140012264252, -0.005970224738121033, 0.6621075868606567, 0.5849456787109375, -0.44342726469039917, 0.2679530084133148, 0.03619072213768959, 0.8636912107467651, 0.20601332187652588, -0.11409294605255127, 0.23839470744132996, -0.1778494268655777, 0.04916523024439812, 0.3729016184806824, 0.11750657856464386, -0.2510504722595215, -0.3293520510196686, -0.008812539279460907, -0.3097308576107025, 0.09029047191143036, 0.1373581886291504, -0.1663280576467514, -0.032007813453674316, 0.1368025541305542, 0.3076184093952179, -0.05746817961335182, -0.16782936453819275, -0.05891481786966324, -0.12184260785579681, -0.11154650151729584, -0.11739781498908997, 0.16540905833244324, -0.4487014412879944, -0.05536554753780365, -0.23840154707431793, -0.2390393316745758, -0.3423728346824646, -0.4324391186237335, 0.0529012605547905, -0.3275991678237915, 0.06194072589278221, 0.3491312265396118, -0.3771847188472748, 0.42248356342315674, 0.035608306527137756, 0.33637598156929016, 0.14177151024341583, -0.03865060955286026, -0.21379345655441284, 0.23265758156776428, -0.1736782044172287, 0.08479490876197815, -0.013458393514156342, 0.11469069123268127, 0.15499833226203918, -0.14070793986320496, -0.20380671322345734, 0.11936789005994797, -0.07224468141794205, 0.1700177639722824, 0.07169795036315918, -0.07225675880908966, -0.30708590149879456, -0.015498626977205276, -0.08278892934322357, 0.06630441546440125, -0.09610596299171448, -0.023156315088272095, 0.1925736963748932, -0.3104207217693329, 0.24433311820030212, 0.02228504791855812, -0.2302829921245575, -0.0302326288074255, 0.3240421712398529, -0.0030399467796087265, 0.07244008779525757, 0.5520380735397339, 0.21796709299087524, -0.2502475380897522, 0.06496966630220413, 0.061674296855926514, 0.39477744698524475, -0.5941242575645447, 0.15238700807094574, -0.6818413138389587, 0.13260489702224731, 0.1785343438386917, 0.20030632615089417, 0.1455105096101761, 0.17929916083812714, -0.31278499960899353, -0.34414058923721313, -0.15542635321617126, 0.2644769847393036, -0.288480669260025, -0.021323032677173615, -0.020895816385746002, -0.21042555570602417, -0.12642326951026917, -0.22581329941749573, -0.12798187136650085, 0.13239827752113342, 0.0075722187757492065, 0.22868065536022186, 0.2864972949028015, -0.04349729046225548, 0.2954903244972229, -0.36939531564712524, -0.0754937082529068, 0.5161480903625488, 0.218256413936615, -0.06211593747138977, -0.1345037817955017, 0.11989974975585938, 0.021326377987861633, -0.4115644097328186, -0.23202961683273315, -0.07528381794691086, -0.2737227976322174, -0.049679890275001526, 0.01443183422088623, -0.005250856280326843, 0.1722910851240158, 0.2543809413909912, -0.24372069537639618, -0.15036463737487793, -0.22450682520866394, 0.13700981438159943, -0.18880793452262878, 0.08907276391983032, 0.01596778631210327, 0.42866724729537964, 0.06919680535793304, -0.09842599928379059, -0.13563048839569092, 0.04997622221708298, 0.09862636774778366, 0.031630564481019974, 0.33865484595298767, -0.5081079006195068, -0.2620617747306824, 0.45133665204048157, 0.3209017813205719, 0.2378135770559311, -0.1383955180644989, -0.47403523325920105, 0.2801484167575836, 0.08597896248102188, -0.13014325499534607, -0.09496308863162994, 0.10356130450963974, 0.11791417002677917, -0.09638861566781998, 0.2322082817554474, -0.022623084485530853, -0.30810171365737915, -0.2420641928911209, 0.3353673815727234, 0.3850473165512085, 0.08242598176002502, -0.041488293558359146, 0.6546432375907898, -0.13077588379383087, 0.05593077093362808, 0.26761001348495483, 0.27299508452415466, 0.4417625665664673, 0.42617931962013245, 0.2125973254442215, 0.09274064004421234, 0.4674733877182007, -0.22684049606323242, -0.030177921056747437, -0.2097417563199997, -0.09014300256967545, 0.42411816120147705, 0.005914192646741867, 0.056202806532382965, 0.2931664288043976, 0.1856473982334137, 0.2183523029088974, -0.043281689286231995, 0.06486084312200546, -0.218661367893219, -0.29833412170410156, 0.20655013620853424, -0.06135360151529312, 0.15940868854522705, 0.04042261838912964, -0.08113617449998856, 0.04929006099700928, 0.3371945321559906, 0.6936203241348267, -0.08841307461261749, 0.13328157365322113, -0.23762232065200806, 0.1965024173259735, 0.3441748321056366, 0.1907402127981186, -0.4321207106113434, 0.1473103016614914, 0.19003400206565857, -0.12377883493900299, 0.014631252735853195, 0.44360414147377014, 0.43939149379730225, 0.29551833868026733, -0.018299371004104614, -0.024453066289424896, -0.014535490423440933, -0.06915334612131119, -0.13172286748886108, 0.2819809913635254, 0.19304203987121582, 0.16143515706062317, 0.083797886967659, -0.06464751809835434, -0.01629171147942543, 0.20367580652236938, 0.25032052397727966, 0.21976450085639954, -0.23372283577919006, -0.12033626437187195, -0.07741869986057281, -0.40348586440086365, -0.0012262482196092606, -0.12720105051994324, -0.020557411015033722, 0.031034305691719055, 0.5396705865859985, 0.0774102658033371, 0.08936642855405807, 0.2825522720813751, -0.030467413365840912, 0.08532030135393143, 0.377322256565094, 0.9920770525932312, -0.10711150616407394, -0.02906738594174385, -0.21046513319015503, -0.13932473957538605, 0.2511045038700104, -0.04998214170336723, -0.19188228249549866, 0.49673160910606384, 0.0006108656525611877, -0.14134085178375244, 0.07507267594337463, 0.41534653306007385, 0.02841067686676979, -0.43786928057670593, 0.4524555206298828, -0.32120418548583984, -0.2732115685939789, 0.4101877212524414, -0.39330294728279114, -0.04394591599702835, -0.39456266164779663, 0.21277326345443726, 0.21453675627708435, -0.12189556658267975, 0.056734055280685425, 0.22938716411590576, -0.22222885489463806, -0.13881753385066986, 0.04241514205932617, 0.3254051208496094, 0.08044220507144928, 0.16035184264183044, 0.13513876497745514, -0.2884596288204193, -0.09665770828723907, -0.29337602853775024, 0.6043492555618286, 0.01046556793153286, 0.3621259331703186, -0.3174833059310913, -0.18310602009296417, -0.028015170246362686, 0.1870461106300354, 0.18878145515918732, -0.3130519986152649, -0.4588613510131836, 0.15797042846679688, -0.11545088142156601, -0.03688337653875351, 0.04101070016622543, -0.09480062872171402, 0.18836617469787598, 0.3014850616455078, 0.12967312335968018, -0.48293790221214294, 0.22731222212314606, -0.3628218173980713, -0.5693137645721436, 0.1117490828037262, 0.18046990036964417, 0.6642470955848694, -0.45441168546676636, -0.5753029584884644, -0.05742038041353226, 0.22058403491973877, -0.14341241121292114, -0.3097977042198181, 0.10617087781429291, 0.23926149308681488, -0.05840018764138222, -0.031818874180316925, 0.01642339676618576, 0.18602706491947174, -0.2284596562385559, 0.03487791121006012, -0.21576708555221558 ]
https://github.com/huggingface/datasets/issues/5783
@mariosasko How do I determine the optimal size of write_batch_size? My training is sometimes fast and sometimes slow. Is it because write_batch_size is too small? Each batch of the current dataloader should be the same size. I preprocessed the dataset using map
Offset overflow while doing regex on a text column
### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0
42
Offset overflow while doing regex on a text column ### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0 @mariosasko How do I determine the optimal size of write_batch_size? My training is sometimes fast and sometimes slow. Is it because write_batch_size is too small? Each batch of the current dataloader should be the same size. I preprocessed the dataset using map
[ -0.23163391649723053, -0.44801807403564453, 0.00698016956448555, 0.5094287395477295, -0.10499437898397446, -0.2033630907535553, 0.4088912606239319, 0.21802420914173126, -0.19072255492210388, 0.15474748611450195, 0.3902827203273773, -0.08839414268732071, -0.005192747339606285, 0.0818256363272667, -0.20683899521827698, 0.0091314148157835, -0.05681806430220604, -0.07971999049186707, -0.18702629208564758, 0.011219017207622528, -0.1456241011619568, -0.02366848848760128, -0.41715124249458313, 0.001831836998462677, -0.13145163655281067, -0.23436084389686584, 0.20847821235656738, 0.04056021571159363, -0.1143932044506073, -0.2799317538738251, 0.44297149777412415, -0.3747192323207855, 0.22349198162555695, 0.12564721703529358, -0.0001287469349335879, -0.11302003264427185, 0.296766459941864, -0.02501455321907997, 0.20957425236701965, 0.13915382325649261, -0.3283536434173584, -0.14010947942733765, -0.2478182315826416, -0.10180827975273132, 0.4731864929199219, -0.032097917050123215, -0.10577122122049332, -0.4169670641422272, 0.3130750358104706, 0.5793930888175964, 0.007819319143891335, 0.06630100309848785, -0.03222118318080902, 0.18967388570308685, 0.23588404059410095, -0.0534043125808239, 0.06533747911453247, -0.08125431090593338, 0.12502677738666534, -0.06823604553937912, -0.15328459441661835, 0.30857449769973755, -0.2456158548593521, -0.18212004005908966, 0.1686735302209854, 0.13233111798763275, 0.2657584846019745, -0.08903762698173523, 0.058266568928956985, 0.21781112253665924, 0.3600969612598419, -0.01546199806034565, -0.20457953214645386, -0.34761232137680054, 0.06327170133590698, -0.020500436425209045, 0.3240582048892975, -0.022922277450561523, 0.027384988963603973, 0.22509899735450745, -0.5493283867835999, 0.16401603817939758, -0.23753556609153748, 0.05092998966574669, 0.14658482372760773, 0.02637512795627117, -0.060958873480558395, 0.1383296400308609, 0.1764373779296875, -0.1833515465259552, 0.143903911113739, -0.17603200674057007, -0.18185551464557648, 0.2701614201068878, -0.4464394748210907, 0.09469065070152283, -0.10029724985361099, -0.489385187625885, 0.4071921706199646, 0.16303160786628723, 0.11304713785648346, -0.18855389952659607, 0.1313142478466034, -0.05835697427392006, 0.06805664300918579, 0.48727959394454956, -0.13482451438903809, 0.3534775972366333, -0.07550141215324402, -0.049936894327402115, 0.14897088706493378, 0.06372328102588654, -0.14374658465385437, -0.5165847539901733, 0.23626381158828735, -0.0834277868270874, 0.12214051932096481, -0.0034146830439567566, -0.3840290307998657, 0.35713720321655273, -0.39161616563796997, 0.05323127284646034, 0.06898379325866699, -0.16313663125038147, 0.02298104390501976, -0.014248959720134735, 0.02195695787668228, 0.20384635031223297, 0.0938064232468605, -0.09741771221160889, -0.1581338793039322, -0.15560637414455414, -0.2680850625038147, -0.13936197757720947, -0.1294896900653839, 0.18032558262348175, -0.025307217612862587, 0.10717123746871948, 0.08412174880504608, -0.09333208203315735, -0.17262086272239685, -0.3065176010131836, 0.4858795404434204, 0.05099824443459511, -0.17953859269618988, 0.089743472635746, -0.0355091355741024, 0.18578855693340302, -0.23887863755226135, 0.2246316820383072, -0.3088971972465515, -0.4083094000816345, -0.10682627558708191, 0.03651655092835426, 0.028329864144325256, 0.05221722275018692, -0.5182977318763733, 0.13311585783958435, 0.5981969237327576, 0.07533258199691772, 0.2640187740325928, -0.20250266790390015, -0.07879073172807693, -0.15820305049419403, 0.17373669147491455, 0.3198530375957489, -0.5485252737998962, 0.29109126329421997, 0.1410137414932251, 0.4314907491207123, 0.4243289828300476, 0.6651785373687744, -0.08276019990444183, 0.2667858600616455, -0.132923424243927, 0.12179331481456757, 0.18361151218414307, -0.31813693046569824, -0.5084604024887085, 0.22244566679000854, -0.29492560029029846, -0.13115853071212769, 0.4723440110683441, -0.15471842885017395, 0.19600316882133484, -0.06435329467058182, 0.03943878412246704, 0.4984523057937622, -0.0701531246304512, 0.10536622256040573, -0.27368372678756714, -0.4158695638179779, -0.20243366062641144, -0.07025168836116791, -0.056094300001859665, -0.38164353370666504, -0.21267127990722656, -0.5140817761421204, -0.08705291152000427, 0.021283557638525963, 0.146449476480484, 0.5098688006401062, 0.09915247559547424, 0.07043631374835968, 0.09902498126029968, -0.26630571484565735, -0.28519558906555176, -0.08712412416934967, 0.056646838784217834, -0.2834984362125397, -0.003100879490375519, -0.2223363220691681, -0.11693452298641205, 0.1130254939198494, -0.048261210322380066, 0.3290170729160309, -0.08663226664066315, -0.3028052747249603, 0.36280107498168945, -0.09068688750267029, -0.16488033533096313, 0.520175039768219, -0.24647396802902222, 0.24338239431381226, -0.3343333303928375, 0.052270181477069855, -0.01888585090637207, -0.27287548780441284, -0.04048362746834755, 0.14389176666736603, -0.007763093337416649, -0.054598916321992874, -0.15289998054504395, 0.5281906723976135, -0.04321916401386261, -0.15549708902835846, -0.18005003035068512, -0.16911208629608154, -0.07244274765253067, -0.3073941469192505, 0.1913841962814331, -0.1157025545835495, -0.1681855022907257, -0.016554124653339386, -0.19897866249084473, 0.031940653920173645, -0.0675966739654541, 0.33537691831588745, -0.03572430461645126, -0.17424021661281586, -0.11254888772964478, -0.07520553469657898, 0.004788115620613098, -0.15586581826210022, 0.08402424305677414, -0.033661872148513794, 0.03318750858306885, -0.06787703186273575, -0.25063809752464294, -0.09274235367774963, 0.33577314019203186, 0.04788844287395477, -0.17069925367832184, 0.49994587898254395, -0.1827705204486847, -0.003037780523300171, -0.21323706209659576, 0.18782809376716614, 0.35594654083251953, 0.2754989266395569, 0.0734085738658905, -0.10839525610208511, -0.036300886422395706, -0.026396460831165314, 0.27031517028808594, 0.18707597255706787, -0.033243484795093536, 0.12856543064117432, 0.2031361162662506, 0.27643924951553345, -0.16801764070987701, -0.374520480632782, 0.07630180567502975, 0.22035834193229675, -0.3129233121871948, 0.27403944730758667, -0.05202533304691315, -0.2105049192905426, -0.3621901273727417, -0.2508828341960907, 0.04211319610476494, -0.17850828170776367, -0.17343540489673615, -0.016118325293064117, -0.32495179772377014, 0.0982012078166008, -0.010386645793914795, 0.1196783035993576, 0.5170504450798035, -0.15013833343982697, 0.005458436906337738, 0.061806388199329376, -0.2943868935108185, -0.15836216509342194, 0.42515829205513, -0.13293704390525818, 0.04656811058521271, 0.04452572762966156, 0.19083915650844574, -0.04055750370025635, -0.26953959465026855, -0.10265323519706726, 0.027667075395584106, -0.10455648601055145, 0.2863270342350006, 0.07566681504249573, -0.41804468631744385, -0.30658158659935, -0.07412673532962799, 0.20268964767456055, -0.18026983737945557, 0.27818918228149414, 0.15183673799037933, -0.15411117672920227, -0.07166615128517151, -0.13964149355888367, 0.2204529494047165, -0.2730870842933655, 0.12423481047153473, -0.377415269613266, 0.07767896354198456, 0.43827393651008606, 0.036373864859342575, 0.025511592626571655, -0.19526149332523346, -0.09800072014331818, 0.0316498689353466, -0.032848380506038666, 0.40539851784706116, 0.024777784943580627, -0.08073949813842773, -0.18013127148151398, -0.19628962874412537, -0.03722519427537918, 0.32437363266944885, -0.363975465297699, 0.1005922257900238, -0.365815669298172, -0.1741451770067215, -0.32349616289138794, 0.37707415223121643, 0.2886058986186981, 0.031889572739601135, 0.10360034555196762, -0.06320513784885406, -0.004334725439548492, 0.5997148752212524, 0.11117570102214813, 0.005004420876502991, 0.14747411012649536, 0.2613440454006195, 0.11077523976564407, 0.22134408354759216, 0.4336983561515808, -0.10751896351575851, -0.022594694048166275, 0.15582527220249176, -0.053249601274728775, -0.07712040096521378, -0.04027235507965088, -0.1456066370010376, 0.1914023756980896, 0.005742184817790985, 0.09290309250354767, 0.0011380910873413086, 0.042429447174072266, 0.37021604180336, 0.11391893029212952, -0.09121174365282059, -0.12689349055290222, 0.34605658054351807, -0.21925461292266846, 0.1440257579088211, 0.026577748358249664, -0.18484565615653992, -0.31055304408073425, -0.05647509545087814, -0.12374675273895264, -0.16166779398918152, 0.12448038160800934, -0.1453692466020584, -0.2567805051803589, -0.11674864590167999, -0.1951068490743637, 0.4055725336074829, 0.33281272649765015, 0.4009712040424347, 0.18559466302394867, -0.013515621423721313, 0.07253095507621765, 0.154235377907753, 0.6659326553344727, -0.41280999779701233, -0.14076882600784302, -0.12138929963111877, 0.2581777572631836, -0.5111240148544312, -0.060813818126916885, -0.18929871916770935, -0.18963855504989624, 0.5068346858024597, 0.4473203122615814, -0.2627415060997009, 0.047345198690891266, 0.7775574326515198, 0.08873695135116577, 0.0632653683423996, -0.11416519433259964, -0.022988036274909973, -0.23802870512008667, 0.046196676790714264, 0.4090275466442108, 0.4182778596878052, 0.435030996799469, 0.3625545799732208, -0.21549458801746368, -0.24322931468486786, -0.08351258933544159, -0.05224817618727684, -0.013290300965309143, 0.4572409391403198, -0.1512681245803833, 0.2913203835487366, 0.10792753100395203, -0.10121841728687286, 0.44165435433387756, 0.2339521050453186, -0.08969731628894806, -0.13045674562454224, -0.23068949580192566, -0.175924152135849, 0.6246809959411621, 0.29907023906707764, -0.04744353145360947, -0.04274444282054901, 0.22154998779296875, 0.31710946559906006, -0.0270351842045784, 0.0723310112953186, 0.20223712921142578, 0.17544445395469666, -0.36357396841049194, -0.35183221101760864, 0.39496517181396484, 0.14463967084884644, 0.043457403779029846, 0.5567745566368103, 0.4279325604438782, -0.38841891288757324, 0.22196316719055176, 0.18644073605537415, 0.9863179922103882, 0.09588465839624405, 0.0015276080230250955, 0.17266976833343506, -0.057639144361019135, -0.09914403408765793, 0.1092454269528389, 0.14583078026771545, -0.22724896669387817, -0.29175737500190735, -0.013427827507257462, -0.3100067377090454, 0.16909651458263397, 0.2443292737007141, -0.012061893939971924, 0.02071809396147728, 0.2121763825416565, 0.4517374038696289, -0.22412723302841187, 0.04982134699821472, -0.12449990212917328, -0.2680744528770447, -0.11601757258176804, -0.15911108255386353, 0.23209330439567566, -0.36104831099510193, 0.02901616320014, -0.18244367837905884, -0.2147294580936432, -0.32934820652008057, -0.4994484782218933, -0.13643400371074677, -0.5348787307739258, 0.06857950985431671, 0.19463986158370972, -0.4040106236934662, 0.32155221700668335, 0.07661983370780945, 0.3459080457687378, 0.2356344759464264, 0.004819955676794052, -0.22595733404159546, 0.1927337497472763, -0.16720816493034363, 0.11445529013872147, -0.15027032792568207, 0.1224244013428688, 0.17400631308555603, -0.07526307553052902, -0.08039706945419312, 0.046798624098300934, 0.024531729519367218, -0.020752891898155212, -0.0478605218231678, -0.012681465595960617, -0.4549141526222229, -0.33891361951828003, -0.15505284070968628, 0.04350094497203827, -0.029398392885923386, -0.0477210097014904, 0.2225561887025833, -0.16850988566875458, 0.3286203444004059, -0.0673474371433258, -0.32309144735336304, -0.09112933278083801, 0.2760288715362549, 0.07749654352664948, -0.020761527121067047, 0.5376552939414978, 0.1659853607416153, -0.21084336936473846, 0.04811558127403259, 0.3023849129676819, 0.49316293001174927, -0.5401716232299805, 0.10277503728866577, -0.5405663251876831, 0.031005680561065674, 0.2079954743385315, 0.1532280594110489, 0.2030433714389801, 0.0512998104095459, -0.259599506855011, -0.2721216678619385, -0.3542606830596924, 0.33108651638031006, -0.025435691699385643, 0.12133610248565674, -0.05215637758374214, -0.23240864276885986, -0.16871479153633118, -0.10395640134811401, -0.09912459552288055, 0.004512697458267212, -0.025261152535676956, 0.17721813917160034, 0.31841546297073364, 0.053041283041238785, 0.4491952061653137, -0.32602831721305847, -0.1284026801586151, 0.38207128643989563, 0.05610842630267143, -0.03555821627378464, -0.1534886360168457, 0.13980011641979218, -0.03800923377275467, -0.2839338481426239, -0.04311588034033775, -0.26095443964004517, -0.2450544536113739, -0.10022196173667908, 0.1035754606127739, 0.005752623081207275, 0.17336203157901764, 0.1946624368429184, -0.19177094101905823, -0.10599347949028015, -0.1404104381799698, 0.15477117896080017, -0.11482272297143936, 0.10709963738918304, 0.02521521970629692, 0.39385437965393066, 0.0943748950958252, -0.14652380347251892, -0.20546570420265198, 0.12022446095943451, 0.13253411650657654, 0.040979593992233276, 0.20544059574604034, -0.45495638251304626, -0.24612568318843842, 0.378761351108551, 0.22615115344524384, 0.3374819755554199, -0.06564037501811981, -0.3771411180496216, 0.2893214225769043, 0.07580982893705368, -0.06117169186472893, -0.07925402373075485, 0.10514402389526367, 0.006489645689725876, -0.14548327028751373, 0.3450620174407959, -0.06857731938362122, -0.11706400662660599, -0.2467876374721527, 0.4006556272506714, 0.3637774586677551, 0.032263725996017456, -0.10417820513248444, 0.668393611907959, 0.008720166981220245, -0.02019714191555977, 0.34934091567993164, 0.3141636550426483, 0.6323840618133545, 0.45519593358039856, 0.3107430934906006, 0.32478711009025574, 0.3254559338092804, -0.06442439556121826, -0.33936649560928345, -0.3316269814968109, -0.10805781185626984, 0.5851892232894897, -0.1264195740222931, 0.15258435904979706, 0.1846264898777008, 0.22900183498859406, 0.13760818541049957, -0.05386248230934143, 0.0239979550242424, -0.10047294199466705, -0.32492491602897644, -0.0008252821862697601, -0.12674497067928314, 0.07199835777282715, 0.1278272271156311, -0.00188339501619339, -0.06050902605056763, 0.2843082547187805, 0.5623045563697815, -0.0755670964717865, 0.16686780750751495, -0.11018440872430801, 0.10663259029388428, 0.19095492362976074, 0.15005448460578918, -0.4733622074127197, 0.3820386826992035, 0.1421852707862854, -0.0726507231593132, -0.009714538231492043, 0.48590630292892456, 0.6045272946357727, 0.25211119651794434, -0.016414087265729904, 0.09029048681259155, 0.11771148443222046, -0.10523618757724762, -0.2572365999221802, 0.4050707519054413, 0.13812217116355896, 0.18350090086460114, 0.09830615669488907, -0.07213810831308365, -0.042150404304265976, 0.1232430636882782, 0.22054055333137512, -0.01684332825243473, -0.1455366313457489, -0.11060841381549835, 0.018277686089277267, -0.4325069785118103, -0.02641405537724495, -0.17767947912216187, -0.16217640042304993, 0.0641082227230072, 0.5207849144935608, 0.10027537494897842, 0.07019908726215363, 0.22746692597866058, -0.026256389915943146, 0.07938447594642639, 0.4737967252731323, 0.9541426301002502, -0.11879567801952362, -0.21855920553207397, -0.16558821499347687, -0.233943372964859, 0.10434110462665558, -0.288221538066864, -0.20194381475448608, 0.3885630667209625, 0.043393321335315704, -0.1201896220445633, -0.006882824469357729, 0.5434208512306213, 0.08727943152189255, -0.5662947297096252, 0.581349790096283, -0.17212624847888947, -0.24465402960777283, 0.19452305138111115, -0.29048600792884827, 0.04110603779554367, -0.48737722635269165, 0.27413612604141235, 0.2377326488494873, -0.16640198230743408, -0.0889655277132988, 0.418114572763443, -0.07083010673522949, -0.16237589716911316, 0.06211607903242111, 0.21884983777999878, 0.1463598757982254, 0.11738140881061554, 0.00030093640089035034, -0.30667340755462646, 0.08463495969772339, -0.284381240606308, 0.5184035897254944, 0.08808626979589462, 0.5106645822525024, -0.48332297801971436, -0.3024459183216095, 0.03466515988111496, 0.13229066133499146, 0.15630176663398743, -0.34048330783843994, -0.3317921757698059, 0.11871063709259033, -0.13719169795513153, -0.0595121905207634, 0.2707277536392212, 0.0632978230714798, 0.11299475282430649, 0.23040656745433807, -0.020057260990142822, -0.36893969774246216, 0.11016669869422913, -0.3970984220504761, -0.5543559193611145, 0.08027414977550507, 0.11979097872972488, 0.46150583028793335, -0.14921215176582336, -0.6354310512542725, 0.04747571051120758, 0.18546932935714722, -0.12109948694705963, -0.2992352247238159, 0.19053897261619568, 0.22102122008800507, -0.030360393226146698, 0.0054340660572052, 0.0705336183309555, 0.08917009830474854, -0.372590571641922, -0.004852160811424255, -0.34724050760269165 ]
https://github.com/huggingface/datasets/issues/5783
@aihao2000 It's unlikely `writer_batch_size` is the problem. You can use the following code to profile the training loop (e.g., on a subset of data) and find slow parts: ```python import cProfile, pstats with cProfile.Profile() as profiler: ... # training loop code stats = pstats.Stats(profiler).sort_stats("cumtime") stats.print_stats() ```
Offset overflow while doing regex on a text column
### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0
46
Offset overflow while doing regex on a text column ### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0 @aihao2000 It's unlikely `writer_batch_size` is the problem. You can use the following code to profile the training loop (e.g., on a subset of data) and find slow parts: ```python import cProfile, pstats with cProfile.Profile() as profiler: ... # training loop code stats = pstats.Stats(profiler).sort_stats("cumtime") stats.print_stats() ```
[ -0.12684278190135956, -0.4592365622520447, 0.03784941881895065, 0.4480961561203003, -0.03673655167222023, -0.06961654126644135, 0.4423154294490814, 0.13392052054405212, -0.35404807329177856, 0.10731114447116852, 0.35320985317230225, 0.20398566126823425, 0.06323806941509247, -0.056840017437934875, -0.1950957030057907, 0.010321724228560925, -0.08034692704677582, -0.09434186667203903, -0.18657976388931274, 0.0381055623292923, -0.1330251544713974, -0.0035931281745433807, -0.47126439213752747, 0.12683942914009094, -0.13229922950267792, -0.1719825267791748, 0.2790965139865875, 0.05828442424535751, -0.0538606271147728, -0.3708813190460205, 0.44785913825035095, -0.3197431266307831, 0.08680562674999237, 0.05188006907701492, -0.00012485290062613785, -0.15108105540275574, 0.3430314064025879, 0.1601569950580597, 0.1611160933971405, 0.16233225166797638, -0.31444406509399414, -0.04322496056556702, -0.18598908185958862, -0.08221569657325745, 0.39747053384780884, -0.0974971130490303, -0.24486757814884186, -0.4371405243873596, 0.24590148031711578, 0.5874462723731995, 0.042904943227767944, 0.005987420678138733, 0.06034877896308899, 0.22809110581874847, 0.13375359773635864, -0.17652831971645355, 0.07421455532312393, -0.1684856414794922, 0.1322815716266632, -0.14337782561779022, -0.06647290289402008, 0.3864287734031677, -0.27951550483703613, -0.2330002784729004, 0.14727988839149475, 0.13973405957221985, 0.16542530059814453, 0.02885301038622856, 0.06583142280578613, 0.15750610828399658, 0.24371817708015442, -0.08623667806386948, -0.16209593415260315, -0.33307409286499023, 0.1410384625196457, -0.049216341227293015, 0.3879993259906769, 0.051482997834682465, 0.07149865478277206, 0.2721157371997833, -0.4875965118408203, 0.17824119329452515, -0.19186009466648102, 0.04395143687725067, 0.07227850705385208, -0.07470589876174927, 0.012464042752981186, 0.08782787621021271, 0.17624300718307495, -0.09890793263912201, 0.16393309831619263, -0.27156543731689453, -0.2197890281677246, 0.2607463002204895, -0.37392210960388184, 0.12227019667625427, -0.08622796833515167, -0.5517336130142212, 0.3291093111038208, 0.2420695275068283, 0.1228431761264801, -0.14942818880081177, -0.0352865606546402, 0.021364063024520874, 0.07070925831794739, 0.29660096764564514, -0.20214861631393433, 0.48581942915916443, -0.15125416219234467, -0.047412365674972534, 0.22200259566307068, 0.05293258652091026, -0.01957608014345169, -0.3864351212978363, 0.15268507599830627, -0.06937126815319061, 0.13375036418437958, -0.016729697585105896, -0.45644745230674744, 0.4175836145877838, -0.5119776129722595, 0.12559087574481964, 0.12059105187654495, -0.24577772617340088, 0.03639005497097969, 0.04821905121207237, 0.07550385594367981, 0.157028466463089, 0.1447136402130127, -0.16213259100914001, -0.11372324079275131, -0.168405681848526, -0.20188984274864197, -0.04849403351545334, -0.10380203276872635, 0.10858729481697083, -0.1482822149991989, 0.2492080181837082, 0.18504366278648376, -0.12679778039455414, -0.14663740992546082, -0.20928266644477844, 0.4986385107040405, -0.015970880165696144, -0.29150018095970154, 0.16613280773162842, -0.03265199437737465, 0.07714530825614929, -0.14821329712867737, 0.19480285048484802, -0.34161582589149475, -0.26295119524002075, -0.15194736421108246, 0.11430718004703522, -0.0007938370108604431, -0.08101408183574677, -0.36493656039237976, 0.14642269909381866, 0.46869054436683655, -0.02187681943178177, 0.23176191747188568, -0.07295616716146469, -0.021098963916301727, -0.0014724098145961761, 0.2022380828857422, 0.25178974866867065, -0.523208737373352, 0.3275303542613983, 0.03405444324016571, 0.4822494089603424, 0.2742031216621399, 0.5308027863502502, -0.1104031652212143, 0.2125331312417984, -0.19674459099769592, 0.1823486089706421, 0.04605274274945259, -0.28054165840148926, -0.42563867568969727, 0.07727459073066711, -0.2533571124076843, 0.021369293332099915, 0.24991917610168457, -0.2377282679080963, 0.024188946932554245, -0.0012642554938793182, 0.02581176906824112, 0.45653828978538513, -0.01109788566827774, 0.0912133976817131, -0.19328424334526062, -0.32667046785354614, -0.19325892627239227, -0.003551892936229706, -0.19876785576343536, -0.2829524576663971, -0.1970093548297882, -0.49681633710861206, -0.014048989862203598, -0.0906093567609787, 0.1466367244720459, 0.5284315347671509, 0.1765744984149933, 0.13379895687103271, 0.15012982487678528, -0.39214304089546204, -0.10008269548416138, -0.12668929994106293, 0.2052232027053833, -0.13657450675964355, -0.10452139377593994, -0.18159551918506622, -0.1102733165025711, 0.1387161910533905, -0.16514955461025238, 0.3326171040534973, -0.025517374277114868, -0.34107038378715515, 0.2251051664352417, -0.013771690428256989, -0.1635213941335678, 0.5169121623039246, -0.0833350121974945, 0.29250568151474, -0.32144060730934143, 0.23510628938674927, -0.08731839805841446, -0.2828122675418854, -0.07507428526878357, 0.2742196321487427, 0.03848857060074806, -0.05848768353462219, -0.17350585758686066, 0.5414888858795166, -0.07459425181150436, -0.20558366179466248, -0.09827736765146255, -0.1812019944190979, -0.021501857787370682, -0.5252529382705688, -0.031716059893369675, 0.05740734189748764, -0.04936441779136658, -0.020240798592567444, -0.2288322150707245, 0.09470140933990479, -0.11316320300102234, 0.3384082615375519, -0.01766055077314377, -0.009451184421777725, 0.04473616182804108, -0.1214432343840599, 0.020112693309783936, -0.12545643746852875, 0.1385086476802826, 0.0014606993645429611, -0.028533846139907837, -0.08078339695930481, -0.2794497013092041, 0.004677027463912964, 0.23834873735904694, 0.09389034658670425, -0.3036409318447113, 0.42670050263404846, -0.29332685470581055, 0.058282770216464996, -0.241941899061203, 0.11804676055908203, 0.3185204565525055, 0.30199745297431946, -0.02845729887485504, -0.004942676983773708, -0.01699957810342312, 0.04122699424624443, 0.3031329810619354, 0.2129024863243103, -0.0794793888926506, 0.15356634557247162, 0.3322674036026001, 0.2527809143066406, -0.1642313301563263, -0.41381675004959106, 0.1091570183634758, 0.17896157503128052, -0.3375867009162903, 0.35324421525001526, -0.13425680994987488, -0.25396591424942017, -0.32532477378845215, -0.29443061351776123, 0.024207089096307755, -0.2570829689502716, -0.17833790183067322, 0.08290094882249832, -0.3142991065979004, 0.22774934768676758, 0.13429486751556396, 0.18069615960121155, 0.5940351486206055, -0.1751338690519333, -0.1839868724346161, -0.026259027421474457, -0.25648364424705505, -0.11273358017206192, 0.4157717227935791, -0.13103675842285156, -0.02806219458580017, 0.20885252952575684, 0.2129039764404297, -0.15827184915542603, -0.29734379053115845, -0.010865084826946259, 0.09995861351490021, -0.12724809348583221, 0.27761027216911316, -0.18400056660175323, -0.4559876322746277, -0.3975694477558136, 0.00432165339589119, 0.21355292201042175, -0.1473536342382431, 0.44329747557640076, 0.23515333235263824, -0.0703812763094902, -0.14404883980751038, -0.1712242066860199, 0.37369194626808167, -0.2519853711128235, 0.06005823612213135, -0.41064155101776123, -0.012504197657108307, 0.4871247708797455, -0.0392051637172699, 0.13378793001174927, -0.24282482266426086, -0.0975523293018341, -0.0791034996509552, 0.1502959132194519, 0.36751487851142883, 0.019281040877103806, -0.14936619997024536, -0.2436182051897049, -0.21041016280651093, -0.08116866648197174, 0.24430511891841888, -0.33615028858184814, -0.02993316948413849, -0.3020065426826477, -0.08510775864124298, -0.5151312351226807, 0.20517155528068542, 0.19644439220428467, 0.11420910060405731, 0.02986946702003479, 0.015858106315135956, 0.018068931996822357, 0.5036000609397888, 0.03282090649008751, -0.12948568165302277, 0.02745022624731064, 0.2219172567129135, 0.12481924891471863, -0.015684425830841064, 0.41028425097465515, -0.07249438762664795, 0.03730632737278938, 0.016598207876086235, -0.06887666881084442, -0.13375042378902435, -0.12599961459636688, -0.3100604712963104, 0.2213110625743866, 0.061304353177547455, -0.0053894370794296265, -0.06373058259487152, 0.05530260503292084, 0.24186092615127563, 0.24225673079490662, -0.04543617367744446, -0.12269898504018784, 0.13618700206279755, -0.25535061955451965, 0.11596870422363281, 0.15108147263526917, -0.15421350300312042, -0.22179369628429413, -0.08114901185035706, -0.090999536216259, -0.12405908852815628, 0.13822343945503235, -0.19916769862174988, -0.21544453501701355, -0.18198269605636597, 0.05124667286872864, 0.39177513122558594, 0.3522967994213104, 0.3137521743774414, 0.10213705897331238, -0.033604905009269714, 0.06521178781986237, 0.12218111753463745, 0.5890101194381714, -0.30869925022125244, -0.23334452509880066, -0.11876891553401947, 0.22034808993339539, -0.5023418664932251, -0.07336702942848206, -0.20440427958965302, -0.23670144379138947, 0.5502899885177612, 0.5107316970825195, -0.20586882531642914, 0.046935319900512695, 0.8423523306846619, 0.048191506415605545, 0.09040339291095734, -0.1332167685031891, -0.03752020746469498, -0.29496729373931885, 0.09534423798322678, 0.2784573435783386, 0.42437413334846497, 0.5680873990058899, 0.3548640012741089, -0.15711775422096252, -0.24710094928741455, -0.034611791372299194, -0.12460768222808838, -0.1466820389032364, 0.5301685333251953, -0.24836112558841705, 0.23625054955482483, 0.013371845707297325, -0.0022145528346300125, 0.2757599353790283, 0.16894182562828064, 0.022947296500205994, -0.24322843551635742, -0.2572399377822876, -0.2675700783729553, 0.577899694442749, 0.16602158546447754, -0.05743280053138733, -0.003378812223672867, 0.19947563111782074, 0.2803384065628052, -0.03973883017897606, 0.061113014817237854, 0.11729364097118378, 0.2650682032108307, -0.17898249626159668, -0.31678253412246704, 0.3217800259590149, 0.15782484412193298, 0.07395203411579132, 0.598972499370575, 0.5067882537841797, -0.4099927544593811, 0.18702711164951324, 0.010176869109272957, 0.8244438171386719, 0.0949440523982048, 0.0029421811923384666, 0.2896652817726135, -0.0865720883011818, -0.005438242107629776, 0.23931705951690674, 0.16593210399150848, -0.20270128548145294, -0.32388970255851746, -0.014404192566871643, -0.3046223521232605, 0.16287317872047424, 0.19724634289741516, -0.0837525725364685, -0.03780758008360863, 0.16750238835811615, 0.38872894644737244, -0.0872989073395729, 0.023434773087501526, -0.034322191029787064, -0.13911764323711395, -0.16271734237670898, -0.09731031954288483, 0.21286340057849884, -0.4721375107765198, 0.033433184027671814, -0.2309599071741104, -0.2455814778804779, -0.3133634328842163, -0.43530017137527466, -0.003637552261352539, -0.26567506790161133, 0.10238124430179596, 0.37476328015327454, -0.3495895564556122, 0.35137316584587097, -0.027074437588453293, 0.3040013611316681, 0.18010246753692627, -0.009156609885394573, -0.17804588377475739, 0.15701881051063538, -0.14749902486801147, 0.1714000701904297, -0.05306731536984444, 0.16213580965995789, 0.16573643684387207, -0.06961869448423386, -0.06178787723183632, 0.09765850007534027, -0.07653853297233582, 0.06255513429641724, 0.033752962946891785, -0.09458911418914795, -0.3966872990131378, -0.06806973367929459, -0.06767770648002625, 0.016961373388767242, -0.08119053393602371, 0.010839281603693962, 0.18347346782684326, -0.34453678131103516, 0.19439107179641724, -0.000771254999563098, -0.24321913719177246, -0.05657240375876427, 0.3397967219352722, -0.06051209941506386, 0.01799646019935608, 0.5830570459365845, 0.24509912729263306, -0.2513338327407837, 0.026165269315242767, 0.184273824095726, 0.5406515598297119, -0.5534403324127197, 0.07566091418266296, -0.5884132981300354, 0.14695218205451965, 0.1928127408027649, 0.07615165412425995, 0.10435602068901062, 0.08961617201566696, -0.2819406986236572, -0.2896254360675812, -0.19505953788757324, 0.17266353964805603, -0.179134801030159, 0.03605955094099045, -0.0396830253303051, -0.11692123115062714, -0.17021149396896362, -0.24380846321582794, -0.16391758620738983, 0.06970656663179398, -0.08737543970346451, 0.1891133338212967, 0.30585479736328125, -0.11025780439376831, 0.32801228761672974, -0.34625282883644104, -0.013635009527206421, 0.4506978988647461, 0.15599486231803894, -0.10834775865077972, -0.10208190232515335, 0.0933377593755722, -0.018481267616152763, -0.38548168540000916, -0.1873491108417511, -0.03883872181177139, -0.2778477668762207, -0.051390260457992554, -0.013078182935714722, -0.04133482649922371, 0.17522233724594116, 0.25604867935180664, -0.2903822660446167, -0.20637525618076324, -0.17085465788841248, 0.07510353624820709, -0.20465096831321716, 0.09148131310939789, -0.05983614921569824, 0.3716767728328705, 0.03520487621426582, -0.07008232921361923, -0.2652084231376648, 0.1329837441444397, 0.14229974150657654, -0.0065677352249622345, 0.3671511709690094, -0.5168240666389465, -0.32008132338523865, 0.5117259621620178, 0.3467307686805725, 0.331453800201416, -0.17849065363407135, -0.4558601975440979, 0.24424533545970917, 0.13533435761928558, -0.10517016798257828, -0.10160946846008301, 0.15068688988685608, 0.0591924823820591, -0.07127692550420761, 0.15492168068885803, -0.11117194592952728, -0.3073127269744873, -0.25173893570899963, 0.3561248183250427, 0.4245983362197876, -0.012606066651642323, -0.09602375328540802, 0.6497863531112671, 0.02362769842147827, -0.06202956661581993, 0.306454598903656, 0.2865988612174988, 0.4231788218021393, 0.5165202617645264, 0.22722524404525757, 0.13003119826316833, 0.36386391520500183, -0.1279504895210266, -0.20103996992111206, -0.14224715530872345, -0.15917038917541504, 0.4869534969329834, -0.06677640974521637, 0.10330699384212494, 0.17236772179603577, 0.24817942082881927, 0.11623068153858185, -0.08187605440616608, 0.06171222776174545, -0.17584417760372162, -0.32720422744750977, 0.21919681131839752, -0.08130557835102081, 0.1664247363805771, 0.06457823514938354, -0.03323136642575264, 0.06212006136775017, 0.33599308133125305, 0.6852847933769226, -0.10370433330535889, 0.1982441395521164, -0.1882791817188263, 0.1865909993648529, 0.26735299825668335, 0.23986412584781647, -0.5028562545776367, 0.1426982432603836, 0.16072838008403778, -0.1165594533085823, 0.0387263260781765, 0.4951387047767639, 0.5081506967544556, 0.24085862934589386, -0.012330109253525734, 0.06423364579677582, -0.07813958823680878, -0.09854249656200409, -0.1607794463634491, 0.39468395709991455, 0.15809211134910583, 0.133309006690979, 0.09324773401021957, -0.03945246338844299, -0.04553496837615967, 0.1241508424282074, 0.20928561687469482, 0.15092067420482635, -0.31057214736938477, -0.11965176463127136, -0.033930808305740356, -0.4403148293495178, 0.007167220115661621, -0.16151279211044312, -0.06834280490875244, 0.0834936872124672, 0.5192445516586304, 0.12574701011180878, 0.08056169748306274, 0.2595261037349701, 0.00012473762035369873, 0.007185060530900955, 0.4277626574039459, 0.9722276329994202, -0.172262042760849, -0.12572918832302094, -0.1969170868396759, -0.19016242027282715, 0.1873820722103119, -0.12353882193565369, -0.17248117923736572, 0.5489686131477356, 0.03619559854269028, -0.12835191190242767, 0.07346969842910767, 0.4518488943576813, 0.010053519159555435, -0.5479467511177063, 0.50322425365448, -0.3353511691093445, -0.22464227676391602, 0.375710129737854, -0.3504689931869507, -0.04578402638435364, -0.35803544521331787, 0.2709764838218689, 0.1948620229959488, -0.07793398946523666, 0.05854653939604759, 0.32540783286094666, -0.16712981462478638, -0.03475189581513405, -0.04592356085777283, 0.30310747027397156, 0.09601134061813354, 0.15917392075061798, 0.10335982590913773, -0.27701491117477417, -0.04423763230443001, -0.2996644377708435, 0.6015170216560364, -0.01767210103571415, 0.320091187953949, -0.3626100718975067, -0.30384212732315063, -0.0317915678024292, 0.1605476588010788, 0.1885417103767395, -0.4122788906097412, -0.4458571970462799, 0.14305126667022705, -0.11391493678092957, 0.02401616796851158, 0.09098765254020691, -0.02406042255461216, 0.2306828796863556, 0.288126677274704, 0.08815038204193115, -0.4426167905330658, 0.16023558378219604, -0.37697234749794006, -0.59333336353302, 0.17324170470237732, 0.15426401793956757, 0.5908811688423157, -0.3107381761074066, -0.526849627494812, -0.06655023247003555, 0.2440580129623413, -0.09086787700653076, -0.34944525361061096, 0.182789146900177, 0.183352530002594, -0.10933586955070496, 0.011985257267951965, -0.057019539177417755, 0.1890162229537964, -0.26526007056236267, 0.10343257337808609, -0.18874099850654602 ]
https://github.com/huggingface/datasets/issues/5783
@mariosasko Is the larger the num_proc of load_dataset within the number of cpu cores, the better? Then the num_proc of data_loader is the number of cpu cores/number of training processes
Offset overflow while doing regex on a text column
### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0
30
Offset overflow while doing regex on a text column ### Describe the bug `ArrowInvalid: offset overflow while concatenating arrays` Same error as [here](https://github.com/huggingface/datasets/issues/615) ### Steps to reproduce the bug Steps to reproduce: (dataset is a few GB big so try in colab maybe) ``` import datasets import re ds = datasets.load_dataset('nishanthc/dnd_map_dataset_v0.1', split = 'train') def get_text_caption(example): regex_pattern = r'\s\d+x\d+|,\sLQ|,\sgrid|\.\w+$' example['text_caption'] = re.sub(regex_pattern, '', example['picture_text']) return example ds = ds.map(get_text_caption) ``` I am trying to apply a regex to remove certain patterns from a text column. Not sure why this error is showing up. ### Expected behavior Dataset should have a new column with processed text ### Environment info Datasets version - 2.11.0 @mariosasko Is the larger the num_proc of load_dataset within the number of cpu cores, the better? Then the num_proc of data_loader is the number of cpu cores/number of training processes
[ -0.006848596036434174, -0.45052462816238403, -0.00009368360042572021, 0.46718233823776245, -0.03373904526233673, -0.10309705138206482, 0.4263171851634979, 0.1237684115767479, -0.23008352518081665, 0.12157027423381805, 0.34287646412849426, 0.296439528465271, 0.08448642492294312, -0.025181159377098083, -0.19601117074489594, 0.04636798053979874, -0.0374019555747509, -0.0905245989561081, -0.1736993044614792, 0.04191850125789642, -0.1573762595653534, 0.03998326510190964, -0.4605255722999573, 0.12599273025989532, -0.1276383399963379, -0.16321973502635956, 0.30829936265945435, 0.1370721012353897, -0.043817177414894104, -0.35578596591949463, 0.45215556025505066, -0.38990622758865356, 0.1018209382891655, 0.03277404606342316, -0.00012601245543919504, -0.13816747069358826, 0.3070174753665924, 0.1516755223274231, 0.22218944132328033, 0.03545146808028221, -0.40362629294395447, 0.008504152297973633, -0.1609627902507782, -0.07363583147525787, 0.4973687529563904, 0.020113792270421982, -0.2952727973461151, -0.4817200303077698, 0.2911759316921234, 0.599625825881958, 0.026105603203177452, -0.015406586229801178, 0.11101922392845154, 0.27686893939971924, 0.07131621241569519, -0.18245725333690643, 0.11237651109695435, -0.17720989882946014, 0.09525527060031891, -0.10385043919086456, -0.009307648986577988, 0.4288936257362366, -0.2773953378200531, -0.22176940739154816, 0.13457156717777252, 0.1487620770931244, 0.11938823759555817, -0.034044958651065826, 0.032909050583839417, 0.1478727161884308, 0.24998939037322998, -0.0919724702835083, -0.20035018026828766, -0.2807248830795288, 0.06805168092250824, -0.03107437863945961, 0.37373030185699463, 0.0711752325296402, 0.11732807755470276, 0.32350844144821167, -0.4232842028141022, 0.1594548225402832, -0.2411157637834549, 0.025485754013061523, 0.053468868136405945, 0.011854786425828934, -0.013759491965174675, 0.1047079786658287, 0.13882769644260406, -0.06023760512471199, 0.07406646758317947, -0.22225521504878998, -0.21587081253528595, 0.2492585927248001, -0.40696731209754944, 0.14861948788166046, -0.132393941283226, -0.5455399751663208, 0.37633681297302246, 0.28533095121383667, 0.13214361667633057, -0.10906976461410522, -0.13942952454090118, 0.06738089770078659, 0.06211037188768387, 0.2845764756202698, -0.1641736924648285, 0.3779590427875519, -0.11956319212913513, -0.046265069395303726, 0.2150830328464508, 0.0189472958445549, -0.017951730638742447, -0.419248104095459, 0.10930922627449036, -0.06019878759980202, 0.2700188159942627, -0.06423142552375793, -0.37689313292503357, 0.4623192846775055, -0.4841267466545105, 0.10304614156484604, 0.04560614749789238, -0.25989431142807007, 0.08854229003190994, 0.09549600630998611, 0.06484536826610565, 0.2307022213935852, 0.13914667069911957, -0.28049054741859436, -0.12201116234064102, -0.1662684679031372, -0.1767859160900116, -0.055878832936286926, -0.10345231741666794, 0.11776325106620789, -0.1266365647315979, 0.2686922252178192, 0.15701551735401154, -0.15473593771457672, -0.17609277367591858, -0.2406223714351654, 0.4774315357208252, -0.004672162234783173, -0.2972784638404846, 0.1443178802728653, 0.025685392320156097, 0.07608624547719955, -0.09474268555641174, 0.2738560438156128, -0.35495027899742126, -0.2964819073677063, -0.20290811359882355, 0.09006129950284958, -0.04356061667203903, -0.07565543055534363, -0.3800435960292816, 0.14195743203163147, 0.480407178401947, -0.016555964946746826, 0.2637086808681488, -0.000898389145731926, -0.05927654355764389, 0.003179077059030533, 0.18265211582183838, 0.2255575954914093, -0.5752760767936707, 0.3363773226737976, 0.04599618539214134, 0.4245372712612152, 0.273769736289978, 0.48633456230163574, -0.09116427600383759, 0.152379110455513, -0.1709347814321518, 0.2171614021062851, 0.03953500837087631, -0.2802060544490814, -0.4832155406475067, 0.07535974681377411, -0.21607662737369537, 0.00794849544763565, 0.28251543641090393, -0.27804192900657654, -0.034611769020557404, 0.04242457449436188, -0.03284057229757309, 0.430014044046402, -0.0008045360445976257, 0.06730687618255615, -0.1790773570537567, -0.36580151319503784, -0.13910657167434692, -0.028168894350528717, -0.16213063895702362, -0.21420764923095703, -0.17420536279678345, -0.5509560704231262, 0.007057682611048222, -0.03567209839820862, 0.1143089085817337, 0.5244913101196289, 0.19723385572433472, 0.17406012117862701, 0.181301087141037, -0.4252277612686157, -0.10904182493686676, -0.10049334168434143, 0.18073518574237823, -0.10995884239673615, -0.13596628606319427, -0.16173982620239258, -0.13358661532402039, 0.19531100988388062, -0.1328870803117752, 0.3107690215110779, -0.02563045546412468, -0.3448498845100403, 0.17749375104904175, -0.05267270281910896, -0.24237951636314392, 0.550990104675293, -0.06795253604650497, 0.34881335496902466, -0.3757484555244446, 0.3171730041503906, -0.10203615576028824, -0.2713330388069153, -0.16878379881381989, 0.2346666008234024, 0.0329730398952961, -0.019758915528655052, -0.19960126280784607, 0.5281664729118347, 0.04254867509007454, -0.15832990407943726, -0.15021534264087677, -0.13888388872146606, 0.01091833971440792, -0.5255520939826965, -0.029604412615299225, 0.0666622668504715, 0.014146242290735245, 0.03625659644603729, -0.16461633145809174, 0.02830466255545616, -0.13779102265834808, 0.39142906665802, -0.04452451318502426, 0.0018828213214874268, 0.06135758012533188, -0.13527163863182068, 0.05026803910732269, -0.14583410322666168, 0.09159862995147705, -0.001617593690752983, -0.027462076395750046, -0.09317883104085922, -0.27283385396003723, -0.008613646030426025, 0.15426450967788696, 0.16026708483695984, -0.2797897160053253, 0.3681959807872772, -0.32315558195114136, 0.002816624939441681, -0.15940462052822113, 0.08857466280460358, 0.30748939514160156, 0.28602322936058044, -0.07018573582172394, 0.04787030071020126, 0.023235395550727844, 0.04980270564556122, 0.2744966149330139, 0.2703247666358948, -0.01347554475069046, 0.15913453698158264, 0.31157225370407104, 0.26801544427871704, -0.12412242591381073, -0.436714768409729, 0.10373209416866302, 0.11921869218349457, -0.38380250334739685, 0.3476596772670746, -0.2104640007019043, -0.22753767669200897, -0.3095751702785492, -0.3495826721191406, -0.020202675834298134, -0.3080857992172241, -0.21049460768699646, 0.08746743947267532, -0.32458680868148804, 0.20867478847503662, 0.12859095633029938, 0.1586754024028778, 0.5549124479293823, -0.12406685203313828, -0.2201392948627472, -0.05893181264400482, -0.19531619548797607, -0.12884093821048737, 0.34823930263519287, -0.11587835848331451, -0.10689830034971237, 0.24440276622772217, 0.22386451065540314, -0.1550656110048294, -0.3657110631465912, 0.02118244767189026, 0.14540454745292664, -0.13087499141693115, 0.29131630063056946, -0.19481921195983887, -0.39931774139404297, -0.4042968153953552, -0.011837542057037354, 0.24797284603118896, -0.14072108268737793, 0.4386747181415558, 0.2413983941078186, -0.021323826164007187, -0.1258772611618042, -0.2131444811820984, 0.3065963089466095, -0.26731061935424805, 0.0662887692451477, -0.3805631399154663, 0.015836933627724648, 0.4702128767967224, -0.05508453771471977, 0.08538230508565903, -0.142520010471344, -0.0733000859618187, -0.150602325797081, 0.151199072599411, 0.3312962055206299, -0.031589895486831665, -0.14046485722064972, -0.18569719791412354, -0.21125848591327667, -0.035047128796577454, 0.24560607969760895, -0.32942429184913635, -0.06365343928337097, -0.30762407183647156, -0.12835754454135895, -0.49444666504859924, 0.20835530757904053, 0.19197630882263184, 0.11832306534051895, 0.05703786015510559, -0.0358961746096611, -0.026442840695381165, 0.532899022102356, 0.08078630268573761, -0.12773147225379944, 0.13411249220371246, 0.27366897463798523, 0.14026212692260742, -0.058165255934000015, 0.3214097023010254, -0.06505532562732697, 0.12209713459014893, -0.01257999986410141, -0.07876913249492645, -0.10957741737365723, -0.07228394597768784, -0.3260973393917084, 0.22218018770217896, 0.057690173387527466, -0.03684874624013901, -0.03129560127854347, 0.12709693610668182, 0.2247869372367859, 0.20984727144241333, -0.09780176728963852, -0.10688195377588272, 0.08215297758579254, -0.20442679524421692, 0.07278501987457275, 0.16370144486427307, -0.17574816942214966, -0.19008071720600128, -0.00682603195309639, -0.06220230087637901, -0.09442026913166046, 0.13693976402282715, -0.20934519171714783, -0.20051121711730957, -0.1341341882944107, 0.07466132193803787, 0.4221377968788147, 0.33739107847213745, 0.33371347188949585, 0.120697520673275, -0.07585862278938293, 0.026907844468951225, 0.1584893763065338, 0.6302163004875183, -0.36031532287597656, -0.2016931176185608, -0.1314600557088852, 0.1460111141204834, -0.5009605884552002, -0.07027220726013184, -0.2043323516845703, -0.20372764766216278, 0.5007891058921814, 0.4652029573917389, -0.15323826670646667, 0.11311240494251251, 0.7707813382148743, 0.03299741819500923, 0.08757634460926056, -0.1484280377626419, -0.06942085921764374, -0.22792309522628784, -0.0026805996894836426, 0.2369438111782074, 0.37503308057785034, 0.5668703317642212, 0.3795452117919922, -0.1568891406059265, -0.2778733968734741, -0.07993946969509125, -0.15110135078430176, -0.17707717418670654, 0.5312769412994385, -0.2844671308994293, 0.1783643215894699, -0.02470122091472149, 0.0007250336930155754, 0.24825498461723328, 0.21809621155261993, -0.010101734660565853, -0.3593205511569977, -0.2853608727455139, -0.2658798098564148, 0.5753233432769775, 0.1054682582616806, -0.04403851553797722, -0.03746110945940018, 0.2585151493549347, 0.1888950765132904, -0.07347631454467773, 0.08993689715862274, 0.06491833180189133, 0.2656223177909851, -0.17731507122516632, -0.29318034648895264, 0.3424767255783081, 0.1508457362651825, -0.0016083121299743652, 0.6525835394859314, 0.581348180770874, -0.44223901629447937, 0.19300615787506104, 0.04382806271314621, 0.8609873056411743, 0.14526207745075226, -0.08273570239543915, 0.27419227361679077, -0.15006737411022186, 0.04024949297308922, 0.17069685459136963, 0.13923057913780212, -0.2421269565820694, -0.3381326496601105, -0.05128244310617447, -0.29973241686820984, 0.16514605283737183, 0.2418060153722763, -0.07878232002258301, -0.005243666470050812, 0.12234559655189514, 0.3878597021102905, -0.053117938339710236, -0.022756822407245636, -0.034316208213567734, -0.13554418087005615, -0.18522173166275024, -0.10203956067562103, 0.21929684281349182, -0.43923258781433105, -0.02726907655596733, -0.1767938733100891, -0.23127979040145874, -0.3389926552772522, -0.42443567514419556, 0.016903743147850037, -0.2736817002296448, 0.14376512169837952, 0.3626624643802643, -0.32233723998069763, 0.3665485680103302, 0.07411129772663116, 0.34977999329566956, 0.11281387507915497, -0.022674020379781723, -0.18198320269584656, 0.1770859658718109, -0.1761179268360138, 0.141294926404953, 0.044489290565252304, 0.12079761177301407, 0.14313441514968872, -0.13070803880691528, -0.1100156158208847, 0.07699958980083466, -0.11468429863452911, 0.0537114292383194, 0.05318177118897438, -0.08824074268341064, -0.394196480512619, -0.07936769723892212, -0.06719053536653519, 0.038759149610996246, -0.062215592712163925, -0.0030070580542087555, 0.19358739256858826, -0.335160493850708, 0.14101730287075043, 0.019975537434220314, -0.2720559239387512, -0.041699476540088654, 0.3698005974292755, -0.0604710727930069, 0.03763403743505478, 0.5398781299591064, 0.2582165002822876, -0.24281200766563416, 0.01937534660100937, 0.09209620952606201, 0.5431087017059326, -0.5313288569450378, 0.083014115691185, -0.6197080612182617, 0.10859343409538269, 0.1483607292175293, 0.0882163941860199, 0.12024222314357758, 0.17521435022354126, -0.260175496339798, -0.36677786707878113, -0.17107629776000977, 0.2639085650444031, -0.2610752284526825, -0.0001797834411263466, 0.0060252174735069275, -0.22017423808574677, -0.18121910095214844, -0.24592052400112152, -0.1486145555973053, 0.10739906877279282, -0.017129600048065186, 0.1709212362766266, 0.27953529357910156, -0.08267258107662201, 0.31362754106521606, -0.3574846684932709, -0.026603691279888153, 0.4763292074203491, 0.1535351276397705, -0.08357036858797073, -0.14652979373931885, 0.1054949164390564, 0.024270400404930115, -0.3846333622932434, -0.18257397413253784, -0.014664292335510254, -0.26822197437286377, -0.015229623764753342, 0.002615004777908325, -0.022565603256225586, 0.17013248801231384, 0.3182922601699829, -0.2454623281955719, -0.1559707522392273, -0.2748044729232788, 0.0791579931974411, -0.19677135348320007, 0.1506747007369995, -0.014064125716686249, 0.3569226861000061, 0.030838031321763992, -0.06274012476205826, -0.2773834764957428, 0.09469471871852875, 0.17765173316001892, -0.042503684759140015, 0.35470694303512573, -0.5090248584747314, -0.24901916086673737, 0.4955495595932007, 0.37321388721466064, 0.2943382263183594, -0.2065596878528595, -0.3980516195297241, 0.22473588585853577, 0.1416330337524414, -0.08933448046445847, -0.09125295281410217, 0.13382379710674286, 0.04966063052415848, -0.08470185846090317, 0.22283995151519775, 0.0041871145367622375, -0.26288366317749023, -0.22792688012123108, 0.33977219462394714, 0.4719741642475128, -0.008554738014936447, -0.03378172963857651, 0.6208003163337708, -0.08981200307607651, -0.01287330873310566, 0.25222042202949524, 0.32203298807144165, 0.4534603953361511, 0.4383113980293274, 0.16835348308086395, 0.09216666966676712, 0.4388274550437927, -0.13919684290885925, -0.11092682182788849, -0.1810663938522339, -0.18198439478874207, 0.5143224000930786, -0.09056656062602997, 0.047626301646232605, 0.1979757696390152, 0.2191675305366516, 0.1791190505027771, -0.06253983080387115, 0.07754100114107132, -0.19400939345359802, -0.27951204776763916, 0.22271743416786194, -0.06204596161842346, 0.14769208431243896, 0.0437280535697937, -0.06112002581357956, 0.05950674042105675, 0.2733563482761383, 0.725273847579956, -0.11229211091995239, 0.1420166790485382, -0.2523379921913147, 0.19778816401958466, 0.30436310172080994, 0.18316194415092468, -0.48593783378601074, 0.1541740447282791, 0.2341419756412506, -0.12828172743320465, 0.1433207392692566, 0.3963128924369812, 0.4673627018928528, 0.23451995849609375, -0.033125098794698715, 0.04879511147737503, -0.04386184364557266, -0.07517872750759125, -0.137911856174469, 0.3497540354728699, 0.1595260053873062, 0.21430808305740356, 0.10626744478940964, -0.04429939389228821, -0.0324791744351387, 0.07131980359554291, 0.2661284804344177, 0.25420427322387695, -0.29144781827926636, -0.06523682922124863, -0.02639310248196125, -0.4158037602901459, 0.043605461716651917, -0.1771613508462906, -0.09809529036283493, 0.03748157247900963, 0.4629765450954437, 0.13045287132263184, 0.0823616310954094, 0.3430304527282715, -0.002750355750322342, 0.06559081375598907, 0.38326746225357056, 0.9476656317710876, -0.15948650240898132, -0.06569697707891464, -0.20292626321315765, -0.19914542138576508, 0.19091607630252838, -0.006912496872246265, -0.24633245170116425, 0.5459322929382324, -0.002942606806755066, -0.1236993744969368, 0.07299214601516724, 0.38626977801322937, -0.06805115938186646, -0.5117121934890747, 0.4796724319458008, -0.33790701627731323, -0.19564524292945862, 0.40879586338996887, -0.34021174907684326, -0.030160538852214813, -0.3380553126335144, 0.2463373839855194, 0.26799798011779785, -0.10029670596122742, 0.04533999040722847, 0.3287484645843506, -0.24244624376296997, -0.11588515341281891, 0.04464314132928848, 0.3146948218345642, 0.10705005377531052, 0.14512787759304047, 0.11304470151662827, -0.27013614773750305, -0.07912818342447281, -0.33324700593948364, 0.6297423243522644, -0.07142554223537445, 0.32063305377960205, -0.3141957223415375, -0.28179046511650085, -0.012893039733171463, 0.17298148572444916, 0.16683277487754822, -0.3886110782623291, -0.5452560186386108, 0.13493382930755615, -0.08029674738645554, -0.011315174400806427, 0.0799727514386177, -0.024667587131261826, 0.2265111356973648, 0.32591310143470764, 0.11046603322029114, -0.43129369616508484, 0.15381385385990143, -0.37792688608169556, -0.6026127934455872, 0.11973579972982407, 0.17166760563850403, 0.5945480465888977, -0.3570522367954254, -0.5657188892364502, -0.08937086910009384, 0.2532055377960205, -0.10991328954696655, -0.3599144220352173, 0.15226426720619202, 0.23030869662761688, -0.12819570302963257, -0.0029399171471595764, -0.09961700439453125, 0.22597822546958923, -0.2273869812488556, 0.09606204926967621, -0.22569480538368225 ]
https://github.com/huggingface/datasets/issues/5782
Hi! You can use `set_transform`/`with_transform` to define a custom decoding for audio formats not supported by `soundfile`: ```python audio_dataset_amr = Dataset.from_dict({"audio": ["audio_samples/audio.amr"]}) def decode_audio(batch): batch["audio"] = [read_ffmpeg(audio_path) for audio_path in batch["audio"]] return batch audio_dataset_amr.set_transform(decode_amr) ``` Supporting multiple backends is more work to maintain, but we could consider this if we get more requests such as this one.
Support for various audio-loading backends instead of always relying on SoundFile
### Feature request Introduce an option to select from a variety of audio-loading backends rather than solely relying on the SoundFile library. For instance, if the ffmpeg library is installed, it can serve as a fallback loading option. ### Motivation - The SoundFile library, used in [features/audio.py](https://github.com/huggingface/datasets/blob/649d5a3315f9e7666713b6affe318ee00c7163a0/src/datasets/features/audio.py#L185), supports only a [limited number of audio formats](https://pysoundfile.readthedocs.io/en/latest/index.html?highlight=supported#soundfile.available_formats). - However, current methods for creating audio datasets permit the inclusion of audio files in formats not supported by SoundFile. - As a result, developers may potentially create a dataset they cannot read back. In my most recent project, I dealt with phone call recordings in `.amr` or `.gsm` formats and was genuinely surprised when I couldn't read the dataset I had just packaged a minute prior. Nonetheless, I can still accurately read these files using the librosa library, which employs the audioread library that internally leverages ffmpeg to read such files. Example: ```python audio_dataset_amr = Dataset.from_dict({"audio": ["audio_samples/audio.amr"]}).cast_column("audio", Audio()) audio_dataset_amr.save_to_disk("audio_dataset_amr") audio_dataset_amr = Dataset.load_from_disk("audio_dataset_amr") print(audio_dataset_amr[0]) ``` Results in: ``` Traceback (most recent call last): ... raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f316323e4d0>: Format not recognised. ``` While I acknowledge that support for these rare file types may not be a priority, I believe it's quite unfortunate that it's possible to create an unreadable dataset in this manner. ### Your contribution I've created a [simple demo repository](https://github.com/BoringDonut/hf-datasets-ffmpeg-audio) that highlights the mentioned issue. It demonstrates how to create an .amr dataset that results in an error when attempting to read it just a few lines later. Additionally, I've made a [fork with a rudimentary solution](https://github.com/BoringDonut/datasets/blob/fea73a8fbbc8876467c7e6422c9360546c6372d8/src/datasets/features/audio.py#L189) that utilizes ffmpeg to load files not supported by SoundFile. Here you may see github actions fails to read `.amr` dataset using the version of the current dataset, but will work with the patched version: - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063785 - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063829 As evident from the GitHub action above, this solution resolves the previously mentioned problem. I'd be happy to create a proper pull request, provide runtime benchmarks and tests if you could offer some guidance on the following: - Where should I incorporate the ffmpeg (or other backends) code? For example, should I create a new file or simply add a function within the Audio class? - Is it feasible to pass the audio-loading function as an argument within the current architecture? This would be useful if I know in advance that I'll be reading files not supported by SoundFile. A few more notes: - In theory, it's possible to load audio using librosa/audioread since librosa is already expected to be installed. However, librosa [will soon discontinue audioread support](https://github.com/librosa/librosa/blob/aacb4c134002903ae56bbd4b4a330519a5abacc0/librosa/core/audio.py#L227). Moreover, using audioread on its own seems inconvenient because it requires a file [path as input](https://github.com/beetbox/audioread/blob/ff9535df934c48038af7be9617fdebb12078cc07/audioread/__init__.py#L108) and cannot work with bytes already loaded into memory or an open file descriptor (as mentioned in [librosa docs](https://librosa.org/doc/main/generated/librosa.load.html#librosa.load), only SoundFile backend supports an open file descriptor as an input).
57
Support for various audio-loading backends instead of always relying on SoundFile ### Feature request Introduce an option to select from a variety of audio-loading backends rather than solely relying on the SoundFile library. For instance, if the ffmpeg library is installed, it can serve as a fallback loading option. ### Motivation - The SoundFile library, used in [features/audio.py](https://github.com/huggingface/datasets/blob/649d5a3315f9e7666713b6affe318ee00c7163a0/src/datasets/features/audio.py#L185), supports only a [limited number of audio formats](https://pysoundfile.readthedocs.io/en/latest/index.html?highlight=supported#soundfile.available_formats). - However, current methods for creating audio datasets permit the inclusion of audio files in formats not supported by SoundFile. - As a result, developers may potentially create a dataset they cannot read back. In my most recent project, I dealt with phone call recordings in `.amr` or `.gsm` formats and was genuinely surprised when I couldn't read the dataset I had just packaged a minute prior. Nonetheless, I can still accurately read these files using the librosa library, which employs the audioread library that internally leverages ffmpeg to read such files. Example: ```python audio_dataset_amr = Dataset.from_dict({"audio": ["audio_samples/audio.amr"]}).cast_column("audio", Audio()) audio_dataset_amr.save_to_disk("audio_dataset_amr") audio_dataset_amr = Dataset.load_from_disk("audio_dataset_amr") print(audio_dataset_amr[0]) ``` Results in: ``` Traceback (most recent call last): ... raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f316323e4d0>: Format not recognised. ``` While I acknowledge that support for these rare file types may not be a priority, I believe it's quite unfortunate that it's possible to create an unreadable dataset in this manner. ### Your contribution I've created a [simple demo repository](https://github.com/BoringDonut/hf-datasets-ffmpeg-audio) that highlights the mentioned issue. It demonstrates how to create an .amr dataset that results in an error when attempting to read it just a few lines later. Additionally, I've made a [fork with a rudimentary solution](https://github.com/BoringDonut/datasets/blob/fea73a8fbbc8876467c7e6422c9360546c6372d8/src/datasets/features/audio.py#L189) that utilizes ffmpeg to load files not supported by SoundFile. Here you may see github actions fails to read `.amr` dataset using the version of the current dataset, but will work with the patched version: - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063785 - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063829 As evident from the GitHub action above, this solution resolves the previously mentioned problem. I'd be happy to create a proper pull request, provide runtime benchmarks and tests if you could offer some guidance on the following: - Where should I incorporate the ffmpeg (or other backends) code? For example, should I create a new file or simply add a function within the Audio class? - Is it feasible to pass the audio-loading function as an argument within the current architecture? This would be useful if I know in advance that I'll be reading files not supported by SoundFile. A few more notes: - In theory, it's possible to load audio using librosa/audioread since librosa is already expected to be installed. However, librosa [will soon discontinue audioread support](https://github.com/librosa/librosa/blob/aacb4c134002903ae56bbd4b4a330519a5abacc0/librosa/core/audio.py#L227). Moreover, using audioread on its own seems inconvenient because it requires a file [path as input](https://github.com/beetbox/audioread/blob/ff9535df934c48038af7be9617fdebb12078cc07/audioread/__init__.py#L108) and cannot work with bytes already loaded into memory or an open file descriptor (as mentioned in [librosa docs](https://librosa.org/doc/main/generated/librosa.load.html#librosa.load), only SoundFile backend supports an open file descriptor as an input). Hi! You can use `set_transform`/`with_transform` to define a custom decoding for audio formats not supported by `soundfile`: ```python audio_dataset_amr = Dataset.from_dict({"audio": ["audio_samples/audio.amr"]}) def decode_audio(batch): batch["audio"] = [read_ffmpeg(audio_path) for audio_path in batch["audio"]] return batch audio_dataset_amr.set_transform(decode_amr) ``` Supporting multiple backends is more work to maintain, but we could consider this if we get more requests such as this one.
[ -0.37373217940330505, 0.07107827067375183, -0.10752930492162704, -0.12114189565181732, 0.10390601307153702, -0.258517324924469, 0.5349103212356567, 0.24692317843437195, 0.048604682087898254, 0.3966282606124878, -0.5119902491569519, 0.14266866445541382, -0.3062678575515747, 0.19196441769599915, 0.07823756337165833, -0.029134485870599747, -0.025281447917222977, 0.22665539383888245, 0.21392078697681427, 0.13320598006248474, -0.3393711745738983, 0.03982406109571457, 0.024521932005882263, 0.026634804904460907, -0.1447460949420929, 0.183294415473938, 0.23763251304626465, 0.08505292981863022, -0.3136221766471863, -0.3783979117870331, 0.13611501455307007, 0.09761454910039902, -0.032746851444244385, 0.145369291305542, -0.00010244411532767117, -0.008208416402339935, 0.25801020860671997, -0.23342657089233398, -0.34060558676719666, -0.22340503334999084, -0.15143026411533356, 0.22908729314804077, -0.022017551586031914, -0.10033554583787918, 0.03150451183319092, -0.280782550573349, -0.03956074267625809, -0.3748689889907837, 0.14733222126960754, 0.08940989524126053, 0.24680139124393463, 0.15214675664901733, -0.14385530352592468, 0.11099791526794434, 0.33529695868492126, 0.21665360033512115, -0.042907215654850006, 0.10920868068933487, 0.5367932915687561, -0.01825888827443123, 0.08424867689609528, 0.15710733830928802, -0.4683555066585541, -0.14568835496902466, 0.102998748421669, -0.038428060710430145, 0.09850060939788818, -0.3344913423061371, -0.1015959084033966, 0.4541647732257843, 0.5669826865196228, -0.1609908938407898, -0.589493989944458, -0.4151868224143982, 0.02309577912092209, -0.30232101678848267, -0.14805150032043457, 0.08130063861608505, -0.27516674995422363, 0.305286169052124, 0.020693369209766388, -0.003965873271226883, 0.12717735767364502, 0.29210224747657776, 0.19725024700164795, 0.05550619959831238, -0.12540869414806366, -0.07730843126773834, 0.5447858572006226, -0.04171166941523552, -0.3647790253162384, -0.16176067292690277, 0.22036191821098328, 0.08110123872756958, -0.1350509524345398, -0.11599339544773102, 0.04278950393199921, -0.30758148431777954, 0.08176392316818237, 0.18463420867919922, -0.02289704605937004, 0.4547335207462311, -0.49264389276504517, 0.1384037435054779, -0.004932353273034096, -0.2517364025115967, -0.08313006162643433, -0.28944069147109985, 0.45484459400177, 0.05219264328479767, 0.46197211742401123, 0.05236031860113144, -0.1263556033372879, 0.09084907174110413, -0.37419337034225464, -0.05135791376233101, 0.024720728397369385, -0.2327144742012024, -0.22187578678131104, -0.28385859727859497, 0.02625272423028946, -0.09774293750524521, 0.11110211908817291, 0.24589847028255463, 0.01814337819814682, 0.24355529248714447, 0.2691630721092224, 0.2877027690410614, 0.01720530539751053, -0.03170496225357056, 0.15592852234840393, -0.023153414949774742, -0.01265043020248413, -0.0034658238291740417, 0.3555082082748413, -0.28282615542411804, 0.25693172216415405, 0.1753949522972107, 0.15179282426834106, -0.029328130185604095, 0.030732929706573486, 0.028963733464479446, -0.13220243155956268, 0.15992151200771332, -0.251636266708374, 0.054144859313964844, -0.10079900920391083, 0.17617247998714447, -0.28688016533851624, 0.10493224859237671, -0.18756116926670074, -0.34022414684295654, -0.142360657453537, 0.2829554080963135, 0.006479822099208832, 0.03994111344218254, -0.2685057520866394, 0.11186656355857849, -0.36025434732437134, -0.5429403185844421, 0.05231763795018196, -0.03274491801857948, -0.3034220039844513, -0.07751565426588058, 0.32841676473617554, 0.14738665521144867, -0.49760156869888306, -0.24711428582668304, -0.09229973703622818, -0.3909418284893036, 0.050714123994112015, 0.04967474564909935, -0.1950124204158783, -0.23611262440681458, -0.2579234838485718, 0.07316040992736816, 0.5304458141326904, -0.49420350790023804, -0.29956668615341187, -0.08856333792209625, -0.0008943453431129456, 0.30998900532722473, 0.3071233630180359, 0.31474626064300537, 0.18012948334217072, -0.25217241048812866, 0.1532025784254074, 0.5456121563911438, -0.0064181555062532425, -0.03220902755856514, 0.018336929380893707, -0.29190248250961304, 0.0017643654718995094, 0.407922625541687, -0.09333768486976624, 0.04907861724495888, 0.03847697749733925, -0.04080217331647873, 0.2453516125679016, -0.1551453024148941, -0.031222451478242874, -0.25762268900871277, 0.38573408126831055, 0.006170868873596191, -0.10425210744142532, -0.4894324839115143, 0.08837567269802094, 0.0373803973197937, 0.03218778222799301, 0.17393717169761658, -0.03415832296013832, -0.08977615833282471, 0.1253328025341034, -0.18233627080917358, -0.27752333879470825, 0.16005893051624298, 0.13385526835918427, 0.303921103477478, -0.1457100361585617, -0.0346524603664875, -0.4048847556114197, 0.07677052170038223, -0.07251148670911789, -0.04585416615009308, -0.24266768991947174, -0.024834219366312027, 0.11733982712030411, 0.08272360265254974, 0.05062566697597504, 0.2688468396663666, -0.08508467674255371, -0.009443920105695724, -0.08112233877182007, 0.3723986744880676, 0.33030521869659424, 0.319047212600708, -0.4606330394744873, 0.6412432789802551, 0.1978289783000946, 0.1280006319284439, 0.2395658642053604, 0.14315834641456604, 0.18503600358963013, -0.1960790604352951, -0.042889565229415894, 0.3327425420284271, 0.29778602719306946, 0.34452787041664124, 0.2781406044960022, -0.15278738737106323, 0.16492798924446106, 0.24313068389892578, -0.36634179949760437, -0.13136349618434906, -0.014365321025252342, -0.2884335517883301, 0.4618465304374695, 0.053136371076107025, -0.29202374815940857, -0.07613334059715271, 0.4358081817626953, -0.18759307265281677, 0.12100235372781754, 0.14739763736724854, -0.15108522772789001, -0.24419544637203217, 0.0727829784154892, 0.2663906514644623, 0.26882970333099365, 0.2846900522708893, -0.027606859803199768, -0.28517812490463257, 0.10765880346298218, -0.23039937019348145, 0.09972876310348511, 0.16291013360023499, -0.0058217719197273254, 0.2699616253376007, 0.24219202995300293, 0.09394389390945435, -0.04649347439408302, -0.15050476789474487, -0.17447419464588165, -0.31730011105537415, -0.06261828541755676, -0.027579084038734436, -0.4050491452217102, -0.0806613340973854, -0.039405085146427155, -0.5509622097015381, -0.04922286421060562, -0.05075007304549217, 0.32788094878196716, 0.3494582772254944, -0.23120638728141785, 0.08159954100847244, -0.21858707070350647, 0.3290373980998993, -0.2379181832075119, -0.4472079277038574, 0.12403380870819092, 0.2928239107131958, 0.06605452299118042, 0.16476836800575256, 0.3992394804954529, 0.06835397332906723, 0.3210461735725403, 0.06252998858690262, -0.2447698712348938, -0.06624658405780792, 0.05841388553380966, 0.2723044753074646, 0.14907531440258026, 0.15647374093532562, 0.11557438969612122, -0.12816114723682404, 0.335396409034729, -0.5243095755577087, 0.17164306342601776, 0.13947242498397827, -0.0745546892285347, 0.1567038893699646, 0.06484787166118622, 0.29308897256851196, -0.15621842443943024, -0.17508581280708313, -0.47505608201026917, -0.5595319271087646, 0.11964346468448639, -0.20245361328125, 0.13619983196258545, 0.25500357151031494, -0.026934832334518433, 0.09404053539037704, -0.0785941481590271, 0.4681116044521332, -0.1121181845664978, -0.07253266870975494, 0.14000868797302246, -0.06921830028295517, -0.018901029601693153, -0.1598920375108719, 0.032218724489212036, 0.013739213347434998, 0.16585920751094818, -0.15351028740406036, -0.3179636299610138, 0.2124878615140915, -0.009919784963130951, 0.07392211258411407, -0.056015945971012115, 0.2445736527442932, 0.27788904309272766, -0.04544768109917641, -0.06455102562904358, -0.09491069614887238, -0.2584036588668823, -0.23531204462051392, 0.02171418070793152, 0.14691096544265747, 0.20182453095912933, -0.3833940625190735, 0.7172499895095825, -0.12654924392700195, -0.0717623233795166, 0.2303447723388672, 0.12127655744552612, 0.10976266860961914, -0.5182846188545227, -0.21327552199363708, -0.022061027586460114, -0.07892046868801117, 0.010303162038326263, 0.18063083291053772, 0.01634891703724861, -0.239252969622612, -0.22186796367168427, 0.19866901636123657, -0.15373684465885162, -0.030825112015008926, 0.1147618219256401, 0.1712418794631958, 0.15089163184165955, -0.10253911465406418, 0.11386290192604065, 0.13130593299865723, 0.028276659548282623, 0.10524645447731018, 0.24939334392547607, 0.46017807722091675, -0.16088251769542694, -0.4426608085632324, 0.018417030572891235, -0.05146380141377449, 0.18069812655448914, 0.253938227891922, 0.3232490122318268, -0.15214258432388306, -0.2464178502559662, -0.12303199619054794, 0.028893623501062393, 0.20034196972846985, 0.06494220346212387, -0.1612766683101654, 0.20641382038593292, -0.026954397559165955, 0.07489641010761261, 0.06003975123167038, -0.12976521253585815, -0.2495301067829132, -0.0855141207575798, 0.3030969798564911, -0.06510330736637115, -0.24242129921913147, -0.14030908048152924, 0.5908176898956299, 0.1341097056865692, -0.11348560452461243, -0.058492884039878845, 0.008124083280563354, -0.41674384474754333, -0.2900325059890747, -0.16756102442741394, 0.16584883630275726, -0.07249408215284348, -0.14774683117866516, 0.3516796827316284, 0.0761847048997879, 0.30887240171432495, 0.0180644690990448, 0.10468167066574097, -0.12821632623672485, 0.19061526656150818, -0.22067010402679443, -0.01217520609498024, 0.3033471405506134, 0.31872081756591797, -0.07266692072153091, -0.2079634666442871, 0.3308088481426239, 0.11787740886211395, 0.20754089951515198, 0.1798027753829956, 0.11405904591083527, 0.3514809012413025, -0.15245550870895386, -0.030620891600847244, -0.35836830735206604, 0.0003648102283477783, 0.4051758646965027, -0.09819822758436203, -0.2362501323223114, -0.4718203544616699, 0.6320884823799133, -0.1871257871389389, -0.12159641087055206, 0.22546561062335968, 0.2225521355867386, 0.025465402752161026, 0.36800509691238403, -0.18893852829933167, 0.8479914665222168, 0.1531887799501419, 0.1129971593618393, 0.32370397448539734, -0.09528949856758118, 0.04456320032477379, -0.43043053150177, 0.1435365229845047, 0.08729812502861023, 0.10162840783596039, -0.11531081795692444, 0.028163745999336243, -0.23167037963867188, 0.17263631522655487, -0.07837957888841629, 0.20035403966903687, 0.041882678866386414, -0.2818171977996826, -0.0026099421083927155, 0.3529410660266876, -0.13772472739219666, -0.4243376851081848, -0.4968208372592926, 0.20689132809638977, 0.27761635184288025, -0.057604577392339706, 0.0688723474740982, -0.020837735384702682, 0.40377891063690186, 0.030765868723392487, -0.37788090109825134, 0.0011762455105781555, 0.0036933869123458862, -0.09513355791568756, -0.024663306772708893, -0.07526595890522003, 0.19928507506847382, -0.026115279644727707, -0.26415395736694336, 0.35264238715171814, -0.0075987279415130615, -0.1335458755493164, -0.3216821551322937, 0.4240269660949707, -0.035580988973379135, -0.06056695058941841, 0.4487150013446808, -0.1311262547969818, -0.1939925104379654, 0.17997132241725922, -0.030556228011846542, -0.4164876937866211, 0.08288644254207611, -0.1369912475347519, 0.341189980506897, -0.1200360357761383, -0.4282396137714386, -0.019077517092227936, 0.13934478163719177, -0.13248135149478912, 0.1971796751022339, 0.08887399733066559, -0.1901426464319229, 0.08014395833015442, -0.0885009616613388, -0.030768215656280518, -0.1379401683807373, 0.10553532838821411, -0.32321876287460327, -0.07130197435617447, 0.34133434295654297, -0.03898408263921738, -0.16176198422908783, -0.21222618222236633, -0.145179882645607, -0.03461020439863205, -0.011655621230602264, 0.04797426983714104, 0.2418663501739502, -0.24048438668251038, -0.15372198820114136, 0.021026886999607086, -0.08902956545352936, -0.06999380886554718, -0.3138827085494995, -0.4382939040660858, -0.13275253772735596, 0.33251041173934937, 0.043294765055179596, 0.1761329621076584, -0.06867242604494095, -0.25341886281967163, -0.2586112916469574, -0.09360139071941376, -0.4068955183029175, 0.08514337241649628, 0.10253413766622543, 0.2272382378578186, 0.16961440443992615, 0.053425710648298264, 0.041034210473299026, 0.13947203755378723, 0.23207077383995056, 0.06820312887430191, -0.15994736552238464, -0.19076314568519592, -0.05598435923457146, 0.18338985741138458, 0.08555954694747925, -0.16864228248596191, 0.19421476125717163, -0.121010422706604, -0.35861411690711975, -0.30758222937583923, 0.14051872491836548, 0.29947590827941895, -0.06859583407640457, -0.141009122133255, -0.04026362672448158, -0.030222438275814056, 0.19201155006885529, 0.2448239028453827, -0.008766558021306992, -0.17974457144737244, 0.1724342256784439, 0.03490445017814636, -0.12505730986595154, -0.18671230971813202, -0.12882375717163086, 0.3906566798686981, 0.2726672887802124, -0.03933027759194374, 0.3550669550895691, 0.14444947242736816, 0.0860113576054573, 0.31501635909080505, 0.3228002190589905, 0.4036329984664917, -0.009344391524791718, 0.20220842957496643, 0.38235971331596375, 0.3386188745498657, -0.1696397215127945, -0.3617249131202698, -0.13153772056102753, -0.08747737109661102, 0.22157776355743408, 0.23183965682983398, 0.1971352994441986, -0.007928445935249329, 0.8123262524604797, -0.13017907738685608, -0.025814073160290718, -0.11609601974487305, 0.1255972534418106, 0.3058718740940094, -0.10493089258670807, 0.0392518974840641, 0.09646697342395782, -0.11011645197868347, 0.2329615354537964, -0.06420056521892548, -0.6781708598136902, 0.19645431637763977, 0.07631854712963104, -0.2682296633720398, 0.20174075663089752, -0.3309650421142578, -0.16351985931396484, 0.1203702986240387, -0.12927405536174774, 0.26513057947158813, 0.04557197540998459, 0.428556889295578, -0.5754464864730835, 0.23235982656478882, 0.1203349232673645, 0.15169428288936615, 0.04098043590784073, -0.20796911418437958, 0.23760442435741425, -0.28442510962486267, -0.08939704298973083, 0.11918072402477264, -0.0837780088186264, 0.012510839849710464, -0.08434872329235077, -0.07274181395769119, 0.10210077464580536, -0.042333658784627914, -0.05463308468461037, 0.03686835244297981, 0.332352876663208, -0.14334321022033691, 0.06348230689764023, 0.24175241589546204, 0.17217561602592468, 0.4152275621891022, 0.1424063742160797, 0.17626751959323883, 0.2131342887878418, -0.0707358568906784, 0.04576324671506882, -0.38002967834472656, 0.09090572595596313, -0.016269762068986893, 0.17911311984062195, 0.32622766494750977, 0.2305404543876648, 0.31031692028045654, 0.23425647616386414, -0.1741570085287094, 0.12939482927322388, -0.15731045603752136, -0.16143834590911865, -0.5225242972373962, 0.17384183406829834, 0.02716463804244995, -0.01659439504146576, -0.27435725927352905, 0.07375972718000412, -0.3099045753479004, -0.20422863960266113, 0.4294910728931427, 0.1523846685886383, 0.08341246098279953, 0.21777008473873138, 0.1288081705570221, -0.11491575837135315, -0.16854822635650635, 0.1839246153831482, 0.11967794597148895, 0.08968202769756317, 0.13875427842140198, -0.42383021116256714, -0.13837352395057678, 0.2848239243030548, -0.027516338974237442, -0.16065813601016998, -0.23193326592445374, 0.6086416244506836, 0.1943812370300293, -0.06285938620567322, -0.13870558142662048, 0.19633379578590393, 0.02693653665482998, -0.002981536090373993, -0.029746592044830322, -0.030560657382011414, 0.16170713305473328, -0.17154350876808167, -0.5418728590011597, -0.09737739711999893, 0.05403417721390724, 0.09782876819372177, -0.09795621037483215, 0.03287758678197861, -0.145308256149292, 0.11721143126487732, 0.3818663954734802, 0.12762342393398285, 0.26766839623451233, -0.37123122811317444, -0.3322507441043854, -0.16645246744155884, 0.056429922580718994, -0.021049533039331436, -0.4479826092720032, -0.20899395644664764, 0.5470566749572754, -0.04053684324026108, 0.30237454175949097, -0.3929746448993683, 0.2795940041542053, -0.08510284125804901, -0.15120622515678406, -0.5052258968353271, -0.04477185755968094, -0.3674999475479126, -0.17851108312606812, 0.20436277985572815, -0.08079454302787781, 0.12822982668876648, -0.04456454515457153, -0.2297811359167099, -0.055374279618263245, 0.3606204390525818, 0.0813622772693634, -0.1294851303100586, -0.005016915500164032, 0.22038120031356812, 0.07106441259384155, 0.32099097967147827, -0.7545433640480042, -0.004904806613922119, 0.30901890993118286, 0.0351705439388752, 0.16301441192626953, 0.22329621016979218, -0.04029944911599159, -0.2188730239868164, -0.20807527005672455, 0.05805926397442818, 0.14354777336120605, -0.012182459235191345, 0.03189145773649216, -0.5364351272583008 ]
https://github.com/huggingface/datasets/issues/5782
Considering the number of times a custom decoding transform has been suggested as a solution, an example in the [docs](https://huggingface.co/docs/datasets/process#format-transform) would be nice. cc @stevhliu
Support for various audio-loading backends instead of always relying on SoundFile
### Feature request Introduce an option to select from a variety of audio-loading backends rather than solely relying on the SoundFile library. For instance, if the ffmpeg library is installed, it can serve as a fallback loading option. ### Motivation - The SoundFile library, used in [features/audio.py](https://github.com/huggingface/datasets/blob/649d5a3315f9e7666713b6affe318ee00c7163a0/src/datasets/features/audio.py#L185), supports only a [limited number of audio formats](https://pysoundfile.readthedocs.io/en/latest/index.html?highlight=supported#soundfile.available_formats). - However, current methods for creating audio datasets permit the inclusion of audio files in formats not supported by SoundFile. - As a result, developers may potentially create a dataset they cannot read back. In my most recent project, I dealt with phone call recordings in `.amr` or `.gsm` formats and was genuinely surprised when I couldn't read the dataset I had just packaged a minute prior. Nonetheless, I can still accurately read these files using the librosa library, which employs the audioread library that internally leverages ffmpeg to read such files. Example: ```python audio_dataset_amr = Dataset.from_dict({"audio": ["audio_samples/audio.amr"]}).cast_column("audio", Audio()) audio_dataset_amr.save_to_disk("audio_dataset_amr") audio_dataset_amr = Dataset.load_from_disk("audio_dataset_amr") print(audio_dataset_amr[0]) ``` Results in: ``` Traceback (most recent call last): ... raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f316323e4d0>: Format not recognised. ``` While I acknowledge that support for these rare file types may not be a priority, I believe it's quite unfortunate that it's possible to create an unreadable dataset in this manner. ### Your contribution I've created a [simple demo repository](https://github.com/BoringDonut/hf-datasets-ffmpeg-audio) that highlights the mentioned issue. It demonstrates how to create an .amr dataset that results in an error when attempting to read it just a few lines later. Additionally, I've made a [fork with a rudimentary solution](https://github.com/BoringDonut/datasets/blob/fea73a8fbbc8876467c7e6422c9360546c6372d8/src/datasets/features/audio.py#L189) that utilizes ffmpeg to load files not supported by SoundFile. Here you may see github actions fails to read `.amr` dataset using the version of the current dataset, but will work with the patched version: - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063785 - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063829 As evident from the GitHub action above, this solution resolves the previously mentioned problem. I'd be happy to create a proper pull request, provide runtime benchmarks and tests if you could offer some guidance on the following: - Where should I incorporate the ffmpeg (or other backends) code? For example, should I create a new file or simply add a function within the Audio class? - Is it feasible to pass the audio-loading function as an argument within the current architecture? This would be useful if I know in advance that I'll be reading files not supported by SoundFile. A few more notes: - In theory, it's possible to load audio using librosa/audioread since librosa is already expected to be installed. However, librosa [will soon discontinue audioread support](https://github.com/librosa/librosa/blob/aacb4c134002903ae56bbd4b4a330519a5abacc0/librosa/core/audio.py#L227). Moreover, using audioread on its own seems inconvenient because it requires a file [path as input](https://github.com/beetbox/audioread/blob/ff9535df934c48038af7be9617fdebb12078cc07/audioread/__init__.py#L108) and cannot work with bytes already loaded into memory or an open file descriptor (as mentioned in [librosa docs](https://librosa.org/doc/main/generated/librosa.load.html#librosa.load), only SoundFile backend supports an open file descriptor as an input).
25
Support for various audio-loading backends instead of always relying on SoundFile ### Feature request Introduce an option to select from a variety of audio-loading backends rather than solely relying on the SoundFile library. For instance, if the ffmpeg library is installed, it can serve as a fallback loading option. ### Motivation - The SoundFile library, used in [features/audio.py](https://github.com/huggingface/datasets/blob/649d5a3315f9e7666713b6affe318ee00c7163a0/src/datasets/features/audio.py#L185), supports only a [limited number of audio formats](https://pysoundfile.readthedocs.io/en/latest/index.html?highlight=supported#soundfile.available_formats). - However, current methods for creating audio datasets permit the inclusion of audio files in formats not supported by SoundFile. - As a result, developers may potentially create a dataset they cannot read back. In my most recent project, I dealt with phone call recordings in `.amr` or `.gsm` formats and was genuinely surprised when I couldn't read the dataset I had just packaged a minute prior. Nonetheless, I can still accurately read these files using the librosa library, which employs the audioread library that internally leverages ffmpeg to read such files. Example: ```python audio_dataset_amr = Dataset.from_dict({"audio": ["audio_samples/audio.amr"]}).cast_column("audio", Audio()) audio_dataset_amr.save_to_disk("audio_dataset_amr") audio_dataset_amr = Dataset.load_from_disk("audio_dataset_amr") print(audio_dataset_amr[0]) ``` Results in: ``` Traceback (most recent call last): ... raise LibsndfileError(err, prefix="Error opening {0!r}: ".format(self.name)) soundfile.LibsndfileError: Error opening <_io.BytesIO object at 0x7f316323e4d0>: Format not recognised. ``` While I acknowledge that support for these rare file types may not be a priority, I believe it's quite unfortunate that it's possible to create an unreadable dataset in this manner. ### Your contribution I've created a [simple demo repository](https://github.com/BoringDonut/hf-datasets-ffmpeg-audio) that highlights the mentioned issue. It demonstrates how to create an .amr dataset that results in an error when attempting to read it just a few lines later. Additionally, I've made a [fork with a rudimentary solution](https://github.com/BoringDonut/datasets/blob/fea73a8fbbc8876467c7e6422c9360546c6372d8/src/datasets/features/audio.py#L189) that utilizes ffmpeg to load files not supported by SoundFile. Here you may see github actions fails to read `.amr` dataset using the version of the current dataset, but will work with the patched version: - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063785 - https://github.com/BoringDonut/hf-datasets-ffmpeg-audio/actions/runs/4773780420/jobs/8487063829 As evident from the GitHub action above, this solution resolves the previously mentioned problem. I'd be happy to create a proper pull request, provide runtime benchmarks and tests if you could offer some guidance on the following: - Where should I incorporate the ffmpeg (or other backends) code? For example, should I create a new file or simply add a function within the Audio class? - Is it feasible to pass the audio-loading function as an argument within the current architecture? This would be useful if I know in advance that I'll be reading files not supported by SoundFile. A few more notes: - In theory, it's possible to load audio using librosa/audioread since librosa is already expected to be installed. However, librosa [will soon discontinue audioread support](https://github.com/librosa/librosa/blob/aacb4c134002903ae56bbd4b4a330519a5abacc0/librosa/core/audio.py#L227). Moreover, using audioread on its own seems inconvenient because it requires a file [path as input](https://github.com/beetbox/audioread/blob/ff9535df934c48038af7be9617fdebb12078cc07/audioread/__init__.py#L108) and cannot work with bytes already loaded into memory or an open file descriptor (as mentioned in [librosa docs](https://librosa.org/doc/main/generated/librosa.load.html#librosa.load), only SoundFile backend supports an open file descriptor as an input). Considering the number of times a custom decoding transform has been suggested as a solution, an example in the [docs](https://huggingface.co/docs/datasets/process#format-transform) would be nice. cc @stevhliu
[ -0.37373217940330505, 0.07107827067375183, -0.10752930492162704, -0.12114189565181732, 0.10390601307153702, -0.258517324924469, 0.5349103212356567, 0.24692317843437195, 0.048604682087898254, 0.3966282606124878, -0.5119902491569519, 0.14266866445541382, -0.3062678575515747, 0.19196441769599915, 0.07823756337165833, -0.029134485870599747, -0.025281447917222977, 0.22665539383888245, 0.21392078697681427, 0.13320598006248474, -0.3393711745738983, 0.03982406109571457, 0.024521932005882263, 0.026634804904460907, -0.1447460949420929, 0.183294415473938, 0.23763251304626465, 0.08505292981863022, -0.3136221766471863, -0.3783979117870331, 0.13611501455307007, 0.09761454910039902, -0.032746851444244385, 0.145369291305542, -0.00010244411532767117, -0.008208416402339935, 0.25801020860671997, -0.23342657089233398, -0.34060558676719666, -0.22340503334999084, -0.15143026411533356, 0.22908729314804077, -0.022017551586031914, -0.10033554583787918, 0.03150451183319092, -0.280782550573349, -0.03956074267625809, -0.3748689889907837, 0.14733222126960754, 0.08940989524126053, 0.24680139124393463, 0.15214675664901733, -0.14385530352592468, 0.11099791526794434, 0.33529695868492126, 0.21665360033512115, -0.042907215654850006, 0.10920868068933487, 0.5367932915687561, -0.01825888827443123, 0.08424867689609528, 0.15710733830928802, -0.4683555066585541, -0.14568835496902466, 0.102998748421669, -0.038428060710430145, 0.09850060939788818, -0.3344913423061371, -0.1015959084033966, 0.4541647732257843, 0.5669826865196228, -0.1609908938407898, -0.589493989944458, -0.4151868224143982, 0.02309577912092209, -0.30232101678848267, -0.14805150032043457, 0.08130063861608505, -0.27516674995422363, 0.305286169052124, 0.020693369209766388, -0.003965873271226883, 0.12717735767364502, 0.29210224747657776, 0.19725024700164795, 0.05550619959831238, -0.12540869414806366, -0.07730843126773834, 0.5447858572006226, -0.04171166941523552, -0.3647790253162384, -0.16176067292690277, 0.22036191821098328, 0.08110123872756958, -0.1350509524345398, -0.11599339544773102, 0.04278950393199921, -0.30758148431777954, 0.08176392316818237, 0.18463420867919922, -0.02289704605937004, 0.4547335207462311, -0.49264389276504517, 0.1384037435054779, -0.004932353273034096, -0.2517364025115967, -0.08313006162643433, -0.28944069147109985, 0.45484459400177, 0.05219264328479767, 0.46197211742401123, 0.05236031860113144, -0.1263556033372879, 0.09084907174110413, -0.37419337034225464, -0.05135791376233101, 0.024720728397369385, -0.2327144742012024, -0.22187578678131104, -0.28385859727859497, 0.02625272423028946, -0.09774293750524521, 0.11110211908817291, 0.24589847028255463, 0.01814337819814682, 0.24355529248714447, 0.2691630721092224, 0.2877027690410614, 0.01720530539751053, -0.03170496225357056, 0.15592852234840393, -0.023153414949774742, -0.01265043020248413, -0.0034658238291740417, 0.3555082082748413, -0.28282615542411804, 0.25693172216415405, 0.1753949522972107, 0.15179282426834106, -0.029328130185604095, 0.030732929706573486, 0.028963733464479446, -0.13220243155956268, 0.15992151200771332, -0.251636266708374, 0.054144859313964844, -0.10079900920391083, 0.17617247998714447, -0.28688016533851624, 0.10493224859237671, -0.18756116926670074, -0.34022414684295654, -0.142360657453537, 0.2829554080963135, 0.006479822099208832, 0.03994111344218254, -0.2685057520866394, 0.11186656355857849, -0.36025434732437134, -0.5429403185844421, 0.05231763795018196, -0.03274491801857948, -0.3034220039844513, -0.07751565426588058, 0.32841676473617554, 0.14738665521144867, -0.49760156869888306, -0.24711428582668304, -0.09229973703622818, -0.3909418284893036, 0.050714123994112015, 0.04967474564909935, -0.1950124204158783, -0.23611262440681458, -0.2579234838485718, 0.07316040992736816, 0.5304458141326904, -0.49420350790023804, -0.29956668615341187, -0.08856333792209625, -0.0008943453431129456, 0.30998900532722473, 0.3071233630180359, 0.31474626064300537, 0.18012948334217072, -0.25217241048812866, 0.1532025784254074, 0.5456121563911438, -0.0064181555062532425, -0.03220902755856514, 0.018336929380893707, -0.29190248250961304, 0.0017643654718995094, 0.407922625541687, -0.09333768486976624, 0.04907861724495888, 0.03847697749733925, -0.04080217331647873, 0.2453516125679016, -0.1551453024148941, -0.031222451478242874, -0.25762268900871277, 0.38573408126831055, 0.006170868873596191, -0.10425210744142532, -0.4894324839115143, 0.08837567269802094, 0.0373803973197937, 0.03218778222799301, 0.17393717169761658, -0.03415832296013832, -0.08977615833282471, 0.1253328025341034, -0.18233627080917358, -0.27752333879470825, 0.16005893051624298, 0.13385526835918427, 0.303921103477478, -0.1457100361585617, -0.0346524603664875, -0.4048847556114197, 0.07677052170038223, -0.07251148670911789, -0.04585416615009308, -0.24266768991947174, -0.024834219366312027, 0.11733982712030411, 0.08272360265254974, 0.05062566697597504, 0.2688468396663666, -0.08508467674255371, -0.009443920105695724, -0.08112233877182007, 0.3723986744880676, 0.33030521869659424, 0.319047212600708, -0.4606330394744873, 0.6412432789802551, 0.1978289783000946, 0.1280006319284439, 0.2395658642053604, 0.14315834641456604, 0.18503600358963013, -0.1960790604352951, -0.042889565229415894, 0.3327425420284271, 0.29778602719306946, 0.34452787041664124, 0.2781406044960022, -0.15278738737106323, 0.16492798924446106, 0.24313068389892578, -0.36634179949760437, -0.13136349618434906, -0.014365321025252342, -0.2884335517883301, 0.4618465304374695, 0.053136371076107025, -0.29202374815940857, -0.07613334059715271, 0.4358081817626953, -0.18759307265281677, 0.12100235372781754, 0.14739763736724854, -0.15108522772789001, -0.24419544637203217, 0.0727829784154892, 0.2663906514644623, 0.26882970333099365, 0.2846900522708893, -0.027606859803199768, -0.28517812490463257, 0.10765880346298218, -0.23039937019348145, 0.09972876310348511, 0.16291013360023499, -0.0058217719197273254, 0.2699616253376007, 0.24219202995300293, 0.09394389390945435, -0.04649347439408302, -0.15050476789474487, -0.17447419464588165, -0.31730011105537415, -0.06261828541755676, -0.027579084038734436, -0.4050491452217102, -0.0806613340973854, -0.039405085146427155, -0.5509622097015381, -0.04922286421060562, -0.05075007304549217, 0.32788094878196716, 0.3494582772254944, -0.23120638728141785, 0.08159954100847244, -0.21858707070350647, 0.3290373980998993, -0.2379181832075119, -0.4472079277038574, 0.12403380870819092, 0.2928239107131958, 0.06605452299118042, 0.16476836800575256, 0.3992394804954529, 0.06835397332906723, 0.3210461735725403, 0.06252998858690262, -0.2447698712348938, -0.06624658405780792, 0.05841388553380966, 0.2723044753074646, 0.14907531440258026, 0.15647374093532562, 0.11557438969612122, -0.12816114723682404, 0.335396409034729, -0.5243095755577087, 0.17164306342601776, 0.13947242498397827, -0.0745546892285347, 0.1567038893699646, 0.06484787166118622, 0.29308897256851196, -0.15621842443943024, -0.17508581280708313, -0.47505608201026917, -0.5595319271087646, 0.11964346468448639, -0.20245361328125, 0.13619983196258545, 0.25500357151031494, -0.026934832334518433, 0.09404053539037704, -0.0785941481590271, 0.4681116044521332, -0.1121181845664978, -0.07253266870975494, 0.14000868797302246, -0.06921830028295517, -0.018901029601693153, -0.1598920375108719, 0.032218724489212036, 0.013739213347434998, 0.16585920751094818, -0.15351028740406036, -0.3179636299610138, 0.2124878615140915, -0.009919784963130951, 0.07392211258411407, -0.056015945971012115, 0.2445736527442932, 0.27788904309272766, -0.04544768109917641, -0.06455102562904358, -0.09491069614887238, -0.2584036588668823, -0.23531204462051392, 0.02171418070793152, 0.14691096544265747, 0.20182453095912933, -0.3833940625190735, 0.7172499895095825, -0.12654924392700195, -0.0717623233795166, 0.2303447723388672, 0.12127655744552612, 0.10976266860961914, -0.5182846188545227, -0.21327552199363708, -0.022061027586460114, -0.07892046868801117, 0.010303162038326263, 0.18063083291053772, 0.01634891703724861, -0.239252969622612, -0.22186796367168427, 0.19866901636123657, -0.15373684465885162, -0.030825112015008926, 0.1147618219256401, 0.1712418794631958, 0.15089163184165955, -0.10253911465406418, 0.11386290192604065, 0.13130593299865723, 0.028276659548282623, 0.10524645447731018, 0.24939334392547607, 0.46017807722091675, -0.16088251769542694, -0.4426608085632324, 0.018417030572891235, -0.05146380141377449, 0.18069812655448914, 0.253938227891922, 0.3232490122318268, -0.15214258432388306, -0.2464178502559662, -0.12303199619054794, 0.028893623501062393, 0.20034196972846985, 0.06494220346212387, -0.1612766683101654, 0.20641382038593292, -0.026954397559165955, 0.07489641010761261, 0.06003975123167038, -0.12976521253585815, -0.2495301067829132, -0.0855141207575798, 0.3030969798564911, -0.06510330736637115, -0.24242129921913147, -0.14030908048152924, 0.5908176898956299, 0.1341097056865692, -0.11348560452461243, -0.058492884039878845, 0.008124083280563354, -0.41674384474754333, -0.2900325059890747, -0.16756102442741394, 0.16584883630275726, -0.07249408215284348, -0.14774683117866516, 0.3516796827316284, 0.0761847048997879, 0.30887240171432495, 0.0180644690990448, 0.10468167066574097, -0.12821632623672485, 0.19061526656150818, -0.22067010402679443, -0.01217520609498024, 0.3033471405506134, 0.31872081756591797, -0.07266692072153091, -0.2079634666442871, 0.3308088481426239, 0.11787740886211395, 0.20754089951515198, 0.1798027753829956, 0.11405904591083527, 0.3514809012413025, -0.15245550870895386, -0.030620891600847244, -0.35836830735206604, 0.0003648102283477783, 0.4051758646965027, -0.09819822758436203, -0.2362501323223114, -0.4718203544616699, 0.6320884823799133, -0.1871257871389389, -0.12159641087055206, 0.22546561062335968, 0.2225521355867386, 0.025465402752161026, 0.36800509691238403, -0.18893852829933167, 0.8479914665222168, 0.1531887799501419, 0.1129971593618393, 0.32370397448539734, -0.09528949856758118, 0.04456320032477379, -0.43043053150177, 0.1435365229845047, 0.08729812502861023, 0.10162840783596039, -0.11531081795692444, 0.028163745999336243, -0.23167037963867188, 0.17263631522655487, -0.07837957888841629, 0.20035403966903687, 0.041882678866386414, -0.2818171977996826, -0.0026099421083927155, 0.3529410660266876, -0.13772472739219666, -0.4243376851081848, -0.4968208372592926, 0.20689132809638977, 0.27761635184288025, -0.057604577392339706, 0.0688723474740982, -0.020837735384702682, 0.40377891063690186, 0.030765868723392487, -0.37788090109825134, 0.0011762455105781555, 0.0036933869123458862, -0.09513355791568756, -0.024663306772708893, -0.07526595890522003, 0.19928507506847382, -0.026115279644727707, -0.26415395736694336, 0.35264238715171814, -0.0075987279415130615, -0.1335458755493164, -0.3216821551322937, 0.4240269660949707, -0.035580988973379135, -0.06056695058941841, 0.4487150013446808, -0.1311262547969818, -0.1939925104379654, 0.17997132241725922, -0.030556228011846542, -0.4164876937866211, 0.08288644254207611, -0.1369912475347519, 0.341189980506897, -0.1200360357761383, -0.4282396137714386, -0.019077517092227936, 0.13934478163719177, -0.13248135149478912, 0.1971796751022339, 0.08887399733066559, -0.1901426464319229, 0.08014395833015442, -0.0885009616613388, -0.030768215656280518, -0.1379401683807373, 0.10553532838821411, -0.32321876287460327, -0.07130197435617447, 0.34133434295654297, -0.03898408263921738, -0.16176198422908783, -0.21222618222236633, -0.145179882645607, -0.03461020439863205, -0.011655621230602264, 0.04797426983714104, 0.2418663501739502, -0.24048438668251038, -0.15372198820114136, 0.021026886999607086, -0.08902956545352936, -0.06999380886554718, -0.3138827085494995, -0.4382939040660858, -0.13275253772735596, 0.33251041173934937, 0.043294765055179596, 0.1761329621076584, -0.06867242604494095, -0.25341886281967163, -0.2586112916469574, -0.09360139071941376, -0.4068955183029175, 0.08514337241649628, 0.10253413766622543, 0.2272382378578186, 0.16961440443992615, 0.053425710648298264, 0.041034210473299026, 0.13947203755378723, 0.23207077383995056, 0.06820312887430191, -0.15994736552238464, -0.19076314568519592, -0.05598435923457146, 0.18338985741138458, 0.08555954694747925, -0.16864228248596191, 0.19421476125717163, -0.121010422706604, -0.35861411690711975, -0.30758222937583923, 0.14051872491836548, 0.29947590827941895, -0.06859583407640457, -0.141009122133255, -0.04026362672448158, -0.030222438275814056, 0.19201155006885529, 0.2448239028453827, -0.008766558021306992, -0.17974457144737244, 0.1724342256784439, 0.03490445017814636, -0.12505730986595154, -0.18671230971813202, -0.12882375717163086, 0.3906566798686981, 0.2726672887802124, -0.03933027759194374, 0.3550669550895691, 0.14444947242736816, 0.0860113576054573, 0.31501635909080505, 0.3228002190589905, 0.4036329984664917, -0.009344391524791718, 0.20220842957496643, 0.38235971331596375, 0.3386188745498657, -0.1696397215127945, -0.3617249131202698, -0.13153772056102753, -0.08747737109661102, 0.22157776355743408, 0.23183965682983398, 0.1971352994441986, -0.007928445935249329, 0.8123262524604797, -0.13017907738685608, -0.025814073160290718, -0.11609601974487305, 0.1255972534418106, 0.3058718740940094, -0.10493089258670807, 0.0392518974840641, 0.09646697342395782, -0.11011645197868347, 0.2329615354537964, -0.06420056521892548, -0.6781708598136902, 0.19645431637763977, 0.07631854712963104, -0.2682296633720398, 0.20174075663089752, -0.3309650421142578, -0.16351985931396484, 0.1203702986240387, -0.12927405536174774, 0.26513057947158813, 0.04557197540998459, 0.428556889295578, -0.5754464864730835, 0.23235982656478882, 0.1203349232673645, 0.15169428288936615, 0.04098043590784073, -0.20796911418437958, 0.23760442435741425, -0.28442510962486267, -0.08939704298973083, 0.11918072402477264, -0.0837780088186264, 0.012510839849710464, -0.08434872329235077, -0.07274181395769119, 0.10210077464580536, -0.042333658784627914, -0.05463308468461037, 0.03686835244297981, 0.332352876663208, -0.14334321022033691, 0.06348230689764023, 0.24175241589546204, 0.17217561602592468, 0.4152275621891022, 0.1424063742160797, 0.17626751959323883, 0.2131342887878418, -0.0707358568906784, 0.04576324671506882, -0.38002967834472656, 0.09090572595596313, -0.016269762068986893, 0.17911311984062195, 0.32622766494750977, 0.2305404543876648, 0.31031692028045654, 0.23425647616386414, -0.1741570085287094, 0.12939482927322388, -0.15731045603752136, -0.16143834590911865, -0.5225242972373962, 0.17384183406829834, 0.02716463804244995, -0.01659439504146576, -0.27435725927352905, 0.07375972718000412, -0.3099045753479004, -0.20422863960266113, 0.4294910728931427, 0.1523846685886383, 0.08341246098279953, 0.21777008473873138, 0.1288081705570221, -0.11491575837135315, -0.16854822635650635, 0.1839246153831482, 0.11967794597148895, 0.08968202769756317, 0.13875427842140198, -0.42383021116256714, -0.13837352395057678, 0.2848239243030548, -0.027516338974237442, -0.16065813601016998, -0.23193326592445374, 0.6086416244506836, 0.1943812370300293, -0.06285938620567322, -0.13870558142662048, 0.19633379578590393, 0.02693653665482998, -0.002981536090373993, -0.029746592044830322, -0.030560657382011414, 0.16170713305473328, -0.17154350876808167, -0.5418728590011597, -0.09737739711999893, 0.05403417721390724, 0.09782876819372177, -0.09795621037483215, 0.03287758678197861, -0.145308256149292, 0.11721143126487732, 0.3818663954734802, 0.12762342393398285, 0.26766839623451233, -0.37123122811317444, -0.3322507441043854, -0.16645246744155884, 0.056429922580718994, -0.021049533039331436, -0.4479826092720032, -0.20899395644664764, 0.5470566749572754, -0.04053684324026108, 0.30237454175949097, -0.3929746448993683, 0.2795940041542053, -0.08510284125804901, -0.15120622515678406, -0.5052258968353271, -0.04477185755968094, -0.3674999475479126, -0.17851108312606812, 0.20436277985572815, -0.08079454302787781, 0.12822982668876648, -0.04456454515457153, -0.2297811359167099, -0.055374279618263245, 0.3606204390525818, 0.0813622772693634, -0.1294851303100586, -0.005016915500164032, 0.22038120031356812, 0.07106441259384155, 0.32099097967147827, -0.7545433640480042, -0.004904806613922119, 0.30901890993118286, 0.0351705439388752, 0.16301441192626953, 0.22329621016979218, -0.04029944911599159, -0.2188730239868164, -0.20807527005672455, 0.05805926397442818, 0.14354777336120605, -0.012182459235191345, 0.03189145773649216, -0.5364351272583008 ]
https://github.com/huggingface/datasets/issues/5781
It looks like an issue with your installation of scipy, can you try reinstalling it ?
Error using `load_datasets`
### Describe the bug I tried to load a dataset using the `datasets` library in a conda jupyter notebook and got the below error. ``` ImportError: dlopen(/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/_iterative.cpython-38-darwin.so, 0x0002): Library not loaded: @rpath/liblapack.3.dylib Referenced from: <65B094A2-59D7-31AC-A966-4DB9E11D2A15> /Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/_iterative.cpython-38-darwin.so Reason: tried: '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/../../../../../../liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/../../../../../../liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/bin/../lib/liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/bin/../lib/liblapack.3.dylib' (no such file), '/usr/local/lib/liblapack.3.dylib' (no such file), '/usr/lib/liblapack.3.dylib' (no such file, not in dyld cache) ``` ### Steps to reproduce the bug Run the `load_datasets` function ### Expected behavior I expected the dataset to be loaded into my notebook. ### Environment info name: review_sense channels: - apple - conda-forge dependencies: - python=3.8 - pip>=19.0 - jupyter - tensorflow-deps #- scikit-learn #- scipy - pandas - pandas-datareader - matplotlib - pillow - tqdm - requests - h5py - pyyaml - flask - boto3 - ipykernel - seaborn - pip: - tensorflow-macos==2.9 - tensorflow-metal==0.5.0 - bayesian-optimization - gym - kaggle - huggingface_hub - datasets - numpy - huggingface
16
Error using `load_datasets` ### Describe the bug I tried to load a dataset using the `datasets` library in a conda jupyter notebook and got the below error. ``` ImportError: dlopen(/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/_iterative.cpython-38-darwin.so, 0x0002): Library not loaded: @rpath/liblapack.3.dylib Referenced from: <65B094A2-59D7-31AC-A966-4DB9E11D2A15> /Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/_iterative.cpython-38-darwin.so Reason: tried: '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/../../../../../../liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/lib/python3.8/site-packages/scipy/sparse/linalg/_isolve/../../../../../../liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/bin/../lib/liblapack.3.dylib' (no such file), '/Users/gilbertyoung/miniforge3/envs/review_sense/bin/../lib/liblapack.3.dylib' (no such file), '/usr/local/lib/liblapack.3.dylib' (no such file), '/usr/lib/liblapack.3.dylib' (no such file, not in dyld cache) ``` ### Steps to reproduce the bug Run the `load_datasets` function ### Expected behavior I expected the dataset to be loaded into my notebook. ### Environment info name: review_sense channels: - apple - conda-forge dependencies: - python=3.8 - pip>=19.0 - jupyter - tensorflow-deps #- scikit-learn #- scipy - pandas - pandas-datareader - matplotlib - pillow - tqdm - requests - h5py - pyyaml - flask - boto3 - ipykernel - seaborn - pip: - tensorflow-macos==2.9 - tensorflow-metal==0.5.0 - bayesian-optimization - gym - kaggle - huggingface_hub - datasets - numpy - huggingface It looks like an issue with your installation of scipy, can you try reinstalling it ?
[ -0.0995519682765007, 0.1529461145401001, -0.03579659387469292, 0.6282527446746826, 0.24879217147827148, 0.003521047532558441, 0.4788861870765686, 0.2676067352294922, -0.3318800926208496, -0.20303790271282196, -0.2591601014137268, 0.47658172249794006, -0.15595141053199768, 0.1413385570049286, -0.023854747414588928, 0.0014849752187728882, 0.0329834446310997, 0.20786680281162262, -0.1237468421459198, -0.04228360578417778, -0.3104313611984253, 0.2348383516073227, -0.347405344247818, 0.06373279541730881, -0.29899346828460693, -0.04267983138561249, -0.004656471312046051, 0.6616777777671814, -0.11257310211658478, -0.27955523133277893, 0.41772010922431946, -0.03752032667398453, 0.4019574522972107, 0.4477103054523468, -0.00010947795090032741, 0.08944045007228851, 0.3571295738220215, -0.15163877606391907, -0.5316817760467529, -0.25765150785446167, -0.15944887697696686, -0.1780771017074585, 0.35002920031547546, -0.20380140841007233, 0.0913829505443573, -0.21691687405109406, -0.2784348428249359, -0.5355899333953857, 0.21974660456180573, 0.20937258005142212, 0.23931196331977844, 0.26882195472717285, 0.2610495090484619, -0.08406920731067657, 0.12763415277004242, 0.027928723022341728, -0.029817383736371994, 0.5003629326820374, 0.22285248339176178, -0.14018069207668304, 0.11765764653682709, 0.16097095608711243, -0.23081277310848236, 0.0977029949426651, 0.24377526342868805, 0.015742894262075424, -0.07030192017555237, -0.2483428716659546, -0.06857837736606598, 0.21242772042751312, 0.8755887150764465, -0.3313021659851074, -0.29179057478904724, -0.09270330518484116, -0.10496893525123596, -0.27296942472457886, 0.1931591033935547, 0.06837522238492966, 0.010821335017681122, 0.1047760546207428, 0.10560145229101181, 0.023840446025133133, -0.11427738517522812, 0.23872002959251404, -0.1629883497953415, 0.19541803002357483, -0.12360161542892456, 0.08163093030452728, 0.2824987769126892, -0.056888140738010406, 0.5623441934585571, 0.18244990706443787, -0.14721661806106567, 0.08458872139453888, -0.38691630959510803, 0.034426264464855194, 0.022060152143239975, -0.09935647994279861, 0.015153087675571442, 0.33125922083854675, 0.21691739559173584, -0.23753398656845093, -0.08565019816160202, 0.2654169201850891, 0.26908764243125916, 0.19363519549369812, 0.21576888859272003, 0.42510703206062317, 0.22261613607406616, 0.09747028350830078, 0.10440495610237122, -0.0895034670829773, -0.29452455043792725, -0.34571224451065063, -0.021803032606840134, -0.08791102468967438, 0.3801971971988678, -0.30969688296318054, -0.47495922446250916, 0.05367447808384895, -0.19302532076835632, 0.0066828615963459015, 0.113096684217453, 0.4025629460811615, -0.1021609902381897, 0.14311394095420837, 0.2933216691017151, 0.21355609595775604, 0.11567384004592896, 0.0508282370865345, -0.17379842698574066, 0.22868886590003967, -0.12862232327461243, -0.1473352164030075, 0.14271511137485504, -0.19826538860797882, 0.4612402319908142, 0.004466146230697632, 0.038860954344272614, -0.3126062750816345, 0.10793974995613098, -0.08999386429786682, -0.24401482939720154, 0.3796103298664093, -0.17142415046691895, -0.02396799623966217, 0.31932491064071655, -0.36968591809272766, -0.11567188054323196, 0.2948513627052307, -0.26770350337028503, -0.12564507126808167, -0.6393014788627625, 0.16084082424640656, -0.19727307558059692, 0.13441582024097443, -0.24745455384254456, -0.08208376169204712, 0.018582016229629517, -0.2222868651151657, -0.06736047565937042, -0.08324819803237915, 0.15611104667186737, -0.2664673328399658, 0.20189878344535828, 0.4075806140899658, -0.80655437707901, 0.030481770634651184, -0.16097542643547058, -0.13054989278316498, 0.27502936124801636, 0.20890259742736816, -0.4345354437828064, 0.06881195306777954, -0.1277311146259308, -0.008444443345069885, 0.5420867204666138, -0.32888203859329224, -0.33196118474006653, 0.015248876065015793, -0.02133166790008545, 0.28188031911849976, -0.08205977082252502, 0.106900155544281, 0.06383989006280899, -0.039420388638973236, 0.12964186072349548, 0.21985773742198944, 0.17372529208660126, -0.1728885918855667, -0.2600155174732208, -0.13730792701244354, 0.2669166028499603, 0.37071332335472107, -0.11722125113010406, -0.026262890547513962, 0.23498570919036865, 0.2817188501358032, 0.16201186180114746, -0.1446647346019745, -0.2700808644294739, 0.2324092984199524, -0.020591475069522858, 0.22068524360656738, -0.01706167683005333, 0.15150722861289978, -0.494446724653244, 0.20045579969882965, 0.04905529320240021, 0.017868483439087868, -0.023821812123060226, 0.08540446311235428, -0.2425912618637085, 0.20851017534732819, -0.23684939742088318, -0.300874799489975, 0.09488920867443085, 0.11278524994850159, -0.08818304538726807, 0.09508883953094482, -0.08975589275360107, 0.46825936436653137, -0.06938657909631729, 0.21864277124404907, -0.37744489312171936, 0.23931963741779327, -0.005906392354518175, -0.04626603424549103, 0.051803991198539734, 0.1646958291530609, 0.0031297216191887856, -0.1967722475528717, -0.14504332840442657, 0.33108949661254883, 0.2932153344154358, -0.31886377930641174, -0.2336878776550293, -0.1978493183851242, 0.03825019299983978, 0.05695390701293945, 0.16619551181793213, 0.09192820638418198, 0.26716873049736023, -0.05630885064601898, 0.07771121710538864, 0.22857096791267395, -0.08275304734706879, 0.008964218199253082, -0.13098497688770294, 0.03618403524160385, 0.23701539635658264, -0.07238733768463135, 0.01798919588327408, -0.09920474141836166, 0.3867088556289673, 0.07658551633358002, 0.40078046917915344, 0.22293077409267426, -0.3264264464378357, -0.37115249037742615, 0.011117041110992432, -0.09959495067596436, 0.006271263584494591, 0.21132493019104004, -0.20591874420642853, 0.1735077202320099, 0.23654522001743317, 0.1972433179616928, 0.642695426940918, 0.112980917096138, -0.2969021201133728, -0.03749067708849907, -0.026090318337082863, -0.11637318134307861, 0.09813332557678223, 0.16012690961360931, 0.6731034517288208, 0.07862000912427902, 0.09137888252735138, 0.12366659939289093, -0.11038868129253387, -0.4403144121170044, -0.1061633974313736, 0.3661011755466461, -0.24624596536159515, 0.24966229498386383, -0.31170177459716797, -0.07975143939256668, 0.013148650527000427, -0.2934202253818512, -0.09375868737697601, -0.09085814654827118, -0.21428196132183075, 0.1410197913646698, 0.08191612362861633, 0.13976070284843445, 0.10493627935647964, 0.02872072160243988, 0.08916057646274567, -0.19545963406562805, -0.08147915452718735, -0.15705211460590363, -0.3566949963569641, 0.07460090517997742, 0.41657012701034546, -0.016930174082517624, 0.03903675824403763, -0.2139771580696106, 0.0612398236989975, -0.05796702578663826, -0.2806950807571411, -0.10265322029590607, 0.07373645156621933, 0.5525195598602295, 0.15244126319885254, 0.0853293240070343, 0.01794952154159546, -0.3528590202331543, 0.20830252766609192, 0.2965600788593292, 0.04309063404798508, -0.024000119417905807, 0.06821437180042267, -0.08230219781398773, 0.09318462759256363, -0.2631773352622986, -0.48123106360435486, -0.3845154643058777, 0.15441812574863434, 0.21603697538375854, 0.09131210297346115, -0.012629877775907516, 0.1935327798128128, 0.1978132277727127, 0.3221036493778229, 0.28818461298942566, -0.04356645792722702, -0.07674653828144073, 0.26723819971084595, -0.09728775918483734, -0.3147304952144623, -0.0666886568069458, 0.021363161504268646, 0.36160171031951904, -0.3010314106941223, -0.6207990646362305, 0.10632848739624023, 0.07399937510490417, 0.03411597013473511, -0.24759474396705627, -0.08397112041711807, 0.1637192815542221, 0.16928859055042267, 0.08787040412425995, -0.060631245374679565, -0.1665741503238678, -0.10551567375659943, -0.2996468245983124, 0.2909725606441498, -0.02184288203716278, 0.44065195322036743, -0.24326559901237488, 0.10840103775262833, 0.13174498081207275, -0.32284918427467346, 0.24199047684669495, 0.14516226947307587, 0.31982317566871643, -0.05789276212453842, -0.3859999477863312, -0.008098293095827103, -0.0045880600810050964, -0.07509789615869522, 0.14028942584991455, -0.02377159520983696, -0.4941076934337616, -0.4217889904975891, -0.13446533679962158, -0.2126035988330841, -0.005814895033836365, 0.04570360481739044, -0.29373443126678467, -0.24210429191589355, 0.020990215241909027, 0.07683895528316498, 0.05088813602924347, 0.004348203539848328, -0.16236478090286255, 0.3253368139266968, -0.05610460788011551, -0.056842125952243805, -0.03438296914100647, 0.02695678547024727, -0.18435138463974, 0.27947238087654114, -0.15699385106563568, 0.289405882358551, 0.14211317896842957, -0.16609729826450348, 0.074172742664814, 0.07165741920471191, 0.611113429069519, 0.12433166801929474, -0.2989014685153961, 0.40008866786956787, 0.026850983500480652, -0.44149115681648254, -0.10402039438486099, -0.18231496214866638, 0.19034412503242493, 0.45819076895713806, 0.2974272668361664, -0.11907702684402466, -0.014657605439424515, 0.315517395734787, 0.36757224798202515, -0.07881949841976166, -0.4264611005783081, -0.45657238364219666, -0.3401811122894287, -0.40158703923225403, -0.2851531505584717, -0.18024829030036926, 0.3297869861125946, 0.041390419006347656, -0.1717030555009842, -0.26528289914131165, -0.22651150822639465, 0.1273183524608612, 0.27903661131858826, 0.361602783203125, -0.06594227999448776, 0.24405962228775024, 0.011199809610843658, 0.43135908246040344, 0.3588912785053253, 0.44082650542259216, -0.1577734500169754, -0.2799294888973236, 0.0550110898911953, 0.07551513612270355, 0.16812491416931152, -0.00735483318567276, -0.25177252292633057, -0.11053772270679474, -0.3584800362586975, 0.018281977623701096, 0.030175838619470596, 0.15940485894680023, 0.15705770254135132, 0.19833756983280182, -0.43052613735198975, -0.3989189863204956, 0.3765389323234558, 0.1427345871925354, -0.015767060220241547, 0.6705950498580933, -0.30938923358917236, -0.08378253877162933, 0.21695533394813538, 0.09879681468009949, 0.8236300945281982, -0.23049668967723846, 0.08074119687080383, 0.35027432441711426, 0.07362422347068787, 0.44198283553123474, -0.08434339612722397, 0.003123035654425621, -0.404110312461853, -0.3305875062942505, -0.032690394669771194, -0.2176617681980133, 0.3108151853084564, -0.02776588872075081, -0.1249944269657135, 0.07209743559360504, -0.18107663094997406, -0.17447011172771454, 0.1849861443042755, 0.1345149427652359, 0.07621274888515472, -0.2118479311466217, -0.43702036142349243, 0.11199945956468582, -0.0821930468082428, 0.18074819445610046, -0.25274598598480225, -0.015348296612501144, -0.30305445194244385, -0.1420544683933258, -0.17310942709445953, 0.22786125540733337, -0.3764648735523224, 0.41760656237602234, 0.2453382909297943, -0.4422977566719055, 0.1327502429485321, 0.500630795955658, 0.07352146506309509, 0.34142422676086426, -0.046101268380880356, 0.05738908052444458, 0.011624183505773544, -0.12234652787446976, 0.12435652315616608, 0.028194304555654526, 0.2917556166648865, -0.0341578833758831, -0.15727418661117554, 0.2829582393169403, -0.13818427920341492, -0.2959003448486328, 0.1731467992067337, 0.33321908116340637, 0.17256826162338257, -0.31495654582977295, -0.3009565770626068, -0.0702616423368454, 0.17930908501148224, -0.24228471517562866, 0.1586492508649826, 0.22870589792728424, 0.05636175721883774, 0.05608046054840088, -0.14543241262435913, -0.41559863090515137, -0.10051091760396957, 0.3384541869163513, -0.042332299053668976, 0.15093374252319336, 0.33563941717147827, 0.29570475220680237, -0.15377771854400635, -0.11191272735595703, 0.3510398864746094, -0.030849583446979523, -0.4160007834434509, 0.3342551290988922, 0.1824503242969513, 0.048861101269721985, -0.18837501108646393, 0.2920089364051819, 0.3021027147769928, 0.07704620063304901, 0.09437845647335052, -0.5775363445281982, -0.29519712924957275, 0.19321560859680176, -0.1955363154411316, 0.14528658986091614, 0.15544414520263672, 0.11450296640396118, -0.2243809551000595, -0.12714195251464844, -0.27810609340667725, 0.10161060839891434, -0.3302875757217407, -0.17039352655410767, 0.466713547706604, 0.09772170335054398, 0.11228598654270172, 0.057402774691581726, 0.17376860976219177, 0.11541010439395905, 0.09273117780685425, -0.2006607949733734, -0.2649909257888794, 0.11163495481014252, 0.001865573227405548, -0.2294449508190155, -0.04309689253568649, -0.26531147956848145, -0.20670625567436218, -0.1413411647081375, -0.0056885406374931335, 0.015429109334945679, 0.049073852598667145, 0.0633118748664856, 0.045189447700977325, -0.06757427752017975, -0.19423717260360718, 0.3031593859195709, -0.17808520793914795, 0.10575389117002487, -0.08069294691085815, 0.10031914710998535, 0.11352439224720001, 0.009291961789131165, -0.1650678664445877, -0.025701019912958145, -0.33472171425819397, -0.005125813186168671, 0.3198719024658203, -0.2885749042034149, 0.07370589673519135, 0.09690764546394348, 0.305486261844635, 0.440761923789978, -0.2951028347015381, 0.01977698504924774, 0.3462831676006317, 0.11267070472240448, -0.30729806423187256, -0.2593061923980713, -0.1817106008529663, 0.06267109513282776, -0.08400798588991165, 0.3317435383796692, -0.131633460521698, -0.2029721736907959, 0.1033257469534874, 0.008564941585063934, 0.28695228695869446, 0.12918217480182648, 0.27713099122047424, 0.4691040813922882, -0.14725027978420258, 0.06282061338424683, 0.2844783663749695, 0.21601155400276184, 0.23084376752376556, 0.30403387546539307, -0.35731375217437744, 0.012322919443249702, -0.2902795672416687, 0.11596697568893433, -0.2910303771495819, -0.48682498931884766, 0.20913644134998322, 0.22295069694519043, -0.06859256327152252, -0.07990305125713348, -0.18506976962089539, 0.2498939335346222, -0.11684231460094452, 0.1788892149925232, -0.029318857938051224, 0.17673221230506897, -0.23915806412696838, -0.08388411998748779, 0.018113575875759125, -0.23828454315662384, -0.0020810067653656006, 0.0168800950050354, -0.1601572185754776, -0.165766641497612, -0.02103421464562416, 0.01528237760066986, -0.24472802877426147, -0.5113368034362793, 0.22993966937065125, 0.31549298763275146, -0.31045159697532654, -0.25501134991645813, 0.20819182693958282, 0.12622354924678802, 0.0958811491727829, 0.03956933319568634, 0.1190456822514534, 0.5070356130599976, 0.4748566150665283, 0.22908549010753632, -0.23889940977096558, -0.12235529720783234, -0.15307030081748962, -0.016712550073862076, 0.3037187457084656, 0.10701930522918701, 0.21624471247196198, 0.3488554060459137, 0.14662432670593262, -0.19122275710105896, 0.1660604476928711, 0.15865463018417358, 0.2556464672088623, -0.25467783212661743, 0.22812221944332123, -0.1878177374601364, -0.16002106666564941, -0.2098560780286789, 0.1392107903957367, -0.35304105281829834, 0.09004495292901993, 0.250186026096344, 0.13623355329036713, 0.12059085071086884, 0.012707807123661041, 0.07307474315166473, -0.04856973886489868, 0.4006830155849457, 0.21304315328598022, 0.1248735785484314, -0.310448557138443, -0.3096849024295807, -0.62119060754776, 0.16034096479415894, -0.05292201414704323, -0.46068471670150757, 0.03229537606239319, -0.04987284541130066, 0.1650087833404541, 0.19234801828861237, 0.017795465886592865, 0.29032373428344727, 0.2123800814151764, -0.2473943531513214, -0.32316654920578003, -0.3651132583618164, -0.07965259253978729, 0.023303890600800514, -0.0607742965221405, -0.3520984947681427, 0.060612089931964874, -0.2551177740097046, 0.05837573856115341, -0.37441548705101013, -0.06241248920559883, -0.004342339932918549, 0.46398013830184937, 0.2564314305782318, 0.040760114789009094, 0.4554586410522461, 0.030111663043498993, 0.00338609516620636, -0.2060726135969162, -0.4034440517425537, -0.02463875710964203, 0.19648587703704834, 0.20430901646614075, 0.2803078293800354, -0.27583426237106323, -0.07834051549434662, -0.3391503095626831, 0.29367396235466003, 0.017067529261112213, 0.1130727231502533, -0.29380202293395996, 0.14605790376663208, -0.01218627393245697, 0.022198762744665146, 0.1984291523694992, 0.1649281531572342, -0.12402068823575974, 0.21708622574806213, -0.20510677993297577, -0.29035186767578125, 0.5695736408233643, -0.3402327299118042, -0.17087924480438232, 0.12222298234701157, -0.0727667510509491, -0.058802761137485504, -0.08962985873222351, -0.3758279085159302, 0.2075003683567047, 0.4186384379863739, 0.1582205444574356, -0.3270965814590454, 0.3290669620037079, -0.006488950923085213, 0.03892262279987335, -0.08592347055673599, 0.18353280425071716, -0.011065157130360603, -0.2800300717353821, 0.020637959241867065, -0.16859017312526703 ]
https://github.com/huggingface/datasets/issues/5778
Hi ! Passing `data_files="path/test.json"` is equivalent to `data_files={"train": ["path/test.json"]}`, that's why you end up with a train split. If you don't pass `data_files=`, then split names are inferred from the data files names
Schrödinger's dataset_dict
### Describe the bug If you use load_dataset('json', data_files="path/test.json"), it will return DatasetDict({train:...}). And if you use load_dataset("path"), it will return DatasetDict({test:...}). Why can't the output behavior be unified? ### Steps to reproduce the bug as description above. ### Expected behavior consistent predictable output. ### Environment info '2.11.0'
33
Schrödinger's dataset_dict ### Describe the bug If you use load_dataset('json', data_files="path/test.json"), it will return DatasetDict({train:...}). And if you use load_dataset("path"), it will return DatasetDict({test:...}). Why can't the output behavior be unified? ### Steps to reproduce the bug as description above. ### Expected behavior consistent predictable output. ### Environment info '2.11.0' Hi ! Passing `data_files="path/test.json"` is equivalent to `data_files={"train": ["path/test.json"]}`, that's why you end up with a train split. If you don't pass `data_files=`, then split names are inferred from the data files names
[ -0.07361853122711182, -0.02407802641391754, -0.08289069682359695, 0.3006475269794464, 0.4270545542240143, -0.08511455357074738, 0.4338962733745575, 0.4926876425743103, 0.16474702954292297, 0.3397959768772125, 0.10446222126483917, 0.8128926753997803, -0.11228886246681213, 0.09356339275836945, -0.18429559469223022, -0.2439439445734024, 0.23347748816013336, 0.0971822440624237, -0.2605462968349457, -0.33070701360702515, -0.13992848992347717, 0.07353245466947556, -0.03552152216434479, -0.18711212277412415, 0.014365814626216888, -0.04758479446172714, -0.22726553678512573, 0.12360644340515137, -0.10481391847133636, -0.18503481149673462, 0.2988207936286926, 0.1729176789522171, -0.05112972855567932, 0.5603736639022827, -0.00011513525532791391, 0.06951600313186646, 0.515373170375824, -0.02197600156068802, -0.17968451976776123, -0.540289044380188, -0.41299277544021606, 0.045968249440193176, 0.3418940305709839, -0.441369891166687, 0.20712479948997498, -0.16897203028202057, -0.07593483477830887, -0.3177063465118408, 0.7115933895111084, 0.19826042652130127, 0.15486018359661102, 0.013581521809101105, -0.308449923992157, -0.07434265315532684, 0.02867930568754673, 0.41294729709625244, -0.008252546191215515, 0.14493796229362488, -0.13426896929740906, 0.16663536429405212, -0.2199101448059082, -0.1259813755750656, -0.1383972018957138, 0.2023291438817978, 0.09821941703557968, 0.17298711836338043, -0.3498643636703491, -0.039619605988264084, -0.08214011788368225, 0.5467560887336731, 0.5762620568275452, -0.2656733989715576, -0.26647332310676575, -0.17763268947601318, -0.2769375145435333, -0.2178380787372589, 0.20688988268375397, 0.23669572174549103, -0.1237483024597168, 0.24529315531253815, 0.022064898163080215, 0.1366155445575714, -0.07525129616260529, 0.13614623248577118, -0.28032198548316956, 0.12573885917663574, 0.0011575892567634583, 0.3304080069065094, 0.0386371873319149, 0.3028261959552765, 0.09232676029205322, -0.35290640592575073, 0.0028211455792188644, -0.33318570256233215, 0.08524665236473083, -0.007183916866779327, 0.20210349559783936, -0.47091132402420044, 0.37649476528167725, 0.2416738122701645, -0.029227353632450104, 0.04543013498187065, -0.07409674674272537, 0.07614046335220337, 0.7451138496398926, 0.15066039562225342, -0.12279745936393738, 0.49932217597961426, 0.08746197819709778, -0.009011246263980865, -0.29744070768356323, 0.017611077055335045, 0.05126858502626419, 0.21754275262355804, -0.0507364422082901, -0.24039939045906067, 0.14608800411224365, -0.12517720460891724, -0.07348376512527466, -0.10471833497285843, -0.4276382625102997, -0.11523601412773132, -0.04074782878160477, 0.23668506741523743, -0.023399053141474724, 0.5508331656455994, 0.024309486150741577, 0.08670040965080261, -0.02527584880590439, 0.09308098256587982, -0.3020974397659302, -0.062002480030059814, -0.23796290159225464, -0.23622919619083405, -0.06582091748714447, 0.12104853987693787, 0.3517780303955078, 0.17192593216896057, 0.3217913508415222, -0.21431443095207214, -0.07072895020246506, -0.2243652641773224, 0.29591795802116394, -0.03860035166144371, 0.09249543398618698, 0.3294430375099182, -0.0022988980636000633, -0.20902547240257263, -0.23124079406261444, 0.06429595500230789, -0.2948051691055298, -0.1991715431213379, -0.27656441926956177, 0.17050422728061676, -0.35981419682502747, 0.2913714051246643, -0.0982942283153534, 0.2805165648460388, -0.0862368792295456, -0.16132885217666626, 0.03141014650464058, -0.2939971685409546, 0.03449791669845581, -0.3791747987270355, 0.1802562177181244, 0.1784256100654602, -0.2596970796585083, -0.09668183326721191, -0.08510102331638336, -0.03170114755630493, 0.33207860589027405, 0.15131941437721252, -0.3688981533050537, 0.3455967903137207, -0.3613104224205017, -0.04691309481859207, 0.4133557081222534, -0.4095655679702759, -0.6261401176452637, 0.35946038365364075, -0.07238849997520447, 0.34467649459838867, 0.3941473364830017, -0.18377777934074402, 0.29832082986831665, 0.22191910445690155, 0.15374498069286346, 0.12409614026546478, -0.10916102677583694, -0.10002591460943222, -0.16290506720542908, -0.20510521531105042, 0.3399271070957184, -0.1509970873594284, -0.06835562735795975, 0.15085725486278534, -0.009521286934614182, 0.19964925944805145, 0.6907793283462524, -0.0829210877418518, 0.05917244404554367, -0.016501769423484802, 0.24814867973327637, 0.15563371777534485, 0.026013772934675217, -0.048193227499723434, -0.26810574531555176, 0.057568371295928955, 0.2578253149986267, -0.031493984162807465, 0.15658462047576904, -0.26261401176452637, -0.07278428226709366, -0.11505177617073059, -0.3517889976501465, 0.03764072805643082, 0.11611513793468475, 0.19925135374069214, -0.22127936780452728, 0.009572625160217285, -0.21599438786506653, 0.4659619629383087, -0.08119843155145645, -0.021818192675709724, -0.05212964862585068, 0.2954273223876953, 0.01672676019370556, 0.027378201484680176, -0.06585283577442169, 0.2899022400379181, -0.06949722766876221, -0.050620295107364655, -0.00691637210547924, 0.16748052835464478, 0.24107198417186737, -0.14780235290527344, -0.2373870313167572, 0.067136749625206, -0.024510545656085014, 0.10808499157428741, -0.1511535793542862, 0.17389661073684692, 0.1009371280670166, -0.2605152726173401, -0.39399388432502747, 0.3796818256378174, -0.036901406943798065, 0.2962246537208557, -0.12647786736488342, 0.10228139162063599, 0.263467401266098, -0.030125491321086884, -0.3946429491043091, -0.15233267843723297, 0.06784132122993469, -0.006255066022276878, 0.3919660747051239, 0.08453721553087234, -0.5237078070640564, -0.10745924711227417, 0.789098858833313, 0.08276329934597015, 0.15271922945976257, 0.051668401807546616, 0.10779859870672226, -0.02099553868174553, 0.195374995470047, 0.3398174047470093, 0.46432945132255554, 0.21497946977615356, 0.1372448354959488, 0.11894092708826065, -0.11840662360191345, -0.13117775321006775, -0.0950339138507843, 0.3817773759365082, 0.1525072306394577, 0.1906450092792511, 0.0948847085237503, -0.1245221346616745, -0.26498931646347046, -0.2989611327648163, -0.1338210105895996, -0.06569261103868484, -0.22567878663539886, 0.1574828028678894, -0.5436965227127075, 0.11684644222259521, -0.5934581160545349, -0.17633208632469177, 0.08633005619049072, -0.3749605417251587, -0.18582765758037567, 0.002457700204104185, -0.1328379213809967, 0.06313378363847733, -0.07553257793188095, 0.06589963287115097, -0.011584296822547913, -0.08344752341508865, -0.08597879111766815, -0.06158266216516495, -0.3714092969894409, 0.011122331023216248, 0.09387964755296707, 0.21248936653137207, 0.07973894476890564, -0.11214951425790787, -0.17861206829547882, 0.09050177037715912, -0.214607372879982, 0.24438735842704773, -0.17789462208747864, 0.12322145700454712, 0.4384694993495941, 0.1863989531993866, 0.03181063383817673, -0.23306436836719513, 0.031423259526491165, 0.09608627110719681, -0.12214009463787079, 0.05683464556932449, 0.15373475849628448, 0.058811552822589874, -0.19963353872299194, -0.6903595328330994, -0.03831929340958595, -0.33839571475982666, 0.3358311951160431, -0.11625918745994568, 0.141567662358284, -0.07856874167919159, 0.0640861839056015, 0.06658130884170532, -0.21261753141880035, 0.19544047117233276, -0.12123469263315201, -0.29802119731903076, 0.0930418148636818, -0.10196366906166077, -0.2697955369949341, -0.13975577056407928, -0.021747063845396042, 0.16907930374145508, -0.11270327866077423, -0.49490290880203247, -0.13755910098552704, -0.10445411503314972, 0.29012084007263184, -0.20082974433898926, 0.031264640390872955, 0.1374337077140808, 0.17090655863285065, 0.021796442568302155, -0.3877539038658142, -0.33094215393066406, 0.3888257145881653, 0.34261026978492737, 0.16032233834266663, 0.17862842977046967, 0.46969640254974365, 0.1507018804550171, 0.34561488032341003, 0.5932878255844116, -0.11135916411876678, 0.09470655024051666, -0.07821401953697205, 0.16268421709537506, -0.2693606913089752, -0.13473907113075256, 0.08694957196712494, -0.08343079686164856, -0.10248193144798279, 0.07172773778438568, 0.13318797945976257, 0.1675739586353302, -0.08998697996139526, 0.1275029480457306, -0.24212785065174103, -0.294683039188385, 0.11489735543727875, -0.4257095754146576, -0.3557386100292206, 0.05426312983036041, 0.29983043670654297, 0.11744537204504013, 0.3268921673297882, 0.003338739275932312, 0.2145465463399887, 0.12506431341171265, 0.14625395834445953, -0.3962114453315735, -0.16678015887737274, -0.3796573579311371, -0.0005741193890571594, -0.04739822447299957, 0.2032909244298935, -0.004659496247768402, -0.12280701100826263, 0.053023919463157654, -0.029869507998228073, 1.1236709356307983, 0.3332436680793762, 0.02977071888744831, -0.04362478479743004, -0.1557805836200714, -0.11041901260614395, -0.062104277312755585, -0.24913038313388824, 0.20182274281978607, -0.1781521439552307, 0.07240280508995056, -0.39851611852645874, -0.33846551179885864, 0.08075939118862152, 0.23794986307621002, -0.14784009754657745, -0.18281491100788116, -0.1324779987335205, -0.3964689373970032, -0.004676900804042816, -0.2327154278755188, 0.07727675884962082, 0.26239779591560364, -0.43205004930496216, -0.42661505937576294, 0.1280379742383957, -0.09385284036397934, 0.08891541510820389, -0.14552660286426544, 0.3971115052700043, -0.37918388843536377, -0.04738040268421173, 0.26141977310180664, 0.32976633310317993, 0.3190682530403137, 0.4429977834224701, -0.35082894563674927, -0.29400286078453064, -0.04175274446606636, -0.36379173398017883, 0.11085695028305054, 0.19615483283996582, 0.02989950403571129, -0.02949368953704834, 0.19325774908065796, -0.18615379929542542, -0.11271825432777405, 0.12884937226772308, 0.4779755473136902, -0.06052979454398155, -0.3237243592739105, -0.8145613670349121, 0.3314472436904907, 0.17584006488323212, -0.16656425595283508, 0.5164797306060791, 0.044373415410518646, -0.43526405096054077, 0.7149266004562378, -0.3601871728897095, 0.8300052881240845, 0.08890564739704132, 0.2636796832084656, 0.387973815202713, -0.40269702672958374, 0.39800262451171875, -0.19253236055374146, 0.1459309458732605, -0.09012850373983383, 0.08634645491838455, -0.257760614156723, -0.20460712909698486, 0.0952455997467041, 0.26337701082229614, -0.23961621522903442, 0.3306177258491516, -0.28132206201553345, 0.3693143129348755, -0.06795590370893478, 0.32665467262268066, 0.10198696702718735, 0.16674664616584778, -0.2587612569332123, 0.0428655706346035, -0.007556730881333351, -0.07115671038627625, 0.08585833013057709, -0.41297492384910583, -0.28088635206222534, -0.2876506447792053, -0.05498191714286804, 0.015380389988422394, 0.3440093398094177, 0.3006514310836792, 0.05970079079270363, -0.40750420093536377, 0.009688295423984528, 0.2714275121688843, -0.11265567690134048, 0.1302555501461029, -0.19110837578773499, 0.29495736956596375, 0.15304002165794373, 0.2682614326477051, -0.03391284495592117, -0.21651029586791992, 0.24178113043308258, 0.08577635884284973, -0.3417242765426636, -0.04649434611201286, -0.2206839621067047, -0.5007931590080261, -0.25697290897369385, 0.21978484094142914, 0.24256834387779236, -0.3888342082500458, 0.0359928235411644, 0.22912730276584625, -0.05555268004536629, -0.29959994554519653, 0.08722644299268723, 0.16913489997386932, -0.16082464158535004, 0.45811811089515686, 0.12158258259296417, -0.26746952533721924, -0.1412363499403, 0.3336290419101715, 0.13458146154880524, 0.02217375487089157, 0.38701218366622925, 0.059869036078453064, -0.0777716413140297, -0.09602048993110657, 0.13943585753440857, 0.319449782371521, -0.09932933747768402, 0.382371187210083, -0.4772522747516632, 0.17016443610191345, -0.14167001843452454, 0.23133912682533264, -0.034767914563417435, 0.15229816734790802, -0.41063809394836426, -0.2069578617811203, -0.12362764030694962, 0.2602565884590149, -0.3745245635509491, 0.24834667146205902, 0.22670599818229675, 0.15405872464179993, -0.03645174205303192, -0.10653359442949295, -0.2793894410133362, -0.16667240858078003, -0.0930320993065834, 0.009371791034936905, -0.008339960128068924, 0.10603431612253189, -0.010207891464233398, 0.061981428414583206, 0.1256721317768097, 0.04465024918317795, -0.12541042268276215, -0.19955331087112427, -0.056504108011722565, 0.13417956233024597, 0.04430488869547844, 0.4005781412124634, -0.15430742502212524, -0.03574825078248978, -0.08802270889282227, -0.15710502862930298, 0.3233456313610077, 0.4223196506500244, -0.11490385979413986, 0.32788848876953125, 0.1602647453546524, 0.12362765520811081, -0.06730765849351883, 0.03481525555253029, -0.027500133961439133, -0.046689245849847794, -0.023714687675237656, 0.17682373523712158, 0.11577922105789185, -0.030911579728126526, -0.15310265123844147, 0.08720867335796356, -0.013301078230142593, 0.14704596996307373, 0.15309973061084747, -0.014803078025579453, 0.21028298139572144, 0.058304544538259506, 0.4386035203933716, 0.5575242042541504, -0.3776146471500397, -0.04234226047992706, 0.13237407803535461, 0.15778294205665588, 0.09365571290254593, -0.14579038321971893, 0.25162678956985474, 0.25162380933761597, 0.03856158256530762, 0.2524571418762207, -0.01129506528377533, -0.23173591494560242, -0.4700376093387604, -0.026204753667116165, 0.39857950806617737, -0.18349948525428772, 0.4310579299926758, 0.7228632569313049, -0.24229802191257477, 0.14399424195289612, -0.05677139759063721, 0.0731402039527893, 0.2898188829421997, 0.8885343074798584, 0.27466779947280884, 0.35076022148132324, 0.18639712035655975, -0.08513236045837402, 0.3208283483982086, -0.1372627317905426, -0.037187036126852036, 0.03724813833832741, -0.18039429187774658, 0.14459708333015442, 0.10519582033157349, 0.16546620428562164, -0.3028135299682617, -0.08456061780452728, -0.14227379858493805, -0.25275903940200806, -0.2079099416732788, -0.048359788954257965, -0.2600691616535187, -0.17261509597301483, 0.03913968801498413, -0.10115860402584076, 0.009206253103911877, -0.08048443496227264, 0.30277061462402344, 0.009021330624818802, -0.08461077511310577, -0.23522964119911194, 0.14280903339385986, -0.04635672643780708, 0.013361632823944092, -0.06034873425960541, 0.015069430693984032, 0.2781824469566345, -0.12854984402656555, 0.3062453269958496, -0.022565670311450958, 0.23885512351989746, 0.3733918368816376, 0.010020032525062561, -0.38340508937835693, 0.172305166721344, -0.2020755410194397, -0.1351444125175476, 0.14776942133903503, -0.093159981071949, -0.09875474870204926, 0.28338053822517395, 0.19291046261787415, -0.06254339218139648, 0.25105512142181396, 0.3184843957424164, 0.4367349445819855, -0.6251232028007507, 0.4865635335445404, -0.06933936476707458, 0.043966881930828094, 0.2310681790113449, 0.04452423378825188, -0.44525521993637085, -0.4097781777381897, 0.21643517911434174, 0.14147792756557465, 0.038524724543094635, -0.04980269819498062, 0.05867798626422882, -0.07865431159734726, 0.014646648429334164, -0.15525299310684204, 0.16094562411308289, -0.14563728868961334, 0.035045087337493896, -0.1338047981262207, 0.15087327361106873, 0.016555199399590492, -0.016907256096601486, -0.22914505004882812, 0.19153951108455658, -0.04100438952445984, -0.16563081741333008, 0.06675854325294495, 0.016559135168790817, -0.074929378926754, 0.2781085968017578, -0.2666741609573364, -0.36876118183135986, 0.026002109050750732, -0.08929935842752457, 0.04830962419509888, -0.28238996863365173, 0.24082571268081665, 0.20532536506652832, 0.004648052155971527, -0.05010537803173065, 0.07535132765769958, 0.35818153619766235, -0.014737028628587723, 0.10642965137958527, 0.3212725520133972, 0.41303056478500366, -0.1594240665435791, -0.13929033279418945, -0.16939567029476166, -0.14516714215278625, -0.23757191002368927, 0.21099865436553955, -0.3647029995918274, 0.34100544452667236, -0.29784873127937317, 0.2758696675300598, -0.15421661734580994, -0.17759716510772705, 0.017881035804748535, -0.05211114138364792, -0.30518609285354614, 0.02081986516714096, -0.16043569147586823, 0.05442695692181587, 0.12480147182941437, 0.31187230348587036, 0.024142175912857056, -0.09892420470714569, -0.018473252654075623, -0.1486516296863556, 0.3422379791736603, -0.26208925247192383, -0.40317946672439575, -0.17057353258132935, 0.003151439130306244, -0.3165455460548401, -0.15261226892471313, -0.4847312569618225, -0.27857810258865356, 0.34730589389801025, -0.10833136737346649, -0.2698606252670288, 0.03580990806221962, 0.07321224361658096, 0.051343247294425964, -0.019836612045764923, 0.20311762392520905, 0.0977335125207901, -0.3768024444580078, 0.3077375888824463, -0.3277127742767334 ]
https://github.com/huggingface/datasets/issues/5777
Note: I listed the datasets and grepped around to find what appears to be an alternative source for this: raw_datasets = load_dataset("espejelomar/code_search_net_python_10000_examples", "python")
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory
### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios.
23
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory ### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios. Note: I listed the datasets and grepped around to find what appears to be an alternative source for this: raw_datasets = load_dataset("espejelomar/code_search_net_python_10000_examples", "python")
[ -0.2291666567325592, 0.13596121966838837, 0.016966447234153748, 0.1255396157503128, 0.23950935900211334, -0.1594688445329666, 0.23064634203910828, 0.03346320241689682, -0.04735599458217621, 0.33694255352020264, -0.27385422587394714, 0.015452004969120026, -0.19089925289154053, -0.16640180349349976, 0.1513800472021103, -0.06317554414272308, 0.09574951231479645, 0.09330624341964722, -0.008679449558258057, -0.048472680151462555, -0.09783363342285156, 0.39403387904167175, -0.05456143617630005, 0.1810181885957718, -0.5094263553619385, -0.1111624538898468, -0.17674162983894348, 0.32273632287979126, -0.2871543765068054, -0.5348667502403259, 0.30543357133865356, 0.017012331634759903, 0.19407950341701508, 0.6149795055389404, -0.0001224726438522339, 0.12428542226552963, 0.16613321006298065, -0.017217416316270828, -0.39544063806533813, -0.6462113857269287, 0.33929431438446045, -0.15656104683876038, 0.23227772116661072, -0.11789616197347641, 0.22600987553596497, -0.326718270778656, 0.2038971483707428, 0.19730915129184723, 0.4099944531917572, 0.3653506338596344, 0.10382287204265594, 0.5196618437767029, -0.030788615345954895, -0.06189659237861633, 0.0545792318880558, 0.2602349519729614, -0.13143830001354218, 0.3335252106189728, 0.03558839112520218, 0.16408595442771912, 0.04268297925591469, 0.07739563286304474, -0.002363137900829315, -0.009960024617612362, 0.3371690809726715, 0.2264517843723297, -0.1856069713830948, -0.4749982953071594, -0.0049710520543158054, 0.15720558166503906, 0.3728221356868744, -0.14892327785491943, -0.3751625418663025, -0.27854329347610474, -0.18319565057754517, -0.15340059995651245, 0.39120030403137207, 0.2932131588459015, -0.23329080641269684, 0.10796438902616501, -0.11423679441213608, -0.004018530249595642, -0.012433841824531555, 0.298173189163208, -0.2910687327384949, 0.4334898889064789, -0.10893205553293228, -0.04473080858588219, -0.013288114219903946, -0.1482861042022705, -0.09272129088640213, -0.08666602522134781, 0.21681994199752808, 0.33834168314933777, -0.05750110372900963, 0.10879561305046082, 0.02015550248324871, -0.3514934480190277, 0.11573942005634308, 0.4525846838951111, -0.17159566283226013, -0.20773011445999146, -0.3829086124897003, 0.12261565774679184, -0.0015742983669042587, 0.23210567235946655, -0.16964375972747803, 0.3452661633491516, 0.31962770223617554, 0.15762777626514435, 0.14512452483177185, -0.12396948039531708, -0.23828735947608948, -0.08426356315612793, -0.11856186389923096, -0.2799220383167267, 0.29996374249458313, -0.09307359904050827, -0.5391836166381836, 0.18192820250988007, -0.7570893168449402, 0.06755618751049042, 0.17795294523239136, 0.4904649555683136, 0.10003435611724854, -0.19043490290641785, 0.16034987568855286, 0.4560098648071289, -0.06958342343568802, 0.10495089739561081, -0.24160006642341614, 0.12598784267902374, -0.019024766981601715, -0.012045776471495628, 0.13657337427139282, -0.07504408806562424, 0.4599323272705078, 0.05618740990757942, 0.15540392696857452, -0.25464174151420593, 0.2131628692150116, 0.06030404940247536, 0.008212905377149582, 0.47612470388412476, 0.14618316292762756, 0.05601855367422104, 0.18600252270698547, -0.365977019071579, -0.23516707122325897, -0.034735437482595444, -0.11317993700504303, -0.3255240321159363, -0.07033631205558777, 0.047666434198617935, -0.06120254099369049, -0.07794974744319916, -0.15293854475021362, -0.08131000399589539, -0.0873413011431694, 0.20857521891593933, 0.17141187191009521, -0.02476062998175621, -0.08461011946201324, -0.07628628611564636, 0.27940472960472107, 0.4686322808265686, 0.07497335970401764, -0.3941536545753479, 0.23507213592529297, -0.025491898879408836, 0.2667554020881653, 0.318886935710907, -0.21131139993667603, 0.578997015953064, -0.5207041501998901, 0.6564397811889648, 0.38747233152389526, -0.46027523279190063, -0.3523927330970764, 0.24388282001018524, -0.3735600411891937, 0.022598013281822205, 0.20080053806304932, -0.07051359117031097, 0.01913207769393921, -0.06979450583457947, 0.23008713126182556, 0.17789505422115326, 0.24273501336574554, 0.09636964648962021, -0.22445093095302582, -0.12760724127292633, -0.0802106112241745, 0.08749429136514664, 0.3174613416194916, 0.038825873285532, -0.03567302227020264, -0.031411293894052505, 0.25787609815597534, -0.353694885969162, -0.10630805790424347, 0.15032896399497986, 0.2629780173301697, 0.30295050144195557, -0.17553603649139404, 0.15521088242530823, -0.18061669170856476, 0.02694912999868393, -0.11436998844146729, 0.13054856657981873, -0.3796938359737396, -0.30417266488075256, -0.16885390877723694, 0.09039466828107834, -0.29386037588119507, -0.2954518795013428, 0.03857746720314026, 0.004150247201323509, 0.0987650454044342, 0.30356070399284363, -0.1230030506849289, 0.35911908745765686, -0.1865277886390686, 0.5235785841941833, -0.03047117218375206, 0.3441409468650818, -0.08381974697113037, -0.058100245893001556, -0.09495632350444794, 0.10223162919282913, 0.26499611139297485, -0.2408665418624878, -0.12751546502113342, 0.543367326259613, -0.0809829831123352, -0.059045616537332535, -0.021880075335502625, 0.1496700942516327, 0.2547338306903839, 0.08954988420009613, 0.0784822553396225, 0.3460213840007782, 0.02619098499417305, 0.1234014555811882, 0.1411805897951126, 0.4686870574951172, 0.06376904249191284, 0.17469948530197144, 0.23607060313224792, 0.20461124181747437, 0.2776693105697632, 0.07014501094818115, -0.12451857328414917, 0.023845702409744263, 0.4976933002471924, -0.1605440080165863, 0.37444037199020386, -0.09681650251150131, -0.32229846715927124, -0.02178868278861046, -0.10012539476156235, -0.2670876383781433, 0.14457590878009796, 0.15182983875274658, -0.107874795794487, -0.07029484212398529, -0.06456944346427917, 0.2741732895374298, 0.4071727395057678, -0.01978587917983532, 0.09828335046768188, 0.23582832515239716, -0.149067223072052, -0.1719426065683365, 0.30632632970809937, 0.27663150429725647, -0.31802913546562195, 0.24931183457374573, 0.009095396846532822, 0.09114527702331543, -0.5007442235946655, -0.5671082139015198, -0.06616723537445068, 0.21976958215236664, -0.4655153155326843, 0.12564152479171753, -0.1962497979402542, -0.19706284999847412, -0.045210789889097214, -0.09550006687641144, -0.2503979802131653, -0.3649193346500397, 0.019590113312005997, 0.2619023621082306, -0.11219602823257446, 0.1368633508682251, -0.3071879744529724, -0.030063167214393616, -0.20067043602466583, 0.12331226468086243, -0.17855995893478394, 0.3237571120262146, -0.15526801347732544, -0.15166911482810974, 0.4393163025379181, -0.18951132893562317, 0.3247666656970978, -0.4657640755176544, -0.014500182121992111, -0.5366824865341187, -0.40079066157341003, 0.3505246639251709, 0.10990063846111298, 0.13933421671390533, 0.28342413902282715, -0.07802258431911469, -0.29906323552131653, -0.3282073438167572, 0.18342632055282593, -0.08689779043197632, -0.30407005548477173, 0.013191379606723785, -0.06044219434261322, -0.12801149487495422, -0.1244126409292221, -0.17884162068367004, -0.32197999954223633, -0.21195651590824127, 0.19206494092941284, 0.018818020820617676, 0.13027499616146088, 0.34338873624801636, -0.2562163770198822, 0.3226746618747711, -0.17217779159545898, 0.03143242746591568, -0.21888282895088196, -0.2553143799304962, 0.18681246042251587, -0.3242654800415039, -0.2780405879020691, 0.10759885609149933, -0.10722734034061432, 0.15889447927474976, 0.13018345832824707, -0.4168851375579834, -0.22284215688705444, -0.1782773733139038, 0.21078836917877197, -0.24387392401695251, 0.010297147557139397, 0.34174466133117676, -0.14256300032138824, -0.012380227446556091, 0.14677581191062927, 0.01668153703212738, 0.15012261271476746, -0.1446058303117752, 0.0064352452754974365, -0.16225838661193848, 0.3610289692878723, 0.12656524777412415, 0.8954418897628784, 0.028468430042266846, 0.08029487729072571, 0.50836580991745, -0.08674938231706619, 0.25782719254493713, -0.2565848231315613, -0.17304609715938568, -0.018441667780280113, 0.08567562699317932, -0.1940700113773346, 0.24378257989883423, 0.19121018052101135, 0.09291143715381622, 0.10018119215965271, -0.15539458394050598, -0.3963635563850403, -0.19695910811424255, 0.017088161781430244, -0.07410842180252075, 0.023147273808717728, 0.10676883161067963, 0.14806267619132996, -0.027535386383533478, 0.03135042265057564, -0.04097706824541092, 0.5300362706184387, 0.33898934721946716, 0.16136345267295837, -0.49652647972106934, -0.19068610668182373, -0.6719269752502441, 0.0469522550702095, 0.01851607859134674, 0.3005741834640503, -0.06409735977649689, 0.04374302178621292, 0.2722770571708679, -0.144023597240448, 0.7213546633720398, 0.2163858860731125, -0.115035280585289, -0.021843116730451584, -0.18671853840351105, -0.3569850027561188, -0.18386855721473694, -0.12187333405017853, 0.32902953028678894, 0.3811275064945221, 0.3139532804489136, -0.398075133562088, -0.2594982981681824, 0.2463313788175583, -0.14315856993198395, 0.027723215520381927, 0.03452518954873085, -0.1502949297428131, -0.4881633520126343, -0.48083314299583435, 0.14608491957187653, 0.2310623824596405, 0.06636129319667816, 0.14726966619491577, 0.09552381932735443, -0.060974158346652985, 0.0556580051779747, 0.04779853671789169, -0.09948381781578064, 0.34894904494285583, -0.19499441981315613, 0.22907699644565582, 0.24320854246616364, 0.19956998527050018, 0.38229140639305115, 0.43606922030448914, 0.17121534049510956, -0.35296982526779175, 0.17745432257652283, 0.11416471749544144, 0.11904303729534149, 0.5208637118339539, -0.15448740124702454, -0.05701511353254318, -0.15685829520225525, 0.3932008743286133, -0.11948490142822266, 0.22169175744056702, 0.433574378490448, -0.038387805223464966, -0.10488054156303406, -0.16778255999088287, 0.3734498918056488, 0.1618884950876236, 0.04195097088813782, 0.1495882272720337, 0.35986751317977905, -0.08454303443431854, 0.4255083501338959, -0.16380926966667175, 0.97613126039505, 0.13160578906536102, 0.4081469178199768, 0.5434989333152771, -0.018413543701171875, 0.4410015046596527, -0.5728182196617126, 0.043072935193777084, -0.20836582779884338, 0.05933958664536476, -0.2056346833705902, -0.24145914614200592, -0.0691412016749382, -0.0943194329738617, -0.15532706677913666, 0.24073266983032227, -0.16152028739452362, 0.2611120939254761, -0.0193141158670187, 0.30112382769584656, -0.5304641127586365, -0.16973543167114258, -0.19132202863693237, 0.028675150126218796, 0.19140402972698212, 0.4126545786857605, -0.3034095764160156, 0.14693918824195862, -0.39382287859916687, -0.384475976228714, -0.15287962555885315, 0.09394979476928711, -0.2513076961040497, 0.2986319363117218, 0.2507306933403015, -0.2060317099094391, -0.09786752611398697, 0.3789178729057312, 0.21595555543899536, -0.0621563196182251, -0.14140568673610687, 0.17231248319149017, -0.43194714188575745, -0.009536024183034897, 0.09935623407363892, -0.25586509704589844, 0.2651214301586151, -0.10615155845880508, -0.03176604211330414, -0.3233041763305664, -0.17463915050029755, -0.22185948491096497, -0.1564752459526062, -0.01492193341255188, 0.17020469903945923, -0.2591361999511719, -0.005418449640274048, 0.05589653551578522, -0.007316306233406067, -0.27962949872016907, -0.023515334352850914, 0.18089540302753448, -0.21445974707603455, -0.3885250389575958, 0.034320369362831116, -0.1974809467792511, -0.15462642908096313, 0.27191123366355896, -0.22604413330554962, -0.1711505502462387, 0.6532038450241089, -0.054265525192022324, -0.19401046633720398, -0.08140472322702408, 0.153188094496727, 0.19045333564281464, -0.41769611835479736, 0.24218803644180298, -0.21433478593826294, 0.03873942792415619, -0.35618460178375244, 0.317561537027359, 0.2141331285238266, -0.20832613110542297, -0.11579941213130951, -0.4311227798461914, -0.19413021206855774, 0.1256851702928543, -0.1167498379945755, 0.16974210739135742, -0.05417951941490173, 0.17941945791244507, -0.10836268216371536, -0.39890724420547485, -0.14915691316127777, 0.22536876797676086, -0.2624421715736389, -0.09605003893375397, -0.1802208572626114, -0.10314325988292694, 0.37135523557662964, -0.09565002471208572, 0.010516371577978134, 0.243362694978714, -0.24697789549827576, -0.0577201284468174, -0.3009079098701477, 0.19183649122714996, 0.27949997782707214, -0.26546332240104675, 0.23003336787223816, 0.2840431332588196, -0.16971281170845032, -0.12065324187278748, 0.044733814895153046, 0.4013015925884247, 0.06050959601998329, -0.21288134157657623, 0.2646506726741791, 0.09434114396572113, -0.173275887966156, -0.011355924420058727, 0.11684316396713257, 0.2239803820848465, 0.008158929646015167, 0.20094044506549835, -0.241968035697937, 0.003939718008041382, -0.18626080453395844, 0.23678186535835266, 0.1200823038816452, 0.13721217215061188, 0.06909202039241791, -0.3244309723377228, -0.03853733837604523, -0.10420449078083038, 0.35319986939430237, 0.4191434979438782, -0.3417018949985504, -0.0035484805703163147, 0.4474985897541046, 0.07763190567493439, 0.01586879789829254, -0.14472037553787231, 0.24896682798862457, -0.006371969357132912, -0.09180586785078049, 0.1843203604221344, 0.07312524318695068, -0.04503835737705231, 0.04520508646965027, 0.06958191096782684, 0.631730854511261, -0.031866274774074554, 0.18372206389904022, 0.1502341628074646, -0.13201172649860382, 0.43172454833984375, 0.36031705141067505, 0.06954683363437653, 0.23395468294620514, 0.3716771900653839, -0.3056158125400543, 0.1669425070285797, -0.17709024250507355, 0.14940598607063293, 0.0749766007065773, -0.3732910752296448, -0.2160263955593109, 0.1914072334766388, 0.15619544684886932, 0.11413595080375671, -0.12302593886852264, 0.3967437148094177, -0.2598850131034851, -0.11752955615520477, -0.2734735608100891, 0.3027580678462982, -0.25872737169265747, -0.10298599302768707, -0.19461548328399658, -0.24001947045326233, -0.1741306334733963, 0.07554970681667328, 0.016926473006606102, -0.2493305206298828, -0.3998246490955353, 0.13461795449256897, -0.14193864166736603, -0.3959451913833618, 0.20019865036010742, -0.0101018650457263, 0.030579958111047745, -0.24929791688919067, 0.2129848450422287, 0.13529115915298462, 0.04941798001527786, 0.06717894226312637, 0.4639756381511688, 0.7207574248313904, 0.18461990356445312, -0.000981885939836502, -0.023475175723433495, -0.30037662386894226, 0.12363740056753159, -0.04477618634700775, 0.08601740002632141, -0.05547075346112251, -0.033930085599422455, 0.21861709654331207, -0.013181254267692566, -0.13595646619796753, 0.009768379852175713, 0.2043135017156601, 0.21468010544776917, -0.006009135395288467, 0.4591095447540283, -0.5086727142333984, -0.005988895893096924, -0.030078450217843056, -0.06732503324747086, -0.37228572368621826, 0.20468541979789734, -0.043704695999622345, 0.0632900819182396, 0.299638569355011, -0.08685804903507233, 0.028764542192220688, -0.06076490879058838, 0.06040466949343681, 0.6372607946395874, 0.00983443297445774, -0.36765342950820923, -0.11625176668167114, -0.6337259411811829, 0.17763307690620422, -0.16935931146144867, -0.01785755157470703, -0.11428925395011902, 0.1993345469236374, -0.17996661365032196, 0.11249597370624542, 0.13060636818408966, 0.2017541527748108, -0.02181452140212059, 0.21944327652454376, -0.20255890488624573, -0.037339068949222565, -0.0021515749394893646, 0.09149505198001862, -0.009901002049446106, -0.1974540650844574, 0.10650648176670074, -0.3810036778450012, -0.09214325994253159, 0.1692202240228653, 0.023054227232933044, -0.166843980550766, -0.2761304974555969, 0.5048062801361084, 0.12378492951393127, 0.37748008966445923, -0.1326780617237091, -0.292996346950531, -0.17768330872058868, -0.13928070664405823, -0.272625595331192, 0.08126495778560638, -0.14182963967323303, 0.5394172072410583, -0.21683213114738464, -0.07436670362949371, -0.33084869384765625, 0.1465226262807846, 0.09978736937046051, -0.1540450155735016, -0.31596657633781433, 0.38453981280326843, -0.27865543961524963, 0.1972462236881256, 0.12348361313343048, 0.22850684821605682, -0.0824568122625351, 0.3881911337375641, -0.37762999534606934, -0.5395863056182861, 0.5919041037559509, -0.26256075501441956, -0.049774572253227234, -0.022961759939789772, 0.27725809812545776, 0.3707468509674072, -0.10555072128772736, -0.1821441799402237, 0.04876607656478882, 0.28907451033592224, 0.007615938782691956, -0.40671759843826294, -0.0344381146132946, 0.09067068994045258, -0.25247880816459656, -0.07507351040840149, 0.5715125203132629, 0.009335782378911972, -0.3330322206020355, 0.4231445789337158, -0.20632027089595795 ]
https://github.com/huggingface/datasets/issues/5777
Thanks for reporting, @jason-brian-anderson. Yes, this is a known issue: the [CodeSearchNet](https://github.com/github/CodeSearchNet) repo has been archived (Apr 11, 2023) and their source data files are no longer accessible in their S3: e.g. https://s3.amazonaws.com/code-search-net/CodeSearchNet/v2/python.zip gives 403 Forbidden error. See: - https://huggingface.co/datasets/code_search_net/discussions/3 We have contacted one of the authors of the dataset to find a solution. I'll keep you informed. CC: @hamelsmu
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory
### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios.
60
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory ### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios. Thanks for reporting, @jason-brian-anderson. Yes, this is a known issue: the [CodeSearchNet](https://github.com/github/CodeSearchNet) repo has been archived (Apr 11, 2023) and their source data files are no longer accessible in their S3: e.g. https://s3.amazonaws.com/code-search-net/CodeSearchNet/v2/python.zip gives 403 Forbidden error. See: - https://huggingface.co/datasets/code_search_net/discussions/3 We have contacted one of the authors of the dataset to find a solution. I'll keep you informed. CC: @hamelsmu
[ -0.2291666567325592, 0.13596121966838837, 0.016966447234153748, 0.1255396157503128, 0.23950935900211334, -0.1594688445329666, 0.23064634203910828, 0.03346320241689682, -0.04735599458217621, 0.33694255352020264, -0.27385422587394714, 0.015452004969120026, -0.19089925289154053, -0.16640180349349976, 0.1513800472021103, -0.06317554414272308, 0.09574951231479645, 0.09330624341964722, -0.008679449558258057, -0.048472680151462555, -0.09783363342285156, 0.39403387904167175, -0.05456143617630005, 0.1810181885957718, -0.5094263553619385, -0.1111624538898468, -0.17674162983894348, 0.32273632287979126, -0.2871543765068054, -0.5348667502403259, 0.30543357133865356, 0.017012331634759903, 0.19407950341701508, 0.6149795055389404, -0.0001224726438522339, 0.12428542226552963, 0.16613321006298065, -0.017217416316270828, -0.39544063806533813, -0.6462113857269287, 0.33929431438446045, -0.15656104683876038, 0.23227772116661072, -0.11789616197347641, 0.22600987553596497, -0.326718270778656, 0.2038971483707428, 0.19730915129184723, 0.4099944531917572, 0.3653506338596344, 0.10382287204265594, 0.5196618437767029, -0.030788615345954895, -0.06189659237861633, 0.0545792318880558, 0.2602349519729614, -0.13143830001354218, 0.3335252106189728, 0.03558839112520218, 0.16408595442771912, 0.04268297925591469, 0.07739563286304474, -0.002363137900829315, -0.009960024617612362, 0.3371690809726715, 0.2264517843723297, -0.1856069713830948, -0.4749982953071594, -0.0049710520543158054, 0.15720558166503906, 0.3728221356868744, -0.14892327785491943, -0.3751625418663025, -0.27854329347610474, -0.18319565057754517, -0.15340059995651245, 0.39120030403137207, 0.2932131588459015, -0.23329080641269684, 0.10796438902616501, -0.11423679441213608, -0.004018530249595642, -0.012433841824531555, 0.298173189163208, -0.2910687327384949, 0.4334898889064789, -0.10893205553293228, -0.04473080858588219, -0.013288114219903946, -0.1482861042022705, -0.09272129088640213, -0.08666602522134781, 0.21681994199752808, 0.33834168314933777, -0.05750110372900963, 0.10879561305046082, 0.02015550248324871, -0.3514934480190277, 0.11573942005634308, 0.4525846838951111, -0.17159566283226013, -0.20773011445999146, -0.3829086124897003, 0.12261565774679184, -0.0015742983669042587, 0.23210567235946655, -0.16964375972747803, 0.3452661633491516, 0.31962770223617554, 0.15762777626514435, 0.14512452483177185, -0.12396948039531708, -0.23828735947608948, -0.08426356315612793, -0.11856186389923096, -0.2799220383167267, 0.29996374249458313, -0.09307359904050827, -0.5391836166381836, 0.18192820250988007, -0.7570893168449402, 0.06755618751049042, 0.17795294523239136, 0.4904649555683136, 0.10003435611724854, -0.19043490290641785, 0.16034987568855286, 0.4560098648071289, -0.06958342343568802, 0.10495089739561081, -0.24160006642341614, 0.12598784267902374, -0.019024766981601715, -0.012045776471495628, 0.13657337427139282, -0.07504408806562424, 0.4599323272705078, 0.05618740990757942, 0.15540392696857452, -0.25464174151420593, 0.2131628692150116, 0.06030404940247536, 0.008212905377149582, 0.47612470388412476, 0.14618316292762756, 0.05601855367422104, 0.18600252270698547, -0.365977019071579, -0.23516707122325897, -0.034735437482595444, -0.11317993700504303, -0.3255240321159363, -0.07033631205558777, 0.047666434198617935, -0.06120254099369049, -0.07794974744319916, -0.15293854475021362, -0.08131000399589539, -0.0873413011431694, 0.20857521891593933, 0.17141187191009521, -0.02476062998175621, -0.08461011946201324, -0.07628628611564636, 0.27940472960472107, 0.4686322808265686, 0.07497335970401764, -0.3941536545753479, 0.23507213592529297, -0.025491898879408836, 0.2667554020881653, 0.318886935710907, -0.21131139993667603, 0.578997015953064, -0.5207041501998901, 0.6564397811889648, 0.38747233152389526, -0.46027523279190063, -0.3523927330970764, 0.24388282001018524, -0.3735600411891937, 0.022598013281822205, 0.20080053806304932, -0.07051359117031097, 0.01913207769393921, -0.06979450583457947, 0.23008713126182556, 0.17789505422115326, 0.24273501336574554, 0.09636964648962021, -0.22445093095302582, -0.12760724127292633, -0.0802106112241745, 0.08749429136514664, 0.3174613416194916, 0.038825873285532, -0.03567302227020264, -0.031411293894052505, 0.25787609815597534, -0.353694885969162, -0.10630805790424347, 0.15032896399497986, 0.2629780173301697, 0.30295050144195557, -0.17553603649139404, 0.15521088242530823, -0.18061669170856476, 0.02694912999868393, -0.11436998844146729, 0.13054856657981873, -0.3796938359737396, -0.30417266488075256, -0.16885390877723694, 0.09039466828107834, -0.29386037588119507, -0.2954518795013428, 0.03857746720314026, 0.004150247201323509, 0.0987650454044342, 0.30356070399284363, -0.1230030506849289, 0.35911908745765686, -0.1865277886390686, 0.5235785841941833, -0.03047117218375206, 0.3441409468650818, -0.08381974697113037, -0.058100245893001556, -0.09495632350444794, 0.10223162919282913, 0.26499611139297485, -0.2408665418624878, -0.12751546502113342, 0.543367326259613, -0.0809829831123352, -0.059045616537332535, -0.021880075335502625, 0.1496700942516327, 0.2547338306903839, 0.08954988420009613, 0.0784822553396225, 0.3460213840007782, 0.02619098499417305, 0.1234014555811882, 0.1411805897951126, 0.4686870574951172, 0.06376904249191284, 0.17469948530197144, 0.23607060313224792, 0.20461124181747437, 0.2776693105697632, 0.07014501094818115, -0.12451857328414917, 0.023845702409744263, 0.4976933002471924, -0.1605440080165863, 0.37444037199020386, -0.09681650251150131, -0.32229846715927124, -0.02178868278861046, -0.10012539476156235, -0.2670876383781433, 0.14457590878009796, 0.15182983875274658, -0.107874795794487, -0.07029484212398529, -0.06456944346427917, 0.2741732895374298, 0.4071727395057678, -0.01978587917983532, 0.09828335046768188, 0.23582832515239716, -0.149067223072052, -0.1719426065683365, 0.30632632970809937, 0.27663150429725647, -0.31802913546562195, 0.24931183457374573, 0.009095396846532822, 0.09114527702331543, -0.5007442235946655, -0.5671082139015198, -0.06616723537445068, 0.21976958215236664, -0.4655153155326843, 0.12564152479171753, -0.1962497979402542, -0.19706284999847412, -0.045210789889097214, -0.09550006687641144, -0.2503979802131653, -0.3649193346500397, 0.019590113312005997, 0.2619023621082306, -0.11219602823257446, 0.1368633508682251, -0.3071879744529724, -0.030063167214393616, -0.20067043602466583, 0.12331226468086243, -0.17855995893478394, 0.3237571120262146, -0.15526801347732544, -0.15166911482810974, 0.4393163025379181, -0.18951132893562317, 0.3247666656970978, -0.4657640755176544, -0.014500182121992111, -0.5366824865341187, -0.40079066157341003, 0.3505246639251709, 0.10990063846111298, 0.13933421671390533, 0.28342413902282715, -0.07802258431911469, -0.29906323552131653, -0.3282073438167572, 0.18342632055282593, -0.08689779043197632, -0.30407005548477173, 0.013191379606723785, -0.06044219434261322, -0.12801149487495422, -0.1244126409292221, -0.17884162068367004, -0.32197999954223633, -0.21195651590824127, 0.19206494092941284, 0.018818020820617676, 0.13027499616146088, 0.34338873624801636, -0.2562163770198822, 0.3226746618747711, -0.17217779159545898, 0.03143242746591568, -0.21888282895088196, -0.2553143799304962, 0.18681246042251587, -0.3242654800415039, -0.2780405879020691, 0.10759885609149933, -0.10722734034061432, 0.15889447927474976, 0.13018345832824707, -0.4168851375579834, -0.22284215688705444, -0.1782773733139038, 0.21078836917877197, -0.24387392401695251, 0.010297147557139397, 0.34174466133117676, -0.14256300032138824, -0.012380227446556091, 0.14677581191062927, 0.01668153703212738, 0.15012261271476746, -0.1446058303117752, 0.0064352452754974365, -0.16225838661193848, 0.3610289692878723, 0.12656524777412415, 0.8954418897628784, 0.028468430042266846, 0.08029487729072571, 0.50836580991745, -0.08674938231706619, 0.25782719254493713, -0.2565848231315613, -0.17304609715938568, -0.018441667780280113, 0.08567562699317932, -0.1940700113773346, 0.24378257989883423, 0.19121018052101135, 0.09291143715381622, 0.10018119215965271, -0.15539458394050598, -0.3963635563850403, -0.19695910811424255, 0.017088161781430244, -0.07410842180252075, 0.023147273808717728, 0.10676883161067963, 0.14806267619132996, -0.027535386383533478, 0.03135042265057564, -0.04097706824541092, 0.5300362706184387, 0.33898934721946716, 0.16136345267295837, -0.49652647972106934, -0.19068610668182373, -0.6719269752502441, 0.0469522550702095, 0.01851607859134674, 0.3005741834640503, -0.06409735977649689, 0.04374302178621292, 0.2722770571708679, -0.144023597240448, 0.7213546633720398, 0.2163858860731125, -0.115035280585289, -0.021843116730451584, -0.18671853840351105, -0.3569850027561188, -0.18386855721473694, -0.12187333405017853, 0.32902953028678894, 0.3811275064945221, 0.3139532804489136, -0.398075133562088, -0.2594982981681824, 0.2463313788175583, -0.14315856993198395, 0.027723215520381927, 0.03452518954873085, -0.1502949297428131, -0.4881633520126343, -0.48083314299583435, 0.14608491957187653, 0.2310623824596405, 0.06636129319667816, 0.14726966619491577, 0.09552381932735443, -0.060974158346652985, 0.0556580051779747, 0.04779853671789169, -0.09948381781578064, 0.34894904494285583, -0.19499441981315613, 0.22907699644565582, 0.24320854246616364, 0.19956998527050018, 0.38229140639305115, 0.43606922030448914, 0.17121534049510956, -0.35296982526779175, 0.17745432257652283, 0.11416471749544144, 0.11904303729534149, 0.5208637118339539, -0.15448740124702454, -0.05701511353254318, -0.15685829520225525, 0.3932008743286133, -0.11948490142822266, 0.22169175744056702, 0.433574378490448, -0.038387805223464966, -0.10488054156303406, -0.16778255999088287, 0.3734498918056488, 0.1618884950876236, 0.04195097088813782, 0.1495882272720337, 0.35986751317977905, -0.08454303443431854, 0.4255083501338959, -0.16380926966667175, 0.97613126039505, 0.13160578906536102, 0.4081469178199768, 0.5434989333152771, -0.018413543701171875, 0.4410015046596527, -0.5728182196617126, 0.043072935193777084, -0.20836582779884338, 0.05933958664536476, -0.2056346833705902, -0.24145914614200592, -0.0691412016749382, -0.0943194329738617, -0.15532706677913666, 0.24073266983032227, -0.16152028739452362, 0.2611120939254761, -0.0193141158670187, 0.30112382769584656, -0.5304641127586365, -0.16973543167114258, -0.19132202863693237, 0.028675150126218796, 0.19140402972698212, 0.4126545786857605, -0.3034095764160156, 0.14693918824195862, -0.39382287859916687, -0.384475976228714, -0.15287962555885315, 0.09394979476928711, -0.2513076961040497, 0.2986319363117218, 0.2507306933403015, -0.2060317099094391, -0.09786752611398697, 0.3789178729057312, 0.21595555543899536, -0.0621563196182251, -0.14140568673610687, 0.17231248319149017, -0.43194714188575745, -0.009536024183034897, 0.09935623407363892, -0.25586509704589844, 0.2651214301586151, -0.10615155845880508, -0.03176604211330414, -0.3233041763305664, -0.17463915050029755, -0.22185948491096497, -0.1564752459526062, -0.01492193341255188, 0.17020469903945923, -0.2591361999511719, -0.005418449640274048, 0.05589653551578522, -0.007316306233406067, -0.27962949872016907, -0.023515334352850914, 0.18089540302753448, -0.21445974707603455, -0.3885250389575958, 0.034320369362831116, -0.1974809467792511, -0.15462642908096313, 0.27191123366355896, -0.22604413330554962, -0.1711505502462387, 0.6532038450241089, -0.054265525192022324, -0.19401046633720398, -0.08140472322702408, 0.153188094496727, 0.19045333564281464, -0.41769611835479736, 0.24218803644180298, -0.21433478593826294, 0.03873942792415619, -0.35618460178375244, 0.317561537027359, 0.2141331285238266, -0.20832613110542297, -0.11579941213130951, -0.4311227798461914, -0.19413021206855774, 0.1256851702928543, -0.1167498379945755, 0.16974210739135742, -0.05417951941490173, 0.17941945791244507, -0.10836268216371536, -0.39890724420547485, -0.14915691316127777, 0.22536876797676086, -0.2624421715736389, -0.09605003893375397, -0.1802208572626114, -0.10314325988292694, 0.37135523557662964, -0.09565002471208572, 0.010516371577978134, 0.243362694978714, -0.24697789549827576, -0.0577201284468174, -0.3009079098701477, 0.19183649122714996, 0.27949997782707214, -0.26546332240104675, 0.23003336787223816, 0.2840431332588196, -0.16971281170845032, -0.12065324187278748, 0.044733814895153046, 0.4013015925884247, 0.06050959601998329, -0.21288134157657623, 0.2646506726741791, 0.09434114396572113, -0.173275887966156, -0.011355924420058727, 0.11684316396713257, 0.2239803820848465, 0.008158929646015167, 0.20094044506549835, -0.241968035697937, 0.003939718008041382, -0.18626080453395844, 0.23678186535835266, 0.1200823038816452, 0.13721217215061188, 0.06909202039241791, -0.3244309723377228, -0.03853733837604523, -0.10420449078083038, 0.35319986939430237, 0.4191434979438782, -0.3417018949985504, -0.0035484805703163147, 0.4474985897541046, 0.07763190567493439, 0.01586879789829254, -0.14472037553787231, 0.24896682798862457, -0.006371969357132912, -0.09180586785078049, 0.1843203604221344, 0.07312524318695068, -0.04503835737705231, 0.04520508646965027, 0.06958191096782684, 0.631730854511261, -0.031866274774074554, 0.18372206389904022, 0.1502341628074646, -0.13201172649860382, 0.43172454833984375, 0.36031705141067505, 0.06954683363437653, 0.23395468294620514, 0.3716771900653839, -0.3056158125400543, 0.1669425070285797, -0.17709024250507355, 0.14940598607063293, 0.0749766007065773, -0.3732910752296448, -0.2160263955593109, 0.1914072334766388, 0.15619544684886932, 0.11413595080375671, -0.12302593886852264, 0.3967437148094177, -0.2598850131034851, -0.11752955615520477, -0.2734735608100891, 0.3027580678462982, -0.25872737169265747, -0.10298599302768707, -0.19461548328399658, -0.24001947045326233, -0.1741306334733963, 0.07554970681667328, 0.016926473006606102, -0.2493305206298828, -0.3998246490955353, 0.13461795449256897, -0.14193864166736603, -0.3959451913833618, 0.20019865036010742, -0.0101018650457263, 0.030579958111047745, -0.24929791688919067, 0.2129848450422287, 0.13529115915298462, 0.04941798001527786, 0.06717894226312637, 0.4639756381511688, 0.7207574248313904, 0.18461990356445312, -0.000981885939836502, -0.023475175723433495, -0.30037662386894226, 0.12363740056753159, -0.04477618634700775, 0.08601740002632141, -0.05547075346112251, -0.033930085599422455, 0.21861709654331207, -0.013181254267692566, -0.13595646619796753, 0.009768379852175713, 0.2043135017156601, 0.21468010544776917, -0.006009135395288467, 0.4591095447540283, -0.5086727142333984, -0.005988895893096924, -0.030078450217843056, -0.06732503324747086, -0.37228572368621826, 0.20468541979789734, -0.043704695999622345, 0.0632900819182396, 0.299638569355011, -0.08685804903507233, 0.028764542192220688, -0.06076490879058838, 0.06040466949343681, 0.6372607946395874, 0.00983443297445774, -0.36765342950820923, -0.11625176668167114, -0.6337259411811829, 0.17763307690620422, -0.16935931146144867, -0.01785755157470703, -0.11428925395011902, 0.1993345469236374, -0.17996661365032196, 0.11249597370624542, 0.13060636818408966, 0.2017541527748108, -0.02181452140212059, 0.21944327652454376, -0.20255890488624573, -0.037339068949222565, -0.0021515749394893646, 0.09149505198001862, -0.009901002049446106, -0.1974540650844574, 0.10650648176670074, -0.3810036778450012, -0.09214325994253159, 0.1692202240228653, 0.023054227232933044, -0.166843980550766, -0.2761304974555969, 0.5048062801361084, 0.12378492951393127, 0.37748008966445923, -0.1326780617237091, -0.292996346950531, -0.17768330872058868, -0.13928070664405823, -0.272625595331192, 0.08126495778560638, -0.14182963967323303, 0.5394172072410583, -0.21683213114738464, -0.07436670362949371, -0.33084869384765625, 0.1465226262807846, 0.09978736937046051, -0.1540450155735016, -0.31596657633781433, 0.38453981280326843, -0.27865543961524963, 0.1972462236881256, 0.12348361313343048, 0.22850684821605682, -0.0824568122625351, 0.3881911337375641, -0.37762999534606934, -0.5395863056182861, 0.5919041037559509, -0.26256075501441956, -0.049774572253227234, -0.022961759939789772, 0.27725809812545776, 0.3707468509674072, -0.10555072128772736, -0.1821441799402237, 0.04876607656478882, 0.28907451033592224, 0.007615938782691956, -0.40671759843826294, -0.0344381146132946, 0.09067068994045258, -0.25247880816459656, -0.07507351040840149, 0.5715125203132629, 0.009335782378911972, -0.3330322206020355, 0.4231445789337158, -0.20632027089595795 ]
https://github.com/huggingface/datasets/issues/5777
This issue is fixed because we are hosting the CodeSearchNet data files in the Hugging Face Hub. See: https://huggingface.co/datasets/code_search_net/discussions/7
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory
### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios.
19
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory ### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios. This issue is fixed because we are hosting the CodeSearchNet data files in the Hugging Face Hub. See: https://huggingface.co/datasets/code_search_net/discussions/7
[ -0.2291666567325592, 0.13596121966838837, 0.016966447234153748, 0.1255396157503128, 0.23950935900211334, -0.1594688445329666, 0.23064634203910828, 0.03346320241689682, -0.04735599458217621, 0.33694255352020264, -0.27385422587394714, 0.015452004969120026, -0.19089925289154053, -0.16640180349349976, 0.1513800472021103, -0.06317554414272308, 0.09574951231479645, 0.09330624341964722, -0.008679449558258057, -0.048472680151462555, -0.09783363342285156, 0.39403387904167175, -0.05456143617630005, 0.1810181885957718, -0.5094263553619385, -0.1111624538898468, -0.17674162983894348, 0.32273632287979126, -0.2871543765068054, -0.5348667502403259, 0.30543357133865356, 0.017012331634759903, 0.19407950341701508, 0.6149795055389404, -0.0001224726438522339, 0.12428542226552963, 0.16613321006298065, -0.017217416316270828, -0.39544063806533813, -0.6462113857269287, 0.33929431438446045, -0.15656104683876038, 0.23227772116661072, -0.11789616197347641, 0.22600987553596497, -0.326718270778656, 0.2038971483707428, 0.19730915129184723, 0.4099944531917572, 0.3653506338596344, 0.10382287204265594, 0.5196618437767029, -0.030788615345954895, -0.06189659237861633, 0.0545792318880558, 0.2602349519729614, -0.13143830001354218, 0.3335252106189728, 0.03558839112520218, 0.16408595442771912, 0.04268297925591469, 0.07739563286304474, -0.002363137900829315, -0.009960024617612362, 0.3371690809726715, 0.2264517843723297, -0.1856069713830948, -0.4749982953071594, -0.0049710520543158054, 0.15720558166503906, 0.3728221356868744, -0.14892327785491943, -0.3751625418663025, -0.27854329347610474, -0.18319565057754517, -0.15340059995651245, 0.39120030403137207, 0.2932131588459015, -0.23329080641269684, 0.10796438902616501, -0.11423679441213608, -0.004018530249595642, -0.012433841824531555, 0.298173189163208, -0.2910687327384949, 0.4334898889064789, -0.10893205553293228, -0.04473080858588219, -0.013288114219903946, -0.1482861042022705, -0.09272129088640213, -0.08666602522134781, 0.21681994199752808, 0.33834168314933777, -0.05750110372900963, 0.10879561305046082, 0.02015550248324871, -0.3514934480190277, 0.11573942005634308, 0.4525846838951111, -0.17159566283226013, -0.20773011445999146, -0.3829086124897003, 0.12261565774679184, -0.0015742983669042587, 0.23210567235946655, -0.16964375972747803, 0.3452661633491516, 0.31962770223617554, 0.15762777626514435, 0.14512452483177185, -0.12396948039531708, -0.23828735947608948, -0.08426356315612793, -0.11856186389923096, -0.2799220383167267, 0.29996374249458313, -0.09307359904050827, -0.5391836166381836, 0.18192820250988007, -0.7570893168449402, 0.06755618751049042, 0.17795294523239136, 0.4904649555683136, 0.10003435611724854, -0.19043490290641785, 0.16034987568855286, 0.4560098648071289, -0.06958342343568802, 0.10495089739561081, -0.24160006642341614, 0.12598784267902374, -0.019024766981601715, -0.012045776471495628, 0.13657337427139282, -0.07504408806562424, 0.4599323272705078, 0.05618740990757942, 0.15540392696857452, -0.25464174151420593, 0.2131628692150116, 0.06030404940247536, 0.008212905377149582, 0.47612470388412476, 0.14618316292762756, 0.05601855367422104, 0.18600252270698547, -0.365977019071579, -0.23516707122325897, -0.034735437482595444, -0.11317993700504303, -0.3255240321159363, -0.07033631205558777, 0.047666434198617935, -0.06120254099369049, -0.07794974744319916, -0.15293854475021362, -0.08131000399589539, -0.0873413011431694, 0.20857521891593933, 0.17141187191009521, -0.02476062998175621, -0.08461011946201324, -0.07628628611564636, 0.27940472960472107, 0.4686322808265686, 0.07497335970401764, -0.3941536545753479, 0.23507213592529297, -0.025491898879408836, 0.2667554020881653, 0.318886935710907, -0.21131139993667603, 0.578997015953064, -0.5207041501998901, 0.6564397811889648, 0.38747233152389526, -0.46027523279190063, -0.3523927330970764, 0.24388282001018524, -0.3735600411891937, 0.022598013281822205, 0.20080053806304932, -0.07051359117031097, 0.01913207769393921, -0.06979450583457947, 0.23008713126182556, 0.17789505422115326, 0.24273501336574554, 0.09636964648962021, -0.22445093095302582, -0.12760724127292633, -0.0802106112241745, 0.08749429136514664, 0.3174613416194916, 0.038825873285532, -0.03567302227020264, -0.031411293894052505, 0.25787609815597534, -0.353694885969162, -0.10630805790424347, 0.15032896399497986, 0.2629780173301697, 0.30295050144195557, -0.17553603649139404, 0.15521088242530823, -0.18061669170856476, 0.02694912999868393, -0.11436998844146729, 0.13054856657981873, -0.3796938359737396, -0.30417266488075256, -0.16885390877723694, 0.09039466828107834, -0.29386037588119507, -0.2954518795013428, 0.03857746720314026, 0.004150247201323509, 0.0987650454044342, 0.30356070399284363, -0.1230030506849289, 0.35911908745765686, -0.1865277886390686, 0.5235785841941833, -0.03047117218375206, 0.3441409468650818, -0.08381974697113037, -0.058100245893001556, -0.09495632350444794, 0.10223162919282913, 0.26499611139297485, -0.2408665418624878, -0.12751546502113342, 0.543367326259613, -0.0809829831123352, -0.059045616537332535, -0.021880075335502625, 0.1496700942516327, 0.2547338306903839, 0.08954988420009613, 0.0784822553396225, 0.3460213840007782, 0.02619098499417305, 0.1234014555811882, 0.1411805897951126, 0.4686870574951172, 0.06376904249191284, 0.17469948530197144, 0.23607060313224792, 0.20461124181747437, 0.2776693105697632, 0.07014501094818115, -0.12451857328414917, 0.023845702409744263, 0.4976933002471924, -0.1605440080165863, 0.37444037199020386, -0.09681650251150131, -0.32229846715927124, -0.02178868278861046, -0.10012539476156235, -0.2670876383781433, 0.14457590878009796, 0.15182983875274658, -0.107874795794487, -0.07029484212398529, -0.06456944346427917, 0.2741732895374298, 0.4071727395057678, -0.01978587917983532, 0.09828335046768188, 0.23582832515239716, -0.149067223072052, -0.1719426065683365, 0.30632632970809937, 0.27663150429725647, -0.31802913546562195, 0.24931183457374573, 0.009095396846532822, 0.09114527702331543, -0.5007442235946655, -0.5671082139015198, -0.06616723537445068, 0.21976958215236664, -0.4655153155326843, 0.12564152479171753, -0.1962497979402542, -0.19706284999847412, -0.045210789889097214, -0.09550006687641144, -0.2503979802131653, -0.3649193346500397, 0.019590113312005997, 0.2619023621082306, -0.11219602823257446, 0.1368633508682251, -0.3071879744529724, -0.030063167214393616, -0.20067043602466583, 0.12331226468086243, -0.17855995893478394, 0.3237571120262146, -0.15526801347732544, -0.15166911482810974, 0.4393163025379181, -0.18951132893562317, 0.3247666656970978, -0.4657640755176544, -0.014500182121992111, -0.5366824865341187, -0.40079066157341003, 0.3505246639251709, 0.10990063846111298, 0.13933421671390533, 0.28342413902282715, -0.07802258431911469, -0.29906323552131653, -0.3282073438167572, 0.18342632055282593, -0.08689779043197632, -0.30407005548477173, 0.013191379606723785, -0.06044219434261322, -0.12801149487495422, -0.1244126409292221, -0.17884162068367004, -0.32197999954223633, -0.21195651590824127, 0.19206494092941284, 0.018818020820617676, 0.13027499616146088, 0.34338873624801636, -0.2562163770198822, 0.3226746618747711, -0.17217779159545898, 0.03143242746591568, -0.21888282895088196, -0.2553143799304962, 0.18681246042251587, -0.3242654800415039, -0.2780405879020691, 0.10759885609149933, -0.10722734034061432, 0.15889447927474976, 0.13018345832824707, -0.4168851375579834, -0.22284215688705444, -0.1782773733139038, 0.21078836917877197, -0.24387392401695251, 0.010297147557139397, 0.34174466133117676, -0.14256300032138824, -0.012380227446556091, 0.14677581191062927, 0.01668153703212738, 0.15012261271476746, -0.1446058303117752, 0.0064352452754974365, -0.16225838661193848, 0.3610289692878723, 0.12656524777412415, 0.8954418897628784, 0.028468430042266846, 0.08029487729072571, 0.50836580991745, -0.08674938231706619, 0.25782719254493713, -0.2565848231315613, -0.17304609715938568, -0.018441667780280113, 0.08567562699317932, -0.1940700113773346, 0.24378257989883423, 0.19121018052101135, 0.09291143715381622, 0.10018119215965271, -0.15539458394050598, -0.3963635563850403, -0.19695910811424255, 0.017088161781430244, -0.07410842180252075, 0.023147273808717728, 0.10676883161067963, 0.14806267619132996, -0.027535386383533478, 0.03135042265057564, -0.04097706824541092, 0.5300362706184387, 0.33898934721946716, 0.16136345267295837, -0.49652647972106934, -0.19068610668182373, -0.6719269752502441, 0.0469522550702095, 0.01851607859134674, 0.3005741834640503, -0.06409735977649689, 0.04374302178621292, 0.2722770571708679, -0.144023597240448, 0.7213546633720398, 0.2163858860731125, -0.115035280585289, -0.021843116730451584, -0.18671853840351105, -0.3569850027561188, -0.18386855721473694, -0.12187333405017853, 0.32902953028678894, 0.3811275064945221, 0.3139532804489136, -0.398075133562088, -0.2594982981681824, 0.2463313788175583, -0.14315856993198395, 0.027723215520381927, 0.03452518954873085, -0.1502949297428131, -0.4881633520126343, -0.48083314299583435, 0.14608491957187653, 0.2310623824596405, 0.06636129319667816, 0.14726966619491577, 0.09552381932735443, -0.060974158346652985, 0.0556580051779747, 0.04779853671789169, -0.09948381781578064, 0.34894904494285583, -0.19499441981315613, 0.22907699644565582, 0.24320854246616364, 0.19956998527050018, 0.38229140639305115, 0.43606922030448914, 0.17121534049510956, -0.35296982526779175, 0.17745432257652283, 0.11416471749544144, 0.11904303729534149, 0.5208637118339539, -0.15448740124702454, -0.05701511353254318, -0.15685829520225525, 0.3932008743286133, -0.11948490142822266, 0.22169175744056702, 0.433574378490448, -0.038387805223464966, -0.10488054156303406, -0.16778255999088287, 0.3734498918056488, 0.1618884950876236, 0.04195097088813782, 0.1495882272720337, 0.35986751317977905, -0.08454303443431854, 0.4255083501338959, -0.16380926966667175, 0.97613126039505, 0.13160578906536102, 0.4081469178199768, 0.5434989333152771, -0.018413543701171875, 0.4410015046596527, -0.5728182196617126, 0.043072935193777084, -0.20836582779884338, 0.05933958664536476, -0.2056346833705902, -0.24145914614200592, -0.0691412016749382, -0.0943194329738617, -0.15532706677913666, 0.24073266983032227, -0.16152028739452362, 0.2611120939254761, -0.0193141158670187, 0.30112382769584656, -0.5304641127586365, -0.16973543167114258, -0.19132202863693237, 0.028675150126218796, 0.19140402972698212, 0.4126545786857605, -0.3034095764160156, 0.14693918824195862, -0.39382287859916687, -0.384475976228714, -0.15287962555885315, 0.09394979476928711, -0.2513076961040497, 0.2986319363117218, 0.2507306933403015, -0.2060317099094391, -0.09786752611398697, 0.3789178729057312, 0.21595555543899536, -0.0621563196182251, -0.14140568673610687, 0.17231248319149017, -0.43194714188575745, -0.009536024183034897, 0.09935623407363892, -0.25586509704589844, 0.2651214301586151, -0.10615155845880508, -0.03176604211330414, -0.3233041763305664, -0.17463915050029755, -0.22185948491096497, -0.1564752459526062, -0.01492193341255188, 0.17020469903945923, -0.2591361999511719, -0.005418449640274048, 0.05589653551578522, -0.007316306233406067, -0.27962949872016907, -0.023515334352850914, 0.18089540302753448, -0.21445974707603455, -0.3885250389575958, 0.034320369362831116, -0.1974809467792511, -0.15462642908096313, 0.27191123366355896, -0.22604413330554962, -0.1711505502462387, 0.6532038450241089, -0.054265525192022324, -0.19401046633720398, -0.08140472322702408, 0.153188094496727, 0.19045333564281464, -0.41769611835479736, 0.24218803644180298, -0.21433478593826294, 0.03873942792415619, -0.35618460178375244, 0.317561537027359, 0.2141331285238266, -0.20832613110542297, -0.11579941213130951, -0.4311227798461914, -0.19413021206855774, 0.1256851702928543, -0.1167498379945755, 0.16974210739135742, -0.05417951941490173, 0.17941945791244507, -0.10836268216371536, -0.39890724420547485, -0.14915691316127777, 0.22536876797676086, -0.2624421715736389, -0.09605003893375397, -0.1802208572626114, -0.10314325988292694, 0.37135523557662964, -0.09565002471208572, 0.010516371577978134, 0.243362694978714, -0.24697789549827576, -0.0577201284468174, -0.3009079098701477, 0.19183649122714996, 0.27949997782707214, -0.26546332240104675, 0.23003336787223816, 0.2840431332588196, -0.16971281170845032, -0.12065324187278748, 0.044733814895153046, 0.4013015925884247, 0.06050959601998329, -0.21288134157657623, 0.2646506726741791, 0.09434114396572113, -0.173275887966156, -0.011355924420058727, 0.11684316396713257, 0.2239803820848465, 0.008158929646015167, 0.20094044506549835, -0.241968035697937, 0.003939718008041382, -0.18626080453395844, 0.23678186535835266, 0.1200823038816452, 0.13721217215061188, 0.06909202039241791, -0.3244309723377228, -0.03853733837604523, -0.10420449078083038, 0.35319986939430237, 0.4191434979438782, -0.3417018949985504, -0.0035484805703163147, 0.4474985897541046, 0.07763190567493439, 0.01586879789829254, -0.14472037553787231, 0.24896682798862457, -0.006371969357132912, -0.09180586785078049, 0.1843203604221344, 0.07312524318695068, -0.04503835737705231, 0.04520508646965027, 0.06958191096782684, 0.631730854511261, -0.031866274774074554, 0.18372206389904022, 0.1502341628074646, -0.13201172649860382, 0.43172454833984375, 0.36031705141067505, 0.06954683363437653, 0.23395468294620514, 0.3716771900653839, -0.3056158125400543, 0.1669425070285797, -0.17709024250507355, 0.14940598607063293, 0.0749766007065773, -0.3732910752296448, -0.2160263955593109, 0.1914072334766388, 0.15619544684886932, 0.11413595080375671, -0.12302593886852264, 0.3967437148094177, -0.2598850131034851, -0.11752955615520477, -0.2734735608100891, 0.3027580678462982, -0.25872737169265747, -0.10298599302768707, -0.19461548328399658, -0.24001947045326233, -0.1741306334733963, 0.07554970681667328, 0.016926473006606102, -0.2493305206298828, -0.3998246490955353, 0.13461795449256897, -0.14193864166736603, -0.3959451913833618, 0.20019865036010742, -0.0101018650457263, 0.030579958111047745, -0.24929791688919067, 0.2129848450422287, 0.13529115915298462, 0.04941798001527786, 0.06717894226312637, 0.4639756381511688, 0.7207574248313904, 0.18461990356445312, -0.000981885939836502, -0.023475175723433495, -0.30037662386894226, 0.12363740056753159, -0.04477618634700775, 0.08601740002632141, -0.05547075346112251, -0.033930085599422455, 0.21861709654331207, -0.013181254267692566, -0.13595646619796753, 0.009768379852175713, 0.2043135017156601, 0.21468010544776917, -0.006009135395288467, 0.4591095447540283, -0.5086727142333984, -0.005988895893096924, -0.030078450217843056, -0.06732503324747086, -0.37228572368621826, 0.20468541979789734, -0.043704695999622345, 0.0632900819182396, 0.299638569355011, -0.08685804903507233, 0.028764542192220688, -0.06076490879058838, 0.06040466949343681, 0.6372607946395874, 0.00983443297445774, -0.36765342950820923, -0.11625176668167114, -0.6337259411811829, 0.17763307690620422, -0.16935931146144867, -0.01785755157470703, -0.11428925395011902, 0.1993345469236374, -0.17996661365032196, 0.11249597370624542, 0.13060636818408966, 0.2017541527748108, -0.02181452140212059, 0.21944327652454376, -0.20255890488624573, -0.037339068949222565, -0.0021515749394893646, 0.09149505198001862, -0.009901002049446106, -0.1974540650844574, 0.10650648176670074, -0.3810036778450012, -0.09214325994253159, 0.1692202240228653, 0.023054227232933044, -0.166843980550766, -0.2761304974555969, 0.5048062801361084, 0.12378492951393127, 0.37748008966445923, -0.1326780617237091, -0.292996346950531, -0.17768330872058868, -0.13928070664405823, -0.272625595331192, 0.08126495778560638, -0.14182963967323303, 0.5394172072410583, -0.21683213114738464, -0.07436670362949371, -0.33084869384765625, 0.1465226262807846, 0.09978736937046051, -0.1540450155735016, -0.31596657633781433, 0.38453981280326843, -0.27865543961524963, 0.1972462236881256, 0.12348361313343048, 0.22850684821605682, -0.0824568122625351, 0.3881911337375641, -0.37762999534606934, -0.5395863056182861, 0.5919041037559509, -0.26256075501441956, -0.049774572253227234, -0.022961759939789772, 0.27725809812545776, 0.3707468509674072, -0.10555072128772736, -0.1821441799402237, 0.04876607656478882, 0.28907451033592224, 0.007615938782691956, -0.40671759843826294, -0.0344381146132946, 0.09067068994045258, -0.25247880816459656, -0.07507351040840149, 0.5715125203132629, 0.009335782378911972, -0.3330322206020355, 0.4231445789337158, -0.20632027089595795 ]
https://github.com/huggingface/datasets/issues/5777
Thanks @hamelsmu for the Zenodo link. I am adding it to the dataset card on the Hugging Face Hub, so that the community knows about this "official" source data. I guess this link is not well known, because some community members already hosted an "unofficial" version of the data on Zenodo as well: https://zenodo.org/record/7857872
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory
### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios.
54
datasets.load_dataset("code_search_net", "python") : NotADirectoryError: [Errno 20] Not a directory ### Describe the bug While checking out the [tokenizer tutorial](https://huggingface.co/course/chapter6/2?fw=pt), i noticed getting an error while initially downloading the python dataset used in the examples. The [collab with the error is here](https://colab.research.google.com/github/huggingface/notebooks/blob/master/course/en/chapter6/section2.ipynb#scrollTo=hGb69Yo3eV8S) ``` from datasets import load_dataset import os os.environ["HF_DATASETS_CACHE"] = "/workspace" # This can take a few minutes to load, so grab a coffee or tea while you wait! raw_datasets = load_dataset("code_search_net", "python") ``` yeilds: ``` ile /opt/conda/lib/python3.10/site-packages/datasets/download/streaming_download_manager.py:524, in xlistdir(path, use_auth_token) 522 main_hop, *rest_hops = _as_str(path).split("::") 523 if is_local_path(main_hop): --> 524 return os.listdir(path) 525 else: 526 # globbing inside a zip in a private repo requires authentication 527 if not rest_hops and (main_hop.startswith("http://") or main_hop.startswith("https://")): NotADirectoryError: [Errno 20] Not a directory: '/workspace/downloads/25ceeb4c25ab737d688bd56ea92bfbb1f199fe572470456cf2d675479f342ac7/python/final/jsonl/train' ``` I was able to reproduce this erro both in the collab and on my own pytorch/pytorch container pulled from the dockerhub official pytorch image, so i think it may be a server side thing. ### Steps to reproduce the bug Steps to reproduce the issue: 1. run `raw_datasets = load_dataset("code_search_net", "python")` ### Expected behavior expect the code to not exception during dataset pull. ### Environment info i tried both the default HF_DATASETS_CACHE on Collab, and on my local container. i then pointed to the HF_DATASETS_CACHE to a large capacity local storage and the problem was consisten across all 3 scenarios. Thanks @hamelsmu for the Zenodo link. I am adding it to the dataset card on the Hugging Face Hub, so that the community knows about this "official" source data. I guess this link is not well known, because some community members already hosted an "unofficial" version of the data on Zenodo as well: https://zenodo.org/record/7857872
[ -0.2291666567325592, 0.13596121966838837, 0.016966447234153748, 0.1255396157503128, 0.23950935900211334, -0.1594688445329666, 0.23064634203910828, 0.03346320241689682, -0.04735599458217621, 0.33694255352020264, -0.27385422587394714, 0.015452004969120026, -0.19089925289154053, -0.16640180349349976, 0.1513800472021103, -0.06317554414272308, 0.09574951231479645, 0.09330624341964722, -0.008679449558258057, -0.048472680151462555, -0.09783363342285156, 0.39403387904167175, -0.05456143617630005, 0.1810181885957718, -0.5094263553619385, -0.1111624538898468, -0.17674162983894348, 0.32273632287979126, -0.2871543765068054, -0.5348667502403259, 0.30543357133865356, 0.017012331634759903, 0.19407950341701508, 0.6149795055389404, -0.0001224726438522339, 0.12428542226552963, 0.16613321006298065, -0.017217416316270828, -0.39544063806533813, -0.6462113857269287, 0.33929431438446045, -0.15656104683876038, 0.23227772116661072, -0.11789616197347641, 0.22600987553596497, -0.326718270778656, 0.2038971483707428, 0.19730915129184723, 0.4099944531917572, 0.3653506338596344, 0.10382287204265594, 0.5196618437767029, -0.030788615345954895, -0.06189659237861633, 0.0545792318880558, 0.2602349519729614, -0.13143830001354218, 0.3335252106189728, 0.03558839112520218, 0.16408595442771912, 0.04268297925591469, 0.07739563286304474, -0.002363137900829315, -0.009960024617612362, 0.3371690809726715, 0.2264517843723297, -0.1856069713830948, -0.4749982953071594, -0.0049710520543158054, 0.15720558166503906, 0.3728221356868744, -0.14892327785491943, -0.3751625418663025, -0.27854329347610474, -0.18319565057754517, -0.15340059995651245, 0.39120030403137207, 0.2932131588459015, -0.23329080641269684, 0.10796438902616501, -0.11423679441213608, -0.004018530249595642, -0.012433841824531555, 0.298173189163208, -0.2910687327384949, 0.4334898889064789, -0.10893205553293228, -0.04473080858588219, -0.013288114219903946, -0.1482861042022705, -0.09272129088640213, -0.08666602522134781, 0.21681994199752808, 0.33834168314933777, -0.05750110372900963, 0.10879561305046082, 0.02015550248324871, -0.3514934480190277, 0.11573942005634308, 0.4525846838951111, -0.17159566283226013, -0.20773011445999146, -0.3829086124897003, 0.12261565774679184, -0.0015742983669042587, 0.23210567235946655, -0.16964375972747803, 0.3452661633491516, 0.31962770223617554, 0.15762777626514435, 0.14512452483177185, -0.12396948039531708, -0.23828735947608948, -0.08426356315612793, -0.11856186389923096, -0.2799220383167267, 0.29996374249458313, -0.09307359904050827, -0.5391836166381836, 0.18192820250988007, -0.7570893168449402, 0.06755618751049042, 0.17795294523239136, 0.4904649555683136, 0.10003435611724854, -0.19043490290641785, 0.16034987568855286, 0.4560098648071289, -0.06958342343568802, 0.10495089739561081, -0.24160006642341614, 0.12598784267902374, -0.019024766981601715, -0.012045776471495628, 0.13657337427139282, -0.07504408806562424, 0.4599323272705078, 0.05618740990757942, 0.15540392696857452, -0.25464174151420593, 0.2131628692150116, 0.06030404940247536, 0.008212905377149582, 0.47612470388412476, 0.14618316292762756, 0.05601855367422104, 0.18600252270698547, -0.365977019071579, -0.23516707122325897, -0.034735437482595444, -0.11317993700504303, -0.3255240321159363, -0.07033631205558777, 0.047666434198617935, -0.06120254099369049, -0.07794974744319916, -0.15293854475021362, -0.08131000399589539, -0.0873413011431694, 0.20857521891593933, 0.17141187191009521, -0.02476062998175621, -0.08461011946201324, -0.07628628611564636, 0.27940472960472107, 0.4686322808265686, 0.07497335970401764, -0.3941536545753479, 0.23507213592529297, -0.025491898879408836, 0.2667554020881653, 0.318886935710907, -0.21131139993667603, 0.578997015953064, -0.5207041501998901, 0.6564397811889648, 0.38747233152389526, -0.46027523279190063, -0.3523927330970764, 0.24388282001018524, -0.3735600411891937, 0.022598013281822205, 0.20080053806304932, -0.07051359117031097, 0.01913207769393921, -0.06979450583457947, 0.23008713126182556, 0.17789505422115326, 0.24273501336574554, 0.09636964648962021, -0.22445093095302582, -0.12760724127292633, -0.0802106112241745, 0.08749429136514664, 0.3174613416194916, 0.038825873285532, -0.03567302227020264, -0.031411293894052505, 0.25787609815597534, -0.353694885969162, -0.10630805790424347, 0.15032896399497986, 0.2629780173301697, 0.30295050144195557, -0.17553603649139404, 0.15521088242530823, -0.18061669170856476, 0.02694912999868393, -0.11436998844146729, 0.13054856657981873, -0.3796938359737396, -0.30417266488075256, -0.16885390877723694, 0.09039466828107834, -0.29386037588119507, -0.2954518795013428, 0.03857746720314026, 0.004150247201323509, 0.0987650454044342, 0.30356070399284363, -0.1230030506849289, 0.35911908745765686, -0.1865277886390686, 0.5235785841941833, -0.03047117218375206, 0.3441409468650818, -0.08381974697113037, -0.058100245893001556, -0.09495632350444794, 0.10223162919282913, 0.26499611139297485, -0.2408665418624878, -0.12751546502113342, 0.543367326259613, -0.0809829831123352, -0.059045616537332535, -0.021880075335502625, 0.1496700942516327, 0.2547338306903839, 0.08954988420009613, 0.0784822553396225, 0.3460213840007782, 0.02619098499417305, 0.1234014555811882, 0.1411805897951126, 0.4686870574951172, 0.06376904249191284, 0.17469948530197144, 0.23607060313224792, 0.20461124181747437, 0.2776693105697632, 0.07014501094818115, -0.12451857328414917, 0.023845702409744263, 0.4976933002471924, -0.1605440080165863, 0.37444037199020386, -0.09681650251150131, -0.32229846715927124, -0.02178868278861046, -0.10012539476156235, -0.2670876383781433, 0.14457590878009796, 0.15182983875274658, -0.107874795794487, -0.07029484212398529, -0.06456944346427917, 0.2741732895374298, 0.4071727395057678, -0.01978587917983532, 0.09828335046768188, 0.23582832515239716, -0.149067223072052, -0.1719426065683365, 0.30632632970809937, 0.27663150429725647, -0.31802913546562195, 0.24931183457374573, 0.009095396846532822, 0.09114527702331543, -0.5007442235946655, -0.5671082139015198, -0.06616723537445068, 0.21976958215236664, -0.4655153155326843, 0.12564152479171753, -0.1962497979402542, -0.19706284999847412, -0.045210789889097214, -0.09550006687641144, -0.2503979802131653, -0.3649193346500397, 0.019590113312005997, 0.2619023621082306, -0.11219602823257446, 0.1368633508682251, -0.3071879744529724, -0.030063167214393616, -0.20067043602466583, 0.12331226468086243, -0.17855995893478394, 0.3237571120262146, -0.15526801347732544, -0.15166911482810974, 0.4393163025379181, -0.18951132893562317, 0.3247666656970978, -0.4657640755176544, -0.014500182121992111, -0.5366824865341187, -0.40079066157341003, 0.3505246639251709, 0.10990063846111298, 0.13933421671390533, 0.28342413902282715, -0.07802258431911469, -0.29906323552131653, -0.3282073438167572, 0.18342632055282593, -0.08689779043197632, -0.30407005548477173, 0.013191379606723785, -0.06044219434261322, -0.12801149487495422, -0.1244126409292221, -0.17884162068367004, -0.32197999954223633, -0.21195651590824127, 0.19206494092941284, 0.018818020820617676, 0.13027499616146088, 0.34338873624801636, -0.2562163770198822, 0.3226746618747711, -0.17217779159545898, 0.03143242746591568, -0.21888282895088196, -0.2553143799304962, 0.18681246042251587, -0.3242654800415039, -0.2780405879020691, 0.10759885609149933, -0.10722734034061432, 0.15889447927474976, 0.13018345832824707, -0.4168851375579834, -0.22284215688705444, -0.1782773733139038, 0.21078836917877197, -0.24387392401695251, 0.010297147557139397, 0.34174466133117676, -0.14256300032138824, -0.012380227446556091, 0.14677581191062927, 0.01668153703212738, 0.15012261271476746, -0.1446058303117752, 0.0064352452754974365, -0.16225838661193848, 0.3610289692878723, 0.12656524777412415, 0.8954418897628784, 0.028468430042266846, 0.08029487729072571, 0.50836580991745, -0.08674938231706619, 0.25782719254493713, -0.2565848231315613, -0.17304609715938568, -0.018441667780280113, 0.08567562699317932, -0.1940700113773346, 0.24378257989883423, 0.19121018052101135, 0.09291143715381622, 0.10018119215965271, -0.15539458394050598, -0.3963635563850403, -0.19695910811424255, 0.017088161781430244, -0.07410842180252075, 0.023147273808717728, 0.10676883161067963, 0.14806267619132996, -0.027535386383533478, 0.03135042265057564, -0.04097706824541092, 0.5300362706184387, 0.33898934721946716, 0.16136345267295837, -0.49652647972106934, -0.19068610668182373, -0.6719269752502441, 0.0469522550702095, 0.01851607859134674, 0.3005741834640503, -0.06409735977649689, 0.04374302178621292, 0.2722770571708679, -0.144023597240448, 0.7213546633720398, 0.2163858860731125, -0.115035280585289, -0.021843116730451584, -0.18671853840351105, -0.3569850027561188, -0.18386855721473694, -0.12187333405017853, 0.32902953028678894, 0.3811275064945221, 0.3139532804489136, -0.398075133562088, -0.2594982981681824, 0.2463313788175583, -0.14315856993198395, 0.027723215520381927, 0.03452518954873085, -0.1502949297428131, -0.4881633520126343, -0.48083314299583435, 0.14608491957187653, 0.2310623824596405, 0.06636129319667816, 0.14726966619491577, 0.09552381932735443, -0.060974158346652985, 0.0556580051779747, 0.04779853671789169, -0.09948381781578064, 0.34894904494285583, -0.19499441981315613, 0.22907699644565582, 0.24320854246616364, 0.19956998527050018, 0.38229140639305115, 0.43606922030448914, 0.17121534049510956, -0.35296982526779175, 0.17745432257652283, 0.11416471749544144, 0.11904303729534149, 0.5208637118339539, -0.15448740124702454, -0.05701511353254318, -0.15685829520225525, 0.3932008743286133, -0.11948490142822266, 0.22169175744056702, 0.433574378490448, -0.038387805223464966, -0.10488054156303406, -0.16778255999088287, 0.3734498918056488, 0.1618884950876236, 0.04195097088813782, 0.1495882272720337, 0.35986751317977905, -0.08454303443431854, 0.4255083501338959, -0.16380926966667175, 0.97613126039505, 0.13160578906536102, 0.4081469178199768, 0.5434989333152771, -0.018413543701171875, 0.4410015046596527, -0.5728182196617126, 0.043072935193777084, -0.20836582779884338, 0.05933958664536476, -0.2056346833705902, -0.24145914614200592, -0.0691412016749382, -0.0943194329738617, -0.15532706677913666, 0.24073266983032227, -0.16152028739452362, 0.2611120939254761, -0.0193141158670187, 0.30112382769584656, -0.5304641127586365, -0.16973543167114258, -0.19132202863693237, 0.028675150126218796, 0.19140402972698212, 0.4126545786857605, -0.3034095764160156, 0.14693918824195862, -0.39382287859916687, -0.384475976228714, -0.15287962555885315, 0.09394979476928711, -0.2513076961040497, 0.2986319363117218, 0.2507306933403015, -0.2060317099094391, -0.09786752611398697, 0.3789178729057312, 0.21595555543899536, -0.0621563196182251, -0.14140568673610687, 0.17231248319149017, -0.43194714188575745, -0.009536024183034897, 0.09935623407363892, -0.25586509704589844, 0.2651214301586151, -0.10615155845880508, -0.03176604211330414, -0.3233041763305664, -0.17463915050029755, -0.22185948491096497, -0.1564752459526062, -0.01492193341255188, 0.17020469903945923, -0.2591361999511719, -0.005418449640274048, 0.05589653551578522, -0.007316306233406067, -0.27962949872016907, -0.023515334352850914, 0.18089540302753448, -0.21445974707603455, -0.3885250389575958, 0.034320369362831116, -0.1974809467792511, -0.15462642908096313, 0.27191123366355896, -0.22604413330554962, -0.1711505502462387, 0.6532038450241089, -0.054265525192022324, -0.19401046633720398, -0.08140472322702408, 0.153188094496727, 0.19045333564281464, -0.41769611835479736, 0.24218803644180298, -0.21433478593826294, 0.03873942792415619, -0.35618460178375244, 0.317561537027359, 0.2141331285238266, -0.20832613110542297, -0.11579941213130951, -0.4311227798461914, -0.19413021206855774, 0.1256851702928543, -0.1167498379945755, 0.16974210739135742, -0.05417951941490173, 0.17941945791244507, -0.10836268216371536, -0.39890724420547485, -0.14915691316127777, 0.22536876797676086, -0.2624421715736389, -0.09605003893375397, -0.1802208572626114, -0.10314325988292694, 0.37135523557662964, -0.09565002471208572, 0.010516371577978134, 0.243362694978714, -0.24697789549827576, -0.0577201284468174, -0.3009079098701477, 0.19183649122714996, 0.27949997782707214, -0.26546332240104675, 0.23003336787223816, 0.2840431332588196, -0.16971281170845032, -0.12065324187278748, 0.044733814895153046, 0.4013015925884247, 0.06050959601998329, -0.21288134157657623, 0.2646506726741791, 0.09434114396572113, -0.173275887966156, -0.011355924420058727, 0.11684316396713257, 0.2239803820848465, 0.008158929646015167, 0.20094044506549835, -0.241968035697937, 0.003939718008041382, -0.18626080453395844, 0.23678186535835266, 0.1200823038816452, 0.13721217215061188, 0.06909202039241791, -0.3244309723377228, -0.03853733837604523, -0.10420449078083038, 0.35319986939430237, 0.4191434979438782, -0.3417018949985504, -0.0035484805703163147, 0.4474985897541046, 0.07763190567493439, 0.01586879789829254, -0.14472037553787231, 0.24896682798862457, -0.006371969357132912, -0.09180586785078049, 0.1843203604221344, 0.07312524318695068, -0.04503835737705231, 0.04520508646965027, 0.06958191096782684, 0.631730854511261, -0.031866274774074554, 0.18372206389904022, 0.1502341628074646, -0.13201172649860382, 0.43172454833984375, 0.36031705141067505, 0.06954683363437653, 0.23395468294620514, 0.3716771900653839, -0.3056158125400543, 0.1669425070285797, -0.17709024250507355, 0.14940598607063293, 0.0749766007065773, -0.3732910752296448, -0.2160263955593109, 0.1914072334766388, 0.15619544684886932, 0.11413595080375671, -0.12302593886852264, 0.3967437148094177, -0.2598850131034851, -0.11752955615520477, -0.2734735608100891, 0.3027580678462982, -0.25872737169265747, -0.10298599302768707, -0.19461548328399658, -0.24001947045326233, -0.1741306334733963, 0.07554970681667328, 0.016926473006606102, -0.2493305206298828, -0.3998246490955353, 0.13461795449256897, -0.14193864166736603, -0.3959451913833618, 0.20019865036010742, -0.0101018650457263, 0.030579958111047745, -0.24929791688919067, 0.2129848450422287, 0.13529115915298462, 0.04941798001527786, 0.06717894226312637, 0.4639756381511688, 0.7207574248313904, 0.18461990356445312, -0.000981885939836502, -0.023475175723433495, -0.30037662386894226, 0.12363740056753159, -0.04477618634700775, 0.08601740002632141, -0.05547075346112251, -0.033930085599422455, 0.21861709654331207, -0.013181254267692566, -0.13595646619796753, 0.009768379852175713, 0.2043135017156601, 0.21468010544776917, -0.006009135395288467, 0.4591095447540283, -0.5086727142333984, -0.005988895893096924, -0.030078450217843056, -0.06732503324747086, -0.37228572368621826, 0.20468541979789734, -0.043704695999622345, 0.0632900819182396, 0.299638569355011, -0.08685804903507233, 0.028764542192220688, -0.06076490879058838, 0.06040466949343681, 0.6372607946395874, 0.00983443297445774, -0.36765342950820923, -0.11625176668167114, -0.6337259411811829, 0.17763307690620422, -0.16935931146144867, -0.01785755157470703, -0.11428925395011902, 0.1993345469236374, -0.17996661365032196, 0.11249597370624542, 0.13060636818408966, 0.2017541527748108, -0.02181452140212059, 0.21944327652454376, -0.20255890488624573, -0.037339068949222565, -0.0021515749394893646, 0.09149505198001862, -0.009901002049446106, -0.1974540650844574, 0.10650648176670074, -0.3810036778450012, -0.09214325994253159, 0.1692202240228653, 0.023054227232933044, -0.166843980550766, -0.2761304974555969, 0.5048062801361084, 0.12378492951393127, 0.37748008966445923, -0.1326780617237091, -0.292996346950531, -0.17768330872058868, -0.13928070664405823, -0.272625595331192, 0.08126495778560638, -0.14182963967323303, 0.5394172072410583, -0.21683213114738464, -0.07436670362949371, -0.33084869384765625, 0.1465226262807846, 0.09978736937046051, -0.1540450155735016, -0.31596657633781433, 0.38453981280326843, -0.27865543961524963, 0.1972462236881256, 0.12348361313343048, 0.22850684821605682, -0.0824568122625351, 0.3881911337375641, -0.37762999534606934, -0.5395863056182861, 0.5919041037559509, -0.26256075501441956, -0.049774572253227234, -0.022961759939789772, 0.27725809812545776, 0.3707468509674072, -0.10555072128772736, -0.1821441799402237, 0.04876607656478882, 0.28907451033592224, 0.007615938782691956, -0.40671759843826294, -0.0344381146132946, 0.09067068994045258, -0.25247880816459656, -0.07507351040840149, 0.5715125203132629, 0.009335782378911972, -0.3330322206020355, 0.4231445789337158, -0.20632027089595795 ]
https://github.com/huggingface/datasets/issues/5773
Thanks for reporting, @v-yunbin. Could you please give more details, the steps to reproduce the bug, the complete error back trace and the environment information (`datasets-cli env`)?
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
27
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` Thanks for reporting, @v-yunbin. Could you please give more details, the steps to reproduce the bug, the complete error back trace and the environment information (`datasets-cli env`)?
[ -0.522157609462738, -0.19083084166049957, -0.08664260804653168, 0.16447564959526062, 0.3741040825843811, -0.05488339066505432, 0.21320584416389465, 0.06412778049707413, -0.08213943988084793, 0.35544633865356445, 0.3760342001914978, 0.14678063988685608, -0.43557193875312805, 0.33599749207496643, -0.22998221218585968, -0.17173555493354797, 0.1286245435476303, 0.06635719537734985, -0.14281903207302094, 0.1972896307706833, -0.3512670397758484, 0.0005823317915201187, -0.2566078007221222, -0.01998768374323845, -0.4209458529949188, -0.200541153550148, -0.08714663237333298, 0.022373119369149208, -0.0031266361474990845, -0.36749371886253357, 0.14770156145095825, -0.2856765687465668, 0.4629894495010376, 0.6948047876358032, -0.00011404637189116329, 0.01579931378364563, 0.26053449511528015, -0.09612146019935608, -0.20478342473506927, -0.014523319900035858, -0.3923953175544739, -0.33023059368133545, 0.03455394506454468, -0.47385185956954956, 0.13642257452011108, 0.030492812395095825, 0.033047765493392944, -0.3279186487197876, 0.4798487424850464, 0.41096386313438416, 0.22681380808353424, 0.3822631239891052, 0.21309947967529297, -0.14649145305156708, -0.051126088947057724, -0.10006935894489288, -0.13135311007499695, 0.19523507356643677, 0.09011427313089371, -0.09418033063411713, -0.019384581595659256, 0.007615257054567337, 0.4273739159107208, 0.09227107465267181, 0.10073207318782806, -0.2908172905445099, 0.40938976407051086, -0.5348644852638245, -0.20324201881885529, 0.10587164759635925, 0.4476199150085449, -0.211452454328537, -0.31216394901275635, 0.11815878748893738, -0.0013153143227100372, -0.565744161605835, 0.20490004122257233, 0.12048667669296265, 0.035807378590106964, 0.19407640397548676, -0.4946918189525604, 0.12095662206411362, -0.32392165064811707, -0.04002908244729042, 0.06815266609191895, 0.33184632658958435, -0.06310339272022247, 0.06534555554389954, -0.10265044867992401, 0.04615199565887451, 0.19607019424438477, 0.34162405133247375, 0.2984776496887207, 0.28525054454803467, -0.42559814453125, -0.11684004217386246, -0.2378721833229065, 0.12852805852890015, 0.12209302186965942, 0.2752857208251953, -0.022211505100131035, 0.06246154010295868, 0.12743285298347473, 0.10904276371002197, -0.0840969830751419, 0.2999666631221771, 0.03429481387138367, 0.2041296660900116, 0.1516771912574768, 0.2931825816631317, 0.12610086798667908, -0.03876887634396553, -0.2219131737947464, -0.5315902233123779, 0.2823397219181061, 0.17936667799949646, -0.057644180953502655, -0.011311635375022888, -0.28458860516548157, 0.5711286067962646, -0.27390119433403015, -0.17523476481437683, 0.13095791637897491, 0.23585660755634308, -0.14702530205249786, -0.07386401295661926, -0.08821245282888412, 0.0010706232860684395, -0.16657155752182007, -0.3206733465194702, -0.1843809187412262, 0.05045650154352188, -0.5908825397491455, 0.08533395826816559, 0.048206448554992676, -0.2375941425561905, 0.40418973565101624, 0.16659927368164062, 0.0580931156873703, -0.20154407620429993, -0.042504437267780304, -0.4456520080566406, -0.05131775513291359, 0.2512643337249756, -0.10959556698799133, 0.10140085220336914, -0.05152357742190361, 0.15195415914058685, 0.04372406005859375, 0.22369247674942017, -0.4481502175331116, -0.4554557800292969, -0.16633421182632446, 0.09386913478374481, -0.02792760729789734, 0.14715373516082764, 0.11381923407316208, 0.11563873291015625, 0.6417660713195801, 0.13438427448272705, 0.042743682861328125, -0.3641633987426758, -0.3796344995498657, -0.13787095248699188, 0.49528729915618896, 0.027699343860149384, -0.5746927261352539, -0.10335733741521835, 0.35817962884902954, -0.2220560908317566, 0.3104434609413147, 0.26761293411254883, -0.004598598927259445, -0.029191043227910995, -0.11183477193117142, 0.05314116179943085, 0.27409839630126953, 0.011428363621234894, -0.18033605813980103, 0.07131852954626083, 0.13503089547157288, -0.3973633050918579, 0.016326457262039185, -0.08396345376968384, 0.07776842266321182, -0.16317158937454224, 0.06088239699602127, 0.1393066644668579, -0.008121157065033913, -0.2729199230670929, -0.2243749499320984, -0.1681024432182312, 0.06665585935115814, 0.12095747888088226, 0.3049512803554535, -0.002010263502597809, 0.03324466943740845, -0.043252166360616684, 0.043298691511154175, -0.09480221569538116, 0.23119574785232544, 0.3409987986087799, 0.03143351525068283, -0.031248245388269424, 0.04465654492378235, -0.31286782026290894, 0.07418210804462433, 0.12632188200950623, -0.043738920241594315, -0.049174714833498, 0.4583360552787781, 0.16940243542194366, -0.3192739188671112, 0.3301604092121124, -0.15197719633579254, -0.1344514638185501, 0.07125315070152283, -0.19082364439964294, 0.05878180265426636, 0.053403183817863464, -0.09202341735363007, 0.11066044867038727, -0.7711753249168396, 0.0735320970416069, -0.1894327998161316, 0.08231718838214874, -0.4231390357017517, -0.18358290195465088, -0.17947156727313995, 0.24715305864810944, 0.0933833122253418, 0.07237184047698975, -0.16694174706935883, 0.301390677690506, 0.03586793690919876, -0.3410721719264984, -0.44800132513046265, 0.08119688928127289, 0.11660348623991013, -0.10035719722509384, 0.014881601557135582, -0.10569167137145996, -0.007651824504137039, 0.12824873626232147, 0.08028855919837952, 0.14927536249160767, 0.09690189361572266, 0.14180392026901245, 0.08063394576311111, 0.05309392511844635, 0.2562500238418579, -0.01214630901813507, -0.1753944307565689, -0.16761751472949982, 0.22695183753967285, -0.1333632618188858, 0.33868855237960815, -0.13296794891357422, -0.6930689215660095, -0.3627847731113434, 0.21912631392478943, 0.05948079377412796, 0.04401709884405136, 0.15039917826652527, -0.010808117687702179, -0.11058664321899414, 0.12763996422290802, 0.09765049815177917, 0.08919691294431686, 0.06776013970375061, 0.07125025987625122, 0.020612312480807304, -0.36181390285491943, -0.1025538444519043, 0.004129201173782349, 0.16563813388347626, 0.47548168897628784, 0.2531580626964569, -0.1249685287475586, 0.034053511917591095, 0.15723773837089539, -0.44065386056900024, 0.07225169241428375, 0.29758885502815247, -0.5462283492088318, 0.16166412830352783, -0.3891425132751465, -0.18915879726409912, -0.35793226957321167, -0.25019970536231995, -0.0964585542678833, -0.02658728137612343, -0.0901172012090683, -0.11609233170747757, 0.08123217523097992, 0.3676280975341797, -0.3127034902572632, 0.1335611194372177, 0.27217450737953186, 0.37115558981895447, 0.18368712067604065, 0.187791645526886, -0.18209987878799438, 0.07029294222593307, 0.07456839084625244, -0.05420180782675743, 0.1242436096072197, 0.042856618762016296, -0.10508404672145844, -0.07794815301895142, -0.22556635737419128, 0.11498698592185974, 0.13529089093208313, 0.43134406208992004, -0.06480783224105835, 0.09098712354898453, -0.09707506746053696, -0.2543366849422455, 0.10699042677879333, 0.08618190139532089, -0.07233384251594543, -0.2074873298406601, -0.07643455266952515, 0.0007529594004154205, -0.1089678406715393, -0.05139750987291336, -0.36210721731185913, -0.22971311211585999, -0.15242186188697815, 0.28740447759628296, 0.25595706701278687, 0.03953148052096367, 0.251289039850235, 0.11009141057729721, 0.29171571135520935, -0.0006877928972244263, -0.10984187573194504, -0.3938072621822357, 0.4769783616065979, -0.39390090107917786, -0.3489316701889038, -0.02196545898914337, -0.1209203451871872, 0.20393605530261993, 0.35876837372779846, -0.2999645173549652, 0.03499637916684151, -0.20252256095409393, -0.06799057126045227, -0.2517032027244568, -0.07565916329622269, 0.29619699716567993, -0.2152652144432068, 0.02346176654100418, -0.11630899459123611, -0.1059538722038269, 0.36360228061676025, -0.24919632077217102, 0.23960641026496887, 0.048483528196811676, 0.7799826860427856, 0.09412892162799835, 0.9067364931106567, 0.33479541540145874, -0.36037641763687134, 0.47033992409706116, 0.03696468472480774, 0.129991352558136, -0.179800882935524, 0.19992771744728088, 0.32990676164627075, 0.014732293784618378, -0.09656667709350586, 0.1624547243118286, -0.11548047512769699, -0.293071985244751, -0.03409624472260475, -0.07494620233774185, 0.10102370381355286, 0.024643853306770325, -0.0438857227563858, -0.23943816125392914, 0.6359922289848328, -0.30056798458099365, 0.17190946638584137, 0.14603616297245026, 0.004117149859666824, -0.19005586206912994, 0.11715686321258545, -0.027861103415489197, 0.16726695001125336, -0.4926968216896057, -0.08831413090229034, -0.35164976119995117, 0.2055623084306717, 0.12579312920570374, 0.8377376198768616, -0.13863779604434967, -0.18796682357788086, -0.012969404458999634, 0.002214886248111725, 0.2344229519367218, -0.19866274297237396, 0.07012936472892761, 0.07854911684989929, 0.11803577095270157, -0.30948948860168457, -0.3854897916316986, -0.12409856915473938, 0.3804422616958618, 0.08201432228088379, 0.29717832803726196, 0.178955540060997, 0.00977841392159462, 0.25055018067359924, 0.07751910388469696, -0.08364130556583405, -0.11817450076341629, -0.1050715446472168, 0.04435914754867554, -0.1792047917842865, 0.44742825627326965, 0.20375706255435944, 0.17312012612819672, -0.059524450451135635, 0.10622645914554596, -0.0860615223646164, 0.09686240553855896, 0.041552960872650146, -0.05564698949456215, 0.1582360416650772, -0.06787741929292679, 0.20329318940639496, -0.19008684158325195, 0.021939806640148163, 0.5011114478111267, 0.02218467928469181, -0.21562065184116364, -0.3157959580421448, 0.5172869563102722, -0.11964357644319534, 0.2758874297142029, 0.10874539613723755, -0.003996238112449646, -0.027325153350830078, 0.43505358695983887, 0.22657659649848938, -0.2780887484550476, 0.08962958306074142, 0.22370828688144684, 0.30049726366996765, -0.7680401802062988, -0.3827112913131714, 0.011737650260329247, 0.3349384069442749, 0.14408980309963226, 0.13031673431396484, -0.22822268307209015, -0.08838839828968048, 0.08023640513420105, 0.3917757272720337, 0.7340216636657715, 0.10511019825935364, 0.02824541926383972, 0.1186445951461792, 0.2733158469200134, -0.003323383629322052, 0.09991245716810226, -0.05867719650268555, -0.2582343816757202, -0.45270872116088867, -0.10873164236545563, -0.14419308304786682, 0.364786833524704, 0.049179986119270325, -0.12343885004520416, 0.3612630367279053, -0.22193259000778198, -0.18099290132522583, -0.013015452772378922, 0.05109518766403198, 0.10034254193305969, -0.12562504410743713, 0.002476247027516365, 0.16731837391853333, -0.09703758358955383, -0.06160306558012962, -0.16553814709186554, 0.07014612853527069, 0.0074291229248046875, 0.017945118248462677, -0.31280940771102905, -0.05208433419466019, -0.19061055779457092, 0.07152977585792542, -0.04262052848935127, -0.526625394821167, 0.4764293432235718, 0.17169976234436035, 0.5073827505111694, 0.10689979791641235, -0.1330379992723465, 0.009174434468150139, -0.12568511068820953, -0.06749425083398819, -0.12453475594520569, 0.04352673515677452, 0.5449187159538269, -0.20709344744682312, -0.03293222188949585, 0.0047172559425234795, -0.019551925361156464, -0.06914906948804855, -0.04935939610004425, 0.07377173006534576, -0.07332265377044678, -0.18004609644412994, -0.08962418884038925, -0.0428493432700634, 0.09637932479381561, -0.18838177621364594, 0.14682213962078094, -0.08678841590881348, 0.049669962376356125, 0.41030433773994446, -0.043495189398527145, -0.09128547459840775, -0.19413632154464722, 0.21315522491931915, 0.046005163341760635, 0.18934433162212372, 0.6040144562721252, 0.2316194474697113, -0.20444580912590027, -0.08994468301534653, 0.023839645087718964, 0.2630773186683655, -0.23197618126869202, -0.19306956231594086, -0.08361510932445526, 0.2541405260562897, 0.00043014809489250183, 0.08364149928092957, 0.1383044421672821, 0.05776504427194595, 0.08546598255634308, -0.35013988614082336, -0.5766996145248413, -0.02070070430636406, -0.362377792596817, 0.1718493103981018, -0.026066653430461884, 0.16434651613235474, 0.20513519644737244, 0.0266194436699152, -0.273759663105011, -0.1368386447429657, -0.48675835132598877, 0.09417260438203812, 0.1294967234134674, -0.027386996895074844, -0.2418839931488037, 0.13337044417858124, -0.05279422551393509, 0.21350374817848206, -0.1618340015411377, -0.09558045864105225, -0.25179365277290344, 0.108283132314682, 0.0036538690328598022, -0.06255914270877838, 0.07845167815685272, -0.1782124787569046, -0.3703744113445282, -0.02937774918973446, -0.2704172432422638, 0.23866026103496552, 0.006409225985407829, 0.3295132517814636, 0.25072526931762695, 0.13864131271839142, 0.16937309503555298, 0.04676837846636772, 0.19089290499687195, 0.26244640350341797, -0.01093137264251709, 0.19092555344104767, 0.09925980120897293, 0.003063216805458069, -0.5580872893333435, 0.08162137866020203, 0.0540509894490242, -0.15239523351192474, -0.2485516518354416, -0.19939087331295013, 0.19057326018810272, 0.1633436679840088, 0.3910825252532959, 0.20651432871818542, -0.2712661921977997, -0.12838035821914673, 0.7057251334190369, 0.15201865136623383, -0.19009768962860107, 0.029019705951213837, 0.2122044414281845, -0.17535758018493652, -0.015909284353256226, 0.2888062596321106, 0.22835928201675415, 0.13291430473327637, 0.16928349435329437, 0.2446746528148651, -0.0390617772936821, -0.48994845151901245, 0.20810995995998383, 0.19989998638629913, 0.036062076687812805, 0.2012511044740677, 0.39054691791534424, 0.0544462725520134, 0.3153628408908844, 0.38929376006126404, -0.056115005165338516, 0.23420177400112152, 0.5697609782218933, -0.11091182380914688, -0.07458377629518509, -0.5487136244773865, -0.4604593813419342, 0.00362405925989151, -0.13406136631965637, 0.04680424928665161, -0.03904375061392784, 0.5651292204856873, 0.0541364960372448, -0.21472713351249695, -0.27152228355407715, 0.02339041978120804, -0.27228593826293945, -0.1303771436214447, -0.32914429903030396, -0.04714515060186386, 0.035372957587242126, -0.0767107680439949, -0.04830169305205345, 0.11702992022037506, 0.3912913203239441, -0.15407848358154297, -0.26635971665382385, -0.11054671555757523, 0.0410635843873024, 0.3263361155986786, 0.03254270553588867, -0.1413598358631134, 0.3852940499782562, 0.022539708763360977, -0.18584778904914856, 0.08832483738660812, 0.14293058216571808, 0.541612982749939, 0.3842278718948364, 0.276226282119751, -0.033722300082445145, 0.14890801906585693, 0.0012300312519073486, 0.06370805203914642, 0.21852067112922668, 0.3440905809402466, -0.16618327796459198, 0.475170373916626, 0.004362661391496658, -0.16283075511455536, 0.4344854950904846, 0.047151118516922, 0.5674126744270325, -0.3007619380950928, 0.04074794426560402, 0.02843792736530304, -0.08288834989070892, 0.045073430985212326, -0.022830694913864136, -0.42126965522766113, 0.4135338366031647, 0.18775665760040283, 0.020569954067468643, 0.11650635302066803, -0.10053752362728119, 0.055913254618644714, -0.2554416060447693, 0.4990590214729309, 0.30406180024147034, 0.060174234211444855, -0.04020552709698677, -0.2854633331298828, -0.5100814700126648, 0.09669707715511322, -0.2508901357650757, 0.1287333071231842, 0.02897714078426361, -0.05545651912689209, -0.07332196831703186, -0.09274526685476303, 0.44531017541885376, -0.24594178795814514, 0.12642624974250793, 0.485120952129364, -0.39743906259536743, 0.0264112651348114, -0.23049645125865936, 0.06503905355930328, 0.1702273041009903, -0.12244319170713425, 0.24508768320083618, -0.06278626620769501, -0.037815071642398834, 0.020292863249778748, -0.14126867055892944, 0.07994146645069122, 0.3977948725223541, 0.43089309334754944, 0.15903623402118683, 0.34296584129333496, -0.21633347868919373, 0.31072571873664856, -0.3040483593940735, -0.09120474755764008, -0.2596796452999115, 0.14584679901599884, 0.09691597521305084, 0.19549047946929932, -0.4809284806251526, -0.17607955634593964, -0.023433782160282135, 0.047900088131427765, -0.17652764916419983, 0.105019211769104, -0.1025027334690094, 0.10912777483463287, -0.036443911492824554, -0.03427514433860779, 0.25310537219047546, 0.12472954392433167, 0.19234101474285126, 0.07787702232599258, -0.282527357339859, -0.2351951003074646, 0.29569047689437866, -0.26485857367515564, -0.21717721223831177, -0.5111998319625854, -0.04552605003118515, 0.2421591430902481, -0.01212674006819725, -0.3325952887535095, -0.06025920808315277, 0.3121762275695801, -0.03731711581349373, -0.36022698879241943, 0.2656126022338867, -0.40682464838027954, 0.20457209646701813, 0.01225077360868454, 0.33563023805618286, 0.07372911274433136, -0.3587997555732727, -0.009294979274272919, -0.2530181407928467 ]
https://github.com/huggingface/datasets/issues/5773
this is a detail error info from transformers: ``` Traceback (most recent call last): File "finetune.py", line 177, in <module> whisper_finetune(traindir,devdir,outdir) File "finetune.py", line 161, in whisper_finetune trainer = Seq2SeqTrainer( File "/home/ybZhang/miniconda3/envs/whister/lib/python3.8/site-packages/transformers/trainer_seq2seq.py", line 56, in __init__ super().__init__( File "/home/ybZhang/miniconda3/envs/whister/lib/python3.8/site-packages/transformers/trainer.py", line 567, in __init__ raise ValueError( ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler. ```
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
73
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` this is a detail error info from transformers: ``` Traceback (most recent call last): File "finetune.py", line 177, in <module> whisper_finetune(traindir,devdir,outdir) File "finetune.py", line 161, in whisper_finetune trainer = Seq2SeqTrainer( File "/home/ybZhang/miniconda3/envs/whister/lib/python3.8/site-packages/transformers/trainer_seq2seq.py", line 56, in __init__ super().__init__( File "/home/ybZhang/miniconda3/envs/whister/lib/python3.8/site-packages/transformers/trainer.py", line 567, in __init__ raise ValueError( ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler. ```
[ -0.46752703189849854, -0.20199625194072723, -0.03817889094352722, 0.20775702595710754, 0.47669774293899536, -0.052558980882167816, 0.4015348553657532, 0.12132513523101807, -0.22176145017147064, 0.29023417830467224, 0.11544169485569, 0.03432578966021538, -0.5872918367385864, 0.1363968849182129, -0.25173506140708923, -0.23373785614967346, 0.08903693407773972, 0.07612302154302597, -0.11205574870109558, 0.1887100636959076, -0.46188443899154663, 0.0279244314879179, -0.365275502204895, -0.0465519018471241, -0.5888498425483704, -0.14300750195980072, 0.020682454109191895, -0.11936967819929123, -0.084347665309906, -0.45728635787963867, 0.25430721044540405, -0.1438659131526947, 0.47264841198921204, 0.7555679082870483, -0.00012284854892641306, 0.15473756194114685, 0.2635270357131958, -0.20171406865119934, -0.1834094226360321, 0.07641834765672684, -0.2808114290237427, -0.2385733723640442, 0.17590463161468506, -0.4304966926574707, 0.04723839461803436, 0.10878980904817581, -0.06292799115180969, -0.03728873282670975, 0.7361254096031189, 0.32205212116241455, 0.14683392643928528, 0.4190782904624939, 0.13112345337867737, -0.028940822929143906, 0.1844719648361206, -0.15121488273143768, -0.14505693316459656, 0.11550061404705048, -0.030626662075519562, -0.05819634348154068, 0.03322310373187065, 0.08931991457939148, 0.2315548211336136, 0.14424598217010498, 0.04327310994267464, -0.16749176383018494, 0.24727897346019745, -0.542195200920105, -0.29164600372314453, 0.25234735012054443, 0.4039435386657715, -0.166099414229393, -0.34199342131614685, 0.06566731631755829, -0.18855349719524384, -0.5185955166816711, 0.03831181675195694, -0.03813496232032776, 0.1529306024312973, 0.18893277645111084, -0.3756709694862366, 0.1589166820049286, -0.2900295555591583, 0.04281383752822876, 0.09218262881040573, 0.5720639824867249, -0.0768669843673706, 0.14032027125358582, -0.05449308827519417, -0.005469992756843567, 0.34241342544555664, 0.22978851199150085, 0.335029274225235, 0.26230964064598083, -0.6230248808860779, -0.2031489759683609, -0.333367258310318, -0.07700102031230927, -0.017533469945192337, 0.30642348527908325, -0.005585389211773872, 0.13156841695308685, 0.25661391019821167, 0.0817490965127945, -0.11135247349739075, 0.4214507043361664, -0.014919042587280273, 0.2419029176235199, 0.06894367933273315, 0.297439306974411, 0.27555739879608154, -0.043518781661987305, -0.2789291441440582, -0.5846813321113586, 0.12104946374893188, 0.25254082679748535, 0.08699057996273041, 0.051115453243255615, -0.26132574677467346, 0.21929900348186493, -0.2500542998313904, -0.25997933745384216, 0.1265115588903427, 0.32877546548843384, -0.09413224458694458, 0.08013475686311722, -0.059797655791044235, 0.16273507475852966, -0.10412183403968811, -0.08389396220445633, -0.17293024063110352, 0.07714533805847168, -0.24631592631340027, 0.16966688632965088, 0.062231868505477905, -0.17219582200050354, 0.3883284330368042, -0.0425599068403244, 0.038819242268800735, -0.1991470456123352, 0.05804229527711868, -0.4815753400325775, -0.0016443803906440735, 0.3043234348297119, -0.21171681582927704, 0.18382585048675537, 0.029124774038791656, 0.13662846386432648, -0.011136673390865326, 0.16263434290885925, -0.4235835671424866, -0.619122326374054, -0.02349088154733181, 0.06202992796897888, -0.029447603970766068, 0.1805710345506668, 0.24796444177627563, 0.053757503628730774, 0.8069777488708496, 0.06829047203063965, 0.07170072942972183, -0.40626201033592224, -0.299003005027771, -0.13185109198093414, 0.3985725939273834, 0.19779494404792786, -0.37707674503326416, -0.24720275402069092, 0.2578243911266327, -0.1859394907951355, 0.28486838936805725, 0.5045465230941772, -0.16883596777915955, 0.07167348265647888, 0.09957708418369293, 0.22564439475536346, 0.4119698107242584, -0.07855210453271866, -0.3538140058517456, 0.12397067248821259, 0.06947413086891174, -0.24496084451675415, 0.11006660759449005, -0.009679097682237625, 0.2811601161956787, -0.19047170877456665, 0.04054955393075943, 0.12086319923400879, 0.13363458216190338, -0.19280104339122772, -0.2899780571460724, -0.3752950429916382, 0.25507020950317383, 0.22328723967075348, 0.2322528064250946, -0.05994086712598801, -0.16830000281333923, 0.4039191007614136, 0.17841675877571106, 0.026664145290851593, 0.23858842253684998, 0.30459749698638916, -0.0036873584613204002, -0.04737354442477226, -0.004724148660898209, -0.16226613521575928, 0.07190296798944473, -0.004808478057384491, 0.004227831959724426, 0.17189592123031616, 0.3237888514995575, 0.16197581589221954, -0.3588346242904663, 0.27350980043411255, -0.4478253424167633, -0.2282973974943161, 0.05170555040240288, -0.14573314785957336, 0.19199076294898987, -0.14530879259109497, -0.034141167998313904, 0.03327731043100357, -0.5033514499664307, 0.13839702308177948, -0.3716793358325958, 0.06295353919267654, -0.3949798345565796, -0.25666025280952454, -0.1595698595046997, 0.2427183985710144, 0.14640308916568756, 0.03484053909778595, -0.09812494367361069, 0.3788703978061676, -0.040334004908800125, -0.529420018196106, -0.5182145237922668, 0.23257902264595032, 0.13469836115837097, -0.3370048403739929, 0.12972266972064972, 0.06868281215429306, -0.04570560157299042, 0.12648989260196686, 0.12481743097305298, 0.242895245552063, 0.14319179952144623, 0.2018446922302246, -0.09428715705871582, 0.08024856448173523, 0.12763328850269318, 0.03979334980249405, -0.32197484374046326, -0.24047261476516724, 0.10626929998397827, -0.04586104303598404, 0.3255236744880676, -0.10443664342164993, -0.24883966147899628, -0.5238038897514343, 0.4180152118206024, 0.06170444190502167, 0.12547054886817932, 0.16273599863052368, -0.21739405393600464, -0.1720554232597351, -0.17080660164356232, -0.0002591535449028015, 0.13114768266677856, -0.002935737371444702, -0.029748760163784027, -0.06824029237031937, -0.2576861083507538, -0.2087017297744751, 0.015351735055446625, 0.24861586093902588, 0.4615490436553955, 0.22783970832824707, -0.016056513413786888, 0.004971131682395935, 0.12323786318302155, -0.4708896279335022, 0.08242012560367584, 0.260431706905365, -0.39419496059417725, 0.08787339925765991, -0.22959554195404053, 0.16185198724269867, -0.43922024965286255, -0.34657955169677734, -0.14697465300559998, -0.0813266783952713, -0.007331287954002619, -0.21501070261001587, 0.10843761265277863, 0.47184908390045166, -0.07844195514917374, 0.10298416763544083, 0.44137871265411377, 0.12950624525547028, 0.10124927759170532, 0.05225396156311035, -0.05620213598012924, 0.018802180886268616, -0.10282988846302032, -0.22580502927303314, -0.13050076365470886, -0.03073514997959137, -0.1470041424036026, 0.17581835389137268, -0.21841008961200714, 0.09413924813270569, 0.03335822373628616, 0.47165730595588684, -0.02856530249118805, 0.1479966938495636, 0.21167580783367157, -0.3626991808414459, 0.10278903692960739, 0.034254297614097595, -0.012665979564189911, -0.2159343659877777, -0.0800090953707695, 0.05871984362602234, -0.019331838935613632, -0.19859863817691803, -0.5015307068824768, -0.1392916440963745, -0.10232719779014587, 0.29476499557495117, 0.16431400179862976, 0.11635217070579529, 0.23375236988067627, -0.05528748407959938, 0.11856931447982788, 0.08346913009881973, -0.15457157790660858, -0.32162532210350037, 0.6306898593902588, -0.26210927963256836, -0.2118413746356964, -0.029242604970932007, -0.30488112568855286, 0.27396464347839355, 0.1883067488670349, -0.2823352813720703, 0.159375861287117, -0.2252354919910431, -0.26506108045578003, -0.045111071318387985, -0.04573282599449158, 0.40054768323898315, -0.07044758647680283, 0.12544529139995575, 0.021344885230064392, -0.21407370269298553, 0.35164016485214233, -0.1290246546268463, 0.2679815888404846, -0.0036831945180892944, 0.7883661985397339, 0.05825163424015045, 0.9065282940864563, 0.1745525598526001, -0.20354312658309937, 0.2828863859176636, 0.07170669734477997, -0.05229898914694786, -0.05097360536456108, 0.21348968148231506, 0.39441752433776855, 0.0239839106798172, -0.004886001348495483, 0.17839965224266052, -0.14594560861587524, -0.21549780666828156, 0.0911259800195694, 0.0009137988090515137, -0.11722305417060852, -0.011346578598022461, 0.011057445779442787, -0.02125871367752552, 0.5770156979560852, -0.2579173743724823, 0.31473255157470703, 0.22163115441799164, -0.13976256549358368, -0.16294877231121063, 0.26208561658859253, -0.018433962017297745, 0.1529834121465683, -0.2241499125957489, 0.02630031853914261, -0.3125094771385193, 0.1887100338935852, 0.029746007174253464, 0.7961959838867188, -0.04558558017015457, -0.2870999574661255, 0.034802235662937164, 0.08023571968078613, 0.33368510007858276, -0.06575516611337662, -0.09729447960853577, -0.046516112983226776, -0.1331404745578766, -0.3635903298854828, -0.36284345388412476, -0.20459237694740295, -0.11440852284431458, -0.12016460299491882, 0.22237327694892883, -0.07656461000442505, 0.07002250850200653, 0.34335458278656006, 0.14428889751434326, -0.254489004611969, -0.07458823174238205, -0.07216835767030716, -0.04713099077343941, -0.39171624183654785, 0.2652488052845001, 0.042986296117305756, 0.21788327395915985, -0.29402706027030945, 0.20470118522644043, -0.08297373354434967, 0.03266342729330063, 0.1359604448080063, 0.04032226279377937, 0.25867465138435364, 0.04011211916804314, 0.015176281332969666, 0.09430422633886337, -0.11271873116493225, 0.45301496982574463, 0.06258401274681091, 0.02001238241791725, -0.2663249671459198, 0.3501354455947876, 0.057481952011585236, 0.20202189683914185, 0.1528145968914032, 0.0397653728723526, 0.20430421829223633, 0.5122959613800049, 0.227278470993042, -0.17200423777103424, 0.11830592155456543, 0.3392484188079834, 0.11434417963027954, -0.6219898462295532, -0.42046791315078735, 0.1315898895263672, 0.3384472131729126, 0.15317308902740479, -0.3489755094051361, -0.4254489243030548, -0.08682379871606827, 0.383283793926239, 0.4183668792247772, 0.9133755564689636, -0.08134748041629791, 0.22071197628974915, 0.1281256079673767, 0.2684729993343353, 0.0743517354130745, -0.2915270924568176, 0.09574472904205322, -0.25134992599487305, -0.3022870719432831, -0.12543269991874695, -0.11515249311923981, 0.2734220623970032, 0.19948120415210724, -0.3994366526603699, 0.37668299674987793, -0.1857757717370987, -0.040350232273340225, -0.05029292404651642, -0.0414864756166935, 0.023416677489876747, -0.14223262667655945, 0.026354432106018066, 0.09114483743906021, -0.20296697318553925, 0.14877094328403473, -0.1256888508796692, -0.042594972997903824, -0.0027604103088378906, -0.1977722942829132, -0.13283289968967438, -0.03539147600531578, -0.1820184588432312, 0.09974589943885803, 0.03980356454849243, -0.4853127598762512, 0.46040400862693787, 0.066512331366539, 0.40480926632881165, 0.19069726765155792, -0.10542192310094833, -0.01789812743663788, -0.035992760211229324, -0.11844196170568466, -0.15386386215686798, 0.13607074320316315, 0.4398163855075836, -0.0545683316886425, -0.1299605816602707, 0.16557951271533966, -0.051790617406368256, -0.11862318962812424, -0.10753074288368225, 0.06680221855640411, 0.0026263026520609856, -0.28360119462013245, -0.012554395943880081, 0.0439605638384819, -0.15005898475646973, -0.29450279474258423, 0.08002919703722, -0.05264659970998764, -0.19682584702968597, 0.35229650139808655, -0.0019752150401473045, -0.15410469472408295, -0.2471877783536911, 0.3267177641391754, 0.17366990447044373, 0.2513502240180969, 0.8444502949714661, 0.15771439671516418, -0.16090628504753113, -0.09752979129552841, 0.0063733309507369995, 0.2475632131099701, -0.3966400623321533, -0.18849703669548035, 0.029010187834501266, 0.13567599654197693, -0.1444046050310135, 0.2514101564884186, 0.18122166395187378, 0.1164586991071701, -0.14120766520500183, -0.27155351638793945, -0.5937051773071289, 0.10049480199813843, -0.2069498896598816, 0.31093454360961914, -0.19931131601333618, 0.4673578441143036, 0.10122866928577423, 0.17217326164245605, -0.22579842805862427, -0.12137867510318756, -0.5442348718643188, 0.2265031933784485, 0.019110094755887985, -0.21419505774974823, -0.1215147152543068, 0.2732292115688324, -0.007360108196735382, 0.23260176181793213, -0.21715334057807922, -0.07033157348632812, -0.23705652356147766, 0.15607291460037231, 0.10635898262262344, -0.16464991867542267, -0.16378673911094666, 0.019903160631656647, -0.23516038060188293, -0.08920831233263016, -0.1393861174583435, 0.11395175755023956, 0.1282075047492981, 0.5050799250602722, 0.41867688298225403, 0.03110203891992569, 0.021410450339317322, 0.020849987864494324, 0.021968279033899307, 0.1704314947128296, 0.018022213131189346, 0.14009711146354675, 0.04855215921998024, -0.05679895728826523, -0.4574272632598877, 0.05881049856543541, 0.20499755442142487, -0.10919206589460373, -0.21717862784862518, -0.3283066153526306, 0.06412035971879959, 0.15585015714168549, 0.35690611600875854, 0.3153055012226105, -0.16010893881320953, -0.24612636864185333, 0.4587254822254181, 0.08062659204006195, -0.14776745438575745, 0.041665300726890564, 0.01480652391910553, -0.24646981060504913, -0.02904631942510605, 0.4005023241043091, 0.013189107179641724, 0.29671287536621094, 0.1958264410495758, 0.2563569247722626, -0.03651328757405281, -0.539482057094574, 0.21562525629997253, 0.3590845465660095, 0.0031274929642677307, 0.2075885534286499, 0.44340741634368896, -0.12646034359931946, 0.4155995547771454, 0.2727747857570648, -0.09368929266929626, 0.28110209107398987, 0.11503329128026962, -0.04666028916835785, -0.1001746654510498, -0.43321341276168823, -0.6665934920310974, -0.0965358167886734, 0.008557219058275223, -0.09124384820461273, -0.07475511729717255, 0.38818463683128357, 0.13665765523910522, -0.08223459124565125, -0.2498008906841278, 0.10473242402076721, -0.20782822370529175, -0.3575980067253113, -0.167373925447464, 0.029513344168663025, -0.14119452238082886, -0.18207088112831116, -0.046736232936382294, 0.05871171876788139, 0.4290800988674164, -0.06888449192047119, -0.20049737393856049, -0.10628087818622589, -0.11172430217266083, 0.46620598435401917, -0.16361086070537567, -0.22332356870174408, 0.28309211134910583, 0.1533931940793991, -0.1264844834804535, 0.06816412508487701, 0.19738677144050598, 0.4399194121360779, 0.28255072236061096, 0.03413540869951248, 0.02340918406844139, 0.13951323926448822, -0.015639528632164, 0.1077314019203186, 0.12936726212501526, 0.46438026428222656, -0.006334233563393354, 0.3646027147769928, -0.028200024738907814, -0.14407379925251007, 0.3817789554595947, -0.06200610473752022, 0.4426484704017639, -0.2926485538482666, 0.3186929225921631, 0.12685635685920715, -0.07944347709417343, 0.014246417209506035, 0.08429740369319916, -0.6330875754356384, 0.4918346703052521, 0.19813160598278046, -0.05668222904205322, 0.16213208436965942, -0.09633012861013412, -0.014185894280672073, -0.2314937263727188, 0.5901543498039246, 0.22247882187366486, 0.13825000822544098, -0.18097823858261108, -0.048654213547706604, -0.3277822434902191, -0.05746486783027649, -0.16924187541007996, 0.1811876893043518, -0.10121815651655197, 0.017573624849319458, -0.013757560402154922, 0.13729140162467957, 0.1843668520450592, -0.3694482445716858, 0.036358680576086044, 0.33463484048843384, -0.2917883098125458, 0.15032315254211426, -0.1520780622959137, 0.1387118399143219, 0.27676212787628174, -0.12919026613235474, 0.16478073596954346, 0.0227896049618721, -0.1013818308711052, -0.08544090390205383, -0.08340784907341003, 0.17635677754878998, 0.23663435876369476, 0.3367718458175659, 0.13669763505458832, 0.27219781279563904, -0.33956366777420044, 0.3669164776802063, -0.27203160524368286, -0.14405293762683868, -0.2668781280517578, 0.03466276451945305, 0.07925678789615631, 0.44695866107940674, -0.3870425224304199, -0.12240108847618103, -0.18366560339927673, -0.08862509578466415, -0.12101496756076813, 0.09309697151184082, -0.07444565743207932, 0.059938594698905945, -0.05137432739138603, -0.011648289859294891, 0.26754283905029297, 0.03858618810772896, 0.25236067175865173, 0.15645182132720947, -0.2936001420021057, -0.2126624584197998, 0.571824312210083, -0.11040177941322327, -0.16674882173538208, -0.538896918296814, -0.1872713416814804, 0.15395689010620117, -0.04594583064317703, -0.2638774514198303, 0.18409377336502075, 0.3136323094367981, 0.03143192455172539, -0.4386042058467865, 0.08298562467098236, -0.12497085332870483, 0.08324295282363892, -0.10342703759670258, 0.39922788739204407, -0.0021877968683838844, -0.1418021321296692, -0.28997164964675903, -0.30821916460990906 ]
https://github.com/huggingface/datasets/issues/5773
How did you create `train_dataset`? The `datasets` library does not appear in your stack trace. We need more information in order to reproduce the issue...
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
25
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` How did you create `train_dataset`? The `datasets` library does not appear in your stack trace. We need more information in order to reproduce the issue...
[ -0.6050503253936768, -0.03692932426929474, -0.14598283171653748, 0.05500232055783272, 0.38665422797203064, -0.057564254850149155, 0.20488183200359344, 0.09926813840866089, -0.07949262112379074, 0.3206044137477875, 0.3287934362888336, 0.2035919427871704, -0.46700623631477356, 0.29903796315193176, -0.21675355732440948, -0.2013229876756668, 0.010150652378797531, 0.10820550471544266, -0.12273047119379044, 0.23687070608139038, -0.241279736161232, 0.05839482694864273, -0.25164496898651123, -0.03164011612534523, -0.41378992795944214, -0.29647499322891235, 0.005764022469520569, 0.03913146257400513, -0.08608809858560562, -0.36621546745300293, 0.07422246038913727, -0.12065345048904419, 0.4709315001964569, 0.6992128491401672, -0.00010039372864412144, 0.010427415370941162, 0.24780544638633728, -0.05319541320204735, -0.2352263331413269, -0.06683316081762314, -0.21009835600852966, -0.24867556989192963, 0.09240017086267471, -0.43312638998031616, -0.010994143784046173, 0.05216878652572632, 0.038330718874931335, -0.25831252336502075, 0.45398077368736267, 0.4612386226654053, 0.36462026834487915, 0.3328714072704315, 0.24888095259666443, -0.11328469216823578, 0.111795574426651, -0.11560694128274918, -0.2097834050655365, 0.1836431622505188, 0.03080875054001808, -0.0030462034046649933, -0.03432561457157135, 0.006439041346311569, 0.3201483488082886, 0.14248403906822205, 0.18266966938972473, -0.21098536252975464, 0.27598631381988525, -0.4761892557144165, -0.1542573720216751, 0.09890243411064148, 0.46015262603759766, -0.1870199590921402, -0.12732085585594177, 0.09969277679920197, 0.00004394352436065674, -0.5276685357093811, 0.06389623880386353, 0.09728709608316422, 0.10488037019968033, 0.059183042496442795, -0.3239273428916931, 0.08870191872119904, -0.2711537480354309, 0.023313747718930244, 0.18347862362861633, 0.30080023407936096, -0.1310105323791504, 0.11105887591838837, -0.013272417709231377, 0.03267983719706535, 0.23768164217472076, 0.3419005572795868, 0.24566349387168884, 0.2980785369873047, -0.36475834250450134, -0.029072053730487823, -0.20501534640789032, 0.14439399540424347, 0.0572998970746994, 0.33085131645202637, -0.000798199325799942, 0.14333702623844147, 0.10393859446048737, 0.0748700499534607, -0.17528851330280304, 0.2965857684612274, 0.02129758521914482, 0.05814046412706375, 0.07446859776973724, 0.3505934476852417, 0.032423004508018494, -0.026874396950006485, -0.15714070200920105, -0.4799193739891052, 0.1742771416902542, 0.06117526441812515, -0.03803032264113426, -0.010202474892139435, -0.18768370151519775, 0.3685944080352783, -0.16772213578224182, -0.259154736995697, 0.10405229032039642, 0.2449108511209488, -0.17516571283340454, -0.11958630383014679, -0.03593095391988754, -0.045263465493917465, -0.22792483866214752, -0.16969510912895203, -0.30892643332481384, 0.1440427601337433, -0.527025580406189, 0.0932757705450058, 0.09102946519851685, -0.2846067547798157, 0.3837442994117737, 0.10806737840175629, 0.06748892366886139, -0.1843711882829666, 0.10244330018758774, -0.3689572811126709, -0.053955383598804474, 0.1905592679977417, -0.1172066479921341, 0.11275751888751984, -0.05115367844700813, 0.1689015030860901, 0.07920621335506439, 0.15215368568897247, -0.4178244471549988, -0.41907408833503723, -0.10710802674293518, 0.2368505746126175, 0.023942776024341583, 0.02402389608323574, 0.08047032356262207, 0.19954898953437805, 0.5252695679664612, 0.08929716795682907, -0.0354405902326107, -0.3432873785495758, -0.33589327335357666, -0.1688522845506668, 0.43757766485214233, -0.03684847056865692, -0.37731093168258667, -0.07271520793437958, 0.26874446868896484, -0.21037504076957703, 0.32841193675994873, 0.2247949093580246, -0.14978145062923431, 0.01243172399699688, -0.017776351422071457, 0.15990382432937622, 0.3031049370765686, 0.019336357712745667, -0.16009443998336792, 0.052929382771253586, 0.05107656121253967, -0.44937771558761597, -0.04211859032511711, -0.04817552492022514, 0.13919676840305328, -0.13166959583759308, -0.03275284171104431, 0.09558036923408508, 0.04203557223081589, -0.22614862024784088, -0.3209744095802307, -0.17588724195957184, 0.051346518099308014, 0.2509487271308899, 0.24238482117652893, -0.02975904941558838, -0.02619064599275589, 0.09753325581550598, 0.012918895110487938, -0.07068000733852386, 0.240143284201622, 0.3453714847564697, -0.029969245195388794, 0.015206418931484222, -0.05862477049231529, -0.28073179721832275, 0.10246869921684265, 0.05199483782052994, -0.0046770572662353516, 0.17058223485946655, 0.4543479382991791, 0.186006098985672, -0.25834766030311584, 0.14683108031749725, -0.17261093854904175, -0.1685100793838501, 0.21122266352176666, -0.18743182718753815, 0.0667809247970581, 0.04168158769607544, -0.1216009110212326, -0.019325919449329376, -0.6297295093536377, 0.06929277628660202, -0.26637864112854004, 0.023425057530403137, -0.3608212172985077, -0.1711909919977188, -0.030513320118188858, 0.2346360832452774, 0.07321435958147049, 0.08544829487800598, -0.1272868812084198, 0.31408941745758057, -0.0065501369535923, -0.40172672271728516, -0.3088139295578003, 0.10500865429639816, 0.031234366819262505, -0.08610187470912933, 0.021363360807299614, -0.11493226885795593, 0.024168308824300766, 0.08668839931488037, 0.22829383611679077, 0.14369770884513855, 0.06815633177757263, 0.08156293630599976, 0.0586177259683609, -0.032094091176986694, 0.202190101146698, -0.006891787052154541, -0.08652494102716446, -0.15145425498485565, 0.17514565587043762, -0.09115326404571533, 0.28506940603256226, -0.15249468386173248, -0.5749636888504028, -0.31841933727264404, 0.23499397933483124, 0.07239644229412079, -0.08974207192659378, 0.09788624942302704, -0.051215674728155136, -0.12777560949325562, 0.03339071571826935, 0.08970266580581665, 0.12991946935653687, 0.18536746501922607, 0.10135921090841293, -0.0010677864775061607, -0.3925492763519287, -0.22860589623451233, -0.01980184018611908, 0.14910165965557098, 0.3792923092842102, 0.16398927569389343, -0.1216869205236435, -0.04253660887479782, -0.04799016937613487, -0.5138601660728455, 0.023533083498477936, 0.3695681095123291, -0.3386039137840271, 0.09692837297916412, -0.3055031895637512, -0.2326665222644806, -0.2962438464164734, -0.22433717548847198, -0.16130873560905457, -0.12667986750602722, -0.040818020701408386, -0.04498714581131935, 0.14496740698814392, 0.4146648645401001, -0.17350858449935913, 0.1312151402235031, 0.18983405828475952, 0.35165169835090637, 0.1323910504579544, 0.09639483690261841, -0.2317298948764801, 0.21716001629829407, 0.03856863081455231, 0.018948573619127274, 0.22354906797409058, 0.033261142671108246, -0.02448330819606781, -0.07951746135950089, -0.21048058569431305, 0.07406744360923767, -0.030297793447971344, 0.3285881578922272, -0.11240526288747787, 0.14459168910980225, -0.11213631927967072, -0.2563087046146393, 0.13612374663352966, -0.1359235644340515, -0.06171664968132973, -0.2875661849975586, -0.11459637433290482, 0.05827042832970619, -0.14201658964157104, -0.16185262799263, -0.3327687084674835, -0.3214360773563385, -0.06327907741069794, 0.38488155603408813, 0.13262689113616943, 0.05684935674071312, 0.2103479653596878, 0.16945263743400574, 0.2547359764575958, 0.0894695445895195, -0.2947080731391907, -0.5040347576141357, 0.4482242465019226, -0.3819577097892761, -0.3425050377845764, 0.06368932127952576, -0.028564047068357468, 0.3108222782611847, 0.17466098070144653, -0.3367440700531006, -0.012216150760650635, -0.13572949171066284, -0.10239524394273758, -0.21579501032829285, -0.018003806471824646, 0.29836705327033997, -0.18689757585525513, -0.11584129929542542, -0.08459357172250748, -0.13413920998573303, 0.40376144647598267, -0.18645954132080078, 0.254653662443161, -0.030408937484025955, 0.6424729824066162, -0.026515711098909378, 0.8656583428382874, 0.1861155927181244, -0.3599604070186615, 0.40126678347587585, -0.006959165446460247, 0.0919303148984909, -0.21541041135787964, 0.1688646674156189, 0.3760490119457245, 0.008362866938114166, 0.025338873267173767, 0.1980837881565094, -0.10371360927820206, -0.31070348620414734, -0.07577195763587952, -0.0582011342048645, 0.05771511793136597, 0.005418151617050171, -0.0030423905700445175, -0.1979665458202362, 0.45929208397865295, -0.2862620949745178, 0.08310140669345856, 0.1459420770406723, -0.07644868642091751, -0.1508418619632721, 0.13287106156349182, -0.07417777180671692, 0.14940863847732544, -0.48586466908454895, 0.08224104344844818, -0.44328755140304565, 0.21149134635925293, -0.02263540029525757, 0.5887855291366577, -0.11616558581590652, -0.21412213146686554, 0.09811705350875854, -0.0003304705023765564, 0.15700769424438477, -0.06857514381408691, -0.15543967485427856, 0.09808090329170227, 0.0035116150975227356, -0.2494262456893921, -0.3164529502391815, -0.15202081203460693, 0.28704145550727844, -0.023226186633110046, 0.18480415642261505, 0.031164109706878662, -0.005339149385690689, 0.23106679320335388, -0.0003680512309074402, -0.058134861290454865, -0.17537549138069153, -0.16895759105682373, -0.10619118064641953, -0.25728195905685425, 0.36418452858924866, 0.13637642562389374, 0.18439963459968567, -0.09200307726860046, 0.05421125888824463, -0.03288629278540611, 0.002124376595020294, 0.13725727796554565, -0.06562864035367966, 0.2126011997461319, 0.0652025118470192, 0.11872494220733643, 0.012066857889294624, 0.03938648849725723, 0.4878997206687927, 0.08736634254455566, -0.16994298994541168, -0.17126116156578064, 0.3964694142341614, -0.09261147677898407, 0.14424824714660645, 0.08331374078989029, 0.018737949430942535, 0.11061568558216095, 0.44146037101745605, 0.32777655124664307, -0.22579556703567505, 0.25533348321914673, 0.25571903586387634, 0.17232511937618256, -0.7495517730712891, -0.5001804232597351, 0.03489849343895912, 0.29156363010406494, 0.14082996547222137, 0.16794335842132568, -0.3843943178653717, -0.08908519148826599, 0.05847492441534996, 0.3495912551879883, 0.7345545887947083, -0.032968390733003616, 0.07912544906139374, 0.13010796904563904, 0.26331180334091187, 0.1297677904367447, -0.041833944618701935, -0.0031014271080493927, -0.3021288514137268, -0.3579724133014679, -0.05657678470015526, -0.042154695838689804, 0.20872066915035248, 0.05166154354810715, -0.1779012233018875, 0.3275667428970337, -0.09901975095272064, -0.0323149748146534, -0.07159252464771271, 0.18367604911327362, 0.07365185767412186, -0.1432187706232071, -0.048023659735918045, 0.27507269382476807, -0.18307344615459442, -0.07844942063093185, -0.11114731431007385, -0.011000027880072594, -0.007103875279426575, -0.044600024819374084, -0.09962870925664902, -0.07814611494541168, -0.18077056109905243, 0.1409795880317688, -0.05962156876921654, -0.39782094955444336, 0.3234390318393707, 0.0905189961194992, 0.4461700916290283, 0.030871953815221786, -0.1722487360239029, 0.08617040514945984, -0.09148425608873367, -0.17016226053237915, -0.18084684014320374, 0.015008214861154556, 0.5272040367126465, -0.2329598367214203, -0.021629080176353455, 0.06197962909936905, 0.015008024871349335, -0.17965060472488403, -0.16052132844924927, 0.06197323650121689, -0.06335724890232086, -0.19915427267551422, -0.08117478340864182, 0.12420526146888733, -0.005125090479850769, -0.16360190510749817, 0.26612910628318787, -0.012747839093208313, -0.017659025266766548, 0.3273501694202423, 0.13335007429122925, -0.17432157695293427, -0.2520179748535156, 0.19418247044086456, 0.10898762941360474, 0.19025179743766785, 0.5918695330619812, 0.2217543125152588, -0.19850918650627136, -0.18009847402572632, -0.046385280787944794, 0.3124731183052063, -0.1793700009584427, -0.11291377246379852, 0.06128259748220444, 0.2576267123222351, 0.16920840740203857, 0.13091705739498138, 0.11649839580059052, 0.09188348054885864, 0.025871627032756805, -0.2171185314655304, -0.6239890456199646, -0.022377900779247284, -0.32312875986099243, 0.28469324111938477, 0.023502804338932037, 0.24171176552772522, 0.183788001537323, 0.05757874250411987, -0.4235188364982605, -0.09083706140518188, -0.4423850178718567, 0.1410614550113678, 0.034060414880514145, -0.18726789951324463, -0.15215714275836945, 0.23721177875995636, 0.10420358926057816, 0.20885373651981354, -0.32222115993499756, -0.24057194590568542, -0.20923185348510742, 0.034954383969306946, 0.014505431056022644, -0.07067815959453583, -0.060454804450273514, -0.13067051768302917, -0.4027634263038635, -0.0021285153925418854, -0.17531904578208923, 0.12212909013032913, -0.05265094339847565, 0.2927749454975128, 0.27484601736068726, 0.046914488077163696, 0.23408041894435883, -0.03605842590332031, 0.08214616775512695, 0.177219957113266, 0.10551247000694275, 0.09217610955238342, 0.14803028106689453, -0.03782622516155243, -0.42279139161109924, 0.07086871564388275, 0.06000505015254021, -0.11771930009126663, -0.28279003500938416, -0.19968178868293762, 0.08092185854911804, 0.11647538095712662, 0.3977784514427185, 0.2619289457798004, -0.12495297193527222, -0.263092041015625, 0.556876540184021, 0.2753944993019104, -0.1524178832769394, -0.01096327230334282, 0.15230226516723633, -0.12580007314682007, 0.1014275848865509, 0.19253072142601013, 0.1588938981294632, 0.1849726140499115, 0.03529510274529457, 0.20838651061058044, -0.07829195261001587, -0.45565712451934814, 0.21647067368030548, 0.020889710634946823, -0.05198683589696884, 0.10052138566970825, 0.4054524004459381, 0.013138821348547935, 0.23119181394577026, 0.4148963391780853, -0.0600171759724617, 0.3923763036727905, 0.4319286644458771, -0.09668971598148346, -0.10997964441776276, -0.5420518517494202, -0.4450417459011078, 0.07701851427555084, -0.1255815029144287, 0.01816335693001747, -0.03611486032605171, 0.6293962001800537, 0.07323066145181656, -0.23137733340263367, -0.1670568585395813, 0.0637204647064209, -0.2939087450504303, -0.16211193799972534, -0.3045459985733032, -0.09390746802091599, 0.045834124088287354, -0.07627122849225998, -0.005062003619968891, 0.12765300273895264, 0.31766852736473083, -0.15730233490467072, -0.2528071999549866, -0.07237247377634048, -0.0066724177449941635, 0.2717990577220917, 0.0000610649585723877, -0.08001790940761566, 0.36022934317588806, -0.007157765328884125, -0.14553111791610718, 0.16826242208480835, 0.008045641705393791, 0.4847894608974457, 0.2900637090206146, 0.19433020055294037, -0.05865361541509628, 0.15611813962459564, -0.01121211051940918, 0.007115118205547333, 0.22284184396266937, 0.46641701459884644, -0.10475103557109833, 0.5173284411430359, 0.15204495191574097, -0.26569661498069763, 0.36626195907592773, 0.0027064215391874313, 0.4549329876899719, -0.22170817852020264, -0.010322440415620804, 0.12609094381332397, -0.03286026418209076, -0.10358205437660217, 0.0031752437353134155, -0.4581727087497711, 0.3039688467979431, 0.15096168220043182, -0.08055514097213745, 0.05347222089767456, -0.19763706624507904, 0.1267954558134079, -0.2752440869808197, 0.6439372897148132, 0.19610311090946198, 0.1865280419588089, -0.03993303328752518, -0.3182080388069153, -0.47162872552871704, 0.06541261076927185, -0.1883615106344223, 0.1268363893032074, -0.08563093096017838, -0.056397825479507446, 0.012047220021486282, 0.009596286341547966, 0.4080362915992737, -0.28807035088539124, 0.12383221089839935, 0.2694888710975647, -0.37418603897094727, 0.1868293136358261, -0.29427435994148254, 0.0717199295759201, 0.19098493456840515, -0.0168108269572258, 0.1592329740524292, -0.09627562761306763, 0.08807514607906342, -0.0275350883603096, -0.09732616692781448, 0.06106793135404587, 0.3130505681037903, 0.3973000645637512, 0.07055854797363281, 0.2661842405796051, -0.2258571982383728, 0.3567392826080322, -0.20796413719654083, -0.0050494372844696045, -0.2082272469997406, 0.11367574334144592, 0.2119286060333252, 0.35116010904312134, -0.2834048271179199, -0.10205765068531036, -0.06665853410959244, 0.21627622842788696, -0.07313283532857895, 0.11491929739713669, -0.10474717617034912, 0.08310222625732422, 0.09479045867919922, -0.07292047142982483, 0.14459477365016937, 0.2083573341369629, 0.2457299530506134, 0.021701708436012268, -0.3084375262260437, -0.27853065729141235, 0.4310769736766815, -0.18212971091270447, -0.20811714231967926, -0.4251166880130768, -0.14988654851913452, 0.3160669505596161, -0.046837761998176575, -0.43854159116744995, 0.06302711367607117, 0.2623574435710907, -0.07150401175022125, -0.34193935990333557, 0.3671269714832306, -0.38596516847610474, 0.19393759965896606, 0.05248004198074341, 0.24769806861877441, 0.044081613421440125, -0.1923297643661499, -0.10699065029621124, -0.2542814612388611 ]
https://github.com/huggingface/datasets/issues/5773
``` def asr_dataset(traindir,devdir): we_voice = IterableDatasetDict() #we_voice["train"] = load_from_disk(traindir,streaming=True) #we_voice["test"]= load_from_disk(devdir,streaming=True) we_voice["train"] = load_dataset("csv",data_files=os.path.join(traindir,"train.csv"),split="train",streaming=True) #print(load_dataset("csv",data_files=os.path.join(traindir,"train.csv"),split="train")) we_voice["test"] = load_dataset("csv",data_files=os.path.join(devdir,"dev.csv"), split="train",streaming=True) we_voice = we_voice.remove_columns(["id"]) we_voice = we_voice.cast_column("audio", Audio(sampling_rate=16000)) return we_voice ```
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
29
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` ``` def asr_dataset(traindir,devdir): we_voice = IterableDatasetDict() #we_voice["train"] = load_from_disk(traindir,streaming=True) #we_voice["test"]= load_from_disk(devdir,streaming=True) we_voice["train"] = load_dataset("csv",data_files=os.path.join(traindir,"train.csv"),split="train",streaming=True) #print(load_dataset("csv",data_files=os.path.join(traindir,"train.csv"),split="train")) we_voice["test"] = load_dataset("csv",data_files=os.path.join(devdir,"dev.csv"), split="train",streaming=True) we_voice = we_voice.remove_columns(["id"]) we_voice = we_voice.cast_column("audio", Audio(sampling_rate=16000)) return we_voice ```
[ -0.6036391258239746, -0.22139286994934082, -0.1419200897216797, 0.06833173334598541, 0.4781287610530853, 0.003932587802410126, 0.2760462164878845, 0.06601475924253464, -0.1648501604795456, 0.4750373959541321, 0.038059428334236145, 0.050733305513858795, -0.5506958365440369, 0.15972232818603516, -0.2657834589481354, -0.1544002890586853, 0.08002321422100067, 0.09578564763069153, 0.018837515264749527, 0.1598556786775589, -0.37403029203414917, 0.15832410752773285, -0.2190483808517456, -0.08329707384109497, -0.2908051908016205, -0.23504357039928436, -0.02458307147026062, -0.02137055993080139, -0.16432684659957886, -0.49455106258392334, -0.06472201645374298, -0.0771334320306778, 0.4849562644958496, 0.7385935187339783, -0.0001168825983768329, 0.09504371881484985, 0.1762445867061615, -0.17804595828056335, -0.2909092307090759, -0.017323218286037445, -0.12906695902347565, -0.20818927884101868, -0.009347308427095413, -0.43235069513320923, -0.014391198754310608, -0.11071474850177765, 0.031005987897515297, -0.31348246335983276, 0.5685505867004395, 0.5137787461280823, 0.1939394772052765, 0.30022716522216797, 0.08459492772817612, 0.02106267586350441, -0.10970495641231537, -0.137715682387352, 0.06314128637313843, 0.22905604541301727, -0.01427525281906128, 0.09086336195468903, 0.08067633211612701, 0.047003574669361115, 0.12425532937049866, 0.05364576727151871, -0.02547357603907585, -0.1485411822795868, 0.19687344133853912, -0.6378613710403442, -0.16931714117527008, 0.11306169629096985, 0.45025795698165894, -0.2605073153972626, -0.2956726551055908, 0.078602135181427, 0.024322111159563065, -0.7230955958366394, -0.03158640116453171, 0.2211804836988449, 0.06201564893126488, 0.13665808737277985, -0.3587917983531952, 0.22170403599739075, -0.2791961133480072, 0.07756862789392471, 0.28800803422927856, 0.3439429700374603, -0.15168167650699615, 0.0850648283958435, 0.07473192363977432, -0.0060212267562747, 0.2299899011850357, 0.13569113612174988, 0.25407496094703674, 0.3409556746482849, -0.515330970287323, -0.1735723316669464, -0.2617449164390564, 0.0022381115704774857, 0.015862949192523956, 0.19767943024635315, 0.22856704890727997, 0.051259253174066544, 0.16676145792007446, 0.06950127333402634, -0.0986839085817337, 0.3275492489337921, 0.04293017089366913, 0.06457636505365372, 0.1449904441833496, 0.3906431794166565, 0.030190572142601013, -0.07679128646850586, -0.26518183946609497, -0.4887053072452545, 0.2865568697452545, 0.1455368846654892, 0.050167620182037354, -0.04203774034976959, -0.31899493932724, 0.3348340690135956, -0.2877958416938782, -0.31048575043678284, 0.10438056290149689, 0.340875506401062, -0.04232713580131531, 0.1286887228488922, -0.1469930112361908, 0.16388189792633057, -0.1392855942249298, -0.1517896056175232, -0.1813211292028427, 0.11208770424127579, -0.22216758131980896, 0.06294167041778564, 0.06333139538764954, -0.2501465976238251, 0.4803588092327118, 0.11081564426422119, 0.1669638603925705, -0.21420599520206451, -0.12552538514137268, -0.46685612201690674, 0.010496631264686584, 0.23135781288146973, -0.02233930677175522, 0.0934712290763855, -0.07600711286067963, 0.14829838275909424, -0.03690570592880249, 0.20684325695037842, -0.2798808515071869, -0.4324709475040436, 0.014510678127408028, 0.14491547644138336, -0.03940606862306595, -0.013739034533500671, 0.050220634788274765, 0.23530304431915283, 0.6361111998558044, 0.06864339113235474, 0.08999606966972351, -0.35785362124443054, -0.5281952619552612, -0.1439000815153122, 0.3735363483428955, -0.07711449265480042, -0.40982407331466675, -0.06734077632427216, 0.30361199378967285, -0.1597917526960373, 0.3349514603614807, 0.46619319915771484, -0.05236894264817238, 0.06583423912525177, -0.06730081140995026, 0.19758331775665283, 0.3926030099391937, -0.09834430366754532, -0.3700101375579834, 0.037283338606357574, 0.20691543817520142, -0.18806985020637512, 0.27057191729545593, -0.05287645012140274, 0.2574518620967865, -0.14365972578525543, 0.149348646402359, 0.22116804122924805, 0.0746615082025528, -0.21490873396396637, -0.22320076823234558, -0.25119611620903015, 0.02486082911491394, 0.2013595551252365, 0.09816455841064453, 0.13778018951416016, -0.030634716153144836, -0.07375993579626083, 0.12295174598693848, -0.13780713081359863, 0.20511206984519958, 0.4191749691963196, -0.05678471550345421, -0.09085378050804138, -0.05358662083745003, -0.32405930757522583, 0.10875866562128067, -0.0026685521006584167, 0.0015944764018058777, 0.12446898221969604, 0.4088066816329956, 0.08763295412063599, -0.3056985139846802, 0.14844298362731934, -0.24383562803268433, -0.17027929425239563, 0.08134524524211884, -0.11020074784755707, 0.18718047440052032, -0.041410572826862335, -0.14633315801620483, -0.017644379287958145, -0.6268628239631653, -0.007550444453954697, -0.15976908802986145, 0.0450347363948822, -0.3175245523452759, -0.2354539930820465, 0.00009889155626296997, 0.39844971895217896, 0.1152854859828949, 0.04154844582080841, -0.10718272626399994, 0.3347342014312744, 0.019555140286684036, -0.31555065512657166, -0.5369638204574585, 0.18587042391300201, 0.0633021667599678, -0.13978351652622223, 0.04993195831775665, -0.034680016338825226, 0.07993466407060623, 0.08469031751155853, 0.20622947812080383, 0.32579848170280457, 0.12288875877857208, 0.15998509526252747, 0.19948431849479675, 0.034137263894081116, 0.30578914284706116, 0.16320842504501343, -0.24299520254135132, -0.0389021635055542, 0.18193520605564117, -0.25951045751571655, 0.34523770213127136, -0.08247686922550201, -0.6302303671836853, -0.40502068400382996, 0.43646353483200073, 0.022471308708190918, -0.13936947286128998, 0.20866799354553223, -0.108891062438488, -0.15418636798858643, -0.052409954369068146, -0.12268529087305069, 0.23472914099693298, 0.1536654531955719, 0.05989234894514084, -0.02024678885936737, -0.25094908475875854, -0.09179575741291046, 0.08650247752666473, 0.18395525217056274, 0.22200386226177216, 0.3017301857471466, -0.11303362995386124, -0.054535821080207825, -0.08531714975833893, -0.5200181007385254, 0.0332237109541893, 0.36869364976882935, -0.48380446434020996, -0.00067911297082901, -0.13426679372787476, -0.1155163049697876, -0.36683011054992676, -0.33566367626190186, -0.07245127856731415, -0.055752456188201904, -0.12407433986663818, 0.14736847579479218, 0.14778490364551544, 0.36039334535598755, -0.22469580173492432, 0.07046574354171753, 0.22349612414836884, 0.19612719118595123, 0.19659292697906494, 0.2712055444717407, 0.013508643954992294, 0.07290402054786682, 0.07703648507595062, -0.11991481482982635, 0.08281373232603073, 0.07251664251089096, -0.11845201998949051, 0.03455507755279541, -0.10238976031541824, 0.0077707115560770035, -0.005453817546367645, 0.3979012370109558, -0.17351296544075012, 0.10118995606899261, -0.0626915767788887, -0.38544386625289917, 0.07930070906877518, -0.07988625019788742, -0.08309639245271683, -0.16842740774154663, -0.048739656805992126, 0.012927539646625519, -0.05190310254693031, -0.11082253605127335, -0.4701600968837738, -0.36755460500717163, -0.08193264901638031, 0.3092151880264282, 0.1807754635810852, 0.12801633775234222, 0.2586750388145447, 0.06094064936041832, 0.3756037950515747, 0.07764244824647903, -0.22081412374973297, -0.35524982213974, 0.406367689371109, -0.33850887417793274, -0.2350461483001709, -0.08268875628709793, -0.20610643923282623, 0.39080309867858887, 0.21318064630031586, -0.18625660240650177, -0.05332568287849426, -0.27560919523239136, -0.020238228142261505, -0.15965603291988373, -0.04494336247444153, 0.3375694751739502, -0.10445746779441833, -0.0005197860300540924, -0.0668657124042511, -0.1749877631664276, 0.3109692335128784, -0.016739018261432648, 0.014647644013166428, 0.08160882443189621, 0.7994980216026306, -0.1699601709842682, 0.9571393728256226, 0.31680721044540405, -0.24981965124607086, 0.5168620944023132, -0.09931223094463348, 0.10552185773849487, -0.15164704620838165, 0.07996661216020584, 0.3653041124343872, 0.08690142631530762, -0.060471195727586746, 0.30462825298309326, -0.20414336025714874, -0.2551741600036621, 0.035243451595306396, 0.04307739436626434, -0.030090607702732086, 0.04273318499326706, 0.026537762954831123, -0.31854721903800964, 0.4819958508014679, -0.3216397166252136, 0.19358982145786285, 0.28630754351615906, -0.08560476452112198, -0.2165743112564087, 0.12736889719963074, -0.0410090871155262, 0.1603202074766159, -0.5827984809875488, -0.13879136741161346, -0.569738507270813, 0.2773014008998871, 0.15190193057060242, 0.8352972269058228, -0.11532758921384811, -0.15372653305530548, 0.08872544765472412, 0.10737919062376022, 0.23889915645122528, -0.23935672640800476, -0.19799941778182983, 0.13045966625213623, 0.1012064665555954, -0.21109294891357422, -0.19713251292705536, -0.1723736822605133, 0.1910223364830017, -0.1541786640882492, 0.19733214378356934, 0.1250344216823578, -0.061550963670015335, 0.24537166953086853, 0.24764959514141083, -0.01992400735616684, -0.06495913118124008, -0.2525034546852112, -0.1950642466545105, -0.21515387296676636, 0.41613125801086426, 0.11001942306756973, 0.2643894851207733, -0.3179820775985718, 0.27302584052085876, -0.12168537825345993, -0.05995284020900726, 0.2927270531654358, -0.06585563719272614, 0.319427490234375, 0.029159322381019592, 0.14542755484580994, 0.11778981983661652, -0.033019427210092545, 0.3780594766139984, 0.295700341463089, -0.2853366732597351, -0.4309499263763428, 0.3112332820892334, 0.047524161636829376, 0.39206671714782715, 0.19114750623703003, 0.0015258565545082092, 0.11755102872848511, 0.4916927218437195, 0.2752222716808319, -0.22560355067253113, 0.23269957304000854, 0.2941187024116516, 0.3242514431476593, -0.6563379168510437, -0.630885124206543, 0.007177792489528656, 0.2660224437713623, 0.09062343835830688, -0.01966884918510914, -0.2959820330142975, -0.14174410700798035, 0.335741251707077, 0.12644121050834656, 0.7958869338035583, -0.019248243421316147, 0.2203972339630127, 0.14280453324317932, 0.21540571749210358, -0.07029055058956146, -0.009828053414821625, 0.20265407860279083, -0.13736975193023682, -0.2908429503440857, -0.09162884950637817, 0.01874052733182907, 0.20640641450881958, 0.2711738646030426, -0.40941622853279114, 0.4323679804801941, -0.14549386501312256, -0.10180004686117172, -0.08512675762176514, 0.2492567002773285, -0.0232384093105793, -0.2616385817527771, -0.22436603903770447, 0.12874582409858704, -0.07087522745132446, -0.02278791181743145, 0.00625976175069809, 0.050755586475133896, 0.034236423671245575, -0.17049941420555115, -0.06119100749492645, -0.068662129342556, -0.22150765359401703, 0.07549886405467987, -0.3188619613647461, -0.5803614258766174, 0.36647868156433105, 0.28922510147094727, 0.40845566987991333, 0.0435662679374218, -0.06515233963727951, -0.02360566146671772, 0.04939461871981621, 0.014584984630346298, -0.11377714574337006, 0.04770742729306221, 0.42463669180870056, -0.10181845724582672, -0.11723241955041885, 0.16795408725738525, 0.0617794468998909, -0.18362435698509216, -0.1148519292473793, 0.03716170787811279, 0.04398346319794655, -0.3178163170814514, -0.19460704922676086, 0.049634501338005066, -0.13067692518234253, -0.18592318892478943, 0.1031278595328331, -0.06812658905982971, -0.15161602199077606, 0.37038373947143555, 0.03495911881327629, -0.22175727784633636, -0.2490295171737671, 0.27059614658355713, 0.10881579667329788, 0.1815958321094513, 0.8905023336410522, -0.03923351317644119, -0.15621156990528107, -0.13716155290603638, -0.16411854326725006, 0.20918723940849304, -0.1601504385471344, -0.11323574185371399, 0.0715784952044487, 0.2781398594379425, -0.15278278291225433, 0.03279215842485428, 0.006828162353485823, 0.12019193172454834, -0.021527491509914398, -0.37161946296691895, -0.6855015754699707, 0.04995259642601013, -0.17461009323596954, 0.3611825704574585, -0.07074202597141266, 0.18257476389408112, 0.12312077730894089, 0.004679741337895393, -0.2754771411418915, -0.11308135092258453, -0.40479448437690735, 0.15559972822666168, 0.1158156543970108, -0.1563704013824463, -0.017828164622187614, 0.243562251329422, 0.09078424423933029, 0.07757237553596497, -0.1977662742137909, -0.11835575103759766, -0.29550737142562866, 0.13028334081172943, 0.04655665159225464, -0.18521060049533844, 0.02391597256064415, -0.08277550339698792, -0.37685129046440125, -0.14581379294395447, -0.20320278406143188, 0.15111397206783295, -0.045691460371017456, 0.2877461612224579, 0.1858849823474884, 0.10594916343688965, 0.26370546221733093, -0.010675358586013317, 0.020066246390342712, 0.15235751867294312, 0.0898604467511177, 0.2446826696395874, 0.09957994520664215, -0.01195516437292099, -0.3600439727306366, -0.007157996296882629, 0.26063141226768494, -0.21408221125602722, -0.28062066435813904, -0.20573896169662476, 0.10317917913198471, 0.1728459745645523, 0.520568311214447, 0.32119283080101013, -0.2263663113117218, -0.21923112869262695, 0.6366487145423889, 0.12909112870693207, -0.11901471018791199, 0.0753716230392456, 0.20603640377521515, -0.19114284217357635, 0.0998629480600357, 0.40399134159088135, 0.14348110556602478, 0.3476260304450989, 0.08519943803548813, 0.09042313694953918, -0.0201338492333889, -0.34973788261413574, 0.1688811182975769, 0.17241764068603516, 0.131892129778862, 0.13068364560604095, 0.3579469621181488, 0.035335686057806015, 0.2863921523094177, 0.44595447182655334, -0.21744076907634735, 0.2876966595649719, 0.2614157199859619, -0.19002749025821686, -0.0765710324048996, -0.5196545124053955, -0.4758068323135376, 0.011160805821418762, -0.16408292949199677, 0.12309034168720245, -0.03746810555458069, 0.5910221934318542, -0.10144360363483429, -0.12293203175067902, -0.09334953874349594, 0.06832093745470047, -0.26777786016464233, -0.2761286199092865, -0.17698487639427185, 0.024662211537361145, 0.03975309431552887, -0.15138104557991028, 0.10572651028633118, 0.13896718621253967, 0.34322798252105713, -0.10491255670785904, -0.21674133837223053, -0.11094698309898376, -0.07670926302671432, 0.4394153356552124, -0.004302583634853363, -0.1962273120880127, 0.3734011948108673, 0.054930318146944046, -0.09117427468299866, 0.2872944176197052, 0.18609629571437836, 0.5890707969665527, 0.2938915491104126, 0.12534166872501373, 0.046352412551641464, 0.07272221893072128, -0.026203181594610214, -0.005150709301233292, 0.11966156214475632, 0.4155103266239166, 0.0022089220583438873, 0.5511823892593384, 0.01126592606306076, -0.16198743879795074, 0.2865133285522461, 0.17291301488876343, 0.38629937171936035, -0.24118712544441223, 0.011251833289861679, 0.04112623259425163, -0.12402917444705963, -0.0932781845331192, -0.040712274610996246, -0.4751574397087097, 0.328045129776001, 0.02217106893658638, -0.10053390264511108, 0.13535520434379578, -0.1566271334886551, 0.03181304410099983, -0.24999791383743286, 0.5235782861709595, 0.25628232955932617, 0.21565461158752441, -0.13494519889354706, -0.16206476092338562, -0.46705591678619385, -0.1685028076171875, -0.1438290774822235, 0.05117727816104889, -0.10240106284618378, 0.01800493150949478, -0.030915189534425735, 0.09299799799919128, 0.3111828565597534, -0.31088852882385254, -0.04809461161494255, 0.455580472946167, -0.28626134991645813, 0.03287313133478165, -0.1917654275894165, 0.17755556106567383, 0.18258337676525116, -0.2866126298904419, 0.07702251523733139, -0.07797874510288239, -0.05979376286268234, 0.03387276083230972, 0.02947385609149933, 0.0000972449779510498, 0.2239810824394226, 0.2304627150297165, 0.07498671859502792, 0.5264087319374084, -0.3944401144981384, 0.32922208309173584, -0.12875504791736603, -0.07242246717214584, -0.4362444579601288, 0.0460381954908371, 0.18672162294387817, 0.5357361435890198, -0.40539926290512085, -0.12674936652183533, -0.07677929848432541, 0.15946711599826813, -0.09759864956140518, -0.07746340334415436, -0.04401735961437225, 0.1569773554801941, -0.01648440957069397, 0.1131972074508667, 0.19528016448020935, 0.1380424052476883, 0.19191527366638184, 0.18885385990142822, -0.31835925579071045, -0.27647683024406433, 0.4978692829608917, -0.21892035007476807, -0.21520820260047913, -0.4505099952220917, -0.01412065327167511, 0.18437054753303528, -0.13234259188175201, -0.35603633522987366, 0.11370953917503357, 0.3489534556865692, -0.039056435227394104, -0.38232749700546265, 0.3504147231578827, -0.3303331434726715, 0.11478883028030396, 0.007594689726829529, 0.23967614769935608, 0.10944792628288269, -0.3260035514831543, -0.09407929331064224, -0.3478754460811615 ]
https://github.com/huggingface/datasets/issues/5773
As you are using iterable datasets (`streaming=True`), their length is not defined. You should: - Either use non-iterable datasets, which have a defined length: use `DatasetDict` and not passing `streaming=True` - Or pass `args.max_steps` to the `Trainer`
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
37
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` As you are using iterable datasets (`streaming=True`), their length is not defined. You should: - Either use non-iterable datasets, which have a defined length: use `DatasetDict` and not passing `streaming=True` - Or pass `args.max_steps` to the `Trainer`
[ -0.527402937412262, -0.20840904116630554, -0.1405806541442871, 0.0275887344032526, 0.40882408618927, -0.09522216022014618, 0.18307887017726898, 0.1347787231206894, -0.14450517296791077, 0.426193505525589, 0.24970772862434387, 0.06304583698511124, -0.4335055947303772, 0.36071711778640747, -0.21943442523479462, -0.2502134144306183, -0.02557232230901718, 0.1535564661026001, -0.10495877265930176, 0.23669056594371796, -0.1622130423784256, 0.06808990240097046, -0.2465415745973587, -0.0855816975235939, -0.3142200708389282, -0.2718132734298706, -0.011907175183296204, -0.06210274621844292, -0.03186928853392601, -0.4433966875076294, -0.08394553512334824, -0.06936267018318176, 0.39034128189086914, 0.6216738820075989, -0.00010292196384398267, 0.022399619221687317, 0.2548886239528656, -0.09078852832317352, -0.31718379259109497, 0.006041370332241058, -0.15127959847450256, -0.1320188194513321, 0.10164090991020203, -0.42108064889907837, -0.13956677913665771, 0.076790951192379, 0.06613289564847946, -0.2086324840784073, 0.5059970617294312, 0.5185586810112, 0.34096214175224304, 0.30594444274902344, 0.10095223784446716, -0.1733374446630478, -0.0030495822429656982, -0.18917930126190186, -0.07139121741056442, 0.1313047558069229, 0.09805608540773392, 0.08731205016374588, -0.10990872979164124, 0.11063657701015472, 0.30410236120224, 0.17140981554985046, 0.21249674260616302, -0.2107321172952652, 0.2618478834629059, -0.44405677914619446, -0.04405494034290314, 0.14826972782611847, 0.4013001620769501, -0.08908633887767792, -0.08510816842317581, 0.024026989936828613, 0.09466689825057983, -0.5935350656509399, 0.08590153604745865, 0.09886634349822998, 0.03261066973209381, 0.009767074137926102, -0.36972713470458984, 0.1557994782924652, -0.3331688344478607, -0.004677318036556244, 0.10848727822303772, 0.2646324336528778, -0.10256260633468628, 0.09013764560222626, 0.02919609844684601, 0.00532384030520916, 0.29552754759788513, 0.18723821640014648, 0.2565869987010956, 0.25806835293769836, -0.38232558965682983, -0.10698983073234558, -0.20762178301811218, 0.09108445793390274, -0.04430752992630005, 0.22218884527683258, 0.23622742295265198, 0.11381278932094574, 0.2323155403137207, -0.015979664400219917, -0.13412752747535706, 0.25296884775161743, -0.015113946050405502, 0.09064845740795135, -0.023845233023166656, 0.3931199014186859, -0.0331905297935009, -0.07971745729446411, -0.09717807173728943, -0.43693625926971436, 0.1509484350681305, 0.019949156790971756, -0.09465450048446655, 0.0129619762301445, -0.253261923789978, 0.38341134786605835, -0.2373252511024475, -0.14143094420433044, 0.15786126255989075, 0.20727065205574036, -0.23123058676719666, -0.05857635289430618, -0.12099575251340866, -0.00305250845849514, -0.20430192351341248, -0.20311260223388672, -0.2922300696372986, 0.08132915198802948, -0.35183870792388916, 0.12840819358825684, 0.10625343024730682, -0.26809364557266235, 0.38621172308921814, -0.001930389553308487, 0.15882998704910278, -0.1607442945241928, 0.06810065358877182, -0.44932815432548523, -0.005610380321741104, 0.11038041114807129, -0.049874745309352875, -0.005699243396520615, -0.015913110226392746, 0.021319203078746796, 0.0747990608215332, 0.13812771439552307, -0.28805872797966003, -0.42052456736564636, 0.0454709455370903, 0.27538031339645386, 0.020653530955314636, 0.034332893788814545, 0.04481828957796097, 0.26728710532188416, 0.4794532358646393, 0.01732662320137024, -0.008220765739679337, -0.3326501250267029, -0.39007240533828735, -0.07346352934837341, 0.4346681833267212, -0.06520430743694305, -0.23506426811218262, -0.1669534146785736, 0.35996729135513306, -0.13192972540855408, 0.29192760586738586, 0.2223353534936905, -0.1352032572031021, 0.0023848973214626312, -0.004683211445808411, 0.20559906959533691, 0.28105467557907104, 0.0076342374086380005, -0.19186992943286896, 0.17272412776947021, -0.004852801561355591, -0.25935041904449463, 0.05733583867549896, -0.07043377310037613, 0.3140081763267517, -0.07582496851682663, 0.048939239233732224, 0.10265618562698364, -0.06120605766773224, -0.17714673280715942, -0.3612220585346222, -0.12717297673225403, 0.04814913123846054, 0.24284042418003082, 0.2965962588787079, -0.040854960680007935, -0.08603610843420029, 0.16785071790218353, 0.06455472111701965, -0.061121005564928055, 0.2587263286113739, 0.33031368255615234, -0.1005726158618927, 0.042958054691553116, -0.09391919523477554, -0.1845540702342987, 0.09978203475475311, 0.07122824341058731, 0.026076816022396088, 0.11652354896068573, 0.4622126519680023, 0.12794604897499084, -0.22036339342594147, 0.10926466435194016, -0.18991009891033173, -0.18407386541366577, 0.24025584757328033, -0.11305354535579681, 0.0933973416686058, 0.001743033528327942, -0.062110088765621185, 0.0646803006529808, -0.7300995588302612, 0.021008003503084183, -0.24520760774612427, 0.0521293580532074, -0.31856560707092285, -0.18325233459472656, 0.04352840781211853, 0.1830119490623474, 0.1471233069896698, 0.06968531012535095, -0.15819530189037323, 0.32138949632644653, -0.0809497982263565, -0.26588720083236694, -0.2276386022567749, 0.09898865222930908, 0.1149437353014946, -0.1828506886959076, -0.074334517121315, 0.03309980034828186, 0.03529166057705879, -0.04004501551389694, 0.15025858581066132, 0.19372659921646118, 0.05815157666802406, 0.14292581379413605, 0.1671983003616333, -0.052234798669815063, 0.16256925463676453, 0.12040048092603683, -0.28157854080200195, -0.06625683605670929, 0.1511160135269165, -0.1218273788690567, 0.22140268981456757, -0.18067701160907745, -0.6169804334640503, -0.2983483076095581, 0.29572299122810364, 0.07230104506015778, -0.22668173909187317, 0.1407221555709839, 0.023993518203496933, -0.1265549510717392, 0.008265882730484009, -0.010099038481712341, 0.18408644199371338, 0.2229907065629959, 0.21185052394866943, 0.00649348646402359, -0.3358687162399292, -0.2325861006975174, 0.1178717166185379, 0.1685863435268402, 0.26419076323509216, 0.2007399946451187, -0.08262528479099274, -0.1336580514907837, -0.12207308411598206, -0.4519212543964386, 0.05133996158838272, 0.33373185992240906, -0.2692243456840515, 0.0878823921084404, -0.2649456262588501, -0.16414770483970642, -0.34748274087905884, -0.2815433740615845, -0.07113546133041382, -0.10911773145198822, 0.02935086190700531, 0.19872336089611053, 0.12314215302467346, 0.36432671546936035, -0.1264672726392746, 0.18605700135231018, 0.2772942781448364, 0.36450761556625366, 0.16550281643867493, 0.0945763811469078, -0.16892464458942413, 0.2293429672718048, 0.04037456586956978, -0.15399210155010223, 0.19390703737735748, -0.01121971383690834, -0.09018462896347046, -0.12922553718090057, -0.17012259364128113, 0.019586050882935524, -0.06565888226032257, 0.2211931049823761, -0.10634718835353851, 0.2324269711971283, -0.1134217157959938, -0.21309134364128113, 0.19960562884807587, -0.23362961411476135, 0.017985470592975616, -0.2168501913547516, -0.04154212772846222, 0.058626409620046616, -0.08912087976932526, -0.11642917990684509, -0.3423142433166504, -0.36358362436294556, -0.10256578028202057, 0.3600280284881592, 0.11236734688282013, 0.1323758065700531, 0.2918138802051544, 0.18297690153121948, 0.28789785504341125, 0.013665713369846344, -0.2759772837162018, -0.5056042075157166, 0.394072949886322, -0.3333725035190582, -0.3591296374797821, 0.0006351619958877563, -0.02183682844042778, 0.3765356242656708, 0.18383748829364777, -0.3796314299106598, -0.04841266945004463, -0.037692002952098846, -0.18742185831069946, -0.2261301875114441, -0.1563904881477356, 0.25505128502845764, -0.21253229677677155, -0.12649592757225037, -0.05592063069343567, -0.048795197159051895, 0.3255263566970825, -0.041148800402879715, 0.13152578473091125, -0.05412917956709862, 0.6287192106246948, 0.07292602956295013, 0.8516104817390442, 0.27148425579071045, -0.23426750302314758, 0.38958749175071716, -0.09987462311983109, -0.0002898797392845154, -0.24515165388584137, 0.13858377933502197, 0.4054189920425415, -0.00349310040473938, -0.04030584543943405, 0.3343435525894165, -0.18920761346817017, -0.3248007297515869, -0.06816621869802475, 0.0036143064498901367, 0.16220739483833313, -0.03534717112779617, 0.07030732184648514, -0.25424832105636597, 0.4082506000995636, -0.24770772457122803, 0.21780633926391602, 0.09230302274227142, -0.07901248335838318, -0.27063262462615967, 0.036197833716869354, -0.1253204345703125, 0.2442358136177063, -0.382970929145813, -0.09928359091281891, -0.47908830642700195, 0.19015134871006012, 0.08161405473947525, 0.5511230826377869, -0.1274612843990326, -0.23992465436458588, 0.13109397888183594, -0.0018355362117290497, 0.13190323114395142, -0.042575933039188385, -0.21463675796985626, 0.06905856728553772, -0.051602430641651154, -0.16445070505142212, -0.30563050508499146, -0.09504823386669159, 0.2036876529455185, -0.08154946565628052, 0.23597542941570282, -0.010865285992622375, -0.07032487541437149, 0.19023874402046204, -0.08869077265262604, -0.06637272983789444, -0.05924011766910553, -0.17369171977043152, -0.10810128599405289, -0.268533855676651, 0.45615237951278687, 0.23025403916835785, 0.3071582019329071, -0.1394178867340088, 0.0078749880194664, -0.04676840454339981, 0.04956715553998947, 0.12836742401123047, 0.0453956164419651, 0.1622026562690735, 0.13923302292823792, 0.10157673060894012, 0.08394291996955872, 0.08688803762197495, 0.4270021617412567, 0.08049513399600983, -0.07050451636314392, -0.10963838547468185, 0.4028877317905426, -0.07721258699893951, 0.17683973908424377, 0.24658837914466858, 0.08167915046215057, 0.11598112434148788, 0.5932660102844238, 0.44844725728034973, -0.17842409014701843, 0.3326221704483032, 0.25082337856292725, 0.0977071225643158, -0.6237602233886719, -0.5452709794044495, -0.007565755397081375, 0.27799224853515625, 0.20244058966636658, 0.21202313899993896, -0.36319559812545776, -0.1373305469751358, -0.007664155215024948, 0.23727549612522125, 0.7209198474884033, 0.12611794471740723, 0.12324783205986023, 0.300333708524704, 0.09548858553171158, -0.08596858382225037, -0.04198497161269188, 0.10272310674190521, -0.18889014422893524, -0.35046321153640747, -0.06722254306077957, 0.06934228539466858, 0.18095700442790985, 0.06915856897830963, -0.2901504933834076, 0.38823989033699036, 0.05834926664829254, 0.11154623329639435, -0.11480576545000076, 0.18650084733963013, -0.026364177465438843, -0.182646706700325, -0.13646170496940613, 0.2794124484062195, -0.1795041263103485, -0.11037293076515198, -0.06416753679513931, -0.09190374612808228, 0.13928958773612976, -0.14905472099781036, 0.07236814498901367, -0.11156892031431198, -0.3159267008304596, 0.0018427502363920212, -0.19439131021499634, -0.4825069308280945, 0.18654586374759674, 0.08636413514614105, 0.27256453037261963, -0.10486211627721786, -0.17546293139457703, 0.09826840460300446, -0.0026612523943185806, -0.08713726699352264, -0.28401297330856323, 0.010804399847984314, 0.47680386900901794, -0.24567919969558716, -0.004380926489830017, 0.1824871301651001, 0.04210700839757919, -0.1449875682592392, -0.029308319091796875, -0.02625342085957527, 0.0626000463962555, -0.2163093090057373, -0.050634924322366714, 0.052475083619356155, -0.1525220274925232, -0.2251884788274765, 0.25039464235305786, -0.15873995423316956, -0.15794751048088074, 0.24737213551998138, 0.22250914573669434, -0.16620001196861267, -0.26691746711730957, 0.23668278753757477, 0.07291160523891449, 0.28194841742515564, 0.6662773489952087, 0.064361572265625, -0.1756715476512909, -0.1657770723104477, -0.074040487408638, 0.26963090896606445, -0.12626537680625916, -0.09187563508749008, 0.008535649627447128, 0.2029622495174408, 0.05451217293739319, 0.1586538702249527, 0.08310861885547638, 0.13409878313541412, 0.06449088454246521, -0.10690988600254059, -0.6955803036689758, -0.022136759012937546, -0.27281540632247925, 0.3123180866241455, -0.04040903225541115, 0.3391723036766052, 0.2460707128047943, 0.10627929121255875, -0.41350194811820984, -0.13750532269477844, -0.42737677693367004, 0.18868306279182434, 0.026023082435131073, -0.3041608929634094, -0.08607731014490128, 0.2593315839767456, 0.11049418151378632, 0.2440907061100006, -0.3231792449951172, -0.26270928978919983, -0.1852196604013443, 0.03540581464767456, 0.11510860919952393, -0.06906048208475113, -0.12054318189620972, -0.08067840337753296, -0.324863076210022, -0.04096675291657448, -0.10690905153751373, 0.007611267268657684, 0.009913625195622444, 0.15288294851779938, 0.28920289874076843, 0.10790804028511047, 0.25350505113601685, -0.1508912444114685, 0.1806170493364334, 0.16582651436328888, 0.01436895877122879, 0.019691387191414833, 0.07257688045501709, -0.08701548725366592, -0.37960851192474365, 0.10416802018880844, 0.16251537203788757, -0.16162574291229248, -0.2721388339996338, -0.24149459600448608, 0.06147216260433197, 0.1257687211036682, 0.3845241069793701, 0.2925145626068115, -0.13759176433086395, -0.24886992573738098, 0.4575442671775818, 0.2615740895271301, -0.11660664528608322, 0.08667104691267014, 0.14597630500793457, -0.09967942535877228, 0.16127008199691772, 0.22010082006454468, 0.08845129609107971, 0.16894251108169556, -0.03012796863913536, 0.2679990828037262, -0.14113232493400574, -0.5380032658576965, 0.15362046658992767, 0.1471695899963379, -0.030276037752628326, 0.07720299065113068, 0.3474884629249573, 0.07001113891601562, 0.1803833693265915, 0.35284653306007385, -0.17437471449375153, 0.3856068551540375, 0.3330598473548889, -0.18334850668907166, -0.1000748872756958, -0.393195241689682, -0.6577327251434326, 0.052926816046237946, -0.10682068765163422, 0.052304707467556, 0.021754562854766846, 0.5120118260383606, 0.010934222489595413, -0.3529234230518341, -0.19197824597358704, 0.029126495122909546, -0.30298131704330444, -0.14375773072242737, -0.36691275238990784, -0.026138372719287872, -0.07923226058483124, -0.03932248055934906, 0.08051645755767822, 0.20498661696910858, 0.36341482400894165, -0.12523208558559418, -0.23380671441555023, -0.10271555930376053, -0.07705284655094147, 0.27999648451805115, 0.05583057552576065, -0.1853826642036438, 0.4723486602306366, -0.011263519525527954, -0.11137840151786804, 0.1709032952785492, 0.0471767783164978, 0.4156307280063629, 0.20274041593074799, 0.13750693202018738, -0.012253155931830406, 0.1843276470899582, -0.05013101547956467, -0.047981467097997665, 0.14992761611938477, 0.4359631836414337, -0.1224578469991684, 0.522033154964447, 0.1632634550333023, -0.2542414367198944, 0.47810474038124084, 0.009575692936778069, 0.3648286461830139, -0.29472219944000244, 0.018056809902191162, 0.20359043776988983, 0.03828108310699463, -0.1203000470995903, -0.03076818957924843, -0.5081321001052856, 0.43857067823410034, 0.020328667014837265, -0.10061989724636078, 0.16508080065250397, -0.19344142079353333, 0.11863407492637634, -0.2518123686313629, 0.628007173538208, 0.08259372413158417, 0.05909943953156471, -0.17711037397384644, -0.25388303399086, -0.47590234875679016, -0.003182709217071533, -0.21301114559173584, 0.21087396144866943, 0.020442239940166473, 0.12597163021564484, 0.0007410570979118347, -0.022861110046505928, 0.3110858201980591, -0.40583112835884094, 0.008200451731681824, 0.35047194361686707, -0.35294032096862793, 0.09290502965450287, -0.20525580644607544, 0.15958131849765778, 0.2335239052772522, -0.040924374014139175, 0.21072261035442352, -0.18344612419605255, 0.1458321362733841, 0.1190626248717308, -0.06557564437389374, 0.02009136974811554, 0.2630966305732727, 0.263911634683609, -0.03978660702705383, 0.1681738793849945, -0.2500203251838684, 0.4098946452140808, -0.2383137047290802, 0.01351270079612732, -0.2823817729949951, 0.055402494966983795, 0.20955559611320496, 0.41777658462524414, -0.25008150935173035, -0.08117914199829102, -0.07808485627174377, 0.17788979411125183, 0.03994312882423401, 0.04202505573630333, -0.047600142657756805, 0.10539335757493973, 0.051998890936374664, 0.08942779898643494, 0.0957951694726944, 0.3005311191082001, 0.1640089750289917, -0.023045379668474197, -0.33186614513397217, -0.4119694232940674, 0.5407071709632874, -0.2711273431777954, -0.24534910917282104, -0.3376099169254303, -0.13310353457927704, 0.4387350082397461, -0.022521797567605972, -0.4175354242324829, 0.13184934854507446, 0.24198399484157562, -0.15019118785858154, -0.32807883620262146, 0.29785507917404175, -0.29904407262802124, 0.1979263424873352, 0.020599588751792908, 0.16442260146141052, 0.07058846950531006, -0.18591192364692688, -0.13688981533050537, -0.33710628747940063 ]
https://github.com/huggingface/datasets/issues/5773
@albertvillanova I think @v-yunbin, myself, and others might be slightly confused about max_steps and how it differs from num_train_epochs.
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
19
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` @albertvillanova I think @v-yunbin, myself, and others might be slightly confused about max_steps and how it differs from num_train_epochs.
[ -0.42442578077316284, -0.3594610095024109, -0.1555129885673523, 0.09776698052883148, 0.30486607551574707, -0.023437470197677612, 0.09157867729663849, -0.03601643815636635, -0.0023092851042747498, 0.31791478395462036, 0.404857873916626, 0.015599068254232407, -0.4500947594642639, 0.2778996229171753, -0.17882418632507324, -0.1548866331577301, 0.19510416686534882, -0.0979827344417572, -0.0667518749833107, 0.2029280662536621, -0.5036122798919678, -0.035060834139585495, -0.2160651832818985, -0.06295071542263031, -0.46421775221824646, -0.1322038322687149, -0.16003809869289398, 0.05632851645350456, 0.05581080913543701, -0.44935646653175354, -0.0023328587412834167, -0.25543317198753357, 0.41418135166168213, 0.6274791955947876, -0.00011036008800147101, 0.043753981590270996, 0.3685067892074585, -0.13440826535224915, -0.18718695640563965, -0.08082200586795807, -0.2522011399269104, -0.35278937220573425, -0.003519061952829361, -0.47423434257507324, 0.17025411128997803, 0.06786563247442245, 0.11591121554374695, -0.2165561020374298, 0.3832455575466156, 0.46062517166137695, 0.28014659881591797, 0.3221481740474701, 0.19180314242839813, -0.2115185707807541, 0.002356460317969322, -0.1754733771085739, -0.11211420595645905, 0.26343441009521484, -0.024643629789352417, 0.03616940975189209, -0.02938743308186531, -0.07525333762168884, 0.345030277967453, 0.13235177099704742, 0.1730731725692749, -0.1782677322626114, 0.545758843421936, -0.45531460642814636, -0.201255202293396, 0.14275744557380676, 0.36847928166389465, -0.05580047518014908, -0.13675259053707123, 0.046284183859825134, -0.10017699003219604, -0.5260373950004578, 0.09157362580299377, 0.20582416653633118, -0.014261893928050995, 0.03216654062271118, -0.44885897636413574, 0.1621852070093155, -0.17311641573905945, 0.05410609394311905, 0.030066944658756256, 0.32408463954925537, -0.14971281588077545, 0.16757790744304657, 0.0438162125647068, 0.10266634821891785, 0.24687117338180542, 0.25707608461380005, 0.4715818464756012, 0.17443591356277466, -0.36614489555358887, 0.020605608820915222, -0.174971804022789, 0.3433973491191864, 0.03505805879831314, 0.29344427585601807, 0.06884609162807465, 0.007868912070989609, 0.2823152244091034, 0.1365598738193512, -0.19060185551643372, 0.18860317766666412, 0.07509510964155197, -0.026946064084768295, -0.017373045906424522, 0.3004175126552582, 0.013886749744415283, 0.02436906471848488, -0.061796560883522034, -0.5502314567565918, 0.2725238800048828, 0.1924600750207901, -0.011528994888067245, 0.03798653930425644, -0.13966618478298187, 0.5360278487205505, -0.18226200342178345, -0.34837210178375244, 0.0201595276594162, 0.1812186986207962, 0.017818495631217957, -0.09367114305496216, -0.20321278274059296, -0.08440487086772919, -0.14177283644676208, -0.20260249078273773, -0.2562658488750458, 0.06806962192058563, -0.36027026176452637, 0.17010894417762756, 0.0240388885140419, -0.3158978819847107, 0.46547508239746094, 0.008819293230772018, 0.25002849102020264, -0.22865144908428192, 0.01941385120153427, -0.5370046496391296, 0.02389942668378353, 0.2499905228614807, -0.08450091630220413, 0.019475698471069336, 0.04552718997001648, 0.3168677091598511, -0.0008566230535507202, 0.30896472930908203, -0.3565548062324524, -0.4797903299331665, 0.12848402559757233, 0.14418503642082214, 0.058853715658187866, 0.10735093057155609, 0.040600020438432693, 0.20750746130943298, 0.6223408579826355, 0.18207763135433197, 0.12982791662216187, -0.4568699896335602, -0.3547087609767914, -0.1991746872663498, 0.21541106700897217, -0.15028910338878632, -0.4404779076576233, -0.1231321170926094, 0.42521288990974426, -0.20800387859344482, 0.2546193301677704, 0.28488829731941223, -0.05697743594646454, -0.05039907246828079, 0.056075431406497955, 0.13551393151283264, 0.23619672656059265, -0.04329710826277733, -0.11891814321279526, 0.06913939863443375, 0.21353426575660706, -0.3588367700576782, 0.06254417449235916, -0.0372265949845314, 0.2132962942123413, -0.2071278840303421, 0.050598375499248505, 0.012552324682474136, 0.08874479681253433, -0.31985244154930115, -0.27154263854026794, -0.12707901000976562, 0.10682126134634018, 0.07164546847343445, 0.18224549293518066, -0.13104526698589325, -0.09478414058685303, 0.10214480757713318, -0.11913315951824188, 0.06694784015417099, 0.19287167489528656, 0.3694353699684143, -0.3463403880596161, -0.1305418610572815, -0.04507683962583542, -0.23732611536979675, 0.048943765461444855, 0.019955433905124664, 0.006327375769615173, 0.04093834385275841, 0.5451565384864807, 0.1501285284757614, -0.2620144188404083, 0.19080740213394165, -0.11900448054075241, -0.12854032218456268, 0.12464650720357895, -0.2370258867740631, 0.18890434503555298, -0.008924506604671478, -0.06889870762825012, 0.02956056036055088, -0.7536994218826294, 0.09650000929832458, -0.26215463876724243, 0.06242677569389343, -0.4079780876636505, -0.15760469436645508, -0.15482699871063232, 0.2439219206571579, 0.0963335633277893, 0.06244432553648949, -0.044732142239809036, 0.26811471581459045, -0.07112796604633331, -0.41898009181022644, -0.42657577991485596, 0.07664474844932556, 0.046317026019096375, -0.019162409007549286, 0.048295386135578156, -0.1975875198841095, -0.050614308565855026, 0.07543297857046127, 0.18061068654060364, 0.09804916381835938, 0.13642996549606323, 0.19120663404464722, 0.1558014154434204, -0.05896018072962761, 0.011719129979610443, 0.0887179970741272, -0.11066590249538422, -0.2217227816581726, 0.2175566852092743, 0.018427520990371704, 0.34066909551620483, -0.07655258476734161, -0.6106961369514465, -0.32758185267448425, 0.41517987847328186, -0.06664592027664185, -0.10248197615146637, 0.06602519750595093, -0.03440956771373749, -0.23069395124912262, -0.0057696811854839325, 0.0018756166100502014, 0.21568994224071503, 0.12788841128349304, 0.19819101691246033, -0.033635225147008896, -0.4406746029853821, -0.20511716604232788, 0.019297365099191666, 0.35849031805992126, 0.3586699068546295, 0.1075851321220398, -0.24305136501789093, -0.06922027468681335, 0.07726602256298065, -0.43189629912376404, 0.18995089828968048, 0.2953655421733856, -0.4209470748901367, 0.05121079087257385, -0.29229670763015747, -0.21143479645252228, -0.37817615270614624, -0.2606426775455475, -0.2005767673254013, -0.20819008350372314, -0.08167123794555664, -0.10898910462856293, 0.20421428978443146, 0.2294987440109253, -0.48121821880340576, 0.11417204886674881, 0.20210513472557068, 0.3577282726764679, 0.132236048579216, 0.15028434991836548, -0.13100965321063995, 0.09618702530860901, 0.049003589898347855, -0.08257962763309479, 0.07560493052005768, -0.002862885594367981, -0.0055932216346263885, 0.12516620755195618, -0.09461302310228348, 0.12190557271242142, -0.08441750705242157, 0.35782328248023987, -0.1825215071439743, 0.07654368877410889, 0.07505439221858978, -0.2129821628332138, 0.03345421701669693, -0.1201251819729805, -0.06533290445804596, -0.3864060342311859, 0.08290845155715942, 0.02410067990422249, -0.16657450795173645, 0.027896912768483162, -0.36768269538879395, -0.32104241847991943, -0.14243517816066742, 0.44482094049453735, 0.2275451123714447, -0.05350141227245331, 0.20579087734222412, 0.16011209785938263, 0.3787859082221985, 0.06269623339176178, -0.2731359004974365, -0.41597288846969604, 0.4062272310256958, -0.398485392332077, -0.2666516602039337, -0.01241544634103775, -0.08984093368053436, 0.3017271161079407, 0.20030900835990906, -0.3104918599128723, -0.16486698389053345, -0.11944353580474854, -0.07950562983751297, -0.12898573279380798, -0.1239958107471466, 0.233901709318161, -0.2405242919921875, -0.0896768644452095, -0.015752822160720825, -0.1441437005996704, 0.3187161386013031, -0.09338612854480743, 0.111054927110672, 0.09666785597801208, 0.7106320858001709, 0.04378979653120041, 0.9459940195083618, 0.2145194113254547, -0.2595168352127075, 0.27012473344802856, 0.08289807289838791, 0.09917379915714264, -0.23257602751255035, 0.2531074285507202, 0.39219188690185547, 0.02899012714624405, 0.08370330929756165, 0.27171555161476135, -0.12090751528739929, -0.16717548668384552, 0.11106723546981812, -0.004161514341831207, 0.1315208077430725, 0.0001833215355873108, -0.05432877689599991, -0.21916787326335907, 0.4240688979625702, -0.3122800588607788, 0.17217782139778137, 0.1060425341129303, 0.036148615181446075, -0.2864855229854584, 0.20810329914093018, -0.052729953080415726, 0.24062491953372955, -0.4144420027732849, 0.058000024408102036, -0.40825560688972473, 0.3575761318206787, 0.057987190783023834, 0.6528453230857849, -0.05238407850265503, -0.3464793264865875, 0.05627991259098053, -0.03302210941910744, 0.22016918659210205, -0.11590931564569473, -0.20947137475013733, 0.0814957544207573, -0.03680230304598808, -0.3429429531097412, -0.3394865393638611, -0.08762838691473007, 0.3303101360797882, 0.07830610871315002, 0.23784862458705902, 0.13485780358314514, -0.16495858132839203, 0.21830156445503235, 0.049509018659591675, -0.06113937124609947, -0.12215517461299896, -0.20369169116020203, 0.04626996070146561, -0.1958581805229187, 0.38160204887390137, 0.14354228973388672, 0.09135957807302475, -0.2662886679172516, 0.1890583038330078, -0.08839251846075058, -0.01949615404009819, 0.18616843223571777, -0.06933703273534775, 0.01283210888504982, 0.053371258080005646, 0.01729608327150345, 0.08994007110595703, 0.10224106907844543, 0.4620794653892517, -0.019624631851911545, -0.2460707128047943, -0.15236175060272217, 0.42678046226501465, -0.1600494533777237, 0.12318683415651321, 0.07150436192750931, 0.0765438824892044, 0.156570702791214, 0.5039181709289551, 0.1781039834022522, -0.08622661978006363, 0.2039785087108612, 0.17848381400108337, 0.2574233114719391, -0.75173020362854, -0.45847320556640625, 0.08426330238580704, 0.47714635729789734, 0.16581517457962036, -0.011446904391050339, -0.2874324917793274, -0.0997534766793251, -0.08483622968196869, 0.2834415137767792, 0.678278923034668, 0.047432370483875275, 0.18736925721168518, -0.008313908241689205, 0.30062463879585266, -0.0625377669930458, 0.21766814589500427, 0.017243843525648117, -0.13830411434173584, -0.3593802750110626, -0.1648150086402893, -0.11447123438119888, 0.3607950806617737, 0.043240126222372055, -0.18746231496334076, 0.45732176303863525, -0.09373180568218231, -0.0730496495962143, -0.07361765950918198, -0.016349196434020996, 0.1655132919549942, -0.15626202523708344, 0.04843832552433014, 0.1882852166891098, -0.0955411046743393, -0.055035509169101715, -0.11560763418674469, 0.04990636557340622, -0.0032199248671531677, -0.03206687048077583, 0.017253905534744263, -0.1948610246181488, -0.1696103811264038, 0.08945387601852417, -0.01565190777182579, -0.5011405348777771, 0.33891284465789795, -0.013631114736199379, 0.35872694849967957, -0.14565224945545197, -0.07734935730695724, -0.12975047528743744, 0.0007435884326696396, -0.060344357043504715, -0.19316387176513672, -0.0999222844839096, 0.6075693368911743, -0.1945839822292328, 0.041150107979774475, 0.14312544465065002, 0.02283637598156929, -0.14820417761802673, -0.24067042768001556, 0.13174277544021606, -0.10809208452701569, -0.15252536535263062, -0.15116041898727417, 0.14386531710624695, -0.06938184797763824, -0.2522127330303192, 0.15883290767669678, -0.23412904143333435, 0.0825999528169632, 0.26394495368003845, 0.0009733806364238262, -0.20224367082118988, -0.1907043308019638, 0.11012749373912811, 0.15595056116580963, 0.19628360867500305, 0.6309541463851929, 0.003513343632221222, -0.2141156792640686, -0.06433819979429245, -0.051117971539497375, 0.16599902510643005, -0.1724497526884079, -0.036641404032707214, -0.013864520937204361, 0.29344257712364197, 0.09574754536151886, 0.03870092332363129, 0.07613162696361542, 0.086717888712883, -0.01877851039171219, -0.2577386796474457, -0.659210205078125, 0.0016019269824028015, -0.2835606336593628, 0.23798969388008118, 0.053414493799209595, 0.2924371361732483, 0.19888658821582794, 0.05065716803073883, -0.30399179458618164, -0.10047588497400284, -0.4085443615913391, 0.11915808171033859, 0.12608304619789124, -0.2554556131362915, -0.21981336176395416, 0.2533244788646698, -0.012734498828649521, 0.19098246097564697, -0.2803992033004761, -0.14409561455249786, -0.28329014778137207, 0.09010108560323715, 0.1244647279381752, -0.05661046877503395, 0.01825595647096634, -0.008012346923351288, -0.2743109166622162, 0.026972297579050064, -0.287192165851593, 0.11228376626968384, -0.03401847556233406, 0.2893952429294586, 0.3592267632484436, 0.2760896384716034, 0.1777464896440506, 0.0017876578494906425, 0.12192301452159882, 0.3216308355331421, 0.03474734351038933, 0.17908883094787598, 0.034944530576467514, 0.060919955372810364, -0.5907315611839294, 0.09160470962524414, 0.11655580252408981, -0.14802592992782593, -0.30339315533638, -0.2139194905757904, 0.1580047309398651, 0.11778006702661514, 0.2580307126045227, 0.3195992112159729, -0.23504631221294403, -0.25792431831359863, 0.5958325862884521, 0.12139561027288437, -0.037358157336711884, 0.0758187472820282, 0.31557852029800415, -0.15795554220676422, 0.12548190355300903, 0.3023011088371277, 0.24986688792705536, 0.3171413242816925, 0.07675017416477203, 0.20423641800880432, -0.16855767369270325, -0.4587342143058777, 0.1407567411661148, 0.1445717215538025, 0.11721432209014893, 0.2730061411857605, 0.5662941932678223, 0.020773544907569885, 0.2933417558670044, 0.4360755980014801, -0.060141321271657944, 0.438172310590744, 0.5301501750946045, -0.2494840770959854, -0.011205494403839111, -0.5336662530899048, -0.4904847741127014, 0.026363424956798553, -0.08476824313402176, 0.14698730409145355, 0.005357012152671814, 0.5092135667800903, 0.1075170636177063, -0.2338997721672058, -0.22464057803153992, -0.009740808978676796, -0.1890631467103958, -0.3518209159374237, -0.35034626722335815, -0.006765298545360565, 0.13212022185325623, -0.032643165439367294, 0.0088056530803442, -0.024373911321163177, 0.41706666350364685, -0.20216622948646545, -0.20990729331970215, -0.030821505934000015, 0.03441949561238289, 0.20220714807510376, -0.07152896374464035, -0.013196974992752075, 0.3780326843261719, 0.07626466453075409, -0.1319868564605713, 0.26806753873825073, -0.07855861634016037, 0.5680274367332458, 0.24975429475307465, 0.10758572816848755, -0.10751278698444366, 0.2589077353477478, 0.008900970220565796, 0.019335895776748657, 0.23085685074329376, 0.388250470161438, -0.05972779169678688, 0.5692514181137085, 0.06059853732585907, -0.21868261694908142, 0.45534297823905945, 0.13677793741226196, 0.4431796073913574, -0.29445967078208923, 0.13335855305194855, 0.04690930247306824, -0.04611169546842575, 0.015197345986962318, 0.18839211761951447, -0.49504396319389343, 0.3232298791408539, 0.06953351199626923, 0.031987257301807404, 0.12677086889743805, -0.10849706828594208, 0.07584647089242935, -0.2832493782043457, 0.7143621444702148, 0.2951065003871918, 0.1732906997203827, 0.025697696954011917, -0.0340331569314003, -0.4824368953704834, 0.03813783824443817, -0.15217959880828857, 0.11012506484985352, -0.07881021499633789, -0.06473802775144577, 0.044252391904592514, -0.020041175186634064, 0.29666587710380554, -0.2703781723976135, 0.15671952068805695, 0.41168710589408875, -0.3135494887828827, 0.02401546761393547, -0.21792049705982208, -0.013219074346125126, 0.1444149762392044, -0.11150239408016205, 0.1686106026172638, -0.10530413687229156, -0.03546975925564766, -0.06300905346870422, -0.02707502990961075, 0.12451723217964172, 0.4876253008842468, 0.39196252822875977, 0.06417948007583618, 0.2932106852531433, -0.22169169783592224, 0.3495064079761505, -0.22344298660755157, 0.11022806167602539, -0.19853800535202026, 0.159952312707901, 0.15009933710098267, 0.15183544158935547, -0.4136596918106079, -0.15267875790596008, 0.17357099056243896, 0.08053626120090485, -0.17663155496120453, 0.08755470812320709, 0.003571920096874237, -0.010101839900016785, 0.035722509026527405, -0.17855414748191833, 0.28856322169303894, 0.20477493107318878, 0.22564302384853363, 0.02809801697731018, -0.29512616991996765, -0.12161865830421448, 0.3153761029243469, -0.2848580479621887, -0.12346819043159485, -0.5715134143829346, -0.21423786878585815, 0.3510812819004059, -0.07378175854682922, -0.28365397453308105, 0.01217612624168396, 0.3379306495189667, -0.09452091157436371, -0.4276348650455475, 0.3284660875797272, -0.4223141670227051, 0.09843328595161438, -0.041779059916734695, 0.113466277718544, -0.0013866377994418144, -0.3625949025154114, -0.16011078655719757, -0.1726028323173523 ]
https://github.com/huggingface/datasets/issues/5773
@lkurlandski A **step** is referring to optimizer's update after back propagation, and it's associated with a batch of data. For example, if a dataset contains 64 examples and you have an overall batch size of 4, then an epoch will have 64/4=16 batches. Therefore, in one epoch, you will have 16 optimizer **steps**.
train_dataset does not implement __len__
when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.`
53
train_dataset does not implement __len__ when train using data precessored by the datasets, I get follow warning and it leads to that I can not set epoch numbers: `ValueError: The train_dataset does not implement __len__, max_steps has to be specified. The number of steps needs to be known in advance for the learning rate scheduler.` @lkurlandski A **step** is referring to optimizer's update after back propagation, and it's associated with a batch of data. For example, if a dataset contains 64 examples and you have an overall batch size of 4, then an epoch will have 64/4=16 batches. Therefore, in one epoch, you will have 16 optimizer **steps**.
[ -0.5346367359161377, -0.2838119864463806, -0.15404485166072845, 0.017284834757447243, 0.3721015453338623, -0.026162296533584595, 0.11708937585353851, 0.1397029310464859, -0.16365745663642883, 0.3835686445236206, 0.5001541972160339, 0.08532778918743134, -0.4400617480278015, 0.2705622911453247, -0.16068997979164124, -0.2119184136390686, 0.08152104914188385, -0.00442369282245636, -0.04323983192443848, 0.2370346486568451, -0.47770828008651733, -0.0815468430519104, -0.11967737227678299, -0.03975340723991394, -0.38467952609062195, -0.24842804670333862, -0.09441627562046051, 0.031620047986507416, 0.0320410430431366, -0.45714569091796875, -0.07913623750209808, -0.13522453606128693, 0.46279892325401306, 0.591798722743988, -0.0001092774691642262, 0.021801449358463287, 0.2683241665363312, -0.11799221485853195, -0.32266005873680115, 0.011286422610282898, -0.37540870904922485, -0.3331446647644043, -0.005517464131116867, -0.49848806858062744, 0.168570876121521, 0.015965308994054794, 0.03791480511426926, -0.26150211691856384, 0.549122154712677, 0.3810493052005768, 0.2574281096458435, 0.4203846752643585, 0.19919395446777344, -0.1126253753900528, -0.03874799609184265, -0.15758424997329712, -0.07927810400724411, 0.09457810968160629, -0.004404988139867783, 0.03068343549966812, -0.061096031218767166, 0.018845148384571075, 0.27263882756233215, 0.1911669224500656, 0.15883345901966095, -0.23889902234077454, 0.6202728748321533, -0.4671798646450043, -0.18951453268527985, 0.15595731139183044, 0.3050212562084198, -0.11328192055225372, -0.2537756562232971, -0.059768304228782654, -0.028109315782785416, -0.6011956930160522, 0.02056138962507248, 0.06188834458589554, 0.023505497723817825, -0.005172610282897949, -0.39343780279159546, 0.06706921011209488, -0.14660340547561646, -0.012382891029119492, 0.16478878259658813, 0.4023769199848175, -0.11537200212478638, 0.16710242629051208, 0.05925200507044792, 0.10671211779117584, 0.2923973798751831, 0.21913649141788483, 0.2901480197906494, 0.2588629424571991, -0.23641061782836914, -0.029233470559120178, -0.15619170665740967, 0.11017248779535294, 0.04426082223653793, 0.2237594574689865, 0.05053917318582535, 0.0718209370970726, 0.20886655151844025, 0.11856171488761902, -0.19622628390789032, 0.21640732884407043, 0.08337592333555222, 0.07477476447820663, 0.08855961263179779, 0.3079124689102173, 0.13266046345233917, -0.01760503649711609, -0.21153701841831207, -0.5365980267524719, 0.21319228410720825, 0.17978712916374207, -0.056445974856615067, 0.1372171938419342, -0.289132297039032, 0.4578286111354828, -0.15124261379241943, -0.33796077966690063, 0.03853911906480789, 0.1667822301387787, -0.004700057208538055, -0.15198346972465515, -0.21274949610233307, -0.04387958347797394, -0.14651083946228027, -0.2992572486400604, -0.262647420167923, -0.02215174026787281, -0.39266860485076904, 0.1351824253797531, -0.08099939674139023, -0.3205389976501465, 0.49635443091392517, 0.04425760731101036, 0.0577610544860363, -0.2581474483013153, 0.015552327036857605, -0.48120832443237305, 0.002624332904815674, 0.23696890473365784, -0.04547795653343201, 0.07364347577095032, -0.017812060192227364, 0.1931440234184265, -0.09926967322826385, 0.30725547671318054, -0.4682306945323944, -0.5181286334991455, -0.11801766604185104, 0.1472731977701187, 0.08037380874156952, 0.12375742942094803, 0.005327116698026657, 0.15858495235443115, 0.6723242402076721, 0.14199188351631165, 0.13667550683021545, -0.39644888043403625, -0.37079453468322754, -0.160403311252594, 0.33959531784057617, 0.026702336966991425, -0.47776296734809875, -0.1706673502922058, 0.36739790439605713, -0.1751018613576889, 0.33664071559906006, 0.3423852026462555, -0.14489662647247314, -0.007141515612602234, -0.03951288014650345, 0.13450740277767181, 0.451873242855072, 0.029047489166259766, -0.08340573310852051, 0.07718031108379364, 0.040571846067905426, -0.38143643736839294, 0.06866668164730072, -0.0012220144271850586, 0.17251554131507874, -0.24493393301963806, 0.035295795649290085, 0.09352332353591919, 0.02770671807229519, -0.2204432487487793, -0.17730535566806793, -0.12989020347595215, -0.027420036494731903, 0.0563441663980484, 0.21285434067249298, -0.07563554495573044, -0.024464286863803864, 0.022529352456331253, -0.015437841415405273, -0.040058434009552, 0.2572290301322937, 0.3491489589214325, -0.2215464562177658, -0.005873344838619232, -0.07487087696790695, -0.15316453576087952, 0.07196888327598572, 0.007999397814273834, 0.033202365040779114, -0.04281346872448921, 0.5437093377113342, 0.10029242932796478, -0.3231789469718933, 0.21630802750587463, -0.17438162863254547, -0.1576472967863083, 0.11393269896507263, -0.18056923151016235, 0.09991225600242615, 0.04849623143672943, -0.055977072566747665, 0.06034712493419647, -0.7210089564323425, 0.01241631805896759, -0.2595650553703308, -0.04681306332349777, -0.2866874039173126, -0.18487313389778137, -0.17464964091777802, 0.24639812111854553, 0.13155993819236755, 0.11400294303894043, -0.07662269473075867, 0.2889903485774994, -0.09145751595497131, -0.28310626745224, -0.36969882249832153, 0.1922340989112854, 0.0035000573843717575, 0.07739246636629105, 0.041590236127376556, -0.24185563623905182, 0.029377080500125885, 0.02985280752182007, 0.22210238873958588, 0.15681684017181396, 0.14499270915985107, 0.10166532546281815, 0.05620322376489639, -0.04347406327724457, 0.1948128044605255, 0.06081928312778473, -0.17955616116523743, -0.22452211380004883, 0.1237189918756485, -0.09007914364337921, 0.32998740673065186, -0.06316432356834412, -0.5907223224639893, -0.4074934422969818, 0.3830564320087433, -0.03562835231423378, -0.004676368087530136, 0.1521429717540741, -0.046808090060949326, -0.16950440406799316, 0.030125832185149193, 0.09526871144771576, 0.15007096529006958, 0.10607045888900757, 0.1286352425813675, -0.05991014093160629, -0.35671889781951904, -0.22370323538780212, -0.02141435444355011, 0.2558189332485199, 0.5980871319770813, 0.07315222173929214, -0.25061100721359253, 0.03506973385810852, 0.12429443746805191, -0.5252094864845276, 0.1536203920841217, 0.278909832239151, -0.4707558751106262, 0.11693329364061356, -0.27570098638534546, -0.2117125689983368, -0.4731135964393616, -0.3095328211784363, -0.16043871641159058, -0.1243973821401596, -0.09797759354114532, -0.019344903528690338, 0.09217208623886108, 0.2757282555103302, -0.4414856731891632, 0.20099124312400818, 0.29236894845962524, 0.2540799081325531, 0.22892606258392334, 0.13197578489780426, -0.10176266729831696, 0.11589998006820679, 0.016622666269540787, -0.05498732626438141, 0.14468136429786682, -0.0508207231760025, -0.13491833209991455, -0.023333638906478882, -0.0456966906785965, 0.10029593110084534, -0.057364966720342636, 0.33510541915893555, -0.17230835556983948, 0.11607739329338074, -0.10389502346515656, -0.3150078356266022, 0.07020686566829681, 0.019161678850650787, -0.079685740172863, -0.2789641320705414, -0.028050804510712624, -0.0011360682547092438, -0.0432773157954216, 0.07235092669725418, -0.33198222517967224, -0.2533911466598511, -0.17912918329238892, 0.3158680200576782, 0.2693972885608673, -0.05190020799636841, 0.2319364845752716, 0.13623467087745667, 0.2675304710865021, -0.01618766039609909, -0.24169200658798218, -0.4540306627750397, 0.34416040778160095, -0.2948724627494812, -0.19932159781455994, -0.057275060564279556, -0.07338965684175491, 0.2724331319332123, 0.25756222009658813, -0.2706592082977295, -0.04205722734332085, -0.136500746011734, -0.013881832361221313, -0.21992866694927216, -0.04005809873342514, 0.3593279719352722, -0.1354418694972992, -0.11272598057985306, -0.04810365289449692, -0.12043286859989166, 0.3209991157054901, -0.15536925196647644, 0.20445646345615387, 0.017084524035453796, 0.8075238466262817, 0.046227723360061646, 0.9821088314056396, 0.2865784764289856, -0.44169196486473083, 0.4181141257286072, 0.007917499169707298, 0.03677833080291748, -0.20805624127388, 0.2765374183654785, 0.39183011651039124, -0.0408351868391037, -0.02420973777770996, 0.1627100110054016, -0.23835161328315735, -0.20801353454589844, 0.09263516962528229, -0.08032058924436569, 0.006766907870769501, 0.0486011877655983, -0.031164858490228653, -0.2696305811405182, 0.4823875427246094, -0.3061498999595642, 0.073086217045784, 0.13248921930789948, 0.024481356143951416, -0.24049672484397888, 0.09043120592832565, 0.003031056374311447, 0.17350243031978607, -0.3787107467651367, 0.06090521812438965, -0.4924234449863434, 0.3304443359375, 0.13299892842769623, 0.6773295402526855, -0.033294953405857086, -0.28176483511924744, 0.036599501967430115, 0.0755772665143013, 0.24551276862621307, 0.06683836877346039, -0.08438816666603088, 0.039488330483436584, -0.03901054710149765, -0.2779998481273651, -0.31270313262939453, -0.12191203236579895, 0.4673766493797302, 0.04391973093152046, 0.19384463131427765, 0.16095048189163208, -0.046236708760261536, 0.23537710309028625, 0.0019414760172367096, -0.060237910598516464, -0.012396503239870071, -0.257404625415802, -0.03507307544350624, -0.1790846288204193, 0.4923577904701233, 0.20397725701332092, 0.17746147513389587, -0.20245113968849182, 0.1331603080034256, -0.11737071722745895, -0.02497372031211853, 0.07763044536113739, -0.03021284192800522, 0.11365574598312378, 0.1038900762796402, -0.02441541478037834, 0.038998253643512726, 0.014147545211017132, 0.5271258354187012, 0.007595008239150047, -0.1569608449935913, -0.28827595710754395, 0.41713079810142517, -0.11666510999202728, 0.24579955637454987, 0.1243709921836853, 0.12342312186956406, 0.15277917683124542, 0.5354453325271606, 0.27159029245376587, -0.3159574866294861, 0.16091564297676086, 0.2776024639606476, 0.26119464635849, -0.7271741628646851, -0.3993390202522278, 0.06146835908293724, 0.43686559796333313, 0.12807336449623108, 0.05314928665757179, -0.20716024935245514, -0.07073831558227539, 0.04459008574485779, 0.4630920886993408, 0.6706171631813049, -0.021426796913146973, 0.13260042667388916, 0.054164618253707886, 0.3836047649383545, -0.08161948621273041, 0.20954063534736633, 0.07290869206190109, -0.10681726783514023, -0.29965662956237793, -0.09403648972511292, -0.010963641107082367, 0.4097065329551697, 0.013305466622114182, -0.156671404838562, 0.37736061215400696, -0.11482472717761993, -0.23320981860160828, -0.10628477483987808, 0.004423961043357849, 0.0296670850366354, -0.14186273515224457, -0.03776194900274277, 0.16926704347133636, -0.13108140230178833, -0.021060748025774956, -0.10145363956689835, 0.04967238008975983, 0.04929759353399277, -0.06495042890310287, -0.08549909293651581, -0.17439323663711548, -0.11262824386358261, 0.06890858709812164, -0.11084167659282684, -0.5209656953811646, 0.258914053440094, -0.00027324771508574486, 0.5162728428840637, -0.0399618074297905, -0.04425475001335144, -0.06220832094550133, -0.06027131900191307, -0.08959908783435822, -0.21361523866653442, -0.0397980660200119, 0.5348690152168274, -0.19706004858016968, -0.023805469274520874, 0.18877360224723816, 0.03853905200958252, -0.26627182960510254, -0.14027559757232666, 0.07472342997789383, -0.12386949360370636, -0.17282354831695557, -0.042589783668518066, 0.11666883528232574, -0.03372791036963463, -0.2179240882396698, 0.15865997970104218, -0.17097537219524384, -0.03494797646999359, 0.2947353720664978, 0.0650021880865097, -0.24087107181549072, -0.1694764643907547, 0.18570967018604279, 0.08345916867256165, 0.25706005096435547, 0.7312520742416382, 0.028338909149169922, -0.18538716435432434, -0.07970158010721207, 0.008938536047935486, 0.21392065286636353, -0.001437351107597351, -0.07684323191642761, -0.008709434419870377, 0.23331981897354126, 0.037814509123563766, 0.049665629863739014, 0.08411937952041626, 0.18843317031860352, 0.016545914113521576, -0.2934272885322571, -0.5607572197914124, 0.0010333694517612457, -0.3341901898384094, 0.21335968375205994, 0.08674339950084686, 0.1994425356388092, 0.20566043257713318, 0.18602445721626282, -0.3169822096824646, -0.15683284401893616, -0.4709295630455017, 0.24756528437137604, 0.02129889652132988, -0.12611275911331177, -0.22782012820243835, 0.25091996788978577, -0.006846372038125992, 0.13282501697540283, -0.27245691418647766, -0.14819970726966858, -0.23157352209091187, 0.09113868325948715, 0.03519617021083832, -0.06270068883895874, -0.0069428905844688416, -0.12915077805519104, -0.31688931584358215, -0.03425664082169533, -0.16612856090068817, 0.2148207128047943, 0.00831175222992897, 0.29234394431114197, 0.4471028447151184, 0.2531633973121643, 0.27018213272094727, -0.04171302169561386, 0.06598018109798431, 0.2102309763431549, -0.039939552545547485, 0.1669112890958786, 0.08730552345514297, 0.03469398617744446, -0.5601481199264526, 0.0641293078660965, 0.2465890496969223, -0.14530721306800842, -0.3500407040119171, -0.23435336351394653, 0.11672048270702362, 0.10333637148141861, 0.3375149965286255, 0.2791276276111603, -0.20539945363998413, -0.3025459051132202, 0.6497504711151123, 0.1523047536611557, -0.08693494647741318, -0.04224462807178497, 0.21464353799819946, -0.09390563517808914, 0.07340577244758606, 0.30786198377609253, 0.1846027821302414, 0.2970416843891144, 0.0827566459774971, 0.1839039921760559, -0.10312575101852417, -0.4844712018966675, 0.1537349820137024, 0.13976633548736572, 0.11745349317789078, 0.12165237963199615, 0.4339843988418579, 0.07187321782112122, 0.36704739928245544, 0.37610217928886414, -0.13805776834487915, 0.4032084047794342, 0.4782414138317108, -0.13549913465976715, -0.07664754241704941, -0.5690369606018066, -0.48957115411758423, 0.05467919260263443, -0.16743507981300354, 0.11559039354324341, -0.022248227149248123, 0.5261642336845398, 0.1377256214618683, -0.17916752398014069, -0.2126695215702057, 0.11085771024227142, -0.23972897231578827, -0.3026496171951294, -0.4460819661617279, 0.0389404296875, 0.0638449639081955, -0.11003633588552475, 0.009822029620409012, 0.045478109270334244, 0.39186906814575195, -0.20520973205566406, -0.20998118817806244, -0.013588527217507362, 0.02888602390885353, 0.2037489116191864, 0.02207075245678425, -0.09725403785705566, 0.3296256959438324, -0.04776911437511444, -0.17138543725013733, 0.18290260434150696, 0.0668068528175354, 0.4929291307926178, 0.3363986909389496, 0.2153666913509369, -0.03354521468281746, 0.14879608154296875, -0.03707452118396759, -0.03304203599691391, 0.16941027343273163, 0.3369935154914856, -0.12870043516159058, 0.45821452140808105, 0.05928952246904373, -0.19132256507873535, 0.4797045886516571, 0.09477145224809647, 0.4802471399307251, -0.20043312013149261, 0.016696270555257797, 0.105616495013237, -0.08412864804267883, -0.018309693783521652, 0.08999720960855484, -0.37986814975738525, 0.35278943181037903, 0.18425141274929047, -0.13356776535511017, 0.150669127702713, -0.05770787596702576, 0.07327067852020264, -0.3137855529785156, 0.6435723900794983, 0.29766467213630676, 0.06441155076026917, -0.020250901579856873, -0.1084655225276947, -0.4499734342098236, 0.060835763812065125, -0.23972159624099731, -0.017920587211847305, 0.021123182028532028, -0.031129520386457443, -0.02522262930870056, 0.010876761749386787, 0.30600833892822266, -0.2935431897640228, 0.12224677205085754, 0.40885862708091736, -0.30608659982681274, 0.10329177975654602, -0.3823733925819397, 0.02495724894106388, 0.18294167518615723, -0.08339625597000122, 0.2696444094181061, -0.026923825964331627, -0.026185959577560425, 0.033257268369197845, -0.08382575958967209, 0.1766493320465088, 0.5180577635765076, 0.4037169814109802, 0.07552125304937363, 0.22054189443588257, -0.34950539469718933, 0.4621899425983429, -0.22804415225982666, 0.13750894367694855, -0.3103409707546234, 0.08069702982902527, 0.17012998461723328, 0.09728396683931351, -0.4452494978904724, -0.06419326364994049, 0.04294111952185631, 0.16925226151943207, -0.18677964806556702, 0.04436499997973442, -0.048855047672986984, 0.04063890129327774, 0.006459668278694153, -0.11261886358261108, 0.30651742219924927, 0.13865399360656738, 0.3065509498119354, 0.05768679827451706, -0.2855474650859833, -0.19438990950584412, 0.36783868074417114, -0.2171986997127533, -0.08732526004314423, -0.5689875483512878, -0.1339433789253235, 0.3565002679824829, -0.10235750675201416, -0.2908274829387665, 0.026302918791770935, 0.30120086669921875, -0.004873990081250668, -0.36491888761520386, 0.28973641991615295, -0.38540664315223694, 0.13898718357086182, 0.021716207265853882, 0.23980309069156647, -0.02371228113770485, -0.2816033959388733, -0.1439848095178604, -0.2865179777145386 ]
https://github.com/huggingface/datasets/issues/5769
Thanks for reporting, @markovalexander. Unfortunately, I'm not able to reproduce the issue: the `tiktoken` tokenizer can be used within `Dataset.map`, both in my local machine and in a Colab notebook: https://colab.research.google.com/drive/1DhJroZgk0sNFJ2Mrz-jYgrmh9jblXaCG?usp=sharing Are you sure you are using `datasets` version 2.11.0?
Tiktoken tokenizers are not pickable
### Describe the bug Since tiktoken tokenizer is not pickable, it is not possible to use it inside `dataset.map()` with multiprocessing enabled. However, you [made](https://github.com/huggingface/datasets/issues/5536) tiktoken's tokenizers pickable in `datasets==2.10.0` for caching. For some reason, this logic does not work in dataset processing and raises `TypeError: cannot pickle 'builtins.CoreBPE' object` ### Steps to reproduce the bug ``` from datasets import load_dataset import tiktoken dataset = load_dataset("stas/openwebtext-10k") enc = tiktoken.get_encoding("gpt2") tokenized = dataset.map( process, remove_columns=['text'], desc="tokenizing the OWT splits", num_proc=2, ) def process(example): ids = enc.encode(example['text']) ids.append(enc.eot_token) out = {'ids': ids, 'len': len(ids)} return out ``` ### Expected behavior starts processing dataset ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.0-1021-oracle-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 9.0.0 - Pandas version: 2.0.0
40
Tiktoken tokenizers are not pickable ### Describe the bug Since tiktoken tokenizer is not pickable, it is not possible to use it inside `dataset.map()` with multiprocessing enabled. However, you [made](https://github.com/huggingface/datasets/issues/5536) tiktoken's tokenizers pickable in `datasets==2.10.0` for caching. For some reason, this logic does not work in dataset processing and raises `TypeError: cannot pickle 'builtins.CoreBPE' object` ### Steps to reproduce the bug ``` from datasets import load_dataset import tiktoken dataset = load_dataset("stas/openwebtext-10k") enc = tiktoken.get_encoding("gpt2") tokenized = dataset.map( process, remove_columns=['text'], desc="tokenizing the OWT splits", num_proc=2, ) def process(example): ids = enc.encode(example['text']) ids.append(enc.eot_token) out = {'ids': ids, 'len': len(ids)} return out ``` ### Expected behavior starts processing dataset ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.0-1021-oracle-x86_64-with-glibc2.29 - Python version: 3.8.10 - Huggingface_hub version: 0.13.4 - PyArrow version: 9.0.0 - Pandas version: 2.0.0 Thanks for reporting, @markovalexander. Unfortunately, I'm not able to reproduce the issue: the `tiktoken` tokenizer can be used within `Dataset.map`, both in my local machine and in a Colab notebook: https://colab.research.google.com/drive/1DhJroZgk0sNFJ2Mrz-jYgrmh9jblXaCG?usp=sharing Are you sure you are using `datasets` version 2.11.0?
[ -0.24836483597755432, -0.24730032682418823, 0.04029063880443573, 0.21145464479923248, 0.04805613309144974, -0.18448340892791748, 0.12182169407606125, 0.20901887118816376, 0.14491097629070282, 0.2306211292743683, -0.39203715324401855, 0.7446089386940002, 0.0173114612698555, 0.36103057861328125, -0.18753987550735474, 0.04716704413294792, -0.052652548998594284, 0.20918028056621552, 0.0742170512676239, 0.19512176513671875, -0.43895748257637024, 0.38961970806121826, -0.37481969594955444, 0.25112980604171753, -0.41995179653167725, -0.2991500198841095, -0.03956880420446396, -0.09328211843967438, -0.10262090712785721, -0.3419913053512573, 0.015773281455039978, 0.10870428383350372, -0.052244074642658234, 0.6436633467674255, -0.00011466655269032344, -0.08142481744289398, 0.025317257270216942, 0.006626643240451813, 0.0927460789680481, -0.39837566018104553, 0.16031679511070251, -0.12292541563510895, -0.13113677501678467, -0.20544441044330597, -0.09441816806793213, -0.22946056723594666, -0.001402348279953003, -0.2082587629556656, 0.355375200510025, 0.032327260822057724, 0.19440554082393646, 0.6794120073318481, 0.1254843771457672, 0.19741608202457428, -0.10784643888473511, -0.16196365654468536, -0.3138940930366516, -0.2657392919063568, 0.22370998561382294, 0.0799936056137085, 0.001199524849653244, 0.12317661195993423, -0.023667696863412857, 0.07795490324497223, 0.01156684197485447, 0.11069944500923157, -0.3046744465827942, -0.4499836266040802, 0.23657704889774323, 0.175977885723114, 0.15991131961345673, -0.31311094760894775, -0.5643309950828552, -0.3964640498161316, -0.24457497894763947, -0.1972717046737671, 0.19783735275268555, 0.020304936915636063, -0.0702974945306778, 0.24327805638313293, -0.37692058086395264, 0.01623084768652916, 0.20621240139007568, 0.10768433660268784, 0.040197744965553284, 0.25096017122268677, -0.18009725213050842, 0.2403057962656021, 0.1516474038362503, -0.10692280530929565, -0.2951354384422302, -0.06535883247852325, -0.00908819492906332, 0.0940193235874176, -0.449325293302536, -0.07509021461009979, 0.182580828666687, 0.10091210901737213, -0.05938950926065445, 0.2461671084165573, 0.1463182270526886, 0.2541100084781647, -0.4336790442466736, 0.28818759322166443, 0.001836482435464859, 0.35207119584083557, 0.28190410137176514, 0.2593231797218323, 0.2240563929080963, -0.3817535638809204, -0.2454828917980194, -0.014163840562105179, -0.0427054800093174, -0.2301778793334961, 0.011439613997936249, 0.09957157075405121, 0.0456162765622139, 0.1420029103755951, -0.2800759971141815, -0.1679767221212387, -0.24055704474449158, -0.029431277886033058, 0.12860357761383057, 0.2062188684940338, -0.057606954127550125, 0.09394706785678864, -0.03539419174194336, 0.05993020161986351, -0.3289496898651123, -0.2560231685638428, -0.22163373231887817, 0.09649726003408432, 0.13237343728542328, 0.11535219848155975, 0.0280982106924057, -0.253828227519989, 0.35251808166503906, 0.008754566311836243, 0.0883847028017044, 0.06634502112865448, 0.17190176248550415, -0.19237300753593445, 0.14665676653385162, 0.15460646152496338, -0.01917136460542679, 0.17143934965133667, 0.04412566125392914, -0.38677969574928284, -0.21704518795013428, 0.049753881990909576, -0.2550894618034363, -0.14718931913375854, 0.02835351787507534, 0.07163096219301224, -0.17425738275051117, -0.06733985245227814, -0.37748265266418457, 0.15459489822387695, 0.48661062121391296, 0.19920828938484192, -0.041931480169296265, -0.2756194770336151, -0.3502123951911926, -0.18857021629810333, 0.28508123755455017, 0.029889006167650223, -0.18155759572982788, -0.24620819091796875, 0.200264573097229, 0.11566541343927383, 0.2642042338848114, 0.37572669982910156, -0.08083733171224594, 0.5565184950828552, -0.13263672590255737, 0.802768886089325, 0.012620452791452408, -0.29687875509262085, -0.4103080630302429, -0.23104038834571838, -0.07742975652217865, 0.09857620298862457, -0.033474456518888474, -0.23812341690063477, 0.3454573452472687, -0.06750364601612091, 0.0818396508693695, 0.20014512538909912, 0.03801523149013519, 0.10477260500192642, -0.2749794125556946, -0.21639978885650635, 0.3050483465194702, -0.07470949739217758, 0.009051252156496048, -0.07054153084754944, -0.21690428256988525, -0.1337233930826187, 0.09130623936653137, -0.07540692389011383, 0.2057134211063385, -0.2374829351902008, 0.30944961309432983, -0.11039213836193085, 0.06965319812297821, -0.40511655807495117, -0.10194582492113113, 0.30032461881637573, 0.08144190162420273, 0.19790250062942505, -0.11762307584285736, -0.21483758091926575, -0.2376798391342163, 0.07131082564592361, -0.2693655490875244, -0.18052202463150024, 0.13393431901931763, 0.17963916063308716, 0.0825907364487648, 0.09510278701782227, -0.18301787972450256, 0.11880118399858475, 0.14118055999279022, 0.24643711745738983, -0.024908432736992836, 0.014245487749576569, -0.06773726642131805, -0.3472951054573059, -0.11424969881772995, 0.21376827359199524, 0.08725530654191971, -0.32705992460250854, -0.2259850800037384, 0.4016629159450531, 0.15529412031173706, -0.10870753228664398, -0.3238876163959503, 0.09250646829605103, 0.21401652693748474, 0.19271087646484375, -0.29062941670417786, -0.0504613071680069, 0.06300627440214157, -0.14242735505104065, 0.5693580508232117, 0.4914039373397827, 0.21945592761039734, 0.012872833758592606, -0.16719356179237366, 0.024225391447544098, 0.027849070727825165, -0.03412529081106186, 0.28232449293136597, -0.2416064441204071, -0.10212470591068268, -0.11924432218074799, 0.24738752841949463, -0.009240315295755863, 0.11908268928527832, 0.3404242992401123, 0.5021483302116394, 0.30168062448501587, 0.05649691820144653, -0.06012958660721779, -0.10700373351573944, -0.011160269379615784, 0.0911337211728096, 0.002941526472568512, 0.3001415729522705, 0.07464390993118286, 0.08047707378864288, -0.03363242745399475, 0.13373184204101562, -0.1516629457473755, 0.15257170796394348, 0.2898155450820923, -0.16473142802715302, 0.15413343906402588, -0.022551313042640686, 0.026174504309892654, -0.2333987057209015, -0.026492822915315628, 0.21314206719398499, 0.32544249296188354, -0.10483904182910919, 0.00953693687915802, -0.5120456218719482, -0.023581713438034058, 0.3427569568157196, -0.11447440832853317, 0.023540660738945007, -0.3087626099586487, 0.04949835687875748, 0.3523460030555725, 0.00731358677148819, 0.40308403968811035, 0.0254322811961174, 0.2037680745124817, -0.06574803590774536, 0.13038603961467743, -0.31257864832878113, -0.040928568691015244, -0.47268760204315186, -0.01856093481183052, 0.3418242037296295, -0.2701476812362671, 0.21357251703739166, 0.0573345348238945, 0.056830890476703644, -0.3071143329143524, -0.3434089422225952, 0.2327233999967575, -0.30083537101745605, 0.3379433751106262, 0.1474032998085022, 0.003457285463809967, -0.315069317817688, -0.3399178981781006, 0.24321861565113068, -0.25842782855033875, -0.42748844623565674, -0.06158251315355301, 0.21283778548240662, -0.16765587031841278, -0.1758708655834198, -0.36064407229423523, -0.2766917645931244, -0.2123447060585022, 0.5973958969116211, -0.08335788547992706, 0.0936870202422142, 0.2615811824798584, -0.22856631875038147, 0.011470209807157516, -0.24631501734256744, -0.06534159183502197, -0.2739262282848358, -0.39287078380584717, 0.40064921975135803, -0.2940142750740051, -0.2818599045276642, 0.01991041749715805, 0.08728856593370438, 0.46622052788734436, -0.059141021221876144, 0.02561994642019272, 0.1378268301486969, -0.3020643889904022, 0.37513700127601624, 0.056320518255233765, -0.039949335157871246, 0.3473508358001709, 0.16425113379955292, -0.07412201166152954, -0.20351450145244598, -0.12476304173469543, 0.2377316951751709, 0.09065771847963333, -0.023999977856874466, 0.2720405161380768, 0.22056961059570312, 0.41748571395874023, 0.399990975856781, 0.029240958392620087, -0.15096892416477203, 0.40953028202056885, 0.04389921575784683, 0.06195031479001045, -0.20817014575004578, -0.5267946720123291, -0.08617883920669556, -0.2937934994697571, 0.2181881070137024, 0.35166773200035095, 0.13437555730342865, 0.004132205620408058, -0.054219022393226624, -0.11684082448482513, -0.4567332863807678, -0.3997393846511841, -0.052129123359918594, 0.0552506260573864, 0.02893131785094738, 0.12218324840068817, 0.06214617192745209, -0.4372546076774597, -0.016520928591489792, 0.0599035918712616, 0.01342780515551567, 0.19404150545597076, -0.07912853360176086, -0.394806444644928, -0.007051173597574234, -0.5342714786529541, 0.3783181607723236, 0.0647621899843216, 0.4998343586921692, -0.01251189410686493, -0.05009840801358223, 0.17111718654632568, 0.06891562044620514, 0.47475701570510864, -0.11237291246652603, -0.02052905037999153, 0.19440113008022308, -0.504786491394043, 0.05201943218708038, 0.06497092545032501, -0.001089245080947876, 0.29992151260375977, 0.6331186294555664, 0.4732620418071747, -0.34908461570739746, -0.23297007381916046, -0.2955845892429352, 0.012696389108896255, -0.06724213063716888, 0.05698235332965851, -0.09395118802785873, -0.17976045608520508, -0.2921043932437897, 0.15112163126468658, 0.46192243695259094, 0.4416634440422058, 0.08134959638118744, 0.04200956970453262, -0.22580496966838837, -0.47574567794799805, 0.13445502519607544, 0.1480969935655594, 0.02672615647315979, -0.07264378666877747, 0.32628685235977173, 0.055893346667289734, -0.09890778362751007, 0.08357353508472443, 0.12940582633018494, 0.13794879615306854, -0.470547616481781, -0.07126937806606293, 0.012090329080820084, 0.13089390099048615, 0.07013919949531555, -0.1680063009262085, 0.3711533844470978, -0.22902101278305054, 0.22298777103424072, 0.015484172850847244, 0.49096277356147766, 0.22405143082141876, 0.039590056985616684, -0.34282955527305603, -0.13270507752895355, 0.10557527840137482, 0.1711423695087433, -0.12382149696350098, 0.5926477313041687, 0.07799369096755981, -0.3723677396774292, 0.2172723114490509, -0.03556836023926735, 0.9158405065536499, -0.1794346421957016, 0.014186288230121136, 0.1693052500486374, 0.010832607746124268, 0.4037335515022278, -0.17330725491046906, -0.027670230716466904, -0.23817497491836548, -0.13071849942207336, -0.05713341757655144, 0.05493658781051636, 0.2061171978712082, 0.29793739318847656, -0.2078554630279541, -0.015420451760292053, 0.24175208806991577, 0.44241562485694885, 0.16981059312820435, 0.32105064392089844, -0.1141134575009346, -0.34234029054641724, 0.15426884591579437, 0.11501553654670715, -0.15078739821910858, 0.26817378401756287, 0.1036754623055458, -0.04623071104288101, 0.014085613191127777, -0.1006721630692482, -0.32090598344802856, -0.1262986809015274, -0.5981783866882324, 0.2662317156791687, -0.03942098468542099, -0.1959993541240692, 0.24037180840969086, 0.2702293395996094, 0.2809182405471802, 0.05699601396918297, -0.24919094145298004, 0.07471363246440887, -0.08297561854124069, 0.03333969786763191, -0.08561680465936661, -0.2647351622581482, 0.2865264117717743, 0.014042980968952179, -0.19287323951721191, -0.1264420747756958, 0.0690605565905571, -0.3351147174835205, -0.0024305731058120728, 0.10726194083690643, 0.33019232749938965, -0.24018627405166626, 0.1397770643234253, -0.07882620394229889, 0.11489290744066238, -0.35939672589302063, 0.08453850448131561, 0.021181121468544006, -0.07658876478672028, 0.24733296036720276, -0.1927284449338913, -0.22529110312461853, -0.006472979672253132, 0.42619961500167847, -0.08949700742959976, -0.17667973041534424, 0.5521385669708252, -0.03262493759393692, -0.36716675758361816, -0.12518076598644257, 0.28056055307388306, 0.0515235997736454, -0.0643213763833046, 0.31463125348091125, -0.0024668872356414795, 0.002921357750892639, 0.03945867717266083, 0.6895108819007874, 0.13900712132453918, -0.07682648301124573, -0.13683728873729706, -0.2198891043663025, -0.17600224912166595, 0.15837189555168152, -0.08448334038257599, 0.2808343768119812, 0.07633461058139801, 0.5903747081756592, -0.152805358171463, 0.2119036614894867, -0.264982134103775, 0.042916059494018555, -0.1386774480342865, -0.04055998846888542, 0.03495791181921959, -0.15680979192256927, -0.11916311085224152, 0.009141143411397934, -0.00702083483338356, 0.3557971119880676, -0.03571460768580437, -0.18948593735694885, -0.23221911489963531, 0.1367044597864151, 0.4095993638038635, -0.23485872149467468, 0.07850630581378937, 0.14366596937179565, -0.1270047128200531, -0.42074134945869446, 0.20958201587200165, 0.1616687774658203, -0.04827214404940605, 0.16337212920188904, 0.5813727378845215, 0.1554899364709854, -0.03139043226838112, 0.020171530544757843, -0.039100904017686844, 0.08418001234531403, 0.05067487433552742, 0.2080179899930954, 0.08446905761957169, 0.05167943239212036, -0.031665533781051636, -0.014519445598125458, 0.19769084453582764, 0.07505814731121063, 0.050862547010183334, -0.23049373924732208, -0.1898646354675293, 0.005752138793468475, 0.07919906079769135, 0.17906919121742249, 0.12933950126171112, -0.34969571232795715, 0.6162437200546265, 0.12663525342941284, -0.15354838967323303, -0.04024357348680496, 0.5069514513015747, -0.04000158980488777, 0.21066536009311676, 0.2672346532344818, 0.031348928809165955, 0.23477929830551147, -0.25715500116348267, -0.11983281373977661, 0.5762820839881897, -0.2660082280635834, 0.25631341338157654, 0.19672062993049622, -0.18307989835739136, 0.2789839506149292, 0.45314687490463257, 0.008706415072083473, 0.22679957747459412, 0.27162474393844604, -0.07584427297115326, 0.5610451698303223, 0.10243944823741913, 0.193134605884552, 0.1455932855606079, -0.5048558115959167, -0.13242220878601074, -0.18597498536109924, -0.040932148694992065, -0.002978844568133354, -0.07621573656797409, 0.6056793332099915, -0.38634687662124634, -0.20637927949428558, -0.1680709719657898, 0.7164966464042664, -0.30371326208114624, -0.10500319302082062, -0.31416645646095276, -0.05979173630475998, -0.052811525762081146, -0.17033295333385468, -0.006325162947177887, -0.01726459711790085, 0.13194440305233002, -0.09214547276496887, -0.1795385330915451, -0.03690221160650253, -0.3119634985923767, -0.20077016949653625, 0.3445216715335846, -0.20582075417041779, 0.12847144901752472, -0.16891732811927795, -0.08263662457466125, -0.2552993595600128, 0.4170949459075928, 0.19595247507095337, 0.2134021371603012, -0.3207428753376007, -0.3152713477611542, -0.31326010823249817, 0.16988803446292877, -0.1697552502155304, 0.46575790643692017, -0.25927793979644775, -0.08861701190471649, 0.15835040807724, 0.013153165578842163, -0.10398100316524506, -0.5708889365196228, 0.1931842416524887, 0.07724450528621674, -0.07332110404968262, 0.28684210777282715, -0.23813298344612122, -0.21560105681419373, 0.26896992325782776, -0.04403815418481827, -0.04960868880152702, 0.29772159457206726, 0.005475956946611404, -0.15034280717372894, 0.23963725566864014, -0.19463181495666504, 0.09275029599666595, 0.021148260682821274, 0.28326693177223206, 0.17836052179336548, -0.18991701304912567, -0.15937136113643646, -0.17595556378364563, -0.44528353214263916, 0.14003075659275055, 0.17562541365623474, -0.2673969268798828, -0.11020137369632721, -0.06106619909405708, 0.029161471873521805, 0.08146845549345016, -0.012626245617866516, 0.4188615083694458, -0.0005492828786373138, 0.22938396036624908, -0.41630908846855164, 0.04786551743745804, -0.03873082995414734, -0.06972518563270569, 0.2208424061536789, -0.21347352862358093, 0.1700657457113266, 0.14200137555599213, 0.047425076365470886, -0.3239312767982483, -0.10646921396255493, 0.1574721336364746, -0.32039669156074524, 0.3230474591255188, 0.27783992886543274, 0.17764504253864288, -0.030312608927488327, 0.3568428158760071, -0.053342513740062714, -0.23312237858772278, -0.1710292249917984, 0.22592268884181976, -0.10709710419178009, 0.43283185362815857, -0.13394412398338318, -0.021677188575267792, -0.24435625970363617, 0.09719657152891159, -0.042005546391010284, 0.02517394721508026, -0.10057442635297775, 0.18395444750785828, -0.20248644053936005, 0.04658650606870651, -0.023725885897874832, 0.3187227249145508, -0.1209290623664856, 0.43584543466567993, -0.3279350996017456, -0.5902301669120789, 0.6034678220748901, -0.4754345118999481, -0.265563428401947, -0.22435787320137024, 0.06553638726472855, 0.28582876920700073, -0.28636863827705383, -0.1630590856075287, -0.2245522141456604, 0.35728931427001953, 0.11010398715734482, -0.35672515630722046, 0.3400425314903259, -0.12434492260217667, -0.15856315195560455, -0.16753050684928894, 0.870323896408081, 0.030750904232263565, -0.0045881569385528564, 0.2951434850692749, 0.07260341197252274 ]
https://github.com/huggingface/datasets/issues/5768
I am not able to reproduce your issue: the dataset loads perfectly on my local machine and on a Colab notebook: https://colab.research.google.com/drive/1Fbdoa1JdNz8DOdX6gmIsOK1nCT8Abj4O?usp=sharing ```python In [1]: from datasets import load_dataset In [2]: ds = load_dataset("squad") Downloading builder script: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5.27k/5.27k [00:00<00:00, 3.22MB/s] Downloading metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.36k/2.36k [00:00<00:00, 1.60MB/s] Downloading readme: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.67k/7.67k [00:00<00:00, 4.58MB/s] Downloading and preparing dataset squad/plain_text to ...t/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453... Downloading data: 30.3MB [00:00, 91.8MB/s] | 0/2 [00:00<?, ?it/s] Downloading data: 4.85MB [00:00, 75.3MB/s] Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.31it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2157.01it/s] Dataset squad downloaded and prepared to .../.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 463.95it/s] In [3]: ds Out[3]: DatasetDict({ train: Dataset({ features: ['id', 'title', 'context', 'question', 'answers'], num_rows: 87599 }) validation: Dataset({ features: ['id', 'title', 'context', 'question', 'answers'], num_rows: 10570 }) }) ```
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1
### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64
134
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1 ### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64 I am not able to reproduce your issue: the dataset loads perfectly on my local machine and on a Colab notebook: https://colab.research.google.com/drive/1Fbdoa1JdNz8DOdX6gmIsOK1nCT8Abj4O?usp=sharing ```python In [1]: from datasets import load_dataset In [2]: ds = load_dataset("squad") Downloading builder script: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 5.27k/5.27k [00:00<00:00, 3.22MB/s] Downloading metadata: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2.36k/2.36k [00:00<00:00, 1.60MB/s] Downloading readme: 100%|█████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 7.67k/7.67k [00:00<00:00, 4.58MB/s] Downloading and preparing dataset squad/plain_text to ...t/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453... Downloading data: 30.3MB [00:00, 91.8MB/s] | 0/2 [00:00<?, ?it/s] Downloading data: 4.85MB [00:00, 75.3MB/s] Downloading data files: 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2.31it/s] Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 2157.01it/s] Dataset squad downloaded and prepared to .../.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453. Subsequent calls will reuse this data. 100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 463.95it/s] In [3]: ds Out[3]: DatasetDict({ train: Dataset({ features: ['id', 'title', 'context', 'question', 'answers'], num_rows: 87599 }) validation: Dataset({ features: ['id', 'title', 'context', 'question', 'answers'], num_rows: 10570 }) }) ```
[ -0.14147433638572693, -0.1111864298582077, 0.11645541340112686, 0.20971336960792542, 0.1910736858844757, -0.010600008070468903, 0.44336479902267456, 0.10783032327890396, 0.12432239949703217, 0.08927089720964432, -0.15808814764022827, 0.47217845916748047, 0.09567844867706299, -0.08369425684213638, 0.06465151906013489, -0.07949637621641159, 0.04164694994688034, 0.03371625393629074, -0.02762630209326744, 0.0066010355949401855, -0.10634399950504303, 0.23977044224739075, -0.31610023975372314, 0.09932774305343628, -0.21057403087615967, 0.11991438269615173, -0.08942921459674835, 0.29296037554740906, -0.0163391325622797, -0.4379059076309204, 0.5355326533317566, 0.13396789133548737, 0.4824672043323517, 0.6802203059196472, -0.0001234605733770877, 0.19730575382709503, 0.16809819638729095, -0.08877447992563248, -0.6296793818473816, -0.4392578601837158, -0.07274910807609558, -0.2982814908027649, 0.36519962549209595, -0.032088689506053925, 0.0033540278673171997, 0.37015557289123535, 0.22217735648155212, -0.28893983364105225, 0.49932608008384705, 0.15460973978042603, 0.15743623673915863, 0.4052542448043823, -0.1866416186094284, -0.27169129252433777, 0.014835734851658344, 0.05477548763155937, -0.23731550574302673, 0.3177575170993805, 0.36807963252067566, 0.11812037229537964, 0.14633861184120178, 0.006986886262893677, -0.025928355753421783, 0.022426031529903412, 0.38828471302986145, 0.16873738169670105, 0.056943319737911224, -0.24497562646865845, 0.18276572227478027, 0.331788033246994, 0.33936232328414917, -0.25541526079177856, -0.33551812171936035, -0.25305336713790894, -0.03625163808465004, 0.03321012109518051, 0.391389936208725, 0.13678748905658722, -0.21921290457248688, 0.172457754611969, -0.13903860747814178, 0.07741475105285645, -0.01611703634262085, -0.017815344035625458, -0.11204130202531815, 0.07458776235580444, -0.27069979906082153, 0.22414830327033997, 0.09346649050712585, 0.11096705496311188, -0.08407995849847794, -0.1790122240781784, -0.04036542400717735, 0.3737218379974365, -0.45240840315818787, 0.20187093317508698, 0.0136030288413167, -0.11376456916332245, 0.10117961466312408, -0.11167576909065247, 0.3531157672405243, 0.16501659154891968, -0.00046495720744132996, 0.28300735354423523, 0.2933180332183838, 0.17218385636806488, 0.27007678151130676, -0.01644863188266754, 0.4787443280220032, 0.38192740082740784, -0.2127113938331604, 0.060432177037000656, -0.37109917402267456, -0.21631039679050446, 0.13281139731407166, -0.21507960557937622, 0.16104266047477722, -0.20641294121742249, -0.31543660163879395, -0.01677769422531128, 0.06697705388069153, -0.010737799108028412, 0.10725298523902893, 0.4653993248939514, -0.08757666498422623, 0.08982294797897339, 0.008722744882106781, 0.24396273493766785, -0.10134577751159668, -0.20085276663303375, -0.07243897020816803, -0.12652668356895447, -0.16286391019821167, 0.0648128017783165, 0.3728846311569214, -0.46782100200653076, 0.10040248930454254, 0.1865507811307907, -0.13906580209732056, -0.08275381475687027, -0.2777460813522339, -0.0978393703699112, -0.019425641745328903, 0.03774449974298477, 0.2064693719148636, 0.2518785893917084, 0.10736115276813507, -0.41694745421409607, -0.13113074004650116, 0.08339892327785492, -0.4551602303981781, -0.053538721054792404, -0.07344409078359604, 0.056619469076395035, -0.31511831283569336, -0.19225887954235077, -0.4332495331764221, 0.2299579381942749, -0.09377869963645935, -0.25126543641090393, -0.18313701450824738, -0.11840107291936874, -0.3299601674079895, -0.18346938490867615, 0.3491584062576294, 0.6474718451499939, -0.7950429320335388, -0.12315340340137482, 0.13445359468460083, -0.10613325238227844, -0.04084929823875427, 0.11449989676475525, -0.10102158784866333, 0.08466577529907227, -0.3304072618484497, -0.3028249740600586, 0.3194698095321655, -0.47373342514038086, -0.13730964064598083, 0.1447303295135498, -0.0896277129650116, 0.365833044052124, -0.004166536033153534, -0.07468236982822418, 0.1391116827726364, 0.009114749729633331, 0.11182749271392822, 0.32100874185562134, 0.04571898281574249, 0.01975957304239273, -0.23522204160690308, -0.35453057289123535, -0.005360610783100128, 0.19653835892677307, 0.2660367488861084, 0.20484238862991333, 0.0767497643828392, 0.11552554368972778, 0.32981351017951965, -0.05736202001571655, -0.05840914696455002, 0.12688308954238892, 0.1698273867368698, 0.004101883620023727, 0.02150139957666397, -0.21240967512130737, -0.5801027417182922, 0.5306609869003296, 0.07548526674509048, -0.007510404102504253, 0.16975098848342896, -0.02573457732796669, -0.2111874669790268, 0.01741863042116165, -0.4254060983657837, 0.020575620234012604, -0.019069403409957886, 0.1801738440990448, 0.08650729805231094, 0.06391313672065735, -0.29102641344070435, 0.5662500858306885, -0.3452441394329071, 0.30525046586990356, -0.17863990366458893, 0.37227076292037964, 0.11477796733379364, -0.2139168679714203, -0.26687681674957275, 0.13728179037570953, 0.15520235896110535, -0.18486103415489197, -0.08595240861177444, 0.45117536187171936, 0.10259567201137543, -0.07014593482017517, 0.006799331866204739, -0.16547302901744843, 0.12341219186782837, 0.005091734230518341, -0.04646041616797447, 0.23196351528167725, 0.2016085535287857, -0.010915406048297882, -0.39233991503715515, 0.3682381510734558, -0.12415646016597748, 0.3411007821559906, 0.2289055436849594, -0.13063156604766846, 0.18579626083374023, 0.10327164828777313, -0.05694686248898506, 0.14412495493888855, 0.07320354133844376, 0.05530242994427681, 0.15244081616401672, 0.02229769341647625, -0.1806248128414154, 0.020236782729625702, 0.40750133991241455, 0.05798596143722534, 0.03122085891664028, 0.24216534197330475, -0.16864487528800964, -0.05745036527514458, 0.07348614186048508, 0.04146873950958252, 0.374755322933197, 0.050198327749967575, -0.09657657146453857, 0.11341466009616852, -0.15481799840927124, 0.03129705786705017, 0.17677024006843567, 0.08145478367805481, -0.04284964129328728, 0.024549029767513275, 0.19450613856315613, 0.2020529955625534, -0.27248090505599976, -0.15582682192325592, -0.0782521590590477, 0.05926983058452606, -0.5920116305351257, 0.2073531448841095, -0.23144227266311646, 0.10350251197814941, -0.36199796199798584, 0.4329087436199188, -0.3539588153362274, -0.14458107948303223, -0.2577988803386688, 0.3801363408565521, 0.3631564676761627, -0.029557108879089355, -0.1334408074617386, 0.4616871476173401, -0.029081787914037704, -0.4167133569717407, 0.07345645129680634, 0.050344113260507584, -0.3678344190120697, -0.11239498853683472, 0.23192083835601807, -0.10820825397968292, -0.046316880732774734, -0.41255268454551697, -0.25944042205810547, -0.07602407783269882, -0.28156769275665283, 0.3640590310096741, 0.07575603574514389, 0.3881033957004547, 0.10959979891777039, 0.12651993334293365, -0.2998697757720947, -0.04388176277279854, 0.37662017345428467, -0.30933964252471924, -0.07554720342159271, 0.19709782302379608, -0.11534395813941956, -0.15845082700252533, -0.1663784384727478, -0.18142084777355194, -0.18894155323505402, -0.250309556722641, 0.1801859438419342, 0.08558802306652069, 0.0613432303071022, 0.4932953715324402, 0.17404510080814362, 0.2725309133529663, 0.04403642937541008, 0.35674312710762024, -0.11005173623561859, -0.5169263482093811, 0.33920809626579285, -0.18418022990226746, -0.44221851229667664, 0.13294483721256256, 0.055558353662490845, -0.128713458776474, -0.1823071837425232, -0.3844040334224701, -0.26099497079849243, -0.11331762373447418, 0.3354165256023407, 0.11738970875740051, 0.3180142939090729, 0.05252336710691452, -0.3371611535549164, 0.11716822534799576, -0.16311049461364746, -0.523339569568634, 0.11308746784925461, 0.2597179412841797, 0.2705534100532532, 0.08708173781633377, 0.17879296839237213, -0.07209332287311554, 0.6621479988098145, 0.1852390170097351, -0.1251969188451767, 0.34163886308670044, -0.18350005149841309, 0.5743580460548401, -0.32390934228897095, -0.38773423433303833, 0.03241585195064545, -0.20738154649734497, 0.0531235933303833, 0.2763724625110626, 0.22731174528598785, 0.08555560559034348, -0.24147967994213104, 0.17460456490516663, 0.01962634176015854, -0.3499249219894409, 0.010766753926873207, 0.18346619606018066, -0.14269870519638062, 0.15683630108833313, 0.4136449098587036, -0.22067762911319733, -0.19829782843589783, -0.10268917679786682, 0.5983203649520874, 0.03964432328939438, 0.0917440801858902, -0.3011416792869568, -0.0072203129529953, -0.26712995767593384, 0.21668697893619537, 0.016412559896707535, 0.3805699348449707, -0.011123299598693848, 0.01928938925266266, 0.13868626952171326, -0.04228024557232857, 0.5936824679374695, -0.0167466439306736, 0.15871752798557281, 0.12081920355558395, -0.19455353915691376, -0.6548908948898315, -0.26570767164230347, 0.03937676548957825, 0.20840473473072052, 0.33394667506217957, 0.25996264815330505, -0.1613510102033615, -0.21534259617328644, 0.14514270424842834, 0.2257944494485855, -0.15100036561489105, -0.07666964828968048, -0.558274507522583, -0.1690966784954071, -0.18126511573791504, -0.23107317090034485, -0.11641573905944824, 0.24852192401885986, -0.007146734744310379, 0.0374986007809639, 0.09636814892292023, -0.035459671169519424, 0.26580971479415894, 0.34398865699768066, 0.29235029220581055, 0.18363668024539948, 0.26882636547088623, 0.486960768699646, 0.14715880155563354, -0.12246201932430267, 0.7199112176895142, -0.20838463306427002, -0.44085612893104553, 0.4049173891544342, -0.18105745315551758, 0.22665941715240479, 0.6369774341583252, -0.21999531984329224, -0.04436955973505974, -0.1590883731842041, -0.020347073674201965, -0.03204288333654404, -0.04373741149902344, 0.3423982262611389, -0.007394265383481979, -0.14561370015144348, -0.4245207905769348, 0.2519858777523041, 0.05601915717124939, -0.05783800780773163, 0.24324673414230347, 0.27117395401000977, -0.22481516003608704, 0.24950814247131348, -0.31385868787765503, 0.8746324777603149, -0.16336774826049805, 0.19228143990039825, 0.29063963890075684, -0.16334418952465057, 0.4633302390575409, 0.033098943531513214, 0.1431632936000824, -0.4624105989933014, -0.11507079005241394, 0.054145172238349915, -0.0820012241601944, 0.2142348289489746, 0.003037939313799143, -0.14188888669013977, 0.3274967074394226, -0.24929702281951904, 0.39908847212791443, 0.16272187232971191, 0.12814879417419434, -0.04252711310982704, -0.24942651391029358, -0.4818970561027527, 0.09859579056501389, 0.030596887692809105, 0.27365371584892273, -0.1599380075931549, 0.06636883318424225, -0.08412431925535202, -0.19912248849868774, -0.28504878282546997, 0.11326049268245697, -0.16636879742145538, 0.0825023427605629, 0.3252108693122864, -0.16307315230369568, 0.20016463100910187, 0.3521994352340698, 0.2915222942829132, -0.0006415906827896833, -0.08351593464612961, 0.14581963419914246, -0.12626028060913086, 0.31870901584625244, 0.015225812792778015, -0.0065123774111270905, 0.24760642647743225, -0.00839512050151825, -0.18046197295188904, -0.11692634969949722, -0.18180879950523376, -0.2880120873451233, 0.0021239668130874634, 0.12822258472442627, 0.1845603734254837, -0.13486769795417786, -0.05345575883984566, -0.202452152967453, 0.23266583681106567, -0.2738199532032013, 0.05307440832257271, 0.05363635718822479, -0.05044376850128174, 0.22246277332305908, 0.15099038183689117, -0.31781578063964844, 0.06747695058584213, 0.5521403551101685, -0.47070080041885376, 0.0017746612429618835, 0.37854328751564026, 0.2388049066066742, -0.10023285448551178, -0.08847448229789734, 0.29485267400741577, 0.2552986443042755, -0.4249348044395447, 0.11495484411716461, -0.16011717915534973, -0.06364941596984863, -0.04600103944540024, 0.5195675492286682, 0.18252769112586975, -0.24542495608329773, -0.056591350585222244, -0.4651936888694763, -0.07382722944021225, -0.020295877009630203, 0.27105364203453064, -0.07213510572910309, 0.08148598670959473, -0.07920818030834198, 0.07890111953020096, -0.2150973528623581, -0.1950400471687317, 0.16924983263015747, -0.009528614580631256, -0.16220442950725555, -0.062451060861349106, 0.12463429570198059, 0.23623235523700714, -0.22954881191253662, -0.018854152411222458, -0.003130044788122177, -0.14533820748329163, -0.11251495778560638, -0.34280967712402344, 0.21234509348869324, -0.05810677632689476, -0.1456954926252365, -0.07092231512069702, -0.17306652665138245, -0.2489008903503418, -0.31059202551841736, 0.2818804383277893, 0.32521194219589233, -0.03215960040688515, 0.04725557565689087, -0.09097601473331451, 0.25234901905059814, -0.07819677889347076, 0.14440752565860748, 0.08849242329597473, 0.4301377832889557, 0.2542511820793152, 0.20511001348495483, -0.2600364685058594, 0.07015059888362885, -0.046843551099300385, 0.25144463777542114, 0.059799373149871826, 0.112650066614151, 0.19364574551582336, -0.5092152953147888, 0.1621052771806717, -0.060394641011953354, 0.18022029101848602, 0.5461205244064331, -0.1525813341140747, 0.05565498024225235, -0.062242232263088226, 0.041198622435331345, -0.08398158848285675, 0.005883172154426575, 0.4407317638397217, 0.038735516369342804, 0.03765053302049637, 0.3995852470397949, 0.15028518438339233, -0.013892538845539093, 0.013604719191789627, -0.014354363083839417, 0.7649060487747192, 0.29117509722709656, 0.23526284098625183, 0.378848135471344, 0.0692010372877121, 0.3799670934677124, 0.13751369714736938, -0.07884521782398224, -0.14752580225467682, 0.24132724106311798, -0.360291063785553, 0.1768266260623932, -0.15739192068576813, 0.2033459097146988, 0.2653205394744873, -0.4721258580684662, 0.304482638835907, 0.08971037715673447, 0.11029767990112305, -0.0731259286403656, -0.2064552903175354, 0.6576586961746216, -0.6175454258918762, -0.2966119647026062, -0.35177427530288696, -0.17579151690006256, -0.13020025193691254, -0.09620869904756546, -0.36559629440307617, -0.37198638916015625, -0.1860964596271515, 0.026150502264499664, -0.026542415842413902, -0.2964661717414856, 0.12554222345352173, 0.03330694139003754, 0.06880079209804535, -0.45154106616973877, -0.2564361095428467, 0.04666005074977875, 0.10601064562797546, -0.025105446577072144, 0.3356645405292511, -0.06524458527565002, 0.07458449900150299, 0.33569130301475525, 0.014589598402380943, 0.42294347286224365, 0.4292905330657959, 0.11336278170347214, -0.04064605012536049, -0.12246684730052948, 0.04547222703695297, -0.07985281199216843, 0.11361917108297348, -0.11217232048511505, -0.09243874251842499, 0.3033265471458435, 0.03893797844648361, -0.033455926924943924, -0.03211665153503418, 0.05720113217830658, 0.08140241354703903, -0.45276761054992676, 0.3658050298690796, -0.26177850365638733, 0.12020839005708694, -0.11619135737419128, -0.08968684077262878, 0.010534882545471191, 0.05222509801387787, 0.18759945034980774, 0.10649321973323822, 0.152430921792984, -0.10626690089702606, 0.023472771048545837, 0.1713382452726364, 0.2986931800842285, 0.17251460254192352, -0.019452666863799095, -0.14901812374591827, 0.11820319294929504, -0.8466902375221252, 0.11601607501506805, 0.025104885920882225, -0.09250685572624207, 0.1335166096687317, 0.2507226765155792, -0.10354194045066833, 0.19710895419120789, 0.327560693025589, -0.27782008051872253, 0.1620291918516159, 0.10723444819450378, -0.3496829867362976, -0.25984516739845276, -0.024051859974861145, 0.0625116378068924, -0.10760781913995743, -0.6166468858718872, 0.12282557785511017, -0.36891061067581177, -0.17455029487609863, 0.07659472525119781, -0.20676037669181824, 0.013080380856990814, -0.5583338141441345, 0.4164707064628601, -0.20652686059474945, 0.4800102114677429, 0.14735190570354462, -0.17399874329566956, -0.3878967761993408, -0.19267506897449493, -0.21263298392295837, 0.1807822436094284, -0.18786878883838654, 0.36487939953804016, -0.13180133700370789, -0.18720358610153198, -0.3038751780986786, 0.24605418741703033, 0.24681676924228668, -0.0186910517513752, -0.39558011293411255, 0.06973348557949066, -0.17174944281578064, 0.360317587852478, 0.032821204513311386, 0.14828801155090332, -0.3248921036720276, 0.20687618851661682, -0.3233942985534668, -0.12046802043914795, 0.4849688708782196, -0.5221558213233948, -0.3539141118526459, -0.4317186772823334, 0.24616749584674835, 0.045567721128463745, -0.10662278532981873, -0.3852914571762085, -0.03302927315235138, 0.20753946900367737, -0.2588246464729309, -0.12750999629497528, 0.09069350361824036, -0.32683074474334717, 0.15397034585475922, -0.11279378831386566, -0.12486808001995087, -0.015663910657167435, -0.16649654507637024, 0.03969421982765198, -0.2595837712287903 ]
https://github.com/huggingface/datasets/issues/5768
I am at a complete loss for what's happening here. A quick summary, I have 3 machines to try this with: 1) My windows 10 laptop 2) Linux machine1, super computer login node 3) Linux machine2, super computer compute node Let's define the following as a test script for the machines: ``` import traceback import datasets print(f"{datasets.__version__=}") try: ds = datasets.load_dataset("squad") except: traceback.print_exc() else: print("Success!") ``` The Windows laptop enters some sort of traceback recursion loop: > datasets.__version__='2.7.1' > Downloading and preparing dataset squad/plain_text to C:/Users/yr3g17/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453... > Downloading data files: 100%|██████████| 2/2 [00:00<?, ?it/s] > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main > exitcode = _main(fd, parent_sentinel) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main > prepare(preparation_data) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare > _fixup_main_from_path(data['init_main_from_path']) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path > main_content = runpy.run_path(main_path, > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 267, in run_path > code, fname = _get_code_from_file(run_name, path_name) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 237, in _get_code_from_file > with io.open_code(decoded_path) as f: > OSError: [Errno 22] Invalid argument: 'C:\\Users\\yr3g17\\OneDrive - University of Southampton\\Documents\\PhD-repository\\<input>' > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main > exitcode = _main(fd, parent_sentinel) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main > prepare(preparation_data) **this error traceback is endlessly recursive** This is a brand new issue that started today and I didn't even realise was a thing, as I had been using my windows machine to follow tracebacks for the other machines... I suspect this issue had something to do with my filepath naming, but I couldn't confirm this when I spent time trying to debug this myself weeks ago, something to do with files being locked and never released. I'm not too concerned about my laptop not working here because I've had so many issues with Microsoft OneDrive and my filesystem. Linux machines 1 and 2 were working fine for months, but have all of a sudden stopped working. Trying to run linux machine 1 (login node), I get: > datasets.__version__='2.10.1' > Downloading and preparing dataset json/squad to /home/yr3g17/.cache/hugg ingface/datasets/json/squad-d733af945be1d2c2/0.0.0/0f7e3662623656454fcd2 b650f34e886a7db4b9104504885bd462096cc7a9f51... > Downloading data files: 100%|███████████████████████████████████████████ █████████████████████████████████████████████| 2/2 [00:00<00:00, 4042.70 it/s] >Extracting data files: 100%|███████████████████████████████████████ ███████████████████████████████████████████████████| 2/2 [00:00<00:00, 1 11.15it/s] > Generating train split: 0 examples [00:00, ? examples/s] and hangs here. This has not happened to me before on the Linux machine. If I forcefully keyboard interrupt, I get: > Traceback (most recent call last): > File "<stdin>", line 2, in <module> > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/load.py", line 1782, in load_dataset > builder_instance.download_and_prepare( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/builder.py", line 793, in download_and_prepare > with FileLock(lock_path) if is_local else contextlib.nullcontext(): > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/utils/filelock.py", line 320, in __enter__ > self.acquire() > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/utils/filelock.py", line 282, in acquire > time.sleep(poll_intervall) Which also appears to be file lock related! I resolved this by navigating to my ~/.cache/huggingface/datasets directory and wiping out anything to do with the squad dataset in *.lock files. Now I get: ``` from datasets import load_dataset dataset_load("squad") ``` > Downloading and preparing dataset squad/plain_text to /home/yr3g17/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb > 2511d223b9150cce08a837ef62ffea453... > Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 44.75it/s] > Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 8.54it/s] > Dataset squad downloaded and prepared to /home/yr3g17/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150 > cce08a837ef62ffea453. Subsequent calls will reuse this data. > 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 19.77it/s] > DatasetDict({ > train: Dataset({ > features: ['id', 'title', 'context', 'question', 'answers'], > num_rows: 87599 > }) > validation: Dataset({ > features: ['id', 'title', 'context', 'question', 'answers'], > num_rows: 10570 > }) > }) > Which all seems fine right, it's doing what it should be. But now, without ever leaving the IDE, I "make a subsequent call" to reuse the data by repeating the command. I encounter the following traceback `load_dataset("squad")` > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1759, in load_dataset > builder_instance = load_dataset_builder( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1496, in load_dataset_builder > dataset_module = dataset_module_factory( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1151, in dataset_module_factory > ).get_module() > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 631, in get_module > data_files = DataFilesDict.from_local_or_remote( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/data_files.py", line 796, in from_local_or_remote > DataFilesList.from_local_or_remote( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/data_files.py", line 764, in from_local_or_remote > data_files = resolve_patterns_locally_or_by_urls(base_path, patterns, allowed_extensions) > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/data_files.py", line 369, in resolve_patterns_locally_or_by_urls > raise FileNotFoundError(error_msg) > FileNotFoundError: Unable to resolve any data file that matches '['train[-._ 0-9/]**', '**[-._ 0-9/]train[-._ 0-9/]**', 'training[-._ 0-9/]**', '**[- > ._ 0-9/]training[-._ 0-9/]**']' at /mainfs/home/yr3g17/.cache/huggingface/datasets/squad 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', 'gr > ib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', ' > mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', ' > emf', 'xbm', 'xpm', 'BLP', 'BMP', 'DIB', 'BUFR', 'CUR', 'PCX', 'DCX', 'DDS', 'PS', 'EPS', 'FIT', 'FITS', 'FLI', 'FLC', 'FTC', 'FTU', 'GBR', 'GIF', 'G > RIB', 'H5', 'HDF', 'PNG', 'APNG', 'JP2', 'J2K', 'JPC', 'JPF', 'JPX', 'J2C', 'ICNS', 'ICO', 'IM', 'IIM', 'TIF', 'TIFF', 'JFIF', 'JPE', 'JPG', 'JPEG', > 'MPG', 'MPEG', 'MSP', 'PCD', 'PXR', 'PBM', 'PGM', 'PPM', 'PNM', 'PSD', 'BW', 'RGB', 'RGBA', 'SGI', 'RAS', 'TGA', 'ICB', 'VDA', 'VST', 'WEBP', 'WMF', > 'EMF', 'XBM', 'XPM', 'aiff', 'au', 'avr', 'caf', 'flac', 'htk', 'svx', 'mat4', 'mat5', 'mpc2k', 'ogg', 'paf', 'pvf', 'raw', 'rf64', 'sd2', 'sds', 'ir > cam', 'voc', 'w64', 'wav', 'nist', 'wavex', 'wve', 'xi', 'mp3', 'opus', 'AIFF', 'AU', 'AVR', 'CAF', 'FLAC', 'HTK', 'SVX', 'MAT4', 'MAT5', 'MPC2K', 'O > GG', 'PAF', 'PVF', 'RAW', 'RF64', 'SD2', 'SDS', 'IRCAM', 'VOC', 'W64', 'WAV', 'NIST', 'WAVEX', 'WVE', 'XI', 'MP3', 'OPUS', 'zip'] It doesn't even appear like I can reliably repeat this process. I'll nuke squad files in my dataset cache and run the Python code again (which downloads a new copy of the dataset to cache). It will either fail (as it just did in the quote above), or it will successfully recall the dataset. I repeated this nuking process a few times until calling load_dataset was reliably giving me the correct result (no filelocking issues or tracebacks). I then sent the test script as a job to the supercomputer compute nodes (which do not have internet access and therefore depend on cached data from Linux machine 1 login nodes) > Using the latest cached version of the module from /home/yr3g17/.cache/huggingface/modules/datasets_modules/datasets/squad/8730650fed465361f38ac4d810 > ccdd16e8fc87b56498e52fb7e2cadaefc1f177 (last modified on Tue Feb 14 10:12:56 2023) since it couldn't be found locally at squad., or remotely on the Hugging Face Hub. > Traceback (most recent call last): > File "/mainfs/scratch/yr3g17/squad_qanswering/3054408/0/../../main.py", line 5, in <module> > dataset = load_dataset("squad") > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1759, in load_dataset > builder_instance = load_dataset_builder( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1522, in load_dataset_builder > builder_instance: DatasetBuilder = builder_cls( > TypeError: 'NoneType' object is not callable and I have absolutely no idea why the second and third machines are producing different tracebacks. I have previously run these exact scripts successfully on the login and compute nodes of the supercomputer, this issue I'm raising has appeared fairly recently for me. This, is where I encounter the TypeError that I opened this issue with, which I was able to traceback (using my laptop before it too started not working) to whatever was dynamically importing "builder_cls". That bit of code wasn't doing importing builder_cls correctly and would effectively make the assignment "builder_cls=None" resulting in the TypeError. Does any of this help?
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1
### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64
1,237
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1 ### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64 I am at a complete loss for what's happening here. A quick summary, I have 3 machines to try this with: 1) My windows 10 laptop 2) Linux machine1, super computer login node 3) Linux machine2, super computer compute node Let's define the following as a test script for the machines: ``` import traceback import datasets print(f"{datasets.__version__=}") try: ds = datasets.load_dataset("squad") except: traceback.print_exc() else: print("Success!") ``` The Windows laptop enters some sort of traceback recursion loop: > datasets.__version__='2.7.1' > Downloading and preparing dataset squad/plain_text to C:/Users/yr3g17/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453... > Downloading data files: 100%|██████████| 2/2 [00:00<?, ?it/s] > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main > exitcode = _main(fd, parent_sentinel) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main > prepare(preparation_data) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 236, in prepare > _fixup_main_from_path(data['init_main_from_path']) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 287, in _fixup_main_from_path > main_content = runpy.run_path(main_path, > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 267, in run_path > code, fname = _get_code_from_file(run_name, path_name) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\runpy.py", line 237, in _get_code_from_file > with io.open_code(decoded_path) as f: > OSError: [Errno 22] Invalid argument: 'C:\\Users\\yr3g17\\OneDrive - University of Southampton\\Documents\\PhD-repository\\<input>' > Traceback (most recent call last): > File "<string>", line 1, in <module> > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 116, in spawn_main > exitcode = _main(fd, parent_sentinel) > File "C:\Users\yr3g17\AppData\Local\Programs\Python\Python39\lib\multiprocessing\spawn.py", line 125, in _main > prepare(preparation_data) **this error traceback is endlessly recursive** This is a brand new issue that started today and I didn't even realise was a thing, as I had been using my windows machine to follow tracebacks for the other machines... I suspect this issue had something to do with my filepath naming, but I couldn't confirm this when I spent time trying to debug this myself weeks ago, something to do with files being locked and never released. I'm not too concerned about my laptop not working here because I've had so many issues with Microsoft OneDrive and my filesystem. Linux machines 1 and 2 were working fine for months, but have all of a sudden stopped working. Trying to run linux machine 1 (login node), I get: > datasets.__version__='2.10.1' > Downloading and preparing dataset json/squad to /home/yr3g17/.cache/hugg ingface/datasets/json/squad-d733af945be1d2c2/0.0.0/0f7e3662623656454fcd2 b650f34e886a7db4b9104504885bd462096cc7a9f51... > Downloading data files: 100%|███████████████████████████████████████████ █████████████████████████████████████████████| 2/2 [00:00<00:00, 4042.70 it/s] >Extracting data files: 100%|███████████████████████████████████████ ███████████████████████████████████████████████████| 2/2 [00:00<00:00, 1 11.15it/s] > Generating train split: 0 examples [00:00, ? examples/s] and hangs here. This has not happened to me before on the Linux machine. If I forcefully keyboard interrupt, I get: > Traceback (most recent call last): > File "<stdin>", line 2, in <module> > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/load.py", line 1782, in load_dataset > builder_instance.download_and_prepare( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/builder.py", line 793, in download_and_prepare > with FileLock(lock_path) if is_local else contextlib.nullcontext(): > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/utils/filelock.py", line 320, in __enter__ > self.acquire() > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/d > atasets/utils/filelock.py", line 282, in acquire > time.sleep(poll_intervall) Which also appears to be file lock related! I resolved this by navigating to my ~/.cache/huggingface/datasets directory and wiping out anything to do with the squad dataset in *.lock files. Now I get: ``` from datasets import load_dataset dataset_load("squad") ``` > Downloading and preparing dataset squad/plain_text to /home/yr3g17/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb > 2511d223b9150cce08a837ef62ffea453... > Downloading data files: 100%|██████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 44.75it/s] > Extracting data files: 100%|███████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 8.54it/s] > Dataset squad downloaded and prepared to /home/yr3g17/.cache/huggingface/datasets/squad/plain_text/1.0.0/d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150 > cce08a837ef62ffea453. Subsequent calls will reuse this data. > 100%|██████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 2/2 [00:00<00:00, 19.77it/s] > DatasetDict({ > train: Dataset({ > features: ['id', 'title', 'context', 'question', 'answers'], > num_rows: 87599 > }) > validation: Dataset({ > features: ['id', 'title', 'context', 'question', 'answers'], > num_rows: 10570 > }) > }) > Which all seems fine right, it's doing what it should be. But now, without ever leaving the IDE, I "make a subsequent call" to reuse the data by repeating the command. I encounter the following traceback `load_dataset("squad")` > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1759, in load_dataset > builder_instance = load_dataset_builder( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1496, in load_dataset_builder > dataset_module = dataset_module_factory( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1151, in dataset_module_factory > ).get_module() > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 631, in get_module > data_files = DataFilesDict.from_local_or_remote( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/data_files.py", line 796, in from_local_or_remote > DataFilesList.from_local_or_remote( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/data_files.py", line 764, in from_local_or_remote > data_files = resolve_patterns_locally_or_by_urls(base_path, patterns, allowed_extensions) > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/data_files.py", line 369, in resolve_patterns_locally_or_by_urls > raise FileNotFoundError(error_msg) > FileNotFoundError: Unable to resolve any data file that matches '['train[-._ 0-9/]**', '**[-._ 0-9/]train[-._ 0-9/]**', 'training[-._ 0-9/]**', '**[- > ._ 0-9/]training[-._ 0-9/]**']' at /mainfs/home/yr3g17/.cache/huggingface/datasets/squad 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', 'gr > ib', 'h5', 'hdf', 'png', 'apng', 'jp2', 'j2k', 'jpc', 'jpf', 'jpx', 'j2c', 'icns', 'ico', 'im', 'iim', 'tif', 'tiff', 'jfif', 'jpe', 'jpg', 'jpeg', ' > mpg', 'mpeg', 'msp', 'pcd', 'pxr', 'pbm', 'pgm', 'ppm', 'pnm', 'psd', 'bw', 'rgb', 'rgba', 'sgi', 'ras', 'tga', 'icb', 'vda', 'vst', 'webp', 'wmf', ' > emf', 'xbm', 'xpm', 'BLP', 'BMP', 'DIB', 'BUFR', 'CUR', 'PCX', 'DCX', 'DDS', 'PS', 'EPS', 'FIT', 'FITS', 'FLI', 'FLC', 'FTC', 'FTU', 'GBR', 'GIF', 'G > RIB', 'H5', 'HDF', 'PNG', 'APNG', 'JP2', 'J2K', 'JPC', 'JPF', 'JPX', 'J2C', 'ICNS', 'ICO', 'IM', 'IIM', 'TIF', 'TIFF', 'JFIF', 'JPE', 'JPG', 'JPEG', > 'MPG', 'MPEG', 'MSP', 'PCD', 'PXR', 'PBM', 'PGM', 'PPM', 'PNM', 'PSD', 'BW', 'RGB', 'RGBA', 'SGI', 'RAS', 'TGA', 'ICB', 'VDA', 'VST', 'WEBP', 'WMF', > 'EMF', 'XBM', 'XPM', 'aiff', 'au', 'avr', 'caf', 'flac', 'htk', 'svx', 'mat4', 'mat5', 'mpc2k', 'ogg', 'paf', 'pvf', 'raw', 'rf64', 'sd2', 'sds', 'ir > cam', 'voc', 'w64', 'wav', 'nist', 'wavex', 'wve', 'xi', 'mp3', 'opus', 'AIFF', 'AU', 'AVR', 'CAF', 'FLAC', 'HTK', 'SVX', 'MAT4', 'MAT5', 'MPC2K', 'O > GG', 'PAF', 'PVF', 'RAW', 'RF64', 'SD2', 'SDS', 'IRCAM', 'VOC', 'W64', 'WAV', 'NIST', 'WAVEX', 'WVE', 'XI', 'MP3', 'OPUS', 'zip'] It doesn't even appear like I can reliably repeat this process. I'll nuke squad files in my dataset cache and run the Python code again (which downloads a new copy of the dataset to cache). It will either fail (as it just did in the quote above), or it will successfully recall the dataset. I repeated this nuking process a few times until calling load_dataset was reliably giving me the correct result (no filelocking issues or tracebacks). I then sent the test script as a job to the supercomputer compute nodes (which do not have internet access and therefore depend on cached data from Linux machine 1 login nodes) > Using the latest cached version of the module from /home/yr3g17/.cache/huggingface/modules/datasets_modules/datasets/squad/8730650fed465361f38ac4d810 > ccdd16e8fc87b56498e52fb7e2cadaefc1f177 (last modified on Tue Feb 14 10:12:56 2023) since it couldn't be found locally at squad., or remotely on the Hugging Face Hub. > Traceback (most recent call last): > File "/mainfs/scratch/yr3g17/squad_qanswering/3054408/0/../../main.py", line 5, in <module> > dataset = load_dataset("squad") > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1759, in load_dataset > builder_instance = load_dataset_builder( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1522, in load_dataset_builder > builder_instance: DatasetBuilder = builder_cls( > TypeError: 'NoneType' object is not callable and I have absolutely no idea why the second and third machines are producing different tracebacks. I have previously run these exact scripts successfully on the login and compute nodes of the supercomputer, this issue I'm raising has appeared fairly recently for me. This, is where I encounter the TypeError that I opened this issue with, which I was able to traceback (using my laptop before it too started not working) to whatever was dynamically importing "builder_cls". That bit of code wasn't doing importing builder_cls correctly and would effectively make the assignment "builder_cls=None" resulting in the TypeError. Does any of this help?
[ -0.06150738522410393, -0.12433319538831711, 0.11155229806900024, 0.1773647964000702, 0.16262215375900269, -0.03887700289487839, 0.4984908998012543, 0.1198122501373291, 0.22320544719696045, 0.08219501376152039, -0.03189168870449066, 0.39904990792274475, 0.15123838186264038, -0.10759390890598297, 0.11669248342514038, -0.07392383366823196, 0.17861299216747284, 0.04713631421327591, -0.10841220617294312, -0.10211634635925293, -0.150691956281662, 0.12851913273334503, -0.23606181144714355, 0.11028851568698883, -0.22150155901908875, 0.11146188527345657, -0.08961909264326096, 0.36200883984565735, 0.05375733971595764, -0.39367878437042236, 0.49249112606048584, 0.045208640396595, 0.4699776768684387, 0.7861020565032959, -0.00012824880832340568, 0.23703822493553162, 0.19996000826358795, -0.0617937296628952, -0.6168367266654968, -0.3629860281944275, -0.11183889955282211, -0.24548284709453583, 0.2920198440551758, -0.04241105169057846, 0.09881390631198883, 0.3076725900173187, 0.1970127522945404, -0.4623335301876068, 0.411659300327301, 0.11490042507648468, 0.10644058883190155, 0.5032157897949219, -0.2902766168117523, -0.28830790519714355, -0.0050352998077869415, 0.11926555633544922, -0.21694308519363403, 0.2581494450569153, 0.3702029883861542, -0.037810053676366806, 0.19717884063720703, -0.015486221760511398, -0.06369265168905258, -0.026030465960502625, 0.3817710280418396, 0.1568906456232071, 0.1337004005908966, -0.1861858069896698, 0.10741396248340607, 0.3785395622253418, 0.2897818386554718, -0.1889214962720871, -0.36319711804389954, -0.23502880334854126, -0.13904589414596558, 0.05260919779539108, 0.43465277552604675, 0.11844143271446228, -0.19440610706806183, 0.06191642954945564, -0.1329396367073059, 0.16594627499580383, -0.009151138365268707, 0.06361997872591019, -0.14707523584365845, 0.08908367156982422, -0.20923511683940887, 0.2836131751537323, 0.020923135802149773, 0.18182909488677979, -0.18347258865833282, -0.17349717020988464, 0.041501548141241074, 0.28474855422973633, -0.4595853388309479, 0.28106293082237244, 0.18585127592086792, -0.09661431610584259, 0.08497612178325653, 0.0016899555921554565, 0.4322819113731384, 0.1438179463148117, 0.03952377662062645, 0.2649070918560028, 0.2857372760772705, 0.1767968237400055, 0.1830228567123413, -0.01853972300887108, 0.45216402411460876, 0.3359478712081909, -0.22999782860279083, 0.0639944076538086, -0.320555180311203, -0.23105141520500183, 0.1553705483675003, -0.22168180346488953, 0.3081842362880707, -0.1488211452960968, -0.2883318066596985, 0.09383343160152435, -0.011264920234680176, -0.055966250598430634, 0.08089126646518707, 0.4007298946380615, -0.06774240732192993, 0.15704812109470367, 0.038505829870700836, 0.330607533454895, -0.15563246607780457, -0.15206284821033478, -0.04960727319121361, -0.19937331974506378, -0.22986823320388794, 0.03252238780260086, 0.39493077993392944, -0.3951510488986969, 0.04361986368894577, 0.25049638748168945, -0.12382639944553375, -0.11380476504564285, -0.24772512912750244, -0.07458916306495667, 0.02272898703813553, 0.029277851805090904, 0.19241783022880554, 0.3049851357936859, 0.19174697995185852, -0.3643155097961426, -0.15105167031288147, 0.035835832357406616, -0.36152365803718567, -0.013768017292022705, 0.017389817163348198, 0.03837178274989128, -0.2930006980895996, -0.1519445776939392, -0.3611970543861389, 0.14480388164520264, -0.08755083382129669, -0.23449566960334778, -0.06437976658344269, -0.1418965458869934, -0.2962799668312073, -0.1719948649406433, 0.3127266466617584, 0.6938215494155884, -0.8004373908042908, -0.0685623437166214, 0.08626972138881683, -0.09263059496879578, -0.009277459233999252, 0.10235506296157837, -0.06318948417901993, 0.18449079990386963, -0.31301698088645935, -0.2322295904159546, 0.21726900339126587, -0.5088780522346497, -0.11462776362895966, 0.16118499636650085, -0.13882623612880707, 0.45103147625923157, 0.02786892279982567, -0.07195844501256943, 0.12032879889011383, -0.011157549917697906, 0.07179927080869675, 0.21436545252799988, 0.050150416791439056, -0.053429219871759415, -0.20928031206130981, -0.2760787010192871, 0.0811745822429657, 0.18676939606666565, 0.2773209810256958, 0.1464880406856537, 0.09707213938236237, 0.07243866473436356, 0.34137043356895447, -0.10929958522319794, -0.014779822900891304, 0.0646764487028122, 0.16329124569892883, 0.04091405123472214, 0.05610131472349167, -0.13374251127243042, -0.4964732527732849, 0.5754678845405579, 0.03121446818113327, -0.03939493000507355, 0.15187300741672516, -0.0011328309774398804, -0.19913510978221893, 0.06359214335680008, -0.48349153995513916, 0.03783300518989563, -0.042780548334121704, 0.2898377478122711, 0.02866952121257782, 0.0720125138759613, -0.26378339529037476, 0.43845754861831665, -0.32866203784942627, 0.2552618980407715, -0.2170793116092682, 0.32472336292266846, 0.09321854263544083, -0.1666610836982727, -0.3480413854122162, 0.14930002391338348, 0.191936194896698, -0.1915421485900879, -0.017011847347021103, 0.4229874312877655, 0.054712746292352676, -0.021921232342720032, -0.147934228181839, -0.13338269293308258, 0.07141135632991791, -0.03750796616077423, 0.011636810377240181, 0.2875661849975586, 0.2496175467967987, -0.09117896854877472, -0.36079496145248413, 0.2332916408777237, -0.18971024453639984, 0.3963025212287903, 0.14077430963516235, -0.14531219005584717, 0.06433433294296265, 0.06783117353916168, -0.11332204192876816, 0.1811504065990448, 0.23617196083068848, 0.07492471486330032, 0.22460070252418518, -0.024315623566508293, -0.23594480752944946, -0.005690034478902817, 0.37393105030059814, 0.02355608344078064, 0.1165459156036377, 0.1651148647069931, -0.12189975380897522, -0.014933425933122635, 0.06937848776578903, 0.0568745881319046, 0.4326236844062805, 0.009808499366044998, -0.02154373750090599, 0.1474246382713318, -0.23089031875133514, 0.017080754041671753, 0.11613714694976807, 0.08460841327905655, -0.07880726456642151, 0.09960807114839554, 0.18502730131149292, 0.2568250298500061, -0.20680350065231323, -0.08026444911956787, -0.0137716606259346, -0.013850179500877857, -0.6626515984535217, 0.34831690788269043, -0.24189287424087524, 0.1945432424545288, -0.3210488557815552, 0.38663774728775024, -0.31424498558044434, -0.14725109934806824, -0.2546498775482178, 0.3267228603363037, 0.23942384123802185, -0.013772035017609596, -0.2172970473766327, 0.48098790645599365, -0.0823173075914383, -0.45521000027656555, 0.05897056311368942, 0.11773524433374405, -0.40005236864089966, -0.1719665825366974, 0.28464967012405396, -0.10973493754863739, 0.030315088108181953, -0.3583073318004608, -0.28715604543685913, -0.09917037934064865, -0.29676663875579834, 0.2755261957645416, 0.021980293095111847, 0.3772266209125519, 0.11404851078987122, 0.11925134062767029, -0.19521786272525787, -0.06957928836345673, 0.37620809674263, -0.3346327543258667, -0.0644373670220375, 0.28649821877479553, -0.045924242585897446, -0.18569791316986084, -0.18608759343624115, -0.20172496140003204, -0.16971355676651, -0.25776705145835876, 0.23717068135738373, 0.009435974061489105, 0.06530573964118958, 0.4519551694393158, 0.1741275042295456, 0.1963071972131729, 0.04671037197113037, 0.3444058299064636, -0.1015203446149826, -0.434347927570343, 0.27778542041778564, -0.1687321960926056, -0.4461144804954529, 0.08042988181114197, 0.11530247330665588, -0.09206061065196991, -0.05712929368019104, -0.3926122188568115, -0.1556728482246399, -0.1744173914194107, 0.2927601933479309, 0.14294880628585815, 0.3457537293434143, 0.14418724179267883, -0.3439827561378479, 0.14207138121128082, -0.26635870337486267, -0.4595203101634979, 0.1800416260957718, 0.16760452091693878, 0.19874826073646545, 0.1509220004081726, 0.23306886851787567, -0.04060065373778343, 0.6106238961219788, 0.248131662607193, -0.06686034053564072, 0.38597768545150757, -0.1540927141904831, 0.5833083391189575, -0.27851879596710205, -0.43077772855758667, 0.017526760697364807, -0.23793624341487885, -0.02085544541478157, 0.1860903650522232, 0.16110089421272278, 0.1281324326992035, -0.1945512741804123, 0.19187556207180023, 0.004471547901630402, -0.36331906914711, 0.06343896687030792, 0.03524027764797211, -0.10818004608154297, 0.13989128172397614, 0.4346732795238495, -0.23291058838367462, -0.12138240039348602, -0.06718611717224121, 0.5422558784484863, -0.006125420331954956, 0.11326797306537628, -0.4579780399799347, 0.0006568804383277893, -0.21875447034835815, 0.21914291381835938, -0.021725710481405258, 0.5461265444755554, -0.10955750197172165, -0.0875556617975235, 0.06713300943374634, -0.027116043493151665, 0.6234645843505859, -0.0766274482011795, 0.30503249168395996, 0.15175452828407288, -0.2618541121482849, -0.6606764197349548, -0.2763384282588959, 0.011394381523132324, 0.17751704156398773, 0.25257956981658936, 0.20679712295532227, -0.13552124798297882, -0.2044125497341156, 0.07960017025470734, 0.21720749139785767, -0.06418228149414062, -0.07208440452814102, -0.5403591990470886, -0.14994601905345917, -0.07692857831716537, -0.22177816927433014, -0.13924814760684967, 0.19047367572784424, -0.11141829937696457, 0.08917373418807983, -0.06419471651315689, 0.021923556923866272, 0.27953004837036133, 0.2924913763999939, 0.23189200460910797, 0.05881868302822113, 0.2713572680950165, 0.5015960335731506, 0.2068639099597931, -0.11025116592645645, 0.7493507266044617, -0.25598961114883423, -0.3993370831012726, 0.39706820249557495, -0.22311820089817047, 0.22528837621212006, 0.7094457745552063, -0.15550068020820618, -0.10279835760593414, -0.10508085787296295, -0.03709745407104492, -0.21594694256782532, -0.036588072776794434, 0.3731372058391571, 0.03612413629889488, -0.1979895830154419, -0.36073511838912964, 0.322116494178772, 0.07745054364204407, -0.10241149365901947, 0.39985930919647217, 0.3446238338947296, -0.2770502269268036, 0.24344909191131592, -0.32012900710105896, 0.8574275970458984, -0.0791613757610321, 0.28975144028663635, 0.3235076367855072, -0.15206843614578247, 0.42844754457473755, 0.033162981271743774, 0.096513532102108, -0.39324772357940674, -0.07614006102085114, -0.02408849075436592, -0.0976567342877388, 0.16326305270195007, -0.021625155583024025, -0.1114698201417923, 0.2943893373012543, -0.3119494616985321, 0.33350226283073425, 0.19452053308486938, 0.07061578333377838, -0.029110291972756386, -0.18242816627025604, -0.424245148897171, 0.06719459593296051, 0.11348497867584229, 0.30566349625587463, -0.17002235352993011, 0.05430738627910614, -0.1828816831111908, -0.23886629939079285, -0.2911893129348755, 0.15104874968528748, -0.15651892125606537, 0.05019112676382065, 0.3044727146625519, -0.22119510173797607, 0.2144664227962494, 0.3001314401626587, 0.3626213073730469, -0.012740961275994778, -0.10203428566455841, 0.06418334692716599, -0.13474343717098236, 0.3302069902420044, 0.08530084043741226, -0.12527933716773987, 0.29873862862586975, 0.06763235479593277, -0.24536806344985962, -0.11169472336769104, -0.20450998842716217, -0.280235230922699, -0.12400828301906586, 0.1985725611448288, 0.10663218051195145, -0.13937796652317047, -0.03574936091899872, -0.20164301991462708, 0.2594960927963257, -0.22688108682632446, 0.016296207904815674, 0.01724969409406185, -0.007550042122602463, 0.26605603098869324, 0.11213083565235138, -0.3559442460536957, 0.08101581037044525, 0.5347484946250916, -0.5646345615386963, 0.021556980907917023, 0.37091192603111267, 0.28529077768325806, -0.03124123066663742, -0.08096692711114883, 0.28919288516044617, 0.32311078906059265, -0.4715302586555481, 0.034204158931970596, -0.2467823326587677, -0.05149346590042114, -0.028608281165361404, 0.43523579835891724, 0.18253228068351746, -0.26424482464790344, -0.016940027475357056, -0.43009069561958313, 0.02228015661239624, 0.018165919929742813, 0.28874507546424866, -0.02071017026901245, 0.07777294516563416, -0.080262191593647, 0.057438939809799194, -0.2074996680021286, -0.1595355123281479, 0.17618611454963684, -0.024539552628993988, -0.1741272211074829, -0.026223983615636826, 0.1426045149564743, 0.23869016766548157, -0.277664452791214, -0.04173604026436806, -0.04428669437766075, -0.189750537276268, -0.07203900068998337, -0.35524600744247437, 0.2375621497631073, 0.004915423691272736, -0.1741294264793396, 0.07140211760997772, -0.18656492233276367, -0.16299894452095032, -0.3074006736278534, 0.2551056146621704, 0.3871475160121918, -0.10590603947639465, 0.07198648154735565, -0.13973696529865265, 0.37577080726623535, -0.12679703533649445, 0.17920437455177307, 0.025713369250297546, 0.3678794503211975, 0.20265132188796997, 0.18357957899570465, -0.19930784404277802, 0.06983764469623566, -0.1259695142507553, 0.30955782532691956, 0.10310395061969757, 0.12641721963882446, 0.2338200807571411, -0.5475990772247314, 0.21078616380691528, -0.08798228949308395, 0.23371638357639313, 0.5435122847557068, -0.2249620258808136, 0.05631692707538605, -0.08053480088710785, 0.03655507415533066, -0.038463495671749115, -0.0434296652674675, 0.35962313413619995, 0.14091451466083527, 0.028997361660003662, 0.4633321762084961, 0.13391093909740448, -0.1838224083185196, -0.0017092451453208923, 0.02494274079799652, 0.6762300729751587, 0.11383578181266785, 0.3066541850566864, 0.3972336947917938, 0.025933846831321716, 0.3537343442440033, 0.054057106375694275, -0.0664980560541153, -0.19441908597946167, 0.2747946083545685, -0.29971230030059814, 0.14434172213077545, -0.12947644293308258, 0.18438151478767395, 0.20728462934494019, -0.4059065580368042, 0.2696627676486969, 0.08813872188329697, 0.0015511363744735718, -0.013516882434487343, -0.22676485776901245, 0.594718873500824, -0.6582551002502441, -0.2205040007829666, -0.3716164827346802, -0.26176193356513977, -0.10739843547344208, -0.1048428937792778, -0.5060296058654785, -0.3465333580970764, -0.15354964137077332, -0.04664084315299988, -0.030056411400437355, -0.25958165526390076, 0.1533564329147339, 0.06401947885751724, -0.01021542027592659, -0.5345140695571899, -0.2152707576751709, 0.0138349998742342, 0.11943455785512924, -0.053347401320934296, 0.24336683750152588, 0.06685738265514374, -0.005187297239899635, 0.3864220380783081, 0.05979262292385101, 0.5149832963943481, 0.4698637127876282, 0.041802532970905304, 0.07618667185306549, -0.11219217628240585, 0.051783569157123566, -0.06605112552642822, 0.15707318484783173, -0.18289464712142944, -0.086396723985672, 0.32595109939575195, 0.02021797001361847, 0.0016938969492912292, 0.021214408800005913, 0.0270279198884964, 0.06561301648616791, -0.5325726866722107, 0.4555290937423706, -0.31508317589759827, 0.18785986304283142, -0.06982967257499695, -0.050519898533821106, -0.12341239303350449, 0.056415311992168427, 0.34694379568099976, 0.1787809133529663, 0.2209256887435913, -0.10529182851314545, -0.0003678537905216217, 0.14936180412769318, 0.24649947881698608, 0.19727176427841187, -0.03520844504237175, -0.1672200858592987, 0.1846843659877777, -0.7966758012771606, 0.15442857146263123, -0.04718834161758423, -0.18155603110790253, 0.15928864479064941, 0.24436408281326294, -0.025031574070453644, 0.07177811861038208, 0.3933925926685333, -0.32539236545562744, 0.07537296414375305, 0.2316097915172577, -0.3096131682395935, -0.24653153121471405, -0.09051704406738281, 0.08522156625986099, -0.12675219774246216, -0.6335586309432983, 0.10439509153366089, -0.3364829123020172, -0.18615520000457764, 0.052625201642513275, -0.14510267972946167, 0.03805208206176758, -0.5007398724555969, 0.40606123208999634, -0.12775498628616333, 0.5400994420051575, 0.185389906167984, -0.22237461805343628, -0.5541495680809021, -0.12255001068115234, -0.24394835531711578, 0.25175026059150696, -0.24525000154972076, 0.33520254492759705, -0.22497349977493286, -0.2536030113697052, -0.29481595754623413, 0.21316741406917572, 0.21827760338783264, 0.030207999050617218, -0.3594001233577728, 0.15140563249588013, -0.15518635511398315, 0.29262158274650574, 0.1380787044763565, 0.17155802249908447, -0.29662656784057617, 0.2583003044128418, -0.359279066324234, -0.16188879311084747, 0.39522185921669006, -0.5409041047096252, -0.3409496247768402, -0.4860590696334839, 0.31143125891685486, -0.04598797857761383, -0.014451018534600735, -0.37623536586761475, -0.14185112714767456, 0.212613046169281, -0.24239061772823334, -0.16419550776481628, 0.07411741465330124, -0.3163062632083893, 0.09434645622968674, -0.05479496717453003, -0.12318425625562668, -0.056509628891944885, -0.14049658179283142, 0.20156824588775635, -0.2989097237586975 ]
https://github.com/huggingface/datasets/issues/5768
I'm back on linux machine 1 (login node) now. After submitting that as a job to machine 2 and it failing with TypeError, linux machine 1 now produces identical traceback to machine 2: > (arkroyal) [yr3g17@cyan52 squad_qanswering]$ python > Python 3.10.8 (main, Nov 24 2022, 14:13:03) [GCC 11.2.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > > from datasets import load_dataset > load_dataset("squad") > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1759, in load_dataset > builder_instance = load_dataset_builder( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1522, in load_dataset_builder > builder_instance: DatasetBuilder = builder_cls( > TypeError: 'NoneType' object is not callable I thought it might be useful to provide you with my cache file structure: >_home_yr3g17_.cache_huggingface_datasets_casino_default_1.1.0_302c3b1ac78c48091deabe83a11f4003c7b472a4e11a8eb92799653785bd5da1.lock >_home_yr3g17_.cache_huggingface_datasets_imdb_plain_text_1.0.0_2fdd8b9bcadd6e7055e742a706876ba43f19faee861df134affd7a3f60fc38a1.lock >_home_yr3g17_.cache_huggingface_datasets_squad_plain_text_1.0.0_d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453.lock >_home_yr3g17_.cache_huggingface_datasets_yelp_review_full_yelp_review_full_1.0.0_e8e18e19d7be9e75642fc66b198abadb116f73599ec89a69ba5dd8d1e57ba0bf.lock > casino > downloads > imdb > json > squad > squad_v2 > yelp_review_full The inside of squad/plain_text/1.0.0/ looks like > d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453 > d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453.incomplete_info.lock > d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453_builder.lock
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1
### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64
156
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1 ### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64 I'm back on linux machine 1 (login node) now. After submitting that as a job to machine 2 and it failing with TypeError, linux machine 1 now produces identical traceback to machine 2: > (arkroyal) [yr3g17@cyan52 squad_qanswering]$ python > Python 3.10.8 (main, Nov 24 2022, 14:13:03) [GCC 11.2.0] on linux > Type "help", "copyright", "credits" or "license" for more information. > > from datasets import load_dataset > load_dataset("squad") > > Traceback (most recent call last): > File "<stdin>", line 1, in <module> > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1759, in load_dataset > builder_instance = load_dataset_builder( > File "/home/yr3g17/.conda/envs/arkroyal/lib/python3.10/site-packages/datasets/load.py", line 1522, in load_dataset_builder > builder_instance: DatasetBuilder = builder_cls( > TypeError: 'NoneType' object is not callable I thought it might be useful to provide you with my cache file structure: >_home_yr3g17_.cache_huggingface_datasets_casino_default_1.1.0_302c3b1ac78c48091deabe83a11f4003c7b472a4e11a8eb92799653785bd5da1.lock >_home_yr3g17_.cache_huggingface_datasets_imdb_plain_text_1.0.0_2fdd8b9bcadd6e7055e742a706876ba43f19faee861df134affd7a3f60fc38a1.lock >_home_yr3g17_.cache_huggingface_datasets_squad_plain_text_1.0.0_d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453.lock >_home_yr3g17_.cache_huggingface_datasets_yelp_review_full_yelp_review_full_1.0.0_e8e18e19d7be9e75642fc66b198abadb116f73599ec89a69ba5dd8d1e57ba0bf.lock > casino > downloads > imdb > json > squad > squad_v2 > yelp_review_full The inside of squad/plain_text/1.0.0/ looks like > d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453 > d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453.incomplete_info.lock > d6ec3ceb99ca480ce37cdd35555d6cb2511d223b9150cce08a837ef62ffea453_builder.lock
[ -0.05922793596982956, -0.07069950550794601, 0.13119247555732727, 0.18312804400920868, 0.18544664978981018, -0.03411577641963959, 0.5674011707305908, 0.13328798115253448, 0.20841602981090546, 0.08103325963020325, -0.053071632981300354, 0.4445434808731079, 0.10887491703033447, -0.1454436182975769, 0.12761729955673218, -0.09639749675989151, 0.0751887783408165, -0.04082012549042702, -0.15582069754600525, -0.10723888128995895, -0.0584297738969326, 0.24063602089881897, -0.26735398173332214, 0.16829094290733337, -0.16745898127555847, 0.07312054187059402, -0.021818295121192932, 0.3152986466884613, 0.10871931165456772, -0.3816899061203003, 0.55282062292099, 0.021873846650123596, 0.4487884044647217, 0.7942880988121033, -0.0001269894710276276, 0.2298911213874817, 0.14952576160430908, -0.06434911489486694, -0.642087459564209, -0.3988383114337921, -0.029132045805454254, -0.3371197283267975, 0.310791552066803, -0.07306475192308426, 0.07438197731971741, 0.25477635860443115, 0.2208731323480606, -0.41245707869529724, 0.4913225769996643, 0.10381031781435013, 0.11442886292934418, 0.42901355028152466, -0.21645033359527588, -0.2627839148044586, -0.012643653899431229, 0.14827165007591248, -0.18901178240776062, 0.26064226031303406, 0.29890674352645874, 0.06295029819011688, 0.16083288192749023, 0.03157706558704376, -0.03674140200018883, -0.037783943116664886, 0.2871101498603821, 0.16197119653224945, 0.05715972185134888, -0.1331227421760559, 0.06624822318553925, 0.307167649269104, 0.2756909728050232, -0.23828931152820587, -0.40145453810691833, -0.2532251477241516, -0.028780998662114143, 0.09984119236469269, 0.4313693940639496, 0.11328765749931335, -0.20381386578083038, 0.15605223178863525, -0.08442708104848862, 0.06160007789731026, -0.09326846897602081, 0.002667924389243126, -0.17109346389770508, 0.09130670130252838, -0.1858435422182083, 0.2993096709251404, 0.07113796472549438, 0.12731735408306122, -0.1400173306465149, -0.13445138931274414, 0.04211097210645676, 0.3664016127586365, -0.4680556356906891, 0.1349548101425171, 0.09062689542770386, -0.18190832436084747, 0.0977984070777893, -0.1389344036579132, 0.33299899101257324, 0.11242403090000153, -0.06130235269665718, 0.28389719128608704, 0.2954272925853729, 0.1919804960489273, 0.24994252622127533, 0.11672771722078323, 0.5067285299301147, 0.2602677047252655, -0.2935364246368408, 0.07561396807432175, -0.36727696657180786, -0.28699952363967896, 0.21430465579032898, -0.08693276345729828, 0.2540821135044098, -0.19655492901802063, -0.25633859634399414, 0.11197840422391891, 0.022495023906230927, -0.10309010744094849, -0.0053629446774721146, 0.4548068046569824, -0.04733571410179138, 0.16015222668647766, 0.05576455593109131, 0.32563692331314087, -0.11648723483085632, -0.24709659814834595, -0.028512973338365555, -0.1858518272638321, -0.10874529182910919, 0.0337415412068367, 0.3535909950733185, -0.36148497462272644, -0.001316845417022705, 0.22076848149299622, -0.11775849759578705, -0.0543997660279274, -0.14497485756874084, -0.06470472365617752, 0.006264951080083847, 0.005259939469397068, 0.14394383132457733, 0.3311348259449005, 0.24336950480937958, -0.3142494857311249, -0.14351975917816162, 0.036264777183532715, -0.44070643186569214, -0.01932821422815323, -0.022206654772162437, 0.024296656250953674, -0.2694939076900482, -0.19013555347919464, -0.467379093170166, 0.13702479004859924, -0.05859726667404175, -0.32630056142807007, -0.09010042995214462, -0.16387537121772766, -0.20923933386802673, -0.18470719456672668, 0.24019721150398254, 0.6147109270095825, -0.7439022660255432, -0.15439069271087646, 0.079106405377388, -0.07002995908260345, 0.03302064165472984, 0.14820532500743866, -0.10302722454071045, 0.14467740058898926, -0.30594968795776367, -0.2589157521724701, 0.3426293730735779, -0.561896800994873, -0.05391819402575493, 0.19583234190940857, -0.1795363426208496, 0.43480753898620605, 0.05688079446554184, -0.1151617169380188, 0.1396728754043579, 0.006659548729658127, 0.042058371007442474, 0.33249732851982117, 0.10640177130699158, -0.023292332887649536, -0.18848969042301178, -0.27471697330474854, 0.013550838455557823, 0.13542701303958893, 0.2791593074798584, 0.168183833360672, 0.11936214566230774, 0.09539875388145447, 0.3761814832687378, -0.10479170829057693, -0.011447899043560028, 0.08212121576070786, 0.1858760416507721, 0.06153794750571251, 0.03184780478477478, -0.19491112232208252, -0.550142765045166, 0.5233714580535889, 0.00214540958404541, 0.016978714615106583, 0.2286899983882904, -0.049353912472724915, -0.1796574890613556, 0.02423093467950821, -0.38689786195755005, -0.049395035952329636, -0.06775220483541489, 0.24873703718185425, -0.001375153660774231, 0.12199075520038605, -0.2634868919849396, 0.46227020025253296, -0.3492666482925415, 0.24508319795131683, -0.23276259005069733, 0.2974812984466553, 0.08873356878757477, -0.18166668713092804, -0.3349010944366455, 0.09393686056137085, 0.2227507084608078, -0.16061431169509888, -0.030510012060403824, 0.35371750593185425, 0.07969343662261963, 0.11359486728906631, -0.0813174918293953, -0.22459906339645386, 0.08793630450963974, 0.013165533542633057, -0.020747186616063118, 0.2646595239639282, 0.21926163136959076, -0.010186828672885895, -0.3649318516254425, 0.3247332274913788, -0.09083142876625061, 0.3183148503303528, 0.20614218711853027, -0.10830825567245483, 0.13650855422019958, 0.10577747225761414, -0.10582281649112701, 0.1570465862751007, 0.17821519076824188, -0.04320422559976578, 0.0656995102763176, -0.037346743047237396, -0.23740488290786743, -0.007177822291851044, 0.43889856338500977, 0.04408411681652069, 0.17367343604564667, 0.20399782061576843, -0.11866454780101776, -0.004885591566562653, 0.12441852688789368, 0.07963191717863083, 0.44621866941452026, 0.006712824106216431, -0.029721394181251526, 0.09667110443115234, -0.15565824508666992, 0.08155062794685364, 0.13570913672447205, -0.07140221446752548, -0.08456764370203018, 0.12858453392982483, 0.21743634343147278, 0.21848908066749573, -0.1476660668849945, -0.15461693704128265, -0.10391607880592346, 0.04566824436187744, -0.6636120080947876, 0.3137596845626831, -0.22326189279556274, 0.2143086940050125, -0.4148995876312256, 0.3984907269477844, -0.401242196559906, -0.1528836190700531, -0.286210834980011, 0.3247895836830139, 0.29067379236221313, 0.047009311616420746, -0.14414557814598083, 0.41694164276123047, -0.03563833609223366, -0.4000653028488159, 0.09147857129573822, 0.04045155644416809, -0.3342098593711853, -0.162330761551857, 0.18875783681869507, -0.14256373047828674, -0.02714349329471588, -0.3717224597930908, -0.3725793659687042, -0.1089039221405983, -0.2747124135494232, 0.3373381495475769, 0.07991841435432434, 0.3664420545101166, 0.14094501733779907, 0.19854237139225006, -0.2603664994239807, -0.04749913886189461, 0.37298783659935, -0.38307636976242065, -0.15575779974460602, 0.2469937801361084, -0.08378052711486816, -0.030765729025006294, -0.1615343689918518, -0.19552236795425415, -0.2169107347726822, -0.2806309461593628, 0.2880040407180786, 0.05705656856298447, 0.12388841807842255, 0.48301514983177185, 0.1109234094619751, 0.22895130515098572, 0.07326063513755798, 0.45082682371139526, -0.11000458896160126, -0.4411180019378662, 0.3007175624370575, -0.19484730064868927, -0.3828607499599457, 0.01906651258468628, 0.1101907268166542, -0.1059609055519104, -0.10130832344293594, -0.3931979537010193, -0.232045978307724, -0.0964934229850769, 0.28608381748199463, 0.09937143325805664, 0.4204915463924408, 0.12580326199531555, -0.3403903841972351, 0.14104026556015015, -0.19859646260738373, -0.45455971360206604, 0.116740882396698, 0.2621114253997803, 0.15496286749839783, 0.10980148613452911, 0.19287192821502686, -0.15207335352897644, 0.6608350872993469, 0.17151781916618347, -0.034339211881160736, 0.35327261686325073, -0.19334286451339722, 0.5384818315505981, -0.2762901782989502, -0.4274771213531494, 0.002498384565114975, -0.1885526180267334, -0.027627605944871902, 0.12852852046489716, 0.1610802412033081, 0.10437194257974625, -0.1978672295808792, 0.0999799519777298, -0.008887603878974915, -0.3631552457809448, 0.07649536430835724, 0.1291099339723587, -0.10000878572463989, 0.1179702877998352, 0.409244567155838, -0.29730355739593506, -0.11490564793348312, -0.06653818488121033, 0.5878579020500183, 0.042031630873680115, 0.10425279289484024, -0.4540914297103882, -0.05217698961496353, -0.2105027735233307, 0.2721686363220215, -0.04138220101594925, 0.45953625440597534, -0.11458190530538559, -0.14658191800117493, 0.05866573005914688, 0.014471691101789474, 0.5613929033279419, -0.09056318551301956, 0.24033531546592712, 0.09657520800828934, -0.19579879939556122, -0.6701654195785522, -0.24943265318870544, 0.06241433322429657, 0.134840726852417, 0.31375107169151306, 0.263282835483551, -0.1583210676908493, -0.10767142474651337, 0.07232087105512619, 0.25956541299819946, -0.12318916618824005, -0.06390698254108429, -0.58940589427948, -0.12353430688381195, -0.12952330708503723, -0.21010468900203705, -0.1603347808122635, 0.1664218306541443, -0.06664274632930756, 0.1164422407746315, -0.05124260112643242, 0.02389650046825409, 0.313289076089859, 0.35976606607437134, 0.24399875104427338, 0.017481662333011627, 0.23422546684741974, 0.5508894920349121, 0.1529858559370041, -0.06985892355442047, 0.7636196613311768, -0.2910175323486328, -0.3604312539100647, 0.42196202278137207, -0.16859519481658936, 0.2849714457988739, 0.7185795307159424, -0.2260623425245285, -0.056919146329164505, -0.12454025447368622, -0.08866558223962784, -0.17966720461845398, -0.13452012836933136, 0.3210057020187378, 0.11443045735359192, -0.19357283413410187, -0.5050302743911743, 0.16509540379047394, 0.06828829646110535, -0.13371841609477997, 0.3394124209880829, 0.2966349720954895, -0.2464500367641449, 0.28127962350845337, -0.39340633153915405, 0.929792046546936, -0.05088790878653526, 0.3019077181816101, 0.29846498370170593, -0.14522847533226013, 0.531721293926239, 0.03728529065847397, 0.145222008228302, -0.4549817740917206, -0.04926043003797531, 0.023772813379764557, -0.14141525328159332, 0.2739797830581665, 0.031337931752204895, -0.14738203585147858, 0.32553017139434814, -0.26817578077316284, 0.33047381043434143, 0.09327187389135361, 0.11142897605895996, -0.10454439371824265, -0.18832549452781677, -0.5239104628562927, 0.047938499599695206, 0.05791706219315529, 0.364734947681427, -0.1326954960823059, 0.055172860622406006, -0.17529326677322388, -0.23415511846542358, -0.32062074542045593, 0.12737765908241272, -0.0921928882598877, 0.10465919226408005, 0.36011815071105957, -0.21627464890480042, 0.2180546671152115, 0.33683791756629944, 0.35223624110221863, -0.018265318125486374, -0.021583832800388336, 0.08597375452518463, -0.1301743984222412, 0.3992217779159546, 0.08922762423753738, -0.09450440108776093, 0.3066917359828949, 0.044405415654182434, -0.22515031695365906, -0.05040355399250984, -0.13684667646884918, -0.30981045961380005, -0.04632687568664551, 0.18135219812393188, 0.10900092869997025, -0.14075236022472382, -0.05035184696316719, -0.20101097226142883, 0.2794986367225647, -0.26395466923713684, 0.024252934381365776, 0.08848711848258972, -0.09140807390213013, 0.1970667541027069, 0.13308383524417877, -0.31490424275398254, 0.10113142430782318, 0.5656708478927612, -0.4165956676006317, 0.04015694558620453, 0.3659181594848633, 0.2950112223625183, -0.05524715781211853, -0.099197156727314, 0.3446378707885742, 0.3698382079601288, -0.5580698847770691, 0.06819044053554535, -0.22075727581977844, -0.08683004230260849, -0.08536648750305176, 0.4012441039085388, 0.17581643164157867, -0.12974411249160767, -0.07350146770477295, -0.43942418694496155, -0.023074503988027573, -0.0063384659588336945, 0.2625700831413269, -0.09525138139724731, 0.1400374323129654, -0.11265049874782562, -0.03707792982459068, -0.1966170370578766, -0.1690787672996521, 0.14444518089294434, -0.022585101425647736, -0.1964208334684372, -0.02519119530916214, 0.0835362896323204, 0.3171513080596924, -0.280004620552063, -0.02489820495247841, -0.06020039692521095, -0.11725643277168274, -0.050508372485637665, -0.3720320463180542, 0.22545242309570312, -0.13609008491039276, -0.12185591459274292, -0.004336904734373093, -0.20724192261695862, -0.13058821856975555, -0.2694273293018341, 0.26184988021850586, 0.3839293122291565, -0.05208665877580643, 0.13102616369724274, -0.15774178504943848, 0.3430607318878174, -0.11597681045532227, 0.18538182973861694, 0.03255492448806763, 0.3769316077232361, 0.24185964465141296, 0.20585665106773376, -0.22827650606632233, 0.0801396369934082, -0.12528544664382935, 0.3117104470729828, 0.08469639718532562, 0.15148591995239258, 0.20788949728012085, -0.47845450043678284, 0.1543581187725067, -0.06311505287885666, 0.23247846961021423, 0.4531899094581604, -0.22252081334590912, 0.06438415497541428, -0.05412989482283592, 0.02841464802622795, -0.004615716636180878, 0.007995571941137314, 0.47271469235420227, 0.02491656318306923, -0.020760126411914825, 0.4628850817680359, 0.09459637105464935, -0.11400224268436432, -0.08463458716869354, 0.03089062124490738, 0.6773879528045654, 0.23045554757118225, 0.3069668710231781, 0.3251092731952667, 0.02728728950023651, 0.3083103895187378, 0.08295543491840363, -0.03742404282093048, -0.1408722698688507, 0.1327957808971405, -0.3342188596725464, 0.06913002580404282, -0.10518282651901245, 0.12580513954162598, 0.31197428703308105, -0.46991080045700073, 0.29529160261154175, 0.13020603358745575, 0.056984834372997284, -0.08512359857559204, -0.19464518129825592, 0.5895935893058777, -0.6266888976097107, -0.26536476612091064, -0.32240530848503113, -0.14736010134220123, -0.1722424030303955, -0.07443255931138992, -0.3966395854949951, -0.37180253863334656, -0.14378149807453156, -0.0341956689953804, -0.07570302486419678, -0.2263788878917694, 0.14499235153198242, 0.09139583259820938, 0.038212183862924576, -0.4983960688114166, -0.2690618634223938, -0.0446743480861187, 0.16220825910568237, -0.02189573645591736, 0.2724948823451996, 0.008077241480350494, 0.0546458400785923, 0.3626630902290344, 0.04787333309650421, 0.5306556820869446, 0.4215356409549713, 0.156749427318573, 0.11090807616710663, -0.10047613084316254, 0.08118060231208801, -0.07886610925197601, 0.17202381789684296, -0.20622959733009338, -0.10082311928272247, 0.30012246966362, 0.021797675639390945, 0.018501702696084976, -0.04974500462412834, 0.05854158103466034, 0.050062064081430435, -0.4464825689792633, 0.44134989380836487, -0.3897988200187683, 0.1572636067867279, -0.14266958832740784, 0.024047359824180603, -0.09492957592010498, -0.0061270929872989655, 0.2798629403114319, 0.17820779979228973, 0.20126111805438995, -0.18248724937438965, 0.0018026456236839294, 0.14612026512622833, 0.21704208850860596, 0.22213521599769592, -0.036346253007650375, -0.14662931859493256, 0.17898254096508026, -0.7651135325431824, 0.2422448843717575, -0.09656493365764618, -0.17452719807624817, 0.08682423830032349, 0.2650235891342163, -0.03749629110097885, 0.1314922273159027, 0.4028506875038147, -0.2872392237186432, 0.05026467889547348, 0.2158105969429016, -0.31461381912231445, -0.27311939001083374, 0.042491406202316284, 0.04521385580301285, -0.11228052526712418, -0.6247028112411499, 0.11894207447767258, -0.3360384702682495, -0.17079505324363708, 0.0726643055677414, -0.1973486691713333, 0.06741130352020264, -0.38856449723243713, 0.3913918137550354, -0.12405834347009659, 0.5780687928199768, 0.1885729432106018, -0.2853790819644928, -0.39043283462524414, -0.2274979054927826, -0.22220520675182343, 0.2625467777252197, -0.2680973410606384, 0.33246129751205444, -0.1577514111995697, -0.3008023500442505, -0.3139585256576538, 0.3054209351539612, 0.17234130203723907, -0.07742825150489807, -0.37706315517425537, 0.1296677142381668, -0.1768554151058197, 0.27246126532554626, 0.017226099967956543, 0.1218351349234581, -0.21654784679412842, 0.20868606865406036, -0.369283527135849, -0.17474022507667542, 0.45390254259109497, -0.5973188877105713, -0.35488349199295044, -0.5072351694107056, 0.2919663190841675, -0.03768901526927948, 0.026441046968102455, -0.4325256645679474, -0.07504674047231674, 0.23709897696971893, -0.2460222840309143, -0.08664432168006897, 0.025357451289892197, -0.35273709893226624, 0.1471973955631256, -0.06890100985765457, -0.11324922740459442, -0.08417374640703201, -0.13795699179172516, 0.1657877117395401, -0.25930777192115784 ]
https://github.com/huggingface/datasets/issues/5768
I see this is quite a complex use case... Let's try multiple things: - First, update `datasets` and make sure you use the same version in all machines, so that we can easily compare different behaviors. ``` pip install -U datasets ``` - Second, wherever you run the `load_dataset("squad")` command, make sure there is not a local directory named "squad". The datasets library gives priority to any local file/directory over the datasets on the Hugging Face Hub - I tell you this, because in one of your trace backs, it seems it refers to a local directory: ``` Downloading and preparing dataset json/squad to /home/yr3g17/.cache/huggingface/datasets/json/squad-d733af945be1d2c2/0.0.0/0f7e3662623656454fcd2b650f34e886a7db4b9104504885bd462096cc7a9f51... ``` - Third, to use the "squad" dataset from the Hub, you need to have internet connection, so that you can download the "squad" Python loading script from the Hub. Do all your machines have internet connection? - I ask this because of this error message: ``` Using the latest cached version of the module from /home/yr3g17/.cache/huggingface/modules/datasets_modules/datasets/squad/8730650fed465361f38ac4d810ccdd16e8fc87b56498e52fb7e2cadaefc1f177 (last modified on Tue Feb 14 10:12:56 2023) since it couldn't be found locally at squad., or remotely on the Hugging Face Hub. ``` - Fourth, to be sure that we avoid any issues with the cache, it is a good idea to remove it and regenerate it. Remove `.cache/huggingface/datasets` and also `.cache/huggingface/modules` - Fifth, as an additional debugging tool, let's be sure we use the latest "squad" Python loading script by passing the revision parameter: ``` ds = load_dataset("squad", revision="5fe18c4c680f9922d794e3f4dd673a751c74ee37") ```
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1
### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64
244
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1 ### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64 I see this is quite a complex use case... Let's try multiple things: - First, update `datasets` and make sure you use the same version in all machines, so that we can easily compare different behaviors. ``` pip install -U datasets ``` - Second, wherever you run the `load_dataset("squad")` command, make sure there is not a local directory named "squad". The datasets library gives priority to any local file/directory over the datasets on the Hugging Face Hub - I tell you this, because in one of your trace backs, it seems it refers to a local directory: ``` Downloading and preparing dataset json/squad to /home/yr3g17/.cache/huggingface/datasets/json/squad-d733af945be1d2c2/0.0.0/0f7e3662623656454fcd2b650f34e886a7db4b9104504885bd462096cc7a9f51... ``` - Third, to use the "squad" dataset from the Hub, you need to have internet connection, so that you can download the "squad" Python loading script from the Hub. Do all your machines have internet connection? - I ask this because of this error message: ``` Using the latest cached version of the module from /home/yr3g17/.cache/huggingface/modules/datasets_modules/datasets/squad/8730650fed465361f38ac4d810ccdd16e8fc87b56498e52fb7e2cadaefc1f177 (last modified on Tue Feb 14 10:12:56 2023) since it couldn't be found locally at squad., or remotely on the Hugging Face Hub. ``` - Fourth, to be sure that we avoid any issues with the cache, it is a good idea to remove it and regenerate it. Remove `.cache/huggingface/datasets` and also `.cache/huggingface/modules` - Fifth, as an additional debugging tool, let's be sure we use the latest "squad" Python loading script by passing the revision parameter: ``` ds = load_dataset("squad", revision="5fe18c4c680f9922d794e3f4dd673a751c74ee37") ```
[ -0.07878868281841278, -0.2868138253688812, 0.07885140180587769, 0.22139808535575867, 0.22745494544506073, 0.006268233060836792, 0.42688995599746704, 0.08101575076580048, 0.2393907755613327, 0.054690808057785034, -0.22609208524227142, 0.4112476706504822, 0.09105101227760315, -0.12755796313285828, 0.1434049904346466, -0.052832216024398804, 0.11122329533100128, 0.026851097121834755, -0.05675723776221275, -0.03428524732589722, -0.09276227653026581, 0.2638271749019623, -0.18941636383533478, 0.09335900843143463, -0.25347405672073364, 0.06943421065807343, -0.07010127604007721, 0.3453793227672577, 0.00006884336471557617, -0.4846160411834717, 0.4621169865131378, 0.08787389099597931, 0.38533130288124084, 0.7002833485603333, -0.00011667394574033096, 0.1809939593076706, 0.15814931690692902, -0.06167563796043396, -0.5267654061317444, -0.41800591349601746, 0.06688444316387177, -0.32089510560035706, 0.29612767696380615, -0.008290097117424011, -0.017012864351272583, 0.3273325562477112, 0.173233300447464, -0.2850618362426758, 0.6038317084312439, 0.12482495605945587, 0.19938957691192627, 0.5564670562744141, -0.14114528894424438, -0.35665541887283325, -0.0027994830161333084, 0.10347191989421844, -0.2028013914823532, 0.26463261246681213, 0.32062196731567383, -0.009533628821372986, 0.15352323651313782, 0.07764353603124619, 0.05578484386205673, -0.0634947419166565, 0.400070458650589, 0.176668182015419, 0.025257743895053864, -0.22212868928909302, 0.07513304054737091, 0.284961998462677, 0.19327384233474731, -0.25113123655319214, -0.37780624628067017, -0.28384798765182495, -0.07691388577222824, 0.09283889830112457, 0.3469565212726593, 0.11193761229515076, -0.136771559715271, 0.18042385578155518, -0.15386492013931274, 0.031736671924591064, -0.013940513134002686, -0.026046082377433777, -0.03514060378074646, 0.025559179484844208, -0.2551974356174469, 0.18350447714328766, 0.18223299086093903, 0.02895733341574669, -0.278308629989624, -0.006378287449479103, -0.029569057747721672, 0.3711153268814087, -0.4549274742603302, 0.18245090544223785, 0.06419572234153748, -0.01642156019806862, 0.14048083126544952, 0.0022971052676439285, 0.25533315539360046, 0.1827063113451004, 0.002797923982143402, 0.23305615782737732, 0.31009963154792786, 0.1579858660697937, 0.26090699434280396, -0.05496476590633392, 0.40745407342910767, 0.37706416845321655, -0.10904552042484283, 0.015574438497424126, -0.3031928837299347, -0.20392152667045593, 0.04684831202030182, -0.255083829164505, 0.20525941252708435, -0.1517210304737091, -0.23348131775856018, 0.006089359521865845, 0.18702179193496704, -0.03367863595485687, 0.13707715272903442, 0.545933187007904, -0.08209806680679321, 0.07685153186321259, -0.01737210899591446, 0.2744349241256714, -0.1444108486175537, -0.09529796242713928, -0.16753417253494263, -0.07894401252269745, -0.12419547140598297, 0.09458968043327332, 0.3525698184967041, -0.45262202620506287, 0.15481284260749817, 0.17492423951625824, 0.013008925132453442, -0.008822731673717499, -0.29830050468444824, -0.05369475483894348, -0.024647388607263565, 0.048078503459692, 0.15729330480098724, 0.2496357262134552, 0.13436636328697205, -0.37349653244018555, -0.15360766649246216, -0.041838668286800385, -0.3792869448661804, -0.0743204802274704, -0.05016593635082245, 0.11877764761447906, -0.319036602973938, -0.13723191618919373, -0.3150029480457306, 0.160086989402771, -0.17207121849060059, -0.2294362485408783, -0.11731582880020142, -0.022268377244472504, -0.17510411143302917, -0.16599829494953156, 0.38892337679862976, 0.6691896319389343, -0.5987808108329773, -0.20142585039138794, 0.1942811757326126, -0.1765379160642624, -0.2210102379322052, 0.1590222418308258, -0.11052724719047546, -0.02869664877653122, -0.32387375831604004, -0.2782254219055176, 0.27457499504089355, -0.6374078392982483, -0.2011258453130722, 0.053866881877183914, -0.2006460279226303, 0.3526560068130493, -0.06769338995218277, -0.015815112739801407, 0.033405154943466187, 0.07104379683732986, 0.03544904291629791, 0.25653523206710815, 0.08450450003147125, 0.014364920556545258, -0.22976112365722656, -0.34305891394615173, -0.051169198006391525, 0.25049567222595215, 0.1543055921792984, 0.1479942500591278, 0.07032299786806107, 0.18709227442741394, 0.25971946120262146, -0.00819556787610054, -0.049258340150117874, 0.2119828313589096, 0.2127108871936798, 0.0983501449227333, 0.04758882895112038, -0.2064952552318573, -0.5988410115242004, 0.5249431133270264, 0.008922472596168518, 0.017299428582191467, 0.1494975984096527, -0.0798993855714798, -0.24024002254009247, -0.019152779132127762, -0.41359007358551025, -0.07257188111543655, 0.03251424431800842, 0.17433743178844452, 0.16160616278648376, 0.07501019537448883, -0.35390549898147583, 0.6072329878807068, -0.2924264073371887, 0.35172009468078613, -0.35819584131240845, 0.35905927419662476, 0.028749918565154076, -0.14909560978412628, -0.2698478698730469, 0.17330574989318848, 0.12173359096050262, -0.19908922910690308, 0.01559193804860115, 0.499564528465271, 0.03121376782655716, 0.09086437523365021, 0.04175683110952377, -0.1734190136194229, 0.1325567066669464, -0.1213812306523323, -0.07865160703659058, 0.14789655804634094, 0.1209745705127716, 0.01639128476381302, -0.4451104402542114, 0.31914710998535156, -0.1827065348625183, 0.274860143661499, 0.24935342371463776, -0.1042262613773346, 0.13280458748340607, 0.08830684423446655, -0.14959248900413513, 0.04702620208263397, 0.09035000205039978, 0.08158613741397858, 0.26471787691116333, -0.045311324298381805, -0.184745192527771, 0.001097358763217926, 0.440825879573822, 0.09848425537347794, 0.06914494931697845, 0.18185195326805115, -0.1513517051935196, -0.0031967386603355408, 0.025420958176255226, -0.06655938178300858, 0.3634251356124878, 0.11686910688877106, -0.12191131711006165, 0.15389904379844666, -0.10616686940193176, 0.052900202572345734, 0.09221837669610977, 0.07454121857881546, -0.0996626764535904, 0.0034503000788390636, 0.17948710918426514, 0.1842585802078247, -0.2920938730239868, -0.0999656617641449, -0.2134663462638855, 0.02519257180392742, -0.5264187455177307, 0.16011448204517365, -0.19402411580085754, 0.1636519730091095, -0.26634085178375244, 0.33940407633781433, -0.4800834059715271, -0.063223697245121, -0.1947479546070099, 0.23406347632408142, 0.3515588045120239, 0.006371740251779556, -0.12442833185195923, 0.4940800666809082, -0.08370352536439896, -0.35873544216156006, -0.02524380385875702, 0.037241000682115555, -0.30792951583862305, -0.06298229098320007, 0.11375194787979126, -0.05913557857275009, 0.02647935412824154, -0.3722725510597229, -0.17769716680049896, -0.12185239791870117, -0.325895756483078, 0.26517096161842346, -0.023930706083774567, 0.3862505853176117, 0.09140320122241974, 0.15037468075752258, -0.3211499750614166, -0.011458657681941986, 0.4302464723587036, -0.3893963098526001, -0.10420943796634674, 0.10364942252635956, -0.06031356751918793, -0.13953691720962524, -0.1469746232032776, -0.2433806210756302, -0.23895692825317383, -0.3223794400691986, 0.35797590017318726, 0.11548878252506256, -0.007195927202701569, 0.41271382570266724, 0.10140496492385864, 0.24645404517650604, -0.10330885648727417, 0.3144504129886627, -0.15419384837150574, -0.5227957963943481, 0.2799127697944641, -0.2529720067977905, -0.43380481004714966, 0.15744060277938843, 0.1054413691163063, -0.061889246106147766, -0.2369847595691681, -0.3557814955711365, -0.40656042098999023, -0.10610027611255646, 0.26723700761795044, 0.0810224860906601, 0.33539801836013794, 0.15138202905654907, -0.30472761392593384, 0.08551247417926788, -0.1263241320848465, -0.49856048822402954, 0.15568839013576508, 0.2735166549682617, 0.1596827507019043, 0.01899709552526474, 0.12075182795524597, -0.05241762101650238, 0.6172204613685608, 0.2430829107761383, -0.038980353623628616, 0.3408820331096649, -0.18187212944030762, 0.645720362663269, -0.31905972957611084, -0.4319717288017273, -0.005656987428665161, -0.12151113152503967, 0.14108866453170776, 0.23252731561660767, 0.2275257706642151, 0.20308488607406616, -0.23675698041915894, 0.13826878368854523, -0.03447386622428894, -0.287555456161499, -0.043980564922094345, 0.2469223290681839, -0.12606671452522278, 0.07510079443454742, 0.3428661525249481, -0.1957898736000061, -0.145846426486969, 0.008847314864397049, 0.5411451458930969, 0.01697368547320366, 0.1645309329032898, -0.5367224216461182, -0.015901952981948853, -0.24347802996635437, 0.20002377033233643, -0.03591509908437729, 0.36102578043937683, -0.09715904295444489, -0.07509511709213257, 0.10412361472845078, -0.07960469275712967, 0.6281691193580627, -0.01378836203366518, 0.1179506927728653, 0.07688383013010025, -0.21947839856147766, -0.7340588569641113, -0.1751556396484375, 0.038923755288124084, 0.08457228541374207, 0.19020558893680573, 0.4246560335159302, -0.18353918194770813, -0.26959389448165894, 0.11172303557395935, 0.2034544050693512, -0.12018052488565445, -0.02355775237083435, -0.5403674244880676, -0.14824120700359344, -0.2093839943408966, -0.1495123654603958, -0.11197268217802048, 0.24296391010284424, 0.0033960044384002686, 0.09757672250270844, 0.1196441799402237, -0.03684148192405701, 0.27797451615333557, 0.3734346926212311, 0.3622790575027466, 0.11188925802707672, 0.24945886433124542, 0.6275190114974976, 0.08643360435962677, -0.1418469250202179, 0.7901729941368103, -0.28310471773147583, -0.5007519125938416, 0.3268231153488159, -0.058185361325740814, 0.1939016431570053, 0.6638059616088867, -0.10789598524570465, -0.005000073462724686, -0.11893367767333984, 0.024429989978671074, -0.1339081972837448, -0.01666611060500145, 0.3282182514667511, 0.00813138484954834, -0.10868121683597565, -0.3369622826576233, 0.25899767875671387, 0.010819092392921448, -0.011106550693511963, 0.18906648457050323, 0.4472908079624176, -0.1790410280227661, 0.27678826451301575, -0.2732856273651123, 0.9267296195030212, -0.11364208906888962, 0.23868896067142487, 0.27772456407546997, -0.1452828198671341, 0.5415619015693665, -0.06688173860311508, 0.09591688215732574, -0.47087717056274414, -0.12746718525886536, 0.04006608575582504, -0.07027950137853622, 0.2574239671230316, 0.04447958245873451, -0.10039542615413666, 0.2744782567024231, -0.23450464010238647, 0.4432815909385681, 0.06506401300430298, 0.19803816080093384, -0.08551649749279022, -0.3022190034389496, -0.46909958124160767, 0.16193050146102905, 0.036855679005384445, 0.33408674597740173, -0.16853216290473938, 0.06107819452881813, -0.15174178779125214, -0.22994285821914673, -0.1788206398487091, 0.12213525176048279, -0.16222988069057465, 0.09902788698673248, 0.33873751759529114, -0.15943235158920288, 0.11081048846244812, 0.41090157628059387, 0.37539222836494446, -0.011004488915205002, -0.12341724336147308, 0.2092318832874298, -0.20724454522132874, 0.2167389690876007, -0.020703988149762154, -0.0019534751772880554, 0.18170489370822906, -0.03196624666452408, -0.24202239513397217, -0.0684065893292427, -0.15183128416538239, -0.23436717689037323, -0.13845959305763245, 0.19982552528381348, 0.05151974409818649, -0.10865722596645355, -0.09128226339817047, -0.16303177177906036, 0.2385561466217041, -0.21559074521064758, 0.09856171160936356, 0.06742586940526962, -0.020850609987974167, 0.17193666100502014, 0.19017843902111053, -0.27883946895599365, 0.00042373407632112503, 0.593702495098114, -0.5888474583625793, -0.11660026758909225, 0.34946486353874207, 0.19130967557430267, -0.1411391943693161, -0.1397264003753662, 0.215509295463562, 0.3532288074493408, -0.46781373023986816, 0.038911279290914536, -0.12870298326015472, -0.10266921669244766, -0.015814214944839478, 0.3589496612548828, 0.20800694823265076, -0.3429751396179199, -0.014703653752803802, -0.40618598461151123, -0.14881058037281036, 0.13400258123874664, 0.25700896978378296, -0.019981497898697853, 0.13970743119716644, -0.15372642874717712, 0.02745676040649414, -0.10913044214248657, -0.2719174325466156, 0.1579819917678833, -0.06360481679439545, -0.1596188247203827, -0.07595595717430115, -0.04696778580546379, 0.32774803042411804, -0.23324763774871826, 0.03026682883501053, 0.0320449136197567, -0.2605421543121338, -0.17088598012924194, -0.2987421751022339, 0.17626148462295532, -0.08129584789276123, -0.13834774494171143, -0.04962308332324028, -0.09026505798101425, -0.14527416229248047, -0.2801479399204254, 0.31995493173599243, 0.3851644992828369, -0.009379815310239792, 0.06135161966085434, -0.09816950559616089, 0.20474019646644592, -0.0258013978600502, 0.11125558614730835, 0.1189611405134201, 0.3062400221824646, 0.225626602768898, 0.11385276168584824, -0.2850794494152069, 0.021849364042282104, 0.004574287682771683, 0.31272023916244507, 0.2110636681318283, 0.13549798727035522, 0.17606741189956665, -0.3904188871383667, 0.12323711812496185, -0.07027379423379898, 0.21544857323169708, 0.4465160667896271, -0.19934207201004028, 0.11372829228639603, -0.010189838707447052, 0.1246282309293747, -0.07485534250736237, -0.06147319823503494, 0.43770137429237366, -0.015332413837313652, 0.0878332108259201, 0.4220416843891144, 0.2156493365764618, 0.07033200562000275, -0.012113813310861588, 0.05997917056083679, 0.8407273888587952, 0.14825649559497833, 0.2459191232919693, 0.347511887550354, 0.007044188678264618, 0.2521767318248749, 0.1508001685142517, -0.0013597849756479263, -0.017763350158929825, 0.22848588228225708, -0.4180086851119995, 0.2240728884935379, -0.20595979690551758, 0.21804076433181763, 0.330639511346817, -0.4671540856361389, 0.18191245198249817, 0.00527586042881012, 0.11488477885723114, -0.07462365925312042, -0.24406418204307556, 0.7354533076286316, -0.5803947448730469, -0.33329981565475464, -0.33195558190345764, -0.12837108969688416, -0.1094127744436264, -0.10200217366218567, -0.23629721999168396, -0.3215824067592621, -0.20342952013015747, 0.015788599848747253, -0.0268856193870306, -0.4433940649032593, 0.12106815725564957, -0.012150824069976807, 0.07777214050292969, -0.38513803482055664, -0.30532169342041016, 0.0760437399148941, 0.11077459156513214, 0.029892340302467346, 0.26507657766342163, 0.03851659595966339, 0.02239004150032997, 0.3252362012863159, 0.09487266838550568, 0.42203232645988464, 0.3409280776977539, 0.12159142643213272, 0.1528884768486023, -0.06491392850875854, 0.021709561347961426, -0.07645735889673233, 0.12887606024742126, -0.163161039352417, -0.17794179916381836, 0.2241806983947754, 0.12162181735038757, -0.11243458092212677, -0.1223326325416565, -0.07826115190982819, 0.11779680103063583, -0.44342830777168274, 0.35932594537734985, -0.36907586455345154, 0.11193419992923737, -0.1594616025686264, -0.0752423107624054, -0.12883782386779785, 0.011651813983917236, 0.22481966018676758, 0.18331804871559143, 0.15015453100204468, -0.17903022468090057, 0.06131599843502045, 0.20328599214553833, 0.3416126072406769, 0.1825106143951416, -0.04811300337314606, -0.10640887916088104, 0.06789909303188324, -0.8278234004974365, 0.1384463757276535, 0.046943239867687225, 0.006488464772701263, 0.12827624380588531, 0.1990072876214981, -0.1164344996213913, 0.1582951843738556, 0.3334650695323944, -0.30263394117355347, 0.11556114256381989, 0.09503288567066193, -0.3136928677558899, -0.14931070804595947, -0.03885951638221741, 0.08661753684282303, -0.017289306968450546, -0.4619695246219635, 0.12822625041007996, -0.2172520011663437, -0.1414935290813446, 0.03813394531607628, -0.0950598269701004, -0.05399317666888237, -0.5413033962249756, 0.4046686589717865, -0.22040563821792603, 0.3867034316062927, 0.1137503832578659, -0.22074049711227417, -0.4132235646247864, -0.24213482439517975, -0.197909876704216, 0.20195437967777252, -0.21192695200443268, 0.36046791076660156, -0.18106064200401306, -0.3613874316215515, -0.2927786409854889, 0.23766730725765228, 0.2532097101211548, -0.046420611441135406, -0.36527156829833984, 0.061555542051792145, -0.09555866569280624, 0.31369203329086304, 0.1140865683555603, 0.19910499453544617, -0.2539044916629791, 0.18898877501487732, -0.31277602910995483, -0.14496833086013794, 0.5548199415206909, -0.4431971609592438, -0.27480000257492065, -0.31360697746276855, 0.2440437525510788, 0.11538111418485641, -0.21531198918819427, -0.4227493405342102, -0.026496604084968567, 0.17586654424667358, -0.1545325070619583, -0.15171968936920166, 0.11161784827709198, -0.3878154754638672, 0.041194990277290344, -0.10382141917943954, -0.13695552945137024, 0.034345705062150955, -0.09068605303764343, 0.20412497222423553, -0.18550947308540344 ]
https://github.com/huggingface/datasets/issues/5768
Additionally, we just had an infrastructure issue on the Hugging Face Hub at around 11:30 today. That might have contributed to the connectivity issue... It is fixed now. https://status.huggingface.co/
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1
### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64
29
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1 ### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64 Additionally, we just had an infrastructure issue on the Hugging Face Hub at around 11:30 today. That might have contributed to the connectivity issue... It is fixed now. https://status.huggingface.co/
[ -0.02963661402463913, -0.368111252784729, 0.10719997435808182, 0.22717875242233276, 0.23377501964569092, -0.011893749237060547, 0.4508305788040161, 0.10612426698207855, 0.2266709804534912, 0.049423523247241974, -0.1979769468307495, 0.33952516317367554, 0.08872051537036896, -0.00844312459230423, 0.12085460126399994, -0.10616077482700348, 0.10370185971260071, -0.023429803550243378, -0.06705743819475174, -0.0441046878695488, -0.09299895167350769, 0.2945178747177124, -0.26604515314102173, 0.10850198566913605, -0.2316703498363495, 0.14946098625659943, -0.08620999753475189, 0.34228119254112244, 0.030244626104831696, -0.39261144399642944, 0.4787672758102417, 0.08220695704221725, 0.3953205347061157, 0.6397828459739685, -0.00012436386896297336, 0.1824498325586319, 0.12050652503967285, -0.0937473252415657, -0.5543765425682068, -0.4393196105957031, 0.016528569161891937, -0.3270915150642395, 0.3370838761329651, 0.03285516798496246, -0.03090735152363777, 0.2565000057220459, 0.17708837985992432, -0.2917955815792084, 0.611049234867096, 0.15931393206119537, 0.13809463381767273, 0.5078373551368713, -0.1557832658290863, -0.3057946562767029, -0.07246031612157822, 0.14265652000904083, -0.19738106429576874, 0.31441938877105713, 0.3358733654022217, 0.04973422735929489, 0.1724456399679184, -0.0018625035881996155, 0.04536206275224686, -0.12393359839916229, 0.4243522882461548, 0.1898566484451294, 0.040589816868305206, -0.23902644217014313, 0.11988802999258041, 0.29090118408203125, 0.2059342861175537, -0.21889135241508484, -0.3750537633895874, -0.29600560665130615, -0.07475631684064865, 0.069264717400074, 0.34953993558883667, 0.10955382138490677, -0.14218208193778992, 0.18953362107276917, -0.197745680809021, 0.008688949048519135, -0.0243387371301651, -0.015552166849374771, 0.00014263391494750977, 0.0031568557024002075, -0.22629699110984802, 0.2582905888557434, 0.12481888383626938, 0.012597329914569855, -0.265622079372406, -0.0375545471906662, -0.05076349154114723, 0.404255747795105, -0.45175331830978394, 0.17627428472042084, 0.046636682003736496, -0.0318760946393013, 0.16688305139541626, 0.011990299448370934, 0.22002512216567993, 0.18649046123027802, -0.041777245700359344, 0.2527625560760498, 0.31032922863960266, 0.1699681580066681, 0.3744921088218689, -0.06952179968357086, 0.41038161516189575, 0.34783101081848145, -0.12754039466381073, 0.021263713017106056, -0.2985398769378662, -0.17222142219543457, 0.09237094223499298, -0.2848731577396393, 0.20087511837482452, -0.18996739387512207, -0.19343331456184387, 0.025493882596492767, 0.12010563164949417, -0.07457593083381653, 0.06591314822435379, 0.5091659426689148, -0.02148045413196087, 0.08772668242454529, 0.008075669407844543, 0.3042542338371277, -0.09229235351085663, -0.2253640741109848, -0.0959145575761795, -0.07955266535282135, -0.11235897243022919, 0.06987293809652328, 0.3537384867668152, -0.5299814939498901, 0.11117800325155258, 0.19934318959712982, -0.022313077002763748, -0.10159289091825485, -0.35672637820243835, -0.02924826368689537, 0.005092941224575043, -0.02029147930443287, 0.12094079703092575, 0.21671636402606964, 0.20352980494499207, -0.3483836054801941, -0.1263219118118286, -0.03091273084282875, -0.4030291438102722, -0.009292744100093842, -0.0736994817852974, 0.03983553126454353, -0.28878867626190186, -0.14221003651618958, -0.34567955136299133, 0.2502928078174591, -0.19010163843631744, -0.263020396232605, -0.10649069398641586, -0.020274007692933083, -0.23046669363975525, -0.1331290602684021, 0.3738535940647125, 0.666440486907959, -0.6323925852775574, -0.2097892314195633, 0.21623732149600983, -0.17705117166042328, -0.14252236485481262, 0.16763100028038025, -0.08397163450717926, -0.052305154502391815, -0.36353784799575806, -0.3233126401901245, 0.24105392396450043, -0.5716703534126282, -0.11540502309799194, 0.11016789078712463, -0.15337589383125305, 0.39371490478515625, -0.0474112406373024, -0.02970968931913376, 0.009078335016965866, 0.08601665496826172, 0.07119907438755035, 0.23847471177577972, 0.05317346006631851, -0.031081631779670715, -0.20195931196212769, -0.31825780868530273, 0.0023840367794036865, 0.21297651529312134, 0.18254372477531433, 0.2479379028081894, 0.054139621555805206, 0.10039381682872772, 0.28719615936279297, 0.0005342625081539154, -0.032975077629089355, 0.12148464471101761, 0.13395747542381287, 0.05020568519830704, 0.06783807277679443, -0.19316869974136353, -0.6610126495361328, 0.5104974508285522, 0.02682671695947647, 0.03739389404654503, 0.18012991547584534, -0.04968949779868126, -0.23661409318447113, -0.0003940686583518982, -0.33625224232673645, -0.06145463511347771, -0.059381622821092606, 0.14400887489318848, 0.13535727560520172, 0.116572305560112, -0.38003647327423096, 0.6411768198013306, -0.31199875473976135, 0.3436542749404907, -0.35354846715927124, 0.33973783254623413, 0.09940603375434875, -0.14163725078105927, -0.2854090631008148, 0.14215430617332458, 0.18209624290466309, -0.207164004445076, 0.006323445588350296, 0.46469464898109436, -0.00008692964911460876, 0.06144578009843826, 0.02035324089229107, -0.19526353478431702, 0.12227980047464371, -0.09617091715335846, -0.13279427587985992, 0.15764957666397095, 0.13401471078395844, -0.019375748932361603, -0.399268239736557, 0.3816222548484802, -0.11415596306324005, 0.29882991313934326, 0.2555307149887085, -0.08692812919616699, 0.14818044006824493, 0.07366979122161865, -0.13311463594436646, 0.05216170847415924, 0.14184962213039398, -0.004092155024409294, 0.20837245881557465, -0.06120191514492035, -0.24659483134746552, -0.05457063019275665, 0.4269697070121765, 0.07241709530353546, 0.06325465440750122, 0.23920273780822754, -0.10346336662769318, -0.036240316927433014, 0.0462905615568161, -0.12189584970474243, 0.3537437319755554, 0.056399330496788025, -0.19517630338668823, 0.1782284677028656, -0.09126240015029907, 0.06899921596050262, 0.11673976480960846, 0.06570495665073395, -0.11232073605060577, 0.024014178663492203, 0.17750877141952515, 0.1585872769355774, -0.2882006764411926, -0.10790085792541504, -0.19101062417030334, 0.04211150109767914, -0.5800487399101257, 0.19704924523830414, -0.14430557191371918, 0.11255617439746857, -0.27516359090805054, 0.3623185157775879, -0.49449917674064636, -0.10519858449697495, -0.26931852102279663, 0.2227577418088913, 0.40249577164649963, -0.03849410638213158, -0.12861387431621552, 0.5321502089500427, -0.06903159618377686, -0.3414289653301239, -0.09061019122600555, 0.08417165279388428, -0.2891579568386078, -0.12940970063209534, 0.11648184806108475, -0.15461578965187073, -0.028505194932222366, -0.4235233664512634, -0.276694118976593, -0.11169680207967758, -0.30618536472320557, 0.3208528161048889, 0.0013303318992257118, 0.3839190900325775, 0.12985850870609283, 0.12791113555431366, -0.36187291145324707, 0.00547105073928833, 0.4132797420024872, -0.42923498153686523, -0.13118195533752441, 0.1484643667936325, -0.047321632504463196, -0.08352433145046234, -0.19245626032352448, -0.15508073568344116, -0.2076731026172638, -0.21835242211818695, 0.40150293707847595, 0.1047787070274353, 0.03667297214269638, 0.43618449568748474, 0.0908346027135849, 0.2544206380844116, -0.06941567361354828, 0.2993110418319702, -0.1478213667869568, -0.4995672404766083, 0.27247241139411926, -0.20043647289276123, -0.4305788278579712, 0.12929177284240723, 0.14139938354492188, -0.12630252540111542, -0.2145683467388153, -0.31862419843673706, -0.34651806950569153, -0.07221291214227676, 0.2956244945526123, 0.06941968202590942, 0.29005658626556396, 0.08256775885820389, -0.35519060492515564, 0.132005512714386, -0.13240046799182892, -0.49207425117492676, 0.1608733832836151, 0.27996546030044556, 0.1439361870288849, 0.07370977103710175, 0.21262423694133759, -0.11893124878406525, 0.544032633304596, 0.23666810989379883, -0.03523637726902962, 0.34964480996131897, -0.25069910287857056, 0.6172943711280823, -0.31189674139022827, -0.44561654329299927, -0.030747946351766586, -0.1424054652452469, 0.12936383485794067, 0.20189562439918518, 0.24382521212100983, 0.251214861869812, -0.3184546232223511, 0.09467657655477524, -0.03342825546860695, -0.2728583812713623, -0.0709637776017189, 0.23640307784080505, -0.11174265295267105, 0.09401199966669083, 0.37587159872055054, -0.17514245212078094, -0.1523381471633911, -0.03734228014945984, 0.5538220405578613, 0.1021810919046402, 0.11854180693626404, -0.45902377367019653, -0.01012171059846878, -0.28323838114738464, 0.2255832552909851, -0.012410447001457214, 0.4365091919898987, -0.0812394842505455, -0.0213778093457222, 0.11233927309513092, -0.049143336713314056, 0.6934252381324768, 0.027806853875517845, 0.15562251210212708, 0.028451979160308838, -0.2453676462173462, -0.7260832786560059, -0.16639865934848785, 0.07337385416030884, 0.134139284491539, 0.2537064254283905, 0.47282421588897705, -0.16185660660266876, -0.23889708518981934, 0.15359851717948914, 0.19235917925834656, -0.10573334991931915, -0.04668214172124863, -0.5453753471374512, -0.11997386813163757, -0.17615269124507904, -0.20019078254699707, -0.11051030457019806, 0.21960198879241943, -0.0026712119579315186, 0.11813777685165405, 0.1405581533908844, -0.058796241879463196, 0.32491540908813477, 0.32634878158569336, 0.32000643014907837, 0.11113181710243225, 0.20702466368675232, 0.6246245503425598, 0.12720158696174622, -0.16959631443023682, 0.8041803240776062, -0.18798905611038208, -0.5119961500167847, 0.3593476712703705, -0.06763508915901184, 0.27474620938301086, 0.7059628367424011, -0.17546182870864868, 0.031878761947155, -0.13742294907569885, 0.04893570393323898, -0.12777739763259888, -0.07999745011329651, 0.3661593794822693, 0.01590818166732788, -0.20311039686203003, -0.335506796836853, 0.2646380364894867, -0.0335211306810379, 0.03151632845401764, 0.23346729576587677, 0.3890223801136017, -0.1642177402973175, 0.19632107019424438, -0.3440851867198944, 0.944313645362854, -0.11333909630775452, 0.2736824154853821, 0.26826149225234985, -0.2015397548675537, 0.5441929697990417, 0.06334484368562698, 0.08084647357463837, -0.4613742232322693, -0.07730764150619507, 0.007030025124549866, -0.07027439773082733, 0.28214231133461, 0.019539911299943924, -0.10282211750745773, 0.2806100845336914, -0.2656019926071167, 0.43068671226501465, 0.11103810369968414, 0.160644993185997, -0.09844083338975906, -0.23584376275539398, -0.5216240286827087, 0.06550425291061401, 0.0502849817276001, 0.3238534927368164, -0.15392039716243744, 0.06100507825613022, -0.16716140508651733, -0.25728639960289, -0.20920386910438538, 0.12445379048585892, -0.08310892432928085, 0.061381109058856964, 0.4065069556236267, -0.15447860956192017, 0.15199030935764313, 0.4019201099872589, 0.32352977991104126, -0.025005588307976723, -0.1476755440235138, 0.1700931042432785, -0.23411168158054352, 0.24949443340301514, 0.007759399712085724, 0.014695610851049423, 0.192207932472229, 0.01563917100429535, -0.22908496856689453, -0.04933229461312294, -0.17214085161685944, -0.21636493504047394, -0.21256732940673828, 0.1900213658809662, 0.02895514667034149, -0.1159307211637497, -0.14106854796409607, -0.21534326672554016, 0.21807515621185303, -0.2529138922691345, 0.025719206780195236, 0.07423515617847443, 0.001931849867105484, 0.1072336956858635, 0.21750988066196442, -0.27907460927963257, 0.014204015955328941, 0.6571340560913086, -0.5887220501899719, -0.09001995623111725, 0.34427526593208313, 0.26821964979171753, -0.06906221807003021, -0.0872146487236023, 0.23794420063495636, 0.4268196225166321, -0.5096517205238342, 0.10658508539199829, -0.10058172792196274, -0.02568298578262329, -0.061680328100919724, 0.4473542869091034, 0.17499807476997375, -0.3023846745491028, 0.0339619517326355, -0.42587873339653015, -0.12785963714122772, 0.0627327412366867, 0.2962772846221924, -0.09940516948699951, 0.15548065304756165, -0.07673288136720657, 0.05751200020313263, -0.10859369486570358, -0.18518474698066711, 0.11719688773155212, 0.0008758306503295898, -0.22742220759391785, -0.03301391378045082, 0.03613582253456116, 0.35357528924942017, -0.24844318628311157, -0.023221764713525772, 0.012924499809741974, -0.20712384581565857, -0.07984812557697296, -0.3192831873893738, 0.2153955101966858, -0.060594115406274796, -0.20946447551250458, -0.058866407722234726, -0.11095017194747925, -0.19605448842048645, -0.2812638282775879, 0.2946041226387024, 0.43069586157798767, -0.036791764199733734, 0.0726209506392479, -0.11023200303316116, 0.2410890907049179, -0.08454267680644989, 0.07763104140758514, 0.1385943591594696, 0.34290188550949097, 0.23413124680519104, 0.11220851540565491, -0.3036423921585083, 0.06288950890302658, -0.03964146971702576, 0.33730530738830566, 0.17093802988529205, 0.0965537577867508, 0.19137822091579437, -0.41877272725105286, 0.12017104029655457, -0.11734114587306976, 0.25408217310905457, 0.4855027496814728, -0.20080327987670898, 0.12588459253311157, -0.05005023255944252, 0.029748037457466125, -0.09659802913665771, -0.03889283165335655, 0.48239487409591675, 0.035502009093761444, 0.021159887313842773, 0.4279828369617462, 0.16303537786006927, -0.006912335753440857, -0.062362391501665115, 0.009819962084293365, 0.8389485478401184, 0.18056514859199524, 0.23624511063098907, 0.33214911818504333, 0.07690522074699402, 0.29071763157844543, 0.16687633097171783, -0.028163157403469086, -0.05488306283950806, 0.18973129987716675, -0.38795027136802673, 0.19149424135684967, -0.2504039704799652, 0.29910987615585327, 0.30994290113449097, -0.4842045307159424, 0.21997953951358795, 0.08853262662887573, 0.07801912724971771, -0.02431526780128479, -0.2684552073478699, 0.746074914932251, -0.5360859632492065, -0.3212781846523285, -0.3209419250488281, -0.09038025885820389, -0.08822982013225555, -0.09722822904586792, -0.21992728114128113, -0.3853355050086975, -0.20828470587730408, 0.020654208958148956, -0.008728076703846455, -0.3871305286884308, 0.13151007890701294, 0.03525586426258087, 0.1165245920419693, -0.39101719856262207, -0.3401646912097931, 0.062251701951026917, 0.18115371465682983, 0.00672333687543869, 0.27010080218315125, 0.018122684210538864, 0.03569095954298973, 0.40678665041923523, 0.020144449546933174, 0.41965535283088684, 0.3716476261615753, 0.22498515248298645, 0.16260093450546265, -0.10209038853645325, 0.06278415769338608, -0.012778028845787048, 0.22662405669689178, -0.10389544069766998, -0.10414184629917145, 0.23316258192062378, 0.04559997469186783, -0.03814585879445076, -0.06114520877599716, -0.006252821534872055, 0.12095753848552704, -0.48862528800964355, 0.36278361082077026, -0.39936473965644836, 0.08219192177057266, -0.18390193581581116, -0.08769810944795609, -0.033198222517967224, -0.03878210112452507, 0.16466474533081055, 0.19342941045761108, 0.15268249809741974, -0.1480817347764969, 0.01992630958557129, 0.20404964685440063, 0.3106570243835449, 0.2276332825422287, -0.028925728052854538, -0.07770251482725143, 0.04021739959716797, -0.7821897864341736, 0.12736782431602478, 0.0836891233921051, -0.037115998566150665, 0.20015698671340942, 0.16614902019500732, -0.10283231735229492, 0.08688332140445709, 0.32069718837738037, -0.2842637896537781, 0.13264665007591248, 0.05046848952770233, -0.28994178771972656, -0.16405093669891357, -0.06782956421375275, 0.11821039021015167, -0.05356840789318085, -0.4479314684867859, 0.1987016648054123, -0.3051407039165497, -0.208158478140831, 0.03837538883090019, -0.12038339674472809, -0.07326220721006393, -0.5191822052001953, 0.39412805438041687, -0.18122273683547974, 0.4565276503562927, 0.11823257803916931, -0.19076432287693024, -0.37279462814331055, -0.2027396559715271, -0.17585760354995728, 0.24283748865127563, -0.2099139243364334, 0.34121471643447876, -0.15950065851211548, -0.3501128554344177, -0.2736899256706238, 0.27817481756210327, 0.22608301043510437, -0.05493073910474777, -0.39964810013771057, 0.0880887508392334, -0.12405256181955338, 0.26274242997169495, 0.0511137992143631, 0.217416450381279, -0.25638261437416077, 0.16862276196479797, -0.29292815923690796, -0.09474695473909378, 0.537675142288208, -0.49545353651046753, -0.3130362629890442, -0.37363722920417786, 0.24221280217170715, 0.07865965366363525, -0.21832118928432465, -0.42373913526535034, -0.06638442724943161, 0.1935143917798996, -0.1225099265575409, -0.09573965519666672, 0.09670092910528183, -0.4009154140949249, 0.05987653136253357, -0.08636122941970825, -0.17082977294921875, 0.06650865823030472, -0.09226854145526886, 0.19617873430252075, -0.1891818791627884 ]
https://github.com/huggingface/datasets/issues/5768
Hi again, thanks for your help and insight Albert Villanova. It's all working now, so thank you for that. For the benefit of anyone else who ends up in this thread, I solved the problem by addressing Albert's advice: (1) Both Windows and Linux machine 1 (have internet access) and can now access the SQuAD dataset. The supercomputer login node can only access version 2.7.1, but my Windows laptop is running on datasets 2.11.0 just fine. I suspect it was just a perfect storm alongside the aforementioned "infrastructure issue". (2) I did have a local directory called squad, because I was using a local copy of evaluate's "SQuAD" metric. The supercomputer compute nodes do not have internet access and treat `metric = evaluate.load('<x>')` as a way of loading a metric at the local path `./<x>/<x>.py`, which could've been a related issue as I was storing the metric under `squad/squad.py`. Don't be lazy like me and store the evaluation code under a path with a name that can be misinterpreted. (3) I can't give internet access to the supercomputer compute nodes, so local files do just fine here. (4) The windows and Linux machine 1 can both access the internet and were getting fresh copies of the dataset from the huggingface hub. Linux machine 2 was working after I cleared the contents of ~/.cache/huggingface/.... I feel silly now, knowing it was all so simple! Sorry about that Albert, and thanks again for the help. I've not raised a Github issue like this before, so I'm not sure if I should be close my own issues or if this is something you guys do?
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1
### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64
272
load_dataset("squad") doesn't work in 2.7.1 and 2.10.1 ### Describe the bug There is an issue that seems to be unique to the "squad" dataset, in which it cannot be loaded using standard methods. This issue is most quickly reproduced from the command line, using the HF examples to verify a dataset is loaded properly. This is not a problem with "squad_v2" dataset for example. ### Steps to reproduce the bug cmd line > $ python -c "from datasets import load_dataset; print(load_dataset('squad', split='train')[0])" OR Python IDE > from datasets import load_dataset > load_dataset("squad") ### Expected behavior I expected to either see the output described here from running the very same command in command line ([https://huggingface.co/docs/datasets/installation]), or any output that does not raise Python's TypeError. There is some funky behaviour in the dataset builder portion of the codebase that means it is trying to import the squad dataset with an incorrect path, or the squad dataset couldn't be downloaded. I'm not really sure what the problem is beyond that. Messing around with caching I did manage to get it to load the dataset once, and then couldn't repeat this. ### Environment info datasets=2.7.1 **or** 2.10.1, python=3.10.8, Linux 3.10.0-1160.36.2.el7.x86_64 **or** Windows 10-64 Hi again, thanks for your help and insight Albert Villanova. It's all working now, so thank you for that. For the benefit of anyone else who ends up in this thread, I solved the problem by addressing Albert's advice: (1) Both Windows and Linux machine 1 (have internet access) and can now access the SQuAD dataset. The supercomputer login node can only access version 2.7.1, but my Windows laptop is running on datasets 2.11.0 just fine. I suspect it was just a perfect storm alongside the aforementioned "infrastructure issue". (2) I did have a local directory called squad, because I was using a local copy of evaluate's "SQuAD" metric. The supercomputer compute nodes do not have internet access and treat `metric = evaluate.load('<x>')` as a way of loading a metric at the local path `./<x>/<x>.py`, which could've been a related issue as I was storing the metric under `squad/squad.py`. Don't be lazy like me and store the evaluation code under a path with a name that can be misinterpreted. (3) I can't give internet access to the supercomputer compute nodes, so local files do just fine here. (4) The windows and Linux machine 1 can both access the internet and were getting fresh copies of the dataset from the huggingface hub. Linux machine 2 was working after I cleared the contents of ~/.cache/huggingface/.... I feel silly now, knowing it was all so simple! Sorry about that Albert, and thanks again for the help. I've not raised a Github issue like this before, so I'm not sure if I should be close my own issues or if this is something you guys do?
[ -0.21133318543434143, -0.045081064105033875, 0.1208299845457077, 0.16353736817836761, 0.28210556507110596, -0.11948999762535095, 0.4114721715450287, 0.08792444318532944, 0.20600098371505737, 0.0734335258603096, -0.09240821748971939, 0.4762028455734253, 0.15384873747825623, -0.06046082824468613, 0.1777847856283188, -0.09316150099039078, 0.14922192692756653, -0.001188371330499649, -0.21105918288230896, -0.023853987455368042, -0.13373593986034393, 0.14225415885448456, -0.28674620389938354, 0.14655578136444092, -0.17629238963127136, 0.11469203233718872, -0.0741935670375824, 0.3767654597759247, -0.033087003976106644, -0.4210699200630188, 0.557004451751709, 0.01589982397854328, 0.5598986148834229, 0.6790618300437927, -0.0001210228365380317, 0.319460391998291, 0.19204756617546082, -0.022819962352514267, -0.5949908494949341, -0.3672429919242859, -0.08369473367929459, -0.2933976650238037, 0.28397178649902344, 0.01224660873413086, -0.048464447259902954, 0.2566486895084381, 0.19156980514526367, -0.3523445129394531, 0.5064058899879456, 0.08154444396495819, 0.13815253973007202, 0.47622254490852356, -0.21246200799942017, -0.3115672469139099, -0.20040041208267212, 0.0928904116153717, -0.19849002361297607, 0.2904176712036133, 0.44310298562049866, -0.08424855768680573, 0.14474748075008392, 0.01284949854016304, 0.0699043795466423, -0.0543178990483284, 0.3973308503627777, 0.15512263774871826, 0.1384592056274414, -0.11670693755149841, 0.041100483387708664, 0.3022214472293854, 0.20292814075946808, -0.1676187962293625, -0.38659974932670593, -0.07530395686626434, -0.0988345667719841, -0.03655402734875679, 0.549635648727417, 0.09249754250049591, -0.18282371759414673, 0.17717796564102173, -0.09289272874593735, 0.05051719397306442, -0.13711579144001007, 0.07656136155128479, -0.06199139356613159, 0.17224432528018951, -0.23679408431053162, 0.28204408288002014, 0.04912613332271576, 0.07533277571201324, -0.18906739354133606, -0.0015812870115041733, 0.10916656255722046, 0.2938317060470581, -0.5591482520103455, 0.1715516746044159, 0.04784931242465973, -0.11676399409770966, -0.0388418473303318, 0.041370511054992676, 0.438246488571167, 0.17245152592658997, 0.05723177269101143, 0.22710183262825012, 0.28411898016929626, 0.15640002489089966, 0.15904437005519867, -0.07133142650127411, 0.4906637668609619, 0.3394683301448822, -0.18505403399467468, 0.08072257786989212, -0.3255545198917389, -0.31334683299064636, 0.019845128059387207, -0.12044580280780792, 0.29609963297843933, -0.13785026967525482, -0.13373851776123047, 0.06194299831986427, 0.21059904992580414, -0.10291123390197754, 0.051519572734832764, 0.370747447013855, -0.0642695352435112, 0.13876843452453613, 0.005176514387130737, 0.3057611584663391, -0.17079651355743408, -0.1913357377052307, -0.054460152983665466, -0.13910093903541565, -0.19775930047035217, 0.11814375966787338, 0.4004371464252472, -0.440679669380188, -0.033863820135593414, 0.2448880821466446, -0.24004921317100525, -0.023071378469467163, -0.20685575902462006, -0.06776784360408783, -0.02928377315402031, 0.039173804223537445, 0.17227132618427277, 0.21790534257888794, 0.15744900703430176, -0.28020256757736206, -0.0990244448184967, 0.020903171971440315, -0.32449355721473694, -0.1479598581790924, -0.10780192166566849, 0.06200605630874634, -0.2508975565433502, -0.19984479248523712, -0.3495263457298279, 0.18636241555213928, -0.17812535166740417, -0.25880932807922363, -0.1512630730867386, -0.08963947743177414, -0.3104688823223114, -0.15856759250164032, 0.3214380741119385, 0.4887044131755829, -0.8925971388816833, -0.06452158838510513, 0.15410593152046204, -0.18128111958503723, -0.06892552971839905, 0.12913332879543304, -0.06393487751483917, 0.026727767661213875, -0.25918832421302795, -0.27593308687210083, 0.25225281715393066, -0.4841457009315491, -0.20346418023109436, 0.12894585728645325, -0.2225886583328247, 0.26642584800720215, 0.01458248496055603, -0.04639320820569992, 0.2040635645389557, 0.06868849694728851, 0.0526808425784111, 0.364643394947052, 0.1245531216263771, -0.07482880353927612, -0.23211634159088135, -0.40673989057540894, 0.006978301331400871, 0.2290681004524231, 0.33298274874687195, 0.11976874619722366, 0.08382716029882431, 0.07795147597789764, 0.28373757004737854, -0.03117569535970688, 0.09475161135196686, 0.09439462423324585, 0.07960410416126251, 0.11729128658771515, 0.060069624334573746, -0.2497178614139557, -0.3541313707828522, 0.5603570938110352, 0.11277508735656738, 0.09464189410209656, 0.09566885977983475, 0.02649994194507599, -0.17173755168914795, 0.007822483777999878, -0.37843599915504456, 0.08893515169620514, -0.010384857654571533, 0.19600176811218262, 0.14907053112983704, 0.008807390928268433, -0.3028869926929474, 0.44306063652038574, -0.3757512867450714, 0.2780187129974365, -0.24969319999217987, 0.43428224325180054, 0.01989322528243065, -0.20503701269626617, -0.29758328199386597, 0.14195773005485535, 0.12928622961044312, -0.20042908191680908, -0.06434666365385056, 0.4198800325393677, -0.0943974107503891, 0.013322897255420685, 0.07189124822616577, -0.0876830667257309, 0.156945139169693, -0.1704348623752594, 0.042106665670871735, 0.32437989115715027, 0.21402229368686676, 0.016983553767204285, -0.43890446424484253, 0.2879384458065033, -0.10976263135671616, 0.303413063287735, 0.2389213740825653, -0.04153407737612724, 0.17055904865264893, 0.09332993626594543, -0.09109316021203995, 0.22433601319789886, 0.033321525901556015, 0.07065640389919281, 0.18884697556495667, -0.050725750625133514, -0.23487362265586853, 0.01154402643442154, 0.32562655210494995, 0.01888633519411087, 0.074958935379982, 0.17277701199054718, -0.2484503984451294, -0.048929501324892044, 0.12679482996463776, -0.009704165160655975, 0.4235711693763733, 0.030431058257818222, -0.02161440998315811, 0.13493333756923676, -0.2410002052783966, 0.07876918464899063, 0.14033742249011993, -0.004625704139471054, -0.10543118417263031, 0.03091168962419033, 0.147050142288208, 0.1888338327407837, -0.2615675926208496, -0.06358080357313156, -0.05452454090118408, -0.002081172540783882, -0.606299877166748, 0.18754705786705017, -0.22521091997623444, 0.10017070174217224, -0.257399320602417, 0.3842862844467163, -0.30396273732185364, -0.015412729233503342, -0.247691810131073, 0.3112777769565582, 0.2627847194671631, 0.07822808623313904, -0.13673152029514313, 0.5442917346954346, 0.00416991114616394, -0.34053775668144226, 0.14592604339122772, -0.008254960179328918, -0.29135382175445557, -0.0979001522064209, 0.26029813289642334, -0.10040134936571121, -0.025650575757026672, -0.18279477953910828, -0.33290964365005493, -0.1908489465713501, -0.22812098264694214, 0.31431636214256287, 0.027351967990398407, 0.3919662535190582, -0.016537636518478394, 0.2178800106048584, -0.20968295633792877, -0.06849092245101929, 0.46641942858695984, -0.3457905054092407, -0.026631910353899002, 0.2674042582511902, -0.09524698555469513, -0.1517672836780548, -0.14659956097602844, -0.34603404998779297, -0.3146117031574249, -0.2582690417766571, 0.2833191454410553, 0.051050156354904175, 0.08201657235622406, 0.38622772693634033, 0.19394172728061676, 0.14100335538387299, 0.15778449177742004, 0.28249675035476685, -0.17730095982551575, -0.5161920189857483, 0.31114286184310913, -0.17544659972190857, -0.48638254404067993, 0.056837454438209534, 0.13116610050201416, -0.07215362042188644, -0.14239643514156342, -0.36472171545028687, -0.2915429174900055, -0.11590931564569473, 0.30441799759864807, 0.14209342002868652, 0.3699222207069397, 0.22428110241889954, -0.37986159324645996, 0.04500729590654373, -0.10196768492460251, -0.3954959809780121, 0.17979696393013, 0.22259482741355896, 0.19708853960037231, 0.17401188611984253, 0.13378673791885376, -0.06355243176221848, 0.7402514219284058, 0.1392086297273636, 0.009131338447332382, 0.3010854721069336, -0.14329390227794647, 0.5512164831161499, -0.15857753157615662, -0.4200511872768402, 0.048436276614665985, -0.31138738989830017, 0.06780199706554413, 0.23851843178272247, 0.2558785676956177, 0.11940329521894455, -0.20953764021396637, 0.11488670855760574, -0.019729316234588623, -0.37266385555267334, 0.05892552435398102, 0.21818402409553528, -0.09280052036046982, 0.14265942573547363, 0.3713115453720093, -0.3066765069961548, -0.22972172498703003, -0.02997485361993313, 0.6016691327095032, -0.11118130385875702, 0.1055602878332138, -0.4821939468383789, -0.020398512482643127, -0.2178453505039215, 0.25234606862068176, -0.1280057430267334, 0.5192941427230835, -0.06359027326107025, -0.14822742342948914, 0.06726504117250443, -0.058577511459589005, 0.4670063555240631, -0.13965269923210144, 0.231169193983078, 0.18927939236164093, -0.2126312404870987, -0.6241973042488098, -0.2868533432483673, 0.03658129274845123, 0.16334854066371918, 0.30433860421180725, 0.19517086446285248, -0.02281346172094345, -0.22937710583209991, 0.08488520979881287, 0.149187371134758, -0.16684815287590027, -0.06175811588764191, -0.47084298729896545, -0.15564954280853271, -0.1322503238916397, -0.09748032689094543, -0.20982258021831512, 0.21023336052894592, -0.07324522733688354, 0.029929399490356445, -0.03283163905143738, 0.0038906484842300415, 0.30107009410858154, 0.3249819576740265, 0.18624931573867798, 0.09971289336681366, 0.28688180446624756, 0.5028331279754639, 0.2541752755641937, -0.11806690692901611, 0.7573176026344299, -0.20954522490501404, -0.360295832157135, 0.4698302447795868, -0.2873768210411072, 0.22000303864479065, 0.7348065376281738, -0.21803483366966248, -0.05587095022201538, -0.07511536777019501, -0.008678779006004333, -0.3347473740577698, -0.13330313563346863, 0.27779293060302734, 0.1090473085641861, -0.103128582239151, -0.3253597915172577, 0.2712632417678833, 0.09879577159881592, -0.1669195145368576, 0.26113152503967285, 0.46487751603126526, -0.22950507700443268, 0.2826880216598511, -0.3630844056606293, 0.9493253231048584, -0.13952286541461945, 0.24023346602916718, 0.25189316272735596, 0.010058455169200897, 0.5706552267074585, -0.057045165449380875, 0.17542722821235657, -0.38542911410331726, -0.20731091499328613, -0.007870461791753769, -0.07695512473583221, 0.25961562991142273, 0.0436117984354496, -0.12926962971687317, 0.34555649757385254, -0.14923329651355743, 0.3446911871433258, 0.14582780003547668, 0.12131854891777039, -0.007241325452923775, -0.28776630759239197, -0.38073843717575073, 0.13488590717315674, 0.0759057104587555, 0.22083988785743713, -0.1847168207168579, 0.07366283982992172, -0.13761775195598602, -0.21778251230716705, -0.2598339021205902, 0.121075838804245, -0.18693377077579498, 0.20999479293823242, 0.2886773943901062, -0.0750427097082138, 0.1803591102361679, 0.30887606739997864, 0.3937128782272339, -0.09189657866954803, -0.10522232204675674, 0.07016856223344803, -0.16479739546775818, 0.3162638247013092, 0.043607357889413834, -0.0043571218848228455, 0.34596091508865356, 0.01902327686548233, -0.2126908302307129, -0.10200865566730499, -0.16813650727272034, -0.2333258092403412, -0.06843605637550354, 0.14720091223716736, 0.07450205832719803, -0.10817688703536987, -0.02236248552799225, -0.2618618309497833, 0.18321362137794495, -0.24528197944164276, 0.07089878618717194, -0.005779590457677841, -0.014841161668300629, 0.29088401794433594, 0.23184779286384583, -0.25399574637413025, 0.1208840012550354, 0.5860558748245239, -0.4110561013221741, -0.0443514920771122, 0.3037693202495575, 0.33581027388572693, -0.0791114941239357, -0.12298053503036499, 0.18990062177181244, 0.19132718443870544, -0.3738479018211365, -0.04563632234930992, -0.13354608416557312, -0.10474548488855362, 0.011081509292125702, 0.37020906805992126, 0.2650321424007416, -0.21254149079322815, -0.06616092473268509, -0.39571598172187805, -0.09025872498750687, 0.038384102284908295, 0.26811832189559937, -0.08569680154323578, 0.08489954471588135, -0.1317765712738037, 0.03434402495622635, -0.13469883799552917, -0.21478107571601868, 0.14445725083351135, -0.0794915035367012, -0.13311558961868286, -0.006311304867267609, 0.05803682282567024, 0.3264472186565399, -0.2989581227302551, -0.03346496447920799, -0.12908630073070526, -0.21446821093559265, -0.1037759780883789, -0.29491084814071655, 0.20029740035533905, -0.048851385712623596, -0.2746531665325165, 0.01283605769276619, -0.226913720369339, -0.10330434888601303, -0.19610971212387085, 0.206145241856575, 0.34083062410354614, -0.11415183544158936, 0.05327785760164261, -0.2096601128578186, 0.2687491178512573, -0.06559576094150543, 0.24392376840114594, 0.07811751961708069, 0.5314978361129761, 0.1356160044670105, 0.14119504392147064, -0.1364295482635498, 0.013509392738342285, -0.1843648999929428, 0.26367485523223877, 0.12973830103874207, 0.17474906146526337, 0.24744445085525513, -0.42346900701522827, 0.07250145822763443, -0.12539348006248474, 0.27138054370880127, 0.48677560687065125, -0.2037898600101471, 0.11874300986528397, -0.1188793033361435, 0.09794008731842041, -0.07161062210798264, -0.02018638700246811, 0.4457649886608124, 0.03514794632792473, 0.025273263454437256, 0.38678210973739624, 0.3260350227355957, -0.10069382935762405, -0.022904109209775925, 0.04260066896677017, 0.6034572124481201, 0.16926823556423187, 0.254253089427948, 0.38335081934928894, 0.11691492050886154, 0.2531002163887024, 0.06164417415857315, -0.003129546530544758, -0.1880972683429718, 0.29318639636039734, -0.4176998734474182, 0.11253084242343903, -0.09259776771068573, 0.23958690464496613, 0.19084832072257996, -0.390809029340744, 0.2702961266040802, -0.00531507283449173, -0.051348984241485596, -0.16111981868743896, -0.26826485991477966, 0.750323474407196, -0.7150769829750061, -0.27027660608291626, -0.394611120223999, -0.23514556884765625, -0.09990640729665756, -0.1325681209564209, -0.45462530851364136, -0.35253670811653137, -0.1825086623430252, -0.010656028985977173, -0.04414257034659386, -0.2744562029838562, 0.17849087715148926, 0.07817290723323822, 0.10156922042369843, -0.4838523268699646, -0.2447459101676941, 0.11818640679121017, 0.0549306720495224, -0.026335686445236206, 0.28480473160743713, 0.05296532064676285, 0.04227060079574585, 0.32201579213142395, 0.15889863669872284, 0.48921632766723633, 0.3806150257587433, -0.013624193146824837, 0.14012080430984497, -0.016163010150194168, 0.05051508545875549, -0.08911722153425217, 0.08869316428899765, -0.12157834321260452, -0.11997172236442566, 0.31333377957344055, 0.06726832687854767, -0.0003733336925506592, 0.015772851184010506, -0.06606893241405487, 0.10807982087135315, -0.38891690969467163, 0.32240748405456543, -0.21258693933486938, 0.1513463258743286, -0.10171964019536972, -0.14406871795654297, -0.23503360152244568, 0.03832613676786423, 0.3023303747177124, 0.17393237352371216, 0.2953106760978699, -0.20174603164196014, 0.02310846745967865, 0.13260319828987122, 0.3655557632446289, 0.21514639258384705, -0.093051478266716, -0.15264928340911865, 0.10338887572288513, -0.800451397895813, 0.08319664746522903, -0.03667757287621498, -0.10383974015712738, 0.0376410037279129, 0.3182642459869385, -0.018703658133745193, 0.12810255587100983, 0.24621066451072693, -0.3994327485561371, -0.0029448233544826508, 0.18351784348487854, -0.4184074103832245, -0.10557736456394196, 0.06708413362503052, 0.15961164236068726, -0.110524982213974, -0.5389386415481567, 0.13119319081306458, -0.274687260389328, -0.17108295857906342, 0.14419867098331451, -0.10790185630321503, -0.05757269635796547, -0.4503699839115143, 0.4905502200126648, -0.17339469492435455, 0.518882691860199, 0.20772641897201538, -0.1623561829328537, -0.521658718585968, -0.15921270847320557, -0.26889681816101074, 0.217099130153656, -0.1718437671661377, 0.39271682500839233, -0.2430802285671234, -0.31196242570877075, -0.2933335304260254, 0.17597812414169312, 0.05591805279254913, 0.029486075043678284, -0.41781726479530334, 0.11092809587717056, -0.16157859563827515, 0.37656429409980774, 0.05545983463525772, 0.12188969552516937, -0.2540286183357239, 0.21134725213050842, -0.4003651738166809, -0.2576863765716553, 0.3753301501274109, -0.5265454053878784, -0.32685238122940063, -0.558539628982544, 0.26272308826446533, 0.11405417323112488, 0.10718483477830887, -0.3272414803504944, -0.08167390525341034, 0.10481144487857819, -0.22096547484397888, -0.12386032938957214, 0.047143932431936264, -0.34253862500190735, 0.17666789889335632, -0.14542840421199799, -0.22724264860153198, -0.09726697206497192, -0.1753484606742859, 0.014702357351779938, -0.2643551826477051 ]
https://github.com/huggingface/datasets/issues/5766
Hi ! Interesting :) What kind of new types would you like to use ? Note that you can already implement your own decoding by using `set_transform` that can decode data on-the-fly when rows are accessed
Support custom feature types
### Feature request I think it would be nice to allow registering custom feature types with the 🤗 Datasets library. For example, allow to do something along the following lines: ``` from datasets.features import register_feature_type # this would be a new function @register_feature_type class CustomFeatureType: def encode_example(self, value): """User-provided logic to encode an example of this feature.""" pass def decode_example(self, value, token_per_repo_id=None): """User-provided logic to decode an example of this feature.""" pass ``` ### Motivation Users of 🤗 Datasets, such as myself, may want to use the library to load datasets with unsupported feature types (i.e., beyond `ClassLabel`, `Image`, or `Audio`). This would be useful for prototyping new feature types and for feature types that aren't used widely enough to warrant inclusion in 🤗 Datasets. At the moment, this is only possible by monkey-patching 🤗 Datasets, which obfuscates the code and is prone to breaking with library updates. It also requires the user to write some custom code which could be easily avoided. ### Your contribution I would be happy to contribute this feature. My proposed solution would involve changing the following call to `globals()` to an explicit feature type registry, which a user-facing `register_feature_type` decorator could update. https://github.com/huggingface/datasets/blob/fd893098627230cc734f6009ad04cf885c979ac4/src/datasets/features/features.py#L1329 I would also provide an abstract base class for custom feature types which users could inherit. This would have at least an `encode_example` method and a `decode_example` method, similar to `Image` or `Audio`. The existing `encode_nested_example` and `decode_nested_example` functions would also need to be updated to correctly call the corresponding functions for the new type.
36
Support custom feature types ### Feature request I think it would be nice to allow registering custom feature types with the 🤗 Datasets library. For example, allow to do something along the following lines: ``` from datasets.features import register_feature_type # this would be a new function @register_feature_type class CustomFeatureType: def encode_example(self, value): """User-provided logic to encode an example of this feature.""" pass def decode_example(self, value, token_per_repo_id=None): """User-provided logic to decode an example of this feature.""" pass ``` ### Motivation Users of 🤗 Datasets, such as myself, may want to use the library to load datasets with unsupported feature types (i.e., beyond `ClassLabel`, `Image`, or `Audio`). This would be useful for prototyping new feature types and for feature types that aren't used widely enough to warrant inclusion in 🤗 Datasets. At the moment, this is only possible by monkey-patching 🤗 Datasets, which obfuscates the code and is prone to breaking with library updates. It also requires the user to write some custom code which could be easily avoided. ### Your contribution I would be happy to contribute this feature. My proposed solution would involve changing the following call to `globals()` to an explicit feature type registry, which a user-facing `register_feature_type` decorator could update. https://github.com/huggingface/datasets/blob/fd893098627230cc734f6009ad04cf885c979ac4/src/datasets/features/features.py#L1329 I would also provide an abstract base class for custom feature types which users could inherit. This would have at least an `encode_example` method and a `decode_example` method, similar to `Image` or `Audio`. The existing `encode_nested_example` and `decode_nested_example` functions would also need to be updated to correctly call the corresponding functions for the new type. Hi ! Interesting :) What kind of new types would you like to use ? Note that you can already implement your own decoding by using `set_transform` that can decode data on-the-fly when rows are accessed
[ -0.1076527014374733, 0.13263635337352753, -0.09200724959373474, 0.027213267982006073, 0.21942318975925446, 0.03645549714565277, 0.31180626153945923, 0.30888277292251587, 0.09450874477624893, 0.01722479984164238, 0.0015231668949127197, 0.34734398126602173, -0.4834030568599701, 0.696212649345398, -0.07972054183483124, -0.2066914439201355, 0.0019803792238235474, 0.16671207547187805, 0.10838210582733154, 0.07705648243427277, -0.14063894748687744, -0.06067848950624466, 0.06476987898349762, 0.1311740130186081, -0.07785777747631073, 0.2114889919757843, 0.005993492901325226, -0.14015907049179077, -0.30598825216293335, -0.5248643159866333, 0.22557416558265686, 0.41954201459884644, 0.28255534172058105, 0.41044706106185913, -0.00010581353853922337, 0.08620335161685944, 0.15528690814971924, 0.07166023552417755, -0.1377582848072052, -0.02231535315513611, -0.020103581249713898, -0.5308154225349426, -0.015367008745670319, -0.11838498711585999, -0.19294804334640503, -0.3921052813529968, -0.11473986506462097, -0.368420273065567, -0.05918460339307785, 0.0328945554792881, 0.22058100998401642, -0.16804304718971252, 0.045367807149887085, 0.22557289898395538, 0.2857115566730499, 0.7525100708007812, -0.5625362396240234, -0.25180065631866455, 0.2934107184410095, -0.005738545209169388, 0.3110293745994568, 0.14237822592258453, -0.048020560294389725, -0.28226977586746216, 0.44083520770072937, -0.001497659832239151, -0.2786045968532562, -0.39653003215789795, -0.24834173917770386, 0.43936267495155334, 0.5089689493179321, -0.1651385873556137, -0.4419757127761841, -0.4907175600528717, 0.04198341444134712, -0.4821106791496277, -0.03256852179765701, -0.04926430806517601, 0.014809221029281616, 0.24059933423995972, -0.027560625225305557, -0.23434126377105713, -0.1863531470298767, 0.16556140780448914, 0.08064441382884979, -0.09766273200511932, -0.05533651262521744, -0.03959918022155762, 0.033229123800992966, -0.2917993664741516, 0.07306764274835587, -0.15064890682697296, 0.05464674159884453, 0.2469271421432495, -0.02370215207338333, -0.2321109175682068, 0.14752739667892456, -0.1609053909778595, 0.3579314649105072, 0.28592029213905334, -0.054799310863018036, 0.33897149562835693, -0.698818027973175, 0.13769708573818207, 0.03736211732029915, -0.16617539525032043, 0.04516783729195595, -0.15549154579639435, 0.42008861899375916, 0.12642189860343933, 0.013886548578739166, 0.02074553817510605, -0.11196330934762955, 0.06461091339588165, 0.10185573995113373, 0.11114466935396194, 0.33440592885017395, -0.035763949155807495, 0.31375521421432495, -0.057954564690589905, 0.013744592666625977, 0.06057734414935112, 0.29364708065986633, 0.041193824261426926, 0.013870790600776672, 0.27065467834472656, 0.021709047257900238, 0.0803825780749321, 0.05977170169353485, -0.20343302190303802, 0.08449826389551163, -0.08044897019863129, -0.12191969901323318, 0.13586023449897766, 0.24875852465629578, -0.11854918301105499, -0.036681197583675385, 0.09895619750022888, 0.314748615026474, 0.0458068773150444, 0.11999312788248062, 0.07171683013439178, -0.07628798484802246, -0.13856270909309387, -0.5979355573654175, -0.10683538764715195, 0.12194505333900452, -0.10544607788324356, -0.31458204984664917, 0.1104457825422287, -0.06964102387428284, -0.2919353246688843, -0.2762387692928314, 0.16533032059669495, -0.3478650450706482, -0.017671510577201843, -0.32709386944770813, 0.5207053422927856, -0.038433294743299484, -0.0688723623752594, 0.1095617413520813, -0.13227564096450806, -0.14159470796585083, -0.38090750575065613, 0.08025206625461578, 0.2072216272354126, -0.3382036089897156, -0.10064813494682312, -0.13190588355064392, -0.14545458555221558, 0.05956597626209259, 0.07698533684015274, -0.19800758361816406, -0.11454968899488449, -0.21668735146522522, 0.13578087091445923, 0.3735731840133667, -0.18737512826919556, 0.01764119789004326, -0.07916942983865738, 0.26414281129837036, 0.36070573329925537, 0.06763941049575806, 0.1638939529657364, 0.032831888645887375, -0.08809107542037964, -0.22973620891571045, 0.35096651315689087, -0.2322615087032318, -0.11526881158351898, -0.028148911893367767, -0.36519932746887207, 0.38395410776138306, 0.16866165399551392, 0.029772639274597168, 0.03883051872253418, 0.2177366018295288, -0.24803850054740906, 0.1087108924984932, -0.33239471912384033, -0.15350529551506042, -0.26427024602890015, 0.49856603145599365, 0.4623991549015045, 0.12880496680736542, -0.3541485667228699, -0.11846810579299927, 0.3831835687160492, -0.05530175194144249, 0.28549569845199585, -0.09837792068719864, -0.33048510551452637, 0.04560389742255211, 0.04327552765607834, -0.22578635811805725, 0.05147203058004379, 0.1807713359594345, 0.04524419829249382, -0.2310948371887207, 0.18882226943969727, -0.4439060091972351, -0.04662981629371643, -0.08820498734712601, 0.05204608663916588, -0.2060180902481079, 0.10221252590417862, 0.2695017457008362, 0.07672448456287384, -0.3151334822177887, 0.5196148157119751, 0.05278078839182854, -0.08503159880638123, -0.07982851564884186, 0.1531664878129959, 0.1564016491174698, 0.15453991293907166, -0.19391563534736633, 0.5270312428474426, 0.2104431539773941, -0.22175100445747375, 0.12349798530340195, 0.06797494739294052, 0.13371223211288452, 0.00948864221572876, -0.05745849758386612, 0.7181521654129028, 0.38951000571250916, 0.04559905827045441, -0.09328670054674149, -0.03053426370024681, 0.06130700558423996, 0.06278420984745026, -0.18998056650161743, -0.10784290730953217, -0.24290047585964203, -0.08462448418140411, -0.36545607447624207, -0.00515552144497633, -0.27243977785110474, 0.11472843587398529, 0.41656914353370667, -0.0064346566796302795, 0.21810287237167358, 0.02960362657904625, -0.17738769948482513, 0.09528765827417374, 0.158341184258461, -0.031899988651275635, 0.32516583800315857, 0.1513616144657135, -0.04843567684292793, -0.08684653043746948, 0.12660002708435059, 0.11400294303894043, 0.22967392206192017, -0.021824337542057037, -0.21695227921009064, -0.036117080599069595, 0.3008016347885132, 0.10105562210083008, -0.11315255612134933, -0.33999770879745483, -0.16675515472888947, -0.14449542760849, -0.1525907814502716, -0.1270233541727066, -0.3776000440120697, -0.2530823051929474, 0.025560550391674042, -0.11562950909137726, -0.11053887009620667, -0.11495968699455261, 0.025557734072208405, -0.10420127958059311, -0.010621950030326843, 0.05408560484647751, -0.37013107538223267, 0.4638836979866028, -0.243577241897583, -0.3788194954395294, -0.014004342257976532, 0.24472099542617798, -0.22421124577522278, 0.12481924146413803, 0.28098544478416443, -0.09899832308292389, 0.39194822311401367, 0.5321497917175293, 0.013711102306842804, -0.30499905347824097, -0.6873888969421387, -0.012819275259971619, -0.050749849528074265, 0.13109898567199707, 0.3248087465763092, -0.2527941167354584, 0.2866742014884949, -0.01108543947339058, 0.1980375051498413, 0.1057732030749321, 0.015879549086093903, -0.05325803905725479, -0.05178689584136009, 0.07904572784900665, -0.3659769892692566, -0.20398572087287903, -0.30007925629615784, -0.42251062393188477, 0.39402610063552856, 0.19365164637565613, 0.14616525173187256, 0.4599074423313141, 0.059469472616910934, 0.0943339616060257, 0.404392272233963, 0.03625887632369995, -0.08891550451517105, -0.09021931886672974, 0.39303821325302124, -0.3254890441894531, -0.015089612454175949, 0.0752895176410675, -0.14168015122413635, -0.16239579021930695, 0.15231835842132568, -0.16426421701908112, -0.22541052103042603, -0.3072252869606018, 0.5175256133079529, 0.06810135394334793, 0.01838229037821293, -0.05268998444080353, 0.38577085733413696, 0.03659968078136444, -0.08574485033750534, -0.26471006870269775, -0.07731059193611145, 0.049379535019397736, 0.058957163244485855, 0.32254910469055176, 0.2420291155576706, 0.1592528522014618, 0.4533415734767914, -0.06659706681966782, -0.17743763327598572, 0.40687862038612366, -0.04752185940742493, 0.19635824859142303, -0.04799326881766319, -0.23514436185359955, 0.1184697151184082, -0.14334096014499664, 0.08566215634346008, -0.053785234689712524, 0.19579605758190155, -0.10375471413135529, -0.10561837255954742, 0.047603756189346313, 0.22803935408592224, -0.20503273606300354, 0.084771066904068, -0.1204100102186203, 0.3161053955554962, -0.42049431800842285, -0.20739486813545227, -0.28481873869895935, 0.02826850116252899, 0.2011672705411911, 0.5010197162628174, 0.2571595311164856, -0.014045320451259613, -0.5659680366516113, -0.15028822422027588, -0.031171325594186783, 0.2556341290473938, 0.1380566656589508, 0.0006391257047653198, -0.06007395312190056, 0.042725905776023865, -0.15169019997119904, 0.16636817157268524, -0.06337255239486694, -0.47692662477493286, -0.46600839495658875, 0.05648462474346161, 0.05617403984069824, 0.2545221447944641, -0.22009162604808807, 0.24586138129234314, 0.060330651700496674, -0.20687058568000793, 0.17005330324172974, -0.1079004779458046, -0.18262368440628052, 0.17220091819763184, 0.2063654214143753, -0.08771077543497086, -0.017595656216144562, 0.09001246094703674, -0.3272123336791992, -0.24957211315631866, -0.2815117835998535, 0.2046031802892685, -0.01385510340332985, -0.25076383352279663, -0.33063217997550964, -0.36894112825393677, 0.05819125473499298, 0.5786782503128052, 0.20256859064102173, -0.039861101657152176, -0.010350704193115234, -0.07357166707515717, -0.36704573035240173, -0.22295674681663513, 0.15436634421348572, 0.5703848600387573, -0.01582084782421589, -0.6013302206993103, -0.1863432377576828, -0.032021813094615936, 0.37828463315963745, 0.1709398627281189, -0.23798803985118866, 0.413729190826416, -0.15225748717784882, -0.14787545800209045, -0.3571428656578064, 0.13580355048179626, 0.21469172835350037, -0.10318015515804291, -0.30982574820518494, -0.730076014995575, 0.5177854299545288, -0.07390624284744263, -0.010292217135429382, -0.11970391869544983, 0.2620570659637451, -0.3214454650878906, 0.24720844626426697, 0.10428701341152191, 0.7223141193389893, 0.04331185668706894, -0.10370044410228729, 0.12830211222171783, -0.07172475755214691, 0.6297343969345093, -0.14796490967273712, -0.053440582007169724, -0.20231981575489044, -0.08092444390058517, -0.13506443798542023, -0.005150273442268372, 0.4653603434562683, -0.07764981687068939, -0.21337977051734924, -0.016431938856840134, -0.17296576499938965, 0.09223295748233795, 0.11715209484100342, 0.23339179158210754, -0.1166483610868454, -0.3351123332977295, 0.013639487326145172, 0.2593494951725006, -0.020530808717012405, -0.04723351076245308, 0.022202961146831512, -0.31564491987228394, -0.02986600250005722, 0.12727396190166473, -0.5208280086517334, -0.15308628976345062, -0.1497550904750824, 0.05276555195450783, 0.10379896312952042, -0.036633968353271484, 0.6145835518836975, 0.17419397830963135, 0.4614090621471405, 0.24369172751903534, -0.15375716984272003, -0.1218966692686081, 0.14100852608680725, 0.07804813981056213, -0.16556957364082336, -0.06570016592741013, 0.441995769739151, -0.012040160596370697, -0.1656942069530487, 0.06164960190653801, 0.1258987933397293, -0.1962144672870636, -0.24732407927513123, -0.07341834902763367, 0.20753443241119385, -0.39152273535728455, -0.1451469212770462, -0.15705692768096924, 0.026266083121299744, -0.05977853387594223, 0.16349931061267853, 0.3598349690437317, -0.12823474407196045, 0.1620413213968277, -0.07699903845787048, 0.17600798606872559, 0.042765699326992035, -0.4924415647983551, 0.07943085581064224, -0.10627638548612595, 0.21195970475673676, 0.08775752782821655, 0.038401201367378235, -0.10123863071203232, 0.1773679256439209, 0.16689640283584595, -0.027127735316753387, 0.043398331850767136, 0.1972278207540512, -0.318256676197052, 0.12253662943840027, 0.1710999608039856, -0.09466925263404846, -0.2224438488483429, -0.07312055677175522, -0.1314225196838379, -0.27387338876724243, 0.06391526758670807, -0.2129381000995636, 0.44344210624694824, -0.19816315174102783, 0.23000556230545044, -0.09441079199314117, -0.11894598603248596, -0.3847714066505432, 0.06289245933294296, 0.10000356286764145, -0.09362645447254181, 0.2434360831975937, 0.28508618474006653, -0.10527152568101883, -0.021810054779052734, 0.11720789223909378, 0.12204733490943909, -0.24136394262313843, -0.13851702213287354, -0.3242616653442383, 0.15624971687793732, 0.1046774685382843, 0.1687740683555603, -0.014397557824850082, 0.06635397672653198, -0.15760771930217743, -0.11686822772026062, -0.023198727518320084, 0.035231880843639374, -0.19688279926776886, 0.3097085952758789, -0.10776515305042267, 0.1437719166278839, 0.0633329525589943, 0.24213957786560059, -0.04729635640978813, 0.24664506316184998, 0.41129404306411743, 0.047640737146139145, -0.11778151988983154, -0.05567985028028488, -0.0603991337120533, 0.14402851462364197, 0.1828240603208542, 0.0651729479432106, 0.40273064374923706, 0.09705191850662231, 0.04552117735147476, 0.27150580286979675, -0.010866258293390274, 0.22383162379264832, -0.17304016649723053, 0.28556710481643677, 0.36011844873428345, 0.20396645367145538, -0.09903137385845184, -0.0628134086728096, 0.1835775226354599, -0.18569497764110565, 0.10236172378063202, 0.5753690004348755, 0.5248794555664062, 0.3540961444377899, -0.06757161021232605, -0.1923142522573471, 0.05077046900987625, -0.08838480710983276, 0.3919104337692261, 0.319661021232605, -0.08202765882015228, -0.05302906408905983, 0.10450954735279083, 0.011001115664839745, 0.23844338953495026, 0.2840428650379181, -0.13874217867851257, 0.15403197705745697, 0.23108726739883423, -0.14792051911354065, 0.5209406614303589, -0.3047592043876648, 0.2593350410461426, 0.08581116050481796, 0.21426111459732056, 0.4123449921607971, 0.19120554625988007, 0.2678784728050232, -0.3254777193069458, -0.19346857070922852, 0.046517595648765564, 0.14742890000343323, 0.2151697725057602, -0.12625384330749512, 0.2546118199825287, -0.11687830090522766, -0.5056173801422119, -0.29061317443847656, -0.059668757021427155, -0.24031655490398407, -0.07724570482969284, -0.08583513647317886, 0.12687990069389343, -0.22093519568443298, 0.12568669021129608, 0.08011972904205322, 0.5532801747322083, 0.0025933831930160522, -0.23624160885810852, -0.009136173874139786, -0.1768304705619812, 0.09626602381467819, 0.14839398860931396, 0.08563554286956787, 0.3636062741279602, -0.12692959606647491, 0.04553532972931862, -0.33829808235168457, 0.13614438474178314, -0.008795518428087234, -0.0416828952729702, -0.02748781070113182, 0.20161058008670807, 0.07838572561740875, 0.15105167031288147, -0.015299038961529732, 0.01985468529164791, -0.3635704815387726, -0.07168039679527283, -0.6429140567779541, 0.46652600169181824, 0.12495401501655579, 0.02721056342124939, -0.10496856272220612, -0.014069851487874985, -0.08053138107061386, -0.6293749213218689, 0.6866692304611206, 0.2959456741809845, 0.08929169178009033, -0.1794535368680954, 0.11677925288677216, 0.011991489678621292, 0.008603975176811218, 0.0789838507771492, 0.12076886743307114, 0.201786071062088, 0.2662956714630127, -0.3828166425228119, -0.05792342126369476, 0.20374688506126404, -0.41139155626296997, 0.16424107551574707, -0.08094853907823563, 0.19128690659999847, 0.1138475239276886, -0.14271734654903412, -0.417887806892395, 0.5415822863578796, 0.04565570130944252, -0.20649230480194092, -0.2771368622779846, -0.06431302428245544, 0.03288281708955765, 0.019565962255001068, -0.07268868386745453, -0.004020487889647484, 0.08833426237106323, 0.0627000629901886, -0.14367914199829102, -0.12797911465168, -0.028891671448946, -0.1919250190258026, 0.7551748156547546, 0.3350389003753662, 0.10715261101722717, 0.008989565074443817, -0.2506028711795807, -0.1420230120420456, 0.06582961231470108, -0.3196845054626465, 0.23333004117012024, -0.12965916097164154, 0.4162331819534302, -0.13800086081027985, 0.15693438053131104, -0.28637853264808655, 0.2331673800945282, 0.19722242653369904, -0.34304293990135193, -0.26064062118530273, 0.12745492160320282, -0.12463842332363129, -0.14492039382457733, 0.08588527143001556, 0.172153502702713, -0.013269836083054543, 0.11696413904428482, -0.11868605017662048, -0.29192960262298584, 0.3508213758468628, -0.02086174488067627, -0.276547908782959, 0.16428697109222412, 0.04796851426362991, 0.11910136044025421, 0.1908809393644333, -0.9107921123504639, -0.238281711935997, 0.2309650331735611, 0.053967226296663284, 0.17667719721794128, 0.2747696042060852, 0.06710994988679886, -0.2638445794582367, -0.18496467173099518, 0.14941862225532532, -0.2140285074710846, 0.3172934651374817, 0.0966925323009491, -0.14843128621578217 ]
https://github.com/huggingface/datasets/issues/5766
An interesting proposal indeed. Pandas and Polars have the "extension API", so doing something similar on our side could be useful, too. However, this requires defining a common interface for the existing feature types before discussing the API/workflow for defining/sharing custom feature types, and this could take some time. It would also be nice if the datasets viewer could render these custom types.
Support custom feature types
### Feature request I think it would be nice to allow registering custom feature types with the 🤗 Datasets library. For example, allow to do something along the following lines: ``` from datasets.features import register_feature_type # this would be a new function @register_feature_type class CustomFeatureType: def encode_example(self, value): """User-provided logic to encode an example of this feature.""" pass def decode_example(self, value, token_per_repo_id=None): """User-provided logic to decode an example of this feature.""" pass ``` ### Motivation Users of 🤗 Datasets, such as myself, may want to use the library to load datasets with unsupported feature types (i.e., beyond `ClassLabel`, `Image`, or `Audio`). This would be useful for prototyping new feature types and for feature types that aren't used widely enough to warrant inclusion in 🤗 Datasets. At the moment, this is only possible by monkey-patching 🤗 Datasets, which obfuscates the code and is prone to breaking with library updates. It also requires the user to write some custom code which could be easily avoided. ### Your contribution I would be happy to contribute this feature. My proposed solution would involve changing the following call to `globals()` to an explicit feature type registry, which a user-facing `register_feature_type` decorator could update. https://github.com/huggingface/datasets/blob/fd893098627230cc734f6009ad04cf885c979ac4/src/datasets/features/features.py#L1329 I would also provide an abstract base class for custom feature types which users could inherit. This would have at least an `encode_example` method and a `decode_example` method, similar to `Image` or `Audio`. The existing `encode_nested_example` and `decode_nested_example` functions would also need to be updated to correctly call the corresponding functions for the new type.
63
Support custom feature types ### Feature request I think it would be nice to allow registering custom feature types with the 🤗 Datasets library. For example, allow to do something along the following lines: ``` from datasets.features import register_feature_type # this would be a new function @register_feature_type class CustomFeatureType: def encode_example(self, value): """User-provided logic to encode an example of this feature.""" pass def decode_example(self, value, token_per_repo_id=None): """User-provided logic to decode an example of this feature.""" pass ``` ### Motivation Users of 🤗 Datasets, such as myself, may want to use the library to load datasets with unsupported feature types (i.e., beyond `ClassLabel`, `Image`, or `Audio`). This would be useful for prototyping new feature types and for feature types that aren't used widely enough to warrant inclusion in 🤗 Datasets. At the moment, this is only possible by monkey-patching 🤗 Datasets, which obfuscates the code and is prone to breaking with library updates. It also requires the user to write some custom code which could be easily avoided. ### Your contribution I would be happy to contribute this feature. My proposed solution would involve changing the following call to `globals()` to an explicit feature type registry, which a user-facing `register_feature_type` decorator could update. https://github.com/huggingface/datasets/blob/fd893098627230cc734f6009ad04cf885c979ac4/src/datasets/features/features.py#L1329 I would also provide an abstract base class for custom feature types which users could inherit. This would have at least an `encode_example` method and a `decode_example` method, similar to `Image` or `Audio`. The existing `encode_nested_example` and `decode_nested_example` functions would also need to be updated to correctly call the corresponding functions for the new type. An interesting proposal indeed. Pandas and Polars have the "extension API", so doing something similar on our side could be useful, too. However, this requires defining a common interface for the existing feature types before discussing the API/workflow for defining/sharing custom feature types, and this could take some time. It would also be nice if the datasets viewer could render these custom types.
[ -0.10012442618608475, 0.10153527557849884, -0.09084055572748184, 0.03676633536815643, 0.31600290536880493, 0.04664631187915802, 0.39689522981643677, 0.3054334223270416, 0.15716344118118286, 0.01747256889939308, -0.0819954052567482, 0.42595556378364563, -0.3231666684150696, 0.7607666850090027, -0.1492374986410141, -0.38486790657043457, 0.01975661888718605, 0.22185805439949036, -0.03631754219532013, 0.07453876733779907, -0.21652138233184814, -0.03715095669031143, 0.0936746597290039, 0.1817876547574997, -0.04614628106355667, 0.09249881654977798, -0.11594490706920624, -0.13576975464820862, -0.2612971365451813, -0.4622446298599243, 0.27961885929107666, 0.3833203911781311, 0.31206464767456055, 0.42393070459365845, -0.00010511708387639374, 0.005319342017173767, 0.19828356802463531, 0.11312032490968704, -0.09165918081998825, -0.04008682072162628, 0.11325087398290634, -0.43357348442077637, 0.08011270314455032, -0.16405732929706573, -0.10938432067632675, -0.5342367887496948, -0.06361351907253265, -0.36038634181022644, -0.03418288752436638, -0.04842803627252579, 0.24042469263076782, -0.04866795986890793, 0.0771796926856041, 0.2550719976425171, 0.2159314602613449, 0.7151755690574646, -0.49091464281082153, -0.2288234978914261, 0.20856326818466187, -0.10033005475997925, 0.22436118125915527, 0.13062945008277893, 0.06076031178236008, -0.18573316931724548, 0.3823525011539459, 0.060750674456357956, -0.1695624589920044, -0.47767263650894165, -0.2782053053379059, 0.5538994669914246, 0.45247140526771545, -0.16155579686164856, -0.5483002066612244, -0.4580923318862915, -0.022861506789922714, -0.4322819709777832, 0.019979240372776985, -0.014735836535692215, 0.06549045443534851, 0.22511032223701477, 0.2228851169347763, -0.12787596881389618, -0.19198507070541382, 0.192269966006279, 0.004047997295856476, 0.03408963605761528, -0.03987642377614975, -0.010395240038633347, -0.024182675406336784, -0.3710795044898987, 0.23696063458919525, -0.13363566994667053, 0.07173926383256912, 0.2494250237941742, -0.08498404175043106, -0.23536816239356995, 0.13441231846809387, -0.2580975592136383, 0.23831748962402344, 0.3872814178466797, -0.0029266271740198135, 0.32345613837242126, -0.7289905548095703, 0.1651957631111145, 0.1753387153148651, -0.12841740250587463, -0.04374641552567482, -0.019852519035339355, 0.4746972322463989, 0.12981286644935608, 0.059182316064834595, -0.04111568257212639, -0.01870407909154892, 0.07554110884666443, 0.042219653725624084, 0.04956529662013054, 0.33913755416870117, -0.04513685405254364, 0.26505911350250244, -0.06769479066133499, 0.024278081953525543, 0.036130547523498535, 0.24432778358459473, 0.07978922873735428, -0.02503361739218235, 0.4361412227153778, 0.04308362305164337, 0.08392727375030518, 0.08817891031503677, 0.01630653440952301, 0.06654086709022522, 0.07075291872024536, -0.07618291676044464, 0.028034567832946777, 0.23487210273742676, -0.0881035178899765, 0.029754579067230225, 0.019775528460741043, 0.3374110758304596, 0.08975709974765778, 0.1052413210272789, 0.0007389411330223083, -0.0613006092607975, -0.06691273301839828, -0.5546378493309021, -0.13309115171432495, 0.07952437549829483, -0.08007703721523285, -0.35073691606521606, 0.040642522275447845, 0.07124044001102448, -0.1333879828453064, -0.27358385920524597, 0.1465873271226883, -0.3066138029098511, 0.0028700856491923332, -0.1963137984275818, 0.49165818095207214, -0.08699849992990494, -0.038252104073762894, 0.11577356606721878, -0.12181588262319565, -0.07205887883901596, -0.3228902816772461, 0.035284459590911865, 0.28547316789627075, -0.3514033555984497, -0.09126308560371399, -0.09125411510467529, -0.08030000329017639, 0.16540203988552094, 0.2103751003742218, -0.169808030128479, -0.17017154395580292, -0.1224910169839859, 0.03854440152645111, 0.3456152677536011, -0.22566109895706177, 0.007405098527669907, -0.005002584308385849, 0.20630306005477905, 0.32536405324935913, 0.06458383798599243, 0.29164043068885803, -0.011874929070472717, -0.08679226040840149, -0.16989265382289886, 0.41687697172164917, -0.2525402903556824, -0.07420355081558228, -0.04753356799483299, -0.43001890182495117, 0.4043612480163574, 0.19931524991989136, 0.13035064935684204, 0.037920497357845306, 0.2651567757129669, -0.2660965323448181, 0.06284129619598389, -0.35795512795448303, -0.10718833655118942, -0.25170043110847473, 0.5427811145782471, 0.4813459813594818, 0.11254237592220306, -0.3341221213340759, -0.11479386687278748, 0.33035361766815186, -0.1829034835100174, 0.249349445104599, -0.07383602857589722, -0.31747329235076904, 0.03950370103120804, -0.058064233511686325, -0.13025036454200745, 0.03711060807108879, 0.17054426670074463, 0.04354085773229599, -0.2102651745080948, 0.2637660503387451, -0.46479135751724243, 0.09593156725168228, -0.18725182116031647, 0.06036307290196419, -0.17600801587104797, 0.0988972932100296, 0.2586631178855896, 0.0546383373439312, -0.1499505341053009, 0.512017011642456, 0.03496725484728813, -0.07920516282320023, -0.06631550192832947, 0.18323996663093567, -0.06483937799930573, 0.17578187584877014, -0.08281492441892624, 0.398554265499115, 0.2511339485645294, -0.23773708939552307, 0.08006990700960159, 0.023348640650510788, 0.18782921135425568, 0.01393849402666092, -0.11207542568445206, 0.7624775171279907, 0.20033682882785797, 0.02097024954855442, -0.039652105420827866, 0.033908911049366, 0.24047766625881195, 0.14785081148147583, -0.30217379331588745, -0.18372929096221924, -0.22292132675647736, -0.07835756242275238, -0.46962568163871765, 0.010475365445017815, -0.4593059718608856, 0.051130834966897964, 0.4444616734981537, 0.056171730160713196, 0.24346056580543518, 0.02429560385644436, -0.08068650960922241, 0.16206571459770203, 0.17310361564159393, 0.09386111795902252, 0.39299196004867554, 0.15776905417442322, -0.054740674793720245, -0.0883125439286232, -0.0521542951464653, 0.073954738676548, 0.20344661176204681, 0.09727557003498077, -0.3354767858982086, -0.14900818467140198, 0.2994529902935028, 0.12582692503929138, -0.16285279393196106, -0.2983711361885071, -0.1498950570821762, -0.1280515342950821, -0.1180160790681839, -0.03367377445101738, -0.3662707507610321, -0.30721938610076904, 0.055624574422836304, -0.16613611578941345, -0.03564029932022095, -0.19587165117263794, -0.049063533544540405, -0.07292433083057404, -0.07256097346544266, 0.14640645682811737, -0.3358469009399414, 0.50475013256073, -0.17599089443683624, -0.35077035427093506, -0.10312855243682861, 0.13271191716194153, -0.14977328479290009, 0.13228432834148407, 0.23870274424552917, -0.031688325107097626, 0.47616758942604065, 0.44411414861679077, 0.041376516222953796, -0.40467002987861633, -0.7218232750892639, -0.0069949328899383545, -0.08219441771507263, 0.20955891907215118, 0.28391045331954956, -0.2019517719745636, 0.17263849079608917, 0.00999954342842102, 0.15341830253601074, 0.03137735277414322, 0.05336214601993561, -0.12093782424926758, -0.04479408264160156, 0.08759991824626923, -0.41254034638404846, -0.24081718921661377, -0.22048524022102356, -0.4365675449371338, 0.5187680721282959, 0.2513471245765686, 0.11633066087961197, 0.2979791462421417, 0.053480420261621475, 0.07255760580301285, 0.3183263838291168, 0.01332644373178482, -0.11957081407308578, -0.1021847277879715, 0.4855431616306305, -0.32970917224884033, -0.07929080724716187, 0.07519788295030594, -0.20536117255687714, -0.043597571551799774, 0.06864695250988007, -0.12435322999954224, -0.24168920516967773, -0.4402906894683838, 0.45634835958480835, 0.059925973415374756, 0.15610650181770325, -0.14833319187164307, 0.3489327132701874, 0.00568273663520813, -0.048752982169389725, -0.28888094425201416, 0.01842528209090233, 0.14772550761699677, 0.029035693034529686, 0.30768072605133057, 0.32036757469177246, 0.061219409108161926, 0.37313470244407654, -0.2202693223953247, -0.19687806069850922, 0.40065059065818787, -0.018964644521474838, 0.2770867943763733, -0.01985517144203186, -0.22996431589126587, 0.0650956779718399, -0.1620619297027588, 0.28694260120391846, -0.12952622771263123, 0.11652885377407074, -0.15533781051635742, -0.16970616579055786, 0.08120609819889069, 0.1672939658164978, -0.15828780829906464, 0.046703629195690155, -0.17761369049549103, 0.30924758315086365, -0.3477163314819336, -0.21636620163917542, -0.3334462642669678, 0.061321236193180084, 0.0939563661813736, 0.41648033261299133, 0.21378940343856812, 0.0034211017191410065, -0.3564550578594208, -0.1897459626197815, -0.12206131219863892, 0.2105916291475296, 0.08937983214855194, 0.06721289455890656, -0.08669344335794449, 0.05143792927265167, -0.13510850071907043, 0.15786273777484894, -0.07837869226932526, -0.31113332509994507, -0.5409480929374695, 0.006615921854972839, -0.14686746895313263, 0.03786603361368179, -0.1149023100733757, 0.08422407507896423, -0.014719493687152863, -0.3636188209056854, 0.23502162098884583, -0.15016689896583557, -0.19219428300857544, 0.2581394612789154, 0.1367623209953308, -0.1110498458147049, -0.05607106164097786, 0.04509156942367554, -0.3818359971046448, -0.2401961386203766, -0.17885027825832367, 0.30936431884765625, -0.08350863307714462, -0.32054823637008667, -0.3185591399669647, -0.48381364345550537, -0.00960780680179596, 0.5957970023155212, 0.2389068305492401, -0.024000097066164017, -0.05643995851278305, -0.03110504150390625, -0.35206377506256104, -0.2729085683822632, 0.13825543224811554, 0.5449464917182922, -0.016361461952328682, -0.43260452151298523, -0.10882841050624847, -0.09408381581306458, 0.3013562560081482, 0.21556514501571655, -0.22462528944015503, 0.4318516254425049, -0.14278452098369598, -0.11535772681236267, -0.3404555320739746, 0.12267249077558517, 0.23074647784233093, -0.01230166107416153, -0.2396542727947235, -0.748816192150116, 0.5544547438621521, -0.006546646356582642, 0.01091371476650238, -0.05486331880092621, 0.3507026731967926, -0.2744320333003998, 0.24753697216510773, 0.2065736949443817, 0.7495633363723755, -0.057963356375694275, -0.0005985996685922146, 0.09628830850124359, -0.1916033774614334, 0.8016020059585571, -0.08957365900278091, -0.03779502213001251, -0.21464213728904724, -0.06966271251440048, -0.138944610953331, -0.022884659469127655, 0.5007947087287903, -0.1845730096101761, -0.23886534571647644, 0.04139144346117973, -0.07593494653701782, 0.020042888820171356, 0.168698251247406, 0.30202576518058777, -0.22896991670131683, -0.3982955813407898, -0.1361231505870819, 0.22332793474197388, -0.04766416549682617, -0.07057799398899078, 0.03496290370821953, -0.3164421617984772, -0.09663641452789307, 0.12105321884155273, -0.3555517792701721, -0.14377647638320923, -0.05424224212765694, 0.14893317222595215, 0.0854513943195343, 0.016746193170547485, 0.5634096264839172, 0.17591221630573273, 0.5325101613998413, 0.1617979258298874, -0.0952792763710022, -0.13149796426296234, 0.11818511039018631, 0.03607583045959473, -0.20910102128982544, -0.017156526446342468, 0.43367624282836914, 0.010200835764408112, -0.17539182305335999, 0.1165008395910263, 0.11622679978609085, -0.10698024928569794, -0.3525548577308655, 0.0412253811955452, 0.09143774211406708, -0.27010273933410645, -0.11462391912937164, -0.2128489762544632, -0.08727563172578812, -0.07328414916992188, 0.16677036881446838, 0.3838879466056824, -0.05269308760762215, 0.2092691957950592, 0.05661783739924431, 0.17191636562347412, -0.07648216187953949, -0.42689239978790283, -0.010875671170651913, 0.10102853178977966, 0.23920071125030518, 0.09971674531698227, -0.023608651012182236, -0.09477639198303223, 0.12540298700332642, 0.11373445391654968, -0.09264924377202988, 0.12451869249343872, 0.09223683178424835, -0.41055750846862793, 0.017980970442295074, 0.10150279849767685, -0.042710572481155396, -0.23006628453731537, -0.10632093250751495, -0.12646065652370453, -0.4258202016353607, 0.09260901808738708, -0.2814734876155853, 0.45711806416511536, -0.11589956283569336, 0.2279793620109558, -0.13146302103996277, -0.09794627875089645, -0.40020012855529785, 0.07985789328813553, 0.01995047926902771, -0.08686764538288116, 0.2968985140323639, 0.27815791964530945, -0.009049229323863983, 0.04203345626592636, 0.12092485278844833, 0.17810019850730896, -0.17417564988136292, -0.16485166549682617, -0.393460750579834, 0.12786030769348145, 0.07335007190704346, 0.06252425909042358, -0.018948763608932495, 0.04905511438846588, -0.18546062707901, -0.1334838569164276, -0.00473940372467041, 0.18697835505008698, -0.16653209924697876, 0.3764215111732483, -0.15652906894683838, 0.049072589725255966, 0.111106276512146, 0.2570745050907135, -0.1398828774690628, 0.12727764248847961, 0.41422560811042786, 0.0352720245718956, -0.11451716721057892, -0.05064922571182251, 0.04351554811000824, 0.07247234135866165, 0.06752126663923264, -0.019523825496435165, 0.31487035751342773, 0.1267208456993103, 0.008858345448970795, 0.23337382078170776, 0.0648028776049614, 0.24881215393543243, -0.12686485052108765, 0.2638625204563141, 0.39082440733909607, 0.17422564327716827, -0.14074088633060455, -0.06914959847927094, 0.11443224549293518, -0.13001275062561035, 0.20578260719776154, 0.6328719854354858, 0.46395376324653625, 0.24828417599201202, -0.10019930452108383, -0.12744659185409546, 0.07111890614032745, -0.17651452124118805, 0.36284857988357544, 0.3347644507884979, -0.08087877929210663, 0.04121392220258713, 0.17895448207855225, 0.0644138753414154, 0.2247633934020996, 0.3637102246284485, -0.07798106968402863, 0.041352175176143646, 0.04292623698711395, -0.06641720980405807, 0.4840658903121948, -0.22132788598537445, 0.196780264377594, 0.026463739573955536, 0.0997997298836708, 0.41061827540397644, 0.23713481426239014, 0.3861517608165741, -0.3434348702430725, -0.11278963088989258, -0.0042723119258880615, 0.20267105102539062, 0.11950276792049408, -0.1979314684867859, 0.17425018548965454, -0.10191253572702408, -0.40775740146636963, -0.26910319924354553, -0.012255856767296791, -0.23265992105007172, -0.14002105593681335, -0.06407280266284943, 0.14010614156723022, -0.17898406088352203, 0.18448345363140106, 0.06291080266237259, 0.5244970321655273, 0.0535915344953537, -0.35338616371154785, 0.10437443852424622, -0.25880691409111023, -0.005562334321439266, 0.15960288047790527, 0.048973917961120605, 0.29626378417015076, -0.14444036781787872, 0.047853097319602966, -0.2951769530773163, 0.05611978471279144, 0.08779862523078918, -0.025556599721312523, 0.01509837806224823, 0.20236848294734955, 0.14518703520298004, 0.1814134120941162, -0.08545257151126862, 0.05263044312596321, -0.3428955674171448, 0.06495843827724457, -0.699398934841156, 0.5283528566360474, 0.0701998770236969, 0.07644548267126083, -0.06499521434307098, 0.015368126332759857, -0.14826279878616333, -0.6384761333465576, 0.5708125233650208, 0.19718486070632935, 0.10514292120933533, -0.1447114646434784, 0.11610449850559235, 0.05416285991668701, 0.09241783618927002, 0.11196845024824142, 0.06624279916286469, 0.18082965910434723, 0.3318924307823181, -0.4502118229866028, -0.13931557536125183, 0.17950022220611572, -0.36898481845855713, 0.10800985991954803, -0.03313011676073074, 0.09047326445579529, 0.06101952865719795, -0.034400224685668945, -0.4024747908115387, 0.4514421820640564, -0.03695841506123543, -0.22777415812015533, -0.3241441547870636, -0.2229723334312439, 0.04022599011659622, 0.04131074994802475, -0.07232151180505753, -0.05678772181272507, 0.08743306994438171, 0.08280929177999496, -0.112603098154068, -0.12423195689916611, -0.13306394219398499, -0.1028333306312561, 0.5905724763870239, 0.3939281105995178, 0.0998375192284584, 0.013408437371253967, -0.25621476769447327, -0.09016793966293335, 0.0060956887900829315, -0.26636362075805664, 0.23144537210464478, -0.13470299541950226, 0.5551941394805908, -0.22404800355434418, -0.058191701769828796, -0.30184823274612427, 0.2207050919532776, 0.14713935554027557, -0.3915373682975769, -0.2575089633464813, 0.22643887996673584, -0.041996292769908905, -0.16537031531333923, 0.08097828924655914, 0.21420946717262268, -0.028915833681821823, 0.10658909380435944, -0.05358856916427612, -0.30847859382629395, 0.38160836696624756, -0.06225183233618736, -0.36018145084381104, 0.1925305426120758, -0.06094765663146973, 0.21958841383457184, 0.17667363584041595, -0.7359643578529358, -0.14092737436294556, 0.12273276597261429, 0.07136905193328857, 0.15559571981430054, 0.16934289038181305, -0.06560792773962021, -0.24104417860507965, -0.24033308029174805, -0.015126615762710571, -0.17928369343280792, 0.3680269122123718, 0.05935683846473694, -0.13984738290309906 ]
https://github.com/huggingface/datasets/issues/5766
Thank you for your replies! @lhoestq I have a use case involving whole-slide images in digital pathology. These are very large images (potentially gigapixel scale), so standard image tools are not suitable. Essentially, encoding/decoding can be done from/to [`OpenSlide`](https://openslide.org/api/python/) objects. Though there may be interest in this use case from the digital pathology community, it may not be sufficiently useful to suggest adding the feature type, but there will likely be many other use cases for a generic custom feature type. Thank you for pointing out `set_transform`! I will make sure to keep this in mind in the future. @mariosasko An "extension API" sounds like a good idea, though I understand that this needs to be properly defined, and that you will need to discuss it internally. Support from the viewer would be awesome, too, though the generalization to arbitrary types sounds challenging. For now, happy to know that you're considering the feature. Feel free to let me know if I can do anything to support the process.
Support custom feature types
### Feature request I think it would be nice to allow registering custom feature types with the 🤗 Datasets library. For example, allow to do something along the following lines: ``` from datasets.features import register_feature_type # this would be a new function @register_feature_type class CustomFeatureType: def encode_example(self, value): """User-provided logic to encode an example of this feature.""" pass def decode_example(self, value, token_per_repo_id=None): """User-provided logic to decode an example of this feature.""" pass ``` ### Motivation Users of 🤗 Datasets, such as myself, may want to use the library to load datasets with unsupported feature types (i.e., beyond `ClassLabel`, `Image`, or `Audio`). This would be useful for prototyping new feature types and for feature types that aren't used widely enough to warrant inclusion in 🤗 Datasets. At the moment, this is only possible by monkey-patching 🤗 Datasets, which obfuscates the code and is prone to breaking with library updates. It also requires the user to write some custom code which could be easily avoided. ### Your contribution I would be happy to contribute this feature. My proposed solution would involve changing the following call to `globals()` to an explicit feature type registry, which a user-facing `register_feature_type` decorator could update. https://github.com/huggingface/datasets/blob/fd893098627230cc734f6009ad04cf885c979ac4/src/datasets/features/features.py#L1329 I would also provide an abstract base class for custom feature types which users could inherit. This would have at least an `encode_example` method and a `decode_example` method, similar to `Image` or `Audio`. The existing `encode_nested_example` and `decode_nested_example` functions would also need to be updated to correctly call the corresponding functions for the new type.
168
Support custom feature types ### Feature request I think it would be nice to allow registering custom feature types with the 🤗 Datasets library. For example, allow to do something along the following lines: ``` from datasets.features import register_feature_type # this would be a new function @register_feature_type class CustomFeatureType: def encode_example(self, value): """User-provided logic to encode an example of this feature.""" pass def decode_example(self, value, token_per_repo_id=None): """User-provided logic to decode an example of this feature.""" pass ``` ### Motivation Users of 🤗 Datasets, such as myself, may want to use the library to load datasets with unsupported feature types (i.e., beyond `ClassLabel`, `Image`, or `Audio`). This would be useful for prototyping new feature types and for feature types that aren't used widely enough to warrant inclusion in 🤗 Datasets. At the moment, this is only possible by monkey-patching 🤗 Datasets, which obfuscates the code and is prone to breaking with library updates. It also requires the user to write some custom code which could be easily avoided. ### Your contribution I would be happy to contribute this feature. My proposed solution would involve changing the following call to `globals()` to an explicit feature type registry, which a user-facing `register_feature_type` decorator could update. https://github.com/huggingface/datasets/blob/fd893098627230cc734f6009ad04cf885c979ac4/src/datasets/features/features.py#L1329 I would also provide an abstract base class for custom feature types which users could inherit. This would have at least an `encode_example` method and a `decode_example` method, similar to `Image` or `Audio`. The existing `encode_nested_example` and `decode_nested_example` functions would also need to be updated to correctly call the corresponding functions for the new type. Thank you for your replies! @lhoestq I have a use case involving whole-slide images in digital pathology. These are very large images (potentially gigapixel scale), so standard image tools are not suitable. Essentially, encoding/decoding can be done from/to [`OpenSlide`](https://openslide.org/api/python/) objects. Though there may be interest in this use case from the digital pathology community, it may not be sufficiently useful to suggest adding the feature type, but there will likely be many other use cases for a generic custom feature type. Thank you for pointing out `set_transform`! I will make sure to keep this in mind in the future. @mariosasko An "extension API" sounds like a good idea, though I understand that this needs to be properly defined, and that you will need to discuss it internally. Support from the viewer would be awesome, too, though the generalization to arbitrary types sounds challenging. For now, happy to know that you're considering the feature. Feel free to let me know if I can do anything to support the process.
[ -0.1313193440437317, 0.12182304263114929, -0.08667328953742981, 0.05268140509724617, 0.24636176228523254, 0.03978772461414337, 0.31911927461624146, 0.30791687965393066, 0.1018514409661293, 0.037960585206747055, -0.01863536238670349, 0.36437463760375977, -0.4562287926673889, 0.7040204405784607, -0.08624404668807983, -0.2176261991262436, -0.005379986017942429, 0.18209733068943024, 0.09400918334722519, 0.07795992493629456, -0.12002269923686981, -0.04243677854537964, 0.05517023801803589, 0.13762880861759186, -0.06743206828832626, 0.20233477652072906, 0.017174333333969116, -0.1424543410539627, -0.302412211894989, -0.510395348072052, 0.22521138191223145, 0.4159071743488312, 0.27765947580337524, 0.39726170897483826, -0.00010465738887432963, 0.10063116252422333, 0.1614016592502594, 0.07030240446329117, -0.16203826665878296, -0.03711826354265213, -0.012007981538772583, -0.5138813257217407, -0.001262422651052475, -0.1273021548986435, -0.20347687602043152, -0.3826650381088257, -0.11012845486402512, -0.352376788854599, -0.030468299984931946, 0.038528408855199814, 0.22686584293842316, -0.15130440890789032, 0.060581207275390625, 0.2306821346282959, 0.2804984450340271, 0.7417007684707642, -0.5679042339324951, -0.26719024777412415, 0.2740783393383026, -0.0056874193251132965, 0.3178139328956604, 0.1532394140958786, -0.03186740353703499, -0.2688308358192444, 0.4406343400478363, 0.0069286152720451355, -0.28157147765159607, -0.41603904962539673, -0.23775632679462433, 0.4443187415599823, 0.5128383636474609, -0.17996379733085632, -0.4495300352573395, -0.4908784329891205, 0.04958195611834526, -0.48270919919013977, -0.010566230863332748, -0.032353147864341736, 0.01476866751909256, 0.25173312425613403, -0.04436478763818741, -0.21716657280921936, -0.202621728181839, 0.16460353136062622, 0.08017507940530777, -0.10352486371994019, -0.0566561184823513, -0.03462706878781319, 0.029693730175495148, -0.3022861182689667, 0.06476826965808868, -0.1560705006122589, 0.06158602237701416, 0.2425803244113922, -0.029615994542837143, -0.22740769386291504, 0.11608622223138809, -0.14435094594955444, 0.37409430742263794, 0.27987074851989746, -0.05546475201845169, 0.3424239456653595, -0.6952155828475952, 0.15056923031806946, 0.05848240852355957, -0.14790400862693787, 0.06075636297464371, -0.13865286111831665, 0.4152061939239502, 0.12786397337913513, 0.010094746947288513, 0.028047259896993637, -0.12844619154930115, 0.07270066440105438, 0.09470751881599426, 0.10460054874420166, 0.3306249678134918, -0.044228121638298035, 0.28954029083251953, -0.06435908377170563, 0.01656288653612137, 0.0695657730102539, 0.272784024477005, 0.059277549386024475, 0.00867573544383049, 0.25861647725105286, 0.032384537160396576, 0.09659254550933838, 0.057909682393074036, -0.2023036777973175, 0.08166107535362244, -0.07431887090206146, -0.12090447545051575, 0.11612299084663391, 0.23680844902992249, -0.1228792816400528, -0.0222758948802948, 0.08335985243320465, 0.3186814785003662, 0.035657837986946106, 0.1206243634223938, 0.07034711539745331, -0.08384564518928528, -0.12220978736877441, -0.5708349347114563, -0.10552515089511871, 0.1312859058380127, -0.10751908272504807, -0.30741453170776367, 0.11514830589294434, -0.07160007208585739, -0.27265268564224243, -0.2639787495136261, 0.17258137464523315, -0.3402590751647949, -0.02084062434732914, -0.3304515779018402, 0.5047290921211243, -0.02313542738556862, -0.04661257937550545, 0.09808149188756943, -0.14273124933242798, -0.15216848254203796, -0.3851298689842224, 0.0871526226401329, 0.1959364116191864, -0.3413465619087219, -0.09673374891281128, -0.11285547912120819, -0.1714855134487152, 0.05975891649723053, 0.09309133887290955, -0.2046566754579544, -0.1268635392189026, -0.2144414186477661, 0.15333057940006256, 0.37213534116744995, -0.2065790295600891, 0.007971048355102539, -0.06685598194599152, 0.27289578318595886, 0.3522324860095978, 0.045840077102184296, 0.15206977725028992, 0.047508273273706436, -0.0906996876001358, -0.22798462212085724, 0.3580179810523987, -0.21957038342952728, -0.09529686719179153, -0.03723108768463135, -0.3611457049846649, 0.38178396224975586, 0.16816198825836182, 0.0015924741746857762, 0.01915901154279709, 0.21925638616085052, -0.2546148896217346, 0.12733998894691467, -0.33343830704689026, -0.14257927238941193, -0.2506538927555084, 0.4933013319969177, 0.4687008857727051, 0.13433684408664703, -0.3530239164829254, -0.11342459917068481, 0.3875492811203003, -0.05847129225730896, 0.29526931047439575, -0.11010386049747467, -0.33815521001815796, 0.05109957978129387, 0.03245727717876434, -0.23411834239959717, 0.04258207231760025, 0.19221630692481995, 0.02489110827445984, -0.23251843452453613, 0.18620048463344574, -0.44098567962646484, -0.03923513740301132, -0.09262555837631226, 0.046181678771972656, -0.20611277222633362, 0.103718601167202, 0.25902292132377625, 0.07011529058218002, -0.29305127263069153, 0.5146669149398804, 0.049627866595983505, -0.0773279070854187, -0.09231314063072205, 0.1634560227394104, 0.16510218381881714, 0.14962907135486603, -0.19852547347545624, 0.5044846534729004, 0.21348504722118378, -0.23368045687675476, 0.10822422057390213, 0.07322268187999725, 0.13164742290973663, 0.006258338689804077, -0.06468906998634338, 0.7253307104110718, 0.40472865104675293, 0.03982527181506157, -0.06655719876289368, -0.026743628084659576, 0.08732874691486359, 0.07170234620571136, -0.20001308619976044, -0.11774451285600662, -0.24190029501914978, -0.09992890059947968, -0.3590308427810669, -0.012381715700030327, -0.2910394072532654, 0.12002573907375336, 0.4247422516345978, -0.0022991150617599487, 0.22510987520217896, 0.020457634702324867, -0.18782608211040497, 0.10436566174030304, 0.16473454236984253, -0.03650079667568207, 0.3162032961845398, 0.15735457837581635, -0.04492945596575737, -0.08085925877094269, 0.11193645000457764, 0.11519667506217957, 0.2341548651456833, -0.022676672786474228, -0.2165437638759613, -0.04304945468902588, 0.29987406730651855, 0.08380237221717834, -0.13261979818344116, -0.32820379734039307, -0.17027424275875092, -0.14591719210147858, -0.17579995095729828, -0.13880684971809387, -0.3926137387752533, -0.26107504963874817, 0.022338494658470154, -0.11478275060653687, -0.1169092208147049, -0.11948275566101074, 0.03224989399313927, -0.10134141147136688, -0.006302550435066223, 0.0659942552447319, -0.3607989549636841, 0.45599523186683655, -0.22922590374946594, -0.357610821723938, -0.00780767947435379, 0.24596628546714783, -0.22878986597061157, 0.13014595210552216, 0.2748383581638336, -0.08652357757091522, 0.4005587100982666, 0.5258033871650696, -0.002097591757774353, -0.2981468141078949, -0.6818657517433167, 0.003533155657351017, -0.06726673245429993, 0.13718757033348083, 0.3135666251182556, -0.22534030675888062, 0.2828202247619629, 0.010597940534353256, 0.20841994881629944, 0.09969685226678848, 0.00022316724061965942, -0.038369499146938324, -0.02962600812315941, 0.0616118423640728, -0.3905656933784485, -0.2036360800266266, -0.3061707317829132, -0.4275341033935547, 0.39787372946739197, 0.18965119123458862, 0.1475321352481842, 0.46823224425315857, 0.044005051255226135, 0.09280544519424438, 0.39516234397888184, 0.04134600609540939, -0.0988222062587738, -0.10342380404472351, 0.40541812777519226, -0.3290098011493683, -0.023838456720113754, 0.09400667250156403, -0.12275567650794983, -0.1603643000125885, 0.14506028592586517, -0.15751108527183533, -0.22833573818206787, -0.30252763628959656, 0.49652814865112305, 0.06925205886363983, 0.024286827072501183, -0.06005137786269188, 0.379913330078125, 0.033630192279815674, -0.10085553675889969, -0.259760320186615, -0.04448941349983215, 0.05539877712726593, 0.07050955295562744, 0.30910322070121765, 0.24151334166526794, 0.1509416699409485, 0.4617151618003845, -0.050512440502643585, -0.16582471132278442, 0.40529921650886536, -0.047859713435173035, 0.19035384058952332, -0.051694389432668686, -0.2129858434200287, 0.11685488373041153, -0.13422027230262756, 0.08300814777612686, -0.03804074600338936, 0.20062731206417084, -0.1084364503622055, -0.10939977318048477, 0.04469776153564453, 0.2185419797897339, -0.21139615774154663, 0.06950445473194122, -0.10617338120937347, 0.3075394928455353, -0.42932701110839844, -0.19441601634025574, -0.260612815618515, 0.025658775120973587, 0.19873076677322388, 0.5038954019546509, 0.2612205445766449, -0.009238675236701965, -0.555206298828125, -0.15921157598495483, -0.046787384897470474, 0.24595458805561066, 0.11739081144332886, -0.004790175706148148, -0.06367240846157074, 0.048997558653354645, -0.14583255350589752, 0.16482245922088623, -0.049814317375421524, -0.48248666524887085, -0.44620534777641296, 0.04144325852394104, 0.04672563076019287, 0.23961707949638367, -0.21737557649612427, 0.22657687962055206, 0.04973667860031128, -0.20934152603149414, 0.17561587691307068, -0.1433178186416626, -0.1826903223991394, 0.15993201732635498, 0.18635696172714233, -0.09509256482124329, -0.027568712830543518, 0.08240097016096115, -0.32615792751312256, -0.26564574241638184, -0.28571170568466187, 0.21938210725784302, -0.02057056874036789, -0.25317907333374023, -0.33773764967918396, -0.3716718256473541, 0.05010026693344116, 0.5682846307754517, 0.21053944528102875, -0.014902770519256592, -0.02492331713438034, -0.05997687578201294, -0.3498293161392212, -0.2196855992078781, 0.16358837485313416, 0.5842055678367615, -0.02176455594599247, -0.6051667928695679, -0.20187720656394958, -0.045825738459825516, 0.3571067452430725, 0.1708410382270813, -0.25075361132621765, 0.3947980999946594, -0.15521240234375, -0.15013180673122406, -0.3614692986011505, 0.13140954077243805, 0.21667955815792084, -0.10058560967445374, -0.30745837092399597, -0.7194536328315735, 0.5283992886543274, -0.09681288152933121, 0.006503626704216003, -0.13145354390144348, 0.2621574401855469, -0.3309227228164673, 0.255450040102005, 0.10505357384681702, 0.727390468120575, 0.035102348774671555, -0.10630759596824646, 0.12268524616956711, -0.06619188189506531, 0.6207195520401001, -0.15559989213943481, -0.05308947712182999, -0.2153925597667694, -0.08953166007995605, -0.1307767927646637, -0.0037183240056037903, 0.463089257478714, -0.06219028681516647, -0.2216048538684845, -0.012821979820728302, -0.1750786006450653, 0.07547007501125336, 0.10142770409584045, 0.22029748558998108, -0.12028887867927551, -0.3303517699241638, -0.005514388903975487, 0.26737552881240845, -0.023470502346754074, -0.043464500457048416, 0.03109893575310707, -0.3248494863510132, -0.024395771324634552, 0.13493849337100983, -0.5054306387901306, -0.13845255970954895, -0.16896668076515198, 0.05290163680911064, 0.09757542610168457, -0.023434318602085114, 0.6109741926193237, 0.1846184879541397, 0.45173102617263794, 0.23872342705726624, -0.17337490618228912, -0.11489896476268768, 0.12753382325172424, 0.07328729331493378, -0.18327870965003967, -0.04590680077672005, 0.44912511110305786, -0.02589636668562889, -0.1650749295949936, 0.05119019001722336, 0.13288865983486176, -0.1883387714624405, -0.227961003780365, -0.08544527739286423, 0.1834934502840042, -0.3878001570701599, -0.13846836984157562, -0.17040635645389557, 0.020127639174461365, -0.05186137184500694, 0.17058894038200378, 0.3546326160430908, -0.1398625671863556, 0.16764327883720398, -0.06609515845775604, 0.17687134444713593, 0.04547997936606407, -0.4742182493209839, 0.07234153151512146, -0.09497419744729996, 0.21589742600917816, 0.10204237699508667, 0.021068774163722992, -0.10136880725622177, 0.15603533387184143, 0.14972937107086182, -0.022814929485321045, 0.038401685655117035, 0.19902902841567993, -0.3049275577068329, 0.10430405288934708, 0.17552396655082703, -0.09718961268663406, -0.22946208715438843, -0.07447335124015808, -0.13906250894069672, -0.27623993158340454, 0.049018777906894684, -0.20806962251663208, 0.458320289850235, -0.18675518035888672, 0.23307032883167267, -0.07227721810340881, -0.10954130440950394, -0.3954705595970154, 0.052460722625255585, 0.08392861485481262, -0.0820654034614563, 0.23741061985492706, 0.29574719071388245, -0.08564890176057816, -0.014290578663349152, 0.11838129162788391, 0.12865690886974335, -0.252916157245636, -0.14938893914222717, -0.3169807195663452, 0.15128375589847565, 0.1153765469789505, 0.17539379000663757, -0.013360429555177689, 0.05674055218696594, -0.1595155894756317, -0.12605468928813934, -0.010231193155050278, 0.04262767732143402, -0.20726615190505981, 0.3168286979198456, -0.09494264423847198, 0.13605251908302307, 0.07755626738071442, 0.23595350980758667, -0.04448356106877327, 0.2501618266105652, 0.4122525453567505, 0.031047459691762924, -0.13111984729766846, -0.0566999688744545, -0.05494801700115204, 0.13452297449111938, 0.18925020098686218, 0.05014387145638466, 0.39857324957847595, 0.08073293417692184, 0.04905804991722107, 0.25613927841186523, 0.019062340259552002, 0.22584357857704163, -0.19330817461013794, 0.28150948882102966, 0.3681347668170929, 0.20985575020313263, -0.09448850154876709, -0.05549903213977814, 0.18157705664634705, -0.19525209069252014, 0.09931696951389313, 0.576671302318573, 0.5114579200744629, 0.3614145815372467, -0.08697552978992462, -0.18784868717193604, 0.07779304683208466, -0.08262467384338379, 0.36937379837036133, 0.30374065041542053, -0.10098052024841309, -0.037520911544561386, 0.10087652504444122, -0.006814207881689072, 0.24942097067832947, 0.3014875054359436, -0.13577502965927124, 0.16743767261505127, 0.2287960797548294, -0.14687559008598328, 0.5245582461357117, -0.29574042558670044, 0.2488483488559723, 0.06852627545595169, 0.1971748024225235, 0.39695531129837036, 0.18751473724842072, 0.2648823857307434, -0.3169769048690796, -0.20057448744773865, 0.037816859781742096, 0.1672997623682022, 0.2069830298423767, -0.13553042709827423, 0.2477128505706787, -0.11500052362680435, -0.48974114656448364, -0.28805023431777954, -0.06641317903995514, -0.24020345509052277, -0.07661689817905426, -0.07733563333749771, 0.13236704468727112, -0.2276868224143982, 0.13631346821784973, 0.10031315684318542, 0.5573885440826416, 0.0005744844675064087, -0.2233634740114212, -0.011488109827041626, -0.17637300491333008, 0.08288820087909698, 0.1447887122631073, 0.09903010725975037, 0.3590685725212097, -0.12017790973186493, 0.030694179236888885, -0.3313608169555664, 0.13140304386615753, -0.010502789169549942, -0.04209926724433899, -0.03537067025899887, 0.19784802198410034, 0.1114639937877655, 0.1538945883512497, -0.019499903544783592, 0.007478047162294388, -0.36418434977531433, -0.053401779383420944, -0.6365209817886353, 0.4573667645454407, 0.11027920246124268, 0.01812925934791565, -0.11511215567588806, -0.03950377553701401, -0.09172217547893524, -0.6148499250411987, 0.6833107471466064, 0.3066835403442383, 0.1000220775604248, -0.19733130931854248, 0.12226375937461853, 0.009011700749397278, 0.03155970573425293, 0.08732260763645172, 0.12480801343917847, 0.19921086728572845, 0.2711644470691681, -0.3911682963371277, -0.0625399798154831, 0.18783964216709137, -0.41831690073013306, 0.16747349500656128, -0.08223891258239746, 0.1963074505329132, 0.12839896976947784, -0.12057267129421234, -0.4018992781639099, 0.5622891783714294, 0.049952708184719086, -0.2081403285264969, -0.2913786470890045, -0.07057051360607147, 0.0260158684104681, 0.032785847783088684, -0.07367899268865585, -0.0071281567215919495, 0.08732855319976807, 0.06484656780958176, -0.13619357347488403, -0.10947444289922714, -0.03813052177429199, -0.20173533260822296, 0.7340707778930664, 0.32871213555336, 0.12062543630599976, 0.008406035602092743, -0.23834091424942017, -0.10617709159851074, 0.056207142770290375, -0.32412654161453247, 0.22162221372127533, -0.12749749422073364, 0.4046212136745453, -0.12961885333061218, 0.13798245787620544, -0.2920738160610199, 0.23183470964431763, 0.19268690049648285, -0.34456318616867065, -0.2603692412376404, 0.12313197553157806, -0.10994088649749756, -0.13341204822063446, 0.08921313285827637, 0.16734036803245544, -0.016321511939167976, 0.09556285291910172, -0.12780296802520752, -0.3192984163761139, 0.3614252209663391, -0.03344490006566048, -0.2849264144897461, 0.17602553963661194, 0.054173488169908524, 0.11427006125450134, 0.1831819862127304, -0.9364147782325745, -0.22489111125469208, 0.22278782725334167, 0.0431206077337265, 0.16945359110832214, 0.2729496955871582, 0.06313981860876083, -0.2519594430923462, -0.1805529147386551, 0.15752559900283813, -0.1952456682920456, 0.3352706730365753, 0.09747648984193802, -0.1525954008102417 ]
https://github.com/huggingface/datasets/issues/5765
You need to remove the `text` and `text_en` columns before passing the dataset to the `DataLoader` to avoid this error: ```python tokenized_datasets = tokenized_datasets.remove_columns(["text", "text_en"]) ```
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text']
### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
26
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 You need to remove the `text` and `text_en` columns before passing the dataset to the `DataLoader` to avoid this error: ```python tokenized_datasets = tokenized_datasets.remove_columns(["text", "text_en"]) ```
[ -0.22707095742225647, -0.15898144245147705, -0.05346143618226051, 0.1391603797674179, 0.5924882292747498, 0.03676106780767441, 0.6367816925048828, 0.27259331941604614, 0.05489131808280945, 0.40304070711135864, -0.13724076747894287, 0.38791391253471375, -0.16426730155944824, -0.3143731653690338, -0.08134152740240097, -0.21842747926712036, 0.07044854760169983, -0.0325014591217041, 0.24086961150169373, -0.13527974486351013, -0.21893242001533508, 0.031180499121546745, -0.22303235530853271, 0.182479590177536, -0.505091667175293, -0.14745154976844788, 0.11956603825092316, -0.1630776822566986, 0.06577171385288239, -0.32028713822364807, -0.04688256233930588, -0.20513838529586792, 0.2504660487174988, 0.4125286042690277, -0.00011158114648424089, 0.02161279320716858, 0.3682352900505066, -0.23832610249519348, -0.24665674567222595, -0.27624744176864624, 0.2754460275173187, 0.13193966448307037, -0.011380922049283981, -0.36616504192352295, 0.02411101758480072, -0.09989137947559357, 0.010076185688376427, -0.2526741921901703, 0.15732108056545258, 0.46292632818222046, 0.20853891968727112, 0.3006960451602936, 0.10770581662654877, -0.16412679851055145, 0.006468396633863449, 0.08804261684417725, -0.048153817653656006, -0.1428634226322174, 0.34960076212882996, 0.22336246073246002, -0.20230388641357422, 0.4663708508014679, -0.11048776656389236, -0.16544657945632935, -0.12902399897575378, 0.10161423683166504, -0.15370623767375946, -0.36822986602783203, 0.051899254322052, -0.15829448401927948, 0.18955501914024353, -0.0869954526424408, -0.33825957775115967, 0.02444831281900406, -0.04222766309976578, -0.2964789867401123, 0.23154915869235992, 0.11885152012109756, -0.21122610569000244, 0.09493783116340637, -0.14012891054153442, 0.2544289827346802, -0.07419987767934799, 0.15046310424804688, 0.11241160333156586, 0.6090826988220215, -0.00486312061548233, 0.11557814478874207, 0.11871728301048279, -0.19081240892410278, 0.4064076840877533, -0.0028589628636837006, 0.21241313219070435, 0.21508923172950745, -0.30197906494140625, -0.2985120415687561, -0.24144485592842102, -0.4212414622306824, 0.09634588658809662, 0.10362169146537781, -0.026749273762106895, -0.0502551794052124, -0.09410685300827026, 0.12854763865470886, -0.13429498672485352, 0.44795936346054077, 0.08792128413915634, 0.4682621359825134, 0.08095411956310272, 0.10258777439594269, -0.029544834047555923, -0.1742078959941864, -0.362698495388031, -0.123123899102211, 0.1251644492149353, 0.31376412510871887, -0.03573652729392052, 0.08133295178413391, -0.5532781481742859, 0.1400408148765564, -0.2868460416793823, 0.02125067263841629, 0.14922872185707092, 0.4346259832382202, 0.17153620719909668, 0.21371537446975708, 0.2468288540840149, 0.2169916033744812, -0.02584715187549591, -0.287635862827301, -0.16820038855075836, 0.20109304785728455, -0.17950034141540527, -0.20442649722099304, 0.019693218171596527, -0.0819506049156189, 0.431205689907074, -0.0768827497959137, 0.1394256353378296, -0.08921302109956741, 0.05629904568195343, -0.19159311056137085, 0.20934201776981354, 0.09089016914367676, 0.2013329416513443, 0.14973443746566772, 0.4264281392097473, -0.2862531542778015, 0.00511816143989563, 0.25985753536224365, -0.2932894229888916, -0.261034220457077, -0.02750636264681816, 0.20450256764888763, 0.4427540898323059, -0.10731380432844162, 0.1327940672636032, 0.004981255158782005, 0.47998183965682983, 0.0007614567875862122, 0.11954745650291443, -0.0758846178650856, 0.10514195263385773, -0.12533092498779297, 0.10959462076425552, 0.31247463822364807, -0.09147486835718155, -0.1784079670906067, 0.19371095299720764, 0.07089196145534515, 0.23038934171199799, 0.48705726861953735, -0.2050355225801468, 0.27525216341018677, -0.07033924758434296, 0.42463380098342896, 0.343469500541687, -0.3676389157772064, -0.1543380320072174, 0.16695424914360046, -0.0035423636436462402, -0.16741587221622467, 0.15658977627754211, 0.04294673725962639, 0.06462413817644119, -0.12909521162509918, 0.44544172286987305, 0.20131981372833252, -0.11658148467540741, -0.04360786825418472, -0.18304327130317688, -0.22044797241687775, 0.3023865222930908, 0.15459546446800232, 0.2868271768093109, 0.09023349732160568, -0.05740399286150932, 0.1613752394914627, 0.03663575276732445, -0.21214932203292847, -0.10619688034057617, 0.13042543828487396, 0.1467326581478119, 0.05656977370381355, -0.11834420263767242, -0.03713824972510338, 0.2762080729007721, -0.16624543070793152, 0.15614889562129974, 0.1642962098121643, -0.3623613119125366, -0.16075637936592102, -0.04109422117471695, 0.060608670115470886, -0.2900463938713074, -0.33223196864128113, 0.14342175424098969, 0.12553799152374268, -0.10936389863491058, -0.1008637547492981, -0.27727070450782776, -0.0160880908370018, -0.3379668593406677, 0.03395849093794823, -0.4881877899169922, 0.1611640304327011, -0.30481234192848206, -0.2975989878177643, -0.2511018216609955, -0.004455134272575378, 0.2967945337295532, 0.029460754245519638, -0.3077855110168457, 0.34017980098724365, 0.0503411591053009, -0.39103734493255615, -0.13535529375076294, 0.04638376832008362, 0.14528343081474304, -0.2763221561908722, 0.013853562995791435, 0.3505251407623291, 0.14023597538471222, 0.012317046523094177, 0.10627764463424683, 0.3894713521003723, -0.15574632585048676, 0.13922280073165894, -0.0535939559340477, 0.19763118028640747, 0.4785841703414917, -0.0008494630455970764, -0.1087101399898529, -0.2584361433982849, 0.2304900884628296, -0.06427685171365738, 0.19807985424995422, -0.2739953398704529, -0.3859012722969055, -0.35830631852149963, 0.23885908722877502, 0.12498622387647629, 0.09054658561944962, 0.16550946235656738, -0.14738966524600983, 0.2546381950378418, -0.10610602796077728, -0.2605803608894348, 0.34398412704467773, 0.12839430570602417, -0.3615087568759918, -0.05811918526887894, 0.1630464494228363, -0.10535653680562973, 0.2408810257911682, 0.02428189478814602, -0.1299818903207779, 0.2656014561653137, -0.012600891292095184, 0.14802004396915436, -0.2440974861383438, -0.1888498067855835, -0.1196012869477272, 0.18084605038166046, -0.26580268144607544, 0.09858725965023041, -0.05124182626605034, -0.03214231878519058, -0.20223480463027954, -0.31423234939575195, 0.09205430746078491, -0.12244905531406403, 0.05107170715928078, 0.03596845269203186, -0.21070554852485657, 0.5327699780464172, 0.16354049742221832, 0.020891547203063965, 0.3033285140991211, -0.03920850157737732, -0.12570688128471375, 0.004776895046234131, -0.12850309908390045, 0.07071035355329514, 0.10689427703619003, -0.29650309681892395, 0.2287900149822235, -0.2638397812843323, 0.13523338735103607, -0.20852339267730713, -0.2726563513278961, 0.10312335193157196, -0.22567607462406158, 0.012183548882603645, 0.1613428294658661, 0.011286024004220963, -0.008636273443698883, -0.6732563972473145, 0.36264702677726746, -0.13725504279136658, -0.09386780112981796, 0.11114571988582611, 0.2674482464790344, -0.2701221704483032, -0.11418542265892029, -0.29398128390312195, -0.35151541233062744, -0.27761244773864746, -0.33253878355026245, 0.07777568697929382, 0.1541275829076767, 0.23076245188713074, 0.20777897536754608, 0.18801023066043854, 0.33438748121261597, -0.21077826619148254, -0.17667487263679504, -0.14451779425144196, 0.48520222306251526, -0.24187412858009338, -0.25166943669319153, -0.09061644971370697, -0.1335986852645874, 0.15754453837871552, 0.11914373189210892, -0.23990941047668457, -0.12333011627197266, -0.09584340453147888, 0.03373049199581146, -0.1583523452281952, 0.17873574793338776, 0.4704285264015198, 0.08344651758670807, -0.07961732149124146, -0.06913600862026215, -0.25330275297164917, 0.041770078241825104, -0.2139396220445633, 0.33796000480651855, -0.21045367419719696, 0.6461179256439209, 0.12386645376682281, 0.6803543567657471, 0.16859500110149384, -0.3057551980018616, 0.3437865376472473, 0.010823054239153862, 0.15125082433223724, -0.1399816870689392, -0.47955262660980225, -0.23639902472496033, -0.14482194185256958, -0.0721074715256691, 0.19126972556114197, -0.2562350630760193, -0.2507924437522888, -0.16344821453094482, -0.1191924661397934, -0.2326229065656662, -0.08640282601118088, 0.37604421377182007, -0.25262460112571716, 0.2644343376159668, -0.2008819580078125, 0.348736435174942, -0.18770462274551392, 0.07049990445375443, 0.10643839091062546, 0.019903307780623436, 0.16922451555728912, -0.1969931423664093, -0.15606160461902618, 0.030022144317626953, -0.14009669423103333, 0.3398590087890625, 0.10257837176322937, 0.5419589281082153, -0.11286137253046036, 0.038841262459754944, -0.09391644597053528, 0.07883108407258987, 0.4349493086338043, -0.12250878661870956, -0.2730678617954254, -0.003752797842025757, -0.11388079077005386, -0.010278768837451935, -0.0072467997670173645, -0.4441862106323242, -0.15309134125709534, 0.2874632179737091, 0.4544239640235901, -0.24972577393054962, 0.011706594377756119, 0.16849665343761444, -0.026409121230244637, -0.1326700747013092, 0.04478278011083603, -0.2752780616283417, -0.2325657308101654, -0.6081133484840393, 0.22087010741233826, 0.33642059564590454, 0.2517566680908203, 0.05707569420337677, 0.25142624974250793, -0.1278662532567978, -0.1132812350988388, 0.2539786994457245, -0.07284785062074661, 0.12910503149032593, 0.029037341475486755, -0.02016386389732361, -0.025122620165348053, 0.2182382494211197, 0.07244793325662613, 0.32009392976760864, 0.10309578478336334, -0.5416263937950134, -0.053529515862464905, -0.1330356001853943, 0.28103384375572205, 0.3188333511352539, -0.1211620420217514, -0.027933664619922638, -0.04165811091661453, 0.14068959653377533, 0.1159895658493042, 0.16686473786830902, 0.38165807723999023, 0.12462837994098663, -0.5428383350372314, -0.3261312246322632, 0.05403246358036995, -0.01071251928806305, 0.1553594321012497, 0.3192477524280548, -0.1290578991174698, -0.3175480365753174, 0.6128234267234802, 0.4199717342853546, 1.0334348678588867, 0.23000136017799377, 0.07247032225131989, 0.12974782288074493, 0.1567099243402481, -0.0669136643409729, -0.2685859799385071, 0.11520418524742126, -0.3953932523727417, -0.366939902305603, -0.04878661409020424, -0.09359781444072723, 0.2817918658256531, 0.16307973861694336, -0.417449951171875, 0.14063593745231628, -0.37435269355773926, 0.17490176856517792, 0.0339587926864624, 0.11054601520299911, -0.3060939311981201, -0.33883774280548096, -0.028091859072446823, 0.17443108558654785, -0.08154024183750153, 0.08153842389583588, 0.03990708664059639, -0.13831210136413574, -0.10799102485179901, -0.42088258266448975, -0.3158876299858093, 0.19956785440444946, -0.35154688358306885, 0.30178165435791016, 0.09415283799171448, -0.06231775879859924, 0.29849159717559814, 0.3336353898048401, 0.5592120289802551, 0.2546544075012207, 0.05657017230987549, 0.17887741327285767, 0.19385232031345367, 0.05083033815026283, 0.05625094100832939, -0.02146836742758751, 0.4157039523124695, -0.13075317442417145, -0.03139200806617737, 0.3998894989490509, 0.23160913586616516, -0.35096487402915955, -0.2608662247657776, -0.12932029366493225, 0.3666922152042389, -0.5793744921684265, -0.2232840657234192, -0.1463727355003357, -0.18971632421016693, -0.2468787133693695, 0.12715022265911102, 0.019990287721157074, -0.2826106548309326, -0.15549537539482117, 0.0058752098120749, -0.038573719561100006, -0.01966765522956848, 0.22743910551071167, 0.12812554836273193, -0.2528255879878998, 0.5689960718154907, -0.04697289317846298, -0.26809948682785034, -0.2420220971107483, 0.22347918152809143, 0.26758524775505066, -0.6850436925888062, 0.07907547056674957, -0.20414726436138153, -0.21038241684436798, -0.23065254092216492, 0.295639306306839, 0.05722089856863022, 0.3646165132522583, -0.10624182969331741, -0.24505652487277985, -0.5253615379333496, 0.001174958422780037, 0.09485756605863571, 0.2573859989643097, -0.15642818808555603, 0.2939724326133728, -0.25602465867996216, 0.06286565214395523, -0.3175482451915741, -0.14609214663505554, -0.309264600276947, 0.259377121925354, -0.26135069131851196, -0.06849423795938492, 0.05307032912969589, 0.19617676734924316, 0.1489628106355667, 0.37312766909599304, -0.027503959834575653, -0.20647671818733215, -0.17334043979644775, 0.12141673266887665, 0.30394765734672546, -0.33221226930618286, -0.187453955411911, -0.00771506130695343, -0.02124321646988392, -0.33559954166412354, -0.11054401099681854, 0.173043891787529, 0.047333139926195145, 0.23518669605255127, 0.2801858186721802, 0.2659336030483246, 0.13718685507774353, -0.2378850281238556, -0.14035660028457642, 0.28451675176620483, 0.12710225582122803, -0.16631709039211273, 0.002706516534090042, -0.0660238191485405, -0.3232019245624542, 0.22201485931873322, 0.43126267194747925, 0.2866007089614868, 0.11172106862068176, -0.4801174998283386, 0.03755304962396622, 0.09644980728626251, -0.09952548891305923, 0.0687284916639328, -0.5602134466171265, -0.11889263987541199, 0.3996785581111908, 0.27513325214385986, -0.2472565472126007, 0.07257194817066193, -0.30780524015426636, -0.16773957014083862, -0.1191699281334877, 0.2752785384654999, -0.02173532545566559, 0.09925267100334167, 0.3631536662578583, 0.0013157650828361511, 0.3692479431629181, -0.224326491355896, 0.1858634352684021, 0.36590611934661865, -0.14515532553195953, 0.10238155722618103, 0.12209798395633698, -0.03331024944782257, 0.0057236142456531525, 0.17878082394599915, -0.27218663692474365, 0.253518670797348, 0.059551067650318146, -0.11990571767091751, 0.013721030205488205, 0.04003886133432388, -0.257620632648468, -0.30862492322921753, -0.11399180442094803, 0.1771060973405838, -0.06154841557145119, -0.03725842013955116, -0.11984826624393463, 0.05019274353981018, -0.03675314411520958, 0.18352164328098297, -0.322346955537796, 0.057389821857213974, -0.08864139020442963, -0.050188012421131134, -0.32570600509643555, -0.08895549178123474, 0.1429615020751953, 0.06637442111968994, -0.12949785590171814, 0.14247001707553864, -0.2500573694705963, -0.20538431406021118, -0.009957616217434406, 0.19975897669792175, 0.28495076298713684, -0.46187663078308105, 0.23921053111553192, 0.47425830364227295, 0.18016913533210754, 0.18519313633441925, 0.22932438552379608, 0.5727677941322327, 0.34291234612464905, -0.07712683081626892, 0.13316702842712402, -0.29279398918151855, -0.10459539294242859, 0.10911238193511963, 0.24613627791404724, 0.11851948499679565, 0.1929728090763092, 0.17863693833351135, 0.1387581080198288, -0.24989107251167297, -0.10169096291065216, 0.13695748150348663, 0.12138425558805466, 0.06577031314373016, 0.5069161057472229, -0.1093347892165184, -0.06017845496535301, -0.23730069398880005, -0.05729586258530617, -0.5844014286994934, 0.35628801584243774, 0.2513810694217682, 0.002572137862443924, 0.1750657856464386, 0.02229340746998787, 0.10065150260925293, -0.04505053162574768, 0.16900593042373657, 0.3685019016265869, -0.08292615413665771, -0.5112868547439575, -0.10818607360124588, -0.20082807540893555, 0.22242364287376404, 0.284845232963562, 0.0031427890062332153, -0.1891964226961136, -0.12187342345714569, 0.32180196046829224, 0.23929403722286224, -0.21821534633636475, -0.09531518816947937, -0.008050613105297089, 0.363861620426178, -0.10776080191135406, -0.011908721178770065, -0.060193225741386414, 0.34367087483406067, 0.1386149823665619, -0.1657712161540985, -0.11085835099220276, 0.046406831592321396, 0.16632044315338135, -0.2091531753540039, -0.1252080649137497, -0.08509249985218048, 0.2787958085536957, 0.1645195484161377, 0.12933553755283356, 0.5429820418357849, -0.24998852610588074, 0.15482163429260254, 0.05351213365793228, -0.2545568346977234, -0.2453378438949585, 0.0778997391462326, 0.5135342478752136, 0.4587442874908447, 0.04680786281824112, -0.20053714513778687, -0.5292811393737793, 0.4081020653247833, 0.005248114466667175, -0.1563887894153595, -0.27976691722869873, 0.2843133807182312, -0.20843419432640076, -0.07795402407646179, 0.1182437539100647, 0.29384028911590576, 0.1344766914844513, 0.24747973680496216, -0.24467051029205322, -0.39313778281211853, 0.6383625268936157, -0.4809979796409607, -0.5399084091186523, 0.08545172214508057, -0.03134702891111374, 0.3270346224308014, 0.12228401750326157, -0.5806410312652588, -0.034222617745399475, 0.23063433170318604, -0.05715325474739075, -0.35007530450820923, 0.122799351811409, 0.24678269028663635, 0.1599891632795334, 0.0033067315816879272, 0.15314243733882904, 0.12833546102046967, 0.0552058145403862, 0.05028306692838669, -0.2455003559589386 ]
https://github.com/huggingface/datasets/issues/5765
Thanks @mariosasko. Now I am getting this error: ``` Traceback (most recent call last): File "client_2.py", line 138, in <module> main() File "client_2.py", line 134, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 124, in fit train(net, trainloader, epochs=1) File "client_2.py", line 78, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/saurav/.local/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1525, in __getitem__ return self._getitem( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 373, in query_table pa_subtable = _query_table_with_indices_mapping(table, key, indices=indices) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 55, in _query_table_with_indices_mapping return _query_table(table, key) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 79, in _query_table return table.fast_slice(key % table.num_rows, 1) ZeroDivisionError: integer division or modulo by zero ``` This is my code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") # tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) tokenized_datasets = tokenized_datasets.remove_columns(["text", "text_en"]) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ```
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text']
### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
550
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 Thanks @mariosasko. Now I am getting this error: ``` Traceback (most recent call last): File "client_2.py", line 138, in <module> main() File "client_2.py", line 134, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 124, in fit train(net, trainloader, epochs=1) File "client_2.py", line 78, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 49, in <listcomp> data = [self.dataset[idx] for idx in possibly_batched_index] File "/home/saurav/.local/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1525, in __getitem__ return self._getitem( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/arrow_dataset.py", line 1517, in _getitem pa_subtable = query_table(self._data, key, indices=self._indices if self._indices is not None else None) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 373, in query_table pa_subtable = _query_table_with_indices_mapping(table, key, indices=indices) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 55, in _query_table_with_indices_mapping return _query_table(table, key) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/formatting/formatting.py", line 79, in _query_table return table.fast_slice(key % table.num_rows, 1) ZeroDivisionError: integer division or modulo by zero ``` This is my code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") # tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) tokenized_datasets = tokenized_datasets.remove_columns(["text", "text_en"]) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ```
[ -0.22707095742225647, -0.15898144245147705, -0.05346143618226051, 0.1391603797674179, 0.5924882292747498, 0.03676106780767441, 0.6367816925048828, 0.27259331941604614, 0.05489131808280945, 0.40304070711135864, -0.13724076747894287, 0.38791391253471375, -0.16426730155944824, -0.3143731653690338, -0.08134152740240097, -0.21842747926712036, 0.07044854760169983, -0.0325014591217041, 0.24086961150169373, -0.13527974486351013, -0.21893242001533508, 0.031180499121546745, -0.22303235530853271, 0.182479590177536, -0.505091667175293, -0.14745154976844788, 0.11956603825092316, -0.1630776822566986, 0.06577171385288239, -0.32028713822364807, -0.04688256233930588, -0.20513838529586792, 0.2504660487174988, 0.4125286042690277, -0.00011158114648424089, 0.02161279320716858, 0.3682352900505066, -0.23832610249519348, -0.24665674567222595, -0.27624744176864624, 0.2754460275173187, 0.13193966448307037, -0.011380922049283981, -0.36616504192352295, 0.02411101758480072, -0.09989137947559357, 0.010076185688376427, -0.2526741921901703, 0.15732108056545258, 0.46292632818222046, 0.20853891968727112, 0.3006960451602936, 0.10770581662654877, -0.16412679851055145, 0.006468396633863449, 0.08804261684417725, -0.048153817653656006, -0.1428634226322174, 0.34960076212882996, 0.22336246073246002, -0.20230388641357422, 0.4663708508014679, -0.11048776656389236, -0.16544657945632935, -0.12902399897575378, 0.10161423683166504, -0.15370623767375946, -0.36822986602783203, 0.051899254322052, -0.15829448401927948, 0.18955501914024353, -0.0869954526424408, -0.33825957775115967, 0.02444831281900406, -0.04222766309976578, -0.2964789867401123, 0.23154915869235992, 0.11885152012109756, -0.21122610569000244, 0.09493783116340637, -0.14012891054153442, 0.2544289827346802, -0.07419987767934799, 0.15046310424804688, 0.11241160333156586, 0.6090826988220215, -0.00486312061548233, 0.11557814478874207, 0.11871728301048279, -0.19081240892410278, 0.4064076840877533, -0.0028589628636837006, 0.21241313219070435, 0.21508923172950745, -0.30197906494140625, -0.2985120415687561, -0.24144485592842102, -0.4212414622306824, 0.09634588658809662, 0.10362169146537781, -0.026749273762106895, -0.0502551794052124, -0.09410685300827026, 0.12854763865470886, -0.13429498672485352, 0.44795936346054077, 0.08792128413915634, 0.4682621359825134, 0.08095411956310272, 0.10258777439594269, -0.029544834047555923, -0.1742078959941864, -0.362698495388031, -0.123123899102211, 0.1251644492149353, 0.31376412510871887, -0.03573652729392052, 0.08133295178413391, -0.5532781481742859, 0.1400408148765564, -0.2868460416793823, 0.02125067263841629, 0.14922872185707092, 0.4346259832382202, 0.17153620719909668, 0.21371537446975708, 0.2468288540840149, 0.2169916033744812, -0.02584715187549591, -0.287635862827301, -0.16820038855075836, 0.20109304785728455, -0.17950034141540527, -0.20442649722099304, 0.019693218171596527, -0.0819506049156189, 0.431205689907074, -0.0768827497959137, 0.1394256353378296, -0.08921302109956741, 0.05629904568195343, -0.19159311056137085, 0.20934201776981354, 0.09089016914367676, 0.2013329416513443, 0.14973443746566772, 0.4264281392097473, -0.2862531542778015, 0.00511816143989563, 0.25985753536224365, -0.2932894229888916, -0.261034220457077, -0.02750636264681816, 0.20450256764888763, 0.4427540898323059, -0.10731380432844162, 0.1327940672636032, 0.004981255158782005, 0.47998183965682983, 0.0007614567875862122, 0.11954745650291443, -0.0758846178650856, 0.10514195263385773, -0.12533092498779297, 0.10959462076425552, 0.31247463822364807, -0.09147486835718155, -0.1784079670906067, 0.19371095299720764, 0.07089196145534515, 0.23038934171199799, 0.48705726861953735, -0.2050355225801468, 0.27525216341018677, -0.07033924758434296, 0.42463380098342896, 0.343469500541687, -0.3676389157772064, -0.1543380320072174, 0.16695424914360046, -0.0035423636436462402, -0.16741587221622467, 0.15658977627754211, 0.04294673725962639, 0.06462413817644119, -0.12909521162509918, 0.44544172286987305, 0.20131981372833252, -0.11658148467540741, -0.04360786825418472, -0.18304327130317688, -0.22044797241687775, 0.3023865222930908, 0.15459546446800232, 0.2868271768093109, 0.09023349732160568, -0.05740399286150932, 0.1613752394914627, 0.03663575276732445, -0.21214932203292847, -0.10619688034057617, 0.13042543828487396, 0.1467326581478119, 0.05656977370381355, -0.11834420263767242, -0.03713824972510338, 0.2762080729007721, -0.16624543070793152, 0.15614889562129974, 0.1642962098121643, -0.3623613119125366, -0.16075637936592102, -0.04109422117471695, 0.060608670115470886, -0.2900463938713074, -0.33223196864128113, 0.14342175424098969, 0.12553799152374268, -0.10936389863491058, -0.1008637547492981, -0.27727070450782776, -0.0160880908370018, -0.3379668593406677, 0.03395849093794823, -0.4881877899169922, 0.1611640304327011, -0.30481234192848206, -0.2975989878177643, -0.2511018216609955, -0.004455134272575378, 0.2967945337295532, 0.029460754245519638, -0.3077855110168457, 0.34017980098724365, 0.0503411591053009, -0.39103734493255615, -0.13535529375076294, 0.04638376832008362, 0.14528343081474304, -0.2763221561908722, 0.013853562995791435, 0.3505251407623291, 0.14023597538471222, 0.012317046523094177, 0.10627764463424683, 0.3894713521003723, -0.15574632585048676, 0.13922280073165894, -0.0535939559340477, 0.19763118028640747, 0.4785841703414917, -0.0008494630455970764, -0.1087101399898529, -0.2584361433982849, 0.2304900884628296, -0.06427685171365738, 0.19807985424995422, -0.2739953398704529, -0.3859012722969055, -0.35830631852149963, 0.23885908722877502, 0.12498622387647629, 0.09054658561944962, 0.16550946235656738, -0.14738966524600983, 0.2546381950378418, -0.10610602796077728, -0.2605803608894348, 0.34398412704467773, 0.12839430570602417, -0.3615087568759918, -0.05811918526887894, 0.1630464494228363, -0.10535653680562973, 0.2408810257911682, 0.02428189478814602, -0.1299818903207779, 0.2656014561653137, -0.012600891292095184, 0.14802004396915436, -0.2440974861383438, -0.1888498067855835, -0.1196012869477272, 0.18084605038166046, -0.26580268144607544, 0.09858725965023041, -0.05124182626605034, -0.03214231878519058, -0.20223480463027954, -0.31423234939575195, 0.09205430746078491, -0.12244905531406403, 0.05107170715928078, 0.03596845269203186, -0.21070554852485657, 0.5327699780464172, 0.16354049742221832, 0.020891547203063965, 0.3033285140991211, -0.03920850157737732, -0.12570688128471375, 0.004776895046234131, -0.12850309908390045, 0.07071035355329514, 0.10689427703619003, -0.29650309681892395, 0.2287900149822235, -0.2638397812843323, 0.13523338735103607, -0.20852339267730713, -0.2726563513278961, 0.10312335193157196, -0.22567607462406158, 0.012183548882603645, 0.1613428294658661, 0.011286024004220963, -0.008636273443698883, -0.6732563972473145, 0.36264702677726746, -0.13725504279136658, -0.09386780112981796, 0.11114571988582611, 0.2674482464790344, -0.2701221704483032, -0.11418542265892029, -0.29398128390312195, -0.35151541233062744, -0.27761244773864746, -0.33253878355026245, 0.07777568697929382, 0.1541275829076767, 0.23076245188713074, 0.20777897536754608, 0.18801023066043854, 0.33438748121261597, -0.21077826619148254, -0.17667487263679504, -0.14451779425144196, 0.48520222306251526, -0.24187412858009338, -0.25166943669319153, -0.09061644971370697, -0.1335986852645874, 0.15754453837871552, 0.11914373189210892, -0.23990941047668457, -0.12333011627197266, -0.09584340453147888, 0.03373049199581146, -0.1583523452281952, 0.17873574793338776, 0.4704285264015198, 0.08344651758670807, -0.07961732149124146, -0.06913600862026215, -0.25330275297164917, 0.041770078241825104, -0.2139396220445633, 0.33796000480651855, -0.21045367419719696, 0.6461179256439209, 0.12386645376682281, 0.6803543567657471, 0.16859500110149384, -0.3057551980018616, 0.3437865376472473, 0.010823054239153862, 0.15125082433223724, -0.1399816870689392, -0.47955262660980225, -0.23639902472496033, -0.14482194185256958, -0.0721074715256691, 0.19126972556114197, -0.2562350630760193, -0.2507924437522888, -0.16344821453094482, -0.1191924661397934, -0.2326229065656662, -0.08640282601118088, 0.37604421377182007, -0.25262460112571716, 0.2644343376159668, -0.2008819580078125, 0.348736435174942, -0.18770462274551392, 0.07049990445375443, 0.10643839091062546, 0.019903307780623436, 0.16922451555728912, -0.1969931423664093, -0.15606160461902618, 0.030022144317626953, -0.14009669423103333, 0.3398590087890625, 0.10257837176322937, 0.5419589281082153, -0.11286137253046036, 0.038841262459754944, -0.09391644597053528, 0.07883108407258987, 0.4349493086338043, -0.12250878661870956, -0.2730678617954254, -0.003752797842025757, -0.11388079077005386, -0.010278768837451935, -0.0072467997670173645, -0.4441862106323242, -0.15309134125709534, 0.2874632179737091, 0.4544239640235901, -0.24972577393054962, 0.011706594377756119, 0.16849665343761444, -0.026409121230244637, -0.1326700747013092, 0.04478278011083603, -0.2752780616283417, -0.2325657308101654, -0.6081133484840393, 0.22087010741233826, 0.33642059564590454, 0.2517566680908203, 0.05707569420337677, 0.25142624974250793, -0.1278662532567978, -0.1132812350988388, 0.2539786994457245, -0.07284785062074661, 0.12910503149032593, 0.029037341475486755, -0.02016386389732361, -0.025122620165348053, 0.2182382494211197, 0.07244793325662613, 0.32009392976760864, 0.10309578478336334, -0.5416263937950134, -0.053529515862464905, -0.1330356001853943, 0.28103384375572205, 0.3188333511352539, -0.1211620420217514, -0.027933664619922638, -0.04165811091661453, 0.14068959653377533, 0.1159895658493042, 0.16686473786830902, 0.38165807723999023, 0.12462837994098663, -0.5428383350372314, -0.3261312246322632, 0.05403246358036995, -0.01071251928806305, 0.1553594321012497, 0.3192477524280548, -0.1290578991174698, -0.3175480365753174, 0.6128234267234802, 0.4199717342853546, 1.0334348678588867, 0.23000136017799377, 0.07247032225131989, 0.12974782288074493, 0.1567099243402481, -0.0669136643409729, -0.2685859799385071, 0.11520418524742126, -0.3953932523727417, -0.366939902305603, -0.04878661409020424, -0.09359781444072723, 0.2817918658256531, 0.16307973861694336, -0.417449951171875, 0.14063593745231628, -0.37435269355773926, 0.17490176856517792, 0.0339587926864624, 0.11054601520299911, -0.3060939311981201, -0.33883774280548096, -0.028091859072446823, 0.17443108558654785, -0.08154024183750153, 0.08153842389583588, 0.03990708664059639, -0.13831210136413574, -0.10799102485179901, -0.42088258266448975, -0.3158876299858093, 0.19956785440444946, -0.35154688358306885, 0.30178165435791016, 0.09415283799171448, -0.06231775879859924, 0.29849159717559814, 0.3336353898048401, 0.5592120289802551, 0.2546544075012207, 0.05657017230987549, 0.17887741327285767, 0.19385232031345367, 0.05083033815026283, 0.05625094100832939, -0.02146836742758751, 0.4157039523124695, -0.13075317442417145, -0.03139200806617737, 0.3998894989490509, 0.23160913586616516, -0.35096487402915955, -0.2608662247657776, -0.12932029366493225, 0.3666922152042389, -0.5793744921684265, -0.2232840657234192, -0.1463727355003357, -0.18971632421016693, -0.2468787133693695, 0.12715022265911102, 0.019990287721157074, -0.2826106548309326, -0.15549537539482117, 0.0058752098120749, -0.038573719561100006, -0.01966765522956848, 0.22743910551071167, 0.12812554836273193, -0.2528255879878998, 0.5689960718154907, -0.04697289317846298, -0.26809948682785034, -0.2420220971107483, 0.22347918152809143, 0.26758524775505066, -0.6850436925888062, 0.07907547056674957, -0.20414726436138153, -0.21038241684436798, -0.23065254092216492, 0.295639306306839, 0.05722089856863022, 0.3646165132522583, -0.10624182969331741, -0.24505652487277985, -0.5253615379333496, 0.001174958422780037, 0.09485756605863571, 0.2573859989643097, -0.15642818808555603, 0.2939724326133728, -0.25602465867996216, 0.06286565214395523, -0.3175482451915741, -0.14609214663505554, -0.309264600276947, 0.259377121925354, -0.26135069131851196, -0.06849423795938492, 0.05307032912969589, 0.19617676734924316, 0.1489628106355667, 0.37312766909599304, -0.027503959834575653, -0.20647671818733215, -0.17334043979644775, 0.12141673266887665, 0.30394765734672546, -0.33221226930618286, -0.187453955411911, -0.00771506130695343, -0.02124321646988392, -0.33559954166412354, -0.11054401099681854, 0.173043891787529, 0.047333139926195145, 0.23518669605255127, 0.2801858186721802, 0.2659336030483246, 0.13718685507774353, -0.2378850281238556, -0.14035660028457642, 0.28451675176620483, 0.12710225582122803, -0.16631709039211273, 0.002706516534090042, -0.0660238191485405, -0.3232019245624542, 0.22201485931873322, 0.43126267194747925, 0.2866007089614868, 0.11172106862068176, -0.4801174998283386, 0.03755304962396622, 0.09644980728626251, -0.09952548891305923, 0.0687284916639328, -0.5602134466171265, -0.11889263987541199, 0.3996785581111908, 0.27513325214385986, -0.2472565472126007, 0.07257194817066193, -0.30780524015426636, -0.16773957014083862, -0.1191699281334877, 0.2752785384654999, -0.02173532545566559, 0.09925267100334167, 0.3631536662578583, 0.0013157650828361511, 0.3692479431629181, -0.224326491355896, 0.1858634352684021, 0.36590611934661865, -0.14515532553195953, 0.10238155722618103, 0.12209798395633698, -0.03331024944782257, 0.0057236142456531525, 0.17878082394599915, -0.27218663692474365, 0.253518670797348, 0.059551067650318146, -0.11990571767091751, 0.013721030205488205, 0.04003886133432388, -0.257620632648468, -0.30862492322921753, -0.11399180442094803, 0.1771060973405838, -0.06154841557145119, -0.03725842013955116, -0.11984826624393463, 0.05019274353981018, -0.03675314411520958, 0.18352164328098297, -0.322346955537796, 0.057389821857213974, -0.08864139020442963, -0.050188012421131134, -0.32570600509643555, -0.08895549178123474, 0.1429615020751953, 0.06637442111968994, -0.12949785590171814, 0.14247001707553864, -0.2500573694705963, -0.20538431406021118, -0.009957616217434406, 0.19975897669792175, 0.28495076298713684, -0.46187663078308105, 0.23921053111553192, 0.47425830364227295, 0.18016913533210754, 0.18519313633441925, 0.22932438552379608, 0.5727677941322327, 0.34291234612464905, -0.07712683081626892, 0.13316702842712402, -0.29279398918151855, -0.10459539294242859, 0.10911238193511963, 0.24613627791404724, 0.11851948499679565, 0.1929728090763092, 0.17863693833351135, 0.1387581080198288, -0.24989107251167297, -0.10169096291065216, 0.13695748150348663, 0.12138425558805466, 0.06577031314373016, 0.5069161057472229, -0.1093347892165184, -0.06017845496535301, -0.23730069398880005, -0.05729586258530617, -0.5844014286994934, 0.35628801584243774, 0.2513810694217682, 0.002572137862443924, 0.1750657856464386, 0.02229340746998787, 0.10065150260925293, -0.04505053162574768, 0.16900593042373657, 0.3685019016265869, -0.08292615413665771, -0.5112868547439575, -0.10818607360124588, -0.20082807540893555, 0.22242364287376404, 0.284845232963562, 0.0031427890062332153, -0.1891964226961136, -0.12187342345714569, 0.32180196046829224, 0.23929403722286224, -0.21821534633636475, -0.09531518816947937, -0.008050613105297089, 0.363861620426178, -0.10776080191135406, -0.011908721178770065, -0.060193225741386414, 0.34367087483406067, 0.1386149823665619, -0.1657712161540985, -0.11085835099220276, 0.046406831592321396, 0.16632044315338135, -0.2091531753540039, -0.1252080649137497, -0.08509249985218048, 0.2787958085536957, 0.1645195484161377, 0.12933553755283356, 0.5429820418357849, -0.24998852610588074, 0.15482163429260254, 0.05351213365793228, -0.2545568346977234, -0.2453378438949585, 0.0778997391462326, 0.5135342478752136, 0.4587442874908447, 0.04680786281824112, -0.20053714513778687, -0.5292811393737793, 0.4081020653247833, 0.005248114466667175, -0.1563887894153595, -0.27976691722869873, 0.2843133807182312, -0.20843419432640076, -0.07795402407646179, 0.1182437539100647, 0.29384028911590576, 0.1344766914844513, 0.24747973680496216, -0.24467051029205322, -0.39313778281211853, 0.6383625268936157, -0.4809979796409607, -0.5399084091186523, 0.08545172214508057, -0.03134702891111374, 0.3270346224308014, 0.12228401750326157, -0.5806410312652588, -0.034222617745399475, 0.23063433170318604, -0.05715325474739075, -0.35007530450820923, 0.122799351811409, 0.24678269028663635, 0.1599891632795334, 0.0033067315816879272, 0.15314243733882904, 0.12833546102046967, 0.0552058145403862, 0.05028306692838669, -0.2455003559589386 ]
https://github.com/huggingface/datasets/issues/5765
Please also remove/comment these lines: ```python tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") ```
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text']
### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
16
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 Please also remove/comment these lines: ```python tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") ```
[ -0.22707095742225647, -0.15898144245147705, -0.05346143618226051, 0.1391603797674179, 0.5924882292747498, 0.03676106780767441, 0.6367816925048828, 0.27259331941604614, 0.05489131808280945, 0.40304070711135864, -0.13724076747894287, 0.38791391253471375, -0.16426730155944824, -0.3143731653690338, -0.08134152740240097, -0.21842747926712036, 0.07044854760169983, -0.0325014591217041, 0.24086961150169373, -0.13527974486351013, -0.21893242001533508, 0.031180499121546745, -0.22303235530853271, 0.182479590177536, -0.505091667175293, -0.14745154976844788, 0.11956603825092316, -0.1630776822566986, 0.06577171385288239, -0.32028713822364807, -0.04688256233930588, -0.20513838529586792, 0.2504660487174988, 0.4125286042690277, -0.00011158114648424089, 0.02161279320716858, 0.3682352900505066, -0.23832610249519348, -0.24665674567222595, -0.27624744176864624, 0.2754460275173187, 0.13193966448307037, -0.011380922049283981, -0.36616504192352295, 0.02411101758480072, -0.09989137947559357, 0.010076185688376427, -0.2526741921901703, 0.15732108056545258, 0.46292632818222046, 0.20853891968727112, 0.3006960451602936, 0.10770581662654877, -0.16412679851055145, 0.006468396633863449, 0.08804261684417725, -0.048153817653656006, -0.1428634226322174, 0.34960076212882996, 0.22336246073246002, -0.20230388641357422, 0.4663708508014679, -0.11048776656389236, -0.16544657945632935, -0.12902399897575378, 0.10161423683166504, -0.15370623767375946, -0.36822986602783203, 0.051899254322052, -0.15829448401927948, 0.18955501914024353, -0.0869954526424408, -0.33825957775115967, 0.02444831281900406, -0.04222766309976578, -0.2964789867401123, 0.23154915869235992, 0.11885152012109756, -0.21122610569000244, 0.09493783116340637, -0.14012891054153442, 0.2544289827346802, -0.07419987767934799, 0.15046310424804688, 0.11241160333156586, 0.6090826988220215, -0.00486312061548233, 0.11557814478874207, 0.11871728301048279, -0.19081240892410278, 0.4064076840877533, -0.0028589628636837006, 0.21241313219070435, 0.21508923172950745, -0.30197906494140625, -0.2985120415687561, -0.24144485592842102, -0.4212414622306824, 0.09634588658809662, 0.10362169146537781, -0.026749273762106895, -0.0502551794052124, -0.09410685300827026, 0.12854763865470886, -0.13429498672485352, 0.44795936346054077, 0.08792128413915634, 0.4682621359825134, 0.08095411956310272, 0.10258777439594269, -0.029544834047555923, -0.1742078959941864, -0.362698495388031, -0.123123899102211, 0.1251644492149353, 0.31376412510871887, -0.03573652729392052, 0.08133295178413391, -0.5532781481742859, 0.1400408148765564, -0.2868460416793823, 0.02125067263841629, 0.14922872185707092, 0.4346259832382202, 0.17153620719909668, 0.21371537446975708, 0.2468288540840149, 0.2169916033744812, -0.02584715187549591, -0.287635862827301, -0.16820038855075836, 0.20109304785728455, -0.17950034141540527, -0.20442649722099304, 0.019693218171596527, -0.0819506049156189, 0.431205689907074, -0.0768827497959137, 0.1394256353378296, -0.08921302109956741, 0.05629904568195343, -0.19159311056137085, 0.20934201776981354, 0.09089016914367676, 0.2013329416513443, 0.14973443746566772, 0.4264281392097473, -0.2862531542778015, 0.00511816143989563, 0.25985753536224365, -0.2932894229888916, -0.261034220457077, -0.02750636264681816, 0.20450256764888763, 0.4427540898323059, -0.10731380432844162, 0.1327940672636032, 0.004981255158782005, 0.47998183965682983, 0.0007614567875862122, 0.11954745650291443, -0.0758846178650856, 0.10514195263385773, -0.12533092498779297, 0.10959462076425552, 0.31247463822364807, -0.09147486835718155, -0.1784079670906067, 0.19371095299720764, 0.07089196145534515, 0.23038934171199799, 0.48705726861953735, -0.2050355225801468, 0.27525216341018677, -0.07033924758434296, 0.42463380098342896, 0.343469500541687, -0.3676389157772064, -0.1543380320072174, 0.16695424914360046, -0.0035423636436462402, -0.16741587221622467, 0.15658977627754211, 0.04294673725962639, 0.06462413817644119, -0.12909521162509918, 0.44544172286987305, 0.20131981372833252, -0.11658148467540741, -0.04360786825418472, -0.18304327130317688, -0.22044797241687775, 0.3023865222930908, 0.15459546446800232, 0.2868271768093109, 0.09023349732160568, -0.05740399286150932, 0.1613752394914627, 0.03663575276732445, -0.21214932203292847, -0.10619688034057617, 0.13042543828487396, 0.1467326581478119, 0.05656977370381355, -0.11834420263767242, -0.03713824972510338, 0.2762080729007721, -0.16624543070793152, 0.15614889562129974, 0.1642962098121643, -0.3623613119125366, -0.16075637936592102, -0.04109422117471695, 0.060608670115470886, -0.2900463938713074, -0.33223196864128113, 0.14342175424098969, 0.12553799152374268, -0.10936389863491058, -0.1008637547492981, -0.27727070450782776, -0.0160880908370018, -0.3379668593406677, 0.03395849093794823, -0.4881877899169922, 0.1611640304327011, -0.30481234192848206, -0.2975989878177643, -0.2511018216609955, -0.004455134272575378, 0.2967945337295532, 0.029460754245519638, -0.3077855110168457, 0.34017980098724365, 0.0503411591053009, -0.39103734493255615, -0.13535529375076294, 0.04638376832008362, 0.14528343081474304, -0.2763221561908722, 0.013853562995791435, 0.3505251407623291, 0.14023597538471222, 0.012317046523094177, 0.10627764463424683, 0.3894713521003723, -0.15574632585048676, 0.13922280073165894, -0.0535939559340477, 0.19763118028640747, 0.4785841703414917, -0.0008494630455970764, -0.1087101399898529, -0.2584361433982849, 0.2304900884628296, -0.06427685171365738, 0.19807985424995422, -0.2739953398704529, -0.3859012722969055, -0.35830631852149963, 0.23885908722877502, 0.12498622387647629, 0.09054658561944962, 0.16550946235656738, -0.14738966524600983, 0.2546381950378418, -0.10610602796077728, -0.2605803608894348, 0.34398412704467773, 0.12839430570602417, -0.3615087568759918, -0.05811918526887894, 0.1630464494228363, -0.10535653680562973, 0.2408810257911682, 0.02428189478814602, -0.1299818903207779, 0.2656014561653137, -0.012600891292095184, 0.14802004396915436, -0.2440974861383438, -0.1888498067855835, -0.1196012869477272, 0.18084605038166046, -0.26580268144607544, 0.09858725965023041, -0.05124182626605034, -0.03214231878519058, -0.20223480463027954, -0.31423234939575195, 0.09205430746078491, -0.12244905531406403, 0.05107170715928078, 0.03596845269203186, -0.21070554852485657, 0.5327699780464172, 0.16354049742221832, 0.020891547203063965, 0.3033285140991211, -0.03920850157737732, -0.12570688128471375, 0.004776895046234131, -0.12850309908390045, 0.07071035355329514, 0.10689427703619003, -0.29650309681892395, 0.2287900149822235, -0.2638397812843323, 0.13523338735103607, -0.20852339267730713, -0.2726563513278961, 0.10312335193157196, -0.22567607462406158, 0.012183548882603645, 0.1613428294658661, 0.011286024004220963, -0.008636273443698883, -0.6732563972473145, 0.36264702677726746, -0.13725504279136658, -0.09386780112981796, 0.11114571988582611, 0.2674482464790344, -0.2701221704483032, -0.11418542265892029, -0.29398128390312195, -0.35151541233062744, -0.27761244773864746, -0.33253878355026245, 0.07777568697929382, 0.1541275829076767, 0.23076245188713074, 0.20777897536754608, 0.18801023066043854, 0.33438748121261597, -0.21077826619148254, -0.17667487263679504, -0.14451779425144196, 0.48520222306251526, -0.24187412858009338, -0.25166943669319153, -0.09061644971370697, -0.1335986852645874, 0.15754453837871552, 0.11914373189210892, -0.23990941047668457, -0.12333011627197266, -0.09584340453147888, 0.03373049199581146, -0.1583523452281952, 0.17873574793338776, 0.4704285264015198, 0.08344651758670807, -0.07961732149124146, -0.06913600862026215, -0.25330275297164917, 0.041770078241825104, -0.2139396220445633, 0.33796000480651855, -0.21045367419719696, 0.6461179256439209, 0.12386645376682281, 0.6803543567657471, 0.16859500110149384, -0.3057551980018616, 0.3437865376472473, 0.010823054239153862, 0.15125082433223724, -0.1399816870689392, -0.47955262660980225, -0.23639902472496033, -0.14482194185256958, -0.0721074715256691, 0.19126972556114197, -0.2562350630760193, -0.2507924437522888, -0.16344821453094482, -0.1191924661397934, -0.2326229065656662, -0.08640282601118088, 0.37604421377182007, -0.25262460112571716, 0.2644343376159668, -0.2008819580078125, 0.348736435174942, -0.18770462274551392, 0.07049990445375443, 0.10643839091062546, 0.019903307780623436, 0.16922451555728912, -0.1969931423664093, -0.15606160461902618, 0.030022144317626953, -0.14009669423103333, 0.3398590087890625, 0.10257837176322937, 0.5419589281082153, -0.11286137253046036, 0.038841262459754944, -0.09391644597053528, 0.07883108407258987, 0.4349493086338043, -0.12250878661870956, -0.2730678617954254, -0.003752797842025757, -0.11388079077005386, -0.010278768837451935, -0.0072467997670173645, -0.4441862106323242, -0.15309134125709534, 0.2874632179737091, 0.4544239640235901, -0.24972577393054962, 0.011706594377756119, 0.16849665343761444, -0.026409121230244637, -0.1326700747013092, 0.04478278011083603, -0.2752780616283417, -0.2325657308101654, -0.6081133484840393, 0.22087010741233826, 0.33642059564590454, 0.2517566680908203, 0.05707569420337677, 0.25142624974250793, -0.1278662532567978, -0.1132812350988388, 0.2539786994457245, -0.07284785062074661, 0.12910503149032593, 0.029037341475486755, -0.02016386389732361, -0.025122620165348053, 0.2182382494211197, 0.07244793325662613, 0.32009392976760864, 0.10309578478336334, -0.5416263937950134, -0.053529515862464905, -0.1330356001853943, 0.28103384375572205, 0.3188333511352539, -0.1211620420217514, -0.027933664619922638, -0.04165811091661453, 0.14068959653377533, 0.1159895658493042, 0.16686473786830902, 0.38165807723999023, 0.12462837994098663, -0.5428383350372314, -0.3261312246322632, 0.05403246358036995, -0.01071251928806305, 0.1553594321012497, 0.3192477524280548, -0.1290578991174698, -0.3175480365753174, 0.6128234267234802, 0.4199717342853546, 1.0334348678588867, 0.23000136017799377, 0.07247032225131989, 0.12974782288074493, 0.1567099243402481, -0.0669136643409729, -0.2685859799385071, 0.11520418524742126, -0.3953932523727417, -0.366939902305603, -0.04878661409020424, -0.09359781444072723, 0.2817918658256531, 0.16307973861694336, -0.417449951171875, 0.14063593745231628, -0.37435269355773926, 0.17490176856517792, 0.0339587926864624, 0.11054601520299911, -0.3060939311981201, -0.33883774280548096, -0.028091859072446823, 0.17443108558654785, -0.08154024183750153, 0.08153842389583588, 0.03990708664059639, -0.13831210136413574, -0.10799102485179901, -0.42088258266448975, -0.3158876299858093, 0.19956785440444946, -0.35154688358306885, 0.30178165435791016, 0.09415283799171448, -0.06231775879859924, 0.29849159717559814, 0.3336353898048401, 0.5592120289802551, 0.2546544075012207, 0.05657017230987549, 0.17887741327285767, 0.19385232031345367, 0.05083033815026283, 0.05625094100832939, -0.02146836742758751, 0.4157039523124695, -0.13075317442417145, -0.03139200806617737, 0.3998894989490509, 0.23160913586616516, -0.35096487402915955, -0.2608662247657776, -0.12932029366493225, 0.3666922152042389, -0.5793744921684265, -0.2232840657234192, -0.1463727355003357, -0.18971632421016693, -0.2468787133693695, 0.12715022265911102, 0.019990287721157074, -0.2826106548309326, -0.15549537539482117, 0.0058752098120749, -0.038573719561100006, -0.01966765522956848, 0.22743910551071167, 0.12812554836273193, -0.2528255879878998, 0.5689960718154907, -0.04697289317846298, -0.26809948682785034, -0.2420220971107483, 0.22347918152809143, 0.26758524775505066, -0.6850436925888062, 0.07907547056674957, -0.20414726436138153, -0.21038241684436798, -0.23065254092216492, 0.295639306306839, 0.05722089856863022, 0.3646165132522583, -0.10624182969331741, -0.24505652487277985, -0.5253615379333496, 0.001174958422780037, 0.09485756605863571, 0.2573859989643097, -0.15642818808555603, 0.2939724326133728, -0.25602465867996216, 0.06286565214395523, -0.3175482451915741, -0.14609214663505554, -0.309264600276947, 0.259377121925354, -0.26135069131851196, -0.06849423795938492, 0.05307032912969589, 0.19617676734924316, 0.1489628106355667, 0.37312766909599304, -0.027503959834575653, -0.20647671818733215, -0.17334043979644775, 0.12141673266887665, 0.30394765734672546, -0.33221226930618286, -0.187453955411911, -0.00771506130695343, -0.02124321646988392, -0.33559954166412354, -0.11054401099681854, 0.173043891787529, 0.047333139926195145, 0.23518669605255127, 0.2801858186721802, 0.2659336030483246, 0.13718685507774353, -0.2378850281238556, -0.14035660028457642, 0.28451675176620483, 0.12710225582122803, -0.16631709039211273, 0.002706516534090042, -0.0660238191485405, -0.3232019245624542, 0.22201485931873322, 0.43126267194747925, 0.2866007089614868, 0.11172106862068176, -0.4801174998283386, 0.03755304962396622, 0.09644980728626251, -0.09952548891305923, 0.0687284916639328, -0.5602134466171265, -0.11889263987541199, 0.3996785581111908, 0.27513325214385986, -0.2472565472126007, 0.07257194817066193, -0.30780524015426636, -0.16773957014083862, -0.1191699281334877, 0.2752785384654999, -0.02173532545566559, 0.09925267100334167, 0.3631536662578583, 0.0013157650828361511, 0.3692479431629181, -0.224326491355896, 0.1858634352684021, 0.36590611934661865, -0.14515532553195953, 0.10238155722618103, 0.12209798395633698, -0.03331024944782257, 0.0057236142456531525, 0.17878082394599915, -0.27218663692474365, 0.253518670797348, 0.059551067650318146, -0.11990571767091751, 0.013721030205488205, 0.04003886133432388, -0.257620632648468, -0.30862492322921753, -0.11399180442094803, 0.1771060973405838, -0.06154841557145119, -0.03725842013955116, -0.11984826624393463, 0.05019274353981018, -0.03675314411520958, 0.18352164328098297, -0.322346955537796, 0.057389821857213974, -0.08864139020442963, -0.050188012421131134, -0.32570600509643555, -0.08895549178123474, 0.1429615020751953, 0.06637442111968994, -0.12949785590171814, 0.14247001707553864, -0.2500573694705963, -0.20538431406021118, -0.009957616217434406, 0.19975897669792175, 0.28495076298713684, -0.46187663078308105, 0.23921053111553192, 0.47425830364227295, 0.18016913533210754, 0.18519313633441925, 0.22932438552379608, 0.5727677941322327, 0.34291234612464905, -0.07712683081626892, 0.13316702842712402, -0.29279398918151855, -0.10459539294242859, 0.10911238193511963, 0.24613627791404724, 0.11851948499679565, 0.1929728090763092, 0.17863693833351135, 0.1387581080198288, -0.24989107251167297, -0.10169096291065216, 0.13695748150348663, 0.12138425558805466, 0.06577031314373016, 0.5069161057472229, -0.1093347892165184, -0.06017845496535301, -0.23730069398880005, -0.05729586258530617, -0.5844014286994934, 0.35628801584243774, 0.2513810694217682, 0.002572137862443924, 0.1750657856464386, 0.02229340746998787, 0.10065150260925293, -0.04505053162574768, 0.16900593042373657, 0.3685019016265869, -0.08292615413665771, -0.5112868547439575, -0.10818607360124588, -0.20082807540893555, 0.22242364287376404, 0.284845232963562, 0.0031427890062332153, -0.1891964226961136, -0.12187342345714569, 0.32180196046829224, 0.23929403722286224, -0.21821534633636475, -0.09531518816947937, -0.008050613105297089, 0.363861620426178, -0.10776080191135406, -0.011908721178770065, -0.060193225741386414, 0.34367087483406067, 0.1386149823665619, -0.1657712161540985, -0.11085835099220276, 0.046406831592321396, 0.16632044315338135, -0.2091531753540039, -0.1252080649137497, -0.08509249985218048, 0.2787958085536957, 0.1645195484161377, 0.12933553755283356, 0.5429820418357849, -0.24998852610588074, 0.15482163429260254, 0.05351213365793228, -0.2545568346977234, -0.2453378438949585, 0.0778997391462326, 0.5135342478752136, 0.4587442874908447, 0.04680786281824112, -0.20053714513778687, -0.5292811393737793, 0.4081020653247833, 0.005248114466667175, -0.1563887894153595, -0.27976691722869873, 0.2843133807182312, -0.20843419432640076, -0.07795402407646179, 0.1182437539100647, 0.29384028911590576, 0.1344766914844513, 0.24747973680496216, -0.24467051029205322, -0.39313778281211853, 0.6383625268936157, -0.4809979796409607, -0.5399084091186523, 0.08545172214508057, -0.03134702891111374, 0.3270346224308014, 0.12228401750326157, -0.5806410312652588, -0.034222617745399475, 0.23063433170318604, -0.05715325474739075, -0.35007530450820923, 0.122799351811409, 0.24678269028663635, 0.1599891632795334, 0.0033067315816879272, 0.15314243733882904, 0.12833546102046967, 0.0552058145403862, 0.05028306692838669, -0.2455003559589386 ]
https://github.com/huggingface/datasets/issues/5765
Thanks @mariosasko . Now, I am trying out this [tutorial](https://flower.dev/docs/quickstart-huggingface.html) which basically trains distil-BERT with IMDB dataset (very similar to this [tutorial](https://huggingface.co/docs/transformers/main/tasks/sequence_classification)). But I don't know why my accuracy isn't increasing even after training for a significant amount of time and also by using the entire dataset. Below I have attached `client.py` file: `client.py`: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW warnings.filterwarnings("ignore", category=UserWarning) DEVICE = "cuda:1" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("imdb") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets = tokenized_datasets.remove_columns("text") tokenized_datasets = tokenized_datasets.rename_column("label", "labels") data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-5) net.train() for i in range(epochs): print("Epoch: ", i+1) j = 1 print("####################### The length of the trainloader is: ", len(trainloader)) for batch in trainloader: print("####################### The batch number is: ", j) batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() j += 1 def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) print({"loss": float(loss), "accuracy": float(accuracy)}) return float(loss), len(testloader), {"loss": float(loss), "accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:5040", client=IMDBClient()) if __name__ == "__main__": main() ``` Can I get any help, please?
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text']
### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
376
ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ### Describe the bug Following is my code that I am trying to run, but facing an error (have attached the whole error below): My code: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW #from transformers import tokenized_datasets warnings.filterwarnings("ignore", category=UserWarning) # DEVICE = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") DEVICE = "cpu" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("yhavinga/imdb_dutch") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) # random 100 samples population = random.sample(range(len(raw_datasets["train"])), 100) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets["train"] = tokenized_datasets["train"].select(population) tokenized_datasets["test"] = tokenized_datasets["test"].select(population) # tokenized_datasets = tokenized_datasets.remove_columns("text") # tokenized_datasets = tokenized_datasets.rename_column("label", "labels") tokenized_datasets = tokenized_datasets.remove_columns("attention_mask") tokenized_datasets = tokenized_datasets.remove_columns("input_ids") tokenized_datasets = tokenized_datasets.remove_columns("label") tokenized_datasets = tokenized_datasets.remove_columns("text_en") # tokenized_datasets = tokenized_datasets.remove_columns(raw_datasets["train"].column_names) data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-4) net.train() for _ in range(epochs): for batch in trainloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) return float(loss), len(testloader), {"accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) if __name__ == "__main__": main() ``` Error: ``` Traceback (most recent call last): File "client_2.py", line 136, in <module> main() File "client_2.py", line 132, in main fl.client.start_numpy_client(server_address="localhost:8080", client=IMDBClient()) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 208, in start_numpy_client start_client( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 142, in start_client client_message, sleep_duration, keep_going = handle( File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 68, in handle return _fit(client, server_msg.fit_ins), 0, True File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/grpc_client/message_handler.py", line 157, in _fit fit_res = client.fit(fit_ins) File "/home/saurav/.local/lib/python3.8/site-packages/flwr/client/app.py", line 252, in _fit results = self.numpy_client.fit(parameters, ins.config) # type: ignore File "client_2.py", line 122, in fit train(net, trainloader, epochs=1) File "client_2.py", line 76, in train for batch in trainloader: File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 652, in __next__ data = self._next_data() File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 692, in _next_data data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/home/saurav/.local/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 52, in fetch return self.collate_fn(data) File "/home/saurav/.local/lib/python3.8/site-packages/transformers/data/data_collator.py", line 221, in __call__ batch = self.tokenizer.pad( File "/home/saurav/.local/lib/python3.8/site-packages/transformers/tokenization_utils_base.py", line 2713, in pad raise ValueError( ValueError: You should supply an encoding or a list of encodings to this method that includes input_ids, but you provided ['text'] ``` ### Steps to reproduce the bug Run the above code. ### Expected behavior Don't know, doing it for the first time. ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 Thanks @mariosasko . Now, I am trying out this [tutorial](https://flower.dev/docs/quickstart-huggingface.html) which basically trains distil-BERT with IMDB dataset (very similar to this [tutorial](https://huggingface.co/docs/transformers/main/tasks/sequence_classification)). But I don't know why my accuracy isn't increasing even after training for a significant amount of time and also by using the entire dataset. Below I have attached `client.py` file: `client.py`: ``` from collections import OrderedDict import warnings import flwr as fl import torch import numpy as np import random from torch.utils.data import DataLoader from datasets import load_dataset, load_metric from transformers import AutoTokenizer, DataCollatorWithPadding from transformers import AutoModelForSequenceClassification from transformers import AdamW warnings.filterwarnings("ignore", category=UserWarning) DEVICE = "cuda:1" CHECKPOINT = "distilbert-base-uncased" # transformer model checkpoint def load_data(): """Load IMDB data (training and eval)""" raw_datasets = load_dataset("imdb") raw_datasets = raw_datasets.shuffle(seed=42) # remove unnecessary data split del raw_datasets["unsupervised"] tokenizer = AutoTokenizer.from_pretrained(CHECKPOINT) def tokenize_function(examples): return tokenizer(examples["text"], truncation=True) tokenized_datasets = raw_datasets.map(tokenize_function, batched=True) tokenized_datasets = tokenized_datasets.remove_columns("text") tokenized_datasets = tokenized_datasets.rename_column("label", "labels") data_collator = DataCollatorWithPadding(tokenizer=tokenizer) trainloader = DataLoader( tokenized_datasets["train"], shuffle=True, batch_size=32, collate_fn=data_collator, ) testloader = DataLoader( tokenized_datasets["test"], batch_size=32, collate_fn=data_collator ) return trainloader, testloader def train(net, trainloader, epochs): optimizer = AdamW(net.parameters(), lr=5e-5) net.train() for i in range(epochs): print("Epoch: ", i+1) j = 1 print("####################### The length of the trainloader is: ", len(trainloader)) for batch in trainloader: print("####################### The batch number is: ", j) batch = {k: v.to(DEVICE) for k, v in batch.items()} outputs = net(**batch) loss = outputs.loss loss.backward() optimizer.step() optimizer.zero_grad() j += 1 def test(net, testloader): metric = load_metric("accuracy") loss = 0 net.eval() for batch in testloader: batch = {k: v.to(DEVICE) for k, v in batch.items()} with torch.no_grad(): outputs = net(**batch) logits = outputs.logits loss += outputs.loss.item() predictions = torch.argmax(logits, dim=-1) metric.add_batch(predictions=predictions, references=batch["labels"]) loss /= len(testloader.dataset) accuracy = metric.compute()["accuracy"] return loss, accuracy def main(): net = AutoModelForSequenceClassification.from_pretrained( CHECKPOINT, num_labels=2 ).to(DEVICE) trainloader, testloader = load_data() # Flower client class IMDBClient(fl.client.NumPyClient): def get_parameters(self, config): return [val.cpu().numpy() for _, val in net.state_dict().items()] def set_parameters(self, parameters): params_dict = zip(net.state_dict().keys(), parameters) state_dict = OrderedDict({k: torch.Tensor(v) for k, v in params_dict}) net.load_state_dict(state_dict, strict=True) def fit(self, parameters, config): self.set_parameters(parameters) print("Training Started...") train(net, trainloader, epochs=1) print("Training Finished.") return self.get_parameters(config={}), len(trainloader), {} def evaluate(self, parameters, config): self.set_parameters(parameters) loss, accuracy = test(net, testloader) print({"loss": float(loss), "accuracy": float(accuracy)}) return float(loss), len(testloader), {"loss": float(loss), "accuracy": float(accuracy)} # Start client fl.client.start_numpy_client(server_address="localhost:5040", client=IMDBClient()) if __name__ == "__main__": main() ``` Can I get any help, please?
[ -0.22707095742225647, -0.15898144245147705, -0.05346143618226051, 0.1391603797674179, 0.5924882292747498, 0.03676106780767441, 0.6367816925048828, 0.27259331941604614, 0.05489131808280945, 0.40304070711135864, -0.13724076747894287, 0.38791391253471375, -0.16426730155944824, -0.3143731653690338, -0.08134152740240097, -0.21842747926712036, 0.07044854760169983, -0.0325014591217041, 0.24086961150169373, -0.13527974486351013, -0.21893242001533508, 0.031180499121546745, -0.22303235530853271, 0.182479590177536, -0.505091667175293, -0.14745154976844788, 0.11956603825092316, -0.1630776822566986, 0.06577171385288239, -0.32028713822364807, -0.04688256233930588, -0.20513838529586792, 0.2504660487174988, 0.4125286042690277, -0.00011158114648424089, 0.02161279320716858, 0.3682352900505066, -0.23832610249519348, -0.24665674567222595, -0.27624744176864624, 0.2754460275173187, 0.13193966448307037, -0.011380922049283981, -0.36616504192352295, 0.02411101758480072, -0.09989137947559357, 0.010076185688376427, -0.2526741921901703, 0.15732108056545258, 0.46292632818222046, 0.20853891968727112, 0.3006960451602936, 0.10770581662654877, -0.16412679851055145, 0.006468396633863449, 0.08804261684417725, -0.048153817653656006, -0.1428634226322174, 0.34960076212882996, 0.22336246073246002, -0.20230388641357422, 0.4663708508014679, -0.11048776656389236, -0.16544657945632935, -0.12902399897575378, 0.10161423683166504, -0.15370623767375946, -0.36822986602783203, 0.051899254322052, -0.15829448401927948, 0.18955501914024353, -0.0869954526424408, -0.33825957775115967, 0.02444831281900406, -0.04222766309976578, -0.2964789867401123, 0.23154915869235992, 0.11885152012109756, -0.21122610569000244, 0.09493783116340637, -0.14012891054153442, 0.2544289827346802, -0.07419987767934799, 0.15046310424804688, 0.11241160333156586, 0.6090826988220215, -0.00486312061548233, 0.11557814478874207, 0.11871728301048279, -0.19081240892410278, 0.4064076840877533, -0.0028589628636837006, 0.21241313219070435, 0.21508923172950745, -0.30197906494140625, -0.2985120415687561, -0.24144485592842102, -0.4212414622306824, 0.09634588658809662, 0.10362169146537781, -0.026749273762106895, -0.0502551794052124, -0.09410685300827026, 0.12854763865470886, -0.13429498672485352, 0.44795936346054077, 0.08792128413915634, 0.4682621359825134, 0.08095411956310272, 0.10258777439594269, -0.029544834047555923, -0.1742078959941864, -0.362698495388031, -0.123123899102211, 0.1251644492149353, 0.31376412510871887, -0.03573652729392052, 0.08133295178413391, -0.5532781481742859, 0.1400408148765564, -0.2868460416793823, 0.02125067263841629, 0.14922872185707092, 0.4346259832382202, 0.17153620719909668, 0.21371537446975708, 0.2468288540840149, 0.2169916033744812, -0.02584715187549591, -0.287635862827301, -0.16820038855075836, 0.20109304785728455, -0.17950034141540527, -0.20442649722099304, 0.019693218171596527, -0.0819506049156189, 0.431205689907074, -0.0768827497959137, 0.1394256353378296, -0.08921302109956741, 0.05629904568195343, -0.19159311056137085, 0.20934201776981354, 0.09089016914367676, 0.2013329416513443, 0.14973443746566772, 0.4264281392097473, -0.2862531542778015, 0.00511816143989563, 0.25985753536224365, -0.2932894229888916, -0.261034220457077, -0.02750636264681816, 0.20450256764888763, 0.4427540898323059, -0.10731380432844162, 0.1327940672636032, 0.004981255158782005, 0.47998183965682983, 0.0007614567875862122, 0.11954745650291443, -0.0758846178650856, 0.10514195263385773, -0.12533092498779297, 0.10959462076425552, 0.31247463822364807, -0.09147486835718155, -0.1784079670906067, 0.19371095299720764, 0.07089196145534515, 0.23038934171199799, 0.48705726861953735, -0.2050355225801468, 0.27525216341018677, -0.07033924758434296, 0.42463380098342896, 0.343469500541687, -0.3676389157772064, -0.1543380320072174, 0.16695424914360046, -0.0035423636436462402, -0.16741587221622467, 0.15658977627754211, 0.04294673725962639, 0.06462413817644119, -0.12909521162509918, 0.44544172286987305, 0.20131981372833252, -0.11658148467540741, -0.04360786825418472, -0.18304327130317688, -0.22044797241687775, 0.3023865222930908, 0.15459546446800232, 0.2868271768093109, 0.09023349732160568, -0.05740399286150932, 0.1613752394914627, 0.03663575276732445, -0.21214932203292847, -0.10619688034057617, 0.13042543828487396, 0.1467326581478119, 0.05656977370381355, -0.11834420263767242, -0.03713824972510338, 0.2762080729007721, -0.16624543070793152, 0.15614889562129974, 0.1642962098121643, -0.3623613119125366, -0.16075637936592102, -0.04109422117471695, 0.060608670115470886, -0.2900463938713074, -0.33223196864128113, 0.14342175424098969, 0.12553799152374268, -0.10936389863491058, -0.1008637547492981, -0.27727070450782776, -0.0160880908370018, -0.3379668593406677, 0.03395849093794823, -0.4881877899169922, 0.1611640304327011, -0.30481234192848206, -0.2975989878177643, -0.2511018216609955, -0.004455134272575378, 0.2967945337295532, 0.029460754245519638, -0.3077855110168457, 0.34017980098724365, 0.0503411591053009, -0.39103734493255615, -0.13535529375076294, 0.04638376832008362, 0.14528343081474304, -0.2763221561908722, 0.013853562995791435, 0.3505251407623291, 0.14023597538471222, 0.012317046523094177, 0.10627764463424683, 0.3894713521003723, -0.15574632585048676, 0.13922280073165894, -0.0535939559340477, 0.19763118028640747, 0.4785841703414917, -0.0008494630455970764, -0.1087101399898529, -0.2584361433982849, 0.2304900884628296, -0.06427685171365738, 0.19807985424995422, -0.2739953398704529, -0.3859012722969055, -0.35830631852149963, 0.23885908722877502, 0.12498622387647629, 0.09054658561944962, 0.16550946235656738, -0.14738966524600983, 0.2546381950378418, -0.10610602796077728, -0.2605803608894348, 0.34398412704467773, 0.12839430570602417, -0.3615087568759918, -0.05811918526887894, 0.1630464494228363, -0.10535653680562973, 0.2408810257911682, 0.02428189478814602, -0.1299818903207779, 0.2656014561653137, -0.012600891292095184, 0.14802004396915436, -0.2440974861383438, -0.1888498067855835, -0.1196012869477272, 0.18084605038166046, -0.26580268144607544, 0.09858725965023041, -0.05124182626605034, -0.03214231878519058, -0.20223480463027954, -0.31423234939575195, 0.09205430746078491, -0.12244905531406403, 0.05107170715928078, 0.03596845269203186, -0.21070554852485657, 0.5327699780464172, 0.16354049742221832, 0.020891547203063965, 0.3033285140991211, -0.03920850157737732, -0.12570688128471375, 0.004776895046234131, -0.12850309908390045, 0.07071035355329514, 0.10689427703619003, -0.29650309681892395, 0.2287900149822235, -0.2638397812843323, 0.13523338735103607, -0.20852339267730713, -0.2726563513278961, 0.10312335193157196, -0.22567607462406158, 0.012183548882603645, 0.1613428294658661, 0.011286024004220963, -0.008636273443698883, -0.6732563972473145, 0.36264702677726746, -0.13725504279136658, -0.09386780112981796, 0.11114571988582611, 0.2674482464790344, -0.2701221704483032, -0.11418542265892029, -0.29398128390312195, -0.35151541233062744, -0.27761244773864746, -0.33253878355026245, 0.07777568697929382, 0.1541275829076767, 0.23076245188713074, 0.20777897536754608, 0.18801023066043854, 0.33438748121261597, -0.21077826619148254, -0.17667487263679504, -0.14451779425144196, 0.48520222306251526, -0.24187412858009338, -0.25166943669319153, -0.09061644971370697, -0.1335986852645874, 0.15754453837871552, 0.11914373189210892, -0.23990941047668457, -0.12333011627197266, -0.09584340453147888, 0.03373049199581146, -0.1583523452281952, 0.17873574793338776, 0.4704285264015198, 0.08344651758670807, -0.07961732149124146, -0.06913600862026215, -0.25330275297164917, 0.041770078241825104, -0.2139396220445633, 0.33796000480651855, -0.21045367419719696, 0.6461179256439209, 0.12386645376682281, 0.6803543567657471, 0.16859500110149384, -0.3057551980018616, 0.3437865376472473, 0.010823054239153862, 0.15125082433223724, -0.1399816870689392, -0.47955262660980225, -0.23639902472496033, -0.14482194185256958, -0.0721074715256691, 0.19126972556114197, -0.2562350630760193, -0.2507924437522888, -0.16344821453094482, -0.1191924661397934, -0.2326229065656662, -0.08640282601118088, 0.37604421377182007, -0.25262460112571716, 0.2644343376159668, -0.2008819580078125, 0.348736435174942, -0.18770462274551392, 0.07049990445375443, 0.10643839091062546, 0.019903307780623436, 0.16922451555728912, -0.1969931423664093, -0.15606160461902618, 0.030022144317626953, -0.14009669423103333, 0.3398590087890625, 0.10257837176322937, 0.5419589281082153, -0.11286137253046036, 0.038841262459754944, -0.09391644597053528, 0.07883108407258987, 0.4349493086338043, -0.12250878661870956, -0.2730678617954254, -0.003752797842025757, -0.11388079077005386, -0.010278768837451935, -0.0072467997670173645, -0.4441862106323242, -0.15309134125709534, 0.2874632179737091, 0.4544239640235901, -0.24972577393054962, 0.011706594377756119, 0.16849665343761444, -0.026409121230244637, -0.1326700747013092, 0.04478278011083603, -0.2752780616283417, -0.2325657308101654, -0.6081133484840393, 0.22087010741233826, 0.33642059564590454, 0.2517566680908203, 0.05707569420337677, 0.25142624974250793, -0.1278662532567978, -0.1132812350988388, 0.2539786994457245, -0.07284785062074661, 0.12910503149032593, 0.029037341475486755, -0.02016386389732361, -0.025122620165348053, 0.2182382494211197, 0.07244793325662613, 0.32009392976760864, 0.10309578478336334, -0.5416263937950134, -0.053529515862464905, -0.1330356001853943, 0.28103384375572205, 0.3188333511352539, -0.1211620420217514, -0.027933664619922638, -0.04165811091661453, 0.14068959653377533, 0.1159895658493042, 0.16686473786830902, 0.38165807723999023, 0.12462837994098663, -0.5428383350372314, -0.3261312246322632, 0.05403246358036995, -0.01071251928806305, 0.1553594321012497, 0.3192477524280548, -0.1290578991174698, -0.3175480365753174, 0.6128234267234802, 0.4199717342853546, 1.0334348678588867, 0.23000136017799377, 0.07247032225131989, 0.12974782288074493, 0.1567099243402481, -0.0669136643409729, -0.2685859799385071, 0.11520418524742126, -0.3953932523727417, -0.366939902305603, -0.04878661409020424, -0.09359781444072723, 0.2817918658256531, 0.16307973861694336, -0.417449951171875, 0.14063593745231628, -0.37435269355773926, 0.17490176856517792, 0.0339587926864624, 0.11054601520299911, -0.3060939311981201, -0.33883774280548096, -0.028091859072446823, 0.17443108558654785, -0.08154024183750153, 0.08153842389583588, 0.03990708664059639, -0.13831210136413574, -0.10799102485179901, -0.42088258266448975, -0.3158876299858093, 0.19956785440444946, -0.35154688358306885, 0.30178165435791016, 0.09415283799171448, -0.06231775879859924, 0.29849159717559814, 0.3336353898048401, 0.5592120289802551, 0.2546544075012207, 0.05657017230987549, 0.17887741327285767, 0.19385232031345367, 0.05083033815026283, 0.05625094100832939, -0.02146836742758751, 0.4157039523124695, -0.13075317442417145, -0.03139200806617737, 0.3998894989490509, 0.23160913586616516, -0.35096487402915955, -0.2608662247657776, -0.12932029366493225, 0.3666922152042389, -0.5793744921684265, -0.2232840657234192, -0.1463727355003357, -0.18971632421016693, -0.2468787133693695, 0.12715022265911102, 0.019990287721157074, -0.2826106548309326, -0.15549537539482117, 0.0058752098120749, -0.038573719561100006, -0.01966765522956848, 0.22743910551071167, 0.12812554836273193, -0.2528255879878998, 0.5689960718154907, -0.04697289317846298, -0.26809948682785034, -0.2420220971107483, 0.22347918152809143, 0.26758524775505066, -0.6850436925888062, 0.07907547056674957, -0.20414726436138153, -0.21038241684436798, -0.23065254092216492, 0.295639306306839, 0.05722089856863022, 0.3646165132522583, -0.10624182969331741, -0.24505652487277985, -0.5253615379333496, 0.001174958422780037, 0.09485756605863571, 0.2573859989643097, -0.15642818808555603, 0.2939724326133728, -0.25602465867996216, 0.06286565214395523, -0.3175482451915741, -0.14609214663505554, -0.309264600276947, 0.259377121925354, -0.26135069131851196, -0.06849423795938492, 0.05307032912969589, 0.19617676734924316, 0.1489628106355667, 0.37312766909599304, -0.027503959834575653, -0.20647671818733215, -0.17334043979644775, 0.12141673266887665, 0.30394765734672546, -0.33221226930618286, -0.187453955411911, -0.00771506130695343, -0.02124321646988392, -0.33559954166412354, -0.11054401099681854, 0.173043891787529, 0.047333139926195145, 0.23518669605255127, 0.2801858186721802, 0.2659336030483246, 0.13718685507774353, -0.2378850281238556, -0.14035660028457642, 0.28451675176620483, 0.12710225582122803, -0.16631709039211273, 0.002706516534090042, -0.0660238191485405, -0.3232019245624542, 0.22201485931873322, 0.43126267194747925, 0.2866007089614868, 0.11172106862068176, -0.4801174998283386, 0.03755304962396622, 0.09644980728626251, -0.09952548891305923, 0.0687284916639328, -0.5602134466171265, -0.11889263987541199, 0.3996785581111908, 0.27513325214385986, -0.2472565472126007, 0.07257194817066193, -0.30780524015426636, -0.16773957014083862, -0.1191699281334877, 0.2752785384654999, -0.02173532545566559, 0.09925267100334167, 0.3631536662578583, 0.0013157650828361511, 0.3692479431629181, -0.224326491355896, 0.1858634352684021, 0.36590611934661865, -0.14515532553195953, 0.10238155722618103, 0.12209798395633698, -0.03331024944782257, 0.0057236142456531525, 0.17878082394599915, -0.27218663692474365, 0.253518670797348, 0.059551067650318146, -0.11990571767091751, 0.013721030205488205, 0.04003886133432388, -0.257620632648468, -0.30862492322921753, -0.11399180442094803, 0.1771060973405838, -0.06154841557145119, -0.03725842013955116, -0.11984826624393463, 0.05019274353981018, -0.03675314411520958, 0.18352164328098297, -0.322346955537796, 0.057389821857213974, -0.08864139020442963, -0.050188012421131134, -0.32570600509643555, -0.08895549178123474, 0.1429615020751953, 0.06637442111968994, -0.12949785590171814, 0.14247001707553864, -0.2500573694705963, -0.20538431406021118, -0.009957616217434406, 0.19975897669792175, 0.28495076298713684, -0.46187663078308105, 0.23921053111553192, 0.47425830364227295, 0.18016913533210754, 0.18519313633441925, 0.22932438552379608, 0.5727677941322327, 0.34291234612464905, -0.07712683081626892, 0.13316702842712402, -0.29279398918151855, -0.10459539294242859, 0.10911238193511963, 0.24613627791404724, 0.11851948499679565, 0.1929728090763092, 0.17863693833351135, 0.1387581080198288, -0.24989107251167297, -0.10169096291065216, 0.13695748150348663, 0.12138425558805466, 0.06577031314373016, 0.5069161057472229, -0.1093347892165184, -0.06017845496535301, -0.23730069398880005, -0.05729586258530617, -0.5844014286994934, 0.35628801584243774, 0.2513810694217682, 0.002572137862443924, 0.1750657856464386, 0.02229340746998787, 0.10065150260925293, -0.04505053162574768, 0.16900593042373657, 0.3685019016265869, -0.08292615413665771, -0.5112868547439575, -0.10818607360124588, -0.20082807540893555, 0.22242364287376404, 0.284845232963562, 0.0031427890062332153, -0.1891964226961136, -0.12187342345714569, 0.32180196046829224, 0.23929403722286224, -0.21821534633636475, -0.09531518816947937, -0.008050613105297089, 0.363861620426178, -0.10776080191135406, -0.011908721178770065, -0.060193225741386414, 0.34367087483406067, 0.1386149823665619, -0.1657712161540985, -0.11085835099220276, 0.046406831592321396, 0.16632044315338135, -0.2091531753540039, -0.1252080649137497, -0.08509249985218048, 0.2787958085536957, 0.1645195484161377, 0.12933553755283356, 0.5429820418357849, -0.24998852610588074, 0.15482163429260254, 0.05351213365793228, -0.2545568346977234, -0.2453378438949585, 0.0778997391462326, 0.5135342478752136, 0.4587442874908447, 0.04680786281824112, -0.20053714513778687, -0.5292811393737793, 0.4081020653247833, 0.005248114466667175, -0.1563887894153595, -0.27976691722869873, 0.2843133807182312, -0.20843419432640076, -0.07795402407646179, 0.1182437539100647, 0.29384028911590576, 0.1344766914844513, 0.24747973680496216, -0.24467051029205322, -0.39313778281211853, 0.6383625268936157, -0.4809979796409607, -0.5399084091186523, 0.08545172214508057, -0.03134702891111374, 0.3270346224308014, 0.12228401750326157, -0.5806410312652588, -0.034222617745399475, 0.23063433170318604, -0.05715325474739075, -0.35007530450820923, 0.122799351811409, 0.24678269028663635, 0.1599891632795334, 0.0033067315816879272, 0.15314243733882904, 0.12833546102046967, 0.0552058145403862, 0.05028306692838669, -0.2455003559589386 ]
https://github.com/huggingface/datasets/issues/5764
Thanks for reporting, @sauravtii. Unfortunately, I'm not able to reproduce the issue: ```python In [1]: from datasets import load_dataset In [2]: ds = load_dataset("josianem/imdb") In [2]: ds Out[2]: DatasetDict({ train: Dataset({ features: ['text', 'label'], num_rows: 25799 }) test: Dataset({ features: ['text', 'label'], num_rows: 25000 }) unsupervised: Dataset({ features: ['text', 'label'], num_rows: 50000 }) }) ``` Could you please retry to load the dataset? Maybe there was a temporary connection issue to Dropbox.
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
72
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 Thanks for reporting, @sauravtii. Unfortunately, I'm not able to reproduce the issue: ```python In [1]: from datasets import load_dataset In [2]: ds = load_dataset("josianem/imdb") In [2]: ds Out[2]: DatasetDict({ train: Dataset({ features: ['text', 'label'], num_rows: 25799 }) test: Dataset({ features: ['text', 'label'], num_rows: 25000 }) unsupervised: Dataset({ features: ['text', 'label'], num_rows: 50000 }) }) ``` Could you please retry to load the dataset? Maybe there was a temporary connection issue to Dropbox.
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5764
Thanks @albertvillanova. I am facing another issue now ``` Traceback (most recent call last): File "sample.py", line 4, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 738, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits raise NonMatchingSplitsSizesError(str(bad_splits)) datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=34501348, num_examples=25799, dataset_name='imdb'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='imdb')}, {'expected': SplitInfo(name='test', num_bytes=32650697, num_examples=25000, dataset_name='imdb'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='imdb')}, {'expected': SplitInfo(name='unsupervised', num_bytes=67106814, num_examples=50000, dataset_name='imdb'), 'recorded': SplitInfo(name='unsupervised', num_bytes=0, num_examples=0, dataset_name='imdb')}] ``` This is my code ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ```
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
99
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 Thanks @albertvillanova. I am facing another issue now ``` Traceback (most recent call last): File "sample.py", line 4, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 738, in _download_and_prepare verify_splits(self.info.splits, split_dict) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/info_utils.py", line 74, in verify_splits raise NonMatchingSplitsSizesError(str(bad_splits)) datasets.utils.info_utils.NonMatchingSplitsSizesError: [{'expected': SplitInfo(name='train', num_bytes=34501348, num_examples=25799, dataset_name='imdb'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='imdb')}, {'expected': SplitInfo(name='test', num_bytes=32650697, num_examples=25000, dataset_name='imdb'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='imdb')}, {'expected': SplitInfo(name='unsupervised', num_bytes=67106814, num_examples=50000, dataset_name='imdb'), 'recorded': SplitInfo(name='unsupervised', num_bytes=0, num_examples=0, dataset_name='imdb')}] ``` This is my code ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ```
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5764
Your connection didn't work and you got an empty dataset (`num_bytes=0, num_examples=0`): ``` datasets.utils.info_utils.NonMatchingSplitsSizesError: [ { 'expected': SplitInfo(name='train', num_bytes=34501348, num_examples=25799, dataset_name='imdb'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='imdb') }, { 'expected': SplitInfo(name='test', num_bytes=32650697, num_examples=25000, dataset_name='imdb'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='imdb') }, { 'expected': SplitInfo(name='unsupervised', num_bytes=67106814, num_examples=50000, dataset_name='imdb'), 'recorded': SplitInfo(name='unsupervised', num_bytes=0, num_examples=0, dataset_name='imdb') } ] ``` Could you please try the link in your browser and see if it works? https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 - If it does not work, you should contact the author of the dataset in their Community tab (https://huggingface.co/datasets/josianem/imdb/discussions) and inform them, so that they can host their data elsewhere, for example on the Hugging Face Hub itself If the link works, you should try to load the dataset but forcing the re-download of the data files (so that the cache is refreshed with the actual data file), by passing `download_mode="force_redownload"`: ```python dataset = load_dataset("josianem/imdb", download_mode="force_redownload") ```
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
145
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 Your connection didn't work and you got an empty dataset (`num_bytes=0, num_examples=0`): ``` datasets.utils.info_utils.NonMatchingSplitsSizesError: [ { 'expected': SplitInfo(name='train', num_bytes=34501348, num_examples=25799, dataset_name='imdb'), 'recorded': SplitInfo(name='train', num_bytes=0, num_examples=0, dataset_name='imdb') }, { 'expected': SplitInfo(name='test', num_bytes=32650697, num_examples=25000, dataset_name='imdb'), 'recorded': SplitInfo(name='test', num_bytes=0, num_examples=0, dataset_name='imdb') }, { 'expected': SplitInfo(name='unsupervised', num_bytes=67106814, num_examples=50000, dataset_name='imdb'), 'recorded': SplitInfo(name='unsupervised', num_bytes=0, num_examples=0, dataset_name='imdb') } ] ``` Could you please try the link in your browser and see if it works? https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 - If it does not work, you should contact the author of the dataset in their Community tab (https://huggingface.co/datasets/josianem/imdb/discussions) and inform them, so that they can host their data elsewhere, for example on the Hugging Face Hub itself If the link works, you should try to load the dataset but forcing the re-download of the data files (so that the cache is refreshed with the actual data file), by passing `download_mode="force_redownload"`: ```python dataset = load_dataset("josianem/imdb", download_mode="force_redownload") ```
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5764
After pasting the link in the browser, it did start the download so it seems that the link is working. But even after including the `download_mode` in my code I am facing the same issue: Error: ``` Traceback (most recent call last): File "sample.py", line 4, in <module> dataset = load_dataset("josianem/imdb", download_mode="force_redownload") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` My code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb", download_mode="force_redownload") ```
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
148
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 After pasting the link in the browser, it did start the download so it seems that the link is working. But even after including the `download_mode` in my code I am facing the same issue: Error: ``` Traceback (most recent call last): File "sample.py", line 4, in <module> dataset = load_dataset("josianem/imdb", download_mode="force_redownload") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` My code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb", download_mode="force_redownload") ```
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5764
I have tried again to reproduce your issue without success: the dataset loads perfectly, both in my local machine and in a Colab notebook. - See: https://colab.research.google.com/drive/1dky3T0XGFuldggy22NNQQN-UqOFqvnuY?usp=sharing I think the cause maight be that you are using a very old version of `datasets`. Please, could you update it and retry? ``` pip install -U datasets ```
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
56
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 I have tried again to reproduce your issue without success: the dataset loads perfectly, both in my local machine and in a Colab notebook. - See: https://colab.research.google.com/drive/1dky3T0XGFuldggy22NNQQN-UqOFqvnuY?usp=sharing I think the cause maight be that you are using a very old version of `datasets`. Please, could you update it and retry? ``` pip install -U datasets ```
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5764
That worked!! Thanks @albertvillanova : ) ``` Downloading builder script: 100%|███████| 4.20k/4.20k [00:00<00:00, 6.69MB/s] Downloading metadata: 100%|█████████████| 2.60k/2.60k [00:00<00:00, 3.41MB/s] Downloading readme: 100%|███████████████| 7.52k/7.52k [00:00<00:00, 12.6MB/s] Downloading and preparing dataset imdb/plain_text to /home/saurav/.cache/huggingface/datasets/josianem___imdb/plain_text/1.0.0/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f... Downloading data: 100%|███████████████████| 301M/301M [01:32<00:00, 3.25MB/s] Dataset imdb downloaded and prepared to /home/saurav/.cache/huggingface/datasets/josianem___imdb/plain_text/1.0.0/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f. Subsequent calls will reuse this data. 100%|█████████████████████████████████████████| 3/3 [00:00<00:00, 794.83it/s] ``` The code I used: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb", download_mode="force_redownload") ``` But when I remove `download_mode="force_redownload"` I get the same error. Any guess on that?
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
86
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 That worked!! Thanks @albertvillanova : ) ``` Downloading builder script: 100%|███████| 4.20k/4.20k [00:00<00:00, 6.69MB/s] Downloading metadata: 100%|█████████████| 2.60k/2.60k [00:00<00:00, 3.41MB/s] Downloading readme: 100%|███████████████| 7.52k/7.52k [00:00<00:00, 12.6MB/s] Downloading and preparing dataset imdb/plain_text to /home/saurav/.cache/huggingface/datasets/josianem___imdb/plain_text/1.0.0/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f... Downloading data: 100%|███████████████████| 301M/301M [01:32<00:00, 3.25MB/s] Dataset imdb downloaded and prepared to /home/saurav/.cache/huggingface/datasets/josianem___imdb/plain_text/1.0.0/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f. Subsequent calls will reuse this data. 100%|█████████████████████████████████████████| 3/3 [00:00<00:00, 794.83it/s] ``` The code I used: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb", download_mode="force_redownload") ``` But when I remove `download_mode="force_redownload"` I get the same error. Any guess on that?
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5764
That is because the cache got the "empty" download file the first time you tried and got the connection error. Then, once you no longer get the connection error, you need to refresh the cache by passing `download_mode="force_redownload"`.
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1
### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0
38
ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ### Describe the bug I want to use this (https://huggingface.co/datasets/josianem/imdb) dataset therefore I am trying to load it using the following code: ``` dataset = load_dataset("josianem/imdb") ``` The dataset is not getting loaded and gives the error message as the following: ``` Traceback (most recent call last): File "sample.py", line 3, in <module> dataset = load_dataset("josianem/imdb") File "/home/saurav/.local/lib/python3.8/site-packages/datasets/load.py", line 1112, in load_dataset builder_instance.download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 636, in download_and_prepare self._download_and_prepare( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/builder.py", line 704, in _download_and_prepare split_generators = self._split_generators(dl_manager, **split_generators_kwargs) File "/home/saurav/.cache/huggingface/modules/datasets_modules/datasets/imdb/cc6ab4acab2799be15d5d217c24548b856156dafdc850165fdc4f2031f27ff2f/imdb.py", line 79, in _split_generators archive = dl_manager.download(_DOWNLOAD_URL) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 196, in download downloaded_path_or_paths = map_nested( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/py_utils.py", line 197, in map_nested return function(data_struct) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/download_manager.py", line 217, in _download return cached_path(url_or_filename, download_config=download_config) File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 289, in cached_path output_path = get_from_cache( File "/home/saurav/.local/lib/python3.8/site-packages/datasets/utils/file_utils.py", line 606, in get_from_cache raise ConnectionError("Couldn't reach {}".format(url)) ConnectionError: Couldn't reach https://www.dropbox.com/s/zts98j4vkqtsns6/aclImdb_v2.tar?dl=1 ``` ### Steps to reproduce the bug You can reproduce the error by using the following code: ``` from datasets import load_dataset, load_metric dataset = load_dataset("josianem/imdb") ``` ### Expected behavior The dataset should get loaded (I am using this dataset for the first time so not much aware of the exact behavior). ### Environment info - `datasets` version: 1.12.1 - Platform: Linux-5.4.0-58-generic-x86_64-with-glibc2.29 - Python version: 3.8.10 - PyArrow version: 11.0.0 That is because the cache got the "empty" download file the first time you tried and got the connection error. Then, once you no longer get the connection error, you need to refresh the cache by passing `download_mode="force_redownload"`.
[ -0.4342045187950134, -0.0925869271159172, -0.09273090958595276, 0.5126129984855652, 0.17861242592334747, 0.06114169955253601, 0.15243282914161682, 0.2641783356666565, 0.2611626386642456, 0.07067699730396271, -0.10803499072790146, 0.3297550082206726, 0.13071894645690918, 0.2889462113380432, 0.1065719872713089, -0.09305591881275177, -0.07591020315885544, -0.04943155124783516, -0.0851779505610466, 0.2611973285675049, -0.07556317746639252, 0.26643645763397217, -0.2407963126897812, 0.07280833274126053, -0.13713335990905762, -0.06465119868516922, 0.12268447875976562, 0.2391851544380188, -0.22628508508205414, -0.26026755571365356, 0.3911411166191101, 0.11560378968715668, 0.1901148110628128, 0.4062545597553253, -0.0001108443466364406, 0.1351265013217926, 0.4744695723056793, -0.17798078060150146, -0.44844216108322144, -0.6032251119613647, -0.1562754213809967, 0.0650985911488533, 0.260544091463089, -0.047875985503196716, -0.15205879509449005, 0.018366046249866486, -0.06917440891265869, -0.43435367941856384, 0.4506637752056122, 0.29211485385894775, 0.2264157086610794, 0.36478811502456665, 0.5821112990379333, -0.17151524126529694, 0.15429161489009857, -0.16756945848464966, -0.012169614434242249, 0.6677557229995728, 0.055428396910429, 0.09131934493780136, 0.17038623988628387, 0.13896788656711578, -0.12795951962471008, 0.04648778587579727, 0.4263094961643219, -0.021245604380965233, -0.23354747891426086, -0.36580756306648254, 0.1836780458688736, 0.223649799823761, 0.7438955903053284, -0.1696614921092987, -0.401965856552124, 0.052902914583683014, 0.10986781120300293, -0.17521178722381592, 0.2896609306335449, 0.13820473849773407, -0.18207204341888428, 0.24210473895072937, -0.0027942173182964325, -0.025061670690774918, -0.20981818437576294, 0.2868243157863617, -0.05860675126314163, 0.001291472464799881, -0.2189098596572876, 0.08957867324352264, 0.3254874348640442, -0.04651499167084694, 0.2472558617591858, -0.16028527915477753, -0.06285177171230316, 0.0920424610376358, -0.28262636065483093, -0.06218497082591057, -0.21026404201984406, 0.18109972774982452, 0.17173975706100464, 0.3622714877128601, 0.3746691942214966, 0.011358093470335007, -0.1740804761648178, 0.18596097826957703, 0.25942811369895935, 0.19757749140262604, 0.05347883328795433, -0.0333465039730072, 0.18939079344272614, 0.6328194737434387, 0.02098996192216873, -0.2098608911037445, -0.2333505004644394, -0.12944936752319336, -0.18990403413772583, 0.0629568099975586, 0.42246735095977783, -0.06848356127738953, -0.48037323355674744, 0.06511235982179642, -0.0672653540968895, -0.15537339448928833, 0.08067591488361359, 0.503775954246521, -0.31075766682624817, 0.02338162064552307, 0.23587444424629211, 0.4130862355232239, -0.004105694591999054, -0.0377965122461319, -0.18792486190795898, 0.19758307933807373, -0.01639901101589203, -0.036302290856838226, 0.21731525659561157, -0.21604423224925995, 0.3391578793525696, -0.17060470581054688, 0.0023989733308553696, -0.07194076478481293, 0.13005483150482178, -0.045552030205726624, -0.20100432634353638, 0.37652280926704407, 0.28682470321655273, 0.007615312933921814, 0.18638469278812408, -0.17262974381446838, -0.055028289556503296, -0.022939134389162064, -0.2715461254119873, -0.24842950701713562, -0.22813965380191803, 0.18858954310417175, 0.014447301626205444, -0.07489768415689468, -0.4625549912452698, -0.2149033546447754, -0.058463744819164276, -0.1599452644586563, -0.22815106809139252, 0.05590227618813515, 0.05768945813179016, -0.10878689587116241, 0.39131829142570496, 0.4637358486652374, -0.3852385878562927, 0.11822918802499771, -0.4709579646587372, 0.008682195097208023, 0.12446095049381256, 0.010349037125706673, -0.17356742918491364, 0.0584416501224041, -0.3968297839164734, -0.027247197926044464, 0.3883151113986969, -0.5211196541786194, -0.41802680492401123, 0.38746291399002075, -0.20801886916160583, 0.04084210842847824, 0.190267413854599, -0.1198997050523758, 0.14495830237865448, -0.028602417558431625, 0.22104351222515106, 0.18085011839866638, -0.02284514531493187, -0.09244130551815033, -0.018501445651054382, -0.21054419875144958, 0.02688656747341156, 0.0875052958726883, -0.07716305553913116, 0.27609822154045105, 0.1665603220462799, 0.21408486366271973, 0.3107594847679138, 0.21289733052253723, 0.08262022584676743, 0.041593533009290695, -0.14332705736160278, 0.06930811703205109, -0.2572060525417328, 0.053383469581604004, -0.34910035133361816, 0.1385851502418518, -0.009394459426403046, 0.05675365403294563, -0.3322690725326538, -0.10621725767850876, -0.5035053491592407, 0.08138930052518845, -0.2230982631444931, -0.13856664299964905, 0.18538059294223785, 0.13844645023345947, 0.025810062885284424, 0.14772969484329224, -0.20321327447891235, 0.1360158920288086, 0.12751519680023193, 0.21523238718509674, -0.5508310198783875, 0.391959547996521, -0.33441317081451416, 0.041027702391147614, 0.3274461627006531, 0.03431214764714241, 0.14406973123550415, -0.2394569218158722, -0.011440219357609749, 0.2890073359012604, -0.07461817562580109, -0.046738218516111374, 0.03564349189400673, -0.11687619984149933, 0.23080071806907654, -0.2978753447532654, 0.24903365969657898, 0.058294668793678284, 0.2698741853237152, -0.07726528495550156, 0.1379031538963318, 0.10689155757427216, -0.11080051958560944, 0.30784398317337036, 0.14723505079746246, 0.08924784511327744, 0.2106674164533615, 0.024342738091945648, -0.033268410712480545, -0.15791039168834686, -0.19544711709022522, -0.12050340324640274, 0.3811435103416443, -0.18966889381408691, -0.1013372540473938, -0.004144243896007538, 0.11826486885547638, 0.02939077466726303, -0.1408451795578003, 0.18206962943077087, -0.04105471819639206, -0.11068892478942871, 0.04915492981672287, 0.27461040019989014, 0.4730297327041626, 0.20468059182167053, -0.058270491659641266, 0.0846971869468689, 0.2647978961467743, -0.2083905041217804, 0.30762434005737305, -0.04072629287838936, 0.034886159002780914, 0.24060705304145813, -0.19472090899944305, 0.002948582172393799, -0.12559357285499573, -0.4227425158023834, -0.09423890709877014, 0.19870761036872864, -0.27863839268684387, 0.14458505809307098, -0.20326025784015656, -0.235354483127594, 0.04545922204852104, -0.144520103931427, -0.12130312621593475, -0.2752673327922821, -0.3238734006881714, 0.6277439594268799, 0.188951775431633, 0.052900806069374084, -0.1563751995563507, 0.04664493352174759, 0.15320084989070892, -0.008658595383167267, -0.23996302485466003, -0.015738632529973984, -0.10154242813587189, 0.1234782338142395, 0.3891390264034271, -0.079886294901371, 0.30547860264778137, -0.271232932806015, -0.17814624309539795, -0.1743667721748352, 0.10204145312309265, 0.1062912866473198, -0.05212509259581566, 0.17975230515003204, 0.22976574301719666, 0.5735498666763306, 0.23736488819122314, -0.5147238969802856, 0.2960844933986664, 0.0805736854672432, -0.10820546746253967, -0.04615579545497894, 0.02001771703362465, -0.07955704629421234, 0.1352398842573166, -0.24440407752990723, -0.35745590925216675, -0.5009194612503052, 0.16962793469429016, 0.14997424185276031, 0.045956071466207504, 0.2569749355316162, 0.16602115333080292, 0.09941312670707703, 0.11888939142227173, 0.1257529854774475, -0.19286766648292542, -0.40641117095947266, 0.13931319117546082, -0.2217407077550888, -0.35820820927619934, 0.2504326105117798, 0.09039431810379028, 0.3797709047794342, -0.31374427676200867, -0.4389222264289856, -0.2621305584907532, -0.024446148425340652, 0.03593650460243225, 0.13508832454681396, 0.07376372814178467, 0.19156281650066376, -0.11158126592636108, -0.05165436863899231, 0.0702625960111618, -0.22135502099990845, -0.03530305624008179, -0.16344916820526123, 0.30918020009994507, 0.26653745770454407, 0.40607210993766785, -0.25960373878479004, 0.2947137653827667, 0.28393903374671936, -0.033880963921546936, 0.5822952389717102, -0.18201598525047302, 0.34537702798843384, -0.417239785194397, -0.49508607387542725, -0.2862739861011505, -0.21335457265377045, -0.0022040903568267822, 0.16041074693202972, -0.07099678367376328, -0.21489010751247406, -0.5743429660797119, -0.24399152398109436, -0.43943339586257935, -0.18781787157058716, -0.10549558699131012, -0.3953981101512909, -0.24668632447719574, 0.10131274163722992, -0.017131388187408447, 0.08963979035615921, -0.09472675621509552, -0.021388057619333267, 0.319379061460495, 0.1878615766763687, 0.07831265032291412, -0.03956645727157593, 0.010677848011255264, -0.5183372497558594, 0.3678499162197113, -0.2570022940635681, 0.2182050198316574, -0.1888444721698761, 0.01740405708551407, 0.0932362824678421, -0.03393182158470154, 0.6551004648208618, -0.36876705288887024, 0.28453850746154785, 0.1769886463880539, 0.013229764997959137, -0.25578051805496216, 0.06118430197238922, 0.023043476045131683, 0.10594591498374939, 0.0015942808240652084, 0.1349400281906128, -0.33254873752593994, -0.10575106739997864, 0.4287656247615814, 0.06525599956512451, -0.022080570459365845, -0.07708485424518585, -0.1623343527317047, -0.35111987590789795, -0.3912387490272522, -0.20798566937446594, -0.10641004890203476, 0.2637385427951813, 0.09811147302389145, -0.11589687317609787, 0.07782205194234848, -0.2205686718225479, 0.04856400191783905, 0.11050832271575928, 0.19059832394123077, 0.06372669339179993, 0.3035520911216736, 0.31729257106781006, 0.177761510014534, 0.4621902108192444, 0.6768622994422913, -0.17040449380874634, -0.27078211307525635, 0.07955755293369293, 0.044767871499061584, 0.030543245375156403, 0.24750235676765442, -0.19065430760383606, -0.14149260520935059, 0.12115226686000824, 0.07813040912151337, -0.02677725814282894, -0.030411425977945328, 0.33198273181915283, -0.008376732468605042, -0.17711395025253296, -0.5722914934158325, 0.25079646706581116, -0.1374800205230713, -0.055751197040081024, 0.07048265635967255, 0.060667455196380615, -0.1328381597995758, 0.4431704580783844, -0.30864018201828003, 0.8439257740974426, 0.22276298701763153, 0.14302659034729004, 0.13876216113567352, -0.017764627933502197, 0.1453557312488556, -0.24542443454265594, 0.05412958562374115, -0.36670708656311035, -0.3104842007160187, -0.0745849534869194, -0.05380848050117493, 0.11275835335254669, 0.1545528769493103, -0.2315330058336258, 0.2512558400630951, -0.3560222387313843, -0.0044215889647603035, -0.027222756296396255, 0.395577609539032, -0.32552453875541687, -0.041932202875614166, -0.2519005537033081, 0.1628195345401764, 0.02251657098531723, 0.4137202501296997, -0.0658854991197586, -0.1370328664779663, -0.0978550985455513, -0.449179470539093, -0.28520870208740234, 0.2021668255329132, -0.4610344171524048, -0.006527857854962349, -0.24584925174713135, -0.1008349284529686, 0.1383693963289261, 0.33713141083717346, 0.07283302396535873, 0.1449567973613739, -0.1664166897535324, 0.077021524310112, -0.18527133762836456, -0.13934151828289032, 0.11405453085899353, -0.031074419617652893, 0.18391552567481995, -0.19393546879291534, -0.23114794492721558, 0.13245412707328796, 0.08973757922649384, -0.10277602076530457, 0.47038453817367554, 0.1638447344303131, -0.020874422043561935, -0.2588514983654022, -0.31157463788986206, -0.21076232194900513, 0.025360912084579468, -0.11899927258491516, 0.1440429389476776, -0.08487141132354736, -0.18823134899139404, -0.1718694567680359, 0.1730104386806488, -0.120094433426857, -0.02054670639336109, 0.7211345434188843, -0.22487841546535492, 0.12972202897071838, 0.2891535460948944, 0.07216425985097885, -0.14388501644134521, -0.21170228719711304, 0.1814194917678833, 0.13423186540603638, -0.526144802570343, 0.11784182488918304, 0.05843576043844223, 0.09759517014026642, -0.16403304040431976, 0.5037198662757874, 0.41861677169799805, 0.2153230756521225, 0.1196461021900177, -0.6244381070137024, -0.15866971015930176, 0.15965408086776733, -0.029780426993966103, 0.16877365112304688, -0.10209694504737854, 0.14161591231822968, 0.04762221872806549, -0.0489436611533165, -0.30401986837387085, 0.08575164526700974, -0.0750575065612793, -0.17944422364234924, 0.368946373462677, -0.14162512123584747, 0.46403753757476807, 0.009253427386283875, 0.22801335155963898, -0.17990688979625702, -0.3132435083389282, -0.19027769565582275, -0.007495768368244171, 0.11844223737716675, -0.11683373153209686, -0.4196763336658478, 0.018311556428670883, -0.3287898302078247, -0.1979694962501526, -0.0554613396525383, 0.17039820551872253, -0.06168799847364426, 0.06563767790794373, -0.38729357719421387, 0.02263430505990982, -0.039346326142549515, -0.2342202514410019, 0.22402352094650269, 0.024002427235245705, 0.44723910093307495, 0.07829674333333969, 0.09681838005781174, -0.1015804260969162, -0.16146962344646454, 0.10455376654863358, 0.03260159492492676, -0.18603338301181793, 0.06666228920221329, 0.5961601734161377, -0.20161917805671692, -0.10552685707807541, 0.21421626210212708, 0.4623229503631592, 0.24311845004558563, -0.04759535565972328, 0.025382213294506073, -0.09765873849391937, 0.2110494077205658, -0.27169936895370483, -0.013034872710704803, 0.3000430762767792, 0.007358882576227188, -0.06563036143779755, 0.07527735829353333, 0.05665484070777893, -0.13403581082820892, -0.2640934884548187, 0.0648476630449295, 0.8014028072357178, 0.14449015259742737, 0.17870786786079407, 0.286901593208313, -0.17144474387168884, 0.17024743556976318, 0.19822192192077637, 0.21776242554187775, 0.1593712866306305, 0.2975476384162903, -0.25124120712280273, 0.019927052780985832, -0.16721153259277344, 0.18547481298446655, -0.17505617439746857, -0.47593453526496887, 0.24585455656051636, 0.11567762494087219, -0.10424606502056122, -0.21816124022006989, -0.05496447905898094, 0.2504647970199585, -0.06896662712097168, 0.08311045169830322, -0.3287426233291626, 0.16064602136611938, 0.0034594042226672173, -0.11086362600326538, -0.08003241568803787, -0.38072526454925537, -0.14141343533992767, -0.1892053484916687, 0.06732164323329926, -0.13191679120063782, 0.251033753156662, 0.0468258336186409, 0.042471252381801605, -0.2230231612920761, -0.14894747734069824, -0.018672537058591843, -0.02871078997850418, -0.2914072871208191, 0.4143018424510956, 0.26533716917037964, 0.16052910685539246, 0.10388942807912827, 0.23664484918117523, 0.7231292724609375, 0.165542870759964, 0.20266146957874298, 0.06258420646190643, -0.04890171438455582, -0.17248918116092682, -0.1870792657136917, 0.08077876269817352, 0.3418835401535034, 0.14829185605049133, 0.31958168745040894, 0.19508855044841766, -0.13824914395809174, 0.25172674655914307, 0.08916008472442627, 0.1542971283197403, -0.07643061131238937, -0.050938915461301804, -0.24569940567016602, -0.06907972693443298, -0.43160486221313477, 0.0566239096224308, -0.34856727719306946, 0.033453647047281265, 0.050149738788604736, -0.26715052127838135, 0.1681918501853943, -0.20793366432189941, 0.0894550234079361, -0.08859305828809738, 0.43309253454208374, 0.2521282434463501, 0.09399735182523727, -0.28125712275505066, -0.13851000368595123, -0.5760089755058289, 0.1467108279466629, 0.0019964752718806267, 0.017940156161785126, -0.16713200509548187, 0.03876776993274689, -0.04923626407980919, 0.1951221227645874, 0.0801256075501442, 0.2375923991203308, -0.021980732679367065, 0.284597784280777, -0.013568125665187836, -0.3228539228439331, -0.06637196242809296, 0.16988089680671692, -0.17946241796016693, -0.2837364077568054, -0.017381496727466583, -0.45944228768348694, 0.03471606969833374, -0.03473874181509018, -0.01814531534910202, -0.04706330597400665, -0.1852317601442337, 0.38002485036849976, 0.033488668501377106, 0.7971875071525574, -0.08247944712638855, -0.13285577297210693, -0.1190812960267067, -0.16073890030384064, -0.1693313866853714, 0.18362335860729218, 0.4151126444339752, 0.22848904132843018, 0.04740116000175476, -0.04297371581196785, -0.3888985514640808, 0.43470314145088196, -0.08071193099021912, -0.03960176184773445, -0.43814435601234436, 0.01658003032207489, -0.08460376411676407, -0.0012561529874801636, 0.091164231300354, -0.05839456990361214, -0.1334747076034546, 0.05195412039756775, -0.21815571188926697, -0.4319557547569275, 0.5916202068328857, -0.08941790461540222, -0.06846945732831955, -0.02753448486328125, 0.16733327507972717, -0.1537041962146759, -0.10759765654802322, 0.010420083999633789, 0.32328271865844727, 0.21310919523239136, -0.21118399500846863, -0.3249703645706177, 0.20884476602077484, -0.10554501414299011, 0.09482812881469727, -0.05290599912405014, 0.18255025148391724, 0.05514216423034668, -0.2519773840904236, -0.055708158761262894, -0.11699405312538147 ]
https://github.com/huggingface/datasets/issues/5762
Thanks for reporting, @surya-narayanan. I see you already started a discussion about this on the Community tab of the corresponding dataset: https://huggingface.co/datasets/EleutherAI/the_pile/discussions/10 Let's continue the discussion there!
Not able to load the pile
### Describe the bug Got this error when I am trying to load the pile dataset ``` TypeError: Couldn't cast array of type struct<file: string, id: string> to {'id': Value(dtype='string', id=None)} ``` ### Steps to reproduce the bug Please visit the following sample notebook https://colab.research.google.com/drive/1JHcjawcHL6QHhi5VcqYd07W2QCEj2nWK#scrollTo=ulJP3eJCI-tB ### Expected behavior The pile should work ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.10.147+-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.3
27
Not able to load the pile ### Describe the bug Got this error when I am trying to load the pile dataset ``` TypeError: Couldn't cast array of type struct<file: string, id: string> to {'id': Value(dtype='string', id=None)} ``` ### Steps to reproduce the bug Please visit the following sample notebook https://colab.research.google.com/drive/1JHcjawcHL6QHhi5VcqYd07W2QCEj2nWK#scrollTo=ulJP3eJCI-tB ### Expected behavior The pile should work ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.10.147+-x86_64-with-glibc2.31 - Python version: 3.9.16 - Huggingface_hub version: 0.13.4 - PyArrow version: 9.0.0 - Pandas version: 1.5.3 Thanks for reporting, @surya-narayanan. I see you already started a discussion about this on the Community tab of the corresponding dataset: https://huggingface.co/datasets/EleutherAI/the_pile/discussions/10 Let's continue the discussion there!
[ -0.14698190987110138, -0.34604471921920776, 0.011125907301902771, 0.5978729724884033, 0.5030195713043213, 0.12426924705505371, 0.1668643206357956, 0.16048584878444672, 0.17309269309043884, -0.011461973190307617, -0.3375040888786316, 0.42514297366142273, -0.10572853684425354, 0.254465788602829, 0.039402615278959274, -0.062056705355644226, 0.11116587370634079, -0.29677584767341614, 0.006826668977737427, 0.11884057521820068, -0.1449049413204193, 0.13783778250217438, -0.32837384939193726, 0.020295608788728714, -0.12054143100976944, 0.026670029386878014, -0.023715928196907043, 0.33040088415145874, -0.12403609603643417, -0.20805272459983826, 0.41761741042137146, -0.14025913178920746, 0.18739484250545502, 0.4761240482330322, -0.00011305434600217268, 0.14349257946014404, 0.40831220149993896, -0.04450834542512894, -0.12430909276008606, -0.4563624858856201, -0.004408307373523712, -0.18756961822509766, 0.14807827770709991, -0.11808503419160843, -0.11419348418712616, -0.08624336868524551, 0.0697166696190834, 0.015652194619178772, 0.043724603950977325, 0.07596106827259064, 0.2223130762577057, 0.5567660331726074, 0.3521135449409485, -0.2319454401731491, 0.1392488032579422, 0.04020489379763603, -0.1806403398513794, 0.5976439118385315, 0.18382516503334045, 0.2507588863372803, -0.08494220674037933, -0.10816312581300735, -0.002520650625228882, -0.1388852447271347, 0.35454171895980835, 0.27639615535736084, 0.10171280801296234, -0.09122608602046967, -0.16337914764881134, 0.15167775750160217, 0.37697023153305054, -0.28555554151535034, -0.2903516888618469, -0.047873564064502716, 0.06668826937675476, 0.08372148871421814, 0.22387489676475525, 0.3263808786869049, 0.001572348177433014, 0.32663649320602417, -0.03532024472951889, 0.3075188398361206, -0.11759437620639801, 0.1730349063873291, 0.2538178861141205, -0.33888280391693115, -0.21257077157497406, 0.02684379369020462, 0.21787558495998383, -0.21533361077308655, -0.09766347706317902, 0.08247904479503632, -0.23718878626823425, 0.2219580113887787, -0.055626995861530304, 0.032263368368148804, 0.09565077722072601, 0.24009492993354797, 0.25818443298339844, -0.2808046042919159, 0.08952955156564713, 0.2705810070037842, -0.09356503188610077, 0.24034415185451508, 0.5103678703308105, 0.031681619584560394, -0.12882956862449646, -0.25135087966918945, 0.08970189839601517, 0.2763105034828186, -0.09332580864429474, -0.09057587385177612, -0.06087136268615723, -0.11625222861766815, 0.18486648797988892, -0.14582352340221405, 0.3734380006790161, -0.2543069124221802, -0.19264210760593414, 0.0027207322418689728, 0.0223771333694458, -0.014507662504911423, 0.24959875643253326, 0.5626389980316162, -0.04777304828166962, 0.2830912172794342, -0.03404649347066879, 0.25824815034866333, 0.056218571960926056, -0.04469740018248558, -0.3675685226917267, 0.15388253331184387, -0.18264171481132507, -0.32716166973114014, 0.1045241579413414, -0.4585212767124176, 0.1423964500427246, 0.11486682295799255, 0.3907455503940582, -0.15862831473350525, -0.3552502989768982, 0.015198305249214172, -0.06706605851650238, 0.33884114027023315, 0.11059733480215073, -0.07035728543996811, 0.40902748703956604, 0.0069456398487091064, -0.18755792081356049, 0.10311154276132584, -0.3235110640525818, -0.24596624076366425, -0.09833520650863647, 0.1783381849527359, -0.21333178877830505, 0.04979381337761879, -0.80027836561203, -0.07565374672412872, -0.06620073318481445, -0.09038276225328445, -0.028146181255578995, -0.18318670988082886, 0.10263697803020477, -0.3844295144081116, 0.007079720497131348, 0.17987897992134094, -0.06352894008159637, -0.11175135523080826, -0.2206578403711319, -0.2474457025527954, 0.19563144445419312, 0.318848192691803, -0.15394267439842224, 0.0706891268491745, -0.3825514018535614, 0.1627441793680191, 0.4896495044231415, -0.08533383905887604, -0.39488688111305237, 0.09257738292217255, -0.07557083666324615, 0.12328439205884933, -0.10046476125717163, 0.19253817200660706, -0.07506175339221954, -0.19146186113357544, -0.02311037853360176, 0.2289581000804901, 0.06974484026432037, 0.012839771807193756, -0.2851402163505554, -0.35528743267059326, 0.011503268033266068, 0.1787879914045334, -0.14027664065361023, 0.28442978858947754, 0.28472191095352173, -0.030078895390033722, 0.1533246636390686, -0.04525317624211311, -0.040080804377794266, -0.07384869456291199, 0.4531903564929962, 0.06271134316921234, 0.14788641035556793, -0.24478667974472046, -0.6249391436576843, 0.26711636781692505, -0.033675938844680786, -0.07548049092292786, -0.09807978570461273, -0.20652662217617035, -0.3407860994338989, 0.15014658868312836, 0.03370809555053711, 0.25971493124961853, 0.04166990518569946, -0.2175062596797943, 0.01073436439037323, -0.04569125920534134, -0.41558361053466797, 0.22766812145709991, -0.3084429204463959, 0.1975884735584259, -0.33789917826652527, 0.2894865870475769, -0.18191476166248322, -0.3432845175266266, 0.013803191483020782, -0.049829643219709396, 0.04061437398195267, -0.2729228138923645, -0.022295262664556503, 0.29031985998153687, -0.2627798616886139, 0.09218251705169678, -0.19736352562904358, 0.12516741454601288, 0.15394437313079834, -0.5102099776268005, 0.016243090853095055, 0.00970941036939621, 0.2796519100666046, -0.16797326505184174, 0.0129743916913867, 0.4530767798423767, -0.2698400914669037, -0.02870761603116989, 0.03500513732433319, -0.06219438463449478, 0.2945067286491394, -0.009487055242061615, 0.23672455549240112, -0.09870915859937668, 0.06935712695121765, -0.042167674750089645, 0.11474191397428513, 0.20128202438354492, -0.4336214065551758, 0.05041858181357384, 0.31625720858573914, 0.008551903069019318, -0.0211976058781147, 0.3987146019935608, 0.027486301958560944, -0.03627909719944, -0.17716987431049347, -0.40860211849212646, 0.352803498506546, 0.19980384409427643, -0.0519208125770092, 0.017773954197764397, 0.07428012788295746, -0.12240318953990936, 0.0465255081653595, -0.014825176447629929, 0.02416667714715004, 0.1461944878101349, 0.21167725324630737, 0.06111891567707062, -0.2940143346786499, -0.009015887975692749, 0.0299464613199234, 0.26499563455581665, -0.4372275471687317, 0.013928644359111786, -0.10439065098762512, -0.19347929954528809, -0.0068130698055028915, -0.20899832248687744, -0.11479264497756958, -0.21678271889686584, -0.26998671889305115, 0.4742673933506012, -0.08759520947933197, 0.013158727437257767, 0.03800106793642044, 0.1286705732345581, 0.10831065475940704, -0.042931199073791504, -0.49480047821998596, 0.051922544836997986, -0.18827497959136963, 0.0189766027033329, 0.3619478642940521, 0.30072101950645447, 0.1581099033355713, -0.0725785493850708, -0.04472079128026962, -0.20218926668167114, -0.1004745215177536, 0.0200301855802536, -0.18516337871551514, 0.41190728545188904, 0.1902671903371811, 0.41249486804008484, -0.14418251812458038, -0.4168681800365448, 0.5258909463882446, -0.5287757515907288, -0.36958959698677063, 0.2749604880809784, 0.12778757512569427, -0.14556413888931274, -0.18366901576519012, -0.201137974858284, -0.22688966989517212, -0.4102773070335388, 0.3492509722709656, -0.04509550705552101, 0.0421571210026741, 0.09188872575759888, 0.1919315904378891, 0.3471427261829376, 0.05334955081343651, -0.056598495692014694, -0.1573818325996399, -0.4389490783214569, 0.2609403133392334, 0.013545684516429901, -0.44214409589767456, -0.06526367366313934, 0.0688224583864212, -0.3057763874530792, -0.06117166578769684, -0.2800493836402893, -0.20057526230812073, -0.2741895616054535, 0.07740256190299988, 0.05728159472346306, -0.00662060733884573, 0.05099574103951454, -0.04880863055586815, -0.009360630065202713, -0.06366540491580963, -0.08815518766641617, 0.027447955682873726, 0.4479207992553711, 0.1342139095067978, 0.176378533244133, 0.3813890218734741, -0.0323295034468174, 0.32674726843833923, 0.09924915432929993, -0.09411762654781342, 0.4874229431152344, -0.08264218270778656, 0.34128686785697937, -0.2773398160934448, -0.4512157738208771, 0.02288590744137764, -0.050307825207710266, -0.15031808614730835, 0.18155306577682495, 0.09323339909315109, -0.13129818439483643, 0.06709755957126617, -0.40638867020606995, -0.03404471278190613, -0.1101771742105484, 0.1646403670310974, 0.3419857621192932, -0.324077308177948, -0.12568260729312897, -0.31826716661453247, 0.014534898102283478, -0.3004719018936157, 0.14214178919792175, 0.4202407896518707, 0.08877623081207275, 0.03223254531621933, 0.05972960591316223, 0.1354893147945404, -0.20762856304645538, 0.21439513564109802, 0.11295346915721893, 0.11519755423069, 0.007418401539325714, -0.18204858899116516, 0.27339625358581543, -0.0056637972593307495, 0.8658161759376526, 0.18280835449695587, 0.48423248529434204, 0.2663480043411255, 0.08672813326120377, -0.32799383997917175, -0.02610015496611595, -0.265422523021698, -0.1415458619594574, 0.5738090872764587, 0.6205166578292847, -0.3287091851234436, -0.13289321959018707, 0.13396500051021576, 0.1501382291316986, 0.025461599230766296, -0.30683284997940063, -0.3330267667770386, -0.4794869124889374, -0.0753609761595726, 0.14701098203659058, 0.37982118129730225, 0.4257233142852783, 0.028101526200771332, 0.03848583251237869, -0.23106986284255981, -0.21839508414268494, 0.12103761732578278, -0.021223433315753937, 0.3234386146068573, -0.015859609469771385, 0.23069757223129272, -0.044550247490406036, 0.11325031518936157, 0.18341438472270966, 0.6211666464805603, 0.23061279952526093, -0.17970867455005646, 0.07520590722560883, 0.04149148240685463, 0.2346581369638443, 0.1094309464097023, -0.15366657078266144, -0.10405159741640091, -0.21930155158042908, 0.2692045569419861, -0.12460984289646149, 0.0981070026755333, -0.07083679735660553, 0.06269673258066177, -0.5045432448387146, -0.10903936624526978, 0.5953394174575806, -0.06838346272706985, -0.005955591797828674, 0.39545872807502747, 0.49620455503463745, -0.1279357373714447, 0.4350079596042633, -0.10999200493097305, 1.038647174835205, -0.34122419357299805, 0.05346657335758209, 0.3368847072124481, -0.030910596251487732, 0.10877379775047302, -0.026351608335971832, -0.06264791637659073, -0.40599551796913147, -0.46422621607780457, 0.017286047339439392, -0.1827963888645172, 0.1574866771697998, 0.1814267933368683, -0.2832725942134857, 0.09246063232421875, -0.3319658637046814, 0.3368206024169922, -0.08756700158119202, 0.08188433200120926, -0.29093533754348755, -0.16345052421092987, -0.4472396969795227, 0.11900165677070618, 0.01926496997475624, 0.12130174785852432, -0.0708664134144783, -0.2243257462978363, -0.07604275643825531, -0.10627814382314682, -0.22528740763664246, 0.17255377769470215, 0.16991625726222992, 0.06763720512390137, 0.3782047629356384, -0.1055181622505188, 0.14437329769134521, 0.4747944176197052, 0.25654760003089905, 0.03416453301906586, -0.1467180699110031, 0.07541519403457642, -0.033632561564445496, -0.0634370818734169, 0.15393027663230896, 0.15386608242988586, 0.4153192341327667, 0.021630994975566864, -0.11329275369644165, -0.12217020988464355, -0.1306041032075882, -0.1909865438938141, 0.05712197721004486, 0.19393038749694824, -0.4574732482433319, -0.6068335175514221, -0.41237673163414, -0.25695687532424927, 0.14389880001544952, -0.030878346413373947, 0.1468919962644577, 0.21880725026130676, -0.047525547444820404, -0.03501511737704277, 0.3001570999622345, -0.2507683038711548, -0.022586345672607422, 0.483123242855072, -0.13093654811382294, 0.18534457683563232, 0.16095513105392456, 0.2625889778137207, -0.18560802936553955, -0.11467787623405457, -0.10058441758155823, 0.29588955640792847, -0.4967670738697052, 0.3200259506702423, 0.16469740867614746, 0.02827410399913788, 0.0417570136487484, 0.4320111870765686, 0.29153725504875183, 0.049322791397571564, -0.14357033371925354, -0.4912976026535034, -0.2930186986923218, 0.29683932662010193, -0.06488743424415588, 0.022638339549303055, -0.13310296833515167, 0.08408991992473602, 0.0917174369096756, -0.147592231631279, -0.3268072307109833, 0.22991839051246643, -0.38394561409950256, -0.06578972935676575, -0.08238406479358673, -0.022142544388771057, 0.33242595195770264, -0.22540844976902008, 0.187279611825943, 0.12020030617713928, -0.13463899493217468, -0.19287338852882385, -0.039146073162555695, 0.06563618034124374, 0.08451054990291595, -0.026866525411605835, -0.09483346343040466, -0.045068517327308655, -0.1599380373954773, -0.24264729022979736, 0.1859205663204193, 0.4565325379371643, 0.07676266133785248, -0.001986999064683914, 0.5321095585823059, 0.10654737055301666, -0.016841843724250793, 0.19121816754341125, -0.0037409700453281403, 0.018890785053372383, -0.08254867792129517, -0.2169405221939087, -0.24721461534500122, 0.11627238988876343, 0.28970131278038025, 0.04931095615029335, 0.28939294815063477, -0.0876975953578949, 0.41089460253715515, -0.023953162133693695, -0.1264442652463913, 0.11831744015216827, 0.27821171283721924, 0.11579205095767975, -0.21545951068401337, 0.10004191100597382, 0.12524950504302979, 0.17563754320144653, -0.42593473196029663, -0.10777415335178375, 0.40960100293159485, 0.14452245831489563, -0.23871371150016785, 0.14340800046920776, -0.055302560329437256, -0.1850961446762085, -0.10415060818195343, 0.09637689590454102, 0.8220065236091614, -0.1333683282136917, 0.01085781678557396, -0.04530302807688713, 0.03984440863132477, -0.013396048918366432, 0.3515266478061676, 0.07911355048418045, 0.20569641888141632, -0.03810478374361992, -0.18726812303066254, -0.1847446858882904, -0.28820255398750305, 0.27438339591026306, 0.062035977840423584, -0.2998938262462616, -0.13317200541496277, 0.7120773196220398, -0.07374908030033112, -0.012815222144126892, -0.06021171063184738, 0.5367886424064636, -0.09420111030340195, -0.10693417489528656, -0.11155086755752563, 0.1145981028676033, -0.28087273240089417, 0.008137386292219162, 0.25180885195732117, -0.04735585302114487, -0.06971873342990875, 0.015518248081207275, -0.08806928992271423, -0.272891640663147, -0.027820095419883728, 0.16948489844799042, -0.007089704275131226, -0.27033907175064087, -0.053938161581754684, 0.21017180383205414, 0.232407808303833, -0.20716652274131775, 0.2176719754934311, 0.05754170939326286, -0.23324444890022278, 0.2722287178039551, 0.2973144054412842, 0.3554481565952301, 0.15265464782714844, 0.27499860525131226, 0.1403675526380539, 0.06254348158836365, -0.20314355194568634, -0.08959279954433441, 0.3277420401573181, 0.004104018211364746, 0.31032150983810425, -0.003959398716688156, 0.2142380326986313, -0.19316375255584717, -0.10286344587802887, -0.07835730910301208, 0.5086536407470703, -0.2021663784980774, 0.6184273958206177, -0.43774914741516113, -0.214943528175354, -0.1041964739561081, -0.1205100417137146, -0.5474324226379395, -0.11698663979768753, 0.21563173830509186, -0.13866612315177917, 0.24068497121334076, 0.2277391254901886, 0.07703974843025208, 0.07135556638240814, 0.3032405376434326, 0.5063340663909912, -0.3039013743400574, -0.17082929611206055, -0.04126095026731491, -0.7002161145210266, 0.21857671439647675, 0.2876077890396118, 0.1754789501428604, 0.2413409948348999, 0.08029408007860184, -0.06745263934135437, -0.1047128289937973, -0.06243738532066345, -0.10102663189172745, 0.036313705146312714, 0.2529790699481964, -0.1283608376979828, -0.18281778693199158, -0.2814771831035614, 0.0008735731244087219, -0.1398455798625946, -0.1618395745754242, 0.17902594804763794, -0.22698883712291718, 0.1036497950553894, -0.10679708421230316, 0.09210740029811859, -0.11931134760379791, -0.39549222588539124, 0.032126761972904205, -0.1886538416147232, 0.16037186980247498, 0.06326848268508911, 0.12354176491498947, -0.1795937716960907, -0.4541044235229492, 0.05878179520368576, 0.22756235301494598, -0.16006751358509064, 0.2244446575641632, -0.17434290051460266, 0.17142371833324432, -0.2083398848772049, -0.11254091560840607, -0.17079214751720428, 0.04933714494109154, -0.40784889459609985, 0.2495487481355667, -0.39876407384872437, -0.021341340616345406, -0.054192885756492615, 0.21130366623401642, 0.12812548875808716, 0.1134495884180069, -0.13133257627487183, -0.3983776271343231, 0.6591508984565735, -0.5996435284614563, -0.3295103907585144, 0.1982993334531784, 0.03732920438051224, 0.0334995873272419, -0.15264634788036346, -0.617725670337677, 0.09029693901538849, 0.22051551938056946, 0.045354198664426804, -0.13419057428836823, 0.10952813923358917, -0.20690913498401642, 0.08962967991828918, -0.19817465543746948, 0.2796012759208679, 0.1551494002342224, -0.07296869158744812, 0.11813510954380035, -0.11540234088897705 ]
https://github.com/huggingface/datasets/issues/5761
Also, when generated from a zip archive, the dataset contains only a few images. In my case, 20 versus 2000+ contained in the archive. The generation from folders works as expected.
One or several metadata.jsonl were found, but not in the same directory or in a parent directory
### Describe the bug An attempt to generate a dataset from a zip archive using imagefolder and metadata.jsonl does not lead to the expected result. Tried all possible locations of the json file: the file in the archive is ignored (generated dataset contains only images), the file next to the archive like [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder) leads to an error: ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1610, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1609 _time = time.time() -> 1610 for key, record in generator: 1611 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\packaged_modules\folder_based_builder\folder_based_builder.py:370, in FolderBasedBuilder._generate_examples(self, files, metadata_files, split_name, add_metadata, add_labels) 369 else: --> 370 raise ValueError( 371 f"One or several metadata.{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_dir_file}." 372 ) 373 if metadata_dir is not None and downloaded_metadata_file is not None: ValueError: One or several metadata.jsonl were found, but not in the same directory or in a parent directory of C:\Users\User\.cache\huggingface\datasets\downloads\extracted\f7fb7de25fb28ae63089974524f2d271a39d83888bc456d04aa3b3d45f33e6a6\ff0745a0-a741-4d9e-b228-a93b851adf61.png. The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[3], line 1 ----> 1 dataset = load_dataset("imagefolder", data_dir=r'C:\Users\User\data') File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:986, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 982 split_dict.add(split_generator.split_info) 984 try: 985 # Prepare split will record examples associated to the split --> 986 self._prepare_split(split_generator, **prepare_split_kwargs) 987 except OSError as e: 988 raise OSError( 989 "Cannot find data file. " 990 + (self.manual_download_instructions or "") 991 + "\nOriginal error:\n" 992 + str(e) 993 ) from None File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1490, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1488 gen_kwargs = split_generator.gen_kwargs 1489 job_id = 0 -> 1490 for job_id, done, content in self._prepare_split_single( 1491 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1492 ): 1493 if done: 1494 result = content File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1646, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1644 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1645 e = e.__context__ -> 1646 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1648 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. Organize directory structure like in the docs: folder/metadata.jsonl folder/train.zip 2. Run load_dataset("imagefolder", data_dir='folder/metadata.jsonl', split='train') ### Expected behavior Dataset generated with all additional features from metadata.jsonl ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.9.0 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
31
One or several metadata.jsonl were found, but not in the same directory or in a parent directory ### Describe the bug An attempt to generate a dataset from a zip archive using imagefolder and metadata.jsonl does not lead to the expected result. Tried all possible locations of the json file: the file in the archive is ignored (generated dataset contains only images), the file next to the archive like [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder) leads to an error: ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1610, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1609 _time = time.time() -> 1610 for key, record in generator: 1611 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\packaged_modules\folder_based_builder\folder_based_builder.py:370, in FolderBasedBuilder._generate_examples(self, files, metadata_files, split_name, add_metadata, add_labels) 369 else: --> 370 raise ValueError( 371 f"One or several metadata.{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_dir_file}." 372 ) 373 if metadata_dir is not None and downloaded_metadata_file is not None: ValueError: One or several metadata.jsonl were found, but not in the same directory or in a parent directory of C:\Users\User\.cache\huggingface\datasets\downloads\extracted\f7fb7de25fb28ae63089974524f2d271a39d83888bc456d04aa3b3d45f33e6a6\ff0745a0-a741-4d9e-b228-a93b851adf61.png. The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[3], line 1 ----> 1 dataset = load_dataset("imagefolder", data_dir=r'C:\Users\User\data') File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:986, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 982 split_dict.add(split_generator.split_info) 984 try: 985 # Prepare split will record examples associated to the split --> 986 self._prepare_split(split_generator, **prepare_split_kwargs) 987 except OSError as e: 988 raise OSError( 989 "Cannot find data file. " 990 + (self.manual_download_instructions or "") 991 + "\nOriginal error:\n" 992 + str(e) 993 ) from None File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1490, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1488 gen_kwargs = split_generator.gen_kwargs 1489 job_id = 0 -> 1490 for job_id, done, content in self._prepare_split_single( 1491 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1492 ): 1493 if done: 1494 result = content File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1646, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1644 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1645 e = e.__context__ -> 1646 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1648 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. Organize directory structure like in the docs: folder/metadata.jsonl folder/train.zip 2. Run load_dataset("imagefolder", data_dir='folder/metadata.jsonl', split='train') ### Expected behavior Dataset generated with all additional features from metadata.jsonl ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.9.0 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Also, when generated from a zip archive, the dataset contains only a few images. In my case, 20 versus 2000+ contained in the archive. The generation from folders works as expected.
[ 0.0063481926918029785, 0.02177014946937561, 0.003071814775466919, 0.7927377223968506, -0.006188119761645794, 0.07700850069522858, 0.1289169043302536, 0.2964591383934021, -0.017772063612937927, 0.11702190339565277, 0.18320302665233612, 0.5142329335212708, -0.2491484135389328, -0.1386450231075287, -0.13588514924049377, -0.01331041194498539, -0.03958188369870186, 0.12554931640625, -0.03939973935484886, -0.09937824308872223, -0.35316404700279236, 0.3889520466327667, -0.0034385472536087036, 0.1204652488231659, -0.19736619293689728, 0.10910053551197052, -0.1617966741323471, 0.3033216595649719, -0.27330124378204346, -0.14250731468200684, 0.09193398803472519, -0.3360828757286072, -0.10950221121311188, 0.5043619871139526, -0.00012051993689965457, 0.04574961215257645, 0.3041227161884308, -0.1610632985830307, -0.16406860947608948, -0.6293297410011292, -0.21359196305274963, -0.005867183208465576, -0.2684696316719055, -0.19454467296600342, 0.16625726222991943, -0.5425432324409485, -0.012313513085246086, -0.2846081852912903, 0.16818195581436157, 0.2027275562286377, 0.12764805555343628, 0.21726492047309875, 0.25396937131881714, 0.11852286756038666, 0.47938311100006104, 0.682862401008606, -0.13635802268981934, 0.24672868847846985, -0.0842692032456398, -0.0689232125878334, 0.2722395956516266, 0.3036767840385437, 0.04436594992876053, 0.12411926686763763, 0.36164355278015137, 0.3573027551174164, -0.18178443610668182, -0.34912967681884766, 0.0635710209608078, -0.08642454445362091, 0.3452334403991699, -0.22846099734306335, -0.45490580797195435, -0.24875211715698242, -0.12431071698665619, -0.12564487755298615, 0.4691064655780792, 0.4723125100135803, -0.34521982073783875, -0.11890951544046402, -0.11759807169437408, -0.02443213015794754, -0.15012890100479126, 0.06696484982967377, 0.10943005979061127, 0.4077642560005188, -0.046637944877147675, 0.1325780600309372, 0.19224326312541962, 0.010897798463702202, 0.08634033054113388, -0.2993601858615875, 0.024763159453868866, 0.16239497065544128, 0.06929060816764832, 0.04550828039646149, -0.102961465716362, -0.39272281527519226, 0.35954561829566956, 0.16377633810043335, -0.04526793956756592, -0.5509966611862183, -0.35552072525024414, 0.2650933265686035, 0.17241990566253662, -0.03095616027712822, 0.23322688043117523, 0.32646360993385315, 0.21452131867408752, 0.23374152183532715, 0.06520828604698181, -0.053093165159225464, -0.08915357291698456, 0.08832608908414841, 0.09476040303707123, 0.0418134368956089, 0.17370513081550598, 0.10835520178079605, -0.12111402302980423, -0.1668524295091629, -0.5645041465759277, -0.3507847189903259, -0.01651466265320778, 0.041411906480789185, 0.22566330432891846, 0.03281208127737045, 0.20377717912197113, 0.17792923748493195, 0.20593935251235962, -0.00321970134973526, -0.048427075147628784, 0.499411404132843, -0.3169100284576416, 0.026101544499397278, 0.1652863323688507, -0.14703041315078735, 0.2973712384700775, 0.20149670541286469, -0.2543688118457794, -0.5044569373130798, 0.26210153102874756, -0.15584126114845276, 0.027316179126501083, 0.4120847284793854, -0.07392680644989014, 0.35801008343696594, 0.0687149167060852, 0.061911821365356445, -0.1807682365179062, 0.10170002281665802, -0.3386695981025696, -0.04069364815950394, 0.22544169425964355, 0.07324809581041336, -0.05961667001247406, 0.2072901874780655, -0.3666037619113922, -0.11876355111598969, 0.2440773844718933, -0.08500389009714127, 0.0712820291519165, 0.13347065448760986, -0.23953662812709808, -0.33322811126708984, 0.025197505950927734, 0.38380295038223267, -0.422410249710083, -0.06440024077892303, -0.14434604346752167, 0.08409164845943451, -0.10813581198453903, 0.34894201159477234, -0.11541782319545746, 0.5877711772918701, -0.5966395139694214, 0.11098144948482513, 0.1637117862701416, -0.5697267055511475, -0.11428350955247879, 0.2715925872325897, -0.10479867458343506, 0.050386056303977966, 0.3101368844509125, -0.09256987273693085, -0.068303182721138, -0.07102268934249878, 0.020758643746376038, 0.13794314861297607, -0.06333586573600769, 0.2459149956703186, -0.016561344265937805, -0.28004807233810425, -0.05707668140530586, 0.00463162362575531, -0.10270336270332336, 0.09481260925531387, -0.1396578699350357, -0.16715168952941895, 0.10970936715602875, -0.22053329646587372, 0.27871546149253845, 0.1981348991394043, 0.06116199493408203, -0.11002548038959503, 0.035572297871112823, 0.10991556197404861, -0.48878300189971924, 0.1365121603012085, -0.17200398445129395, 0.017801601439714432, -0.5790894031524658, 0.13173356652259827, -0.09802251309156418, 0.0010255500674247742, -0.1886720210313797, -0.3610728085041046, 0.0643383115530014, 0.4189755916595459, 0.1557662934064865, -0.13824471831321716, -0.23330888152122498, 0.30429062247276306, 0.5230602025985718, 0.2863329350948334, -0.6189788579940796, 0.49011969566345215, 0.014014603570103645, -0.18754401803016663, 0.16184638440608978, -0.0135783851146698, 0.13837362825870514, -0.18786367774009705, -0.017845524474978447, 0.23228538036346436, -0.09058450162410736, 0.07040806114673615, 0.08722831308841705, 0.03726746141910553, 0.2759511172771454, -0.25924012064933777, 0.20440351963043213, 0.014452729374170303, 0.22708959877490997, -0.11641934514045715, -0.29075056314468384, 0.24856901168823242, 0.003093746490776539, 0.3838220238685608, 0.05941396951675415, -0.06536700576543808, 0.026990480720996857, -0.08726949989795685, 0.04411613196134567, -0.16631893813610077, 0.04262002184987068, 0.2825758159160614, 0.35286879539489746, 0.12697988748550415, -0.026407986879348755, 0.14082995057106018, 0.22063808143138885, -0.023985296487808228, 0.020100394263863564, 0.24845966696739197, -0.05082474276423454, -0.01581496372818947, -0.20781265199184418, 0.43183791637420654, 0.7347219586372375, 0.09864592552185059, -0.09384441375732422, -0.022369254380464554, -0.0797848328948021, -0.199870303273201, 0.012201085686683655, -0.12039431929588318, 0.21967124938964844, 0.43888646364212036, 0.4112567603588104, 0.04355015605688095, -0.3317560851573944, -0.26202791929244995, 0.06792336702346802, 0.2623186707496643, -0.20507344603538513, 0.1655057668685913, -0.18598419427871704, -0.2137005627155304, -0.22829914093017578, 0.020997658371925354, -0.3105793297290802, -0.15092912316322327, 0.046426285058259964, 0.3714298903942108, -0.1225496381521225, -0.07797244936227798, 0.4864307641983032, 0.27109140157699585, -0.05978115275502205, 0.21295151114463806, -0.4728010594844818, 0.19350478053092957, -0.021789586171507835, -0.10572108626365662, 0.16831502318382263, 0.012136708945035934, 0.291288286447525, -0.23440833389759064, -0.05615142360329628, -0.704291045665741, -0.09118051826953888, 0.27729734778404236, -0.228866845369339, 0.38128936290740967, 0.32257241010665894, 0.16875021159648895, 0.21732549369335175, -0.36073341965675354, 0.34945815801620483, 0.02030293643474579, -0.3867769241333008, 0.007349349558353424, 0.01665758714079857, 0.3279305696487427, -0.186501145362854, -0.2591513395309448, -0.19895461201667786, -0.20659352838993073, 0.2856539785861969, -0.049346763640642166, 0.3629894256591797, 0.16825516521930695, -0.06614237278699875, -0.15157698094844818, -0.33693063259124756, -0.013795537874102592, -0.0787799060344696, -0.40098148584365845, 0.2403181493282318, -0.15233337879180908, -0.19274815917015076, -0.07807725667953491, -0.005974791944026947, 0.31780362129211426, 0.07745258510112762, -0.3587656617164612, -0.43909043073654175, -0.15463146567344666, 0.12182533740997314, -0.2506832480430603, 0.11179018020629883, 0.2168813943862915, 0.06813278794288635, 0.040874183177948, -0.31557562947273254, -0.29535341262817383, 0.42268985509872437, -0.26390671730041504, 0.3793560862541199, 0.09732113778591156, 0.44844475388526917, 0.029961176216602325, 0.24656741321086884, 0.4406834840774536, 0.08653133362531662, 0.26037412881851196, -0.08443950861692429, 0.280328631401062, 0.031925272196531296, -0.13594312965869904, -0.13229644298553467, 0.24187055230140686, 0.044293083250522614, 0.027590163052082062, 0.2651752233505249, 0.13586729764938354, -0.0979016125202179, 0.16599318385124207, -0.707011342048645, -0.1114124283194542, -0.06375975161790848, 0.23544389009475708, 0.10339903831481934, -0.056508101522922516, -0.183355450630188, -0.08876947313547134, 0.14366115629673004, 0.09372507780790329, 0.32272109389305115, 0.4272565543651581, 0.1322869509458542, -0.2383778840303421, -0.14811989665031433, 0.019590934738516808, -0.07187367230653763, 0.05206472426652908, 0.3036603331565857, -0.0871819481253624, 0.23786944150924683, 0.02267315797507763, -0.15649566054344177, 0.884688675403595, -0.2778422236442566, 0.29384845495224, -0.06186529994010925, -0.07218503206968307, -0.255179226398468, -0.10016612708568573, -0.12899993360042572, 0.030948158353567123, 0.018444642424583435, 0.7103434801101685, -0.4551065266132355, -0.0039563290774822235, 0.1627732217311859, 0.07464974373579025, 0.032439738512039185, -0.42421266436576843, -0.10311813652515411, -0.44539910554885864, -0.27308017015457153, -0.31391456723213196, -0.015051394701004028, -0.010533809661865234, 0.20344913005828857, -0.11001960933208466, 0.4003761410713196, -0.23051607608795166, -0.15216600894927979, -0.09788130223751068, 0.25613152980804443, -0.2895672917366028, 0.2973213493824005, 0.3122568726539612, 0.07900702208280563, 0.4104315936565399, 0.5018766522407532, 0.08124663680791855, -0.3020859956741333, 0.07393702119588852, -0.1814080774784088, 0.13273122906684875, 0.28304213285446167, -0.2245662659406662, 0.05657512694597244, -0.48848915100097656, 0.14236479997634888, -0.06288602203130722, -0.2600228488445282, 0.5327097177505493, -0.18384210765361786, -0.015103098005056381, -0.1905989646911621, 0.584690272808075, 0.49753129482269287, -0.08090552687644958, 0.3088650107383728, -0.20604220032691956, -0.35293418169021606, 0.03319516405463219, -0.15322254598140717, 0.7654201984405518, 0.0859539657831192, 0.10582001507282257, 0.3549892008304596, -0.38037848472595215, 0.5547235608100891, -0.24114510416984558, 0.08340327441692352, -0.5133206844329834, -0.05617374926805496, -0.05524662509560585, -0.21922117471694946, -0.029660392552614212, 0.25769662857055664, -0.07016601413488388, 0.1639459729194641, -0.2561096251010895, -0.0389581061899662, -0.03646048158407211, 0.22234909236431122, -0.2767738401889801, -0.2676197290420532, -0.40126168727874756, 0.05733451247215271, -0.09847144782543182, 0.45560455322265625, -0.012747779488563538, -0.1611749529838562, -0.44605833292007446, -0.4456159472465515, -0.47247856855392456, 0.211029052734375, 0.009387645870447159, 0.09101678431034088, 0.44755738973617554, 0.010716944932937622, -0.1989128738641739, -0.18814150989055634, 0.33217570185661316, -0.04906037449836731, -0.12216212600469589, -0.0174807608127594, -0.18157730996608734, 0.21573057770729065, -0.028537916019558907, -0.12460820376873016, 0.0556722953915596, -0.06963665038347244, 0.06083753705024719, -0.06334257870912552, -0.2700497508049011, -0.11737968027591705, -0.14225122332572937, -0.05914171412587166, -0.3785133361816406, 0.05012163892388344, 0.09169512987136841, -0.04477372765541077, -0.1385512351989746, -0.19351567327976227, 0.02173326350748539, 0.2810436487197876, -0.01274586096405983, 0.040906649082899094, -0.224493145942688, -0.22458402812480927, -0.0401519276201725, 0.28213635087013245, -0.030283518135547638, 0.16154751181602478, 0.19174577295780182, 0.13336509466171265, -0.022221405059099197, -0.1947489082813263, 0.4005681276321411, 0.18283088505268097, -0.5591082572937012, 0.33425456285476685, -0.0447152778506279, 0.10800322890281677, 0.13954493403434753, 0.15013255178928375, 0.3431713879108429, 0.14644761383533478, -0.060349833220243454, -0.5759138464927673, 0.013690166175365448, 0.3971789479255676, -0.14270000159740448, -0.03575825318694115, -0.2718350887298584, 0.05820653960108757, 0.15647092461585999, -0.031510595232248306, -0.1922062635421753, 0.06760796904563904, -0.11583748459815979, 0.004165826365351677, 0.33518677949905396, 0.09839391708374023, 0.13004329800605774, 0.07097882032394409, 0.05759323760867119, 0.10973416268825531, -0.15746837854385376, -0.0066766515374183655, -0.21024900674819946, 0.15711793303489685, 0.1287989616394043, 0.07777969539165497, 0.06631915271282196, -0.0995204970240593, -0.18466708064079285, -0.0483691580593586, 0.05104245990514755, -0.029542189091444016, -0.15284422039985657, 0.013578303158283234, 0.08980681747198105, -0.06983740627765656, -0.05045204609632492, 0.21555954217910767, -0.2046523243188858, 0.07579278200864792, 0.11569935083389282, 0.13352715969085693, -0.17889584600925446, -0.09633030742406845, -0.35430994629859924, 0.06452023983001709, -0.48767200112342834, 0.4438767731189728, 0.4391288757324219, -0.30271628499031067, 0.22501729428768158, 0.01837078109383583, 0.3165439963340759, 0.22211509943008423, -0.20675167441368103, 0.1865551620721817, -0.17232555150985718, 0.06395810842514038, -0.11339356750249863, -0.23539267480373383, -0.18499985337257385, 0.10824225097894669, -0.013083204627037048, 0.33442357182502747, -0.14929695427417755, 0.06247831881046295, -0.1518903374671936, -0.028623059391975403, 0.7114486694335938, 0.04636932909488678, -0.08694806694984436, 0.37142476439476013, -0.23332102596759796, 0.2610792815685272, 0.3320049047470093, -0.020271465182304382, 0.1345658004283905, 0.11299765855073929, 0.10535390675067902, 0.1737043857574463, -0.028451932594180107, -0.052512090653181076, 0.20156827569007874, -0.16615372896194458, -0.18621307611465454, 0.16636346280574799, 0.426251083612442, -0.14715714752674103, -0.06799262017011642, 0.3503462076187134, -0.2841655910015106, 0.07194297760725021, -0.03068733587861061, 0.48671451210975647, 0.14858441054821014, 0.0032209642231464386, -0.26431405544281006, -0.3316251039505005, -0.22071179747581482, 0.005415298044681549, -0.041443876922130585, -0.11157308518886566, 0.21362480521202087, 0.08123345673084259, -0.21469733119010925, -0.3348677158355713, -0.10112009197473526, 0.16710221767425537, 0.10011250525712967, -0.38661858439445496, 0.5862846374511719, 0.175573468208313, -0.16136199235916138, -0.009695608168840408, 0.455541729927063, 0.34691935777664185, 0.4676036536693573, 0.463888019323349, 0.0018798448145389557, -0.5670835375785828, -0.03390025720000267, -0.04792998731136322, 0.2016654908657074, -0.020857464522123337, -0.2787655293941498, 0.09808075428009033, 0.09526288509368896, -0.08546709269285202, 0.11139455437660217, 0.16308671236038208, 0.2394026517868042, -0.09894435852766037, 0.17537552118301392, -0.3129082918167114, -0.05256815627217293, 0.08855431526899338, -0.11942458152770996, -0.38307783007621765, -0.4066010117530823, 0.2089734673500061, 0.2118961364030838, 0.14487576484680176, 0.07833027094602585, 0.029190313071012497, 0.0037170015275478363, 0.18974749743938446, 0.45659375190734863, -0.16852200031280518, -0.1103019192814827, -0.21120858192443848, -0.48055028915405273, -0.057488638907670975, -0.2827964425086975, -0.27420544624328613, -0.20567095279693604, 0.048338741064071655, 0.09117422997951508, 0.013456737622618675, 0.4262996017932892, 0.46594077348709106, -0.038805752992630005, 0.18519574403762817, -0.4275650382041931, -0.3275832235813141, 0.43692994117736816, 0.14356137812137604, -0.016422808170318604, -0.14449308812618256, 0.30323654413223267, 0.0005580224096775055, 0.04415823519229889, -0.05543194338679314, 0.02336832880973816, -0.08997044712305069, -0.11528468877077103, 0.34665557742118835, 0.19902631640434265, 0.24183878302574158, -0.12449542433023453, -0.4139781892299652, -0.2597575783729553, 0.02103530243039131, -0.1422395408153534, 0.19953615963459015, 0.2280137985944748, 0.680396556854248, -0.1672435700893402, 0.11804526299238205, -0.5902280211448669, -0.09887811541557312, -0.2575806975364685, -0.003892291337251663, -0.37666982412338257, 0.41844892501831055, -0.12652432918548584, -0.09487517178058624, 0.021858640015125275, 0.006906558759510517, -0.0548851378262043, 0.07078658789396286, -0.4257494807243347, -0.3221747875213623, 0.4803650975227356, -0.1680324822664261, -0.2961729168891907, 0.25463593006134033, 0.15672999620437622, -0.2551995515823364, -0.10899832099676132, -0.13637831807136536, -0.01780940592288971, 0.34383395314216614, 0.000021146610379219055, -0.26223328709602356, -0.2340150773525238, 0.012283381074666977, -0.14722281694412231, 0.14647872745990753, 0.08880861103534698, 0.2097969949245453, -0.28176945447921753, 0.4590199291706085, 0.028700269758701324 ]
https://github.com/huggingface/datasets/issues/5761
Thanks for reporting, @blghtr. You should include the `metadata.jsonl` in your ZIP archives, at the root level directory. I agree that our documentation is not clear enough. Maybe we could improve it.
One or several metadata.jsonl were found, but not in the same directory or in a parent directory
### Describe the bug An attempt to generate a dataset from a zip archive using imagefolder and metadata.jsonl does not lead to the expected result. Tried all possible locations of the json file: the file in the archive is ignored (generated dataset contains only images), the file next to the archive like [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder) leads to an error: ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1610, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1609 _time = time.time() -> 1610 for key, record in generator: 1611 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\packaged_modules\folder_based_builder\folder_based_builder.py:370, in FolderBasedBuilder._generate_examples(self, files, metadata_files, split_name, add_metadata, add_labels) 369 else: --> 370 raise ValueError( 371 f"One or several metadata.{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_dir_file}." 372 ) 373 if metadata_dir is not None and downloaded_metadata_file is not None: ValueError: One or several metadata.jsonl were found, but not in the same directory or in a parent directory of C:\Users\User\.cache\huggingface\datasets\downloads\extracted\f7fb7de25fb28ae63089974524f2d271a39d83888bc456d04aa3b3d45f33e6a6\ff0745a0-a741-4d9e-b228-a93b851adf61.png. The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[3], line 1 ----> 1 dataset = load_dataset("imagefolder", data_dir=r'C:\Users\User\data') File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:986, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 982 split_dict.add(split_generator.split_info) 984 try: 985 # Prepare split will record examples associated to the split --> 986 self._prepare_split(split_generator, **prepare_split_kwargs) 987 except OSError as e: 988 raise OSError( 989 "Cannot find data file. " 990 + (self.manual_download_instructions or "") 991 + "\nOriginal error:\n" 992 + str(e) 993 ) from None File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1490, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1488 gen_kwargs = split_generator.gen_kwargs 1489 job_id = 0 -> 1490 for job_id, done, content in self._prepare_split_single( 1491 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1492 ): 1493 if done: 1494 result = content File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1646, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1644 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1645 e = e.__context__ -> 1646 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1648 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. Organize directory structure like in the docs: folder/metadata.jsonl folder/train.zip 2. Run load_dataset("imagefolder", data_dir='folder/metadata.jsonl', split='train') ### Expected behavior Dataset generated with all additional features from metadata.jsonl ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.9.0 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
32
One or several metadata.jsonl were found, but not in the same directory or in a parent directory ### Describe the bug An attempt to generate a dataset from a zip archive using imagefolder and metadata.jsonl does not lead to the expected result. Tried all possible locations of the json file: the file in the archive is ignored (generated dataset contains only images), the file next to the archive like [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder) leads to an error: ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1610, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1609 _time = time.time() -> 1610 for key, record in generator: 1611 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\packaged_modules\folder_based_builder\folder_based_builder.py:370, in FolderBasedBuilder._generate_examples(self, files, metadata_files, split_name, add_metadata, add_labels) 369 else: --> 370 raise ValueError( 371 f"One or several metadata.{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_dir_file}." 372 ) 373 if metadata_dir is not None and downloaded_metadata_file is not None: ValueError: One or several metadata.jsonl were found, but not in the same directory or in a parent directory of C:\Users\User\.cache\huggingface\datasets\downloads\extracted\f7fb7de25fb28ae63089974524f2d271a39d83888bc456d04aa3b3d45f33e6a6\ff0745a0-a741-4d9e-b228-a93b851adf61.png. The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[3], line 1 ----> 1 dataset = load_dataset("imagefolder", data_dir=r'C:\Users\User\data') File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:986, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 982 split_dict.add(split_generator.split_info) 984 try: 985 # Prepare split will record examples associated to the split --> 986 self._prepare_split(split_generator, **prepare_split_kwargs) 987 except OSError as e: 988 raise OSError( 989 "Cannot find data file. " 990 + (self.manual_download_instructions or "") 991 + "\nOriginal error:\n" 992 + str(e) 993 ) from None File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1490, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1488 gen_kwargs = split_generator.gen_kwargs 1489 job_id = 0 -> 1490 for job_id, done, content in self._prepare_split_single( 1491 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1492 ): 1493 if done: 1494 result = content File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1646, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1644 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1645 e = e.__context__ -> 1646 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1648 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. Organize directory structure like in the docs: folder/metadata.jsonl folder/train.zip 2. Run load_dataset("imagefolder", data_dir='folder/metadata.jsonl', split='train') ### Expected behavior Dataset generated with all additional features from metadata.jsonl ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.9.0 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Thanks for reporting, @blghtr. You should include the `metadata.jsonl` in your ZIP archives, at the root level directory. I agree that our documentation is not clear enough. Maybe we could improve it.
[ 0.0063481926918029785, 0.02177014946937561, 0.003071814775466919, 0.7927377223968506, -0.006188119761645794, 0.07700850069522858, 0.1289169043302536, 0.2964591383934021, -0.017772063612937927, 0.11702190339565277, 0.18320302665233612, 0.5142329335212708, -0.2491484135389328, -0.1386450231075287, -0.13588514924049377, -0.01331041194498539, -0.03958188369870186, 0.12554931640625, -0.03939973935484886, -0.09937824308872223, -0.35316404700279236, 0.3889520466327667, -0.0034385472536087036, 0.1204652488231659, -0.19736619293689728, 0.10910053551197052, -0.1617966741323471, 0.3033216595649719, -0.27330124378204346, -0.14250731468200684, 0.09193398803472519, -0.3360828757286072, -0.10950221121311188, 0.5043619871139526, -0.00012051993689965457, 0.04574961215257645, 0.3041227161884308, -0.1610632985830307, -0.16406860947608948, -0.6293297410011292, -0.21359196305274963, -0.005867183208465576, -0.2684696316719055, -0.19454467296600342, 0.16625726222991943, -0.5425432324409485, -0.012313513085246086, -0.2846081852912903, 0.16818195581436157, 0.2027275562286377, 0.12764805555343628, 0.21726492047309875, 0.25396937131881714, 0.11852286756038666, 0.47938311100006104, 0.682862401008606, -0.13635802268981934, 0.24672868847846985, -0.0842692032456398, -0.0689232125878334, 0.2722395956516266, 0.3036767840385437, 0.04436594992876053, 0.12411926686763763, 0.36164355278015137, 0.3573027551174164, -0.18178443610668182, -0.34912967681884766, 0.0635710209608078, -0.08642454445362091, 0.3452334403991699, -0.22846099734306335, -0.45490580797195435, -0.24875211715698242, -0.12431071698665619, -0.12564487755298615, 0.4691064655780792, 0.4723125100135803, -0.34521982073783875, -0.11890951544046402, -0.11759807169437408, -0.02443213015794754, -0.15012890100479126, 0.06696484982967377, 0.10943005979061127, 0.4077642560005188, -0.046637944877147675, 0.1325780600309372, 0.19224326312541962, 0.010897798463702202, 0.08634033054113388, -0.2993601858615875, 0.024763159453868866, 0.16239497065544128, 0.06929060816764832, 0.04550828039646149, -0.102961465716362, -0.39272281527519226, 0.35954561829566956, 0.16377633810043335, -0.04526793956756592, -0.5509966611862183, -0.35552072525024414, 0.2650933265686035, 0.17241990566253662, -0.03095616027712822, 0.23322688043117523, 0.32646360993385315, 0.21452131867408752, 0.23374152183532715, 0.06520828604698181, -0.053093165159225464, -0.08915357291698456, 0.08832608908414841, 0.09476040303707123, 0.0418134368956089, 0.17370513081550598, 0.10835520178079605, -0.12111402302980423, -0.1668524295091629, -0.5645041465759277, -0.3507847189903259, -0.01651466265320778, 0.041411906480789185, 0.22566330432891846, 0.03281208127737045, 0.20377717912197113, 0.17792923748493195, 0.20593935251235962, -0.00321970134973526, -0.048427075147628784, 0.499411404132843, -0.3169100284576416, 0.026101544499397278, 0.1652863323688507, -0.14703041315078735, 0.2973712384700775, 0.20149670541286469, -0.2543688118457794, -0.5044569373130798, 0.26210153102874756, -0.15584126114845276, 0.027316179126501083, 0.4120847284793854, -0.07392680644989014, 0.35801008343696594, 0.0687149167060852, 0.061911821365356445, -0.1807682365179062, 0.10170002281665802, -0.3386695981025696, -0.04069364815950394, 0.22544169425964355, 0.07324809581041336, -0.05961667001247406, 0.2072901874780655, -0.3666037619113922, -0.11876355111598969, 0.2440773844718933, -0.08500389009714127, 0.0712820291519165, 0.13347065448760986, -0.23953662812709808, -0.33322811126708984, 0.025197505950927734, 0.38380295038223267, -0.422410249710083, -0.06440024077892303, -0.14434604346752167, 0.08409164845943451, -0.10813581198453903, 0.34894201159477234, -0.11541782319545746, 0.5877711772918701, -0.5966395139694214, 0.11098144948482513, 0.1637117862701416, -0.5697267055511475, -0.11428350955247879, 0.2715925872325897, -0.10479867458343506, 0.050386056303977966, 0.3101368844509125, -0.09256987273693085, -0.068303182721138, -0.07102268934249878, 0.020758643746376038, 0.13794314861297607, -0.06333586573600769, 0.2459149956703186, -0.016561344265937805, -0.28004807233810425, -0.05707668140530586, 0.00463162362575531, -0.10270336270332336, 0.09481260925531387, -0.1396578699350357, -0.16715168952941895, 0.10970936715602875, -0.22053329646587372, 0.27871546149253845, 0.1981348991394043, 0.06116199493408203, -0.11002548038959503, 0.035572297871112823, 0.10991556197404861, -0.48878300189971924, 0.1365121603012085, -0.17200398445129395, 0.017801601439714432, -0.5790894031524658, 0.13173356652259827, -0.09802251309156418, 0.0010255500674247742, -0.1886720210313797, -0.3610728085041046, 0.0643383115530014, 0.4189755916595459, 0.1557662934064865, -0.13824471831321716, -0.23330888152122498, 0.30429062247276306, 0.5230602025985718, 0.2863329350948334, -0.6189788579940796, 0.49011969566345215, 0.014014603570103645, -0.18754401803016663, 0.16184638440608978, -0.0135783851146698, 0.13837362825870514, -0.18786367774009705, -0.017845524474978447, 0.23228538036346436, -0.09058450162410736, 0.07040806114673615, 0.08722831308841705, 0.03726746141910553, 0.2759511172771454, -0.25924012064933777, 0.20440351963043213, 0.014452729374170303, 0.22708959877490997, -0.11641934514045715, -0.29075056314468384, 0.24856901168823242, 0.003093746490776539, 0.3838220238685608, 0.05941396951675415, -0.06536700576543808, 0.026990480720996857, -0.08726949989795685, 0.04411613196134567, -0.16631893813610077, 0.04262002184987068, 0.2825758159160614, 0.35286879539489746, 0.12697988748550415, -0.026407986879348755, 0.14082995057106018, 0.22063808143138885, -0.023985296487808228, 0.020100394263863564, 0.24845966696739197, -0.05082474276423454, -0.01581496372818947, -0.20781265199184418, 0.43183791637420654, 0.7347219586372375, 0.09864592552185059, -0.09384441375732422, -0.022369254380464554, -0.0797848328948021, -0.199870303273201, 0.012201085686683655, -0.12039431929588318, 0.21967124938964844, 0.43888646364212036, 0.4112567603588104, 0.04355015605688095, -0.3317560851573944, -0.26202791929244995, 0.06792336702346802, 0.2623186707496643, -0.20507344603538513, 0.1655057668685913, -0.18598419427871704, -0.2137005627155304, -0.22829914093017578, 0.020997658371925354, -0.3105793297290802, -0.15092912316322327, 0.046426285058259964, 0.3714298903942108, -0.1225496381521225, -0.07797244936227798, 0.4864307641983032, 0.27109140157699585, -0.05978115275502205, 0.21295151114463806, -0.4728010594844818, 0.19350478053092957, -0.021789586171507835, -0.10572108626365662, 0.16831502318382263, 0.012136708945035934, 0.291288286447525, -0.23440833389759064, -0.05615142360329628, -0.704291045665741, -0.09118051826953888, 0.27729734778404236, -0.228866845369339, 0.38128936290740967, 0.32257241010665894, 0.16875021159648895, 0.21732549369335175, -0.36073341965675354, 0.34945815801620483, 0.02030293643474579, -0.3867769241333008, 0.007349349558353424, 0.01665758714079857, 0.3279305696487427, -0.186501145362854, -0.2591513395309448, -0.19895461201667786, -0.20659352838993073, 0.2856539785861969, -0.049346763640642166, 0.3629894256591797, 0.16825516521930695, -0.06614237278699875, -0.15157698094844818, -0.33693063259124756, -0.013795537874102592, -0.0787799060344696, -0.40098148584365845, 0.2403181493282318, -0.15233337879180908, -0.19274815917015076, -0.07807725667953491, -0.005974791944026947, 0.31780362129211426, 0.07745258510112762, -0.3587656617164612, -0.43909043073654175, -0.15463146567344666, 0.12182533740997314, -0.2506832480430603, 0.11179018020629883, 0.2168813943862915, 0.06813278794288635, 0.040874183177948, -0.31557562947273254, -0.29535341262817383, 0.42268985509872437, -0.26390671730041504, 0.3793560862541199, 0.09732113778591156, 0.44844475388526917, 0.029961176216602325, 0.24656741321086884, 0.4406834840774536, 0.08653133362531662, 0.26037412881851196, -0.08443950861692429, 0.280328631401062, 0.031925272196531296, -0.13594312965869904, -0.13229644298553467, 0.24187055230140686, 0.044293083250522614, 0.027590163052082062, 0.2651752233505249, 0.13586729764938354, -0.0979016125202179, 0.16599318385124207, -0.707011342048645, -0.1114124283194542, -0.06375975161790848, 0.23544389009475708, 0.10339903831481934, -0.056508101522922516, -0.183355450630188, -0.08876947313547134, 0.14366115629673004, 0.09372507780790329, 0.32272109389305115, 0.4272565543651581, 0.1322869509458542, -0.2383778840303421, -0.14811989665031433, 0.019590934738516808, -0.07187367230653763, 0.05206472426652908, 0.3036603331565857, -0.0871819481253624, 0.23786944150924683, 0.02267315797507763, -0.15649566054344177, 0.884688675403595, -0.2778422236442566, 0.29384845495224, -0.06186529994010925, -0.07218503206968307, -0.255179226398468, -0.10016612708568573, -0.12899993360042572, 0.030948158353567123, 0.018444642424583435, 0.7103434801101685, -0.4551065266132355, -0.0039563290774822235, 0.1627732217311859, 0.07464974373579025, 0.032439738512039185, -0.42421266436576843, -0.10311813652515411, -0.44539910554885864, -0.27308017015457153, -0.31391456723213196, -0.015051394701004028, -0.010533809661865234, 0.20344913005828857, -0.11001960933208466, 0.4003761410713196, -0.23051607608795166, -0.15216600894927979, -0.09788130223751068, 0.25613152980804443, -0.2895672917366028, 0.2973213493824005, 0.3122568726539612, 0.07900702208280563, 0.4104315936565399, 0.5018766522407532, 0.08124663680791855, -0.3020859956741333, 0.07393702119588852, -0.1814080774784088, 0.13273122906684875, 0.28304213285446167, -0.2245662659406662, 0.05657512694597244, -0.48848915100097656, 0.14236479997634888, -0.06288602203130722, -0.2600228488445282, 0.5327097177505493, -0.18384210765361786, -0.015103098005056381, -0.1905989646911621, 0.584690272808075, 0.49753129482269287, -0.08090552687644958, 0.3088650107383728, -0.20604220032691956, -0.35293418169021606, 0.03319516405463219, -0.15322254598140717, 0.7654201984405518, 0.0859539657831192, 0.10582001507282257, 0.3549892008304596, -0.38037848472595215, 0.5547235608100891, -0.24114510416984558, 0.08340327441692352, -0.5133206844329834, -0.05617374926805496, -0.05524662509560585, -0.21922117471694946, -0.029660392552614212, 0.25769662857055664, -0.07016601413488388, 0.1639459729194641, -0.2561096251010895, -0.0389581061899662, -0.03646048158407211, 0.22234909236431122, -0.2767738401889801, -0.2676197290420532, -0.40126168727874756, 0.05733451247215271, -0.09847144782543182, 0.45560455322265625, -0.012747779488563538, -0.1611749529838562, -0.44605833292007446, -0.4456159472465515, -0.47247856855392456, 0.211029052734375, 0.009387645870447159, 0.09101678431034088, 0.44755738973617554, 0.010716944932937622, -0.1989128738641739, -0.18814150989055634, 0.33217570185661316, -0.04906037449836731, -0.12216212600469589, -0.0174807608127594, -0.18157730996608734, 0.21573057770729065, -0.028537916019558907, -0.12460820376873016, 0.0556722953915596, -0.06963665038347244, 0.06083753705024719, -0.06334257870912552, -0.2700497508049011, -0.11737968027591705, -0.14225122332572937, -0.05914171412587166, -0.3785133361816406, 0.05012163892388344, 0.09169512987136841, -0.04477372765541077, -0.1385512351989746, -0.19351567327976227, 0.02173326350748539, 0.2810436487197876, -0.01274586096405983, 0.040906649082899094, -0.224493145942688, -0.22458402812480927, -0.0401519276201725, 0.28213635087013245, -0.030283518135547638, 0.16154751181602478, 0.19174577295780182, 0.13336509466171265, -0.022221405059099197, -0.1947489082813263, 0.4005681276321411, 0.18283088505268097, -0.5591082572937012, 0.33425456285476685, -0.0447152778506279, 0.10800322890281677, 0.13954493403434753, 0.15013255178928375, 0.3431713879108429, 0.14644761383533478, -0.060349833220243454, -0.5759138464927673, 0.013690166175365448, 0.3971789479255676, -0.14270000159740448, -0.03575825318694115, -0.2718350887298584, 0.05820653960108757, 0.15647092461585999, -0.031510595232248306, -0.1922062635421753, 0.06760796904563904, -0.11583748459815979, 0.004165826365351677, 0.33518677949905396, 0.09839391708374023, 0.13004329800605774, 0.07097882032394409, 0.05759323760867119, 0.10973416268825531, -0.15746837854385376, -0.0066766515374183655, -0.21024900674819946, 0.15711793303489685, 0.1287989616394043, 0.07777969539165497, 0.06631915271282196, -0.0995204970240593, -0.18466708064079285, -0.0483691580593586, 0.05104245990514755, -0.029542189091444016, -0.15284422039985657, 0.013578303158283234, 0.08980681747198105, -0.06983740627765656, -0.05045204609632492, 0.21555954217910767, -0.2046523243188858, 0.07579278200864792, 0.11569935083389282, 0.13352715969085693, -0.17889584600925446, -0.09633030742406845, -0.35430994629859924, 0.06452023983001709, -0.48767200112342834, 0.4438767731189728, 0.4391288757324219, -0.30271628499031067, 0.22501729428768158, 0.01837078109383583, 0.3165439963340759, 0.22211509943008423, -0.20675167441368103, 0.1865551620721817, -0.17232555150985718, 0.06395810842514038, -0.11339356750249863, -0.23539267480373383, -0.18499985337257385, 0.10824225097894669, -0.013083204627037048, 0.33442357182502747, -0.14929695427417755, 0.06247831881046295, -0.1518903374671936, -0.028623059391975403, 0.7114486694335938, 0.04636932909488678, -0.08694806694984436, 0.37142476439476013, -0.23332102596759796, 0.2610792815685272, 0.3320049047470093, -0.020271465182304382, 0.1345658004283905, 0.11299765855073929, 0.10535390675067902, 0.1737043857574463, -0.028451932594180107, -0.052512090653181076, 0.20156827569007874, -0.16615372896194458, -0.18621307611465454, 0.16636346280574799, 0.426251083612442, -0.14715714752674103, -0.06799262017011642, 0.3503462076187134, -0.2841655910015106, 0.07194297760725021, -0.03068733587861061, 0.48671451210975647, 0.14858441054821014, 0.0032209642231464386, -0.26431405544281006, -0.3316251039505005, -0.22071179747581482, 0.005415298044681549, -0.041443876922130585, -0.11157308518886566, 0.21362480521202087, 0.08123345673084259, -0.21469733119010925, -0.3348677158355713, -0.10112009197473526, 0.16710221767425537, 0.10011250525712967, -0.38661858439445496, 0.5862846374511719, 0.175573468208313, -0.16136199235916138, -0.009695608168840408, 0.455541729927063, 0.34691935777664185, 0.4676036536693573, 0.463888019323349, 0.0018798448145389557, -0.5670835375785828, -0.03390025720000267, -0.04792998731136322, 0.2016654908657074, -0.020857464522123337, -0.2787655293941498, 0.09808075428009033, 0.09526288509368896, -0.08546709269285202, 0.11139455437660217, 0.16308671236038208, 0.2394026517868042, -0.09894435852766037, 0.17537552118301392, -0.3129082918167114, -0.05256815627217293, 0.08855431526899338, -0.11942458152770996, -0.38307783007621765, -0.4066010117530823, 0.2089734673500061, 0.2118961364030838, 0.14487576484680176, 0.07833027094602585, 0.029190313071012497, 0.0037170015275478363, 0.18974749743938446, 0.45659375190734863, -0.16852200031280518, -0.1103019192814827, -0.21120858192443848, -0.48055028915405273, -0.057488638907670975, -0.2827964425086975, -0.27420544624328613, -0.20567095279693604, 0.048338741064071655, 0.09117422997951508, 0.013456737622618675, 0.4262996017932892, 0.46594077348709106, -0.038805752992630005, 0.18519574403762817, -0.4275650382041931, -0.3275832235813141, 0.43692994117736816, 0.14356137812137604, -0.016422808170318604, -0.14449308812618256, 0.30323654413223267, 0.0005580224096775055, 0.04415823519229889, -0.05543194338679314, 0.02336832880973816, -0.08997044712305069, -0.11528468877077103, 0.34665557742118835, 0.19902631640434265, 0.24183878302574158, -0.12449542433023453, -0.4139781892299652, -0.2597575783729553, 0.02103530243039131, -0.1422395408153534, 0.19953615963459015, 0.2280137985944748, 0.680396556854248, -0.1672435700893402, 0.11804526299238205, -0.5902280211448669, -0.09887811541557312, -0.2575806975364685, -0.003892291337251663, -0.37666982412338257, 0.41844892501831055, -0.12652432918548584, -0.09487517178058624, 0.021858640015125275, 0.006906558759510517, -0.0548851378262043, 0.07078658789396286, -0.4257494807243347, -0.3221747875213623, 0.4803650975227356, -0.1680324822664261, -0.2961729168891907, 0.25463593006134033, 0.15672999620437622, -0.2551995515823364, -0.10899832099676132, -0.13637831807136536, -0.01780940592288971, 0.34383395314216614, 0.000021146610379219055, -0.26223328709602356, -0.2340150773525238, 0.012283381074666977, -0.14722281694412231, 0.14647872745990753, 0.08880861103534698, 0.2097969949245453, -0.28176945447921753, 0.4590199291706085, 0.028700269758701324 ]
https://github.com/huggingface/datasets/issues/5761
You can find a dummy dataset example here: https://huggingface.co/datasets/albertvillanova/tmp-imagefolder-metadata ``` tmp-imagefolder-metadata/ └── data/ ├── train.zip └── valid.zip ``` where, the directory structure within the `train.zip` archive is: ``` metadata.jsonl train/ ├── bharatanatyam/ └── bharatanatyam_original_113.jpg_70c297a2-e2f2-4ed8-b93c-0c03d0809fe2.jpg └── kathak/ └── kathak_original_10.jpg_2c4a2c3d-47fc-4b33-9c09-38b542826632.jpg ``` and the metadata file contains: ``` {"file_name": "train/bharatanatyam/bharatanatyam_original_113.jpg_70c297a2-e2f2-4ed8-b93c-0c03d0809fe2.jpg", "text": "first"} {"file_name": "train/kathak/kathak_original_10.jpg_2c4a2c3d-47fc-4b33-9c09-38b542826632.jpg", "text": "second"} ```
One or several metadata.jsonl were found, but not in the same directory or in a parent directory
### Describe the bug An attempt to generate a dataset from a zip archive using imagefolder and metadata.jsonl does not lead to the expected result. Tried all possible locations of the json file: the file in the archive is ignored (generated dataset contains only images), the file next to the archive like [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder) leads to an error: ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1610, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1609 _time = time.time() -> 1610 for key, record in generator: 1611 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\packaged_modules\folder_based_builder\folder_based_builder.py:370, in FolderBasedBuilder._generate_examples(self, files, metadata_files, split_name, add_metadata, add_labels) 369 else: --> 370 raise ValueError( 371 f"One or several metadata.{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_dir_file}." 372 ) 373 if metadata_dir is not None and downloaded_metadata_file is not None: ValueError: One or several metadata.jsonl were found, but not in the same directory or in a parent directory of C:\Users\User\.cache\huggingface\datasets\downloads\extracted\f7fb7de25fb28ae63089974524f2d271a39d83888bc456d04aa3b3d45f33e6a6\ff0745a0-a741-4d9e-b228-a93b851adf61.png. The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[3], line 1 ----> 1 dataset = load_dataset("imagefolder", data_dir=r'C:\Users\User\data') File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:986, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 982 split_dict.add(split_generator.split_info) 984 try: 985 # Prepare split will record examples associated to the split --> 986 self._prepare_split(split_generator, **prepare_split_kwargs) 987 except OSError as e: 988 raise OSError( 989 "Cannot find data file. " 990 + (self.manual_download_instructions or "") 991 + "\nOriginal error:\n" 992 + str(e) 993 ) from None File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1490, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1488 gen_kwargs = split_generator.gen_kwargs 1489 job_id = 0 -> 1490 for job_id, done, content in self._prepare_split_single( 1491 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1492 ): 1493 if done: 1494 result = content File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1646, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1644 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1645 e = e.__context__ -> 1646 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1648 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. Organize directory structure like in the docs: folder/metadata.jsonl folder/train.zip 2. Run load_dataset("imagefolder", data_dir='folder/metadata.jsonl', split='train') ### Expected behavior Dataset generated with all additional features from metadata.jsonl ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.9.0 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
54
One or several metadata.jsonl were found, but not in the same directory or in a parent directory ### Describe the bug An attempt to generate a dataset from a zip archive using imagefolder and metadata.jsonl does not lead to the expected result. Tried all possible locations of the json file: the file in the archive is ignored (generated dataset contains only images), the file next to the archive like [here](https://huggingface.co/docs/datasets/image_dataset#imagefolder) leads to an error: ``` --------------------------------------------------------------------------- ValueError Traceback (most recent call last) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1610, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1609 _time = time.time() -> 1610 for key, record in generator: 1611 if max_shard_size is not None and writer._num_bytes > max_shard_size: File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\packaged_modules\folder_based_builder\folder_based_builder.py:370, in FolderBasedBuilder._generate_examples(self, files, metadata_files, split_name, add_metadata, add_labels) 369 else: --> 370 raise ValueError( 371 f"One or several metadata.{metadata_ext} were found, but not in the same directory or in a parent directory of {downloaded_dir_file}." 372 ) 373 if metadata_dir is not None and downloaded_metadata_file is not None: ValueError: One or several metadata.jsonl were found, but not in the same directory or in a parent directory of C:\Users\User\.cache\huggingface\datasets\downloads\extracted\f7fb7de25fb28ae63089974524f2d271a39d83888bc456d04aa3b3d45f33e6a6\ff0745a0-a741-4d9e-b228-a93b851adf61.png. The above exception was the direct cause of the following exception: DatasetGenerationError Traceback (most recent call last) Cell In[3], line 1 ----> 1 dataset = load_dataset("imagefolder", data_dir=r'C:\Users\User\data') File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:986, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 982 split_dict.add(split_generator.split_info) 984 try: 985 # Prepare split will record examples associated to the split --> 986 self._prepare_split(split_generator, **prepare_split_kwargs) 987 except OSError as e: 988 raise OSError( 989 "Cannot find data file. " 990 + (self.manual_download_instructions or "") 991 + "\nOriginal error:\n" 992 + str(e) 993 ) from None File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1490, in GeneratorBasedBuilder._prepare_split(self, split_generator, check_duplicate_keys, file_format, num_proc, max_shard_size) 1488 gen_kwargs = split_generator.gen_kwargs 1489 job_id = 0 -> 1490 for job_id, done, content in self._prepare_split_single( 1491 gen_kwargs=gen_kwargs, job_id=job_id, **_prepare_split_args 1492 ): 1493 if done: 1494 result = content File ~\PycharmProjects\testproj\venv\lib\site-packages\datasets\builder.py:1646, in GeneratorBasedBuilder._prepare_split_single(self, gen_kwargs, fpath, file_format, max_shard_size, split_info, check_duplicate_keys, job_id) 1644 if isinstance(e, SchemaInferenceError) and e.__context__ is not None: 1645 e = e.__context__ -> 1646 raise DatasetGenerationError("An error occurred while generating the dataset") from e 1648 yield job_id, True, (total_num_examples, total_num_bytes, writer._features, num_shards, shard_lengths) DatasetGenerationError: An error occurred while generating the dataset ``` ### Steps to reproduce the bug 1. Organize directory structure like in the docs: folder/metadata.jsonl folder/train.zip 2. Run load_dataset("imagefolder", data_dir='folder/metadata.jsonl', split='train') ### Expected behavior Dataset generated with all additional features from metadata.jsonl ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.22621-SP0 - Python version: 3.9.0 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 You can find a dummy dataset example here: https://huggingface.co/datasets/albertvillanova/tmp-imagefolder-metadata ``` tmp-imagefolder-metadata/ └── data/ ├── train.zip └── valid.zip ``` where, the directory structure within the `train.zip` archive is: ``` metadata.jsonl train/ ├── bharatanatyam/ └── bharatanatyam_original_113.jpg_70c297a2-e2f2-4ed8-b93c-0c03d0809fe2.jpg └── kathak/ └── kathak_original_10.jpg_2c4a2c3d-47fc-4b33-9c09-38b542826632.jpg ``` and the metadata file contains: ``` {"file_name": "train/bharatanatyam/bharatanatyam_original_113.jpg_70c297a2-e2f2-4ed8-b93c-0c03d0809fe2.jpg", "text": "first"} {"file_name": "train/kathak/kathak_original_10.jpg_2c4a2c3d-47fc-4b33-9c09-38b542826632.jpg", "text": "second"} ```
[ 0.0063481926918029785, 0.02177014946937561, 0.003071814775466919, 0.7927377223968506, -0.006188119761645794, 0.07700850069522858, 0.1289169043302536, 0.2964591383934021, -0.017772063612937927, 0.11702190339565277, 0.18320302665233612, 0.5142329335212708, -0.2491484135389328, -0.1386450231075287, -0.13588514924049377, -0.01331041194498539, -0.03958188369870186, 0.12554931640625, -0.03939973935484886, -0.09937824308872223, -0.35316404700279236, 0.3889520466327667, -0.0034385472536087036, 0.1204652488231659, -0.19736619293689728, 0.10910053551197052, -0.1617966741323471, 0.3033216595649719, -0.27330124378204346, -0.14250731468200684, 0.09193398803472519, -0.3360828757286072, -0.10950221121311188, 0.5043619871139526, -0.00012051993689965457, 0.04574961215257645, 0.3041227161884308, -0.1610632985830307, -0.16406860947608948, -0.6293297410011292, -0.21359196305274963, -0.005867183208465576, -0.2684696316719055, -0.19454467296600342, 0.16625726222991943, -0.5425432324409485, -0.012313513085246086, -0.2846081852912903, 0.16818195581436157, 0.2027275562286377, 0.12764805555343628, 0.21726492047309875, 0.25396937131881714, 0.11852286756038666, 0.47938311100006104, 0.682862401008606, -0.13635802268981934, 0.24672868847846985, -0.0842692032456398, -0.0689232125878334, 0.2722395956516266, 0.3036767840385437, 0.04436594992876053, 0.12411926686763763, 0.36164355278015137, 0.3573027551174164, -0.18178443610668182, -0.34912967681884766, 0.0635710209608078, -0.08642454445362091, 0.3452334403991699, -0.22846099734306335, -0.45490580797195435, -0.24875211715698242, -0.12431071698665619, -0.12564487755298615, 0.4691064655780792, 0.4723125100135803, -0.34521982073783875, -0.11890951544046402, -0.11759807169437408, -0.02443213015794754, -0.15012890100479126, 0.06696484982967377, 0.10943005979061127, 0.4077642560005188, -0.046637944877147675, 0.1325780600309372, 0.19224326312541962, 0.010897798463702202, 0.08634033054113388, -0.2993601858615875, 0.024763159453868866, 0.16239497065544128, 0.06929060816764832, 0.04550828039646149, -0.102961465716362, -0.39272281527519226, 0.35954561829566956, 0.16377633810043335, -0.04526793956756592, -0.5509966611862183, -0.35552072525024414, 0.2650933265686035, 0.17241990566253662, -0.03095616027712822, 0.23322688043117523, 0.32646360993385315, 0.21452131867408752, 0.23374152183532715, 0.06520828604698181, -0.053093165159225464, -0.08915357291698456, 0.08832608908414841, 0.09476040303707123, 0.0418134368956089, 0.17370513081550598, 0.10835520178079605, -0.12111402302980423, -0.1668524295091629, -0.5645041465759277, -0.3507847189903259, -0.01651466265320778, 0.041411906480789185, 0.22566330432891846, 0.03281208127737045, 0.20377717912197113, 0.17792923748493195, 0.20593935251235962, -0.00321970134973526, -0.048427075147628784, 0.499411404132843, -0.3169100284576416, 0.026101544499397278, 0.1652863323688507, -0.14703041315078735, 0.2973712384700775, 0.20149670541286469, -0.2543688118457794, -0.5044569373130798, 0.26210153102874756, -0.15584126114845276, 0.027316179126501083, 0.4120847284793854, -0.07392680644989014, 0.35801008343696594, 0.0687149167060852, 0.061911821365356445, -0.1807682365179062, 0.10170002281665802, -0.3386695981025696, -0.04069364815950394, 0.22544169425964355, 0.07324809581041336, -0.05961667001247406, 0.2072901874780655, -0.3666037619113922, -0.11876355111598969, 0.2440773844718933, -0.08500389009714127, 0.0712820291519165, 0.13347065448760986, -0.23953662812709808, -0.33322811126708984, 0.025197505950927734, 0.38380295038223267, -0.422410249710083, -0.06440024077892303, -0.14434604346752167, 0.08409164845943451, -0.10813581198453903, 0.34894201159477234, -0.11541782319545746, 0.5877711772918701, -0.5966395139694214, 0.11098144948482513, 0.1637117862701416, -0.5697267055511475, -0.11428350955247879, 0.2715925872325897, -0.10479867458343506, 0.050386056303977966, 0.3101368844509125, -0.09256987273693085, -0.068303182721138, -0.07102268934249878, 0.020758643746376038, 0.13794314861297607, -0.06333586573600769, 0.2459149956703186, -0.016561344265937805, -0.28004807233810425, -0.05707668140530586, 0.00463162362575531, -0.10270336270332336, 0.09481260925531387, -0.1396578699350357, -0.16715168952941895, 0.10970936715602875, -0.22053329646587372, 0.27871546149253845, 0.1981348991394043, 0.06116199493408203, -0.11002548038959503, 0.035572297871112823, 0.10991556197404861, -0.48878300189971924, 0.1365121603012085, -0.17200398445129395, 0.017801601439714432, -0.5790894031524658, 0.13173356652259827, -0.09802251309156418, 0.0010255500674247742, -0.1886720210313797, -0.3610728085041046, 0.0643383115530014, 0.4189755916595459, 0.1557662934064865, -0.13824471831321716, -0.23330888152122498, 0.30429062247276306, 0.5230602025985718, 0.2863329350948334, -0.6189788579940796, 0.49011969566345215, 0.014014603570103645, -0.18754401803016663, 0.16184638440608978, -0.0135783851146698, 0.13837362825870514, -0.18786367774009705, -0.017845524474978447, 0.23228538036346436, -0.09058450162410736, 0.07040806114673615, 0.08722831308841705, 0.03726746141910553, 0.2759511172771454, -0.25924012064933777, 0.20440351963043213, 0.014452729374170303, 0.22708959877490997, -0.11641934514045715, -0.29075056314468384, 0.24856901168823242, 0.003093746490776539, 0.3838220238685608, 0.05941396951675415, -0.06536700576543808, 0.026990480720996857, -0.08726949989795685, 0.04411613196134567, -0.16631893813610077, 0.04262002184987068, 0.2825758159160614, 0.35286879539489746, 0.12697988748550415, -0.026407986879348755, 0.14082995057106018, 0.22063808143138885, -0.023985296487808228, 0.020100394263863564, 0.24845966696739197, -0.05082474276423454, -0.01581496372818947, -0.20781265199184418, 0.43183791637420654, 0.7347219586372375, 0.09864592552185059, -0.09384441375732422, -0.022369254380464554, -0.0797848328948021, -0.199870303273201, 0.012201085686683655, -0.12039431929588318, 0.21967124938964844, 0.43888646364212036, 0.4112567603588104, 0.04355015605688095, -0.3317560851573944, -0.26202791929244995, 0.06792336702346802, 0.2623186707496643, -0.20507344603538513, 0.1655057668685913, -0.18598419427871704, -0.2137005627155304, -0.22829914093017578, 0.020997658371925354, -0.3105793297290802, -0.15092912316322327, 0.046426285058259964, 0.3714298903942108, -0.1225496381521225, -0.07797244936227798, 0.4864307641983032, 0.27109140157699585, -0.05978115275502205, 0.21295151114463806, -0.4728010594844818, 0.19350478053092957, -0.021789586171507835, -0.10572108626365662, 0.16831502318382263, 0.012136708945035934, 0.291288286447525, -0.23440833389759064, -0.05615142360329628, -0.704291045665741, -0.09118051826953888, 0.27729734778404236, -0.228866845369339, 0.38128936290740967, 0.32257241010665894, 0.16875021159648895, 0.21732549369335175, -0.36073341965675354, 0.34945815801620483, 0.02030293643474579, -0.3867769241333008, 0.007349349558353424, 0.01665758714079857, 0.3279305696487427, -0.186501145362854, -0.2591513395309448, -0.19895461201667786, -0.20659352838993073, 0.2856539785861969, -0.049346763640642166, 0.3629894256591797, 0.16825516521930695, -0.06614237278699875, -0.15157698094844818, -0.33693063259124756, -0.013795537874102592, -0.0787799060344696, -0.40098148584365845, 0.2403181493282318, -0.15233337879180908, -0.19274815917015076, -0.07807725667953491, -0.005974791944026947, 0.31780362129211426, 0.07745258510112762, -0.3587656617164612, -0.43909043073654175, -0.15463146567344666, 0.12182533740997314, -0.2506832480430603, 0.11179018020629883, 0.2168813943862915, 0.06813278794288635, 0.040874183177948, -0.31557562947273254, -0.29535341262817383, 0.42268985509872437, -0.26390671730041504, 0.3793560862541199, 0.09732113778591156, 0.44844475388526917, 0.029961176216602325, 0.24656741321086884, 0.4406834840774536, 0.08653133362531662, 0.26037412881851196, -0.08443950861692429, 0.280328631401062, 0.031925272196531296, -0.13594312965869904, -0.13229644298553467, 0.24187055230140686, 0.044293083250522614, 0.027590163052082062, 0.2651752233505249, 0.13586729764938354, -0.0979016125202179, 0.16599318385124207, -0.707011342048645, -0.1114124283194542, -0.06375975161790848, 0.23544389009475708, 0.10339903831481934, -0.056508101522922516, -0.183355450630188, -0.08876947313547134, 0.14366115629673004, 0.09372507780790329, 0.32272109389305115, 0.4272565543651581, 0.1322869509458542, -0.2383778840303421, -0.14811989665031433, 0.019590934738516808, -0.07187367230653763, 0.05206472426652908, 0.3036603331565857, -0.0871819481253624, 0.23786944150924683, 0.02267315797507763, -0.15649566054344177, 0.884688675403595, -0.2778422236442566, 0.29384845495224, -0.06186529994010925, -0.07218503206968307, -0.255179226398468, -0.10016612708568573, -0.12899993360042572, 0.030948158353567123, 0.018444642424583435, 0.7103434801101685, -0.4551065266132355, -0.0039563290774822235, 0.1627732217311859, 0.07464974373579025, 0.032439738512039185, -0.42421266436576843, -0.10311813652515411, -0.44539910554885864, -0.27308017015457153, -0.31391456723213196, -0.015051394701004028, -0.010533809661865234, 0.20344913005828857, -0.11001960933208466, 0.4003761410713196, -0.23051607608795166, -0.15216600894927979, -0.09788130223751068, 0.25613152980804443, -0.2895672917366028, 0.2973213493824005, 0.3122568726539612, 0.07900702208280563, 0.4104315936565399, 0.5018766522407532, 0.08124663680791855, -0.3020859956741333, 0.07393702119588852, -0.1814080774784088, 0.13273122906684875, 0.28304213285446167, -0.2245662659406662, 0.05657512694597244, -0.48848915100097656, 0.14236479997634888, -0.06288602203130722, -0.2600228488445282, 0.5327097177505493, -0.18384210765361786, -0.015103098005056381, -0.1905989646911621, 0.584690272808075, 0.49753129482269287, -0.08090552687644958, 0.3088650107383728, -0.20604220032691956, -0.35293418169021606, 0.03319516405463219, -0.15322254598140717, 0.7654201984405518, 0.0859539657831192, 0.10582001507282257, 0.3549892008304596, -0.38037848472595215, 0.5547235608100891, -0.24114510416984558, 0.08340327441692352, -0.5133206844329834, -0.05617374926805496, -0.05524662509560585, -0.21922117471694946, -0.029660392552614212, 0.25769662857055664, -0.07016601413488388, 0.1639459729194641, -0.2561096251010895, -0.0389581061899662, -0.03646048158407211, 0.22234909236431122, -0.2767738401889801, -0.2676197290420532, -0.40126168727874756, 0.05733451247215271, -0.09847144782543182, 0.45560455322265625, -0.012747779488563538, -0.1611749529838562, -0.44605833292007446, -0.4456159472465515, -0.47247856855392456, 0.211029052734375, 0.009387645870447159, 0.09101678431034088, 0.44755738973617554, 0.010716944932937622, -0.1989128738641739, -0.18814150989055634, 0.33217570185661316, -0.04906037449836731, -0.12216212600469589, -0.0174807608127594, -0.18157730996608734, 0.21573057770729065, -0.028537916019558907, -0.12460820376873016, 0.0556722953915596, -0.06963665038347244, 0.06083753705024719, -0.06334257870912552, -0.2700497508049011, -0.11737968027591705, -0.14225122332572937, -0.05914171412587166, -0.3785133361816406, 0.05012163892388344, 0.09169512987136841, -0.04477372765541077, -0.1385512351989746, -0.19351567327976227, 0.02173326350748539, 0.2810436487197876, -0.01274586096405983, 0.040906649082899094, -0.224493145942688, -0.22458402812480927, -0.0401519276201725, 0.28213635087013245, -0.030283518135547638, 0.16154751181602478, 0.19174577295780182, 0.13336509466171265, -0.022221405059099197, -0.1947489082813263, 0.4005681276321411, 0.18283088505268097, -0.5591082572937012, 0.33425456285476685, -0.0447152778506279, 0.10800322890281677, 0.13954493403434753, 0.15013255178928375, 0.3431713879108429, 0.14644761383533478, -0.060349833220243454, -0.5759138464927673, 0.013690166175365448, 0.3971789479255676, -0.14270000159740448, -0.03575825318694115, -0.2718350887298584, 0.05820653960108757, 0.15647092461585999, -0.031510595232248306, -0.1922062635421753, 0.06760796904563904, -0.11583748459815979, 0.004165826365351677, 0.33518677949905396, 0.09839391708374023, 0.13004329800605774, 0.07097882032394409, 0.05759323760867119, 0.10973416268825531, -0.15746837854385376, -0.0066766515374183655, -0.21024900674819946, 0.15711793303489685, 0.1287989616394043, 0.07777969539165497, 0.06631915271282196, -0.0995204970240593, -0.18466708064079285, -0.0483691580593586, 0.05104245990514755, -0.029542189091444016, -0.15284422039985657, 0.013578303158283234, 0.08980681747198105, -0.06983740627765656, -0.05045204609632492, 0.21555954217910767, -0.2046523243188858, 0.07579278200864792, 0.11569935083389282, 0.13352715969085693, -0.17889584600925446, -0.09633030742406845, -0.35430994629859924, 0.06452023983001709, -0.48767200112342834, 0.4438767731189728, 0.4391288757324219, -0.30271628499031067, 0.22501729428768158, 0.01837078109383583, 0.3165439963340759, 0.22211509943008423, -0.20675167441368103, 0.1865551620721817, -0.17232555150985718, 0.06395810842514038, -0.11339356750249863, -0.23539267480373383, -0.18499985337257385, 0.10824225097894669, -0.013083204627037048, 0.33442357182502747, -0.14929695427417755, 0.06247831881046295, -0.1518903374671936, -0.028623059391975403, 0.7114486694335938, 0.04636932909488678, -0.08694806694984436, 0.37142476439476013, -0.23332102596759796, 0.2610792815685272, 0.3320049047470093, -0.020271465182304382, 0.1345658004283905, 0.11299765855073929, 0.10535390675067902, 0.1737043857574463, -0.028451932594180107, -0.052512090653181076, 0.20156827569007874, -0.16615372896194458, -0.18621307611465454, 0.16636346280574799, 0.426251083612442, -0.14715714752674103, -0.06799262017011642, 0.3503462076187134, -0.2841655910015106, 0.07194297760725021, -0.03068733587861061, 0.48671451210975647, 0.14858441054821014, 0.0032209642231464386, -0.26431405544281006, -0.3316251039505005, -0.22071179747581482, 0.005415298044681549, -0.041443876922130585, -0.11157308518886566, 0.21362480521202087, 0.08123345673084259, -0.21469733119010925, -0.3348677158355713, -0.10112009197473526, 0.16710221767425537, 0.10011250525712967, -0.38661858439445496, 0.5862846374511719, 0.175573468208313, -0.16136199235916138, -0.009695608168840408, 0.455541729927063, 0.34691935777664185, 0.4676036536693573, 0.463888019323349, 0.0018798448145389557, -0.5670835375785828, -0.03390025720000267, -0.04792998731136322, 0.2016654908657074, -0.020857464522123337, -0.2787655293941498, 0.09808075428009033, 0.09526288509368896, -0.08546709269285202, 0.11139455437660217, 0.16308671236038208, 0.2394026517868042, -0.09894435852766037, 0.17537552118301392, -0.3129082918167114, -0.05256815627217293, 0.08855431526899338, -0.11942458152770996, -0.38307783007621765, -0.4066010117530823, 0.2089734673500061, 0.2118961364030838, 0.14487576484680176, 0.07833027094602585, 0.029190313071012497, 0.0037170015275478363, 0.18974749743938446, 0.45659375190734863, -0.16852200031280518, -0.1103019192814827, -0.21120858192443848, -0.48055028915405273, -0.057488638907670975, -0.2827964425086975, -0.27420544624328613, -0.20567095279693604, 0.048338741064071655, 0.09117422997951508, 0.013456737622618675, 0.4262996017932892, 0.46594077348709106, -0.038805752992630005, 0.18519574403762817, -0.4275650382041931, -0.3275832235813141, 0.43692994117736816, 0.14356137812137604, -0.016422808170318604, -0.14449308812618256, 0.30323654413223267, 0.0005580224096775055, 0.04415823519229889, -0.05543194338679314, 0.02336832880973816, -0.08997044712305069, -0.11528468877077103, 0.34665557742118835, 0.19902631640434265, 0.24183878302574158, -0.12449542433023453, -0.4139781892299652, -0.2597575783729553, 0.02103530243039131, -0.1422395408153534, 0.19953615963459015, 0.2280137985944748, 0.680396556854248, -0.1672435700893402, 0.11804526299238205, -0.5902280211448669, -0.09887811541557312, -0.2575806975364685, -0.003892291337251663, -0.37666982412338257, 0.41844892501831055, -0.12652432918548584, -0.09487517178058624, 0.021858640015125275, 0.006906558759510517, -0.0548851378262043, 0.07078658789396286, -0.4257494807243347, -0.3221747875213623, 0.4803650975227356, -0.1680324822664261, -0.2961729168891907, 0.25463593006134033, 0.15672999620437622, -0.2551995515823364, -0.10899832099676132, -0.13637831807136536, -0.01780940592288971, 0.34383395314216614, 0.000021146610379219055, -0.26223328709602356, -0.2340150773525238, 0.012283381074666977, -0.14722281694412231, 0.14647872745990753, 0.08880861103534698, 0.2097969949245453, -0.28176945447921753, 0.4590199291706085, 0.028700269758701324 ]
https://github.com/huggingface/datasets/issues/5760
Supporting this could be useful (I remember a use-case for this on the Hub). Do you agree @polinaeterna? Implementing this should be possible if we iterate over metadata files and build image/audio file paths instead of iterating over image/audio files and looking for the corresponding entries in metadata files.
Multi-image loading in Imagefolder dataset
### Feature request Extend the `imagefolder` dataloading script to support loading multiple images per dataset entry. This only really makes sense if a metadata file is present. Currently you can use the following format (example `metadata.jsonl`: ``` {'file_name': 'path_to_image.png', 'metadata': ...} ... ``` which will return a batch with key `image` and any other metadata. I would propose extending `file_name` to also accept a list of files, which would return a batch with key `images` and any other metadata. ### Motivation This is useful for example in segmentation tasks in computer vision models, or in text-to-image models that also accept conditioning signals such as another image, feature map, or similar. Currently if I want to do this, I would need to write a custom dataset, rather than just use `imagefolder`. ### Your contribution Would be open to doing a PR, but also happy for someone else to take it as I am not familiar with the datasets library.
49
Multi-image loading in Imagefolder dataset ### Feature request Extend the `imagefolder` dataloading script to support loading multiple images per dataset entry. This only really makes sense if a metadata file is present. Currently you can use the following format (example `metadata.jsonl`: ``` {'file_name': 'path_to_image.png', 'metadata': ...} ... ``` which will return a batch with key `image` and any other metadata. I would propose extending `file_name` to also accept a list of files, which would return a batch with key `images` and any other metadata. ### Motivation This is useful for example in segmentation tasks in computer vision models, or in text-to-image models that also accept conditioning signals such as another image, feature map, or similar. Currently if I want to do this, I would need to write a custom dataset, rather than just use `imagefolder`. ### Your contribution Would be open to doing a PR, but also happy for someone else to take it as I am not familiar with the datasets library. Supporting this could be useful (I remember a use-case for this on the Hub). Do you agree @polinaeterna? Implementing this should be possible if we iterate over metadata files and build image/audio file paths instead of iterating over image/audio files and looking for the corresponding entries in metadata files.
[ -0.32815250754356384, 0.28350213170051575, -0.14983941614627838, 0.2693420350551605, 0.0037037041038274765, -0.018421150743961334, 0.4850492477416992, 0.17986856400966644, 0.3869134485721588, 0.19497497379779816, -0.13056352734565735, 0.3341748118400574, -0.47223758697509766, 0.11088322103023529, 0.055158521980047226, -0.20900332927703857, 0.029874060302972794, 0.0943552553653717, -0.0342559739947319, 0.18487799167633057, -0.33504587411880493, 0.009202232584357262, -0.025599613785743713, -0.18584656715393066, -0.3342415392398834, 0.0886189341545105, -0.3307018280029297, 0.11837205290794373, -0.1641829013824463, -0.5035443305969238, -0.21631570160388947, 0.3687805235385895, 0.21591129899024963, 0.340786874294281, -0.00010168107110075653, -0.07215717434883118, 0.26777786016464233, -0.13951975107192993, -0.40456658601760864, -0.26903441548347473, -0.4507298469543457, -0.00868438184261322, 0.04185483604669571, -0.30974048376083374, 0.3083137273788452, -0.40170156955718994, 0.3020842373371124, -0.10002917051315308, 0.13214710354804993, -0.11883851885795593, 0.24149268865585327, 0.015501745045185089, -0.07230891287326813, 0.08420765399932861, 0.27496254444122314, 0.580359160900116, 0.053261712193489075, 0.10884536802768707, 0.4883947968482971, -0.2591356039047241, -0.2521337866783142, 0.31556466221809387, -0.1061573177576065, 0.006646636873483658, 0.3933849632740021, 0.10345503687858582, 0.04258672147989273, -0.30157265067100525, -0.08774381130933762, 0.21796540915966034, 0.49684739112854004, -0.12726271152496338, -0.40125519037246704, -0.437859445810318, 0.014260008931159973, -0.10912616550922394, -0.09311239421367645, 0.23120221495628357, -0.1281956434249878, -0.11884770542383194, -0.09923608601093292, -0.23361581563949585, -0.20104113221168518, 0.10982109606266022, 0.07461706548929214, 0.2850077450275421, 0.03531033545732498, 0.08486176282167435, 0.295987606048584, -0.055013157427310944, 0.2938634157180786, -0.34033265709877014, -0.013145539909601212, 0.022731781005859375, -0.0911567434668541, 0.050030529499053955, -0.026948366314172745, 0.024244531989097595, 0.13313305377960205, 0.15552690625190735, 0.24448257684707642, -0.10316210985183716, -0.49260854721069336, 0.2651984691619873, 0.38905996084213257, -0.25557637214660645, -0.05436120927333832, 0.07844528555870056, 0.1051756739616394, 0.09140204638242722, 0.06875088810920715, -0.12029695510864258, -0.42195791006088257, -0.023577211424708366, -0.009368441998958588, -0.06047562137246132, -0.11352230608463287, 0.19444644451141357, -0.09852761030197144, -0.4597720801830292, 0.28374558687210083, -0.27259403467178345, 0.22417712211608887, 0.03559428080916405, 0.17139717936515808, 0.18164391815662384, 0.06702868640422821, 0.08428630977869034, 0.23714736104011536, -0.02348955348134041, -0.02851727046072483, 0.20551899075508118, -0.24671301245689392, 0.2321823537349701, 0.1793888807296753, -0.03575456887483597, 0.18536102771759033, -0.1832266002893448, 0.1862715184688568, -0.1737370640039444, 0.2433568239212036, -0.1760859340429306, 0.12230558693408966, 0.09818024933338165, 0.06259212642908096, -0.11709151417016983, -0.012079193256795406, -0.011781163513660431, -0.2614820599555969, 0.1731814742088318, -0.5725790858268738, -0.07385727763175964, -0.04152143746614456, 0.16138698160648346, -0.035040102899074554, -0.007877039723098278, -0.8138459920883179, 0.24083225429058075, -0.187622532248497, -0.1548571139574051, -0.015043254941701889, -0.18437153100967407, -0.2663877308368683, -0.3304326832294464, 0.058037273585796356, 0.5830061435699463, -0.16451673209667206, -0.07509277760982513, -0.10075429081916809, -0.13367071747779846, -0.23610112071037292, 0.01385704055428505, -0.31409141421318054, 0.31265348196029663, -0.495430052280426, 0.17276711761951447, 0.05183722823858261, -0.6245628595352173, 0.20892411470413208, 0.31078314781188965, -0.14271005988121033, 0.25630757212638855, 0.27804332971572876, 0.3813803195953369, 0.21210482716560364, -0.34546026587486267, 0.0009535513818264008, 0.44669780135154724, -0.23704630136489868, 0.17323270440101624, 0.2882049083709717, -0.29730987548828125, 0.07420660555362701, 0.276750385761261, -0.09704344719648361, -0.004330091178417206, 0.02328900434076786, 0.11099939048290253, 0.27005359530448914, -0.26782160997390747, 0.19383862614631653, -0.04548664763569832, 0.07224582135677338, 0.036053791642189026, -0.039597950875759125, -0.1324218511581421, -0.6044419407844543, 0.3004990816116333, 0.23204286396503448, -0.08718644827604294, -0.3305743336677551, 0.014617636799812317, 0.2067064344882965, 0.04923305660486221, -0.4361501932144165, 0.049067240208387375, 0.18686091899871826, 0.38693422079086304, -0.18179446458816528, -0.20487873256206512, -0.2274468094110489, 0.4065536856651306, -0.03310609236359596, -0.003099929541349411, -0.1267230212688446, 0.36611512303352356, 0.28101953864097595, 0.14640851318836212, 0.09342990815639496, -0.10668338090181351, -0.03093569353222847, -0.10869671404361725, 0.20915502309799194, 0.44576674699783325, 0.38217657804489136, 0.280666321516037, 0.20438025891780853, 0.43289440870285034, 0.24169211089611053, -0.20303907990455627, 0.23883910477161407, -0.20753751695156097, 0.20175394415855408, -0.2951127588748932, -0.49216780066490173, 0.3633551299571991, -0.25932615995407104, 0.3872656226158142, 0.09495946019887924, -0.1733708679676056, 0.0795745849609375, 0.07132747769355774, -0.34832754731178284, -0.15696009993553162, -0.17177608609199524, 0.1978876143693924, 0.19237086176872253, 0.014423895627260208, -0.06775866448879242, -0.07149076461791992, 0.09804688394069672, 0.006495490670204163, 0.06357410550117493, 0.20991945266723633, -0.08489474654197693, -0.018489964306354523, -0.15350204706192017, 0.36099278926849365, 0.460796594619751, 0.29773980379104614, -0.07795463502407074, -0.29922768473625183, 0.24573248624801636, -0.006374482065439224, 0.187147855758667, 0.08963215351104736, 0.3274984359741211, 0.29813438653945923, 0.2688329517841339, -0.13142111897468567, -0.17371541261672974, -0.6256279945373535, 0.18405425548553467, -0.04926678538322449, -0.030030570924282074, -0.052367500960826874, -0.21431362628936768, -0.2868557870388031, -0.12428698688745499, -0.10761301964521408, -0.18688708543777466, 0.05958970636129379, 0.03179619088768959, 0.2655264735221863, -0.04434019699692726, -0.017455046996474266, -0.14834068715572357, 0.483638197183609, -0.07321418076753616, -0.25281763076782227, -0.20292460918426514, 0.15860258042812347, 0.21663135290145874, 0.09611935913562775, 0.5139375925064087, -0.009121917188167572, 0.29192087054252625, 0.12420526891946793, 0.1524195671081543, -0.515410840511322, -0.1262388378381729, 0.2555042505264282, -0.0581844225525856, -0.036950722336769104, 0.28236058354377747, 0.03649710491299629, 0.5059151649475098, -0.3673870861530304, 0.17037710547447205, 0.1509309709072113, -0.06361020356416702, -0.1328476369380951, 0.06401289999485016, 0.12124019116163254, -0.15353399515151978, 0.07410586625337601, -0.26455557346343994, -0.32481473684310913, 0.28864869475364685, 0.1820017397403717, 0.3672237694263458, 0.3005256652832031, 0.21552065014839172, -0.17768540978431702, -0.23554760217666626, -0.17952893674373627, 0.12073163688182831, -0.4010985493659973, 0.04447981342673302, -0.2034732699394226, 0.08572836220264435, -0.17714959383010864, 0.001507878303527832, 0.16324326395988464, 0.21152791380882263, -0.2970429062843323, -0.38395607471466064, 0.28094977140426636, -0.02108294516801834, -0.062074147164821625, -0.036846961826086044, -0.04390139505267143, 0.32166174054145813, -0.10148204118013382, -0.17306219041347504, 0.09517990052700043, -0.06990277767181396, 0.03963631018996239, 0.1685052365064621, 0.24443477392196655, 0.0379861481487751, 0.05875729024410248, 0.2837551236152649, -0.11775633692741394, 0.07444366812705994, 0.426331102848053, -0.18079406023025513, 0.2624107301235199, -0.1652836799621582, -0.18912240862846375, -0.07979576289653778, -0.14264363050460815, -0.07717175036668777, 0.22333924472332, 0.16717982292175293, -0.23471413552761078, -0.05388810485601425, 0.27303603291511536, -0.33403533697128296, -0.1716945320367813, 0.26687055826187134, 0.1769143044948578, 0.16394497454166412, -0.27865761518478394, -0.37285807728767395, -0.2940429151058197, 0.04930267482995987, 0.05556798353791237, 0.28617411851882935, 0.4437561333179474, -0.19866007566452026, -0.10471659153699875, 0.22329072654247284, 0.005989385768771172, -0.105372354388237, 0.21919259428977966, 0.024137943983078003, 0.11442418396472931, -0.027412038296461105, -0.12522712349891663, -0.1224261075258255, 0.8010838627815247, -0.181828573346138, 0.050854917615652084, -0.0045681484043598175, -0.002595171332359314, -0.06853286921977997, -0.004204146564006805, -0.13373638689517975, 0.036655303090810776, -0.2271231710910797, 0.7676131725311279, -0.14888840913772583, -0.19085416197776794, 0.05267615616321564, 0.07862967252731323, -0.2235516905784607, -0.3378847539424896, -0.10421933978796005, 0.018999598920345306, -0.2773481607437134, -0.23049396276474, 0.1189730167388916, 0.00980566069483757, -0.013535529375076294, -0.11207237839698792, 0.16440914571285248, -0.09254498034715652, -0.07660737633705139, -0.16375525295734406, 0.06631571799516678, 0.24374067783355713, 0.21050052344799042, 0.07436719536781311, 0.1134398952126503, 0.6230171322822571, 0.41795405745506287, -0.4087061285972595, -0.12994833290576935, 0.20570100843906403, -0.19253304600715637, 0.25007081031799316, 0.2537732720375061, 0.10588635504245758, 0.05349060520529747, -0.012767032720148563, -0.07311391830444336, -0.5369409918785095, 0.07763871550559998, 0.30961504578590393, -0.21790483593940735, -0.12278132885694504, -0.5118567943572998, 0.6937490701675415, 0.13837704062461853, -0.09453478455543518, 0.3190487325191498, -0.163985937833786, -0.3831750750541687, 0.1857365518808365, 0.13242369890213013, 0.5434786081314087, -0.1446099579334259, 0.34099704027175903, 0.004903580993413925, -0.2008492648601532, 0.11375011503696442, -0.3149305582046509, -0.0750209242105484, -0.18803036212921143, -0.13071708381175995, 0.008606776595115662, -0.03400783613324165, -0.022765669971704483, 0.3697783946990967, 0.021236732602119446, -0.027400977909564972, -0.004213541746139526, -0.06911756098270416, -0.18242302536964417, 0.4931034445762634, -0.24496130645275116, -0.4577188491821289, 0.06767572462558746, 0.1864822804927826, 0.08440208435058594, -0.20963981747627258, -0.055839985609054565, -0.14952102303504944, 0.23141123354434967, -0.039862968027591705, -0.24429191648960114, 0.04282666742801666, -0.03789537027478218, 0.005737710744142532, -0.14274708926677704, 0.08014188706874847, 0.05853808671236038, 0.002580349799245596, -0.2732032239437103, -0.16417483985424042, -0.03747342526912689, 0.172539621591568, -0.1025354266166687, 0.3690643906593323, -0.30990850925445557, -0.46193814277648926, 0.18189744651317596, 0.20919279754161835, 0.08714869618415833, -0.1889219582080841, -0.006937704980373383, -0.3938657343387604, -0.18239834904670715, 0.07201948016881943, 0.2720608711242676, -0.06044302135705948, -0.20175674557685852, 0.046924564987421036, -0.1066906750202179, -0.0028215572237968445, 0.16901274025440216, 0.24018332362174988, -0.007061388343572617, 0.11692680418491364, -0.14391352236270905, -0.01830066740512848, 0.1144932359457016, 0.15337622165679932, 0.025625083595514297, -0.3131304383277893, 0.22588013112545013, 0.2180970162153244, 0.14987340569496155, -0.2315625697374344, 0.21367038786411285, 0.41233447194099426, -0.17584222555160522, 0.22104036808013916, 0.12323422729969025, 0.17008596658706665, 0.09605351090431213, 0.03899948298931122, 0.09461218118667603, -0.029496558010578156, -0.1210736408829689, -0.4226304590702057, -0.0029780827462673187, 0.41572853922843933, -0.3978347182273865, 0.4102114140987396, -0.3325556218624115, -0.26175376772880554, 0.004683367908000946, 0.06997476518154144, -0.38678792119026184, 0.1011553481221199, -0.008523434400558472, 0.07771191000938416, 0.4220433235168457, 0.23330190777778625, -0.061414096504449844, 0.23770490288734436, 0.1811642199754715, 0.012630961835384369, -0.13877224922180176, -0.14368696510791779, -0.16131363809108734, 0.108184814453125, 0.15303581953048706, 0.3207967281341553, 0.11396078765392303, -0.2823665142059326, -0.22018347680568695, -0.18767838180065155, 0.06997692584991455, -0.17734959721565247, -0.28871679306030273, -0.053650036454200745, 0.18858598172664642, -0.11934152990579605, 0.21662506461143494, 0.30732569098472595, -0.023983415216207504, 0.2968137860298157, 0.28790247440338135, 0.24135179817676544, -0.2365945279598236, -0.10603941977024078, -0.05195019766688347, 0.36902156472206116, 0.20308029651641846, 0.12507593631744385, 0.17332009971141815, 0.11787082999944687, 0.06119188666343689, 0.18306779861450195, 0.4642993211746216, 0.25460994243621826, -0.20104598999023438, 0.1147058978676796, 0.1508059799671173, 0.23637069761753082, -0.12835411727428436, -0.22801573574543, -0.06154822185635567, -0.13356494903564453, 0.1614772379398346, 0.22728270292282104, 0.15682265162467957, 0.06171181797981262, 0.10861119627952576, -0.2110576033592224, 0.5280429124832153, -0.26130419969558716, -0.07546119391918182, 0.14096295833587646, -0.09798282384872437, 0.02542552351951599, 0.214679554104805, 0.0900658667087555, 0.18138812482357025, 0.46327105164527893, -0.29725557565689087, 0.32190850377082825, 0.23351873457431793, -0.09808391332626343, 0.4061509966850281, -0.2531837522983551, -0.03169923275709152, 0.09374022483825684, 0.29200172424316406, 0.3043132722377777, -0.04422491043806076, 0.12355351448059082, -0.019410397857427597, 0.15351375937461853, -0.047659676522016525, 0.34865057468414307, 0.1869312822818756, -0.21698987483978271, -0.4289345145225525, -0.32134151458740234, -0.3549453616142273, 0.04282774776220322, -0.1308394968509674, -0.29441314935684204, -0.0082581527531147, 0.11537966132164001, 0.23387399315834045, -0.18551214039325714, -0.21273273229599, 0.2316035032272339, 0.1389150768518448, -0.4463425874710083, 0.11018053442239761, 0.3131578266620636, -0.041177261620759964, 0.3908088505268097, 0.20501893758773804, 0.24551890790462494, 0.3168230652809143, 0.25371450185775757, 0.004928253591060638, -0.4792211353778839, 0.08253277838230133, -0.1563670039176941, -0.07476678490638733, 0.025705676525831223, -0.052826374769210815, 0.2753842771053314, 0.20126163959503174, -0.182684987783432, -0.012168186716735363, 0.19239555299282074, -0.14920079708099365, -0.26037275791168213, -0.08586551249027252, 0.17934879660606384, 0.012102536857128143, -0.11049377918243408, 0.14408068358898163, -0.47848865389823914, -0.4584295153617859, 0.43510565161705017, -0.015854280441999435, -0.021394703537225723, 0.3825189173221588, 0.11532425135374069, -0.10394664108753204, 0.3158698081970215, 0.2020457684993744, 0.09276467561721802, -0.19429565966129303, -0.24224013090133667, -0.6278641819953918, -0.09440648555755615, -0.13159522414207458, -0.27187690138816833, -0.0817970484495163, 0.2356806993484497, 0.1993687003850937, 0.12809419631958008, 0.1357179433107376, -0.05532337352633476, 0.34533455967903137, 0.3378644585609436, -0.3573067784309387, 0.030609797686338425, 0.4742458164691925, 0.38475191593170166, -0.09254138171672821, -0.167999267578125, -0.08318746089935303, 0.0015184730291366577, 0.10350848734378815, -0.23048089444637299, -0.05437660589814186, -0.03839470073580742, 0.015272153541445732, 0.42491644620895386, -0.21815136075019836, 0.1500748097896576, -0.24050629138946533, -0.13697996735572815, -0.39682742953300476, -0.03802197426557541, -0.0963565856218338, -0.21438512206077576, 0.25806841254234314, 0.35182738304138184, -0.1754986047744751, -0.10819783061742783, -0.4226011335849762, -0.18687820434570312, -0.2548459768295288, -0.0006153807044029236, -0.38931795954704285, 0.16477739810943604, -0.09060373902320862, 0.004950582981109619, -0.06426029652357101, -0.00777579378336668, 0.18659505248069763, -0.1606605052947998, -0.17464502155780792, -0.17163848876953125, 0.31423234939575195, -0.34081190824508667, -0.3215319812297821, -0.04020712524652481, 0.19192057847976685, -0.49491968750953674, 0.4109806418418884, -0.18889862298965454, 0.05487857758998871, 0.3872264325618744, 0.16166122257709503, -0.1976800262928009, 0.14264512062072754, 0.13971979916095734, -0.018205702304840088, -0.1434842348098755, -0.3471600115299225, 0.09780015051364899, -0.24045196175575256, -0.30976587533950806, -0.3614891767501831 ]
https://github.com/huggingface/datasets/issues/5760
I've build a similar feature from scratch and would be interested to combine it with the datasets package. My solution works something like this: Interpret the first element of each column as a file path. If the path exists and is a file, (try to) load the files for the entire column. Thereby, one isn't restricted to a particular column name, with comes in handy when dealing with multiple file columns. I've looked into the code to try to implement this, but didn't find the right places. I'm also open to contribute, but will need some guidance.
Multi-image loading in Imagefolder dataset
### Feature request Extend the `imagefolder` dataloading script to support loading multiple images per dataset entry. This only really makes sense if a metadata file is present. Currently you can use the following format (example `metadata.jsonl`: ``` {'file_name': 'path_to_image.png', 'metadata': ...} ... ``` which will return a batch with key `image` and any other metadata. I would propose extending `file_name` to also accept a list of files, which would return a batch with key `images` and any other metadata. ### Motivation This is useful for example in segmentation tasks in computer vision models, or in text-to-image models that also accept conditioning signals such as another image, feature map, or similar. Currently if I want to do this, I would need to write a custom dataset, rather than just use `imagefolder`. ### Your contribution Would be open to doing a PR, but also happy for someone else to take it as I am not familiar with the datasets library.
97
Multi-image loading in Imagefolder dataset ### Feature request Extend the `imagefolder` dataloading script to support loading multiple images per dataset entry. This only really makes sense if a metadata file is present. Currently you can use the following format (example `metadata.jsonl`: ``` {'file_name': 'path_to_image.png', 'metadata': ...} ... ``` which will return a batch with key `image` and any other metadata. I would propose extending `file_name` to also accept a list of files, which would return a batch with key `images` and any other metadata. ### Motivation This is useful for example in segmentation tasks in computer vision models, or in text-to-image models that also accept conditioning signals such as another image, feature map, or similar. Currently if I want to do this, I would need to write a custom dataset, rather than just use `imagefolder`. ### Your contribution Would be open to doing a PR, but also happy for someone else to take it as I am not familiar with the datasets library. I've build a similar feature from scratch and would be interested to combine it with the datasets package. My solution works something like this: Interpret the first element of each column as a file path. If the path exists and is a file, (try to) load the files for the entire column. Thereby, one isn't restricted to a particular column name, with comes in handy when dealing with multiple file columns. I've looked into the code to try to implement this, but didn't find the right places. I'm also open to contribute, but will need some guidance.
[ -0.28135037422180176, 0.34455224871635437, -0.11237320303916931, 0.22050783038139343, 0.035994820296764374, 0.12466489523649216, 0.5199511051177979, 0.30428287386894226, 0.49550026655197144, 0.09138574451208115, -0.06388944387435913, 0.33959248661994934, -0.3794679045677185, 0.25638145208358765, -0.027675146237015724, -0.16007328033447266, 0.02824598178267479, 0.1975855827331543, -0.1156969964504242, 0.2129938155412674, -0.2878044843673706, -0.004699593409895897, -0.059305451810359955, -0.0980951189994812, -0.3168141543865204, 0.0394522026181221, -0.31642428040504456, 0.10690179467201233, -0.09979939460754395, -0.3517920970916748, -0.12781879305839539, 0.41653549671173096, 0.3086862862110138, 0.305423766374588, -0.0001017792455968447, -0.1124972552061081, 0.15877912938594818, -0.10572423785924911, -0.4058247208595276, -0.2547081410884857, -0.35076096653938293, -0.16561070084571838, 0.07815169543027878, -0.4114743173122406, 0.3135858178138733, -0.5047929286956787, 0.2526552677154541, -0.14187288284301758, 0.048391543328762054, -0.08932271599769592, 0.22650061547756195, 0.008044257760047913, -0.08365567028522491, 0.06848901510238647, 0.3131307065486908, 0.4521074891090393, -0.00592011958360672, 0.06550759822130203, 0.4475109875202179, -0.4289672076702118, -0.2651098668575287, 0.33607038855552673, -0.1158791333436966, 0.11256735026836395, 0.39837974309921265, 0.19586685299873352, 0.0439930260181427, -0.13878357410430908, -0.08141441643238068, 0.2112801969051361, 0.5251700282096863, -0.06881892681121826, -0.3709048330783844, -0.4850336015224457, 0.0014471597969532013, -0.10413828492164612, -0.02256746217608452, 0.19139441847801208, -0.09675486385822296, -0.10439887642860413, -0.1038467288017273, -0.22413188219070435, -0.26834622025489807, 0.08741801232099533, -0.09812991321086884, 0.15265804529190063, -0.007170520722866058, 0.12047839164733887, 0.24519023299217224, -0.04272844269871712, 0.2707202434539795, -0.353628545999527, 0.05494621768593788, 0.03709842264652252, -0.1974220871925354, 0.11827176809310913, -0.00020701438188552856, 0.056674301624298096, 0.16290012001991272, 0.12933339178562164, 0.20045942068099976, -0.10397641360759735, -0.36564287543296814, 0.1965019404888153, 0.3664177358150482, -0.16746440529823303, -0.08638671040534973, 0.148032084107399, 0.04661647230386734, 0.17617395520210266, -0.05111151188611984, -0.15142545104026794, -0.43178489804267883, 0.030040763318538666, -0.04870263487100601, -0.22343884408473969, -0.08988519757986069, 0.17025022208690643, -0.09568477421998978, -0.3463270664215088, 0.3549646735191345, -0.24865718185901642, 0.21294477581977844, 0.04167476296424866, 0.0628366470336914, 0.24844545125961304, 0.05899550020694733, -0.029261644929647446, 0.248450368642807, -0.042825475335121155, -0.10172650218009949, 0.24847882986068726, -0.2998107373714447, 0.18041113018989563, 0.18427208065986633, -0.07092660665512085, 0.052359260618686676, -0.1854727566242218, 0.13158336281776428, -0.11182437092065811, 0.17906324565410614, -0.22591134905815125, 0.056822311133146286, 0.0755598321557045, 0.10136625170707703, -0.1353723704814911, 0.16082067787647247, -0.0583491213619709, -0.19835379719734192, 0.10017772018909454, -0.5641889572143555, -0.10194666683673859, -0.13137590885162354, 0.16092856228351593, -0.054816123098134995, 0.036098379641771317, -0.7432231307029724, 0.2538599371910095, -0.1518092006444931, -0.08256383240222931, -0.09521500021219254, -0.12464563548564911, -0.16893476247787476, -0.3499909043312073, 0.07048548758029938, 0.6581335067749023, -0.2227575182914734, 0.026949778199195862, -0.10614834725856781, -0.13414382934570312, -0.19305971264839172, -0.08382128179073334, -0.2729094922542572, 0.29408571124076843, -0.41242265701293945, 0.11470918357372284, 0.0961294174194336, -0.44333159923553467, 0.19217267632484436, 0.39114874601364136, -0.182033509016037, 0.22904813289642334, 0.2873785197734833, 0.31823375821113586, 0.18876031041145325, -0.21144722402095795, -0.043799541890621185, 0.46139150857925415, -0.23301251232624054, 0.11045146733522415, 0.2971547842025757, -0.35212621092796326, 0.026028327643871307, 0.39122360944747925, -0.005370059981942177, 0.05276168882846832, 0.06385187804698944, -0.044872600585222244, 0.22380900382995605, -0.24909666180610657, 0.15516027808189392, -0.030296193435788155, -0.03157080337405205, 0.22324855625629425, -0.0254655871540308, -0.13512647151947021, -0.7631747126579285, 0.2690730690956116, 0.4428616166114807, -0.21378622949123383, -0.4390130341053009, -0.020353838801383972, 0.06067284569144249, 0.02221900224685669, -0.3649381101131439, 0.14675414562225342, 0.17140626907348633, 0.342911034822464, -0.17804749310016632, -0.1863391399383545, -0.2578616142272949, 0.4970747232437134, -0.15946970880031586, 0.026685182005167007, -0.16239845752716064, 0.396637886762619, 0.28779128193855286, 0.14590732753276825, 0.09096962213516235, -0.06484002619981766, -0.04425591602921486, -0.13207396864891052, 0.2550780177116394, 0.38139939308166504, 0.20362216234207153, 0.24687469005584717, 0.25911182165145874, 0.43400880694389343, 0.0905112698674202, -0.04798278585076332, 0.17829202115535736, -0.4136091470718384, 0.23179510235786438, -0.18531188368797302, -0.6610874533653259, 0.38990098237991333, -0.4178263247013092, 0.3699471950531006, 0.11023303866386414, -0.11686597764492035, 0.1079932376742363, 0.0007666945457458496, -0.23867759108543396, -0.22896462678909302, -0.1311691701412201, 0.19933173060417175, 0.04488609731197357, 0.040430255234241486, -0.12479939311742783, -0.04305548593401909, 0.055454764515161514, 0.03874858468770981, 0.01260796282440424, 0.16124458611011505, 0.02203955501317978, 0.07735531032085419, -0.08222756534814835, 0.4103964567184448, 0.5138639807701111, 0.29992252588272095, -0.10287646949291229, -0.3024675250053406, 0.18821270763874054, -0.023554597049951553, 0.1691988706588745, 0.08502336591482162, 0.22325056791305542, 0.29440397024154663, 0.15527725219726562, -0.10115183889865875, -0.17202788591384888, -0.55631023645401, 0.2923003137111664, 0.03245845437049866, -0.1014212891459465, -0.0036498308181762695, -0.29009392857551575, -0.2654995024204254, -0.11066621541976929, -0.03231905773282051, -0.026798002421855927, 0.01607060432434082, -0.034085676074028015, 0.2097260057926178, -0.0031044185161590576, -0.05571692809462547, -0.36093461513519287, 0.49011915922164917, 0.019561767578125, -0.3278731107711792, -0.1292216181755066, 0.09643487632274628, 0.1997339278459549, 0.13828802108764648, 0.5132775902748108, 0.03261404111981392, 0.32716280221939087, 0.09713329374790192, 0.13512489199638367, -0.5674528479576111, -0.11875821650028229, 0.24784576892852783, -0.1869579553604126, -0.0018138084560632706, 0.3108164072036743, 0.11774002015590668, 0.3953395485877991, -0.25966349244117737, 0.2204417884349823, 0.18094928562641144, -0.028813865035772324, -0.04514402523636818, 0.12945429980754852, 0.058136165142059326, -0.11319056153297424, -0.04264775291085243, -0.2283688485622406, -0.24494338035583496, 0.23775357007980347, 0.18423959612846375, 0.3731364905834198, 0.1395294964313507, 0.23916392028331757, -0.16143277287483215, -0.14626751840114594, -0.20860089361667633, 0.0769708976149559, -0.2982364296913147, 0.14802786707878113, -0.13902634382247925, 0.020230570808053017, -0.09401855617761612, 0.025675252079963684, 0.04410553351044655, 0.25610241293907166, -0.4030417501926422, -0.403539776802063, 0.1892370730638504, -0.027584601193666458, -0.0056521473452448845, 0.02241436578333378, -0.03494478389620781, 0.2642403542995453, -0.09881839901208878, -0.15818753838539124, 0.047853097319602966, -0.015656381845474243, -0.030473066493868828, 0.13650627434253693, 0.2926494777202606, 0.131781205534935, 0.08239831030368805, 0.11010101437568665, -0.14008769392967224, 0.07236985862255096, 0.44911667704582214, -0.2385345846414566, 0.30386751890182495, -0.017249081283807755, -0.2579571604728699, -0.11848874390125275, -0.16184447705745697, 0.00019800662994384766, 0.15707136690616608, 0.17795413732528687, -0.13869686424732208, -0.09088221937417984, 0.36912858486175537, -0.31470224261283875, -0.13577498495578766, 0.292758047580719, 0.18275363743305206, 0.19268009066581726, -0.2837454080581665, -0.4590255618095398, -0.32754239439964294, -0.020464465022087097, 0.05625263974070549, 0.3258920907974243, 0.3502408564090729, -0.23832690715789795, -0.057603541761636734, 0.20430082082748413, 0.06819044798612595, -0.03737363964319229, 0.14697574079036713, -0.026716772466897964, 0.19646595418453217, -0.04136725142598152, -0.11485445499420166, -0.13193199038505554, 0.8820940852165222, -0.13590392470359802, -0.02004174515604973, 0.05469805747270584, 0.013250231742858887, -0.1281302273273468, -0.10679112374782562, -0.1405724287033081, -0.04755760729312897, -0.33003976941108704, 0.8356399536132812, -0.1456567943096161, -0.2626408040523529, 0.1962854564189911, 0.039475273340940475, -0.29593634605407715, -0.37705910205841064, -0.1459595263004303, -0.010618090629577637, -0.21378010511398315, -0.19770747423171997, 0.0455637127161026, 0.11953620612621307, 0.012249447405338287, -0.16779384016990662, 0.09349784255027771, -0.12513084709644318, -0.06008562073111534, -0.018397994339466095, 0.08807525038719177, 0.23546276986598969, 0.21190336346626282, 0.09853437542915344, 0.14438502490520477, 0.5574118494987488, 0.47766292095184326, -0.5110667943954468, -0.11452378332614899, 0.18462027609348297, -0.2963484227657318, 0.2754668593406677, 0.20677593350410461, -0.032806675881147385, 0.08587843924760818, -0.22467783093452454, -0.03885820135474205, -0.4754641354084015, 0.027550797909498215, 0.2647244930267334, -0.1776903122663498, -0.045634716749191284, -0.57720947265625, 0.7019476890563965, 0.2569817900657654, -0.1200692281126976, 0.31888478994369507, -0.07688159495592117, -0.3032207489013672, 0.15827667713165283, 0.12702320516109467, 0.5202361345291138, -0.2864000201225281, 0.2824856638908386, 0.009478574618697166, -0.18217690289020538, 0.21925140917301178, -0.3278936743736267, -0.09467938542366028, -0.2581050395965576, -0.28799575567245483, -0.05692140385508537, -0.048800721764564514, 0.09844447672367096, 0.34616684913635254, 0.054298266768455505, 0.07345637679100037, -0.022484727203845978, 0.03738664463162422, -0.16082017123699188, 0.4181908369064331, -0.19545525312423706, -0.449813574552536, -0.044515352696180344, 0.16328942775726318, 0.027463693171739578, -0.29845672845840454, -0.046407412737607956, -0.05603543668985367, 0.14108598232269287, -0.041076451539993286, -0.20791137218475342, 0.05166115611791611, 0.09167573601007462, 0.008602350950241089, -0.13173039257526398, 0.12651807069778442, 0.08674107491970062, 0.10715623199939728, -0.2739841341972351, -0.19665086269378662, -0.005599750205874443, 0.08142311871051788, -0.08872929960489273, 0.29217278957366943, -0.3709973096847534, -0.46392810344696045, 0.24491705000400543, 0.23672401905059814, 0.08408236503601074, -0.16309644281864166, 0.048925723880529404, -0.3478447198867798, -0.17564891278743744, 0.12285368144512177, 0.42830124497413635, -0.1686628758907318, -0.2268364131450653, -0.07255752384662628, -0.004538215696811676, 0.005315624177455902, 0.17733879387378693, 0.20866098999977112, 0.06930920481681824, 0.24245001375675201, -0.14359129965305328, 0.0002152472734451294, 0.1406150460243225, 0.21189263463020325, 0.0025776540860533714, -0.24287353456020355, 0.24992036819458008, 0.2985703945159912, 0.07704846560955048, -0.2185104787349701, 0.1569635570049286, 0.4611551761627197, -0.12277652323246002, 0.21195313334465027, 0.11457100510597229, 0.14576461911201477, 0.16242976486682892, 0.10862068831920624, 0.14977991580963135, -0.022691600024700165, -0.020556196570396423, -0.47952204942703247, 0.04032526910305023, 0.4124683737754822, -0.35094621777534485, 0.35494840145111084, -0.1639403998851776, -0.33799558877944946, -0.02439386397600174, 0.1411680281162262, -0.38027897477149963, 0.14146587252616882, -0.027874864637851715, 0.023799490183591843, 0.506391704082489, 0.2954978346824646, 0.004570439457893372, 0.11860103160142899, 0.21000538766384125, 0.006053272634744644, -0.04698310047388077, -0.18660560250282288, -0.124105304479599, 0.10636113584041595, 0.09993690252304077, 0.2553073465824127, 0.04529570788145065, -0.3190118074417114, -0.25445055961608887, -0.2137572318315506, 0.0843450203537941, -0.1807962954044342, -0.24514688551425934, -0.033887892961502075, 0.16471374034881592, -0.11890748888254166, 0.05097690224647522, 0.2773568630218506, -0.11997963488101959, 0.19820059835910797, 0.34361180663108826, 0.20854048430919647, -0.22490955889225006, -0.04883279651403427, -0.06600338220596313, 0.3087577521800995, 0.11623130738735199, 0.07056489586830139, 0.22136330604553223, 0.04312492161989212, 0.05392076075077057, 0.25716525316238403, 0.39408260583877563, 0.27676424384117126, -0.23453614115715027, 0.026291877031326294, 0.17323361337184906, 0.2368992418050766, -0.24031983315944672, -0.26528671383857727, 0.00040511973202228546, -0.0910647064447403, 0.14558538794517517, 0.32090145349502563, 0.1566089689731598, -0.009306266903877258, -0.02570735290646553, -0.17050205171108246, 0.5336107611656189, -0.14700722694396973, -0.09096382558345795, 0.2543734908103943, -0.032566919922828674, 0.013851331546902657, 0.26223641633987427, 0.21277612447738647, 0.09556342661380768, 0.5041778683662415, -0.24542692303657532, 0.08315383642911911, 0.152725949883461, 0.0242379829287529, 0.13568001985549927, -0.37300729751586914, 0.2215566337108612, 0.13415443897247314, 0.19703570008277893, 0.2501171827316284, -0.10174475610256195, 0.10693985223770142, 0.023396257311105728, 0.19250205159187317, -0.03832753002643585, 0.31473565101623535, 0.17491672933101654, -0.17968836426734924, -0.4424748122692108, -0.35564547777175903, -0.4298056960105896, 0.049405910074710846, -0.08094893395900726, -0.37591928243637085, 0.07637941837310791, 0.13936620950698853, 0.22183997929096222, -0.23906296491622925, -0.08848970383405685, 0.28065651655197144, 0.22746074199676514, -0.4295470714569092, 0.08952458947896957, 0.3116641640663147, 0.041483763605356216, 0.416359007358551, 0.07738780230283737, 0.16416490077972412, 0.24767599999904633, 0.41788235306739807, -0.0802471935749054, -0.4337156414985657, 0.037214621901512146, -0.11522224545478821, -0.07486533373594284, -0.06275513768196106, -0.05277658626437187, 0.2264571487903595, 0.1980839967727661, -0.22777169942855835, 0.07496678084135056, 0.15781769156455994, -0.14029650390148163, -0.3231584131717682, -0.025545652955770493, 0.29760587215423584, -0.06188139691948891, -0.13186883926391602, 0.16632848978042603, -0.3931790590286255, -0.43578675389289856, 0.44258058071136475, 0.022503148764371872, 0.041357822716236115, 0.40304034948349, 0.13139131665229797, 0.017474155873060226, 0.28929710388183594, 0.24989748001098633, -0.013835189864039421, -0.20590868592262268, -0.25334739685058594, -0.6876909136772156, -0.0265660360455513, -0.21902553737163544, -0.4134731888771057, 0.041210878640413284, 0.23376218974590302, 0.19490277767181396, 0.013417420908808708, 0.0860135406255722, -0.0013707168400287628, 0.3401200473308563, 0.3535849153995514, -0.4035632014274597, -0.0725204199552536, 0.45330217480659485, 0.31855547428131104, -0.16045311093330383, -0.16885830461978912, -0.01967025175690651, 0.062044594436883926, 0.11705616116523743, -0.2287655621767044, 0.0030658096075057983, 0.029505863785743713, -0.11835009604692459, 0.40950632095336914, -0.3372293710708618, 0.16080041229724884, -0.14755958318710327, -0.0843062698841095, -0.3901844918727875, 0.11506247520446777, -0.15886875987052917, -0.11768116801977158, 0.30058687925338745, 0.28488481044769287, -0.18516917526721954, -0.12642942368984222, -0.3698226809501648, -0.15101081132888794, -0.24732749164104462, 0.0031304210424423218, -0.32688501477241516, 0.16891154646873474, 0.017063573002815247, 0.0041943565011024475, -0.047899384051561356, 0.043042320758104324, 0.12929309904575348, -0.05861123651266098, -0.11076615750789642, -0.31352055072784424, 0.23760393261909485, -0.40536022186279297, -0.35108426213264465, 0.0649757832288742, 0.12454193830490112, -0.4079628586769104, 0.3566991984844208, -0.18846957385540009, 0.065198615193367, 0.36957836151123047, 0.11200878024101257, -0.09444771707057953, 0.14853817224502563, 0.18056413531303406, 0.0905206948518753, -0.16291052103042603, -0.3096238672733307, 0.057991888374090195, -0.22412356734275818, -0.2937304377555847, -0.30939286947250366 ]
https://github.com/huggingface/datasets/issues/5759
Thanks for reporting, @LZY-the-boys. Could you please give more details about what is your intended dataset structure? What are the names of the columns and the value of each row? Currently, the JSON-Lines format is supported: - Each line correspond to one row of the dataset - Each line is composed of one JSON object, where the names are the names of the columns, and the values are the values for the row-column pair.
Can I load in list of list of dict format?
### Feature request my jsonl dataset has following format: ``` [{'input':xxx, 'output':xxx},{'input:xxx,'output':xxx},...] [{'input':xxx, 'output':xxx},{'input:xxx,'output':xxx},...] ``` I try to use `datasets.load_dataset('json', data_files=path)` or `datasets.Dataset.from_json`, it raises ``` File "site-packages/datasets/arrow_dataset.py", line 1078, in from_json ).read() File "site-packages/datasets/io/json.py", line 59, in read self.builder.download_and_prepare( File "site-packages/datasets/builder.py", line 872, in download_and_prepare self._download_and_prepare( File "site-packages/datasets/builder.py", line 967, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "site-packages/datasets/builder.py", line 1749, in _prepare_split for job_id, done, content in self._prepare_split_single( File "site-packages/datasets/builder.py", line 1892, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Motivation I wanna use features like `Datasets.map` or `Datasets.shuffle`, so i need the dataset in memory to be `arrow_dataset.Datasets` format ### Your contribution PR
74
Can I load in list of list of dict format? ### Feature request my jsonl dataset has following format: ``` [{'input':xxx, 'output':xxx},{'input:xxx,'output':xxx},...] [{'input':xxx, 'output':xxx},{'input:xxx,'output':xxx},...] ``` I try to use `datasets.load_dataset('json', data_files=path)` or `datasets.Dataset.from_json`, it raises ``` File "site-packages/datasets/arrow_dataset.py", line 1078, in from_json ).read() File "site-packages/datasets/io/json.py", line 59, in read self.builder.download_and_prepare( File "site-packages/datasets/builder.py", line 872, in download_and_prepare self._download_and_prepare( File "site-packages/datasets/builder.py", line 967, in _download_and_prepare self._prepare_split(split_generator, **prepare_split_kwargs) File "site-packages/datasets/builder.py", line 1749, in _prepare_split for job_id, done, content in self._prepare_split_single( File "site-packages/datasets/builder.py", line 1892, in _prepare_split_single raise DatasetGenerationError("An error occurred while generating the dataset") from e datasets.builder.DatasetGenerationError: An error occurred while generating the dataset ``` ### Motivation I wanna use features like `Datasets.map` or `Datasets.shuffle`, so i need the dataset in memory to be `arrow_dataset.Datasets` format ### Your contribution PR Thanks for reporting, @LZY-the-boys. Could you please give more details about what is your intended dataset structure? What are the names of the columns and the value of each row? Currently, the JSON-Lines format is supported: - Each line correspond to one row of the dataset - Each line is composed of one JSON object, where the names are the names of the columns, and the values are the values for the row-column pair.
[ -0.3445363938808441, -0.1746564656496048, -0.14360003173351288, 0.5329079031944275, 0.14330129325389862, 0.3087426722049713, 0.12361147999763489, 0.4864727854728699, 0.5251843333244324, -0.1500074565410614, -0.1594400703907013, 0.6687206029891968, -0.3528434634208679, 0.34140098094940186, -0.11546316742897034, -0.18479245901107788, -0.006892658770084381, 0.2626292109489441, -0.07139980792999268, 0.025226213037967682, -0.15621230006217957, 0.03687094897031784, -0.1089475005865097, -0.14478078484535217, 0.23059704899787903, -0.11501963436603546, -0.07257498055696487, 0.3128916919231415, -0.30331405997276306, -0.5817046761512756, 0.18274667859077454, 0.2111053615808487, 0.23650553822517395, 0.07623274624347687, -0.00011211985838599503, 0.14465397596359253, 0.13497251272201538, -0.0718429759144783, -0.3331357538700104, -0.40869855880737305, -0.5986045598983765, -0.37256115674972534, 0.3516094386577606, -0.36081182956695557, -0.12040023505687714, -0.47206300497055054, -0.1426321119070053, -0.40047481656074524, 0.6101906895637512, 0.25373026728630066, 0.1487331986427307, 0.08843119442462921, 0.2077886015176773, 0.09867838025093079, 0.24046564102172852, 0.5282139778137207, -0.15275779366493225, 0.07526158541440964, 0.25840020179748535, 0.24011953175067902, 0.2771303355693817, -0.14732427895069122, -0.31415796279907227, -0.004480995237827301, 0.09144604951143265, -0.06417657434940338, -0.04852813482284546, -0.02825283259153366, -0.08227379620075226, 0.314541757106781, 0.8078848123550415, -0.2358410358428955, -0.4150995910167694, 0.007772952318191528, -0.16244995594024658, -0.23607809841632843, -0.12059147655963898, 0.15945176780223846, -0.04817511886358261, 0.2502722144126892, -0.1096840351819992, -0.3460634648799896, 0.008659593760967255, 0.0677000880241394, -0.13218240439891815, 0.21512815356254578, -0.19858036935329437, 0.05849393829703331, 0.014718531630933285, -0.2707463502883911, 0.068748340010643, -0.1277771294116974, -0.2349151074886322, 0.1293882429599762, -0.4229429364204407, -0.29509103298187256, -0.03766123205423355, -0.45396023988723755, 0.30583086609840393, 0.11195029318332672, 0.23127371072769165, 0.03024987131357193, -0.18389706313610077, 0.1178085207939148, 0.47151732444763184, 0.11749064922332764, 0.3967148959636688, 0.0671081468462944, -0.14697295427322388, -0.03493496775627136, -0.0016841515898704529, -0.009170396253466606, -0.3956856429576874, 0.09710058569908142, -0.04501583054661751, 0.006381910294294357, 0.0981147438287735, -0.09069529175758362, -0.27620214223861694, -0.24474024772644043, -0.1304575353860855, -0.14003339409828186, 0.1362120658159256, 0.4599205255508423, 0.11656802892684937, 0.5925108194351196, -0.13782306015491486, 0.034306202083826065, 0.3084416389465332, 0.11202190816402435, -0.07057997584342957, 0.10359305143356323, 0.06135064363479614, -0.21265685558319092, -0.04263310134410858, 0.2101650834083557, 0.18071259558200836, -0.08893044292926788, -0.12072087079286575, -0.1594657599925995, 0.1783510446548462, -0.13451093435287476, 0.10537901520729065, 0.127352774143219, -0.10544095933437347, 0.056818991899490356, 0.04029548540711403, 0.030500128865242004, -0.39219963550567627, 0.36367350816726685, -0.34677010774612427, -0.14454302191734314, -0.0788998156785965, 0.16857895255088806, 0.04809286445379257, -0.006065302528440952, -0.5839861631393433, 0.1906988024711609, 0.06337900459766388, -0.11009247601032257, -0.16803394258022308, -0.04206408932805061, -0.1781689077615738, -0.41030141711235046, -0.05439000576734543, 0.37188372015953064, -0.6543138027191162, -0.04403063654899597, 0.03718395158648491, -0.13840049505233765, -0.04219823330640793, 0.26803022623062134, -0.329875111579895, 0.14835935831069946, -0.1747705042362213, 0.03133480250835419, 0.7039259672164917, -0.5633012652397156, -0.10999546200037003, 0.4142238199710846, 0.19718316197395325, -0.0007179304957389832, 0.4158991277217865, 0.05662781745195389, 0.28332212567329407, -0.051060646772384644, 0.23477253317832947, 0.3925718665122986, 0.09911845624446869, 0.14049959182739258, 0.08637087047100067, -0.45993825793266296, 0.3904578685760498, 0.1942017823457718, -0.2981390357017517, 0.10506495833396912, -0.04825953021645546, 0.15038137137889862, 0.35238587856292725, -0.24749264121055603, -0.16002634167671204, 0.2764665484428406, -0.09482717514038086, -0.16565488278865814, -0.017331179231405258, -0.21826598048210144, -0.6791122555732727, 0.1065564826130867, -0.005900710821151733, -0.3071167469024658, -0.1305766999721527, -0.062156837433576584, -0.2779218256473541, 0.18504104018211365, -0.35982269048690796, 0.09842725843191147, 0.13279281556606293, -0.08886618912220001, 0.10429783165454865, -0.2682840824127197, -0.33040302991867065, 0.13881167769432068, 0.026691801846027374, 0.031920503824949265, -0.2798781096935272, 0.2363150417804718, 0.20936036109924316, 0.11312486231327057, 0.16319186985492706, 0.03528491407632828, -0.09306597709655762, -0.16476446390151978, 0.04779238626360893, 0.1460740864276886, 0.5596158504486084, -0.06490737199783325, 0.04890575259923935, 0.08141128718852997, 0.13518305122852325, -0.0707249566912651, 0.09220048040151596, 0.018033623695373535, 0.13930201530456543, -0.03367343544960022, -0.2880175709724426, 0.36505019664764404, -0.07204030454158783, 0.2787097096443176, 0.05382176488637924, -0.06878256797790527, 0.4209510087966919, 0.11775470525026321, 0.05072769522666931, -0.240360826253891, -0.1847088634967804, 0.5819991230964661, 0.3509422540664673, 0.07796377688646317, -0.3644959032535553, -0.11163102090358734, 0.48108920454978943, 0.09698303043842316, 0.1756039559841156, 0.14129340648651123, -0.053455427289009094, -0.10234150290489197, 0.010913560166954994, -0.10340766608715057, 0.22315888106822968, 0.20659491419792175, -0.1894514113664627, -0.12783555686473846, 0.350707471370697, 0.08151385188102722, 0.20527230203151703, -0.12817731499671936, 0.4204937517642975, 0.21704275906085968, 0.3090577721595764, -0.3315734267234802, -0.14734987914562225, -0.3511343002319336, 0.2746339440345764, 0.0730561837553978, -0.18078124523162842, -0.09027501940727234, -0.23042619228363037, -0.12751160562038422, 0.04754012078046799, -0.062346599996089935, 0.0851186066865921, -0.0690341591835022, -0.13346421718597412, 0.17563828825950623, 0.00878092646598816, 0.0272025465965271, 0.18803802132606506, -0.0675341784954071, 0.23113340139389038, -0.25076085329055786, -0.17261171340942383, -0.19219756126403809, 0.1109108179807663, 0.10240171104669571, 0.16946153342723846, 0.1992771327495575, 0.305196613073349, -0.11725074052810669, -0.12852638959884644, -0.16506117582321167, 0.19083164632320404, 0.3013211488723755, 0.049887657165527344, -0.02509293705224991, 0.36416497826576233, 0.37326303124427795, 0.06569289416074753, -0.04290771484375, 0.18409991264343262, 0.33637163043022156, -0.35034048557281494, 0.14136019349098206, -0.008231274783611298, 0.1922365128993988, 0.13961681723594666, -0.38247981667518616, -0.40016940236091614, -0.41162794828414917, 0.340829074382782, 0.40026944875717163, 0.31166720390319824, -0.12374480813741684, 0.0672394335269928, -0.02332191914319992, 0.1256345957517624, 0.10873913019895554, -0.1428324431180954, -0.06112433969974518, 0.17498759925365448, -0.12551699578762054, -0.15321676433086395, -0.05656486004590988, -0.004041247069835663, 0.13891679048538208, 0.20986081659793854, -0.18463411927223206, -0.16782702505588531, -0.11064759641885757, 0.038196563720703125, -0.06128263100981712, 0.06848078221082687, 0.24064597487449646, 0.3027559518814087, -0.05715964734554291, 0.12208826839923859, 0.021230190992355347, 0.12962029874324799, 0.13382427394390106, 0.022612031549215317, 0.39657437801361084, 0.5085669159889221, -0.1002095565199852, 0.3910863995552063, 0.24989180266857147, -0.07083787769079208, 0.230884850025177, -0.1695622056722641, 0.09926488250494003, -0.352773517370224, -0.004057720303535461, -0.36642181873321533, -0.010527580976486206, -0.2527809739112854, 0.07132593542337418, -0.10919643193483353, -0.2507702112197876, -0.17160090804100037, 0.2000034898519516, -0.11575508862733841, 0.18293341994285583, 0.16868630051612854, -0.2829810082912445, 0.16737407445907593, -0.1250602751970291, 0.08599112927913666, -0.14476144313812256, 0.11080291867256165, 0.006209779530763626, 0.11578027904033661, 0.17521369457244873, -0.296613872051239, -0.5790890455245972, -0.24862296879291534, -0.3484848737716675, 0.11729040741920471, 0.22222943603992462, 0.4500214457511902, 0.14974313974380493, 0.06400333344936371, -0.0494411326944828, -0.25412753224372864, 0.648578941822052, -0.10319865494966507, -0.10303082317113876, 0.3723229765892029, -0.07252231985330582, -0.11121121048927307, 0.13961990177631378, -0.14510157704353333, 0.17096897959709167, -0.15030786395072937, 0.2649588882923126, -0.5285654067993164, -0.3404390215873718, -0.23627370595932007, 0.3689493238925934, -0.3333011269569397, -0.1313992440700531, -0.18258005380630493, -0.17294564843177795, -0.45723846554756165, -0.3678392171859741, 0.08547037839889526, 0.008888639509677887, 0.11494182050228119, -0.2592061161994934, -0.23891982436180115, -0.24168555438518524, -0.028985247015953064, -0.013407960534095764, 0.4855699837207794, 0.027602296322584152, -0.007120534777641296, -0.06414498388767242, 0.16069047152996063, 0.3201756775379181, 0.5025264620780945, 0.04479570314288139, -0.3136734366416931, -0.2173345983028412, 0.05099746212363243, 0.09285204857587814, -0.019662775099277496, -0.22609162330627441, 0.2014031708240509, -0.10576079785823822, 0.015545985661447048, -0.19261306524276733, -0.3079650402069092, 0.3033289611339569, -0.1428009569644928, -0.39432358741760254, -0.7692558169364929, 0.3823740482330322, 0.2553447186946869, 0.09309408068656921, 0.0399162694811821, -0.3360093832015991, -0.2708897292613983, 0.5953964591026306, 0.18909554183483124, 0.761702299118042, -0.36226654052734375, 0.255312442779541, 0.42275214195251465, -0.015599802136421204, 0.5343617796897888, -0.15387846529483795, -0.013255645520985126, -0.5221317410469055, 0.3076552152633667, -0.14918670058250427, -0.1516006588935852, 0.06547026336193085, 0.4563988447189331, -0.3554559350013733, 0.19910790026187897, -0.32521742582321167, 0.09485287219285965, -0.11383247375488281, 0.43377482891082764, -0.010948752984404564, -0.10047949850559235, -0.5052275657653809, 0.04464387148618698, -0.16346150636672974, -0.5068044662475586, -0.08797940611839294, -0.25758227705955505, 0.07629263401031494, 0.05665121227502823, -0.24250811338424683, 0.012561023235321045, -0.06390494108200073, 0.3618963658809662, -0.034979477524757385, -0.3596796989440918, 0.2293277233839035, 0.3179560601711273, -0.1662163883447647, 0.06964288651943207, -0.09013105928897858, 0.024366028606891632, 0.0223094429820776, 0.09831490367650986, -0.2155105471611023, 0.06506720930337906, 0.22223350405693054, 0.032796360552310944, -0.00022912025451660156, 0.328691303730011, -0.27960002422332764, -0.35658547282218933, 0.016574934124946594, 0.09390706568956375, 0.17154940962791443, -0.4886065423488617, -0.44455236196517944, 0.04067402333021164, -0.22374707460403442, 0.038502104580402374, 0.0900244191288948, 0.21165074408054352, -0.0914202332496643, 0.289413183927536, 0.07477839291095734, 0.020855888724327087, 0.10357493162155151, 0.05490672215819359, 0.40816742181777954, 0.14012040197849274, 0.5883319973945618, 0.302914023399353, -0.08148501813411713, -0.31566035747528076, 0.10125628113746643, 0.15888601541519165, 0.13600245118141174, 0.29779675602912903, 0.12484946101903915, 0.04402981698513031, 0.025530289858579636, 0.28147342801094055, -0.03813895210623741, 0.38405728340148926, -0.13838407397270203, -0.40392667055130005, -0.11618222296237946, 0.33679986000061035, 0.01717360131442547, 0.22754701972007751, 0.09370416402816772, -0.07211580872535706, -0.5206236243247986, -0.10870081931352615, -0.25464171171188354, 0.050180524587631226, -0.33464497327804565, 0.11843925714492798, -0.019249439239501953, 0.1610812395811081, 0.08414166420698166, 0.1422095000743866, 0.19295388460159302, -0.10430853068828583, -0.24107497930526733, -0.18424946069717407, 0.0945548415184021, 0.10948611050844193, 0.1027471125125885, 0.04579510539770126, -0.1607954353094101, -0.24946442246437073, -0.27145469188690186, -0.10746373236179352, -0.0187804214656353, 0.04825340956449509, -0.057267867028713226, 0.15761974453926086, 0.05114709958434105, -0.1335388720035553, -0.33329111337661743, 0.3106122314929962, -0.07765868306159973, 0.07505059242248535, -0.0016048476099967957, 0.5080564022064209, 0.01588420197367668, -0.1409188210964203, -0.3074001669883728, 0.22586879134178162, 0.12428851425647736, 0.0003621065989136696, 0.32449573278427124, -0.23737701773643494, 0.06281124800443649, 0.10783720016479492, 0.49790436029434204, 0.5734687447547913, -0.21244226396083832, 0.32448139786720276, -0.1139402687549591, 0.17661377787590027, -0.09759263694286346, -0.1815510094165802, 0.15418902039527893, -0.14834800362586975, 0.03780394792556763, 0.17793142795562744, 0.035408079624176025, 0.035366714000701904, -0.04185645654797554, -0.2339790165424347, 0.11210186779499054, -0.02548355795443058, 0.013472385704517365, 0.28305187821388245, 0.20003679394721985, -0.02365245297551155, -0.040956608951091766, 0.3693980872631073, 0.3018324375152588, 0.3955562114715576, 0.06436324119567871, 0.157750204205513, 0.39010822772979736, 0.3199846148490906, 0.06015480309724808, -0.3465973138809204, 0.2595159411430359, 0.3083992004394531, 0.037621449679136276, -0.054927416145801544, 0.16165834665298462, 0.09769967943429947, 0.16679681837558746, -0.04633582383394241, -0.06373061239719391, 0.19140641391277313, -0.04618252441287041, -0.2642117738723755, -0.04809010773897171, -0.2827603220939636, -0.012918859720230103, -0.06509371101856232, -0.15713977813720703, -0.12407883256673813, -0.27040013670921326, 0.13607020676136017, 0.32242417335510254, -0.3965018689632416, 0.5234096646308899, 0.0381164588034153, 0.03410458192229271, -0.4287800192832947, 0.23773838579654694, 0.13829125463962555, 0.008958681486546993, 0.10492555052042007, 0.04991678148508072, 0.2502737045288086, 0.3412764072418213, 0.055444058030843735, -0.14646926522254944, -0.09662023186683655, -0.23744401335716248, -0.2021271139383316, 0.031169552356004715, -0.0008587613701820374, -0.009433358907699585, 0.2534884512424469, 0.18277424573898315, -0.06365024298429489, -0.048595551401376724, 0.11511008441448212, -0.2168688327074051, -0.09230390936136246, 0.1087491363286972, -0.033726662397384644, -0.3315916061401367, 0.059966590255498886, -0.029746223241090775, -0.3876134753227234, -0.24945560097694397, 0.2737409174442291, 0.04778308793902397, 0.2331574559211731, 0.24257615208625793, 0.09376883506774902, -0.14096765220165253, 0.390659362077713, 0.12588973343372345, 0.26841235160827637, -0.05980867147445679, -0.06866272538900375, -0.02677479386329651, -0.13966983556747437, 0.0831039696931839, -0.28384125232696533, 0.2251664102077484, 0.2593945860862732, 0.3508862555027008, 0.38151201605796814, -0.19110456109046936, 0.16482308506965637, 0.033669330179691315, 0.31341636180877686, -0.2504309415817261, -0.14973711967468262, 0.1880291998386383, 0.38623350858688354, -0.14463737607002258, -0.47270411252975464, 0.126030832529068, 0.06725107878446579, 0.013870008289813995, -0.3856118321418762, 0.1728183776140213, -0.02630716934800148, -0.08862036466598511, 0.016174569725990295, 0.03332514315843582, 0.3665328025817871, -0.05918191000819206, -0.18966513872146606, 0.1409202367067337, -0.25568974018096924, 0.009295109659433365, 0.2383997142314911, 0.13001303374767303, 0.440981388092041, -0.11687994003295898, 0.2608547806739807, -0.21850596368312836, -0.01613479107618332, -0.3173050284385681, -0.2968668043613434, -0.42922478914260864, 0.11180972307920456, -0.13020426034927368, -0.1781458854675293, -0.07679340243339539, 0.21620535850524902, 0.03166331350803375, -0.03222046047449112, -0.12910360097885132, -0.08020426332950592, 0.11000873148441315, -0.09443454444408417, -0.22134622931480408, 0.2019648253917694, -0.15501800179481506, -0.11236578226089478, 0.07701928913593292, -0.13493837416172028, 0.13167035579681396, 0.35638564825057983, -0.12488269805908203, -0.10885381698608398, 0.15504609048366547, 0.2508070468902588, 0.09550037235021591, -0.20368899405002594, 0.08729357272386551, -0.15162275731563568, -0.16624608635902405, -0.5002856850624084, -0.27822345495224 ]
https://github.com/huggingface/datasets/issues/5756
Thanks, this appears to have fixed the issue. I've created a PR for the same change in the mnist dataset: https://huggingface.co/datasets/mnist/discussions/3/files
Calling shuffle on a IterableDataset with streaming=True, gives "ValueError: cannot reshape array"
### Describe the bug When calling shuffle on a IterableDataset with streaming=True, I get the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/administrator/Documents/Projects/huggingface/jax-diffusers-sprint-consistency-models/virtualenv/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 937, in __iter__ for key, example in ex_iterable: File "/home/administrator/Documents/Projects/huggingface/jax-diffusers-sprint-consistency-models/virtualenv/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 627, in __iter__ for x in self.ex_iterable: File "/home/administrator/Documents/Projects/huggingface/jax-diffusers-sprint-consistency-models/virtualenv/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 138, in __iter__ yield from self.generate_examples_fn(**kwargs_with_shuffled_shards) File "/home/administrator/.cache/huggingface/modules/datasets_modules/datasets/mnist/fda16c03c4ecfb13f165ba7e29cf38129ce035011519968cdaf74894ce91c9d4/mnist.py", line 111, in _generate_examples images = np.frombuffer(f.read(), dtype=np.uint8).reshape(size, 28, 28) ValueError: cannot reshape array of size 59992 into shape (60000,28,28) ``` Tested with the fashion_mnist and mnist datasets ### Steps to reproduce the bug Code to reproduce ```python from datasets import load_dataset SHUFFLE_SEED = 42 SHUFFLE_BUFFER_SIZE = 10_000 dataset = load_dataset('fashion_mnist', streaming=True).shuffle(seed=SHUFFLE_SEED, buffer_size=SHUFFLE_BUFFER_SIZE) next(iter(dataset['train'])) ``` ### Expected behavior A random item from the dataset and no error ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.0-69-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
21
Calling shuffle on a IterableDataset with streaming=True, gives "ValueError: cannot reshape array" ### Describe the bug When calling shuffle on a IterableDataset with streaming=True, I get the following error: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/administrator/Documents/Projects/huggingface/jax-diffusers-sprint-consistency-models/virtualenv/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 937, in __iter__ for key, example in ex_iterable: File "/home/administrator/Documents/Projects/huggingface/jax-diffusers-sprint-consistency-models/virtualenv/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 627, in __iter__ for x in self.ex_iterable: File "/home/administrator/Documents/Projects/huggingface/jax-diffusers-sprint-consistency-models/virtualenv/lib/python3.10/site-packages/datasets/iterable_dataset.py", line 138, in __iter__ yield from self.generate_examples_fn(**kwargs_with_shuffled_shards) File "/home/administrator/.cache/huggingface/modules/datasets_modules/datasets/mnist/fda16c03c4ecfb13f165ba7e29cf38129ce035011519968cdaf74894ce91c9d4/mnist.py", line 111, in _generate_examples images = np.frombuffer(f.read(), dtype=np.uint8).reshape(size, 28, 28) ValueError: cannot reshape array of size 59992 into shape (60000,28,28) ``` Tested with the fashion_mnist and mnist datasets ### Steps to reproduce the bug Code to reproduce ```python from datasets import load_dataset SHUFFLE_SEED = 42 SHUFFLE_BUFFER_SIZE = 10_000 dataset = load_dataset('fashion_mnist', streaming=True).shuffle(seed=SHUFFLE_SEED, buffer_size=SHUFFLE_BUFFER_SIZE) next(iter(dataset['train'])) ``` ### Expected behavior A random item from the dataset and no error ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.0-69-generic-x86_64-with-glibc2.35 - Python version: 3.10.6 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 Thanks, this appears to have fixed the issue. I've created a PR for the same change in the mnist dataset: https://huggingface.co/datasets/mnist/discussions/3/files
[ -0.08259496092796326, -0.31450343132019043, -0.025883890688419342, 0.20404884219169617, 0.3728506863117218, -0.042026594281196594, 0.23772695660591125, 0.07290518283843994, -0.3404311537742615, 0.43852028250694275, -0.14926981925964355, 0.4260514974594116, -0.1987188160419464, 0.13537105917930603, 0.03405667841434479, -0.05960190296173096, 0.1756087839603424, 0.07959835231304169, -0.37523001432418823, 0.1185186356306076, -0.08845890313386917, 0.08845102041959763, -0.529183030128479, -0.1787128746509552, -0.2130729854106903, 0.099643774330616, -0.16484805941581726, 0.13462072610855103, -0.2651793658733368, -0.10043460875749588, 0.27317488193511963, 0.26867979764938354, -0.3166874349117279, 0.44476521015167236, -0.00012067904026480392, -0.009188264608383179, 0.35694730281829834, -0.25275617837905884, -0.09871400892734528, 0.05903222784399986, -0.14910371601581573, 0.10794255137443542, -0.5688046813011169, -0.04836820065975189, -0.03634639084339142, -0.4471326172351837, -0.2033528834581375, -0.3510463833808899, 0.2434430867433548, 0.014141712337732315, 0.07300058752298355, 0.1295357197523117, 0.1852387934923172, 0.035655759274959564, 0.2462543398141861, 0.21891272068023682, -0.13993889093399048, 0.36970019340515137, 0.03247600421309471, 0.17337220907211304, 0.027425892651081085, 0.24866537749767303, -0.12126769125461578, 0.12414976954460144, 0.34374088048934937, -0.2858394384384155, -0.2311072051525116, 0.024713315069675446, 0.06504343450069427, 0.1956295371055603, 0.13964778184890747, -0.24108339846134186, -0.3111308515071869, -0.5136486291885376, 0.08698619902133942, -0.06593428552150726, 0.2474953532218933, 0.05042742192745209, 0.09691447019577026, -0.18103332817554474, -0.4562186598777771, 0.23848086595535278, -0.09297817945480347, 0.06301440298557281, 0.2456011027097702, 0.30125439167022705, -0.1903589367866516, 0.21060466766357422, 0.3320052921772003, -0.3592202067375183, 0.4008171558380127, 0.07198783755302429, -0.3716154098510742, 0.17357763648033142, -0.24172377586364746, 0.023172438144683838, -0.08551811426877975, -0.13683868944644928, 0.37570619583129883, -0.09837288409471512, 0.3280096650123596, 0.11685267835855484, 0.2592877745628357, 0.151350736618042, 0.3247142434120178, 0.197243332862854, -0.30125609040260315, 0.17101028561592102, -0.06906803697347641, 0.4022716283798218, 0.1455915868282318, -0.10431361198425293, 0.21949400007724762, -0.14528630673885345, -0.19895991683006287, 0.019597213715314865, 0.08087614178657532, 0.07637593150138855, -0.19216132164001465, -0.265843003988266, -0.4136689603328705, -0.0515773668885231, 0.22165602445602417, 0.11680731922388077, 0.11542488634586334, 0.29941171407699585, -0.3048298954963684, 0.24962010979652405, 0.08685125410556793, -0.11987230181694031, -0.20432797074317932, 0.06683837622404099, -0.185093492269516, 0.2420043647289276, 0.15189018845558167, -0.3182218074798584, 0.2656203508377075, 0.015109028667211533, 0.25342294573783875, -0.036114756017923355, -0.2004672884941101, -0.06065496429800987, 0.2191881388425827, 0.23329633474349976, 0.001994311809539795, -0.1995418667793274, 0.07038360834121704, 0.1619250774383545, 0.035132020711898804, 0.13504791259765625, -0.09873761981725693, -0.05643368139863014, 0.5244989395141602, 0.08796096593141556, -0.21921417117118835, -0.07111628353595734, -0.3435339629650116, -0.06271800398826599, 0.24253855645656586, -0.2494983822107315, 0.033349987119436264, -0.20000948011875153, -0.11442588269710541, -0.1881718933582306, 0.08783543109893799, 0.00464901328086853, 0.03756539523601532, -0.11744169145822525, -0.17677348852157593, 0.04858238250017166, 0.6138397455215454, 0.42542600631713867, -0.0066358596086502075, 0.05451701581478119, -0.16759222745895386, 0.1844654083251953, 0.1312502771615982, 0.2277052253484726, -0.4775617718696594, -0.12286553531885147, -0.02125408500432968, 0.37812864780426025, 0.13293614983558655, -0.013610396534204483, 0.08919123560190201, 0.02571433037519455, 0.11604487895965576, 0.25920426845550537, -0.3043709993362427, 0.1742747277021408, -0.29120731353759766, -0.13883906602859497, 0.0011550839990377426, 0.1506122201681137, -0.168491929769516, 0.2460649013519287, -0.004808440804481506, 0.04168073460459709, 0.29020678997039795, -0.18096405267715454, -0.01551288552582264, -0.07442990690469742, 0.3266596496105194, 0.02387816645205021, 0.16608785092830658, -0.2963159680366516, -0.06776091456413269, 0.12275126576423645, 0.025377191603183746, -0.31343013048171997, 0.10451750457286835, 0.03848686069250107, -0.32301586866378784, -0.09793826937675476, -0.2187730222940445, -0.2711823880672455, 0.11527162790298462, 0.24362702667713165, 0.2581266760826111, -0.1547662913799286, -0.1828516721725464, 0.007944822311401367, -0.49019545316696167, -0.10734131932258606, -0.5754373669624329, 0.3060741126537323, 0.1187022253870964, -0.3327285647392273, 0.1355525255203247, 0.2369144707918167, 0.12743979692459106, -0.08290089666843414, -0.15736712515354156, 0.47638139128685, 0.17327401041984558, 0.15885469317436218, -0.32763946056365967, 0.2491285502910614, -0.06905753165483475, -0.027226246893405914, -0.15854421257972717, 0.059606973081827164, 0.163380965590477, -0.0627267062664032, 0.07906948029994965, 0.6025144457817078, -0.7888028621673584, 0.1927804797887802, 0.07908482849597931, -0.039607323706150055, 0.25382691621780396, 0.2939912676811218, -0.23381780087947845, -0.2252541184425354, 0.036397501826286316, -0.3597663640975952, -0.019801869988441467, -0.15890300273895264, 0.014343708753585815, -0.11228276789188385, 0.4149532616138458, 0.10715022683143616, -0.1900109350681305, -0.11327120661735535, 0.019855182617902756, -0.02767670899629593, -0.06043881177902222, 0.5355733036994934, 0.516028106212616, 0.03398330137133598, -0.029958810657262802, 0.18345053493976593, 0.2266227900981903, -0.2702396810054779, 0.15736761689186096, 0.08062182366847992, 0.37750473618507385, 0.47525089979171753, 0.22087794542312622, -0.04605036973953247, -0.4184584617614746, -0.2102820724248886, 0.02944187819957733, 0.26313140988349915, -0.10125009715557098, -0.09091649949550629, -0.30005979537963867, -0.25425732135772705, -0.21570926904678345, -0.30344584584236145, -0.05796027183532715, -0.49647611379623413, -0.12906020879745483, 0.7706806063652039, -0.1656290590763092, 0.08158747851848602, 0.3614879250526428, 0.0834326446056366, 0.2076335996389389, 0.2569163143634796, -0.353476881980896, 0.07787340134382248, -0.10340343415737152, -0.020678112283349037, 0.13436171412467957, -0.045100703835487366, 0.08379103988409042, -0.09722047299146652, -0.060119982808828354, -0.3594452440738678, -0.03592611849308014, 0.0792464092373848, 0.001727682538330555, -0.08146495372056961, 0.3185277283191681, 0.14339521527290344, 0.04118555784225464, -0.3030509948730469, 0.3947980999946594, -0.28118330240249634, -0.1523369699716568, 0.419400691986084, 0.015462126582860947, -0.0938342809677124, -0.16994218528270721, 0.03321003541350365, -0.0743829682469368, -0.3756135106086731, 0.34639430046081543, -0.10406989604234695, -0.03310384601354599, 0.4199359118938446, 0.11438120901584625, 0.06607110798358917, -0.18476693332195282, -0.16935995221138, -0.3318648636341095, -0.3072454631328583, 0.08461828529834747, -0.0572616308927536, -0.25093284249305725, -0.02717934548854828, 0.005888305604457855, 0.17232121527194977, 0.7344805598258972, -0.019628308713436127, 0.1799880415201187, -0.108939528465271, -0.29605379700660706, -0.0700971707701683, -0.08196333050727844, 0.33246874809265137, -0.026694342494010925, 0.153738334774971, -0.18305698037147522, -0.09028124809265137, 0.007722396403551102, 0.35061532258987427, 0.13950270414352417, 0.2004658281803131, 0.40781164169311523, 0.3187566101551056, 0.5203948020935059, 0.1502998024225235, 0.17436137795448303, 0.30484217405319214, 0.007479829713702202, 0.19263531267642975, -0.2308853268623352, -0.2129741758108139, 0.41049665212631226, 0.15428683161735535, -0.3310672342777252, -0.0426819771528244, -0.05035039409995079, -0.14367994666099548, -0.07264037430286407, 0.31155115365982056, 0.23459912836551666, -0.06802579760551453, 0.050936080515384674, 0.0492292121052742, 0.1571645736694336, 0.009264759719371796, 0.12220701575279236, 0.10691698640584946, -0.15133517980575562, -0.20091190934181213, 0.007396288216114044, 0.32865166664123535, 0.03334253281354904, -0.4380003809928894, -0.4516695439815521, 0.021556727588176727, 0.06728830188512802, 0.13817039132118225, 0.9024132490158081, -0.07377791404724121, -0.13262683153152466, 0.12322998046875, 0.03542172908782959, 0.6752361059188843, -0.1943395882844925, -0.03552908077836037, 0.22549907863140106, 0.12373018264770508, -0.2761528789997101, -0.32715755701065063, -0.18962007761001587, 0.07411132752895355, 0.051504045724868774, 0.6771544814109802, -0.033637434244155884, 0.3227265477180481, -0.10563930124044418, 0.0216243676841259, 0.1282183825969696, -0.09879501163959503, -0.3753657639026642, -0.43647706508636475, -0.2440851628780365, 0.04523590952157974, 0.03148277848958969, 0.1547199934720993, -0.045876454561948776, 0.12328080832958221, -0.1296371966600418, -0.2155979424715042, -0.3204863667488098, 0.2272457480430603, 0.2859354019165039, -0.052603818476200104, 0.14357596635818481, 0.44364723563194275, 0.07694091647863388, 0.2329985350370407, 0.09230118989944458, 0.5452376008033752, -0.010708004236221313, 0.08898001909255981, 0.007171418517827988, -0.008465234190225601, 0.26242536306381226, -0.19331426918506622, -0.10870146751403809, 0.24526318907737732, 0.10334321856498718, -0.12611347436904907, -0.28272688388824463, 0.2579679489135742, -0.2667343318462372, -0.10519689321517944, -0.8208637833595276, 0.18233001232147217, 0.09293957054615021, 0.17064014077186584, 0.5169177055358887, -0.03060116246342659, 0.0023821406066417694, 0.25252771377563477, 0.018591007217764854, 0.7424542307853699, 0.018248356878757477, -0.04726957157254219, 0.5728400349617004, -0.018322370946407318, -0.11137811839580536, -0.01639055460691452, 0.4150247573852539, -0.183954656124115, -0.6450769901275635, 0.05409684032201767, -0.15397760272026062, 0.29026907682418823, 0.06918841600418091, -0.29423969984054565, 0.20550371706485748, 0.07709324359893799, 0.005730900913476944, -0.19280125200748444, -0.208636075258255, -0.6343140602111816, -0.2770611345767975, -0.45556536316871643, 0.03476905822753906, -0.03444882109761238, 0.10429070889949799, 0.21561089158058167, 0.025271780788898468, 0.0037653595209121704, 0.14390787482261658, -0.310462087392807, 0.11791414022445679, -0.03484267368912697, -0.01418046373873949, 0.05953231826424599, 0.03532005846500397, -0.06521570682525635, 0.14745266735553741, -0.13791227340698242, 0.0004269164055585861, -0.05070707947015762, 0.1994580775499344, 0.14935936033725739, 0.0042772479355335236, 0.04775676131248474, 0.18952633440494537, -0.00021697767078876495, -0.16127485036849976, -0.0784185528755188, -0.11936211585998535, 0.1516280621290207, -0.4314248561859131, -0.4562455117702484, -0.11623434722423553, 0.20361578464508057, -0.09884533286094666, -0.17924834787845612, -0.08353830873966217, -0.14981946349143982, -0.16779476404190063, 0.04977540671825409, 0.011504397727549076, -0.15888872742652893, 0.1405130922794342, -0.09128870069980621, 0.007890880107879639, -0.009773391298949718, 0.5995429158210754, 0.07472914457321167, 0.17355376482009888, 0.23477762937545776, -0.15819241106510162, -0.11711061000823975, -0.1505664885044098, 0.012402534484863281, -0.1018427163362503, -0.12259449809789658, 0.10852208733558655, -0.24324458837509155, -0.04868169128894806, 0.007482275366783142, 0.17107632756233215, 0.14103704690933228, 0.1186288446187973, -0.10981889814138412, -0.37053731083869934, -0.2900136113166809, 0.26138797402381897, 0.31526607275009155, 0.07965563982725143, -0.1846550703048706, 0.058702874928712845, -0.28544336557388306, 0.06869423389434814, -0.23092201352119446, -0.23421309888362885, 0.043607547879219055, 0.024638976901769638, -0.15001921355724335, -0.17642360925674438, -0.004181817173957825, -0.13468755781650543, 0.05096004903316498, 0.4102216958999634, -0.211910218000412, -0.04620697721838951, 0.010890990495681763, 0.06785759329795837, 0.26756083965301514, -0.032236844301223755, -0.022251248359680176, -0.08424879610538483, -0.5052781701087952, -0.21341700851917267, 0.1342182457447052, 0.07510683685541153, -0.00029379501938819885, 0.06967461109161377, 0.5354002714157104, 0.06631455570459366, 0.19084550440311432, 0.09251593053340912, -0.2776588797569275, -0.5530529022216797, -0.18392251431941986, 0.02669556811451912, 0.0023074373602867126, -0.10485108196735382, -0.2884674668312073, -0.0919593945145607, 0.16151005029678345, 0.05156487226486206, 0.40447095036506653, -0.27829980850219727, 0.11875130236148834, 0.06347410380840302, 0.6117427349090576, 0.6719402074813843, -0.06171117722988129, -0.23121896386146545, 0.34527114033699036, 0.08278126269578934, -0.11311908066272736, -0.03877865895628929, 0.11592629551887512, 0.2278345376253128, 0.002766922116279602, 0.18747825920581818, -0.13027845323085785, -0.3861338198184967, -0.40143877267837524, 0.16292275488376617, 0.255059152841568, -0.616010844707489, 0.30349066853523254, 0.22635608911514282, -0.10533393919467926, -0.09475353360176086, 0.05506347119808197, -0.0560603067278862, -0.0347139947116375, 0.3851611316204071, 0.004938652738928795, 0.5400208234786987, 0.27862221002578735, -0.08933771401643753, 0.05798131972551346, -0.37724047899246216, -0.17866051197052002, 0.668428897857666, -0.05663043260574341, 0.5872654914855957, 0.13971398770809174, 0.24484510719776154, -0.14911794662475586, 0.045767396688461304, -0.08241765946149826, -0.19987402856349945, -0.13185977935791016, 0.06693073362112045, 0.011287666857242584, -0.3401171863079071, -0.3581044375896454, -0.11212189495563507, 0.08492623269557953, 0.22132284939289093, 0.5663211345672607, -0.15935157239437103, -0.18251775205135345, -0.5462458729743958, -0.013641579076647758, 0.26997748017311096, 0.40761566162109375, -0.32689231634140015, 0.019640645012259483, 0.2215966284275055, 0.08784370124340057, 0.2930237948894501, 0.09227373450994492, 0.28402090072631836, 0.3988824486732483, 0.1748012751340866, 0.02183067426085472, -0.20728954672813416, -0.2445048987865448, 0.10737042129039764, 0.49514368176460266, 0.11773896217346191, -0.23047418892383575, 0.1273573935031891, 0.05170239508152008, -0.07808826863765717, -0.06913143396377563, 0.17642730474472046, 0.5193860530853271, -0.14913246035575867, 0.19102631509304047, -0.40640291571617126, 0.09556321054697037, 0.13335669040679932, -0.013871610164642334, -0.47841039299964905, -0.16058434545993805, -0.25634992122650146, -0.09328696131706238, 0.1542029082775116, 0.10628412663936615, 0.03963569551706314, 0.07860346138477325, 0.42781856656074524, 0.21551159024238586, -0.6003434658050537, 0.17657344043254852, -0.40260735154151917, -0.3941481113433838, -0.04513637721538544, -0.018033215776085854, 0.12971583008766174, 0.24418693780899048, 0.3353799879550934, -0.10229891538619995, 0.06983818113803864, -0.07810664176940918, 0.1151873990893364, -0.10131897032260895, 0.5116974711418152, -0.24512580037117004, -0.37309300899505615, -0.0731729194521904, -0.004165302962064743, 0.13635843992233276, -0.32082563638687134, 0.15654154121875763, 0.2012341469526291, 0.02926914393901825, 0.24324627220630646, 0.18686740100383759, -0.22299954295158386, -0.20482933521270752, -0.2742283344268799, 0.19688598811626434, 0.13974347710609436, -0.023521676659584045, -0.23851768672466278, -0.3915010094642639, -0.31029707193374634, -0.2810986638069153, 0.12014736235141754, 0.025284718722105026, 0.5747883915901184, 0.1807018220424652, -0.04535932093858719, -0.2792471945285797, 0.4331468641757965, -0.060157082974910736, -0.025365622714161873, -0.44647425413131714, 0.4245914816856384, 0.01876017451286316, 0.40149688720703125, -0.2501274347305298, -0.00580286979675293, -0.09263132512569427, 0.08474064618349075, -0.1466265618801117, -0.23659586906433105, 0.7489395141601562, -0.4202520549297333, -0.41949301958084106, 0.15452873706817627, -0.13163620233535767, 0.10206005722284317, -0.0599336214363575, -0.17730863392353058, 0.21876581013202667, 0.12749452888965607, -0.09370355308055878, 0.43570661544799805, 0.15911337733268738, -0.0647706389427185, -0.059889938682317734, -0.04373783618211746, 0.18074268102645874, 0.22837406396865845, -0.3771679699420929, 0.44758132100105286, -0.0533454492688179 ]
https://github.com/huggingface/datasets/issues/5753
Problem with the code snippet! Using global vars and functions was not a good idea with iterable datasets! If we update to: ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # now add a new column to our streaming dataset using our hack name = "new_column" column_1 = [f"new dataset 1, row {i}" for i in range(50)] new_features = original_dataset.features.copy() new_features[name] = new_features["file"] # I know that "file" has the right column type to match our new feature def add_column_fn_1(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column_1[idx]} modified_dataset_1 = original_dataset.map(add_column_fn_1, with_indices=True, features=new_features) # now create a second modified dataset using the same trick column_2 = [f"new dataset 2, row {i}" for i in range(50)] def add_column_fn_2(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column_2[idx]} modified_dataset_2 = original_dataset.map(add_column_fn_2, with_indices=True, features=new_features) interleaved_dataset = interleave_datasets([modified_dataset_1, modified_dataset_2]) for i, sample in enumerate(interleaved_dataset): print(sample["new_column"]) if i == 10: break ``` we get the correct outputs: ```python new dataset 1, row 0 new dataset 2, row 0 new dataset 1, row 1 new dataset 2, row 1 new dataset 1, row 2 new dataset 2, row 2 new dataset 1, row 3 new dataset 2, row 3 new dataset 1, row 4 new dataset 2, row 4 new dataset 1, row 5 ```
[IterableDatasets] Add column followed by interleave datasets gives bogus outputs
### Describe the bug If we add a new column to our iterable dataset using the hack described in #5752, when we then interleave datasets the new column is pinned to one value. ### Steps to reproduce the bug What we're going to do here is: 1. Load an iterable dataset in streaming mode (`original_dataset`) 2. Add a new column to this dataset using the hack in #5752 (`modified_dataset_1`) 3. Create another new dataset by adding a column with the same key but different values (`modified_dataset_2`) 4. Interleave our new datasets (`modified_dataset_1` + `modified_dataset_2`) 5. Check the value of our newly added column (`new_column`) ```python from datasets import load_dataset # load an iterable dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # now add a new column to our streaming dataset using our hack from 5752 name = "new_column" column = [f"new dataset 1, row {i}" for i in range(50)] new_features = original_dataset.features.copy() new_features[name] = new_features["file"] # I know that "file" has the right column type to match our new feature def add_column_fn(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column[idx]} modified_dataset_1 = original_dataset.map(add_column_fn, with_indices=True, features=new_features) # now create a second modified dataset using the same trick column = [f"new dataset 2, row {i}" for i in range(50)] def add_column_fn(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column[idx]} modified_dataset_2 = original_dataset.map(add_column_fn, with_indices=True, features=new_features) # interleave these datasets interleaved_dataset = interleave_datasets([modified_dataset_1, modified_dataset_2]) # now check what the value of the added column is for i, sample in enumerate(interleaved_dataset): print(sample["new_column"]) if i == 10: break ``` **Print Output:** ``` new dataset 2, row 0 new dataset 2, row 0 new dataset 2, row 1 new dataset 2, row 1 new dataset 2, row 2 new dataset 2, row 2 new dataset 2, row 3 new dataset 2, row 3 new dataset 2, row 4 new dataset 2, row 4 new dataset 2, row 5 ``` We see that we only get outputs from our second dataset. ### Expected behavior We should interleave between dataset 1 and 2 and increase in row value: ``` new dataset 1, row 0 new dataset 2, row 0 new dataset 1, row 1 new dataset 2, row 1 new dataset 1, row 2 new dataset 2, row 2 ... ``` ### Environment info - datasets version: 2.10.2.dev0 - Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.2
235
[IterableDatasets] Add column followed by interleave datasets gives bogus outputs ### Describe the bug If we add a new column to our iterable dataset using the hack described in #5752, when we then interleave datasets the new column is pinned to one value. ### Steps to reproduce the bug What we're going to do here is: 1. Load an iterable dataset in streaming mode (`original_dataset`) 2. Add a new column to this dataset using the hack in #5752 (`modified_dataset_1`) 3. Create another new dataset by adding a column with the same key but different values (`modified_dataset_2`) 4. Interleave our new datasets (`modified_dataset_1` + `modified_dataset_2`) 5. Check the value of our newly added column (`new_column`) ```python from datasets import load_dataset # load an iterable dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # now add a new column to our streaming dataset using our hack from 5752 name = "new_column" column = [f"new dataset 1, row {i}" for i in range(50)] new_features = original_dataset.features.copy() new_features[name] = new_features["file"] # I know that "file" has the right column type to match our new feature def add_column_fn(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column[idx]} modified_dataset_1 = original_dataset.map(add_column_fn, with_indices=True, features=new_features) # now create a second modified dataset using the same trick column = [f"new dataset 2, row {i}" for i in range(50)] def add_column_fn(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column[idx]} modified_dataset_2 = original_dataset.map(add_column_fn, with_indices=True, features=new_features) # interleave these datasets interleaved_dataset = interleave_datasets([modified_dataset_1, modified_dataset_2]) # now check what the value of the added column is for i, sample in enumerate(interleaved_dataset): print(sample["new_column"]) if i == 10: break ``` **Print Output:** ``` new dataset 2, row 0 new dataset 2, row 0 new dataset 2, row 1 new dataset 2, row 1 new dataset 2, row 2 new dataset 2, row 2 new dataset 2, row 3 new dataset 2, row 3 new dataset 2, row 4 new dataset 2, row 4 new dataset 2, row 5 ``` We see that we only get outputs from our second dataset. ### Expected behavior We should interleave between dataset 1 and 2 and increase in row value: ``` new dataset 1, row 0 new dataset 2, row 0 new dataset 1, row 1 new dataset 2, row 1 new dataset 1, row 2 new dataset 2, row 2 ... ``` ### Environment info - datasets version: 2.10.2.dev0 - Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.2 Problem with the code snippet! Using global vars and functions was not a good idea with iterable datasets! If we update to: ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) # now add a new column to our streaming dataset using our hack name = "new_column" column_1 = [f"new dataset 1, row {i}" for i in range(50)] new_features = original_dataset.features.copy() new_features[name] = new_features["file"] # I know that "file" has the right column type to match our new feature def add_column_fn_1(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column_1[idx]} modified_dataset_1 = original_dataset.map(add_column_fn_1, with_indices=True, features=new_features) # now create a second modified dataset using the same trick column_2 = [f"new dataset 2, row {i}" for i in range(50)] def add_column_fn_2(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column_2[idx]} modified_dataset_2 = original_dataset.map(add_column_fn_2, with_indices=True, features=new_features) interleaved_dataset = interleave_datasets([modified_dataset_1, modified_dataset_2]) for i, sample in enumerate(interleaved_dataset): print(sample["new_column"]) if i == 10: break ``` we get the correct outputs: ```python new dataset 1, row 0 new dataset 2, row 0 new dataset 1, row 1 new dataset 2, row 1 new dataset 1, row 2 new dataset 2, row 2 new dataset 1, row 3 new dataset 2, row 3 new dataset 1, row 4 new dataset 2, row 4 new dataset 1, row 5 ```
[ -0.11507052183151245, -0.17837277054786682, 0.034994907677173615, 0.11832471191883087, 0.1666976362466812, 0.13741260766983032, 0.3849218785762787, 0.18497334420681, 0.06469251215457916, 0.12903645634651184, -0.13880906999111176, 0.5539201498031616, 0.09769801795482635, 0.04437682777643204, 0.12570615112781525, 0.16578572988510132, 0.2500062584877014, 0.18717916309833527, -0.08772914856672287, -0.04860846325755119, -0.24110032618045807, 0.16790537536144257, -0.22642576694488525, -0.24605584144592285, -0.18460555374622345, 0.23187756538391113, -0.20027011632919312, -0.014971163123846054, -0.13638484477996826, -0.23453065752983093, 0.2667740285396576, 0.156965434551239, -0.20726419985294342, 0.3568747937679291, -0.00011069142783526331, -0.14485286176204681, 0.11133673787117004, 0.0020945072174072266, -0.23427832126617432, -0.04244285821914673, -0.3499907851219177, -0.28161004185676575, -0.08444257825613022, -0.10318706929683685, -0.1991073489189148, -0.3263937532901764, -0.3457653820514679, -0.5109067559242249, 0.12243957817554474, 0.1973213404417038, 0.20448359847068787, 0.22295202314853668, -0.05030667409300804, -0.05693303793668747, 0.4793325364589691, -0.12710000574588776, -0.13064460456371307, 0.1293809860944748, 0.15605929493904114, -0.059230439364910126, 0.2867259979248047, 0.3078070878982544, -0.09115052223205566, -0.05863805487751961, 0.07085283100605011, 0.2666308283805847, -0.30750149488449097, -0.37854695320129395, 0.10178112983703613, 0.22255539894104004, 0.1939665973186493, -0.23494015634059906, -0.15379920601844788, -0.2808716297149658, 0.006541434675455093, -0.4067586064338684, 0.11379726976156235, -0.024274339899420738, 0.19023384153842926, 0.03283447399735451, 0.15910907089710236, 0.06799781322479248, -0.07776767015457153, 0.15438848733901978, 0.023568667471408844, 0.1324659287929535, -0.10675275325775146, 0.23551656305789948, 0.08489932119846344, 0.0643472671508789, 0.21177658438682556, -0.20171085000038147, -0.3109005093574524, 0.2191886454820633, -0.4815405309200287, -0.20510149002075195, 0.055987656116485596, -0.10114717483520508, -0.014437280595302582, 0.09736678004264832, 0.09143174439668655, -0.069479800760746, 0.13700562715530396, 0.038866087794303894, 0.23074302077293396, 0.10367747396230698, -0.6131539344787598, 0.23878124356269836, 0.07840791344642639, 0.14440932869911194, 0.06501822173595428, -0.23293474316596985, 0.4590308368206024, -0.10368409752845764, 0.24342021346092224, -0.18960358202457428, 0.2886975407600403, -0.24700023233890533, -0.4589924216270447, 0.22441937029361725, -0.5436028242111206, -0.14150874316692352, -0.08700819313526154, 0.02585991472005844, 0.12802237272262573, 0.20214393734931946, -0.057946525514125824, 0.36013084650039673, -0.10636524856090546, -0.14364111423492432, -0.20671245455741882, 0.25363999605178833, -0.004158496856689453, 0.1500934660434723, 0.10618981719017029, -0.12815167009830475, -0.11110533773899078, 0.4763931930065155, -0.08608075231313705, -0.19711744785308838, 0.04463714361190796, -0.16560646891593933, 0.32148030400276184, 0.1019609272480011, 0.06759220361709595, 0.19907301664352417, 0.0567067451775074, -0.38908788561820984, -0.10735973715782166, -0.01672135293483734, -0.05559707060456276, -0.07452014088630676, -0.3757542669773102, 0.27859628200531006, -0.27189549803733826, -0.03160913661122322, -0.0703914538025856, 0.3800696134567261, 0.1604403555393219, -0.2011381983757019, 0.17021091282367706, -0.09997134655714035, 0.0017150938510894775, -0.15937325358390808, 0.1723719835281372, 0.21510808169841766, -0.1392686665058136, 0.044277921319007874, 0.06589753925800323, 0.013181302696466446, 0.314132422208786, 0.008403388783335686, 0.017013221979141235, 0.09635278582572937, -0.2567352056503296, -0.03151075541973114, 0.21175344288349152, 0.005356147885322571, -0.5135794878005981, 0.31628790497779846, -0.09314054250717163, 0.658153772354126, 0.24953536689281464, 0.2771870791912079, 0.34369149804115295, 0.05155174434185028, 0.17854611575603485, 0.07806307077407837, -0.18087416887283325, -0.09446562826633453, -0.434162437915802, -0.05704928934574127, 0.07289473712444305, -0.0543341338634491, 0.024130376055836678, 0.31970033049583435, 0.3980456590652466, 0.10133124887943268, 0.27142226696014404, -0.07812120020389557, 0.08882565051317215, -0.159991055727005, 0.38382086157798767, 0.06565588712692261, 0.06375138461589813, -0.1775735765695572, -0.5911886692047119, 0.11431019753217697, 0.3362649083137512, 0.11129162460565567, 0.053901709616184235, -0.24845990538597107, -0.20393113791942596, 0.02071494609117508, -0.3007526993751526, -0.3214867115020752, 0.14980590343475342, 0.2825862169265747, -0.030258014798164368, -0.17769302427768707, -0.3613787591457367, 0.48849523067474365, 0.014366112649440765, -0.18690913915634155, -0.44825536012649536, 0.30464282631874084, 0.004712672904133797, -0.0616990365087986, 0.018550090491771698, 0.3963620662689209, 0.18249058723449707, -0.13478857278823853, -0.1282753050327301, 0.4248550832271576, -0.33347180485725403, 0.3767927885055542, 0.12138454616069794, 0.4090302288532257, 0.20194552838802338, -0.11208869516849518, -0.1071302592754364, 0.03306974470615387, 0.2661037743091583, -0.05477260798215866, -0.1934603899717331, 0.20109587907791138, -0.17859187722206116, 0.15980729460716248, -0.10661566257476807, 0.10535718500614166, 0.3102130889892578, -0.0027112290263175964, -0.22170136868953705, -0.4347790479660034, -0.006803680211305618, -0.12673735618591309, -0.24982082843780518, 0.009627006947994232, -0.226258784532547, 0.46735766530036926, 0.3303694725036621, -0.01519981399178505, -0.21406212449073792, 0.046904306858778, -0.13706785440444946, -0.21667201817035675, -0.04065012186765671, 0.2874220609664917, 0.45347118377685547, 0.10465247929096222, 0.0937856137752533, 0.02472151629626751, -0.1882757842540741, -0.1132224053144455, 0.19365760684013367, 0.03736921399831772, -0.02885659970343113, 0.4230351448059082, 0.36944398283958435, -0.11722201108932495, -0.26271265745162964, -0.19402112066745758, 0.008730448782444, 0.3091784715652466, -0.31563255190849304, -0.012586571276187897, -0.04166984558105469, -0.02797038108110428, -0.28621503710746765, -0.5458133220672607, 0.2796323001384735, -0.617519199848175, -0.04835015535354614, 0.6781137585639954, -0.022932790219783783, -0.06263549625873566, -0.5362371206283569, 0.29131877422332764, -0.07708943635225296, 0.23020952939987183, -0.27525073289871216, 0.022532012313604355, -0.28397881984710693, 0.10868485271930695, 0.027722898870706558, -0.1634984314441681, 0.33936983346939087, 0.20692574977874756, -0.20676445960998535, -0.4923730492591858, -0.3654841184616089, -0.0268394835293293, -0.244633749127388, 0.40149176120758057, 0.24008049070835114, -0.17315548658370972, 0.13422891497612, -0.3583674132823944, 0.17468208074569702, 0.03615032881498337, 0.011201374232769012, 0.11108997464179993, -0.17955999076366425, -0.012960817664861679, -0.12345273792743683, -0.6080203056335449, 0.046637170016765594, -0.17284533381462097, 0.00004287809133529663, 0.030746929347515106, -0.009890122339129448, -0.1166784018278122, -0.05372017249464989, 0.057800717651844025, 0.44871649146080017, -0.12553828954696655, -0.6223165988922119, -0.13198456168174744, 0.29477831721305847, -0.21851754188537598, -0.24646109342575073, -0.033097125589847565, -0.3410356640815735, -0.04210343956947327, -0.005373392254114151, -0.3572661280632019, -0.1537148505449295, -0.37453126907348633, 0.1488899290561676, -0.1311299055814743, 0.07309029251337051, 0.0970417857170105, 0.0038075558841228485, -0.0185718834400177, -0.24765706062316895, -0.09628000110387802, 0.09493499994277954, 0.31022611260414124, 0.015891309827566147, 0.08650390803813934, 0.4175960421562195, 0.13206210732460022, 0.2889905571937561, 0.5703510046005249, 0.057008758187294006, 0.5876244306564331, -0.18860752880573273, 0.34922635555267334, -0.2981376349925995, -0.4005047380924225, 0.025794807821512222, -0.050313204526901245, -0.006650112569332123, 0.020271219313144684, -0.17589467763900757, -0.25459250807762146, 0.02031148225069046, 0.29103395342826843, 0.1447218358516693, -0.18081340193748474, 0.09273157268762589, -0.33939599990844727, 0.07766304910182953, 0.01488996297121048, -0.053888313472270966, -0.08418679237365723, -0.3034716248512268, -0.032096266746520996, 0.025417828932404518, 0.07818804681301117, -0.027301445603370667, -0.37005794048309326, -0.12872502207756042, -0.6007152795791626, 0.30719196796417236, 0.26249924302101135, 0.4974067509174347, 0.17625132203102112, -0.41214847564697266, 0.18083855509757996, 0.06400258839130402, 0.5317457914352417, -0.4278070032596588, -0.448495477437973, 0.3933315873146057, 0.2730892598628998, -0.04896324872970581, -0.33669283986091614, -0.41254156827926636, 0.25886234641075134, 0.31381189823150635, 0.424096018075943, -0.21393318474292755, 0.05831198766827583, 0.5814924240112305, 0.09688248485326767, 0.019778504967689514, -0.06299354135990143, -0.2456490844488144, -0.20598700642585754, -0.036382827907800674, -0.026403464376926422, 0.04193919897079468, 0.2627919018268585, -0.21157974004745483, -0.1420498639345169, -0.26480966806411743, -0.0025641173124313354, 0.16171479225158691, 0.33153021335601807, 0.19026115536689758, 0.27763351798057556, 0.42861247062683105, 0.08602278679609299, 0.09728798270225525, -0.14952459931373596, 0.7087001204490662, -0.029418116435408592, -0.277534544467926, 0.0851973369717598, -0.458259254693985, 0.23962074518203735, 0.20103572309017181, 0.06728382408618927, 0.35617539286613464, -0.08076950907707214, 0.13428780436515808, -0.18560665845870972, -0.0552494190633297, 0.3958561420440674, 0.009235378354787827, -0.17560416460037231, -0.5006017684936523, 0.23058122396469116, 0.08299583196640015, -0.2459123432636261, 0.4902874231338501, 0.20500768721103668, -0.18893855810165405, 0.3475918173789978, -0.007163930684328079, 0.9538326263427734, 0.1165216863155365, 0.06958022713661194, 0.35179081559181213, -0.21500349044799805, 0.3019282817840576, -0.17193639278411865, 0.26615944504737854, -0.2591265141963959, -0.6640936136245728, 0.024938620626926422, 0.0068234726786613464, -0.023307230323553085, -0.33279117941856384, -0.2501417398452759, 0.2891337275505066, -0.02557452768087387, 0.5098111629486084, -0.014509007334709167, 0.0596601665019989, -0.2372060865163803, -0.20091603696346283, 0.08741354942321777, 0.12372004985809326, 0.15056248009204865, 0.07405298948287964, 0.03898710757493973, 0.032729510217905045, 0.024674654006958008, -0.24265657365322113, -0.2694312334060669, 0.17734208703041077, 0.23541487753391266, 0.06899867951869965, -0.02628161758184433, -0.3027483820915222, -0.09499971568584442, 0.03766021877527237, 0.2493901550769806, -0.21403759717941284, 0.11415761709213257, 0.01612105220556259, 0.49994373321533203, 0.2933253049850464, 0.2112433761358261, -0.1536327302455902, 0.1802513748407364, 0.0955822765827179, -0.32882630825042725, 0.2946401536464691, 0.25330454111099243, -0.3492949903011322, -0.24501089751720428, 0.19162890315055847, 0.19842085242271423, -0.3087565302848816, -0.216415137052536, 0.243256077170372, -0.020569127053022385, -0.432489275932312, 0.09594734013080597, -0.13849130272865295, -0.25806596875190735, 0.32916516065597534, -0.41533857583999634, -0.24783927202224731, -0.23725531995296478, 0.34841158986091614, 0.06645829230546951, 0.13293108344078064, 0.27236849069595337, -0.01488061249256134, -0.10991519689559937, -0.12474851310253143, -0.2084612250328064, -0.01881493628025055, -0.08326324820518494, 0.04124310612678528, -0.29380542039871216, 0.03740735352039337, -0.07781361788511276, 0.4288550019264221, -0.02655581198632717, 0.3055509626865387, -0.04541553929448128, -0.3651732802391052, -0.004956692457199097, 0.00645778514444828, 0.11923228204250336, 0.4059540033340454, -0.12979595363140106, -0.06793184578418732, -0.17457908391952515, 0.24386264383792877, -0.338910311460495, -0.11833856999874115, 0.038168810307979584, 0.12813504040241241, 0.5043332576751709, 0.02531392313539982, 0.28146764636039734, -0.06432728469371796, 0.2472512125968933, 0.1399751603603363, 0.1389455944299698, -0.2046368569135666, -0.22406551241874695, 0.0813714936375618, -0.039024513214826584, -0.13470381498336792, -0.3146435022354126, -0.06120896339416504, -0.0318029522895813, -0.2611458897590637, 0.23451553285121918, 0.20688259601593018, -0.09269418567419052, -0.05504751205444336, -0.31958669424057007, -0.10047926753759384, -0.06447630375623703, -0.04455162584781647, -0.11444932222366333, -0.3128492832183838, -0.07518844306468964, 0.1855773776769638, -0.03552559018135071, -0.06487448513507843, -0.011738091707229614, 0.057384390383958817, 0.023740418255329132, 0.2789808511734009, 0.22354544699192047, -0.010371455922722816, 0.0009361058473587036, 0.4096442461013794, 0.22733306884765625, 0.34859898686408997, -0.10146471858024597, -0.21918673813343048, -0.03563695028424263, 0.22799192368984222, -0.15782511234283447, -0.2056553065776825, 0.05666104331612587, -0.05833751708269119, 0.2561754286289215, 0.43043750524520874, 0.3290885388851166, -0.12775687873363495, -0.015701841562986374, 0.05650866776704788, 0.048430051654577255, -0.42137494683265686, 0.17783769965171814, 0.3115517199039459, 0.01151641458272934, 0.009852815419435501, 0.0791366696357727, -0.20016241073608398, -0.0015268400311470032, 0.3522210419178009, -0.1898958683013916, -0.028835782781243324, 0.22490838170051575, -0.031371310353279114, 0.1460602879524231, -0.18277931213378906, 0.12408941984176636, -0.044644296169281006, -0.030505087226629257, 0.3646130859851837, 0.5184847712516785, 0.09748397767543793, -0.028767261654138565, 0.05062656104564667, -0.20652569830417633, -0.12937131524085999, -0.09092707931995392, -0.19317123293876648, 0.17335373163223267, -0.25032922625541687, -0.24044962227344513, -0.028214477002620697, 0.07585270702838898, 0.1747245341539383, 0.49589914083480835, 0.09419992566108704, -0.06386685371398926, -0.18127121031284332, 0.2015979290008545, 0.26046818494796753, 0.375012069940567, -0.19173043966293335, 0.1406533271074295, 0.23754099011421204, -0.11122444272041321, 0.0393444262444973, 0.10746975988149643, 0.25573602318763733, 0.2084706425666809, 0.14366881549358368, 0.3350435197353363, -0.018901798874139786, -0.2334633320569992, 0.04344239830970764, 0.2344711869955063, -0.2978450655937195, -0.13045766949653625, 0.23400351405143738, 0.16782540082931519, -0.144284188747406, 0.19188803434371948, 0.04252190142869949, 0.4315594434738159, -0.42728886008262634, 0.1824467033147812, -0.048227403312921524, -0.03188440203666687, -0.10925032198429108, -0.06992057710886002, -0.0666808933019638, -0.29945138096809387, -0.11394339799880981, -0.2320508360862732, 0.19214312732219696, -0.1739935427904129, 0.10828988254070282, 0.17428499460220337, 0.1505768597126007, 0.12405087053775787, -0.3489554822444916, -0.18436160683631897, -0.09803923964500427, -0.5525038242340088, 0.014954689890146255, -0.04614701122045517, -0.3775143027305603, -0.2979586720466614, 0.6189422607421875, -0.0685073584318161, -0.0260150209069252, 0.1333373636007309, -0.19235199689865112, 0.05478069186210632, 0.6016266942024231, -0.1836334764957428, -0.16840873658657074, 0.0861407220363617, -0.10560690611600876, -0.061066288501024246, -0.17967888712882996, 0.1571129560470581, 0.1437452733516693, 0.1437900960445404, 0.20985469222068787, -0.18448315560817719, 0.015276513993740082, -0.27224016189575195, 0.29308420419692993, 0.24626758694648743, 0.23659688234329224, -0.27296048402786255, 0.039834894239902496, -0.43975430727005005, -0.05608825758099556, -0.45615220069885254, 0.22080060839653015, -0.15774817764759064, 0.37017011642456055, 0.04224024713039398, 0.1188361868262291, -0.1847555935382843, 0.2005213052034378, 0.21992194652557373, -0.03980531916022301, -0.37555766105651855, 0.3014798164367676, -0.1203482449054718, 0.45749279856681824, -0.011367488652467728, 0.4960836172103882, 0.05444646254181862, 0.48621270060539246, -0.062466464936733246, -0.6243025660514832, 0.23676785826683044, -0.3775426745414734, -0.14760734140872955, -0.06782761216163635, 0.23881933093070984, 0.40518876910209656, -0.033747874200344086, -0.3113800287246704, -0.1925080418586731, 0.3028300702571869, -0.33238574862480164, 0.04469597339630127, 0.4465944766998291, 0.18111002445220947, 0.10696029663085938, -0.06651895493268967, 0.007537130266427994, 0.28695541620254517, -0.11575129628181458, 0.22161534428596497, -0.21066981554031372 ]
https://github.com/huggingface/datasets/issues/5752
I believe the issue resides in this line: https://github.com/huggingface/datasets/blob/7c3a9b057c476c40d157bd7a5d57f49066239df0/src/datasets/iterable_dataset.py#L1415 If we pass the **new** features of the dataset to the `.map` method we can return the features after adding a column, e.g.: ```python from datasets import load_dataset, Value original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) # now add a new column to our streaming dataset using our hack name = "new_column" column = ["some random text" for _ in range(50)] new_features = original_dataset.features.copy() new_features[name] = Value(dtype="string", id=None) # I know the correct column type for this feature def add_column_fn(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column[idx]} modified_dataset = original_dataset.map(add_column_fn, with_indices=True, features=new_features) print(modified_dataset.features.keys()) ``` **Print Output:** ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id', 'new_column']) ```
Streaming dataset looses `.feature` method after `.add_column`
### Describe the bug After appending a new column to a streaming dataset using `.add_column`, we can no longer access the list of dataset features using the `.feature` method. ### Steps to reproduce the bug ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) # now add a new column to our streaming dataset modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) print(modified_dataset.features.keys()) ``` **Print Output:** ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[1], line 8 6 # now add a new column to our streaming dataset 7 modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) ----> 8 print(modified_dataset.features.keys()) AttributeError: 'NoneType' object has no attribute 'keys' ``` We see that we get the features for the original dataset, but not the modified one with the added column. ### Expected behavior Features should be persevered after adding a new column, i.e. calling: ```python print(modified_dataset.features.keys()) ``` Should return: ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id', 'new_column']) ``` ### Environment info - `datasets` version: 2.10.2.dev0 - Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.2
133
Streaming dataset looses `.feature` method after `.add_column` ### Describe the bug After appending a new column to a streaming dataset using `.add_column`, we can no longer access the list of dataset features using the `.feature` method. ### Steps to reproduce the bug ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) # now add a new column to our streaming dataset modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) print(modified_dataset.features.keys()) ``` **Print Output:** ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[1], line 8 6 # now add a new column to our streaming dataset 7 modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) ----> 8 print(modified_dataset.features.keys()) AttributeError: 'NoneType' object has no attribute 'keys' ``` We see that we get the features for the original dataset, but not the modified one with the added column. ### Expected behavior Features should be persevered after adding a new column, i.e. calling: ```python print(modified_dataset.features.keys()) ``` Should return: ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id', 'new_column']) ``` ### Environment info - `datasets` version: 2.10.2.dev0 - Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.2 I believe the issue resides in this line: https://github.com/huggingface/datasets/blob/7c3a9b057c476c40d157bd7a5d57f49066239df0/src/datasets/iterable_dataset.py#L1415 If we pass the **new** features of the dataset to the `.map` method we can return the features after adding a column, e.g.: ```python from datasets import load_dataset, Value original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) # now add a new column to our streaming dataset using our hack name = "new_column" column = ["some random text" for _ in range(50)] new_features = original_dataset.features.copy() new_features[name] = Value(dtype="string", id=None) # I know the correct column type for this feature def add_column_fn(example, idx): if name in example: raise ValueError(f"Error when adding {name}: column {name} is already in the dataset.") return {name: column[idx]} modified_dataset = original_dataset.map(add_column_fn, with_indices=True, features=new_features) print(modified_dataset.features.keys()) ``` **Print Output:** ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id', 'new_column']) ```
[ -0.04294446483254433, -0.1640377640724182, -0.010875217616558075, -0.04881264269351959, 0.396542489528656, 0.23651453852653503, 0.3395603597164154, -0.006269645877182484, 0.15625685453414917, 0.03049561381340027, 0.10282491892576218, 0.39729106426239014, -0.19473698735237122, 0.38857021927833557, 0.10530149191617966, -0.17453278601169586, 0.06861177831888199, -0.07762394845485687, 0.15311622619628906, 0.017952613532543182, -0.1729530543088913, -0.06807991117238998, -0.3896030783653259, -0.09388025104999542, 0.08187438547611237, 0.12313230335712433, -0.06793855130672455, -0.0036869142204523087, 0.05069959908723831, -0.48485440015792847, 0.010885819792747498, -0.07512079179286957, 0.021710649132728577, 0.36222660541534424, -0.00011684137280099094, -0.043737441301345825, 0.24000301957130432, -0.05244790017604828, -0.3935064971446991, -0.054569363594055176, -0.22497957944869995, -0.3101874887943268, 0.11813639104366302, -0.17310822010040283, -0.06991265714168549, -0.26427897810935974, -0.15686292946338654, -0.49443453550338745, -0.32607972621917725, 0.34378865361213684, 0.18985119462013245, 0.28492316603660583, 0.05230361223220825, 0.002977486699819565, 0.3075835108757019, 0.1207953542470932, -0.28602004051208496, -0.13460442423820496, 0.4012124836444855, 0.0030684098601341248, 0.07893373817205429, 0.34246042370796204, -0.11549174785614014, -0.2075849026441574, 0.360342800617218, 0.03545631095767021, -0.23247206211090088, -0.21562328934669495, 0.20511208474636078, 0.06927463412284851, 0.6127398014068604, -0.045506250113248825, -0.35802704095840454, -0.21804098784923553, 0.19145217537879944, -0.3832141160964966, -0.09709249436855316, -0.04570280760526657, -0.1155320256948471, -0.15380649268627167, -0.02746732532978058, -0.36975646018981934, -0.10187947750091553, 0.07220393419265747, 0.0717618465423584, 0.08296868205070496, -0.01085507683455944, 0.12727037072181702, -0.303443968296051, -0.0031881285831332207, 0.10421769320964813, -0.22006556391716003, -0.14094406366348267, 0.13784335553646088, -0.049749955534935, 0.012322187423706055, 0.6321554780006409, -0.16026006639003754, -0.04413532838225365, 0.12907345592975616, 0.25877007842063904, -0.03293824940919876, -0.14599579572677612, -0.008805552497506142, 0.18057259917259216, 0.11709617078304291, 0.09264323860406876, 0.1683436930179596, 0.3046833872795105, 0.4462091624736786, 0.01198616623878479, -0.36437949538230896, 0.39794373512268066, 0.5049715042114258, 0.4716719686985016, -0.11686110496520996, 0.4976136386394501, -0.07770919799804688, -0.06808724999427795, 0.2508516013622284, -0.0801430344581604, -0.08320596069097519, 0.19058503210544586, 0.2767568528652191, 0.10914534330368042, 0.22838449478149414, 0.016609549522399902, 0.1997189074754715, 0.1516154557466507, -0.026913871988654137, -0.27296319603919983, -0.08194121718406677, 0.03513626754283905, -0.015134189277887344, -0.0029203370213508606, -0.29141610860824585, 0.10485412925481796, 0.1506435126066208, -0.026229359209537506, -0.05791562423110008, -0.28230050206184387, 0.05485010892152786, 0.047600239515304565, 0.047290485352277756, -0.2196430116891861, 0.07515748590230942, -0.1582215130329132, -0.10398153960704803, -0.005001530051231384, 0.040629565715789795, -0.0975804477930069, -0.4576020836830139, -0.13857035338878632, 0.24425113201141357, -0.10346762835979462, -0.0437319315969944, -0.13755011558532715, 0.3324355483055115, -0.13272660970687866, -0.2995217442512512, -0.01406395435333252, -0.04095590114593506, -0.17725586891174316, -0.2615804076194763, 0.01993129402399063, 0.31938132643699646, -0.1702902615070343, -0.10488303750753403, -0.11972896754741669, 0.10688504576683044, 0.29752904176712036, -0.14573386311531067, -0.26001787185668945, 0.013646818697452545, -0.18200623989105225, 0.01215904951095581, 0.44226038455963135, 0.12632635235786438, -0.45891809463500977, 0.07319685816764832, -0.036655113101005554, 0.5790453553199768, 0.18617257475852966, 0.21187591552734375, 0.3596543073654175, 0.06670036166906357, 0.15859074890613556, 0.1440703570842743, -0.05963907390832901, -0.05889465659856796, -0.15030819177627563, -0.19743791222572327, 0.2945214509963989, -0.15700876712799072, 0.2648351490497589, 0.5183908343315125, 0.18421928584575653, 0.068443164229393, 0.16311050951480865, -0.14015790820121765, -0.008599791675806046, 0.024581827223300934, 0.4175741672515869, 0.23613151907920837, 0.03284280002117157, -0.4240385890007019, -0.4743141233921051, 0.20343784987926483, 0.5696700811386108, -0.1775992512702942, -0.24003958702087402, -0.15824198722839355, -0.18029259145259857, 0.08240938931703568, -0.05116867274045944, -0.26648184657096863, 0.1055716872215271, 0.4022231698036194, -0.2200246900320053, 0.059659019112586975, -0.2663589417934418, 0.2990836203098297, 0.020346052944660187, -0.05523895472288132, -0.21983176469802856, 0.26164132356643677, 0.02969837374985218, -0.13754019141197205, -0.23091261088848114, 0.15399861335754395, 0.3554234504699707, 0.06082599610090256, -0.21512022614479065, 0.3668708801269531, -0.0703771710395813, 0.2620711326599121, -0.07679130136966705, 0.17887094616889954, 0.20287029445171356, 0.0444241464138031, -0.04909447580575943, 0.2555234730243683, 0.40034061670303345, -0.03752393275499344, -0.029237765818834305, 0.07833773642778397, 0.11440277099609375, 0.2430374175310135, 0.1897698938846588, 0.11795622855424881, 0.1345033198595047, 0.29861998558044434, 0.036121666431427, -0.09611980617046356, 0.00927373394370079, -0.2782067060470581, -0.430408775806427, -0.2224900722503662, -0.5562310218811035, 0.3356999158859253, 0.3892592787742615, 0.08005353808403015, -0.031477008014917374, 0.12217099964618683, -0.33332669734954834, -0.06143932789564133, 0.09277144074440002, 0.16312409937381744, 0.554912269115448, 0.1056380569934845, 0.16593585908412933, 0.0914488285779953, -0.09057499468326569, -0.1482188105583191, 0.17917707562446594, 0.1576044261455536, -0.3227056562900543, 0.2968381941318512, 0.5372189879417419, 0.07639826834201813, -0.21154463291168213, -0.20796406269073486, 0.20342940092086792, 0.17885631322860718, -0.38849106431007385, 0.04906826466321945, -0.3044781982898712, -0.029182370752096176, 0.16000811755657196, -0.3544381260871887, 0.15550848841667175, -0.5135501027107239, 0.0017377743497490883, 0.4942505657672882, -0.15448500216007233, -0.06142186000943184, -0.45285463333129883, -0.051765263080596924, 0.05363322049379349, -0.10950125753879547, -0.16403275728225708, -0.09886972606182098, 0.031091928482055664, 0.057104431092739105, -0.0658736303448677, -0.19436681270599365, 0.1928110420703888, 0.33669742941856384, -0.168959379196167, -0.6642776727676392, -0.27040573954582214, -0.1668575406074524, -0.06466670334339142, 0.44431233406066895, 0.1726524829864502, 0.0657968744635582, 0.0912049263715744, -0.1923239678144455, 0.15544582903385162, -0.14665405452251434, -0.06738746166229248, 0.31628066301345825, 0.02585161104798317, 0.09183178842067719, -0.08082247525453568, -0.5591858625411987, 0.03826933354139328, -0.4115319848060608, 0.1598125547170639, 0.05089903622865677, 0.008513195440173149, 0.005194991827011108, -0.0748295933008194, 0.027256160974502563, 0.43389028310775757, 0.21780610084533691, -0.39197805523872375, 0.013978876173496246, 0.3855355381965637, -0.16670826077461243, -0.2938353419303894, 0.03653735667467117, -0.12484821677207947, -0.058045629411935806, 0.229319766163826, -0.201259583234787, -0.2871672511100769, -0.3271057903766632, 0.5268603563308716, -0.08516914397478104, 0.051636792719364166, 0.3008687198162079, 0.07035838067531586, -0.006559982895851135, 0.011041097342967987, -0.2320723980665207, -0.15958961844444275, 0.35766005516052246, 0.10329678654670715, 0.08659522980451584, 0.4957413375377655, -0.0664089024066925, 0.4518670439720154, -0.07863443344831467, 0.10765576362609863, 0.39992207288742065, -0.2861124575138092, 0.3016723394393921, -0.2601352632045746, -0.4003087282180786, 0.03746515512466431, -0.18569323420524597, -0.031025059521198273, -0.2345762699842453, 0.023150548338890076, -0.035971544682979584, -0.12101206183433533, 0.0736134946346283, 0.03731842339038849, -0.02303975820541382, 0.08050072938203812, -0.4457574188709259, 0.44533467292785645, 0.21466147899627686, 0.28736668825149536, -0.2796328067779541, -0.2071039378643036, -0.09038703143596649, 0.14383408427238464, 0.3424589931964874, -0.06278576701879501, -0.5026840567588806, -0.21340622007846832, -0.3837181031703949, 0.25011080503463745, 0.14606750011444092, 0.5172237753868103, -0.0448702797293663, -0.4488944709300995, 0.01832389459013939, 0.11436184495687485, 0.16230225563049316, -0.33977699279785156, -0.3861129581928253, 0.16358324885368347, 0.11046308279037476, -0.042068611830472946, -0.3153128921985626, -0.3211561441421509, 0.12017956376075745, -0.11407315731048584, 0.28132596611976624, 0.0798608809709549, 0.16197925806045532, 0.21191856265068054, 0.20291870832443237, -0.026312604546546936, 0.19449838995933533, -0.1424647718667984, -0.2404468059539795, -0.05531581491231918, 0.00253266841173172, -0.13670265674591064, 0.1820472776889801, -0.26203644275665283, -0.06815758347511292, -0.05531388893723488, -0.06758587062358856, -0.0696503072977066, 0.07456674426794052, 0.07705076038837433, -0.001572776585817337, 0.09720909595489502, -0.12216724455356598, 0.08641010522842407, -0.04183153808116913, 0.45558398962020874, 0.2009911835193634, -0.38206520676612854, -0.12709689140319824, -0.13506586849689484, 0.2567472457885742, 0.17801567912101746, -0.2716193199157715, 0.5162267088890076, -0.30319029092788696, -0.03493093326687813, -0.28073596954345703, -0.09949014335870743, 0.549069881439209, -0.13565564155578613, 0.11118391156196594, -0.530128538608551, 0.20555716753005981, -0.23006793856620789, -0.23569396138191223, 0.24372214078903198, 0.009102966636419296, -0.3234157860279083, 0.28595244884490967, -0.2550353407859802, 0.6428255438804626, 0.22856873273849487, -0.14961865544319153, 0.18630817532539368, -0.4148377478122711, 0.392044335603714, 0.004991218447685242, 0.4705524444580078, -0.05570503696799278, -0.5891066789627075, -0.1286073625087738, -0.06801004707813263, 0.2778472304344177, -0.44798240065574646, -0.0033324509859085083, 0.4031735062599182, -0.3292194604873657, 0.697488009929657, 0.04399643838405609, -0.08811244368553162, -0.21286797523498535, -0.09283789247274399, -0.12558592855930328, 0.1051308736205101, -0.14566506445407867, 0.035133469849824905, 0.07128375768661499, 0.10750369727611542, -0.0487244538962841, -0.22627201676368713, -0.4063263535499573, 0.13514280319213867, 0.0823608934879303, 0.06303451955318451, -0.008202177472412586, -0.564395546913147, 0.14305318892002106, 0.28187811374664307, -0.13324782252311707, 0.02278527431190014, -0.0176914781332016, 0.06070762872695923, 0.4715890884399414, 0.4929845929145813, 0.23379817605018616, 0.04398779198527336, 0.21983951330184937, 0.14982008934020996, -0.3482174873352051, 0.5790625214576721, -0.09578147530555725, -0.2724789083003998, -0.33883047103881836, 0.0639151781797409, 0.7304449677467346, -0.268940806388855, -0.2653729021549225, 0.04168921709060669, 0.05886255204677582, -0.4973430633544922, 0.08766178786754608, -0.0005834288895130157, -0.4042360782623291, 0.23392999172210693, -0.21858267486095428, 0.11286155879497528, -0.14541400969028473, 0.36701682209968567, 0.012181544676423073, 0.21235871315002441, 0.3972856402397156, 0.04940403997898102, -0.17754654586315155, -0.05832112953066826, -0.1010759025812149, -0.06448096036911011, -0.06464098393917084, 0.043353371322155, -0.1236855611205101, 0.13138902187347412, -0.08935587853193283, 0.18320387601852417, -0.3673641085624695, 0.14087453484535217, -0.3926326036453247, -0.27763494849205017, -0.2816007435321808, 0.07031778991222382, 0.06863975524902344, 0.03273932635784149, -0.24903278052806854, -0.073527991771698, -0.08071289211511612, 0.1282660961151123, -0.2773485779762268, 0.0029840990900993347, 0.19239825010299683, 0.24593083560466766, 0.47840580344200134, 0.3187786042690277, 0.08499754965305328, -0.25868770480155945, 0.2362610101699829, -0.04266181215643883, 0.1650772988796234, -0.1563853919506073, -0.20400358736515045, 0.1306002140045166, 0.0034865867346525192, 0.07293255627155304, -0.39073997735977173, -0.21013659238815308, 0.009650235995650291, -0.06219606101512909, 0.3043612241744995, 0.22507765889167786, -0.11828888207674026, 0.3939339518547058, -0.08134940266609192, 0.003230741247534752, -0.037254270166158676, 0.2895249128341675, -0.19051188230514526, 0.05270853266119957, 0.11817945539951324, 0.15541575849056244, -0.05021931976079941, 0.018901094794273376, -0.5043707489967346, 0.021973662078380585, -0.4319765269756317, 0.3851522207260132, 0.7045163512229919, -0.2477545291185379, 0.1268800050020218, 0.11574840545654297, 0.08250726759433746, 0.23053975403308868, -0.05860127508640289, -0.07110076397657394, 0.07356350123882294, 0.20828746259212494, -0.34909847378730774, -0.46350541710853577, -0.073152557015419, 0.1943640410900116, 0.2746727168560028, 0.20327383279800415, 0.084261953830719, -0.1119736060500145, -0.08713442087173462, 0.06845226883888245, -0.1917785406112671, -0.03793715685606003, 0.31387436389923096, 0.7907088994979858, 0.2212304025888443, 0.09202520549297333, -0.07147860527038574, 0.08837194740772247, -0.05588195100426674, 0.5814517140388489, 0.31934741139411926, -0.08217328041791916, 0.48112279176712036, 0.031282760202884674, 0.12873439490795135, -0.4877724349498749, 0.15978670120239258, -0.07119488716125488, -0.1671467274427414, 0.2770216464996338, 0.1540965437889099, -0.09122641384601593, -0.0669131875038147, -0.10396257042884827, 0.05256945639848709, 0.11922074854373932, -0.09366735816001892, -0.13607896864414215, 0.4145295321941376, -0.2820952534675598, -0.1284957379102707, 0.04751436412334442, 0.06983110308647156, 0.19065074622631073, 0.2109673023223877, -0.29469794034957886, -0.13126665353775024, -0.21679715812206268, 0.047987256199121475, 0.13887368142604828, 0.5581203103065491, -0.22953301668167114, 0.06914269179105759, 0.18879464268684387, -0.00989672914147377, 0.18298934400081635, -0.010073214769363403, -0.019715478643774986, 0.03698600083589554, 0.23194481432437897, 0.38791635632514954, 0.09557072818279266, -0.21400868892669678, 0.11459260433912277, 0.21882560849189758, 0.011792583391070366, 0.24787549674510956, 0.09390848875045776, 0.13094580173492432, -0.1092328280210495, 0.5126917362213135, 0.125616192817688, 0.252881795167923, -0.5494970679283142, 0.5664134621620178, 0.05014736205339432, -0.35646718740463257, -0.17734870314598083, -0.06664051115512848, 0.05888676643371582, -0.2559624910354614, 0.11899462342262268, 0.10984053462743759, 0.19565129280090332, -0.07078339159488678, 0.0755222737789154, 0.0648036003112793, 0.05496479570865631, 0.24606169760227203, -0.3597990870475769, -0.05667239427566528, -0.11983788013458252, -0.45243749022483826, -0.01805514097213745, 0.10729178786277771, -0.41649097204208374, 0.10947710275650024, 0.2852373719215393, 0.010662049055099487, -0.16548538208007812, 0.04743834584951401, -0.32715120911598206, -0.13815413415431976, 0.3830409049987793, -0.09764138609170914, -0.4153003990650177, -0.011332057416439056, -0.03086903505027294, -0.24940747022628784, -0.19735977053642273, 0.17390887439250946, 0.0592845119535923, 0.13081175088882446, 0.15312355756759644, -0.1621418446302414, -0.13432718813419342, -0.11095143854618073, 0.26118430495262146, 0.06572113931179047, 0.1372777372598648, -0.19160546362400055, -0.11895798146724701, -0.33298054337501526, -0.17597147822380066, -0.21411117911338806, 0.05100422352552414, -0.06157314404845238, 0.697393536567688, 0.056819260120391846, 0.010104048997163773, -0.23505672812461853, 0.43083417415618896, 0.05951153486967087, -0.37016963958740234, -0.31116771697998047, 0.3389835059642792, -0.20705749094486237, 0.1300525665283203, 0.132405087351799, 0.19463348388671875, -0.16345460712909698, -0.05844103544950485, -0.019043132662773132, -0.31663626432418823, 0.4242834746837616, -0.07733213156461716, -0.36085355281829834, -0.08740665018558502, 0.2815273404121399, 0.2790995240211487, -0.18314339220523834, -0.415068119764328, -0.3253798484802246, 0.4549385905265808, -0.23747578263282776, -0.06250534951686859, 0.2244456261396408, -0.052739910781383514, 0.05797511339187622, -0.08822129666805267, 0.06228562071919441, -0.03907711058855057, 0.026961922645568848, 0.22021745145320892, -0.07081492245197296 ]
https://github.com/huggingface/datasets/issues/5752
It seems that map will also cause this issue ### Steps to reproduce the bug ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) def test(data): return data modified_dataset = original_dataset.map(test) print(modified_dataset.features.keys()) ``` ### Output ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[5], line 10 7 return data 9 modified_dataset = original_dataset.map(test) ---> 10 print(modified_dataset.features.keys()) AttributeError: 'NoneType' object has no attribute 'keys' ```
Streaming dataset looses `.feature` method after `.add_column`
### Describe the bug After appending a new column to a streaming dataset using `.add_column`, we can no longer access the list of dataset features using the `.feature` method. ### Steps to reproduce the bug ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) # now add a new column to our streaming dataset modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) print(modified_dataset.features.keys()) ``` **Print Output:** ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[1], line 8 6 # now add a new column to our streaming dataset 7 modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) ----> 8 print(modified_dataset.features.keys()) AttributeError: 'NoneType' object has no attribute 'keys' ``` We see that we get the features for the original dataset, but not the modified one with the added column. ### Expected behavior Features should be persevered after adding a new column, i.e. calling: ```python print(modified_dataset.features.keys()) ``` Should return: ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id', 'new_column']) ``` ### Environment info - `datasets` version: 2.10.2.dev0 - Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.2
74
Streaming dataset looses `.feature` method after `.add_column` ### Describe the bug After appending a new column to a streaming dataset using `.add_column`, we can no longer access the list of dataset features using the `.feature` method. ### Steps to reproduce the bug ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) # now add a new column to our streaming dataset modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) print(modified_dataset.features.keys()) ``` **Print Output:** ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[1], line 8 6 # now add a new column to our streaming dataset 7 modified_dataset = original_dataset.add_column("new_column", ["some random text" for _ in range(50)]) ----> 8 print(modified_dataset.features.keys()) AttributeError: 'NoneType' object has no attribute 'keys' ``` We see that we get the features for the original dataset, but not the modified one with the added column. ### Expected behavior Features should be persevered after adding a new column, i.e. calling: ```python print(modified_dataset.features.keys()) ``` Should return: ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id', 'new_column']) ``` ### Environment info - `datasets` version: 2.10.2.dev0 - Platform: Linux-4.19.0-23-cloud-amd64-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.3 - PyArrow version: 10.0.1 - Pandas version: 1.5.2 It seems that map will also cause this issue ### Steps to reproduce the bug ```python from datasets import load_dataset original_dataset = load_dataset("librispeech_asr", "clean", split="validation", streaming=True) print(original_dataset.features.keys()) def test(data): return data modified_dataset = original_dataset.map(test) print(modified_dataset.features.keys()) ``` ### Output ``` dict_keys(['file', 'audio', 'text', 'speaker_id', 'chapter_id', 'id']) --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[5], line 10 7 return data 9 modified_dataset = original_dataset.map(test) ---> 10 print(modified_dataset.features.keys()) AttributeError: 'NoneType' object has no attribute 'keys' ```
[ -0.04294446483254433, -0.1640377640724182, -0.010875217616558075, -0.04881264269351959, 0.396542489528656, 0.23651453852653503, 0.3395603597164154, -0.006269645877182484, 0.15625685453414917, 0.03049561381340027, 0.10282491892576218, 0.39729106426239014, -0.19473698735237122, 0.38857021927833557, 0.10530149191617966, -0.17453278601169586, 0.06861177831888199, -0.07762394845485687, 0.15311622619628906, 0.017952613532543182, -0.1729530543088913, -0.06807991117238998, -0.3896030783653259, -0.09388025104999542, 0.08187438547611237, 0.12313230335712433, -0.06793855130672455, -0.0036869142204523087, 0.05069959908723831, -0.48485440015792847, 0.010885819792747498, -0.07512079179286957, 0.021710649132728577, 0.36222660541534424, -0.00011684137280099094, -0.043737441301345825, 0.24000301957130432, -0.05244790017604828, -0.3935064971446991, -0.054569363594055176, -0.22497957944869995, -0.3101874887943268, 0.11813639104366302, -0.17310822010040283, -0.06991265714168549, -0.26427897810935974, -0.15686292946338654, -0.49443453550338745, -0.32607972621917725, 0.34378865361213684, 0.18985119462013245, 0.28492316603660583, 0.05230361223220825, 0.002977486699819565, 0.3075835108757019, 0.1207953542470932, -0.28602004051208496, -0.13460442423820496, 0.4012124836444855, 0.0030684098601341248, 0.07893373817205429, 0.34246042370796204, -0.11549174785614014, -0.2075849026441574, 0.360342800617218, 0.03545631095767021, -0.23247206211090088, -0.21562328934669495, 0.20511208474636078, 0.06927463412284851, 0.6127398014068604, -0.045506250113248825, -0.35802704095840454, -0.21804098784923553, 0.19145217537879944, -0.3832141160964966, -0.09709249436855316, -0.04570280760526657, -0.1155320256948471, -0.15380649268627167, -0.02746732532978058, -0.36975646018981934, -0.10187947750091553, 0.07220393419265747, 0.0717618465423584, 0.08296868205070496, -0.01085507683455944, 0.12727037072181702, -0.303443968296051, -0.0031881285831332207, 0.10421769320964813, -0.22006556391716003, -0.14094406366348267, 0.13784335553646088, -0.049749955534935, 0.012322187423706055, 0.6321554780006409, -0.16026006639003754, -0.04413532838225365, 0.12907345592975616, 0.25877007842063904, -0.03293824940919876, -0.14599579572677612, -0.008805552497506142, 0.18057259917259216, 0.11709617078304291, 0.09264323860406876, 0.1683436930179596, 0.3046833872795105, 0.4462091624736786, 0.01198616623878479, -0.36437949538230896, 0.39794373512268066, 0.5049715042114258, 0.4716719686985016, -0.11686110496520996, 0.4976136386394501, -0.07770919799804688, -0.06808724999427795, 0.2508516013622284, -0.0801430344581604, -0.08320596069097519, 0.19058503210544586, 0.2767568528652191, 0.10914534330368042, 0.22838449478149414, 0.016609549522399902, 0.1997189074754715, 0.1516154557466507, -0.026913871988654137, -0.27296319603919983, -0.08194121718406677, 0.03513626754283905, -0.015134189277887344, -0.0029203370213508606, -0.29141610860824585, 0.10485412925481796, 0.1506435126066208, -0.026229359209537506, -0.05791562423110008, -0.28230050206184387, 0.05485010892152786, 0.047600239515304565, 0.047290485352277756, -0.2196430116891861, 0.07515748590230942, -0.1582215130329132, -0.10398153960704803, -0.005001530051231384, 0.040629565715789795, -0.0975804477930069, -0.4576020836830139, -0.13857035338878632, 0.24425113201141357, -0.10346762835979462, -0.0437319315969944, -0.13755011558532715, 0.3324355483055115, -0.13272660970687866, -0.2995217442512512, -0.01406395435333252, -0.04095590114593506, -0.17725586891174316, -0.2615804076194763, 0.01993129402399063, 0.31938132643699646, -0.1702902615070343, -0.10488303750753403, -0.11972896754741669, 0.10688504576683044, 0.29752904176712036, -0.14573386311531067, -0.26001787185668945, 0.013646818697452545, -0.18200623989105225, 0.01215904951095581, 0.44226038455963135, 0.12632635235786438, -0.45891809463500977, 0.07319685816764832, -0.036655113101005554, 0.5790453553199768, 0.18617257475852966, 0.21187591552734375, 0.3596543073654175, 0.06670036166906357, 0.15859074890613556, 0.1440703570842743, -0.05963907390832901, -0.05889465659856796, -0.15030819177627563, -0.19743791222572327, 0.2945214509963989, -0.15700876712799072, 0.2648351490497589, 0.5183908343315125, 0.18421928584575653, 0.068443164229393, 0.16311050951480865, -0.14015790820121765, -0.008599791675806046, 0.024581827223300934, 0.4175741672515869, 0.23613151907920837, 0.03284280002117157, -0.4240385890007019, -0.4743141233921051, 0.20343784987926483, 0.5696700811386108, -0.1775992512702942, -0.24003958702087402, -0.15824198722839355, -0.18029259145259857, 0.08240938931703568, -0.05116867274045944, -0.26648184657096863, 0.1055716872215271, 0.4022231698036194, -0.2200246900320053, 0.059659019112586975, -0.2663589417934418, 0.2990836203098297, 0.020346052944660187, -0.05523895472288132, -0.21983176469802856, 0.26164132356643677, 0.02969837374985218, -0.13754019141197205, -0.23091261088848114, 0.15399861335754395, 0.3554234504699707, 0.06082599610090256, -0.21512022614479065, 0.3668708801269531, -0.0703771710395813, 0.2620711326599121, -0.07679130136966705, 0.17887094616889954, 0.20287029445171356, 0.0444241464138031, -0.04909447580575943, 0.2555234730243683, 0.40034061670303345, -0.03752393275499344, -0.029237765818834305, 0.07833773642778397, 0.11440277099609375, 0.2430374175310135, 0.1897698938846588, 0.11795622855424881, 0.1345033198595047, 0.29861998558044434, 0.036121666431427, -0.09611980617046356, 0.00927373394370079, -0.2782067060470581, -0.430408775806427, -0.2224900722503662, -0.5562310218811035, 0.3356999158859253, 0.3892592787742615, 0.08005353808403015, -0.031477008014917374, 0.12217099964618683, -0.33332669734954834, -0.06143932789564133, 0.09277144074440002, 0.16312409937381744, 0.554912269115448, 0.1056380569934845, 0.16593585908412933, 0.0914488285779953, -0.09057499468326569, -0.1482188105583191, 0.17917707562446594, 0.1576044261455536, -0.3227056562900543, 0.2968381941318512, 0.5372189879417419, 0.07639826834201813, -0.21154463291168213, -0.20796406269073486, 0.20342940092086792, 0.17885631322860718, -0.38849106431007385, 0.04906826466321945, -0.3044781982898712, -0.029182370752096176, 0.16000811755657196, -0.3544381260871887, 0.15550848841667175, -0.5135501027107239, 0.0017377743497490883, 0.4942505657672882, -0.15448500216007233, -0.06142186000943184, -0.45285463333129883, -0.051765263080596924, 0.05363322049379349, -0.10950125753879547, -0.16403275728225708, -0.09886972606182098, 0.031091928482055664, 0.057104431092739105, -0.0658736303448677, -0.19436681270599365, 0.1928110420703888, 0.33669742941856384, -0.168959379196167, -0.6642776727676392, -0.27040573954582214, -0.1668575406074524, -0.06466670334339142, 0.44431233406066895, 0.1726524829864502, 0.0657968744635582, 0.0912049263715744, -0.1923239678144455, 0.15544582903385162, -0.14665405452251434, -0.06738746166229248, 0.31628066301345825, 0.02585161104798317, 0.09183178842067719, -0.08082247525453568, -0.5591858625411987, 0.03826933354139328, -0.4115319848060608, 0.1598125547170639, 0.05089903622865677, 0.008513195440173149, 0.005194991827011108, -0.0748295933008194, 0.027256160974502563, 0.43389028310775757, 0.21780610084533691, -0.39197805523872375, 0.013978876173496246, 0.3855355381965637, -0.16670826077461243, -0.2938353419303894, 0.03653735667467117, -0.12484821677207947, -0.058045629411935806, 0.229319766163826, -0.201259583234787, -0.2871672511100769, -0.3271057903766632, 0.5268603563308716, -0.08516914397478104, 0.051636792719364166, 0.3008687198162079, 0.07035838067531586, -0.006559982895851135, 0.011041097342967987, -0.2320723980665207, -0.15958961844444275, 0.35766005516052246, 0.10329678654670715, 0.08659522980451584, 0.4957413375377655, -0.0664089024066925, 0.4518670439720154, -0.07863443344831467, 0.10765576362609863, 0.39992207288742065, -0.2861124575138092, 0.3016723394393921, -0.2601352632045746, -0.4003087282180786, 0.03746515512466431, -0.18569323420524597, -0.031025059521198273, -0.2345762699842453, 0.023150548338890076, -0.035971544682979584, -0.12101206183433533, 0.0736134946346283, 0.03731842339038849, -0.02303975820541382, 0.08050072938203812, -0.4457574188709259, 0.44533467292785645, 0.21466147899627686, 0.28736668825149536, -0.2796328067779541, -0.2071039378643036, -0.09038703143596649, 0.14383408427238464, 0.3424589931964874, -0.06278576701879501, -0.5026840567588806, -0.21340622007846832, -0.3837181031703949, 0.25011080503463745, 0.14606750011444092, 0.5172237753868103, -0.0448702797293663, -0.4488944709300995, 0.01832389459013939, 0.11436184495687485, 0.16230225563049316, -0.33977699279785156, -0.3861129581928253, 0.16358324885368347, 0.11046308279037476, -0.042068611830472946, -0.3153128921985626, -0.3211561441421509, 0.12017956376075745, -0.11407315731048584, 0.28132596611976624, 0.0798608809709549, 0.16197925806045532, 0.21191856265068054, 0.20291870832443237, -0.026312604546546936, 0.19449838995933533, -0.1424647718667984, -0.2404468059539795, -0.05531581491231918, 0.00253266841173172, -0.13670265674591064, 0.1820472776889801, -0.26203644275665283, -0.06815758347511292, -0.05531388893723488, -0.06758587062358856, -0.0696503072977066, 0.07456674426794052, 0.07705076038837433, -0.001572776585817337, 0.09720909595489502, -0.12216724455356598, 0.08641010522842407, -0.04183153808116913, 0.45558398962020874, 0.2009911835193634, -0.38206520676612854, -0.12709689140319824, -0.13506586849689484, 0.2567472457885742, 0.17801567912101746, -0.2716193199157715, 0.5162267088890076, -0.30319029092788696, -0.03493093326687813, -0.28073596954345703, -0.09949014335870743, 0.549069881439209, -0.13565564155578613, 0.11118391156196594, -0.530128538608551, 0.20555716753005981, -0.23006793856620789, -0.23569396138191223, 0.24372214078903198, 0.009102966636419296, -0.3234157860279083, 0.28595244884490967, -0.2550353407859802, 0.6428255438804626, 0.22856873273849487, -0.14961865544319153, 0.18630817532539368, -0.4148377478122711, 0.392044335603714, 0.004991218447685242, 0.4705524444580078, -0.05570503696799278, -0.5891066789627075, -0.1286073625087738, -0.06801004707813263, 0.2778472304344177, -0.44798240065574646, -0.0033324509859085083, 0.4031735062599182, -0.3292194604873657, 0.697488009929657, 0.04399643838405609, -0.08811244368553162, -0.21286797523498535, -0.09283789247274399, -0.12558592855930328, 0.1051308736205101, -0.14566506445407867, 0.035133469849824905, 0.07128375768661499, 0.10750369727611542, -0.0487244538962841, -0.22627201676368713, -0.4063263535499573, 0.13514280319213867, 0.0823608934879303, 0.06303451955318451, -0.008202177472412586, -0.564395546913147, 0.14305318892002106, 0.28187811374664307, -0.13324782252311707, 0.02278527431190014, -0.0176914781332016, 0.06070762872695923, 0.4715890884399414, 0.4929845929145813, 0.23379817605018616, 0.04398779198527336, 0.21983951330184937, 0.14982008934020996, -0.3482174873352051, 0.5790625214576721, -0.09578147530555725, -0.2724789083003998, -0.33883047103881836, 0.0639151781797409, 0.7304449677467346, -0.268940806388855, -0.2653729021549225, 0.04168921709060669, 0.05886255204677582, -0.4973430633544922, 0.08766178786754608, -0.0005834288895130157, -0.4042360782623291, 0.23392999172210693, -0.21858267486095428, 0.11286155879497528, -0.14541400969028473, 0.36701682209968567, 0.012181544676423073, 0.21235871315002441, 0.3972856402397156, 0.04940403997898102, -0.17754654586315155, -0.05832112953066826, -0.1010759025812149, -0.06448096036911011, -0.06464098393917084, 0.043353371322155, -0.1236855611205101, 0.13138902187347412, -0.08935587853193283, 0.18320387601852417, -0.3673641085624695, 0.14087453484535217, -0.3926326036453247, -0.27763494849205017, -0.2816007435321808, 0.07031778991222382, 0.06863975524902344, 0.03273932635784149, -0.24903278052806854, -0.073527991771698, -0.08071289211511612, 0.1282660961151123, -0.2773485779762268, 0.0029840990900993347, 0.19239825010299683, 0.24593083560466766, 0.47840580344200134, 0.3187786042690277, 0.08499754965305328, -0.25868770480155945, 0.2362610101699829, -0.04266181215643883, 0.1650772988796234, -0.1563853919506073, -0.20400358736515045, 0.1306002140045166, 0.0034865867346525192, 0.07293255627155304, -0.39073997735977173, -0.21013659238815308, 0.009650235995650291, -0.06219606101512909, 0.3043612241744995, 0.22507765889167786, -0.11828888207674026, 0.3939339518547058, -0.08134940266609192, 0.003230741247534752, -0.037254270166158676, 0.2895249128341675, -0.19051188230514526, 0.05270853266119957, 0.11817945539951324, 0.15541575849056244, -0.05021931976079941, 0.018901094794273376, -0.5043707489967346, 0.021973662078380585, -0.4319765269756317, 0.3851522207260132, 0.7045163512229919, -0.2477545291185379, 0.1268800050020218, 0.11574840545654297, 0.08250726759433746, 0.23053975403308868, -0.05860127508640289, -0.07110076397657394, 0.07356350123882294, 0.20828746259212494, -0.34909847378730774, -0.46350541710853577, -0.073152557015419, 0.1943640410900116, 0.2746727168560028, 0.20327383279800415, 0.084261953830719, -0.1119736060500145, -0.08713442087173462, 0.06845226883888245, -0.1917785406112671, -0.03793715685606003, 0.31387436389923096, 0.7907088994979858, 0.2212304025888443, 0.09202520549297333, -0.07147860527038574, 0.08837194740772247, -0.05588195100426674, 0.5814517140388489, 0.31934741139411926, -0.08217328041791916, 0.48112279176712036, 0.031282760202884674, 0.12873439490795135, -0.4877724349498749, 0.15978670120239258, -0.07119488716125488, -0.1671467274427414, 0.2770216464996338, 0.1540965437889099, -0.09122641384601593, -0.0669131875038147, -0.10396257042884827, 0.05256945639848709, 0.11922074854373932, -0.09366735816001892, -0.13607896864414215, 0.4145295321941376, -0.2820952534675598, -0.1284957379102707, 0.04751436412334442, 0.06983110308647156, 0.19065074622631073, 0.2109673023223877, -0.29469794034957886, -0.13126665353775024, -0.21679715812206268, 0.047987256199121475, 0.13887368142604828, 0.5581203103065491, -0.22953301668167114, 0.06914269179105759, 0.18879464268684387, -0.00989672914147377, 0.18298934400081635, -0.010073214769363403, -0.019715478643774986, 0.03698600083589554, 0.23194481432437897, 0.38791635632514954, 0.09557072818279266, -0.21400868892669678, 0.11459260433912277, 0.21882560849189758, 0.011792583391070366, 0.24787549674510956, 0.09390848875045776, 0.13094580173492432, -0.1092328280210495, 0.5126917362213135, 0.125616192817688, 0.252881795167923, -0.5494970679283142, 0.5664134621620178, 0.05014736205339432, -0.35646718740463257, -0.17734870314598083, -0.06664051115512848, 0.05888676643371582, -0.2559624910354614, 0.11899462342262268, 0.10984053462743759, 0.19565129280090332, -0.07078339159488678, 0.0755222737789154, 0.0648036003112793, 0.05496479570865631, 0.24606169760227203, -0.3597990870475769, -0.05667239427566528, -0.11983788013458252, -0.45243749022483826, -0.01805514097213745, 0.10729178786277771, -0.41649097204208374, 0.10947710275650024, 0.2852373719215393, 0.010662049055099487, -0.16548538208007812, 0.04743834584951401, -0.32715120911598206, -0.13815413415431976, 0.3830409049987793, -0.09764138609170914, -0.4153003990650177, -0.011332057416439056, -0.03086903505027294, -0.24940747022628784, -0.19735977053642273, 0.17390887439250946, 0.0592845119535923, 0.13081175088882446, 0.15312355756759644, -0.1621418446302414, -0.13432718813419342, -0.11095143854618073, 0.26118430495262146, 0.06572113931179047, 0.1372777372598648, -0.19160546362400055, -0.11895798146724701, -0.33298054337501526, -0.17597147822380066, -0.21411117911338806, 0.05100422352552414, -0.06157314404845238, 0.697393536567688, 0.056819260120391846, 0.010104048997163773, -0.23505672812461853, 0.43083417415618896, 0.05951153486967087, -0.37016963958740234, -0.31116771697998047, 0.3389835059642792, -0.20705749094486237, 0.1300525665283203, 0.132405087351799, 0.19463348388671875, -0.16345460712909698, -0.05844103544950485, -0.019043132662773132, -0.31663626432418823, 0.4242834746837616, -0.07733213156461716, -0.36085355281829834, -0.08740665018558502, 0.2815273404121399, 0.2790995240211487, -0.18314339220523834, -0.415068119764328, -0.3253798484802246, 0.4549385905265808, -0.23747578263282776, -0.06250534951686859, 0.2244456261396408, -0.052739910781383514, 0.05797511339187622, -0.08822129666805267, 0.06228562071919441, -0.03907711058855057, 0.026961922645568848, 0.22021745145320892, -0.07081492245197296 ]
https://github.com/huggingface/datasets/issues/5750
`from_generator` expects a generator function, not a generator object, so this should work: ```python from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() def gen() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request yield from query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ```
Fail to create datasets from a generator when using Google Big Query
### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0
70
Fail to create datasets from a generator when using Google Big Query ### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0 `from_generator` expects a generator function, not a generator object, so this should work: ```python from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() def gen() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request yield from query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ```
[ -0.26841217279434204, 0.10827602446079254, 0.04360625892877579, 0.32818055152893066, 0.01671903394162655, -0.0813726931810379, 0.22551752626895905, 0.16309794783592224, 0.19760994613170624, 0.24006269872188568, 0.35184764862060547, 0.274338036775589, -0.2643771469593048, 0.2300550937652588, 0.3428870141506195, -0.20855534076690674, -0.01926320418715477, -0.07478376477956772, -0.13928481936454773, -0.10591429471969604, -0.34739965200424194, 0.11567188799381256, 0.02216726541519165, 0.07272621989250183, -0.12060586363077164, -0.0463300421833992, 0.13306501507759094, 0.15731501579284668, -0.29753577709198, -0.04697571322321892, 0.049871884286403656, -0.2838200330734253, -0.15411707758903503, 0.4403350055217743, -0.00011513182107592002, 0.036042213439941406, 0.21372675895690918, 0.03587731719017029, -0.17256222665309906, -0.3084985911846161, -0.29782265424728394, -0.21408376097679138, -0.35048139095306396, -0.049443960189819336, 0.03739052265882492, -0.0036980770528316498, -0.14766287803649902, -0.21762079000473022, 0.1864614188671112, 0.38518577814102173, 0.18821460008621216, -0.00892496109008789, 0.12625986337661743, -0.21237140893936157, 0.15376299619674683, 0.15863031148910522, -0.43507203459739685, 0.15186172723770142, 0.08952021598815918, -0.18866878747940063, 0.2015470713376999, -0.03344032168388367, -0.13155397772789001, -0.24604365229606628, 0.3194427490234375, 0.15475669503211975, -0.3121846914291382, -0.4921205937862396, 0.27810975909233093, 0.3888868987560272, 0.48629865050315857, -0.06118021160364151, -0.420131117105484, -0.3308904767036438, 0.007125701755285263, -0.16750109195709229, 0.33194631338119507, 0.3653113543987274, -0.019645899534225464, 0.1323520541191101, -0.2800753712654114, -0.3620506823062897, -0.0975610688328743, -0.17548868060112, 0.058899275958538055, -0.16868259012699127, 0.07935366034507751, 0.12813186645507812, 0.12443700432777405, -0.0698079913854599, 0.04086242616176605, -0.26197680830955505, -0.03263504058122635, 0.06634779274463654, -0.41154739260673523, -0.013278268277645111, 0.3942435681819916, 0.2512750029563904, 0.41715502738952637, 0.24806715548038483, 0.2263081967830658, -0.25817957520484924, 0.060876790434122086, 0.19056753814220428, -0.03866954892873764, -0.06965124607086182, 0.019868947565555573, 0.16713297367095947, 0.24882009625434875, -0.09358091652393341, 0.19209326803684235, 0.10928098857402802, -0.01642473042011261, -0.4777364432811737, 0.11444216966629028, 0.14461079239845276, 0.14366871118545532, 0.08655120432376862, -0.06975968927145004, 0.31124770641326904, -0.2240874320268631, 0.0371023453772068, 0.12431187927722931, 0.2683088481426239, -0.20879080891609192, -0.21385495364665985, -0.11797982454299927, 0.32721561193466187, -0.29954832792282104, -0.394703209400177, -0.14645083248615265, 0.08888879418373108, 0.12481144070625305, 0.07100233435630798, 0.09472279250621796, -0.307871013879776, 0.19412179291248322, 0.14958038926124573, -0.008318543434143066, -0.14611691236495972, 0.26713263988494873, -0.1759188175201416, 0.03914918377995491, 0.2581535875797272, -0.00476469099521637, 0.04644540697336197, 0.10443392395973206, -0.19719988107681274, -0.127323716878891, 0.1934395581483841, 0.00408075749874115, -0.46817317605018616, -0.21449629962444305, 0.11992676556110382, -0.11181828379631042, 0.18590962886810303, -0.3112032413482666, 0.09588900953531265, 0.6063661575317383, 0.1841018795967102, -0.2024017572402954, -0.2654416561126709, -0.2807331085205078, -0.26958250999450684, 0.2500123381614685, 0.6533623933792114, -0.5524056553840637, 0.06946761906147003, -0.15514600276947021, 0.07759883999824524, 0.12812083959579468, 0.08468997478485107, -0.05127604678273201, 0.328865647315979, -0.2103564292192459, -0.3339797854423523, 0.25398552417755127, 0.33440887928009033, -0.5964542627334595, 0.07709794491529465, -0.11826029419898987, 0.05772321671247482, 0.20493191480636597, 0.11533038318157196, -0.1752099245786667, 0.016941729933023453, 0.31831100583076477, 0.33188366889953613, -0.25538215041160583, 0.1112484410405159, -0.14414839446544647, -0.10089446604251862, -0.019254550337791443, 0.07247966527938843, 0.22638466954231262, 0.3360354006290436, 0.058436620980501175, -0.5295654535293579, -0.08235175907611847, -0.07452358305454254, 0.10277049988508224, 0.16853021085262299, 0.3658631443977356, -0.4619058072566986, 0.1548333466053009, 0.38877221941947937, -0.48721471428871155, 0.42343586683273315, -0.41033825278282166, 0.25277918577194214, -0.1929413378238678, 0.09574169665575027, -0.2773061692714691, 0.11666247248649597, -0.29231002926826477, 0.02448384091258049, -0.06840591132640839, -0.041896842420101166, 0.31661200523376465, -0.1292436718940735, -0.09540357440710068, 0.09004499018192291, -0.2020496129989624, -0.02039465866982937, -0.6634653210639954, 0.14829958975315094, -0.15084628760814667, -0.16125772893428802, 0.2521136701107025, -0.13698835670948029, 0.06186312809586525, 0.012780293822288513, -0.08656083047389984, 0.0637001320719719, -0.0076635535806417465, 0.0355699397623539, -0.1342390775680542, 0.2649378180503845, 0.12396059930324554, -0.05283987149596214, 0.1420585960149765, -0.14694270491600037, 0.0038019493222236633, 0.061630964279174805, 0.05999184399843216, 0.2198023498058319, -0.047981224954128265, 0.09601608663797379, -0.27084606885910034, 0.14004206657409668, 0.11524398624897003, 0.050832852721214294, 0.2640710175037384, -0.11252599209547043, 0.11039707064628601, 0.348181813955307, 0.10355585813522339, 0.019410988315939903, -0.32240161299705505, 0.23261040449142456, 0.29515689611434937, 0.14386603236198425, 0.15308335423469543, 0.12497720867395401, -0.007249161601066589, -0.21218827366828918, -0.1796770542860031, 0.1755792200565338, 0.3055579960346222, -0.06961310654878616, -0.10560325533151627, -0.01578800566494465, 0.09522999823093414, -0.2688535153865814, 0.11608847975730896, -0.13955149054527283, 0.011051177978515625, 0.10741502046585083, 0.20488190650939941, -0.18355348706245422, 0.004970468580722809, 0.01839686930179596, 0.3852465748786926, 0.3343759775161743, -0.349030077457428, 0.21709400415420532, 0.01162305474281311, 0.14768433570861816, 0.10885141044855118, 0.23043929040431976, -0.23691265285015106, -0.2143934667110443, 0.06679152697324753, 0.28804895281791687, -0.11640951037406921, -0.05735091120004654, 0.09842075407505035, 0.22040539979934692, 0.40359610319137573, -0.2824563980102539, -0.2255156934261322, -0.21628153324127197, -0.2248946726322174, 0.11425396054983139, 0.16786836087703705, -0.4866877794265747, 0.3394526243209839, -0.14098888635635376, -0.25897470116615295, -0.4764064848423004, 0.050296440720558167, 0.21549992263317108, -0.21008579432964325, 0.8118581175804138, 0.3103955388069153, -0.0006517581641674042, -0.12861239910125732, 0.21277356147766113, 0.1320147067308426, -0.06675847619771957, -0.16076380014419556, 0.1878732293844223, -0.12832395732402802, 0.07088010758161545, 0.04333077371120453, -0.32596608996391296, -0.21343117952346802, -0.143744558095932, 0.12123420834541321, 0.23585030436515808, 0.3894057273864746, 0.10611473023891449, 0.22955548763275146, -0.2032124549150467, 0.17142662405967712, -0.06885358691215515, -0.18470852077007294, -0.5132302045822144, 0.43059852719306946, -0.4412522614002228, -0.36746400594711304, 0.06541797518730164, -0.24228455126285553, 0.028823118656873703, 0.06516170501708984, -0.2602306604385376, 0.17386238276958466, -0.16198773682117462, 0.3479617238044739, -0.011920238845050335, 0.0810503214597702, -0.06769169867038727, 0.01298120990395546, 0.10590040683746338, -0.2141769528388977, -0.17081290483474731, 0.17067274451255798, 0.38281726837158203, 0.44061923027038574, 0.31807100772857666, 0.3444842994213104, -0.23299866914749146, 0.7658070921897888, 0.3719639182090759, -0.06053539738059044, 0.13895966112613678, -0.04589644819498062, 0.07359831035137177, -0.3545542359352112, -0.2217809110879898, 0.2118377983570099, 0.21202029287815094, -0.29878538846969604, -0.03175422176718712, 0.04148991405963898, 0.20561756193637848, -0.093449667096138, 0.24513323605060577, -0.06904482841491699, -0.23121652007102966, -0.06239697337150574, -0.3764740824699402, 0.07747012376785278, 0.03153233975172043, 0.1326058804988861, -0.25228220224380493, 0.1526898890733719, 0.005450736731290817, -0.19888141751289368, 0.6272710561752319, 0.06713138520717621, 0.22679825127124786, -0.013788264244794846, -0.46676719188690186, 0.23574134707450867, 0.06810584664344788, 0.11698199808597565, -0.1028730496764183, 0.033874280750751495, -0.03183695301413536, 0.09134726226329803, 0.5097314119338989, -0.46592605113983154, -0.16872161626815796, 0.11757602542638779, -0.011192217469215393, 0.14280971884727478, 0.08981716632843018, 0.24112996459007263, 0.12101514637470245, -0.1458074450492859, -0.07018239051103592, -0.49336808919906616, 0.23167087137699127, -0.12718217074871063, 0.41651177406311035, -0.1607932448387146, -0.12620976567268372, -0.26082202792167664, -0.39706385135650635, 0.03484019637107849, -0.004045985639095306, -0.02696489915251732, 0.16026893258094788, -0.3713127374649048, 0.153600811958313, 0.17208170890808105, -0.011843360960483551, -0.0653458833694458, 0.016873706132173538, 0.30208587646484375, -0.4896116852760315, 0.5376839637756348, 0.10482210665941238, -0.18802206218242645, 0.2970212996006012, 0.7528093457221985, 0.20117923617362976, -0.02302069589495659, 0.2992798388004303, 0.08590966463088989, 0.08340805023908615, -0.05483432114124298, -0.2549171447753906, 0.1908649355173111, 0.2531181871891022, 0.1669066846370697, 0.10291394591331482, -0.10385365039110184, -0.02731546200811863, -0.28096500039100647, -0.2853456735610962, -0.6767370700836182, 0.704935610294342, 0.11403732001781464, 0.060960665345191956, 0.4685851037502289, -0.12010771036148071, -0.10772879421710968, 0.140447735786438, -0.07878506183624268, 0.5705550909042358, -0.09277786314487457, -0.2880522906780243, 0.16622184216976166, 0.11998995393514633, 0.7459689974784851, 0.057332441210746765, 0.24355880916118622, -0.758234977722168, -0.10664147138595581, 0.028973452746868134, -0.3632756471633911, 0.051187288016080856, 0.07467947900295258, -0.16512088477611542, 0.1874057948589325, -0.36320966482162476, 0.062417492270469666, -0.030880291014909744, 0.20721149444580078, -0.40300291776657104, -0.16169613599777222, 0.0939972847700119, 0.10238988697528839, -0.09180180728435516, 0.3671146333217621, 0.034269947558641434, -0.02275647222995758, -0.21421970427036285, -0.2864009737968445, -0.30349084734916687, 0.2185845822095871, -0.27319401502609253, 0.08332846313714981, 0.4481663107872009, -0.556311309337616, 0.29533445835113525, 0.05245649442076683, 0.3807293474674225, 0.15134331583976746, -0.17227955162525177, 0.22769798338413239, 0.27531105279922485, 0.11220542341470718, 0.27603664994239807, 0.07357896864414215, 0.30121946334838867, 0.17208993434906006, -0.11464850604534149, 0.2754365801811218, -0.227359801530838, -0.1114303320646286, -0.3765946626663208, -0.20075616240501404, -0.20124341547489166, -0.08433057367801666, -0.005841422826051712, -0.22867007553577423, -0.12750475108623505, -0.200702503323555, 0.10081230849027634, 0.29531019926071167, 0.170731782913208, 0.16563791036605835, -0.2697628140449524, -0.01149442046880722, -0.1783420443534851, 0.12429250776767731, 0.1820887327194214, 0.04929928481578827, 0.27618345618247986, 0.2554405927658081, -0.061289239674806595, -0.1771586537361145, -0.15877297520637512, 0.0474710687994957, -0.10450239479541779, 0.3043658435344696, 0.1979343295097351, 0.226573646068573, 0.238682821393013, 0.12807480990886688, -0.16448909044265747, -0.05926789715886116, 0.07836821675300598, -0.04772082716226578, -0.11048192530870438, 0.08357246220111847, -0.17664706707000732, 0.049468014389276505, -0.009041383862495422, -0.08542191982269287, -0.13032498955726624, 0.1198229119181633, -0.2455361932516098, -0.3942016661167145, -0.23563185334205627, -0.13834187388420105, 0.08769538998603821, 0.06446540355682373, -0.22504320740699768, -0.0792752355337143, 0.017063580453395844, -0.006220178212970495, -0.0833171159029007, -0.12962652742862701, -0.12077101320028305, 0.13592413067817688, 0.2916267216205597, -0.06723107397556305, -0.16297848522663116, -0.13078907132148743, -0.26710236072540283, -0.08864158391952515, 0.5163390636444092, 0.1527378112077713, -0.24167634546756744, -0.3471578061580658, -0.15404675900936127, 0.013772007077932358, -0.22681134939193726, 0.018398970365524292, -0.2681179344654083, 0.0065155550837516785, 0.0817234069108963, 0.11391206085681915, 0.09370990842580795, -0.13780680298805237, -0.17830337584018707, 0.08153009414672852, -0.16129423677921295, -0.028197262436151505, 0.6690255403518677, -0.42837539315223694, -0.09436417371034622, -0.10193300992250443, 0.13365483283996582, 0.2959330677986145, -0.06048718839883804, -0.09443266689777374, 0.23582930862903595, 0.16475218534469604, -0.2281491458415985, -0.0986979752779007, -0.2023916244506836, 0.15777722001075745, 0.0658469870686531, 0.1847643405199051, 0.20397299528121948, -0.15903083980083466, -0.6321186423301697, 0.11616183817386627, 0.31825825572013855, -0.2565937042236328, 0.05286172032356262, 0.4126233458518982, 0.04285068064928055, 0.12880131602287292, 0.3647395074367523, 0.10349023342132568, 0.21020303666591644, 0.29463714361190796, 0.03496275097131729, 0.23464062809944153, 0.05532125383615494, 0.05715266987681389, 0.12270522117614746, -0.6722779273986816, -0.021712729707360268, -0.07747180759906769, -0.16685549914836884, 0.07868674397468567, -0.08746708929538727, 0.18622469902038574, -0.2680511474609375, 0.3351898491382599, -0.4920234680175781, 0.40062057971954346, 0.13535243272781372, 0.13510139286518097, -0.48617473244667053, -0.2950766086578369, 0.15461856126785278, -0.023874953389167786, 0.1420026421546936, -0.10692903399467468, 0.33304154872894287, 0.13584794104099274, -0.0882464349269867, -0.068021759390831, 0.12595556676387787, 0.005116516724228859, 0.06419969350099564, -0.32937586307525635, -0.07373721152544022, 0.06552910804748535, -0.15059193968772888, -0.2814445197582245, 0.23995554447174072, 0.38490286469459534, 0.3963138461112976, -0.06407342851161957, -0.16814479231834412, 0.016923435032367706, -0.012123048305511475, -0.057088106870651245, 0.3217273950576782, -0.15622887015342712, -0.28835320472717285, 0.20144522190093994, -0.01660213991999626, 0.027382347732782364, -0.1209997907280922, 0.24251113831996918, 0.6676934361457825, 0.04407360404729843, -0.030768699944019318, -0.3116392195224762, -0.14169304072856903, -0.03812774270772934, 0.037925660610198975, -0.07444190979003906, -0.19606027007102966, 0.5283253788948059, 0.2707340717315674, 0.17771700024604797, -0.17835816740989685, 0.04003936052322388, 0.004599446430802345, 0.33589696884155273, 0.23786738514900208, 0.14141570031642914, -0.4085783064365387, 0.30447918176651, -0.13554216921329498, -0.06522679328918457, -0.14478103816509247, 0.33427441120147705, -0.026376018300652504, 0.10932192951440811, 0.10224063694477081, 0.00820029154419899, -0.3583126664161682, 0.4258342385292053, -0.05581899359822273, 0.46785908937454224, -0.16634601354599, -0.43679141998291016, -0.02385571226477623, -0.06454391032457352, -0.07566262781620026, -0.39904889464378357, 0.23265528678894043, -0.49200382828712463, 0.10627716779708862, -0.3741041421890259, -0.16429856419563293, 0.4402097463607788, 0.1791749894618988, 0.41654932498931885, 0.5112780332565308, 0.2546042203903198, 0.03856869786977768, -0.17313873767852783, -0.35031187534332275, -0.2557004690170288, -0.18326467275619507, 0.11746788769960403, -0.07407723367214203, 0.3180851936340332, 0.35250920057296753, 0.10597747564315796, -0.4566735029220581, 0.18057744204998016, -0.19080206751823425, 0.28297391533851624, -0.09252817928791046, -0.23333923518657684, -0.20563527941703796, 0.08043365180492401, 0.11352971196174622, -0.07504379749298096, -0.12961432337760925, 0.20867028832435608, -0.3161386251449585, -0.2847628593444824, 0.3741770386695862, -0.025198563933372498, -0.1213931292295456, -0.24201558530330658, 0.2616393268108368, 0.2073730230331421, -0.15714465081691742, 0.09019127488136292, 0.03313535451889038, 0.23273836076259613, -0.25080353021621704, 0.23013828694820404, -0.12077246606349945, 0.165715292096138, 0.32366737723350525, 0.007426172494888306, 0.3209765553474426, -0.20821961760520935, -0.02350587025284767, -0.02028774470090866, 0.07039112597703934 ]
https://github.com/huggingface/datasets/issues/5750
@mariosasko your code was incomplete, so I tried to fix it: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() def gen(): # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request yield from query_job.result() # Waits for query to finish ds = Dataset.from_generator(gen) for r in ds: print(r) ``` The error is also present in this case: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` I think it doesn't matter if the generator is an object or a function. The problem is that the generator is referencing an object that is not pickable (the client in this case).
Fail to create datasets from a generator when using Google Big Query
### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0
128
Fail to create datasets from a generator when using Google Big Query ### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0 @mariosasko your code was incomplete, so I tried to fix it: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() def gen(): # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request yield from query_job.result() # Waits for query to finish ds = Dataset.from_generator(gen) for r in ds: print(r) ``` The error is also present in this case: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` I think it doesn't matter if the generator is an object or a function. The problem is that the generator is referencing an object that is not pickable (the client in this case).
[ -0.27556538581848145, 0.10176995396614075, 0.023528318852186203, 0.3146030604839325, 0.029008813202381134, -0.06387528777122498, 0.23672935366630554, 0.17986364662647247, 0.21328823268413544, 0.25452178716659546, 0.3336375951766968, 0.27794840931892395, -0.264303982257843, 0.24262216687202454, 0.3312777280807495, -0.18549445271492004, -0.03423631936311722, -0.056184977293014526, -0.1530255526304245, -0.10953155159950256, -0.3427812159061432, 0.11954455822706223, 0.029697909951210022, 0.0366850271821022, -0.12665221095085144, -0.061138004064559937, 0.12334994971752167, 0.15654385089874268, -0.29366952180862427, -0.07272176444530487, 0.04523863643407822, -0.2529379427433014, -0.1504426896572113, 0.4380493462085724, -0.00011323725630063564, 0.04303641617298126, 0.21478155255317688, 0.03199227154254913, -0.1884234994649887, -0.308589369058609, -0.3051917552947998, -0.22907544672489166, -0.3288697898387909, -0.05480744689702988, 0.009060613811016083, -0.019037360325455666, -0.15654218196868896, -0.20941106975078583, 0.1977754831314087, 0.3906862735748291, 0.20415754616260529, -0.028910841792821884, 0.15412311255931854, -0.19442033767700195, 0.14245113730430603, 0.12962967157363892, -0.4113200008869171, 0.18518443405628204, 0.07803474366664886, -0.164190411567688, 0.21892902255058289, -0.03834327310323715, -0.125076562166214, -0.23384200036525726, 0.2963387668132782, 0.16332590579986572, -0.28620123863220215, -0.5067287087440491, 0.26906001567840576, 0.38310855627059937, 0.4862397015094757, -0.08570612967014313, -0.4279371500015259, -0.29949450492858887, 0.019970986992120743, -0.21711516380310059, 0.3069320321083069, 0.3818768262863159, -0.01448206976056099, 0.1434784233570099, -0.2847505807876587, -0.36827611923217773, -0.12203943729400635, -0.16067814826965332, 0.07010513544082642, -0.14888478815555573, 0.07237880676984787, 0.11274514347314835, 0.11879763007164001, -0.08399917185306549, 0.04774400591850281, -0.26829227805137634, -0.021848324686288834, 0.0680292397737503, -0.4265737533569336, -0.03906606510281563, 0.3544203042984009, 0.23740625381469727, 0.4240243434906006, 0.25135689973831177, 0.22541163861751556, -0.25392746925354004, 0.08179745078086853, 0.21018192172050476, -0.06311929225921631, -0.06559494137763977, 0.01096402294933796, 0.17472784221172333, 0.24757888913154602, -0.11903077363967896, 0.18874919414520264, 0.11345397680997849, -0.02808741107583046, -0.4817648231983185, 0.10627694427967072, 0.1594371348619461, 0.15253999829292297, 0.08686085045337677, -0.07333137094974518, 0.29016292095184326, -0.22840723395347595, 0.021513238549232483, 0.12201985716819763, 0.30237096548080444, -0.22226133942604065, -0.2222306728363037, -0.11376295983791351, 0.3213862478733063, -0.28921857476234436, -0.37906894087791443, -0.16080108284950256, 0.11309676617383957, 0.12450486421585083, 0.0739237442612648, 0.1125965267419815, -0.31262871623039246, 0.20614412426948547, 0.14368820190429688, -0.005910113453865051, -0.14456380903720856, 0.2743092179298401, -0.1740540713071823, 0.027715547010302544, 0.26985645294189453, 0.01069670170545578, 0.021888695657253265, 0.10799804329872131, -0.20485404133796692, -0.13611799478530884, 0.18257418274879456, 0.0013620778918266296, -0.45836400985717773, -0.19336585700511932, 0.14321474730968475, -0.11428499221801758, 0.1628502756357193, -0.2998616099357605, 0.11472266167402267, 0.5952957272529602, 0.19621747732162476, -0.21930257976055145, -0.24441038072109222, -0.26724347472190857, -0.27984780073165894, 0.2619132399559021, 0.6497827172279358, -0.5331425666809082, 0.059352800250053406, -0.14511224627494812, 0.07119579613208771, 0.12356841564178467, 0.07945704460144043, -0.04011804610490799, 0.338375061750412, -0.2096710503101349, -0.3221450746059418, 0.26441115140914917, 0.33017224073410034, -0.582598865032196, 0.05801056697964668, -0.13269473612308502, 0.024920597672462463, 0.21022269129753113, 0.103777214884758, -0.15771915018558502, 0.026194274425506592, 0.3223581910133362, 0.3411204516887665, -0.242512509226799, 0.11267644166946411, -0.14851686358451843, -0.11525404453277588, -0.010714120231568813, 0.09104631841182709, 0.21210722625255585, 0.337124228477478, 0.06806638836860657, -0.5600000023841858, -0.06977928429841995, -0.07586848735809326, 0.0996091216802597, 0.1773410141468048, 0.3844304084777832, -0.43938925862312317, 0.1485464721918106, 0.38264861702919006, -0.48013535141944885, 0.4109521508216858, -0.3934139609336853, 0.26696595549583435, -0.18917006254196167, 0.0871647447347641, -0.2876163423061371, 0.10336867719888687, -0.2941131889820099, 0.027773473411798477, -0.046867888420820236, -0.05346635729074478, 0.34206581115722656, -0.12551960349082947, -0.09488070011138916, 0.07613120973110199, -0.22463494539260864, -0.021262943744659424, -0.6521761417388916, 0.1722515970468521, -0.1647903472185135, -0.1641993522644043, 0.2777060866355896, -0.1470012664794922, 0.060359831899404526, -0.006545979529619217, -0.08387700468301773, 0.07959569990634918, -0.002120867371559143, 0.02490188367664814, -0.10424482822418213, 0.2685460150241852, 0.11054452508687973, -0.08266162872314453, 0.144881933927536, -0.13398082554340363, 0.011133711785078049, 0.05900163948535919, 0.06652885675430298, 0.23473352193832397, -0.04527709260582924, 0.09170917421579361, -0.26298633217811584, 0.10914275050163269, 0.12852129340171814, 0.05036371201276779, 0.2545281648635864, -0.1219424307346344, 0.11314922571182251, 0.3442029654979706, 0.13143135607242584, 0.009154586121439934, -0.3112720549106598, 0.21956557035446167, 0.2707557678222656, 0.1345350742340088, 0.16831162571907043, 0.14224815368652344, -0.0020057372748851776, -0.19395871460437775, -0.1998135894536972, 0.17251935601234436, 0.32870930433273315, -0.03438517078757286, -0.14277419447898865, -0.011431973427534103, 0.11300091445446014, -0.2621605098247528, 0.13335466384887695, -0.13970407843589783, 0.03417976573109627, 0.09198082983493805, 0.22283098101615906, -0.19580744206905365, -0.014480799436569214, 0.007463462650775909, 0.38292932510375977, 0.3492293357849121, -0.32022035121917725, 0.20404794812202454, 0.004053927958011627, 0.177431121468544, 0.10191140323877335, 0.22171206772327423, -0.23663564026355743, -0.1914101541042328, 0.06695692241191864, 0.2752269506454468, -0.10035078227519989, -0.024103164672851562, 0.10434424877166748, 0.22139468789100647, 0.40398502349853516, -0.2922060787677765, -0.22352957725524902, -0.21700738370418549, -0.21063542366027832, 0.12852641940116882, 0.17301282286643982, -0.46448904275894165, 0.38386139273643494, -0.1431945562362671, -0.25952133536338806, -0.4682733714580536, 0.042649686336517334, 0.1941310167312622, -0.22096052765846252, 0.7908759713172913, 0.29659250378608704, 0.04096633940935135, -0.11663827300071716, 0.20202583074569702, 0.14226749539375305, -0.06970683485269547, -0.15980738401412964, 0.1795295625925064, -0.12301620841026306, 0.06737986207008362, 0.05641472339630127, -0.3607631325721741, -0.2472115159034729, -0.1530156433582306, 0.12223966419696808, 0.2450370192527771, 0.39488038420677185, 0.11067021638154984, 0.2455873340368271, -0.21080100536346436, 0.17194947600364685, -0.06190552935004234, -0.18821300566196442, -0.4993377923965454, 0.42008867859840393, -0.4419909715652466, -0.3726010322570801, 0.07258138060569763, -0.2479068785905838, 0.03668147698044777, 0.05653292313218117, -0.24555005133152008, 0.16404512524604797, -0.1749105602502823, 0.3524917960166931, -0.018255574628710747, 0.09734237939119339, -0.048547592014074326, 0.025986753404140472, 0.09260069578886032, -0.2035377323627472, -0.17832714319229126, 0.16859020292758942, 0.3745329678058624, 0.4412861764431, 0.3152514696121216, 0.3371140956878662, -0.26160794496536255, 0.7717674970626831, 0.3846411108970642, -0.08760149776935577, 0.13621863722801208, -0.07012756913900375, 0.07476595789194107, -0.3447207510471344, -0.2464413344860077, 0.20046471059322357, 0.20060467720031738, -0.29087841510772705, -0.026515811681747437, 0.03207315877079964, 0.19477325677871704, -0.10882727801799774, 0.2416914701461792, -0.1055670827627182, -0.23179316520690918, -0.06399733573198318, -0.3403204679489136, 0.09538276493549347, 0.028850987553596497, 0.10485568642616272, -0.250072181224823, 0.14861947298049927, -0.010942172259092331, -0.19625629484653473, 0.5955448150634766, 0.07235436886548996, 0.23231393098831177, -0.03438691794872284, -0.4650234580039978, 0.2621327042579651, 0.05889739841222763, 0.0997103899717331, -0.09267275035381317, 0.049615904688835144, -0.02721307799220085, 0.09001265466213226, 0.5191367864608765, -0.46046003699302673, -0.18442967534065247, 0.11347952485084534, -0.022025682032108307, 0.16464273631572723, 0.10824066400527954, 0.22899964451789856, 0.12921668589115143, -0.13007615506649017, -0.052050165832042694, -0.5229846239089966, 0.21917065978050232, -0.11821797490119934, 0.43408674001693726, -0.16970492899417877, -0.15822631120681763, -0.26493537425994873, -0.3914315700531006, -0.004178307950496674, -0.0025139451026916504, -0.03955177217721939, 0.17478828132152557, -0.38820579648017883, 0.13821884989738464, 0.17059491574764252, -0.018840286880731583, -0.05621788278222084, 0.023025423288345337, 0.301891028881073, -0.4639407992362976, 0.5358907580375671, 0.09571433067321777, -0.1896270364522934, 0.3198825418949127, 0.7559472918510437, 0.18866246938705444, -0.007266458123922348, 0.2891960144042969, 0.10207095742225647, 0.07751907408237457, -0.04829983413219452, -0.23873555660247803, 0.18550707399845123, 0.24918600916862488, 0.19591651856899261, 0.09320403635501862, -0.0902545303106308, -0.04024733975529671, -0.27204063534736633, -0.2981783151626587, -0.6930801272392273, 0.6996270418167114, 0.08455510437488556, 0.08532123267650604, 0.46291306614875793, -0.11003435403108597, -0.10628073662519455, 0.13891160488128662, -0.07078121602535248, 0.5949195623397827, -0.1058029755949974, -0.2851391136646271, 0.15518619120121002, 0.12671945989131927, 0.7240447998046875, 0.054938316345214844, 0.24854286015033722, -0.7658581733703613, -0.08795629441738129, 0.040099240839481354, -0.3461151719093323, 0.05915094166994095, 0.07651396840810776, -0.18695254623889923, 0.2058374136686325, -0.3504974842071533, 0.0386551097035408, -0.056630149483680725, 0.2344086468219757, -0.4043400287628174, -0.1708260476589203, 0.0743943601846695, 0.11983731389045715, -0.1119009256362915, 0.3564767837524414, 0.032325878739356995, -0.0345706008374691, -0.22064736485481262, -0.2858448028564453, -0.2954927682876587, 0.21023786067962646, -0.292886883020401, 0.11072760820388794, 0.3942216634750366, -0.5705616474151611, 0.26599109172821045, 0.043596163392066956, 0.3743756115436554, 0.1864628791809082, -0.15202058851718903, 0.22653421759605408, 0.25793418288230896, 0.08395267277956009, 0.25013330578804016, 0.06513937562704086, 0.2769777476787567, 0.15258556604385376, -0.13779571652412415, 0.2877996563911438, -0.21837475895881653, -0.08514440059661865, -0.37990623712539673, -0.20172959566116333, -0.20405182242393494, -0.0929681807756424, -0.03357943892478943, -0.22859585285186768, -0.1529354751110077, -0.19965341687202454, 0.11627563834190369, 0.30435484647750854, 0.1734740287065506, 0.17073196172714233, -0.2569704055786133, -0.022077016532421112, -0.19905906915664673, 0.13958357274532318, 0.1978316307067871, 0.026453129947185516, 0.2966536283493042, 0.25458264350891113, -0.05607636272907257, -0.20232298970222473, -0.13550028204917908, 0.03548280522227287, -0.10869386792182922, 0.302593469619751, 0.2197698950767517, 0.2308661788702011, 0.23209092020988464, 0.1304721236228943, -0.17229753732681274, -0.021691538393497467, 0.10339775681495667, -0.05430857464671135, -0.1361735761165619, 0.07353350520133972, -0.18540939688682556, 0.07892350852489471, 0.002034999430179596, -0.06072840094566345, -0.14351949095726013, 0.13027110695838928, -0.2694236636161804, -0.39106041193008423, -0.25511637330055237, -0.14798183739185333, 0.06763899326324463, 0.047186631709337234, -0.2050887942314148, -0.06923118978738785, 0.05120331794023514, -0.015297150239348412, -0.08630096912384033, -0.15310201048851013, -0.11191154271364212, 0.12379539012908936, 0.2932848632335663, -0.03696798160672188, -0.17366428673267365, -0.1403953582048416, -0.2779916226863861, -0.08706562966108322, 0.49544191360473633, 0.14715656638145447, -0.2331685572862625, -0.3405628502368927, -0.1432466357946396, -0.014802895486354828, -0.2126532793045044, -0.0018094498664140701, -0.2705742120742798, 0.004766497761011124, 0.08644884079694748, 0.10403470695018768, 0.10162608325481415, -0.13252420723438263, -0.17540550231933594, 0.07260949164628983, -0.1328786015510559, -0.04532071575522423, 0.6576879620552063, -0.4212711453437805, -0.10998174548149109, -0.09945089370012283, 0.14609399437904358, 0.3049503266811371, -0.06753640621900558, -0.059974752366542816, 0.24005654454231262, 0.18461807072162628, -0.23828063905239105, -0.08907321095466614, -0.18788109719753265, 0.13728496432304382, 0.08557555079460144, 0.1952613741159439, 0.17338760197162628, -0.1386318802833557, -0.6226956844329834, 0.11622883379459381, 0.31445205211639404, -0.2602846920490265, 0.04595969244837761, 0.38526657223701477, 0.05041566491127014, 0.11067052185535431, 0.3556958734989166, 0.1481088101863861, 0.22015607357025146, 0.28499460220336914, 0.016981540247797966, 0.24604451656341553, 0.025339815765619278, 0.05049249157309532, 0.09787088632583618, -0.6632033586502075, -0.015391720458865166, -0.10078102350234985, -0.18778982758522034, 0.06837313622236252, -0.08716651052236557, 0.17878058552742004, -0.26471278071403503, 0.32909709215164185, -0.4812300205230713, 0.4033544361591339, 0.14093536138534546, 0.13494563102722168, -0.4499170184135437, -0.27295857667922974, 0.1512170433998108, -0.04983755573630333, 0.1461503803730011, -0.13208602368831635, 0.30474820733070374, 0.14311139285564423, -0.09712842106819153, -0.08997515588998795, 0.12310904264450073, 0.03652104735374451, 0.06730744987726212, -0.3209609389305115, -0.07702507823705673, 0.08546730875968933, -0.1462772786617279, -0.2964150905609131, 0.24671338498592377, 0.40047523379325867, 0.3982613682746887, -0.058385543525218964, -0.17242640256881714, 0.016442883759737015, -0.027580175548791885, -0.05544285476207733, 0.2990143895149231, -0.13963250815868378, -0.2802864909172058, 0.2029198706150055, 0.005609016865491867, 0.003127995878458023, -0.13843318819999695, 0.24735639989376068, 0.6515611410140991, 0.04201580211520195, -0.04111221432685852, -0.2976585328578949, -0.1489562839269638, -0.06770595908164978, 0.04600946232676506, -0.13708730041980743, -0.16664761304855347, 0.5188360810279846, 0.26496025919914246, 0.15880365669727325, -0.18952545523643494, 0.05205840617418289, -0.014273514971137047, 0.3457859754562378, 0.22481565177440643, 0.15802758932113647, -0.42883703112602234, 0.2929064631462097, -0.12155449390411377, -0.08019622415304184, -0.16548246145248413, 0.31807607412338257, -0.043156664818525314, 0.11665713042020798, 0.10703586041927338, 0.017516199499368668, -0.3568214178085327, 0.43548861145973206, -0.03945321589708328, 0.4779485762119293, -0.17153602838516235, -0.40120482444763184, -0.05356450378894806, -0.04970864579081535, -0.06567610800266266, -0.38826584815979004, 0.22027741372585297, -0.4757348895072937, 0.12207686901092529, -0.3805858790874481, -0.13684116303920746, 0.437534898519516, 0.15874606370925903, 0.4158143103122711, 0.4934439957141876, 0.2703574299812317, 0.0021541640162467957, -0.1854194700717926, -0.3423939347267151, -0.2783377170562744, -0.20281392335891724, 0.13038185238838196, -0.042638424783945084, 0.315259724855423, 0.3554379940032959, 0.060571834444999695, -0.44374069571495056, 0.20339511334896088, -0.19820235669612885, 0.24476099014282227, -0.06356190890073776, -0.22233057022094727, -0.1752646118402481, 0.07302870601415634, 0.10733434557914734, -0.0651978850364685, -0.12724284827709198, 0.21194767951965332, -0.31817901134490967, -0.28958165645599365, 0.3916800320148468, -0.01331515982747078, -0.12605229020118713, -0.24105298519134521, 0.2697005569934845, 0.21140670776367188, -0.13060997426509857, 0.07919611036777496, 0.06572481989860535, 0.2333141714334488, -0.24823305010795593, 0.19232898950576782, -0.08815418183803558, 0.17258664965629578, 0.334186315536499, 0.012519359588623047, 0.3041877746582031, -0.21257847547531128, -0.006852053105831146, -0.03714613988995552, 0.062439583241939545 ]
https://github.com/huggingface/datasets/issues/5750
It does matter: this function expects a generator function, as stated in the docs. This should work: ```python from datasets import Dataset from google.cloud import bigquery def gen(): client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request yield from query_job.result() # Waits for query to finish ds = Dataset.from_generator(gen) for r in ds: print(r) ``` We could allow passing non-picklable objects and use a random hash for the generated arrow file. In that case, the caching mechanism would not work, meaning repeated calls with the same set of arguments would generate new datasets instead of reusing the cached version, but this behavior is still better than raising an error.
Fail to create datasets from a generator when using Google Big Query
### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0
128
Fail to create datasets from a generator when using Google Big Query ### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0 It does matter: this function expects a generator function, as stated in the docs. This should work: ```python from datasets import Dataset from google.cloud import bigquery def gen(): client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request yield from query_job.result() # Waits for query to finish ds = Dataset.from_generator(gen) for r in ds: print(r) ``` We could allow passing non-picklable objects and use a random hash for the generated arrow file. In that case, the caching mechanism would not work, meaning repeated calls with the same set of arguments would generate new datasets instead of reusing the cached version, but this behavior is still better than raising an error.
[ -0.2612236440181732, 0.1188696026802063, 0.03804491460323334, 0.30534034967422485, 0.020163144916296005, -0.07264968752861023, 0.23761841654777527, 0.15740983188152313, 0.21236394345760345, 0.23176400363445282, 0.3501090705394745, 0.2762688994407654, -0.26403680443763733, 0.23278747498989105, 0.3456822633743286, -0.2044852375984192, -0.020784202963113785, -0.06155296787619591, -0.1453162133693695, -0.11477823555469513, -0.3548855781555176, 0.12253810465335846, 0.024465180933475494, 0.07003994286060333, -0.14828144013881683, -0.04316028952598572, 0.14633849263191223, 0.16058491170406342, -0.30667510628700256, -0.04135334864258766, 0.055112116038799286, -0.27922582626342773, -0.15381896495819092, 0.43443599343299866, -0.0001149364179582335, 0.032644011080265045, 0.21024256944656372, 0.025043465197086334, -0.17170646786689758, -0.32597166299819946, -0.2874752879142761, -0.2172277867794037, -0.3518276810646057, -0.04685579240322113, 0.021411806344985962, -0.022877439856529236, -0.1442745327949524, -0.2141592800617218, 0.17952173948287964, 0.3923533856868744, 0.1888388991355896, -0.042014431208372116, 0.1311459243297577, -0.21522358059883118, 0.14576579630374908, 0.15091754496097565, -0.416689395904541, 0.17731249332427979, 0.07703860849142075, -0.18605172634124756, 0.1993325799703598, -0.03911604359745979, -0.12358691543340683, -0.24102210998535156, 0.32150140404701233, 0.1624491959810257, -0.3043232262134552, -0.5034401416778564, 0.26932859420776367, 0.3793353736400604, 0.4782475531101227, -0.06755998730659485, -0.4158306121826172, -0.3164815306663513, 0.016095958650112152, -0.1820695847272873, 0.32552269101142883, 0.3807847499847412, -0.015708018094301224, 0.1354236751794815, -0.2798561751842499, -0.36554086208343506, -0.09680689126253128, -0.1705964207649231, 0.06785791367292404, -0.16490855813026428, 0.07295645773410797, 0.1258850395679474, 0.12995871901512146, -0.06785701215267181, 0.04703139886260033, -0.2584746479988098, -0.027337031438946724, 0.08187712728977203, -0.41531437635421753, -0.010803833603858948, 0.3908563256263733, 0.2630884051322937, 0.4116043746471405, 0.25379040837287903, 0.2093779444694519, -0.26593464612960815, 0.05467675253748894, 0.2033260017633438, -0.050757959485054016, -0.0714661106467247, 0.01888107880949974, 0.16238965094089508, 0.24591726064682007, -0.11486510187387466, 0.1965726912021637, 0.11167307198047638, -0.016088202595710754, -0.4787915349006653, 0.11170206218957901, 0.14168933033943176, 0.1297617256641388, 0.09273452311754227, -0.07260768115520477, 0.30809175968170166, -0.2253197431564331, 0.036960016936063766, 0.11999427527189255, 0.2747332751750946, -0.20660899579524994, -0.21568945050239563, -0.11555054038763046, 0.33375734090805054, -0.29530781507492065, -0.39554640650749207, -0.14995057880878448, 0.10464686155319214, 0.12422379106283188, 0.07417068630456924, 0.09054544568061829, -0.3089745044708252, 0.2015998363494873, 0.15265515446662903, -0.010732211172580719, -0.14980970323085785, 0.2734849452972412, -0.17930743098258972, 0.037906236946582794, 0.2644959092140198, 0.003620065748691559, 0.02850566804409027, 0.12255042791366577, -0.20198498666286469, -0.12864495813846588, 0.18788382411003113, 0.009217987768352032, -0.46169936656951904, -0.21674031019210815, 0.12081184983253479, -0.1086379736661911, 0.18158219754695892, -0.30796319246292114, 0.11384981870651245, 0.604597806930542, 0.18168070912361145, -0.20333391427993774, -0.2558654248714447, -0.27191323041915894, -0.27189770340919495, 0.2440231442451477, 0.6525419354438782, -0.5439368486404419, 0.056115731596946716, -0.13555221259593964, 0.08061110973358154, 0.12856045365333557, 0.0850064679980278, -0.039996497333049774, 0.3380524218082428, -0.21036553382873535, -0.3264074921607971, 0.24615146219730377, 0.3446580469608307, -0.5781831741333008, 0.06202220544219017, -0.12209164351224899, 0.04684761166572571, 0.20288477838039398, 0.11477795988321304, -0.17291074991226196, 0.017324399203062057, 0.33672425150871277, 0.3318435847759247, -0.2524741291999817, 0.10604995489120483, -0.1440635323524475, -0.11082188785076141, -0.01076433900743723, 0.07212211936712265, 0.21714246273040771, 0.3607936501502991, 0.052354246377944946, -0.5441131591796875, -0.07862778753042221, -0.07007098197937012, 0.10365753620862961, 0.1621396392583847, 0.36143529415130615, -0.4559687674045563, 0.15930113196372986, 0.39159920811653137, -0.48870837688446045, 0.414322167634964, -0.39519116282463074, 0.26128557324409485, -0.17867165803909302, 0.09214787185192108, -0.2904375195503235, 0.10606630146503448, -0.28840166330337524, 0.02630537748336792, -0.06315463036298752, -0.052655309438705444, 0.3293968439102173, -0.11137091368436813, -0.09897702932357788, 0.09228220582008362, -0.2179637849330902, -0.026400338858366013, -0.6658506989479065, 0.14909175038337708, -0.14585363864898682, -0.14937107264995575, 0.2597377598285675, -0.14841823279857635, 0.053454723209142685, 0.008804317563772202, -0.08758486807346344, 0.07210127264261246, 0.0061151012778282166, 0.0243438258767128, -0.12335601449012756, 0.272566556930542, 0.11609379202127457, -0.05176575481891632, 0.13836437463760376, -0.1471991240978241, 0.001567702740430832, 0.056160569190979004, 0.062115076929330826, 0.22157438099384308, -0.04905074089765549, 0.09525904804468155, -0.27906808257102966, 0.1417616307735443, 0.12278977781534195, 0.06120021641254425, 0.252828449010849, -0.11106701195240021, 0.10805721580982208, 0.3294215798377991, 0.12641943991184235, 0.019690195098519325, -0.313865065574646, 0.2319745272397995, 0.2753954827785492, 0.13510465621948242, 0.15428416430950165, 0.13009710609912872, -0.0021889209747314453, -0.20359793305397034, -0.186919704079628, 0.17524808645248413, 0.31893235445022583, -0.06673121452331543, -0.11830756068229675, -0.01635976880788803, 0.09971801191568375, -0.2664680480957031, 0.11849400401115417, -0.14958997070789337, 0.023556653410196304, 0.09567936509847641, 0.21111103892326355, -0.18087130784988403, -0.003383331000804901, 0.02399362623691559, 0.3834092319011688, 0.34700119495391846, -0.3378351926803589, 0.21542832255363464, 0.010182186961174011, 0.1559000164270401, 0.1212151050567627, 0.22429674863815308, -0.23494869470596313, -0.20405374467372894, 0.05463406443595886, 0.2793976366519928, -0.10611563920974731, -0.04671614617109299, 0.09399338066577911, 0.2314731478691101, 0.39794549345970154, -0.2883051335811615, -0.22704842686653137, -0.21774360537528992, -0.21267351508140564, 0.11420739442110062, 0.1561632603406906, -0.483748197555542, 0.3483051061630249, -0.1462136209011078, -0.26320213079452515, -0.4503343105316162, 0.04960079491138458, 0.20879821479320526, -0.21615728735923767, 0.8063459992408752, 0.31673580408096313, 0.00893189013004303, -0.130022794008255, 0.2116978019475937, 0.13110101222991943, -0.0669487863779068, -0.1614747941493988, 0.17371220886707306, -0.13209699094295502, 0.07676795870065689, 0.037825264036655426, -0.3282257914543152, -0.2294844537973404, -0.14459148049354553, 0.12312746047973633, 0.23578456044197083, 0.38536542654037476, 0.10601763427257538, 0.2291715443134308, -0.21216952800750732, 0.17781871557235718, -0.07629244029521942, -0.19661006331443787, -0.5208907723426819, 0.43248674273490906, -0.44311103224754333, -0.37432512640953064, 0.07094551622867584, -0.2525356113910675, 0.032929424196481705, 0.06170595437288284, -0.2512021064758301, 0.17331244051456451, -0.15812420845031738, 0.3419210910797119, -0.011693568900227547, 0.08474688231945038, -0.06255200505256653, 0.0059828199446201324, 0.11146438866853714, -0.21863780915737152, -0.1758677363395691, 0.18402394652366638, 0.3860143721103668, 0.43513691425323486, 0.32703933119773865, 0.33875584602355957, -0.24394798278808594, 0.7609789967536926, 0.3787885010242462, -0.06137124449014664, 0.13010025024414062, -0.055524736642837524, 0.08581367880105972, -0.35764777660369873, -0.21946826577186584, 0.2072795033454895, 0.20183710753917694, -0.3042547106742859, -0.04164106398820877, 0.03650832176208496, 0.19620060920715332, -0.09479901194572449, 0.2505723834037781, -0.08139990270137787, -0.22431296110153198, -0.06089428812265396, -0.36592891812324524, 0.07223144918680191, 0.038648441433906555, 0.12917263805866241, -0.24875155091285706, 0.15425090491771698, -0.0015886425971984863, -0.1960853636264801, 0.6415700912475586, 0.08219072222709656, 0.24062052369117737, -0.02928866446018219, -0.4675142168998718, 0.22045616805553436, 0.06634215265512466, 0.10313789546489716, -0.09322899580001831, 0.030955880880355835, -0.030402176082134247, 0.09133365005254745, 0.5109289884567261, -0.4624905586242676, -0.18198420107364655, 0.1184210479259491, -0.00832165777683258, 0.15987826883792877, 0.09757263958454132, 0.25235840678215027, 0.13459943234920502, -0.14273542165756226, -0.07263974845409393, -0.4999839663505554, 0.2222522497177124, -0.12307454645633698, 0.4099475145339966, -0.163255512714386, -0.1317259669303894, -0.26195991039276123, -0.38252711296081543, 0.026173271238803864, -0.00945211946964264, -0.030277401208877563, 0.15815572440624237, -0.38581815361976624, 0.16425281763076782, 0.17781542241573334, -0.0003405660390853882, -0.06727670133113861, 0.01920098438858986, 0.30292266607284546, -0.4776538610458374, 0.5285972952842712, 0.11816063523292542, -0.19026046991348267, 0.29279765486717224, 0.7523815035820007, 0.20286524295806885, -0.015518303960561752, 0.30085623264312744, 0.09052533656358719, 0.0837419256567955, -0.061941832304000854, -0.2502705454826355, 0.17826971411705017, 0.24148814380168915, 0.16726741194725037, 0.09446494281291962, -0.09878462553024292, -0.032645486295223236, -0.2950544059276581, -0.2789061367511749, -0.6876342296600342, 0.7053555250167847, 0.0981217622756958, 0.06673803925514221, 0.46966317296028137, -0.11831259727478027, -0.10689388960599899, 0.13808771967887878, -0.06935746222734451, 0.5647286772727966, -0.0968400090932846, -0.2778424322605133, 0.16775548458099365, 0.13834542036056519, 0.749742329120636, 0.05109493434429169, 0.24603813886642456, -0.7564476728439331, -0.0966888964176178, 0.031139418482780457, -0.3505779206752777, 0.037394121289253235, 0.07834585011005402, -0.17140153050422668, 0.19276537001132965, -0.363964319229126, 0.059714145958423615, -0.03442178666591644, 0.19822490215301514, -0.40214526653289795, -0.17506974935531616, 0.08870448172092438, 0.10657306760549545, -0.0923348069190979, 0.36795830726623535, 0.0299026258289814, -0.017818236723542213, -0.22045078873634338, -0.2765124440193176, -0.29516926407814026, 0.21019889414310455, -0.28505536913871765, 0.08398622274398804, 0.4323776662349701, -0.5557562708854675, 0.27387696504592896, 0.04899909347295761, 0.3601997196674347, 0.15809515118598938, -0.16006805002689362, 0.2251741886138916, 0.2860272228717804, 0.10393787920475006, 0.2783314883708954, 0.06764218211174011, 0.29580622911453247, 0.17457839846611023, -0.11615587025880814, 0.2747665345668793, -0.23367668688297272, -0.09950179606676102, -0.3834885060787201, -0.186660036444664, -0.2100510448217392, -0.0804365873336792, -0.015774130821228027, -0.2225443422794342, -0.12561501562595367, -0.1960734724998474, 0.1012987270951271, 0.3059103786945343, 0.17180417478084564, 0.1598401665687561, -0.2878497838973999, -0.02109893411397934, -0.19735929369926453, 0.13313165307044983, 0.19237923622131348, 0.03768859803676605, 0.2766161262989044, 0.2435477077960968, -0.05500224232673645, -0.1810571551322937, -0.14868023991584778, 0.0437161847949028, -0.10385483503341675, 0.3097213804721832, 0.20790578424930573, 0.21963566541671753, 0.2385057806968689, 0.119530588388443, -0.16669131815433502, -0.061046671122312546, 0.09388677775859833, -0.060083936899900436, -0.12738046050071716, 0.08363601565361023, -0.17668992280960083, 0.045326314866542816, -0.0027943700551986694, -0.08679842203855515, -0.13279634714126587, 0.11601328104734421, -0.2470742166042328, -0.39017876982688904, -0.23671269416809082, -0.13840802013874054, 0.0682389959692955, 0.07366013526916504, -0.21354766190052032, -0.07181994616985321, 0.01828649267554283, -0.004947653040289879, -0.08175744116306305, -0.13479183614253998, -0.12411031126976013, 0.13186746835708618, 0.3026704490184784, -0.05901011824607849, -0.16681602597236633, -0.13162867724895477, -0.2875247001647949, -0.08879993855953217, 0.5093181133270264, 0.15100230276584625, -0.23680967092514038, -0.34494122862815857, -0.1477026492357254, 0.003670455887913704, -0.2098444402217865, 0.008044546470046043, -0.25743818283081055, 0.00519343838095665, 0.0850478857755661, 0.11002179980278015, 0.09849711507558823, -0.1315128058195114, -0.17013511061668396, 0.08582013845443726, -0.1578647941350937, -0.034654319286346436, 0.6685918569564819, -0.43659576773643494, -0.08557412028312683, -0.11086858808994293, 0.1301800012588501, 0.3175649642944336, -0.060684047639369965, -0.07937448471784592, 0.2317783683538437, 0.16839006543159485, -0.22744643688201904, -0.09066368639469147, -0.18572229146957397, 0.15944938361644745, 0.07425206899642944, 0.19263017177581787, 0.19293701648712158, -0.15774235129356384, -0.6295850872993469, 0.1136607751250267, 0.313447505235672, -0.27115267515182495, 0.053541406989097595, 0.3977906405925751, 0.057720378041267395, 0.13416650891304016, 0.35821232199668884, 0.11830639839172363, 0.21415922045707703, 0.30089229345321655, 0.04360412806272507, 0.22726266086101532, 0.04104170575737953, 0.04909396916627884, 0.10923705995082855, -0.6735621690750122, -0.031417325139045715, -0.07539208233356476, -0.1876433789730072, 0.07769203186035156, -0.08711991459131241, 0.19114981591701508, -0.2701655626296997, 0.3261588215827942, -0.4956659972667694, 0.3875008821487427, 0.13922864198684692, 0.13337934017181396, -0.47500014305114746, -0.28361859917640686, 0.155443474650383, -0.0370405949652195, 0.14678612351417542, -0.10721714049577713, 0.3323555886745453, 0.1357993185520172, -0.08683070540428162, -0.07359149307012558, 0.11472669243812561, 0.015448696911334991, 0.06317820399999619, -0.32057666778564453, -0.08463720232248306, 0.07007794827222824, -0.14747890830039978, -0.27381497621536255, 0.24089103937149048, 0.3822217583656311, 0.4032820463180542, -0.0658363401889801, -0.1683996170759201, 0.011249139904975891, -0.016531527042388916, -0.0554928332567215, 0.32438400387763977, -0.14684128761291504, -0.2887780964374542, 0.19827857613563538, -0.012433787807822227, 0.025826796889305115, -0.12448342889547348, 0.24974536895751953, 0.655807375907898, 0.04715079441666603, -0.03200968727469444, -0.3225153088569641, -0.1348111629486084, -0.04563777893781662, 0.03892741724848747, -0.09009886533021927, -0.18318192660808563, 0.5105657577514648, 0.27347591519355774, 0.17435504496097565, -0.17540591955184937, 0.0423138327896595, -0.0038045216351747513, 0.3438453674316406, 0.22719261050224304, 0.150240957736969, -0.4146018624305725, 0.294082373380661, -0.12012985348701477, -0.07976992428302765, -0.1482645571231842, 0.34074386954307556, -0.031337082386016846, 0.11528095602989197, 0.11157679557800293, 0.012011459097266197, -0.384981632232666, 0.4325762987136841, -0.05804891139268875, 0.48247748613357544, -0.15643301606178284, -0.4372924268245697, -0.052512574940919876, -0.06291121244430542, -0.07285133749246597, -0.3936976194381714, 0.2205362170934677, -0.48995304107666016, 0.10918852686882019, -0.36459827423095703, -0.15231262147426605, 0.44349217414855957, 0.18056829273700714, 0.4207751452922821, 0.5161575675010681, 0.2553909122943878, 0.032446108758449554, -0.17519912123680115, -0.3605918884277344, -0.2575903534889221, -0.20792825520038605, 0.1210002601146698, -0.06515245139598846, 0.3112944960594177, 0.34524402022361755, 0.09105154126882553, -0.45350155234336853, 0.19367964565753937, -0.18359515070915222, 0.27629441022872925, -0.08806910365819931, -0.22505514323711395, -0.20940741896629333, 0.07721950113773346, 0.11020341515541077, -0.06829550117254257, -0.12994033098220825, 0.2263246476650238, -0.315296471118927, -0.2712094187736511, 0.37915724515914917, -0.01627323031425476, -0.11771228164434433, -0.2546209692955017, 0.2615716755390167, 0.21578705310821533, -0.1588129848241806, 0.09071111679077148, 0.039236441254615784, 0.2259199172258377, -0.25439995527267456, 0.21707284450531006, -0.11173510551452637, 0.17040598392486572, 0.3267734944820404, 0.005490489304065704, 0.331633597612381, -0.20474568009376526, -0.02238624170422554, -0.006611056625843048, 0.06755620241165161 ]
https://github.com/huggingface/datasets/issues/5750
Thank you @mariosasko . Your last code is working indeed. Curiously, the important detail here was to wrap the client instantiation within the generator itself. If the line `client = bigquery.Client()` is moved outside, then the error is back. I see now also your point in regard to the generator being a generator function. We can close the issue if you want.
Fail to create datasets from a generator when using Google Big Query
### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0
62
Fail to create datasets from a generator when using Google Big Query ### Describe the bug Creating a dataset from a generator using `Dataset.from_generator()` fails if the generator is the [Google Big Query Python client](https://cloud.google.com/python/docs/reference/bigquery/latest). The problem is that the Big Query client is not pickable. And the function `create_config_id` tries to get a hash of the generator by pickling it. So the following error is generated: ``` _pickle.PicklingError: Pickling client objects is explicitly not supported. Clients have non-trivial state that is local and unpickleable. ``` ### Steps to reproduce the bug 1. Install the big query client and datasets `pip install google-cloud-bigquery datasets` 2. Run the following code: ```py from datasets import Dataset from google.cloud import bigquery client = bigquery.Client() # Perform a query. QUERY = ( 'SELECT name FROM `bigquery-public-data.usa_names.usa_1910_2013` ' 'WHERE state = "TX" ' 'LIMIT 100') query_job = client.query(QUERY) # API request rows = query_job.result() # Waits for query to finish ds = Dataset.from_generator(rows) for r in ds: print(r) ``` ### Expected behavior Two options: 1. Ignore the pickle errors when computing the hash 2. Provide a scape hutch so that we can avoid calculating the hash for the generator. For example, allowing to provide a hash from the user. ### Environment info python 3.9 google-cloud-bigquery 3.9.0 datasets 2.11.0 Thank you @mariosasko . Your last code is working indeed. Curiously, the important detail here was to wrap the client instantiation within the generator itself. If the line `client = bigquery.Client()` is moved outside, then the error is back. I see now also your point in regard to the generator being a generator function. We can close the issue if you want.
[ -0.26652318239212036, 0.13725778460502625, 0.03106006234884262, 0.28722265362739563, 0.03300163894891739, -0.087629534304142, 0.2441944181919098, 0.17209544777870178, 0.21294474601745605, 0.27725276350975037, 0.3305439054965973, 0.2740379273891449, -0.24410590529441833, 0.2754037082195282, 0.34588295221328735, -0.22928577661514282, -0.044163644313812256, -0.05267849192023277, -0.2042219638824463, -0.09763742238283157, -0.3232440948486328, 0.10822800546884537, 0.02365685999393463, 0.09842930734157562, -0.08440139144659042, -0.09642522782087326, 0.12535332143306732, 0.14617618918418884, -0.2682116627693176, -0.08380650728940964, 0.018390513956546783, -0.27304789423942566, -0.13552658259868622, 0.4357028603553772, -0.00010932791337836534, 0.06307561695575714, 0.19164086878299713, 0.0066089630126953125, -0.23910434544086456, -0.3470189571380615, -0.2806895077228546, -0.18880820274353027, -0.3011249303817749, -0.06338443607091904, 0.010516047477722168, -0.0750432014465332, -0.1607344001531601, -0.18059894442558289, 0.23940104246139526, 0.411324143409729, 0.23773512244224548, -0.013883363455533981, 0.12861284613609314, -0.2355232536792755, 0.11978287249803543, 0.11773309111595154, -0.3728351891040802, 0.16784843802452087, 0.05103570222854614, -0.17400355637073517, 0.20077429711818695, -0.026125920936465263, -0.10145214200019836, -0.16819074749946594, 0.3533918261528015, 0.15864253044128418, -0.2882944345474243, -0.5273005962371826, 0.24915571510791779, 0.397420734167099, 0.5068561434745789, -0.0933055654168129, -0.41720178723335266, -0.2768465280532837, 0.008702583611011505, -0.19526055455207825, 0.3254002332687378, 0.3959791958332062, -0.08417201042175293, 0.1526799499988556, -0.21566273272037506, -0.3232133686542511, -0.11321664601564407, -0.17093932628631592, 0.025641560554504395, -0.16595715284347534, 0.046146370470523834, 0.11545215547084808, 0.1107933297753334, -0.11753331869840622, 0.05154840648174286, -0.27162083983421326, 0.004353349097073078, 0.09933872520923615, -0.38322290778160095, -0.02910945564508438, 0.350774347782135, 0.26362937688827515, 0.4202609956264496, 0.26983800530433655, 0.2722778618335724, -0.23586609959602356, 0.05374429374933243, 0.24508576095104218, -0.02527538128197193, -0.07488036900758743, 0.046174436807632446, 0.17194920778274536, 0.23884019255638123, -0.12290441989898682, 0.17199769616127014, 0.06783618032932281, -0.02270366996526718, -0.4678453803062439, 0.07790039479732513, 0.14014852046966553, 0.09889902174472809, 0.06024166941642761, -0.04643906280398369, 0.26569661498069763, -0.17583736777305603, 0.042399972677230835, 0.1215577945113182, 0.2935546934604645, -0.1797284185886383, -0.20646989345550537, -0.09230116754770279, 0.2941558361053467, -0.28226035833358765, -0.41086581349372864, -0.14787714183330536, 0.15264102816581726, 0.0937141478061676, 0.07618049532175064, 0.123625248670578, -0.30939027667045593, 0.19961881637573242, 0.09452219307422638, 0.01848442852497101, -0.09590607136487961, 0.3036210536956787, -0.15351921319961548, 0.09477339684963226, 0.29557913541793823, 0.021198458969593048, -0.011677935719490051, 0.10500556230545044, -0.19654490053653717, -0.15555807948112488, 0.1760416477918625, 0.026647772639989853, -0.430533230304718, -0.16649827361106873, 0.17067016661167145, -0.11036026477813721, 0.16814690828323364, -0.30435532331466675, 0.07654419541358948, 0.52486252784729, 0.13317961990833282, -0.2509205639362335, -0.23867231607437134, -0.2642679214477539, -0.29132482409477234, 0.21942445635795593, 0.6130256652832031, -0.5322453379631042, 0.07750542461872101, -0.14813143014907837, 0.03730962052941322, 0.10782364755868912, 0.030584879219532013, -0.07247304916381836, 0.3784791827201843, -0.21462929248809814, -0.2991284728050232, 0.27692389488220215, 0.3585186004638672, -0.5508749485015869, 0.03675935044884682, -0.14543288946151733, 0.02933204174041748, 0.1430874913930893, 0.07357527315616608, -0.13934969902038574, 0.014781273901462555, 0.3561626672744751, 0.34026533365249634, -0.19765517115592957, 0.12606093287467957, -0.14530403912067413, -0.0683312714099884, -0.03059825859963894, 0.059097468852996826, 0.13784459233283997, 0.3700716495513916, 0.050838589668273926, -0.5652850866317749, -0.08978910744190216, -0.09978310763835907, 0.12951251864433289, 0.14099380373954773, 0.37588319182395935, -0.4086247682571411, 0.13543426990509033, 0.37349048256874084, -0.445674329996109, 0.38240891695022583, -0.3732256591320038, 0.28616464138031006, -0.1679895669221878, 0.05294094979763031, -0.2555634677410126, 0.16061033308506012, -0.2831001877784729, 0.002873392775654793, -0.006148040294647217, -0.020282745361328125, 0.36772045493125916, -0.14118629693984985, -0.14351144433021545, 0.10640053451061249, -0.2261553704738617, -0.055925335735082626, -0.6104183793067932, 0.1714782863855362, -0.1823168396949768, -0.15544308722019196, 0.2903851568698883, -0.18424689769744873, 0.038519490510225296, -0.0113759096711874, -0.09054841846227646, 0.05810931697487831, -0.004663746803998947, 0.012458696961402893, -0.09458461403846741, 0.2573038637638092, 0.07859181612730026, -0.0474572479724884, 0.16889725625514984, -0.11427420377731323, 0.05987490341067314, 0.09399400651454926, 0.049096833914518356, 0.26922452449798584, -0.018275827169418335, 0.08184333890676498, -0.22688733041286469, 0.12105952948331833, 0.13985559344291687, 0.07362610101699829, 0.2216702550649643, -0.10705924034118652, 0.11456016451120377, 0.3247630298137665, 0.11191786825656891, -0.00974934734404087, -0.32052716612815857, 0.1950387954711914, 0.22998499870300293, 0.15584947168827057, 0.1816149652004242, 0.13373777270317078, -0.043496374040842056, -0.1902155876159668, -0.1819106638431549, 0.20686861872673035, 0.3692154884338379, -0.029851021245121956, -0.11632753908634186, -0.008069195784628391, 0.1631726622581482, -0.26413026452064514, 0.12020935863256454, -0.14921912550926208, 0.033877450972795486, 0.07739105820655823, 0.19981935620307922, -0.1798887550830841, -0.04000137001276016, 0.02998320758342743, 0.35960516333580017, 0.33632540702819824, -0.29417118430137634, 0.22258132696151733, -0.0012954771518707275, 0.15511491894721985, 0.07315335422754288, 0.24176864326000214, -0.23234021663665771, -0.20023059844970703, 0.0971749871969223, 0.2641853094100952, -0.15458396077156067, -0.04023692011833191, 0.13914260268211365, 0.27065131068229675, 0.3832581043243408, -0.25180864334106445, -0.2242196798324585, -0.23173557221889496, -0.20955239236354828, 0.16015931963920593, 0.179143488407135, -0.38989242911338806, 0.3919861316680908, -0.1236470639705658, -0.23797358572483063, -0.45127418637275696, 0.0341859832406044, 0.20572170615196228, -0.1838054656982422, 0.7868707180023193, 0.32343512773513794, 0.059249892830848694, -0.09417704492807388, 0.1856209933757782, 0.14255036413669586, -0.1390451341867447, -0.14065149426460266, 0.18589989840984344, -0.11408492177724838, 0.08964399993419647, 0.030959099531173706, -0.3707472085952759, -0.27660250663757324, -0.19390927255153656, 0.12113581597805023, 0.2400493025779724, 0.41711264848709106, 0.082417331635952, 0.238978773355484, -0.1975645273923874, 0.1666058897972107, -0.06975355744361877, -0.20980314910411835, -0.45504000782966614, 0.44490331411361694, -0.49943897128105164, -0.4189383387565613, 0.0979747548699379, -0.2691799998283386, 0.02799910679459572, 0.03584980219602585, -0.20827369391918182, 0.13620725274085999, -0.15319283306598663, 0.32025909423828125, 0.00831515621393919, 0.12389648705720901, -0.07876940816640854, 0.007654137909412384, 0.05967329815030098, -0.22397631406784058, -0.17592798173427582, 0.19412797689437866, 0.38097047805786133, 0.4115511476993561, 0.34783464670181274, 0.2822871804237366, -0.294374942779541, 0.722804605960846, 0.37353405356407166, -0.14476799964904785, 0.13195985555648804, -0.08452372252941132, 0.058548297733068466, -0.38041675090789795, -0.2178523689508438, 0.20565158128738403, 0.1788146197795868, -0.31234174966812134, -0.022915884852409363, 0.011454518884420395, 0.1776541918516159, -0.1509600132703781, 0.24937856197357178, -0.10679265856742859, -0.24803650379180908, -0.04024402052164078, -0.263073593378067, 0.0720968022942543, 0.05755246430635452, 0.08786003291606903, -0.285122811794281, 0.18428289890289307, -0.0015729479491710663, -0.2102428376674652, 0.5790505409240723, 0.05841691419482231, 0.19340696930885315, -0.028673162683844566, -0.48516345024108887, 0.2750725746154785, 0.051565058529376984, 0.02667231112718582, -0.08618275821208954, -0.02006342262029648, -0.012789111584424973, 0.09363029152154922, 0.47874757647514343, -0.47877252101898193, -0.1978299617767334, 0.1048571914434433, 0.01635407656431198, 0.1609751582145691, 0.12112870812416077, 0.2132357656955719, 0.10801141709089279, -0.18533702194690704, -0.08245433866977692, -0.5062688589096069, 0.2116125226020813, -0.15222761034965515, 0.41346555948257446, -0.17278149724006653, -0.12543480098247528, -0.26381605863571167, -0.41079187393188477, -0.038506265729665756, -0.023103151470422745, -0.05194960534572601, 0.17697829008102417, -0.38424304127693176, 0.1493837684392929, 0.20492424070835114, 0.0427817776799202, -0.0563930980861187, 0.05281706526875496, 0.3138822913169861, -0.45011934638023376, 0.47252345085144043, 0.12409579753875732, -0.15198266506195068, 0.3257175385951996, 0.7493035793304443, 0.18917186558246613, 0.025299817323684692, 0.292210191488266, 0.08482680469751358, 0.061052653938531876, 0.00575781986117363, -0.21470199525356293, 0.15631788969039917, 0.2102222591638565, 0.19426992535591125, 0.06345614790916443, -0.08075475692749023, -0.09773217886686325, -0.24251441657543182, -0.20801115036010742, -0.697221040725708, 0.7067583203315735, 0.08314023911952972, 0.04600214958190918, 0.4490290880203247, -0.1382283866405487, -0.11154662817716599, 0.18167895078659058, -0.04670460522174835, 0.5832728147506714, -0.090531125664711, -0.26992267370224, 0.19139954447746277, 0.13088971376419067, 0.6935168504714966, 0.005102083086967468, 0.2553090751171112, -0.7734948992729187, -0.0731813982129097, 0.010821796953678131, -0.34188729524612427, 0.05818016827106476, 0.10458192229270935, -0.21302449703216553, 0.16102400422096252, -0.3331463932991028, 0.011016208678483963, -0.05941721796989441, 0.23983344435691833, -0.42549383640289307, -0.19801166653633118, 0.05449653044342995, 0.1522349715232849, -0.08358633518218994, 0.39780038595199585, 0.021176636219024658, -0.03409646824002266, -0.19258186221122742, -0.25687748193740845, -0.2414933294057846, 0.20475435256958008, -0.2688453197479248, 0.07249051332473755, 0.3884996175765991, -0.5115549564361572, 0.30599212646484375, 0.02759925276041031, 0.3498087525367737, 0.16942359507083893, -0.12221655249595642, 0.22948336601257324, 0.2695026993751526, 0.0903165265917778, 0.20163992047309875, 0.0942515954375267, 0.29327285289764404, 0.12691347301006317, -0.16225728392601013, 0.2867371737957001, -0.19638670980930328, -0.06797005236148834, -0.37766799330711365, -0.20381571352481842, -0.21642360091209412, -0.11186793446540833, -0.01802709698677063, -0.20614993572235107, -0.16190972924232483, -0.16857275366783142, 0.14667640626430511, 0.26898229122161865, 0.10970985889434814, 0.15652549266815186, -0.21933859586715698, -0.005856126546859741, -0.14490912854671478, 0.13929809629917145, 0.20914649963378906, 0.06104198098182678, 0.27843913435935974, 0.2733466625213623, -0.0563042014837265, -0.23086154460906982, -0.16777729988098145, 0.055011820048093796, -0.06780809164047241, 0.3042277693748474, 0.25450044870376587, 0.21378283202648163, 0.21742282807826996, 0.18143916130065918, -0.1995285451412201, -0.03562760725617409, 0.07738414406776428, -0.05356697365641594, -0.13467898964881897, 0.07870859652757645, -0.1735241860151291, 0.05481412261724472, 0.02976755052804947, -0.050246432423591614, -0.09050066769123077, 0.1461637318134308, -0.31846657395362854, -0.36812546849250793, -0.216122567653656, -0.10715094208717346, 0.07441605627536774, 0.032160498201847076, -0.20909321308135986, -0.03029400296509266, 0.06059678643941879, 0.023412436246871948, -0.13734149932861328, -0.1910543441772461, -0.04990634322166443, 0.1045566275715828, 0.29074639081954956, -0.05117916315793991, -0.1440783441066742, -0.1327308863401413, -0.2776021957397461, -0.07452392578125, 0.5147500038146973, 0.07351434230804443, -0.2763488292694092, -0.3499066233634949, -0.15917450189590454, -0.004911508411169052, -0.2179926633834839, 0.007284428924322128, -0.22077679634094238, -0.023981738835573196, 0.07234767079353333, 0.0782480239868164, 0.04995676875114441, -0.16253627836704254, -0.14590732753276825, 0.11292411386966705, -0.1304272562265396, -0.041521161794662476, 0.6470739245414734, -0.4211680591106415, -0.09886601567268372, -0.1393604725599289, 0.16842974722385406, 0.33421197533607483, -0.07720476388931274, -0.03875252604484558, 0.2145119309425354, 0.20354488492012024, -0.27353063225746155, -0.04775384068489075, -0.18960586190223694, 0.12079643458127975, 0.09934167563915253, 0.18513236939907074, 0.2000962793827057, -0.12912039458751678, -0.617106556892395, 0.09084281325340271, 0.2916080355644226, -0.2927597165107727, -0.004081986844539642, 0.3782179355621338, -0.004431828856468201, 0.1275252401828766, 0.37240928411483765, 0.13072961568832397, 0.24659337103366852, 0.30423885583877563, 0.018352583050727844, 0.2603515386581421, 0.005757070146501064, 0.04534723609685898, 0.10529270768165588, -0.7234913110733032, 0.007940646260976791, -0.04191599786281586, -0.13696682453155518, 0.05160866677761078, -0.0518503375351429, 0.11660565435886383, -0.2579237222671509, 0.30844366550445557, -0.47933217883110046, 0.3996696472167969, 0.1391899287700653, 0.14092552661895752, -0.4963812530040741, -0.28259748220443726, 0.14282426238059998, -0.03829389438033104, 0.14442703127861023, -0.10552146285772324, 0.32735252380371094, 0.10761949419975281, -0.07437218725681305, -0.08816035091876984, 0.12269856780767441, -0.012331513687968254, 0.05636320635676384, -0.2989211678504944, -0.07920007407665253, 0.060871899127960205, -0.1418060064315796, -0.2943955361843109, 0.2529074549674988, 0.3899190127849579, 0.3780370056629181, -0.04414478689432144, -0.15378625690937042, -0.05059053376317024, -0.02639242634177208, -0.07845024764537811, 0.2764107882976532, -0.11802402138710022, -0.28224197030067444, 0.26213231682777405, 0.04066937044262886, -0.00794350728392601, -0.17935386300086975, 0.24968792498111725, 0.6704410910606384, 0.058250825852155685, -0.08565102517604828, -0.24169622361660004, -0.11670757830142975, -0.08490470051765442, 0.001879427582025528, -0.12475518137216568, -0.15152308344841003, 0.4898070693016052, 0.24967360496520996, 0.13860763609409332, -0.24064072966575623, 0.08006565272808075, -0.052865639328956604, 0.3956322968006134, 0.24889740347862244, 0.1722036749124527, -0.4109261631965637, 0.25480103492736816, -0.16434533894062042, -0.04071778059005737, -0.20888298749923706, 0.3263764977455139, -0.03620125353336334, 0.1068897619843483, 0.14926090836524963, 0.06479611992835999, -0.43669426441192627, 0.40203261375427246, -0.09544190764427185, 0.45179328322410583, -0.21687713265419006, -0.397956520318985, -0.08958649635314941, -0.016563737764954567, -0.0649125725030899, -0.3896130323410034, 0.18559731543064117, -0.5186856389045715, 0.15619584918022156, -0.32259923219680786, -0.1148698478937149, 0.41477394104003906, 0.15793901681900024, 0.4699840247631073, 0.47716739773750305, 0.2654677927494049, 0.01502837985754013, -0.15723642706871033, -0.29851821064949036, -0.23546524345874786, -0.2225513756275177, 0.12078575789928436, -0.022611567750573158, 0.30022603273391724, 0.37690305709838867, 0.08666358888149261, -0.4389820694923401, 0.17490516602993011, -0.1944657862186432, 0.2635193467140198, -0.06541335582733154, -0.21624290943145752, -0.20880839228630066, 0.07454872131347656, 0.12491858005523682, -0.04483798146247864, -0.12100052833557129, 0.14465361833572388, -0.3294229507446289, -0.2451557219028473, 0.38639795780181885, -0.03420095145702362, -0.1319791078567505, -0.23749960958957672, 0.23703333735466003, 0.18683083355426788, -0.17444957792758942, 0.06987415254116058, 0.08595731854438782, 0.19951105117797852, -0.24805490672588348, 0.17885121703147888, -0.09522686153650284, 0.13392089307308197, 0.3222973942756653, -0.023756302893161774, 0.32024452090263367, -0.22273999452590942, 0.0016741752624511719, -0.12204448878765106, 0.04397676885128021 ]
https://github.com/huggingface/datasets/issues/5749
I got the same error, and the official website for visual genome is down. Did you solve this problem?
AttributeError: 'Version' object has no attribute 'match'
### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3
19
AttributeError: 'Version' object has no attribute 'match' ### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3 I got the same error, and the official website for visual genome is down. Did you solve this problem?
[ -0.19554170966148376, 0.019373491406440735, 0.01434849202632904, 0.2700212299823761, 0.32112330198287964, 0.046529993414878845, 0.24270014464855194, 0.5838724970817566, 0.28396525979042053, 0.25258180499076843, 0.18423843383789062, 0.2591090202331543, 0.06297559291124344, 0.18058335781097412, -0.1841655671596527, -0.31374624371528625, 0.028639934957027435, 0.3809821605682373, -0.2248632311820984, -0.10082150250673294, -0.21145474910736084, 0.2588158845901489, -0.13443586230278015, 0.257469117641449, -0.14275160431861877, -0.05305512249469757, 0.07329032570123672, 0.12121979892253876, -0.05994555726647377, -0.5016893744468689, 0.2564443349838257, -0.47022438049316406, 0.1583966612815857, 0.3401408791542053, -0.0001134037011070177, -0.030913017690181732, 0.3680552840232849, -0.048902373760938644, -0.4858623147010803, -0.342181921005249, -0.1922387182712555, -0.11220534145832062, 0.12563076615333557, 0.006693899631500244, -0.08859129995107651, -0.2761288285255432, -0.10518481582403183, -0.38265809416770935, 0.012195806950330734, 0.1859949231147766, 0.23871304094791412, 0.19226276874542236, 0.2750442922115326, -0.2346031814813614, 0.21039897203445435, -0.02744220197200775, -0.08439455181360245, 0.22092872858047485, 0.2621377110481262, 0.017886236310005188, 0.22091880440711975, 0.37340086698532104, -0.09937520325183868, 0.30927520990371704, 0.12260476499795914, 0.005489800125360489, 0.2620481252670288, -0.12026835232973099, 0.11258835345506668, 0.14713852107524872, 0.6393735408782959, -0.32852691411972046, -0.6078495383262634, 0.019094079732894897, -0.023614823818206787, -0.3823280334472656, 0.18983125686645508, -0.06574016809463501, -0.10311548411846161, 0.17057576775550842, -0.2525330185890198, -0.009170807898044586, -0.1728745996952057, -0.03534740209579468, -0.1076408326625824, -0.09033136814832687, -0.03820839896798134, 0.018084626644849777, -0.17774765193462372, -0.0457402765750885, 0.03128198906779289, -0.17354735732078552, -0.2493513971567154, 0.31612247228622437, -0.48160266876220703, -0.06948361545801163, -0.26345378160476685, 0.1268620491027832, 0.2517041862010956, 0.27407485246658325, 0.09238070249557495, -0.2736469507217407, 0.028384044766426086, 0.10033340752124786, 0.18804728984832764, 0.4008617103099823, 0.09121257066726685, 0.31657126545906067, -0.0361027866601944, -0.07960639148950577, -0.15487998723983765, -0.01979619264602661, -0.021120373159646988, -0.3436775505542755, 0.2899298667907715, 0.23576220870018005, 0.429374098777771, -0.44922226667404175, -0.349854439496994, 0.15076203644275665, -0.43255889415740967, 0.0965631753206253, -0.10642769932746887, 0.23045791685581207, -0.16472019255161285, 0.16438287496566772, 0.2359602451324463, 0.11871587485074997, -0.28685903549194336, -0.42455214262008667, -0.3329216539859772, 0.029138583689928055, -0.034266211092472076, -0.06494632363319397, -0.015328936278820038, -0.09831125289201736, 0.2469440996646881, -0.16513526439666748, 0.04536484554409981, -0.10714158415794373, -0.0684562474489212, -0.14932458102703094, -0.15222248435020447, 0.42972713708877563, -0.13686907291412354, 0.26840224862098694, 0.2735305726528168, -0.3405449390411377, -0.08970452100038528, 0.15821398794651031, -0.2817765474319458, -0.28332334756851196, -0.1478995829820633, 0.23243869841098785, -0.3355938494205475, -0.044288817793130875, -0.17536713182926178, -0.24373780190944672, 0.09656397998332977, -0.15237924456596375, -0.14979767799377441, -0.21141844987869263, -0.2056483030319214, -0.2941035032272339, 0.24759772419929504, 0.5259004235267639, -0.38413238525390625, -0.1878320723772049, 0.0659884512424469, 0.003676127642393112, 0.008795466274023056, -0.011898561380803585, 0.17705604434013367, 0.19465462863445282, -0.12826883792877197, -0.09054155647754669, 0.4242992103099823, -0.5693094730377197, -0.4758452773094177, 0.46181631088256836, -0.10572050511837006, 0.10944394022226334, 0.18837133049964905, -0.1252211183309555, 0.13802815973758698, -0.02544894628226757, 0.2216733694076538, 0.12380420416593552, 0.04702530801296234, 0.09351401031017303, -0.08748362958431244, -0.27221766114234924, 0.03200332447886467, 0.03129573166370392, 0.03442297875881195, 0.2756645679473877, 0.14564630389213562, -0.19005146622657776, 0.16842782497406006, -0.05104285851120949, -0.0189839918166399, 0.14224229753017426, 0.3411916196346283, -0.03134899213910103, 0.11403924226760864, -0.19454477727413177, -0.4897097945213318, 0.36006420850753784, -0.08292049914598465, 0.021845240145921707, 0.07272239029407501, -0.008997038006782532, -0.40825963020324707, 0.06103774905204773, -0.4392084777355194, -0.439272940158844, 0.0904359295964241, -0.005305130034685135, 0.03261909633874893, 0.03943507373332977, -0.08449145406484604, 0.4135861098766327, -0.06717968732118607, 0.18381594121456146, -0.3058442175388336, 0.3117997944355011, -0.27434664964675903, -0.12933200597763062, 0.1465597301721573, 0.10486696660518646, 0.14218582212924957, 0.029740918427705765, -0.23988427221775055, 0.2925357222557068, 0.013325817883014679, 0.37458840012550354, -0.001173145603388548, -0.018157556653022766, 0.0888519212603569, -0.14557607471942902, 0.046900682151317596, 0.12697085738182068, 0.3020290434360504, 0.1367306411266327, 0.15465396642684937, 0.07671202719211578, 0.1407211273908615, 0.2628413438796997, -0.028325803577899933, 0.09313786029815674, 0.2444712370634079, -0.1081666499376297, -0.025006812065839767, -0.23845116794109344, 0.15128959715366364, 0.009113054722547531, 0.3467402160167694, -0.0028079207986593246, -0.303058922290802, -0.07340143620967865, 0.23502716422080994, 0.0067840516567230225, 0.09929884970188141, -0.07021450996398926, -0.410245805978775, 0.19543775916099548, -0.020663294941186905, 0.20316193997859955, 0.49709099531173706, 0.2070240080356598, -0.10401064902544022, 0.15568773448467255, -0.06992370635271072, -0.0011065490543842316, 0.1899898648262024, 0.08450832962989807, 0.46247005462646484, 0.36035293340682983, 0.008109267801046371, 0.1751152127981186, -0.0807764083147049, -0.3178907632827759, -0.08229825645685196, 0.3928435742855072, -0.6760531067848206, -0.007174603641033173, -0.3082730770111084, -0.06250879913568497, -0.3276025652885437, -0.10673853754997253, -0.13384206593036652, -0.03078412637114525, -0.12587828934192657, 0.2887312173843384, 0.06538370251655579, 0.1711631864309311, -0.2759915888309479, -0.13603432476520538, 0.16838395595550537, -0.2710672616958618, -0.05492497980594635, 0.013766400516033173, -0.33676877617836, 0.06534256041049957, -0.08013925701379776, -0.23437418043613434, 0.155160591006279, -0.29448020458221436, 0.058536969125270844, -0.15577952563762665, -0.1939658522605896, 0.15912654995918274, -0.06684955954551697, 0.516806960105896, 0.29041188955307007, 0.15929438173770905, 0.22933778166770935, 0.08123251795768738, 0.2471798062324524, -0.04499058425426483, -0.5650161504745483, 0.06493633985519409, 0.006954200565814972, -0.09691924601793289, 0.06673526763916016, -0.4326021075248718, -0.24595610797405243, -0.4411624073982239, 0.0002761036157608032, 0.1102304756641388, 0.23662088811397552, 0.49532240629196167, 0.21623557806015015, 0.09646116197109222, 0.11324334889650345, 0.24569472670555115, -0.1564519703388214, -0.10887498408555984, 0.22722899913787842, -0.06102066859602928, -0.3378838896751404, 0.049142010509967804, 0.0018549934029579163, 0.05395093187689781, 0.27030569314956665, -0.25876718759536743, -0.24171549081802368, -0.09471771121025085, -0.12418937683105469, 0.08411306887865067, -0.05692830681800842, 0.47959986329078674, 0.16798655688762665, -0.07107514142990112, -0.1928790807723999, -0.29479724168777466, 0.14222951233386993, 0.058598458766937256, 0.1090337336063385, 0.08592812716960907, 0.38774195313453674, 0.020717911422252655, 0.30005961656570435, 0.4822211265563965, -0.07094603031873703, 0.21715369820594788, -0.10413368791341782, 0.11940103769302368, -0.3965111970901489, -0.3192795515060425, -0.07367464154958725, -0.10037171095609665, -0.08611883968114853, 0.15693072974681854, -0.0880294069647789, 0.17788898944854736, -0.25564438104629517, -0.22595855593681335, -0.41891568899154663, -0.05608569085597992, -0.15921317040920258, -0.3666827082633972, 0.33969274163246155, -0.09342672675848007, 0.10939967632293701, -0.06206898391246796, 0.22948133945465088, 0.08036591857671738, 0.30395233631134033, 0.027861524373292923, 0.14169448614120483, -0.20198267698287964, -0.10922269523143768, -0.04653113707900047, 0.459648072719574, 0.18947087228298187, 0.4361959993839264, -0.029643550515174866, -0.16876286268234253, -0.1334690898656845, 0.11893773078918457, 0.4218067228794098, -0.2767502963542938, 0.3891480267047882, 0.010051414370536804, -0.15046566724777222, 0.009603850543498993, -0.09322545677423477, 0.04414127767086029, 0.11628155410289764, -0.1654377579689026, 0.46309342980384827, -0.04481397569179535, -0.05065309628844261, 0.4316696524620056, 0.21713446080684662, -0.12984701991081238, 0.01389685645699501, -0.217119961977005, 0.09884370863437653, -0.3754485547542572, -0.12224429845809937, -0.09253682941198349, 0.19821076095104218, 0.12244167178869247, 0.02760019153356552, -0.37991949915885925, -0.22413189709186554, 0.10501054674386978, 0.05467194691300392, 0.3441373407840729, -0.3684723377227783, 0.28744763135910034, 0.2535973787307739, 0.05075366422533989, 0.1222761794924736, 0.5924530625343323, 0.006762288510799408, -0.5684106945991516, -0.13044783473014832, 0.030547533184289932, 0.19214798510074615, 0.22533005475997925, -0.1326809972524643, -0.2883659899234772, -0.19168365001678467, -0.1619640588760376, -0.16333165764808655, -0.19232508540153503, 0.2736363112926483, 0.14290708303451538, -0.2624565660953522, -0.39020562171936035, 0.49185192584991455, 0.18074065446853638, -0.1581508368253708, 0.37600386142730713, 0.26509320735931396, -0.2761305868625641, 0.20722180604934692, -0.15823113918304443, 0.7017083168029785, 0.2750161290168762, -0.03083149716258049, 0.15127986669540405, -0.18325304985046387, 0.20118924975395203, 0.5188870429992676, -0.03139244765043259, -0.5375080704689026, -0.3325987756252289, -0.181518092751503, -0.1803206503391266, 0.5236738324165344, -0.016251085326075554, -0.09835712611675262, 0.5702056884765625, -0.038235053420066833, 0.14376486837863922, 0.2811182737350464, -0.06438696384429932, -0.03413531184196472, 0.08354349434375763, -0.31078773736953735, 0.15191230177879333, -0.23670808970928192, 0.606372594833374, 0.0757354348897934, 0.0185566283762455, -0.4675038158893585, -0.4312840700149536, -0.35014650225639343, 0.17095424234867096, -0.23402079939842224, -0.07198010385036469, 0.31063392758369446, -0.546984076499939, 0.07146561145782471, 0.09914180636405945, 0.11144418269395828, 0.022795353084802628, -0.10195925086736679, 0.17363187670707703, -0.00871272012591362, 0.17636741697788239, 0.20392948389053345, -0.12554967403411865, 0.4537685215473175, -0.11370629072189331, -0.20131781697273254, 0.12865588068962097, -0.1424090564250946, -0.16699662804603577, 0.16069550812244415, -0.28795748949050903, 0.01947948709130287, -0.1694936454296112, -0.18444888293743134, -0.2075010985136032, 0.31084299087524414, -0.23505842685699463, 0.13184423744678497, -0.026609137654304504, -0.28064578771591187, -0.015768442302942276, 0.2051113247871399, -0.38177457451820374, -0.08408583700656891, 0.46010684967041016, 0.020775169134140015, 0.1481357216835022, 0.6278978586196899, 0.06162038445472717, -0.032414570450782776, -0.20901748538017273, 0.03386291116476059, 0.3367937505245209, -0.589687705039978, 0.11688908189535141, -0.2733195126056671, -0.061507537961006165, 0.10785884410142899, 0.6921044588088989, 0.1394260823726654, -0.020632442086935043, 0.1218009889125824, -0.6025596261024475, -0.05835319310426712, 0.35312414169311523, -0.40516194701194763, 0.11180592328310013, 0.009397879242897034, 0.09342073649168015, 0.04437195509672165, -0.13259346783161163, -0.2812933027744293, -0.11441446840763092, -0.09695545583963394, 0.1839824616909027, 0.1513199806213379, 0.10241562873125076, 0.2300201654434204, -0.12299975007772446, 0.17667177319526672, -0.01661650836467743, -0.15591835975646973, -0.2110200971364975, -0.2866581678390503, 0.11965522170066833, -0.11855943500995636, 0.10715033113956451, 0.060212790966033936, 0.013563752174377441, -0.08433711528778076, -0.06653385609388351, 0.026460327208042145, 0.17860189080238342, -0.06461164355278015, 0.29512089490890503, -0.12817072868347168, -0.002376314252614975, -0.044654909521341324, 0.16198621690273285, -0.2959800362586975, 0.09607070684432983, 0.10001541674137115, 0.09538230299949646, -0.06885258108377457, -0.0391385555267334, -0.29837000370025635, 0.023873819038271904, -0.4188513457775116, 0.1675497591495514, 0.4538933336734772, -0.2821718752384186, 0.15194164216518402, 0.31897619366645813, 0.30910709500312805, -0.02694963663816452, -0.22205667197704315, -0.020084697753190994, 0.01914670690894127, 0.2410488724708557, -0.40804699063301086, -0.0807034969329834, 0.01780438795685768, -0.12859757244586945, -0.02703026682138443, 0.36376237869262695, 0.08764539659023285, -0.11049219220876694, -0.1433904618024826, 0.19158847630023956, 0.5397861003875732, -0.10489945113658905, 0.2749168276786804, 0.4870842397212982, -0.0017997398972511292, 0.16349412500858307, 0.17302335798740387, 0.29159462451934814, 0.2181513011455536, 0.6151905059814453, -0.11306331306695938, -0.17024379968643188, 0.08339007198810577, 0.19057509303092957, -0.05078751593828201, -0.3759390115737915, 0.04283110424876213, 0.03844434767961502, -0.00830172747373581, 0.0422794371843338, 0.2653757929801941, 0.10618115216493607, -0.05261689051985741, -0.046144999563694, -0.04184305667877197, -0.024757372215390205, 0.010649936273694038, -0.027896352112293243, -0.17124833166599274, -0.18645043671131134, -0.25855499505996704, -0.1614018827676773, -0.21241801977157593, -0.12226052582263947, 0.4498032033443451, -0.040514711290597916, -0.1836865246295929, -0.39391186833381653, 0.01725289225578308, 0.17684948444366455, -0.005993664264678955, -0.3231850564479828, 0.3523058593273163, 0.01589389517903328, 0.05646141618490219, 0.26190829277038574, 0.474691778421402, 0.5762162208557129, 0.26602426171302795, -0.016791820526123047, -0.12223540246486664, -0.1793345957994461, -0.2795043885707855, 0.06438519060611725, 0.04960399493575096, -0.3697408437728882, -0.0953240692615509, 0.42592915892601013, 0.1816580593585968, -0.025455428287386894, 0.15577679872512817, -0.10998933017253876, 0.04514249414205551, -0.46485400199890137, 0.8607051968574524, -0.22318461537361145, -0.1575237512588501, -0.18236905336380005, 0.19049791991710663, -0.2800964117050171, -0.018042314797639847, 0.04545394703745842, 0.17007389664649963, -0.014324449002742767, 0.03685418888926506, 0.08471499383449554, 0.10592954605817795, 0.1833280771970749, 0.43289053440093994, 0.2227998673915863, -0.2850738763809204, -0.04221544414758682, -0.4788191318511963, 0.1273762583732605, -0.1419496238231659, 0.020425893366336823, 0.06913934648036957, 0.14779579639434814, -0.06743735074996948, 0.14509809017181396, 0.23207664489746094, 0.1443541795015335, 0.1084919348359108, 0.20820163190364838, -0.12236088514328003, -0.4267936646938324, 0.02355518750846386, -0.03343842178583145, -0.048129722476005554, -0.46387457847595215, -0.01384550891816616, -0.06504574418067932, 0.12396888434886932, -0.012160169892013073, -0.18017680943012238, 0.17523902654647827, -0.1798352599143982, 0.35833606123924255, 0.14979849755764008, 0.317350298166275, 0.02398974448442459, -0.06951539218425751, -0.22229528427124023, -0.11997352540493011, -0.3201659917831421, 0.3677625060081482, -0.04045631363987923, 0.32683154940605164, -0.0034880340099334717, 0.039740171283483505, -0.24294140934944153, 0.2222931981086731, -0.0517238974571228, 0.003929343074560165, -0.44277316331863403, 0.4570198655128479, -0.17735609412193298, 0.0110568106174469, 0.010276313871145248, 0.1501319408416748, -0.10889895260334015, 0.2230464518070221, -0.3372287154197693, -0.5263574719429016, 0.40438926219940186, -0.26132479310035706, -0.17815083265304565, 0.006376940757036209, 0.38749945163726807, 0.37436723709106445, -0.08998217433691025, -0.4418724477291107, 0.10204087197780609, 0.4646379053592682, -0.04991661757230759, -0.1145220547914505, 0.2213282436132431, -0.1377454400062561, 0.16048702597618103, 0.10197989642620087, 0.5593533515930176, 0.041673291474580765, 0.04219357669353485, 0.026852712035179138, -0.24222418665885925 ]
https://github.com/huggingface/datasets/issues/5749
Apart form data host server being down, there is an additional issue with the `datasets` library introduced by this PR: - #5238 I am working to fix it.
AttributeError: 'Version' object has no attribute 'match'
### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3
28
AttributeError: 'Version' object has no attribute 'match' ### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3 Apart form data host server being down, there is an additional issue with the `datasets` library introduced by this PR: - #5238 I am working to fix it.
[ -0.19554170966148376, 0.019373491406440735, 0.01434849202632904, 0.2700212299823761, 0.32112330198287964, 0.046529993414878845, 0.24270014464855194, 0.5838724970817566, 0.28396525979042053, 0.25258180499076843, 0.18423843383789062, 0.2591090202331543, 0.06297559291124344, 0.18058335781097412, -0.1841655671596527, -0.31374624371528625, 0.028639934957027435, 0.3809821605682373, -0.2248632311820984, -0.10082150250673294, -0.21145474910736084, 0.2588158845901489, -0.13443586230278015, 0.257469117641449, -0.14275160431861877, -0.05305512249469757, 0.07329032570123672, 0.12121979892253876, -0.05994555726647377, -0.5016893744468689, 0.2564443349838257, -0.47022438049316406, 0.1583966612815857, 0.3401408791542053, -0.0001134037011070177, -0.030913017690181732, 0.3680552840232849, -0.048902373760938644, -0.4858623147010803, -0.342181921005249, -0.1922387182712555, -0.11220534145832062, 0.12563076615333557, 0.006693899631500244, -0.08859129995107651, -0.2761288285255432, -0.10518481582403183, -0.38265809416770935, 0.012195806950330734, 0.1859949231147766, 0.23871304094791412, 0.19226276874542236, 0.2750442922115326, -0.2346031814813614, 0.21039897203445435, -0.02744220197200775, -0.08439455181360245, 0.22092872858047485, 0.2621377110481262, 0.017886236310005188, 0.22091880440711975, 0.37340086698532104, -0.09937520325183868, 0.30927520990371704, 0.12260476499795914, 0.005489800125360489, 0.2620481252670288, -0.12026835232973099, 0.11258835345506668, 0.14713852107524872, 0.6393735408782959, -0.32852691411972046, -0.6078495383262634, 0.019094079732894897, -0.023614823818206787, -0.3823280334472656, 0.18983125686645508, -0.06574016809463501, -0.10311548411846161, 0.17057576775550842, -0.2525330185890198, -0.009170807898044586, -0.1728745996952057, -0.03534740209579468, -0.1076408326625824, -0.09033136814832687, -0.03820839896798134, 0.018084626644849777, -0.17774765193462372, -0.0457402765750885, 0.03128198906779289, -0.17354735732078552, -0.2493513971567154, 0.31612247228622437, -0.48160266876220703, -0.06948361545801163, -0.26345378160476685, 0.1268620491027832, 0.2517041862010956, 0.27407485246658325, 0.09238070249557495, -0.2736469507217407, 0.028384044766426086, 0.10033340752124786, 0.18804728984832764, 0.4008617103099823, 0.09121257066726685, 0.31657126545906067, -0.0361027866601944, -0.07960639148950577, -0.15487998723983765, -0.01979619264602661, -0.021120373159646988, -0.3436775505542755, 0.2899298667907715, 0.23576220870018005, 0.429374098777771, -0.44922226667404175, -0.349854439496994, 0.15076203644275665, -0.43255889415740967, 0.0965631753206253, -0.10642769932746887, 0.23045791685581207, -0.16472019255161285, 0.16438287496566772, 0.2359602451324463, 0.11871587485074997, -0.28685903549194336, -0.42455214262008667, -0.3329216539859772, 0.029138583689928055, -0.034266211092472076, -0.06494632363319397, -0.015328936278820038, -0.09831125289201736, 0.2469440996646881, -0.16513526439666748, 0.04536484554409981, -0.10714158415794373, -0.0684562474489212, -0.14932458102703094, -0.15222248435020447, 0.42972713708877563, -0.13686907291412354, 0.26840224862098694, 0.2735305726528168, -0.3405449390411377, -0.08970452100038528, 0.15821398794651031, -0.2817765474319458, -0.28332334756851196, -0.1478995829820633, 0.23243869841098785, -0.3355938494205475, -0.044288817793130875, -0.17536713182926178, -0.24373780190944672, 0.09656397998332977, -0.15237924456596375, -0.14979767799377441, -0.21141844987869263, -0.2056483030319214, -0.2941035032272339, 0.24759772419929504, 0.5259004235267639, -0.38413238525390625, -0.1878320723772049, 0.0659884512424469, 0.003676127642393112, 0.008795466274023056, -0.011898561380803585, 0.17705604434013367, 0.19465462863445282, -0.12826883792877197, -0.09054155647754669, 0.4242992103099823, -0.5693094730377197, -0.4758452773094177, 0.46181631088256836, -0.10572050511837006, 0.10944394022226334, 0.18837133049964905, -0.1252211183309555, 0.13802815973758698, -0.02544894628226757, 0.2216733694076538, 0.12380420416593552, 0.04702530801296234, 0.09351401031017303, -0.08748362958431244, -0.27221766114234924, 0.03200332447886467, 0.03129573166370392, 0.03442297875881195, 0.2756645679473877, 0.14564630389213562, -0.19005146622657776, 0.16842782497406006, -0.05104285851120949, -0.0189839918166399, 0.14224229753017426, 0.3411916196346283, -0.03134899213910103, 0.11403924226760864, -0.19454477727413177, -0.4897097945213318, 0.36006420850753784, -0.08292049914598465, 0.021845240145921707, 0.07272239029407501, -0.008997038006782532, -0.40825963020324707, 0.06103774905204773, -0.4392084777355194, -0.439272940158844, 0.0904359295964241, -0.005305130034685135, 0.03261909633874893, 0.03943507373332977, -0.08449145406484604, 0.4135861098766327, -0.06717968732118607, 0.18381594121456146, -0.3058442175388336, 0.3117997944355011, -0.27434664964675903, -0.12933200597763062, 0.1465597301721573, 0.10486696660518646, 0.14218582212924957, 0.029740918427705765, -0.23988427221775055, 0.2925357222557068, 0.013325817883014679, 0.37458840012550354, -0.001173145603388548, -0.018157556653022766, 0.0888519212603569, -0.14557607471942902, 0.046900682151317596, 0.12697085738182068, 0.3020290434360504, 0.1367306411266327, 0.15465396642684937, 0.07671202719211578, 0.1407211273908615, 0.2628413438796997, -0.028325803577899933, 0.09313786029815674, 0.2444712370634079, -0.1081666499376297, -0.025006812065839767, -0.23845116794109344, 0.15128959715366364, 0.009113054722547531, 0.3467402160167694, -0.0028079207986593246, -0.303058922290802, -0.07340143620967865, 0.23502716422080994, 0.0067840516567230225, 0.09929884970188141, -0.07021450996398926, -0.410245805978775, 0.19543775916099548, -0.020663294941186905, 0.20316193997859955, 0.49709099531173706, 0.2070240080356598, -0.10401064902544022, 0.15568773448467255, -0.06992370635271072, -0.0011065490543842316, 0.1899898648262024, 0.08450832962989807, 0.46247005462646484, 0.36035293340682983, 0.008109267801046371, 0.1751152127981186, -0.0807764083147049, -0.3178907632827759, -0.08229825645685196, 0.3928435742855072, -0.6760531067848206, -0.007174603641033173, -0.3082730770111084, -0.06250879913568497, -0.3276025652885437, -0.10673853754997253, -0.13384206593036652, -0.03078412637114525, -0.12587828934192657, 0.2887312173843384, 0.06538370251655579, 0.1711631864309311, -0.2759915888309479, -0.13603432476520538, 0.16838395595550537, -0.2710672616958618, -0.05492497980594635, 0.013766400516033173, -0.33676877617836, 0.06534256041049957, -0.08013925701379776, -0.23437418043613434, 0.155160591006279, -0.29448020458221436, 0.058536969125270844, -0.15577952563762665, -0.1939658522605896, 0.15912654995918274, -0.06684955954551697, 0.516806960105896, 0.29041188955307007, 0.15929438173770905, 0.22933778166770935, 0.08123251795768738, 0.2471798062324524, -0.04499058425426483, -0.5650161504745483, 0.06493633985519409, 0.006954200565814972, -0.09691924601793289, 0.06673526763916016, -0.4326021075248718, -0.24595610797405243, -0.4411624073982239, 0.0002761036157608032, 0.1102304756641388, 0.23662088811397552, 0.49532240629196167, 0.21623557806015015, 0.09646116197109222, 0.11324334889650345, 0.24569472670555115, -0.1564519703388214, -0.10887498408555984, 0.22722899913787842, -0.06102066859602928, -0.3378838896751404, 0.049142010509967804, 0.0018549934029579163, 0.05395093187689781, 0.27030569314956665, -0.25876718759536743, -0.24171549081802368, -0.09471771121025085, -0.12418937683105469, 0.08411306887865067, -0.05692830681800842, 0.47959986329078674, 0.16798655688762665, -0.07107514142990112, -0.1928790807723999, -0.29479724168777466, 0.14222951233386993, 0.058598458766937256, 0.1090337336063385, 0.08592812716960907, 0.38774195313453674, 0.020717911422252655, 0.30005961656570435, 0.4822211265563965, -0.07094603031873703, 0.21715369820594788, -0.10413368791341782, 0.11940103769302368, -0.3965111970901489, -0.3192795515060425, -0.07367464154958725, -0.10037171095609665, -0.08611883968114853, 0.15693072974681854, -0.0880294069647789, 0.17788898944854736, -0.25564438104629517, -0.22595855593681335, -0.41891568899154663, -0.05608569085597992, -0.15921317040920258, -0.3666827082633972, 0.33969274163246155, -0.09342672675848007, 0.10939967632293701, -0.06206898391246796, 0.22948133945465088, 0.08036591857671738, 0.30395233631134033, 0.027861524373292923, 0.14169448614120483, -0.20198267698287964, -0.10922269523143768, -0.04653113707900047, 0.459648072719574, 0.18947087228298187, 0.4361959993839264, -0.029643550515174866, -0.16876286268234253, -0.1334690898656845, 0.11893773078918457, 0.4218067228794098, -0.2767502963542938, 0.3891480267047882, 0.010051414370536804, -0.15046566724777222, 0.009603850543498993, -0.09322545677423477, 0.04414127767086029, 0.11628155410289764, -0.1654377579689026, 0.46309342980384827, -0.04481397569179535, -0.05065309628844261, 0.4316696524620056, 0.21713446080684662, -0.12984701991081238, 0.01389685645699501, -0.217119961977005, 0.09884370863437653, -0.3754485547542572, -0.12224429845809937, -0.09253682941198349, 0.19821076095104218, 0.12244167178869247, 0.02760019153356552, -0.37991949915885925, -0.22413189709186554, 0.10501054674386978, 0.05467194691300392, 0.3441373407840729, -0.3684723377227783, 0.28744763135910034, 0.2535973787307739, 0.05075366422533989, 0.1222761794924736, 0.5924530625343323, 0.006762288510799408, -0.5684106945991516, -0.13044783473014832, 0.030547533184289932, 0.19214798510074615, 0.22533005475997925, -0.1326809972524643, -0.2883659899234772, -0.19168365001678467, -0.1619640588760376, -0.16333165764808655, -0.19232508540153503, 0.2736363112926483, 0.14290708303451538, -0.2624565660953522, -0.39020562171936035, 0.49185192584991455, 0.18074065446853638, -0.1581508368253708, 0.37600386142730713, 0.26509320735931396, -0.2761305868625641, 0.20722180604934692, -0.15823113918304443, 0.7017083168029785, 0.2750161290168762, -0.03083149716258049, 0.15127986669540405, -0.18325304985046387, 0.20118924975395203, 0.5188870429992676, -0.03139244765043259, -0.5375080704689026, -0.3325987756252289, -0.181518092751503, -0.1803206503391266, 0.5236738324165344, -0.016251085326075554, -0.09835712611675262, 0.5702056884765625, -0.038235053420066833, 0.14376486837863922, 0.2811182737350464, -0.06438696384429932, -0.03413531184196472, 0.08354349434375763, -0.31078773736953735, 0.15191230177879333, -0.23670808970928192, 0.606372594833374, 0.0757354348897934, 0.0185566283762455, -0.4675038158893585, -0.4312840700149536, -0.35014650225639343, 0.17095424234867096, -0.23402079939842224, -0.07198010385036469, 0.31063392758369446, -0.546984076499939, 0.07146561145782471, 0.09914180636405945, 0.11144418269395828, 0.022795353084802628, -0.10195925086736679, 0.17363187670707703, -0.00871272012591362, 0.17636741697788239, 0.20392948389053345, -0.12554967403411865, 0.4537685215473175, -0.11370629072189331, -0.20131781697273254, 0.12865588068962097, -0.1424090564250946, -0.16699662804603577, 0.16069550812244415, -0.28795748949050903, 0.01947948709130287, -0.1694936454296112, -0.18444888293743134, -0.2075010985136032, 0.31084299087524414, -0.23505842685699463, 0.13184423744678497, -0.026609137654304504, -0.28064578771591187, -0.015768442302942276, 0.2051113247871399, -0.38177457451820374, -0.08408583700656891, 0.46010684967041016, 0.020775169134140015, 0.1481357216835022, 0.6278978586196899, 0.06162038445472717, -0.032414570450782776, -0.20901748538017273, 0.03386291116476059, 0.3367937505245209, -0.589687705039978, 0.11688908189535141, -0.2733195126056671, -0.061507537961006165, 0.10785884410142899, 0.6921044588088989, 0.1394260823726654, -0.020632442086935043, 0.1218009889125824, -0.6025596261024475, -0.05835319310426712, 0.35312414169311523, -0.40516194701194763, 0.11180592328310013, 0.009397879242897034, 0.09342073649168015, 0.04437195509672165, -0.13259346783161163, -0.2812933027744293, -0.11441446840763092, -0.09695545583963394, 0.1839824616909027, 0.1513199806213379, 0.10241562873125076, 0.2300201654434204, -0.12299975007772446, 0.17667177319526672, -0.01661650836467743, -0.15591835975646973, -0.2110200971364975, -0.2866581678390503, 0.11965522170066833, -0.11855943500995636, 0.10715033113956451, 0.060212790966033936, 0.013563752174377441, -0.08433711528778076, -0.06653385609388351, 0.026460327208042145, 0.17860189080238342, -0.06461164355278015, 0.29512089490890503, -0.12817072868347168, -0.002376314252614975, -0.044654909521341324, 0.16198621690273285, -0.2959800362586975, 0.09607070684432983, 0.10001541674137115, 0.09538230299949646, -0.06885258108377457, -0.0391385555267334, -0.29837000370025635, 0.023873819038271904, -0.4188513457775116, 0.1675497591495514, 0.4538933336734772, -0.2821718752384186, 0.15194164216518402, 0.31897619366645813, 0.30910709500312805, -0.02694963663816452, -0.22205667197704315, -0.020084697753190994, 0.01914670690894127, 0.2410488724708557, -0.40804699063301086, -0.0807034969329834, 0.01780438795685768, -0.12859757244586945, -0.02703026682138443, 0.36376237869262695, 0.08764539659023285, -0.11049219220876694, -0.1433904618024826, 0.19158847630023956, 0.5397861003875732, -0.10489945113658905, 0.2749168276786804, 0.4870842397212982, -0.0017997398972511292, 0.16349412500858307, 0.17302335798740387, 0.29159462451934814, 0.2181513011455536, 0.6151905059814453, -0.11306331306695938, -0.17024379968643188, 0.08339007198810577, 0.19057509303092957, -0.05078751593828201, -0.3759390115737915, 0.04283110424876213, 0.03844434767961502, -0.00830172747373581, 0.0422794371843338, 0.2653757929801941, 0.10618115216493607, -0.05261689051985741, -0.046144999563694, -0.04184305667877197, -0.024757372215390205, 0.010649936273694038, -0.027896352112293243, -0.17124833166599274, -0.18645043671131134, -0.25855499505996704, -0.1614018827676773, -0.21241801977157593, -0.12226052582263947, 0.4498032033443451, -0.040514711290597916, -0.1836865246295929, -0.39391186833381653, 0.01725289225578308, 0.17684948444366455, -0.005993664264678955, -0.3231850564479828, 0.3523058593273163, 0.01589389517903328, 0.05646141618490219, 0.26190829277038574, 0.474691778421402, 0.5762162208557129, 0.26602426171302795, -0.016791820526123047, -0.12223540246486664, -0.1793345957994461, -0.2795043885707855, 0.06438519060611725, 0.04960399493575096, -0.3697408437728882, -0.0953240692615509, 0.42592915892601013, 0.1816580593585968, -0.025455428287386894, 0.15577679872512817, -0.10998933017253876, 0.04514249414205551, -0.46485400199890137, 0.8607051968574524, -0.22318461537361145, -0.1575237512588501, -0.18236905336380005, 0.19049791991710663, -0.2800964117050171, -0.018042314797639847, 0.04545394703745842, 0.17007389664649963, -0.014324449002742767, 0.03685418888926506, 0.08471499383449554, 0.10592954605817795, 0.1833280771970749, 0.43289053440093994, 0.2227998673915863, -0.2850738763809204, -0.04221544414758682, -0.4788191318511963, 0.1273762583732605, -0.1419496238231659, 0.020425893366336823, 0.06913934648036957, 0.14779579639434814, -0.06743735074996948, 0.14509809017181396, 0.23207664489746094, 0.1443541795015335, 0.1084919348359108, 0.20820163190364838, -0.12236088514328003, -0.4267936646938324, 0.02355518750846386, -0.03343842178583145, -0.048129722476005554, -0.46387457847595215, -0.01384550891816616, -0.06504574418067932, 0.12396888434886932, -0.012160169892013073, -0.18017680943012238, 0.17523902654647827, -0.1798352599143982, 0.35833606123924255, 0.14979849755764008, 0.317350298166275, 0.02398974448442459, -0.06951539218425751, -0.22229528427124023, -0.11997352540493011, -0.3201659917831421, 0.3677625060081482, -0.04045631363987923, 0.32683154940605164, -0.0034880340099334717, 0.039740171283483505, -0.24294140934944153, 0.2222931981086731, -0.0517238974571228, 0.003929343074560165, -0.44277316331863403, 0.4570198655128479, -0.17735609412193298, 0.0110568106174469, 0.010276313871145248, 0.1501319408416748, -0.10889895260334015, 0.2230464518070221, -0.3372287154197693, -0.5263574719429016, 0.40438926219940186, -0.26132479310035706, -0.17815083265304565, 0.006376940757036209, 0.38749945163726807, 0.37436723709106445, -0.08998217433691025, -0.4418724477291107, 0.10204087197780609, 0.4646379053592682, -0.04991661757230759, -0.1145220547914505, 0.2213282436132431, -0.1377454400062561, 0.16048702597618103, 0.10197989642620087, 0.5593533515930176, 0.041673291474580765, 0.04219357669353485, 0.026852712035179138, -0.24222418665885925 ]
https://github.com/huggingface/datasets/issues/5749
For the issue with their data host server being down, I have opened a discussion in the "Community" tab of the Hub dataset: https://huggingface.co/datasets/visual_genome/discussions/3 Let's continue the discussion there.
AttributeError: 'Version' object has no attribute 'match'
### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3
29
AttributeError: 'Version' object has no attribute 'match' ### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3 For the issue with their data host server being down, I have opened a discussion in the "Community" tab of the Hub dataset: https://huggingface.co/datasets/visual_genome/discussions/3 Let's continue the discussion there.
[ -0.19554170966148376, 0.019373491406440735, 0.01434849202632904, 0.2700212299823761, 0.32112330198287964, 0.046529993414878845, 0.24270014464855194, 0.5838724970817566, 0.28396525979042053, 0.25258180499076843, 0.18423843383789062, 0.2591090202331543, 0.06297559291124344, 0.18058335781097412, -0.1841655671596527, -0.31374624371528625, 0.028639934957027435, 0.3809821605682373, -0.2248632311820984, -0.10082150250673294, -0.21145474910736084, 0.2588158845901489, -0.13443586230278015, 0.257469117641449, -0.14275160431861877, -0.05305512249469757, 0.07329032570123672, 0.12121979892253876, -0.05994555726647377, -0.5016893744468689, 0.2564443349838257, -0.47022438049316406, 0.1583966612815857, 0.3401408791542053, -0.0001134037011070177, -0.030913017690181732, 0.3680552840232849, -0.048902373760938644, -0.4858623147010803, -0.342181921005249, -0.1922387182712555, -0.11220534145832062, 0.12563076615333557, 0.006693899631500244, -0.08859129995107651, -0.2761288285255432, -0.10518481582403183, -0.38265809416770935, 0.012195806950330734, 0.1859949231147766, 0.23871304094791412, 0.19226276874542236, 0.2750442922115326, -0.2346031814813614, 0.21039897203445435, -0.02744220197200775, -0.08439455181360245, 0.22092872858047485, 0.2621377110481262, 0.017886236310005188, 0.22091880440711975, 0.37340086698532104, -0.09937520325183868, 0.30927520990371704, 0.12260476499795914, 0.005489800125360489, 0.2620481252670288, -0.12026835232973099, 0.11258835345506668, 0.14713852107524872, 0.6393735408782959, -0.32852691411972046, -0.6078495383262634, 0.019094079732894897, -0.023614823818206787, -0.3823280334472656, 0.18983125686645508, -0.06574016809463501, -0.10311548411846161, 0.17057576775550842, -0.2525330185890198, -0.009170807898044586, -0.1728745996952057, -0.03534740209579468, -0.1076408326625824, -0.09033136814832687, -0.03820839896798134, 0.018084626644849777, -0.17774765193462372, -0.0457402765750885, 0.03128198906779289, -0.17354735732078552, -0.2493513971567154, 0.31612247228622437, -0.48160266876220703, -0.06948361545801163, -0.26345378160476685, 0.1268620491027832, 0.2517041862010956, 0.27407485246658325, 0.09238070249557495, -0.2736469507217407, 0.028384044766426086, 0.10033340752124786, 0.18804728984832764, 0.4008617103099823, 0.09121257066726685, 0.31657126545906067, -0.0361027866601944, -0.07960639148950577, -0.15487998723983765, -0.01979619264602661, -0.021120373159646988, -0.3436775505542755, 0.2899298667907715, 0.23576220870018005, 0.429374098777771, -0.44922226667404175, -0.349854439496994, 0.15076203644275665, -0.43255889415740967, 0.0965631753206253, -0.10642769932746887, 0.23045791685581207, -0.16472019255161285, 0.16438287496566772, 0.2359602451324463, 0.11871587485074997, -0.28685903549194336, -0.42455214262008667, -0.3329216539859772, 0.029138583689928055, -0.034266211092472076, -0.06494632363319397, -0.015328936278820038, -0.09831125289201736, 0.2469440996646881, -0.16513526439666748, 0.04536484554409981, -0.10714158415794373, -0.0684562474489212, -0.14932458102703094, -0.15222248435020447, 0.42972713708877563, -0.13686907291412354, 0.26840224862098694, 0.2735305726528168, -0.3405449390411377, -0.08970452100038528, 0.15821398794651031, -0.2817765474319458, -0.28332334756851196, -0.1478995829820633, 0.23243869841098785, -0.3355938494205475, -0.044288817793130875, -0.17536713182926178, -0.24373780190944672, 0.09656397998332977, -0.15237924456596375, -0.14979767799377441, -0.21141844987869263, -0.2056483030319214, -0.2941035032272339, 0.24759772419929504, 0.5259004235267639, -0.38413238525390625, -0.1878320723772049, 0.0659884512424469, 0.003676127642393112, 0.008795466274023056, -0.011898561380803585, 0.17705604434013367, 0.19465462863445282, -0.12826883792877197, -0.09054155647754669, 0.4242992103099823, -0.5693094730377197, -0.4758452773094177, 0.46181631088256836, -0.10572050511837006, 0.10944394022226334, 0.18837133049964905, -0.1252211183309555, 0.13802815973758698, -0.02544894628226757, 0.2216733694076538, 0.12380420416593552, 0.04702530801296234, 0.09351401031017303, -0.08748362958431244, -0.27221766114234924, 0.03200332447886467, 0.03129573166370392, 0.03442297875881195, 0.2756645679473877, 0.14564630389213562, -0.19005146622657776, 0.16842782497406006, -0.05104285851120949, -0.0189839918166399, 0.14224229753017426, 0.3411916196346283, -0.03134899213910103, 0.11403924226760864, -0.19454477727413177, -0.4897097945213318, 0.36006420850753784, -0.08292049914598465, 0.021845240145921707, 0.07272239029407501, -0.008997038006782532, -0.40825963020324707, 0.06103774905204773, -0.4392084777355194, -0.439272940158844, 0.0904359295964241, -0.005305130034685135, 0.03261909633874893, 0.03943507373332977, -0.08449145406484604, 0.4135861098766327, -0.06717968732118607, 0.18381594121456146, -0.3058442175388336, 0.3117997944355011, -0.27434664964675903, -0.12933200597763062, 0.1465597301721573, 0.10486696660518646, 0.14218582212924957, 0.029740918427705765, -0.23988427221775055, 0.2925357222557068, 0.013325817883014679, 0.37458840012550354, -0.001173145603388548, -0.018157556653022766, 0.0888519212603569, -0.14557607471942902, 0.046900682151317596, 0.12697085738182068, 0.3020290434360504, 0.1367306411266327, 0.15465396642684937, 0.07671202719211578, 0.1407211273908615, 0.2628413438796997, -0.028325803577899933, 0.09313786029815674, 0.2444712370634079, -0.1081666499376297, -0.025006812065839767, -0.23845116794109344, 0.15128959715366364, 0.009113054722547531, 0.3467402160167694, -0.0028079207986593246, -0.303058922290802, -0.07340143620967865, 0.23502716422080994, 0.0067840516567230225, 0.09929884970188141, -0.07021450996398926, -0.410245805978775, 0.19543775916099548, -0.020663294941186905, 0.20316193997859955, 0.49709099531173706, 0.2070240080356598, -0.10401064902544022, 0.15568773448467255, -0.06992370635271072, -0.0011065490543842316, 0.1899898648262024, 0.08450832962989807, 0.46247005462646484, 0.36035293340682983, 0.008109267801046371, 0.1751152127981186, -0.0807764083147049, -0.3178907632827759, -0.08229825645685196, 0.3928435742855072, -0.6760531067848206, -0.007174603641033173, -0.3082730770111084, -0.06250879913568497, -0.3276025652885437, -0.10673853754997253, -0.13384206593036652, -0.03078412637114525, -0.12587828934192657, 0.2887312173843384, 0.06538370251655579, 0.1711631864309311, -0.2759915888309479, -0.13603432476520538, 0.16838395595550537, -0.2710672616958618, -0.05492497980594635, 0.013766400516033173, -0.33676877617836, 0.06534256041049957, -0.08013925701379776, -0.23437418043613434, 0.155160591006279, -0.29448020458221436, 0.058536969125270844, -0.15577952563762665, -0.1939658522605896, 0.15912654995918274, -0.06684955954551697, 0.516806960105896, 0.29041188955307007, 0.15929438173770905, 0.22933778166770935, 0.08123251795768738, 0.2471798062324524, -0.04499058425426483, -0.5650161504745483, 0.06493633985519409, 0.006954200565814972, -0.09691924601793289, 0.06673526763916016, -0.4326021075248718, -0.24595610797405243, -0.4411624073982239, 0.0002761036157608032, 0.1102304756641388, 0.23662088811397552, 0.49532240629196167, 0.21623557806015015, 0.09646116197109222, 0.11324334889650345, 0.24569472670555115, -0.1564519703388214, -0.10887498408555984, 0.22722899913787842, -0.06102066859602928, -0.3378838896751404, 0.049142010509967804, 0.0018549934029579163, 0.05395093187689781, 0.27030569314956665, -0.25876718759536743, -0.24171549081802368, -0.09471771121025085, -0.12418937683105469, 0.08411306887865067, -0.05692830681800842, 0.47959986329078674, 0.16798655688762665, -0.07107514142990112, -0.1928790807723999, -0.29479724168777466, 0.14222951233386993, 0.058598458766937256, 0.1090337336063385, 0.08592812716960907, 0.38774195313453674, 0.020717911422252655, 0.30005961656570435, 0.4822211265563965, -0.07094603031873703, 0.21715369820594788, -0.10413368791341782, 0.11940103769302368, -0.3965111970901489, -0.3192795515060425, -0.07367464154958725, -0.10037171095609665, -0.08611883968114853, 0.15693072974681854, -0.0880294069647789, 0.17788898944854736, -0.25564438104629517, -0.22595855593681335, -0.41891568899154663, -0.05608569085597992, -0.15921317040920258, -0.3666827082633972, 0.33969274163246155, -0.09342672675848007, 0.10939967632293701, -0.06206898391246796, 0.22948133945465088, 0.08036591857671738, 0.30395233631134033, 0.027861524373292923, 0.14169448614120483, -0.20198267698287964, -0.10922269523143768, -0.04653113707900047, 0.459648072719574, 0.18947087228298187, 0.4361959993839264, -0.029643550515174866, -0.16876286268234253, -0.1334690898656845, 0.11893773078918457, 0.4218067228794098, -0.2767502963542938, 0.3891480267047882, 0.010051414370536804, -0.15046566724777222, 0.009603850543498993, -0.09322545677423477, 0.04414127767086029, 0.11628155410289764, -0.1654377579689026, 0.46309342980384827, -0.04481397569179535, -0.05065309628844261, 0.4316696524620056, 0.21713446080684662, -0.12984701991081238, 0.01389685645699501, -0.217119961977005, 0.09884370863437653, -0.3754485547542572, -0.12224429845809937, -0.09253682941198349, 0.19821076095104218, 0.12244167178869247, 0.02760019153356552, -0.37991949915885925, -0.22413189709186554, 0.10501054674386978, 0.05467194691300392, 0.3441373407840729, -0.3684723377227783, 0.28744763135910034, 0.2535973787307739, 0.05075366422533989, 0.1222761794924736, 0.5924530625343323, 0.006762288510799408, -0.5684106945991516, -0.13044783473014832, 0.030547533184289932, 0.19214798510074615, 0.22533005475997925, -0.1326809972524643, -0.2883659899234772, -0.19168365001678467, -0.1619640588760376, -0.16333165764808655, -0.19232508540153503, 0.2736363112926483, 0.14290708303451538, -0.2624565660953522, -0.39020562171936035, 0.49185192584991455, 0.18074065446853638, -0.1581508368253708, 0.37600386142730713, 0.26509320735931396, -0.2761305868625641, 0.20722180604934692, -0.15823113918304443, 0.7017083168029785, 0.2750161290168762, -0.03083149716258049, 0.15127986669540405, -0.18325304985046387, 0.20118924975395203, 0.5188870429992676, -0.03139244765043259, -0.5375080704689026, -0.3325987756252289, -0.181518092751503, -0.1803206503391266, 0.5236738324165344, -0.016251085326075554, -0.09835712611675262, 0.5702056884765625, -0.038235053420066833, 0.14376486837863922, 0.2811182737350464, -0.06438696384429932, -0.03413531184196472, 0.08354349434375763, -0.31078773736953735, 0.15191230177879333, -0.23670808970928192, 0.606372594833374, 0.0757354348897934, 0.0185566283762455, -0.4675038158893585, -0.4312840700149536, -0.35014650225639343, 0.17095424234867096, -0.23402079939842224, -0.07198010385036469, 0.31063392758369446, -0.546984076499939, 0.07146561145782471, 0.09914180636405945, 0.11144418269395828, 0.022795353084802628, -0.10195925086736679, 0.17363187670707703, -0.00871272012591362, 0.17636741697788239, 0.20392948389053345, -0.12554967403411865, 0.4537685215473175, -0.11370629072189331, -0.20131781697273254, 0.12865588068962097, -0.1424090564250946, -0.16699662804603577, 0.16069550812244415, -0.28795748949050903, 0.01947948709130287, -0.1694936454296112, -0.18444888293743134, -0.2075010985136032, 0.31084299087524414, -0.23505842685699463, 0.13184423744678497, -0.026609137654304504, -0.28064578771591187, -0.015768442302942276, 0.2051113247871399, -0.38177457451820374, -0.08408583700656891, 0.46010684967041016, 0.020775169134140015, 0.1481357216835022, 0.6278978586196899, 0.06162038445472717, -0.032414570450782776, -0.20901748538017273, 0.03386291116476059, 0.3367937505245209, -0.589687705039978, 0.11688908189535141, -0.2733195126056671, -0.061507537961006165, 0.10785884410142899, 0.6921044588088989, 0.1394260823726654, -0.020632442086935043, 0.1218009889125824, -0.6025596261024475, -0.05835319310426712, 0.35312414169311523, -0.40516194701194763, 0.11180592328310013, 0.009397879242897034, 0.09342073649168015, 0.04437195509672165, -0.13259346783161163, -0.2812933027744293, -0.11441446840763092, -0.09695545583963394, 0.1839824616909027, 0.1513199806213379, 0.10241562873125076, 0.2300201654434204, -0.12299975007772446, 0.17667177319526672, -0.01661650836467743, -0.15591835975646973, -0.2110200971364975, -0.2866581678390503, 0.11965522170066833, -0.11855943500995636, 0.10715033113956451, 0.060212790966033936, 0.013563752174377441, -0.08433711528778076, -0.06653385609388351, 0.026460327208042145, 0.17860189080238342, -0.06461164355278015, 0.29512089490890503, -0.12817072868347168, -0.002376314252614975, -0.044654909521341324, 0.16198621690273285, -0.2959800362586975, 0.09607070684432983, 0.10001541674137115, 0.09538230299949646, -0.06885258108377457, -0.0391385555267334, -0.29837000370025635, 0.023873819038271904, -0.4188513457775116, 0.1675497591495514, 0.4538933336734772, -0.2821718752384186, 0.15194164216518402, 0.31897619366645813, 0.30910709500312805, -0.02694963663816452, -0.22205667197704315, -0.020084697753190994, 0.01914670690894127, 0.2410488724708557, -0.40804699063301086, -0.0807034969329834, 0.01780438795685768, -0.12859757244586945, -0.02703026682138443, 0.36376237869262695, 0.08764539659023285, -0.11049219220876694, -0.1433904618024826, 0.19158847630023956, 0.5397861003875732, -0.10489945113658905, 0.2749168276786804, 0.4870842397212982, -0.0017997398972511292, 0.16349412500858307, 0.17302335798740387, 0.29159462451934814, 0.2181513011455536, 0.6151905059814453, -0.11306331306695938, -0.17024379968643188, 0.08339007198810577, 0.19057509303092957, -0.05078751593828201, -0.3759390115737915, 0.04283110424876213, 0.03844434767961502, -0.00830172747373581, 0.0422794371843338, 0.2653757929801941, 0.10618115216493607, -0.05261689051985741, -0.046144999563694, -0.04184305667877197, -0.024757372215390205, 0.010649936273694038, -0.027896352112293243, -0.17124833166599274, -0.18645043671131134, -0.25855499505996704, -0.1614018827676773, -0.21241801977157593, -0.12226052582263947, 0.4498032033443451, -0.040514711290597916, -0.1836865246295929, -0.39391186833381653, 0.01725289225578308, 0.17684948444366455, -0.005993664264678955, -0.3231850564479828, 0.3523058593273163, 0.01589389517903328, 0.05646141618490219, 0.26190829277038574, 0.474691778421402, 0.5762162208557129, 0.26602426171302795, -0.016791820526123047, -0.12223540246486664, -0.1793345957994461, -0.2795043885707855, 0.06438519060611725, 0.04960399493575096, -0.3697408437728882, -0.0953240692615509, 0.42592915892601013, 0.1816580593585968, -0.025455428287386894, 0.15577679872512817, -0.10998933017253876, 0.04514249414205551, -0.46485400199890137, 0.8607051968574524, -0.22318461537361145, -0.1575237512588501, -0.18236905336380005, 0.19049791991710663, -0.2800964117050171, -0.018042314797639847, 0.04545394703745842, 0.17007389664649963, -0.014324449002742767, 0.03685418888926506, 0.08471499383449554, 0.10592954605817795, 0.1833280771970749, 0.43289053440093994, 0.2227998673915863, -0.2850738763809204, -0.04221544414758682, -0.4788191318511963, 0.1273762583732605, -0.1419496238231659, 0.020425893366336823, 0.06913934648036957, 0.14779579639434814, -0.06743735074996948, 0.14509809017181396, 0.23207664489746094, 0.1443541795015335, 0.1084919348359108, 0.20820163190364838, -0.12236088514328003, -0.4267936646938324, 0.02355518750846386, -0.03343842178583145, -0.048129722476005554, -0.46387457847595215, -0.01384550891816616, -0.06504574418067932, 0.12396888434886932, -0.012160169892013073, -0.18017680943012238, 0.17523902654647827, -0.1798352599143982, 0.35833606123924255, 0.14979849755764008, 0.317350298166275, 0.02398974448442459, -0.06951539218425751, -0.22229528427124023, -0.11997352540493011, -0.3201659917831421, 0.3677625060081482, -0.04045631363987923, 0.32683154940605164, -0.0034880340099334717, 0.039740171283483505, -0.24294140934944153, 0.2222931981086731, -0.0517238974571228, 0.003929343074560165, -0.44277316331863403, 0.4570198655128479, -0.17735609412193298, 0.0110568106174469, 0.010276313871145248, 0.1501319408416748, -0.10889895260334015, 0.2230464518070221, -0.3372287154197693, -0.5263574719429016, 0.40438926219940186, -0.26132479310035706, -0.17815083265304565, 0.006376940757036209, 0.38749945163726807, 0.37436723709106445, -0.08998217433691025, -0.4418724477291107, 0.10204087197780609, 0.4646379053592682, -0.04991661757230759, -0.1145220547914505, 0.2213282436132431, -0.1377454400062561, 0.16048702597618103, 0.10197989642620087, 0.5593533515930176, 0.041673291474580765, 0.04219357669353485, 0.026852712035179138, -0.24222418665885925 ]
https://github.com/huggingface/datasets/issues/5749
The authors just replied to us with their new URL: https://homes.cs.washington.edu/~ranjay/visualgenome/ We have fixed the datasets loading script, which is operative again.
AttributeError: 'Version' object has no attribute 'match'
### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3
22
AttributeError: 'Version' object has no attribute 'match' ### Describe the bug When I run from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') AttributeError: 'Version' object has no attribute 'match' ### Steps to reproduce the bug from datasets import load_dataset data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') ### Expected behavior This is error trace: Downloading and preparing dataset visual_genome/region_descriptions_v1.2.0 to C:/Users/Acer/.cache/huggingface/datasets/visual_genome/region_descriptions_v1.2.0/1.2.0/136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) Cell In[6], line 1 ----> 1 data = load_dataset("visual_genome", 'region_descriptions_v1.2.0') File ~\.conda\envs\aai\Lib\site-packages\datasets\load.py:1791, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1788 try_from_hf_gcs = path not in _PACKAGED_DATASETS_MODULES 1790 # Download and prepare data -> 1791 builder_instance.download_and_prepare( 1792 download_config=download_config, 1793 download_mode=download_mode, 1794 verification_mode=verification_mode, 1795 try_from_hf_gcs=try_from_hf_gcs, 1796 num_proc=num_proc, 1797 storage_options=storage_options, 1798 ) 1800 # Build dataset for splits 1801 keep_in_memory = ( 1802 keep_in_memory if keep_in_memory is not None else is_small_dataset(builder_instance.info.dataset_size) 1803 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:891, in DatasetBuilder.download_and_prepare(self, output_dir, download_config, download_mode, verification_mode, ignore_verifications, try_from_hf_gcs, dl_manager, base_path, use_auth_token, file_format, max_shard_size, num_proc, storage_options, **download_and_prepare_kwargs) 889 if num_proc is not None: 890 prepare_split_kwargs["num_proc"] = num_proc --> 891 self._download_and_prepare( 892 dl_manager=dl_manager, 893 verification_mode=verification_mode, 894 **prepare_split_kwargs, 895 **download_and_prepare_kwargs, 896 ) 897 # Sync info 898 self.info.dataset_size = sum(split.num_bytes for split in self.info.splits.values()) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:1651, in GeneratorBasedBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs) 1650 def _download_and_prepare(self, dl_manager, verification_mode, **prepare_splits_kwargs): -> 1651 super()._download_and_prepare( 1652 dl_manager, 1653 verification_mode, 1654 check_duplicate_keys=verification_mode == VerificationMode.BASIC_CHECKS 1655 or verification_mode == VerificationMode.ALL_CHECKS, 1656 **prepare_splits_kwargs, 1657 ) File ~\.conda\envs\aai\Lib\site-packages\datasets\builder.py:964, in DatasetBuilder._download_and_prepare(self, dl_manager, verification_mode, **prepare_split_kwargs) 962 split_dict = SplitDict(dataset_name=self.name) 963 split_generators_kwargs = self._make_split_generators_kwargs(prepare_split_kwargs) --> 964 split_generators = self._split_generators(dl_manager, **split_generators_kwargs) 966 # Checksums verification 967 if verification_mode == VerificationMode.ALL_CHECKS and dl_manager.record_checksums: File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:377, in VisualGenome._split_generators(self, dl_manager) 375 def _split_generators(self, dl_manager): 376 # Download image meta datas. --> 377 image_metadatas_dir = dl_manager.download_and_extract(self.config.image_metadata_url) 378 image_metadatas_file = os.path.join( 379 image_metadatas_dir, _get_decompressed_filename_from_url(self.config.image_metadata_url) 380 ) 382 # Download annotations File ~\.cache\huggingface\modules\datasets_modules\datasets\visual_genome\136fe5b83f6691884566c5530313288171e053a3b33bfe3ea2e4c8b39abaf7f3\visual_genome.py:328, in VisualGenomeConfig.image_metadata_url(self) 326 @property 327 def image_metadata_url(self): --> 328 if not self.version.match(_LATEST_VERSIONS["image_metadata"]): 329 logger.warning( 330 f"Latest image metadata version is {_LATEST_VERSIONS['image_metadata']}. Trying to generate a dataset of version: {self.version}. Please double check that image data are unchanged between the two versions." 331 ) 332 return f"{_BASE_ANNOTATION_URL}/image_data.json.zip" ### Environment info datasets 2.11.0 python 3.11.3 The authors just replied to us with their new URL: https://homes.cs.washington.edu/~ranjay/visualgenome/ We have fixed the datasets loading script, which is operative again.
[ -0.19554170966148376, 0.019373491406440735, 0.01434849202632904, 0.2700212299823761, 0.32112330198287964, 0.046529993414878845, 0.24270014464855194, 0.5838724970817566, 0.28396525979042053, 0.25258180499076843, 0.18423843383789062, 0.2591090202331543, 0.06297559291124344, 0.18058335781097412, -0.1841655671596527, -0.31374624371528625, 0.028639934957027435, 0.3809821605682373, -0.2248632311820984, -0.10082150250673294, -0.21145474910736084, 0.2588158845901489, -0.13443586230278015, 0.257469117641449, -0.14275160431861877, -0.05305512249469757, 0.07329032570123672, 0.12121979892253876, -0.05994555726647377, -0.5016893744468689, 0.2564443349838257, -0.47022438049316406, 0.1583966612815857, 0.3401408791542053, -0.0001134037011070177, -0.030913017690181732, 0.3680552840232849, -0.048902373760938644, -0.4858623147010803, -0.342181921005249, -0.1922387182712555, -0.11220534145832062, 0.12563076615333557, 0.006693899631500244, -0.08859129995107651, -0.2761288285255432, -0.10518481582403183, -0.38265809416770935, 0.012195806950330734, 0.1859949231147766, 0.23871304094791412, 0.19226276874542236, 0.2750442922115326, -0.2346031814813614, 0.21039897203445435, -0.02744220197200775, -0.08439455181360245, 0.22092872858047485, 0.2621377110481262, 0.017886236310005188, 0.22091880440711975, 0.37340086698532104, -0.09937520325183868, 0.30927520990371704, 0.12260476499795914, 0.005489800125360489, 0.2620481252670288, -0.12026835232973099, 0.11258835345506668, 0.14713852107524872, 0.6393735408782959, -0.32852691411972046, -0.6078495383262634, 0.019094079732894897, -0.023614823818206787, -0.3823280334472656, 0.18983125686645508, -0.06574016809463501, -0.10311548411846161, 0.17057576775550842, -0.2525330185890198, -0.009170807898044586, -0.1728745996952057, -0.03534740209579468, -0.1076408326625824, -0.09033136814832687, -0.03820839896798134, 0.018084626644849777, -0.17774765193462372, -0.0457402765750885, 0.03128198906779289, -0.17354735732078552, -0.2493513971567154, 0.31612247228622437, -0.48160266876220703, -0.06948361545801163, -0.26345378160476685, 0.1268620491027832, 0.2517041862010956, 0.27407485246658325, 0.09238070249557495, -0.2736469507217407, 0.028384044766426086, 0.10033340752124786, 0.18804728984832764, 0.4008617103099823, 0.09121257066726685, 0.31657126545906067, -0.0361027866601944, -0.07960639148950577, -0.15487998723983765, -0.01979619264602661, -0.021120373159646988, -0.3436775505542755, 0.2899298667907715, 0.23576220870018005, 0.429374098777771, -0.44922226667404175, -0.349854439496994, 0.15076203644275665, -0.43255889415740967, 0.0965631753206253, -0.10642769932746887, 0.23045791685581207, -0.16472019255161285, 0.16438287496566772, 0.2359602451324463, 0.11871587485074997, -0.28685903549194336, -0.42455214262008667, -0.3329216539859772, 0.029138583689928055, -0.034266211092472076, -0.06494632363319397, -0.015328936278820038, -0.09831125289201736, 0.2469440996646881, -0.16513526439666748, 0.04536484554409981, -0.10714158415794373, -0.0684562474489212, -0.14932458102703094, -0.15222248435020447, 0.42972713708877563, -0.13686907291412354, 0.26840224862098694, 0.2735305726528168, -0.3405449390411377, -0.08970452100038528, 0.15821398794651031, -0.2817765474319458, -0.28332334756851196, -0.1478995829820633, 0.23243869841098785, -0.3355938494205475, -0.044288817793130875, -0.17536713182926178, -0.24373780190944672, 0.09656397998332977, -0.15237924456596375, -0.14979767799377441, -0.21141844987869263, -0.2056483030319214, -0.2941035032272339, 0.24759772419929504, 0.5259004235267639, -0.38413238525390625, -0.1878320723772049, 0.0659884512424469, 0.003676127642393112, 0.008795466274023056, -0.011898561380803585, 0.17705604434013367, 0.19465462863445282, -0.12826883792877197, -0.09054155647754669, 0.4242992103099823, -0.5693094730377197, -0.4758452773094177, 0.46181631088256836, -0.10572050511837006, 0.10944394022226334, 0.18837133049964905, -0.1252211183309555, 0.13802815973758698, -0.02544894628226757, 0.2216733694076538, 0.12380420416593552, 0.04702530801296234, 0.09351401031017303, -0.08748362958431244, -0.27221766114234924, 0.03200332447886467, 0.03129573166370392, 0.03442297875881195, 0.2756645679473877, 0.14564630389213562, -0.19005146622657776, 0.16842782497406006, -0.05104285851120949, -0.0189839918166399, 0.14224229753017426, 0.3411916196346283, -0.03134899213910103, 0.11403924226760864, -0.19454477727413177, -0.4897097945213318, 0.36006420850753784, -0.08292049914598465, 0.021845240145921707, 0.07272239029407501, -0.008997038006782532, -0.40825963020324707, 0.06103774905204773, -0.4392084777355194, -0.439272940158844, 0.0904359295964241, -0.005305130034685135, 0.03261909633874893, 0.03943507373332977, -0.08449145406484604, 0.4135861098766327, -0.06717968732118607, 0.18381594121456146, -0.3058442175388336, 0.3117997944355011, -0.27434664964675903, -0.12933200597763062, 0.1465597301721573, 0.10486696660518646, 0.14218582212924957, 0.029740918427705765, -0.23988427221775055, 0.2925357222557068, 0.013325817883014679, 0.37458840012550354, -0.001173145603388548, -0.018157556653022766, 0.0888519212603569, -0.14557607471942902, 0.046900682151317596, 0.12697085738182068, 0.3020290434360504, 0.1367306411266327, 0.15465396642684937, 0.07671202719211578, 0.1407211273908615, 0.2628413438796997, -0.028325803577899933, 0.09313786029815674, 0.2444712370634079, -0.1081666499376297, -0.025006812065839767, -0.23845116794109344, 0.15128959715366364, 0.009113054722547531, 0.3467402160167694, -0.0028079207986593246, -0.303058922290802, -0.07340143620967865, 0.23502716422080994, 0.0067840516567230225, 0.09929884970188141, -0.07021450996398926, -0.410245805978775, 0.19543775916099548, -0.020663294941186905, 0.20316193997859955, 0.49709099531173706, 0.2070240080356598, -0.10401064902544022, 0.15568773448467255, -0.06992370635271072, -0.0011065490543842316, 0.1899898648262024, 0.08450832962989807, 0.46247005462646484, 0.36035293340682983, 0.008109267801046371, 0.1751152127981186, -0.0807764083147049, -0.3178907632827759, -0.08229825645685196, 0.3928435742855072, -0.6760531067848206, -0.007174603641033173, -0.3082730770111084, -0.06250879913568497, -0.3276025652885437, -0.10673853754997253, -0.13384206593036652, -0.03078412637114525, -0.12587828934192657, 0.2887312173843384, 0.06538370251655579, 0.1711631864309311, -0.2759915888309479, -0.13603432476520538, 0.16838395595550537, -0.2710672616958618, -0.05492497980594635, 0.013766400516033173, -0.33676877617836, 0.06534256041049957, -0.08013925701379776, -0.23437418043613434, 0.155160591006279, -0.29448020458221436, 0.058536969125270844, -0.15577952563762665, -0.1939658522605896, 0.15912654995918274, -0.06684955954551697, 0.516806960105896, 0.29041188955307007, 0.15929438173770905, 0.22933778166770935, 0.08123251795768738, 0.2471798062324524, -0.04499058425426483, -0.5650161504745483, 0.06493633985519409, 0.006954200565814972, -0.09691924601793289, 0.06673526763916016, -0.4326021075248718, -0.24595610797405243, -0.4411624073982239, 0.0002761036157608032, 0.1102304756641388, 0.23662088811397552, 0.49532240629196167, 0.21623557806015015, 0.09646116197109222, 0.11324334889650345, 0.24569472670555115, -0.1564519703388214, -0.10887498408555984, 0.22722899913787842, -0.06102066859602928, -0.3378838896751404, 0.049142010509967804, 0.0018549934029579163, 0.05395093187689781, 0.27030569314956665, -0.25876718759536743, -0.24171549081802368, -0.09471771121025085, -0.12418937683105469, 0.08411306887865067, -0.05692830681800842, 0.47959986329078674, 0.16798655688762665, -0.07107514142990112, -0.1928790807723999, -0.29479724168777466, 0.14222951233386993, 0.058598458766937256, 0.1090337336063385, 0.08592812716960907, 0.38774195313453674, 0.020717911422252655, 0.30005961656570435, 0.4822211265563965, -0.07094603031873703, 0.21715369820594788, -0.10413368791341782, 0.11940103769302368, -0.3965111970901489, -0.3192795515060425, -0.07367464154958725, -0.10037171095609665, -0.08611883968114853, 0.15693072974681854, -0.0880294069647789, 0.17788898944854736, -0.25564438104629517, -0.22595855593681335, -0.41891568899154663, -0.05608569085597992, -0.15921317040920258, -0.3666827082633972, 0.33969274163246155, -0.09342672675848007, 0.10939967632293701, -0.06206898391246796, 0.22948133945465088, 0.08036591857671738, 0.30395233631134033, 0.027861524373292923, 0.14169448614120483, -0.20198267698287964, -0.10922269523143768, -0.04653113707900047, 0.459648072719574, 0.18947087228298187, 0.4361959993839264, -0.029643550515174866, -0.16876286268234253, -0.1334690898656845, 0.11893773078918457, 0.4218067228794098, -0.2767502963542938, 0.3891480267047882, 0.010051414370536804, -0.15046566724777222, 0.009603850543498993, -0.09322545677423477, 0.04414127767086029, 0.11628155410289764, -0.1654377579689026, 0.46309342980384827, -0.04481397569179535, -0.05065309628844261, 0.4316696524620056, 0.21713446080684662, -0.12984701991081238, 0.01389685645699501, -0.217119961977005, 0.09884370863437653, -0.3754485547542572, -0.12224429845809937, -0.09253682941198349, 0.19821076095104218, 0.12244167178869247, 0.02760019153356552, -0.37991949915885925, -0.22413189709186554, 0.10501054674386978, 0.05467194691300392, 0.3441373407840729, -0.3684723377227783, 0.28744763135910034, 0.2535973787307739, 0.05075366422533989, 0.1222761794924736, 0.5924530625343323, 0.006762288510799408, -0.5684106945991516, -0.13044783473014832, 0.030547533184289932, 0.19214798510074615, 0.22533005475997925, -0.1326809972524643, -0.2883659899234772, -0.19168365001678467, -0.1619640588760376, -0.16333165764808655, -0.19232508540153503, 0.2736363112926483, 0.14290708303451538, -0.2624565660953522, -0.39020562171936035, 0.49185192584991455, 0.18074065446853638, -0.1581508368253708, 0.37600386142730713, 0.26509320735931396, -0.2761305868625641, 0.20722180604934692, -0.15823113918304443, 0.7017083168029785, 0.2750161290168762, -0.03083149716258049, 0.15127986669540405, -0.18325304985046387, 0.20118924975395203, 0.5188870429992676, -0.03139244765043259, -0.5375080704689026, -0.3325987756252289, -0.181518092751503, -0.1803206503391266, 0.5236738324165344, -0.016251085326075554, -0.09835712611675262, 0.5702056884765625, -0.038235053420066833, 0.14376486837863922, 0.2811182737350464, -0.06438696384429932, -0.03413531184196472, 0.08354349434375763, -0.31078773736953735, 0.15191230177879333, -0.23670808970928192, 0.606372594833374, 0.0757354348897934, 0.0185566283762455, -0.4675038158893585, -0.4312840700149536, -0.35014650225639343, 0.17095424234867096, -0.23402079939842224, -0.07198010385036469, 0.31063392758369446, -0.546984076499939, 0.07146561145782471, 0.09914180636405945, 0.11144418269395828, 0.022795353084802628, -0.10195925086736679, 0.17363187670707703, -0.00871272012591362, 0.17636741697788239, 0.20392948389053345, -0.12554967403411865, 0.4537685215473175, -0.11370629072189331, -0.20131781697273254, 0.12865588068962097, -0.1424090564250946, -0.16699662804603577, 0.16069550812244415, -0.28795748949050903, 0.01947948709130287, -0.1694936454296112, -0.18444888293743134, -0.2075010985136032, 0.31084299087524414, -0.23505842685699463, 0.13184423744678497, -0.026609137654304504, -0.28064578771591187, -0.015768442302942276, 0.2051113247871399, -0.38177457451820374, -0.08408583700656891, 0.46010684967041016, 0.020775169134140015, 0.1481357216835022, 0.6278978586196899, 0.06162038445472717, -0.032414570450782776, -0.20901748538017273, 0.03386291116476059, 0.3367937505245209, -0.589687705039978, 0.11688908189535141, -0.2733195126056671, -0.061507537961006165, 0.10785884410142899, 0.6921044588088989, 0.1394260823726654, -0.020632442086935043, 0.1218009889125824, -0.6025596261024475, -0.05835319310426712, 0.35312414169311523, -0.40516194701194763, 0.11180592328310013, 0.009397879242897034, 0.09342073649168015, 0.04437195509672165, -0.13259346783161163, -0.2812933027744293, -0.11441446840763092, -0.09695545583963394, 0.1839824616909027, 0.1513199806213379, 0.10241562873125076, 0.2300201654434204, -0.12299975007772446, 0.17667177319526672, -0.01661650836467743, -0.15591835975646973, -0.2110200971364975, -0.2866581678390503, 0.11965522170066833, -0.11855943500995636, 0.10715033113956451, 0.060212790966033936, 0.013563752174377441, -0.08433711528778076, -0.06653385609388351, 0.026460327208042145, 0.17860189080238342, -0.06461164355278015, 0.29512089490890503, -0.12817072868347168, -0.002376314252614975, -0.044654909521341324, 0.16198621690273285, -0.2959800362586975, 0.09607070684432983, 0.10001541674137115, 0.09538230299949646, -0.06885258108377457, -0.0391385555267334, -0.29837000370025635, 0.023873819038271904, -0.4188513457775116, 0.1675497591495514, 0.4538933336734772, -0.2821718752384186, 0.15194164216518402, 0.31897619366645813, 0.30910709500312805, -0.02694963663816452, -0.22205667197704315, -0.020084697753190994, 0.01914670690894127, 0.2410488724708557, -0.40804699063301086, -0.0807034969329834, 0.01780438795685768, -0.12859757244586945, -0.02703026682138443, 0.36376237869262695, 0.08764539659023285, -0.11049219220876694, -0.1433904618024826, 0.19158847630023956, 0.5397861003875732, -0.10489945113658905, 0.2749168276786804, 0.4870842397212982, -0.0017997398972511292, 0.16349412500858307, 0.17302335798740387, 0.29159462451934814, 0.2181513011455536, 0.6151905059814453, -0.11306331306695938, -0.17024379968643188, 0.08339007198810577, 0.19057509303092957, -0.05078751593828201, -0.3759390115737915, 0.04283110424876213, 0.03844434767961502, -0.00830172747373581, 0.0422794371843338, 0.2653757929801941, 0.10618115216493607, -0.05261689051985741, -0.046144999563694, -0.04184305667877197, -0.024757372215390205, 0.010649936273694038, -0.027896352112293243, -0.17124833166599274, -0.18645043671131134, -0.25855499505996704, -0.1614018827676773, -0.21241801977157593, -0.12226052582263947, 0.4498032033443451, -0.040514711290597916, -0.1836865246295929, -0.39391186833381653, 0.01725289225578308, 0.17684948444366455, -0.005993664264678955, -0.3231850564479828, 0.3523058593273163, 0.01589389517903328, 0.05646141618490219, 0.26190829277038574, 0.474691778421402, 0.5762162208557129, 0.26602426171302795, -0.016791820526123047, -0.12223540246486664, -0.1793345957994461, -0.2795043885707855, 0.06438519060611725, 0.04960399493575096, -0.3697408437728882, -0.0953240692615509, 0.42592915892601013, 0.1816580593585968, -0.025455428287386894, 0.15577679872512817, -0.10998933017253876, 0.04514249414205551, -0.46485400199890137, 0.8607051968574524, -0.22318461537361145, -0.1575237512588501, -0.18236905336380005, 0.19049791991710663, -0.2800964117050171, -0.018042314797639847, 0.04545394703745842, 0.17007389664649963, -0.014324449002742767, 0.03685418888926506, 0.08471499383449554, 0.10592954605817795, 0.1833280771970749, 0.43289053440093994, 0.2227998673915863, -0.2850738763809204, -0.04221544414758682, -0.4788191318511963, 0.1273762583732605, -0.1419496238231659, 0.020425893366336823, 0.06913934648036957, 0.14779579639434814, -0.06743735074996948, 0.14509809017181396, 0.23207664489746094, 0.1443541795015335, 0.1084919348359108, 0.20820163190364838, -0.12236088514328003, -0.4267936646938324, 0.02355518750846386, -0.03343842178583145, -0.048129722476005554, -0.46387457847595215, -0.01384550891816616, -0.06504574418067932, 0.12396888434886932, -0.012160169892013073, -0.18017680943012238, 0.17523902654647827, -0.1798352599143982, 0.35833606123924255, 0.14979849755764008, 0.317350298166275, 0.02398974448442459, -0.06951539218425751, -0.22229528427124023, -0.11997352540493011, -0.3201659917831421, 0.3677625060081482, -0.04045631363987923, 0.32683154940605164, -0.0034880340099334717, 0.039740171283483505, -0.24294140934944153, 0.2222931981086731, -0.0517238974571228, 0.003929343074560165, -0.44277316331863403, 0.4570198655128479, -0.17735609412193298, 0.0110568106174469, 0.010276313871145248, 0.1501319408416748, -0.10889895260334015, 0.2230464518070221, -0.3372287154197693, -0.5263574719429016, 0.40438926219940186, -0.26132479310035706, -0.17815083265304565, 0.006376940757036209, 0.38749945163726807, 0.37436723709106445, -0.08998217433691025, -0.4418724477291107, 0.10204087197780609, 0.4646379053592682, -0.04991661757230759, -0.1145220547914505, 0.2213282436132431, -0.1377454400062561, 0.16048702597618103, 0.10197989642620087, 0.5593533515930176, 0.041673291474580765, 0.04219357669353485, 0.026852712035179138, -0.24222418665885925 ]
https://github.com/huggingface/datasets/issues/5744
Thanks for reporting, @keyboardAnt. We haven't noticed any crash in our CI tests. Could you please indicate specifically the `load_dataset` command that crashes in your side, so that we can reproduce it?
[BUG] With Pandas 2.0.0, `load_dataset` raises `TypeError: read_csv() got an unexpected keyword argument 'mangle_dupe_cols'`
The `load_dataset` function with Pandas `1.5.3` has no issue (just a FutureWarning) but crashes with Pandas `2.0.0`. For your convenience, I opened a draft Pull Request to fix it quickly: https://github.com/huggingface/datasets/pull/5745 --- * The FutureWarning mentioned above: ``` FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols' ```
32
[BUG] With Pandas 2.0.0, `load_dataset` raises `TypeError: read_csv() got an unexpected keyword argument 'mangle_dupe_cols'` The `load_dataset` function with Pandas `1.5.3` has no issue (just a FutureWarning) but crashes with Pandas `2.0.0`. For your convenience, I opened a draft Pull Request to fix it quickly: https://github.com/huggingface/datasets/pull/5745 --- * The FutureWarning mentioned above: ``` FutureWarning: the 'mangle_dupe_cols' keyword is deprecated and will be removed in a future version. Please take steps to stop the use of 'mangle_dupe_cols' ``` Thanks for reporting, @keyboardAnt. We haven't noticed any crash in our CI tests. Could you please indicate specifically the `load_dataset` command that crashes in your side, so that we can reproduce it?
[ -0.11242857575416565, -0.06373906135559082, 0.06913965940475464, 0.2574194371700287, 0.2377796471118927, 0.20134049654006958, 0.4677693843841553, 0.23842857778072357, 0.28475335240364075, 0.050444185733795166, 0.025958240032196045, 0.1630541980266571, -0.16546288132667542, 0.31347987055778503, -0.040925923734903336, -0.057888343930244446, 0.3479194641113281, 0.02803441695868969, -0.43023133277893066, 0.3459482789039612, -0.5129250288009644, 0.19664908945560455, -0.371018648147583, 0.04105959087610245, -0.1556614190340042, 0.07952984422445297, -0.26621681451797485, 0.38872355222702026, -0.12498887628316879, -0.44986456632614136, 0.3531630039215088, 0.06169739365577698, 0.03449321910738945, 0.6464329957962036, -0.00010530597501201555, 0.011205658316612244, 0.4204338788986206, 0.026291459798812866, -0.3122911751270294, -0.48508673906326294, 0.1954258233308792, -0.3492090106010437, 0.17891591787338257, -0.08020918071269989, 0.22940446436405182, -0.15370170772075653, -0.1327899694442749, -0.04065687209367752, 0.35801613330841064, 0.10485056042671204, 0.280504047870636, 0.3076566755771637, 0.27803879976272583, -0.3296230435371399, 0.03054923191666603, -0.20527583360671997, -0.045312508940696716, 0.16039562225341797, 0.025698993355035782, -0.2587244510650635, -0.033674076199531555, 0.10967797040939331, -0.2550406754016876, -0.17375408113002777, 0.11511237919330597, -0.11334767937660217, -0.1576736569404602, -0.2602592706680298, 0.08844833821058273, 0.24777542054653168, 0.28460219502449036, -0.27991020679473877, -0.31437379121780396, -0.12240134179592133, -0.06898965686559677, -0.07022619992494583, 0.3353022336959839, -0.14785170555114746, -0.016415227204561234, 0.1806366890668869, 0.09921003878116608, 0.07613622397184372, 0.012844279408454895, 0.12348753958940506, -0.15712815523147583, 0.018973706290125847, -0.24792180955410004, 0.10722407698631287, 0.3716493546962738, -0.251309335231781, 0.05927228182554245, 0.033193089067935944, -0.39626309275627136, 0.1534341424703598, -0.46538519859313965, -0.058362822979688644, 0.03226868435740471, -0.10104992240667343, 0.23427799344062805, -0.031111812219023705, -0.13702274858951569, -0.18237020075321198, 0.008864186704158783, 0.3217647075653076, 0.5226541757583618, 0.18263967335224152, -0.01496625691652298, -0.2389233112335205, 0.25890782475471497, -0.11527026444673538, 0.14821337163448334, -0.12460286170244217, 0.07572974264621735, -0.2946688234806061, 0.18106764554977417, -0.05940086022019386, 0.4634140729904175, -0.3298170566558838, -0.3650396168231964, 0.0921403020620346, -0.08269229531288147, 0.09101352095603943, -0.031356409192085266, 0.34885725378990173, -0.14123840630054474, 0.5322331786155701, 0.14018335938453674, 0.16861805319786072, -0.014549072831869125, -0.30614352226257324, -0.2378547638654709, 0.039104998111724854, -0.1446065455675125, 0.033780813217163086, 0.11699654906988144, 0.006638690829277039, 0.2601085901260376, 0.25113457441329956, 0.07157178968191147, -0.19134879112243652, -0.2621116042137146, -0.19511602818965912, -0.19660581648349762, 0.2810963988304138, 0.19486643373966217, 0.031026221811771393, 0.3223922848701477, -0.2133627086877823, -0.0011281371116638184, 0.1183469146490097, -0.25073766708374023, -0.21849223971366882, -0.2066996693611145, 0.19184452295303345, -0.12100696563720703, -0.044578369706869125, -0.4403667151927948, 0.22865800559520721, 0.020904261618852615, -0.0780794620513916, -0.22157064080238342, 0.08351248502731323, 0.01896301656961441, -0.27845123410224915, -0.09212209284305573, 0.6983607411384583, -0.4695374071598053, 0.04252031445503235, 0.26735109090805054, 0.12137050926685333, 0.09729565680027008, 0.28522244095802307, -0.22208082675933838, -0.3491949439048767, -0.1907767355442047, -0.3224855661392212, 0.2428320050239563, 0.05484329164028168, -0.09030865132808685, 0.5076194405555725, -0.17537444829940796, 0.08925008773803711, 0.1337582767009735, -0.05959451571106911, -0.08639691770076752, -0.16062723100185394, 0.07626456767320633, 0.03418005630373955, -0.22821465134620667, 0.08620879799127579, -0.19088217616081238, -0.41155117750167847, 0.33082693815231323, -0.08500414341688156, 0.05696653947234154, 0.17142361402511597, 0.004974499344825745, -0.24593451619148254, 0.1392396092414856, -0.0750102698802948, -0.18182963132858276, 0.2259903848171234, 0.2182226926088333, 0.1688770204782486, 0.24809099733829498, -0.2467702031135559, -0.579102635383606, 0.1866942197084427, 0.2785695493221283, -0.01894773729145527, -0.015451289713382721, -0.23449161648750305, -0.29329627752304077, -0.1095568835735321, 0.07638352364301682, 0.10533107072114944, 0.08107137680053711, -0.16088703274726868, -0.015323273837566376, 0.37334316968917847, -0.31997624039649963, 0.30144980549812317, -0.26807403564453125, 0.12010985612869263, -0.07147744297981262, 0.160041943192482, -0.20696450769901276, -0.14630812406539917, 0.029980771243572235, 0.17691940069198608, 0.10980966687202454, -0.02954261191189289, -0.15851962566375732, 0.5045326948165894, -0.04773971810936928, 0.15833976864814758, -0.07339946925640106, -0.014083415269851685, 0.09327021986246109, 0.016723334789276123, -0.014574220404028893, 0.03658830001950264, 0.19091854989528656, -0.20699602365493774, -0.017979633063077927, 0.40164726972579956, -0.13223227858543396, -0.0492108091711998, -0.06440466642379761, 0.09066112339496613, 0.23868253827095032, -0.007257625460624695, -0.09163717925548553, -0.14592880010604858, 0.012066561728715897, -0.04790515452623367, 0.04518568515777588, 0.027710968628525734, -0.34253376722335815, -0.22264406085014343, 0.44497594237327576, -0.07457829266786575, 0.14314980804920197, 0.11269311606884003, -0.0754975825548172, -0.07169075310230255, 0.07167673110961914, 0.08300341665744781, 0.3559150695800781, 0.19963441789150238, -0.1378622055053711, 0.17041584849357605, -0.306614488363266, -0.05121532827615738, 0.2221880704164505, 0.022187307476997375, 0.10017791390419006, -0.17871873080730438, 0.049428388476371765, 0.3454740643501282, -0.3740711212158203, 0.13149943947792053, 0.042681507766246796, 0.34671348333358765, -0.4776381850242615, 0.1495330035686493, -0.38986828923225403, -0.0784081518650055, 0.0007759593427181244, 0.19737155735492706, -0.2022460401058197, -0.3624139726161957, -0.2503814697265625, 0.5084640383720398, 0.07107184082269669, 0.18483102321624756, -0.058285459876060486, 0.3569602966308594, 0.19561153650283813, 0.3223460018634796, 0.039435744285583496, -0.04585525766015053, -0.15932799875736237, 0.049691349267959595, 0.3420211374759674, -0.19907113909721375, 0.3845131993293762, 0.1672036498785019, -0.11524145305156708, -0.01267588883638382, -0.2948095202445984, -0.10032272338867188, -0.156281977891922, 0.16419175267219543, 0.20055274665355682, 0.14732280373573303, -0.1866961121559143, -0.09459264576435089, 0.16612398624420166, -0.13885098695755005, -0.21250736713409424, 0.2471311390399933, -0.08572962880134583, -0.1032758578658104, -0.19468149542808533, -0.2149333506822586, 0.058736637234687805, -0.3829140067100525, 0.14226430654525757, -0.13203741610050201, -0.09102052450180054, 0.2191656529903412, 0.2366044819355011, 0.07457989454269409, 0.1946260929107666, -0.03107481449842453, -0.48954591155052185, -0.45937609672546387, 0.1358247697353363, -0.1366538256406784, -0.41231751441955566, 0.13589733839035034, 0.21853098273277283, 0.06510686874389648, -0.22253485023975372, -0.4895562529563904, -0.5652140974998474, -0.04601346701383591, -0.0051065534353256226, 0.0035345004871487617, 0.00710994191467762, 0.047340381890535355, 0.14042243361473083, -0.05345676839351654, 0.1112712025642395, -0.25418686866760254, 0.09855041652917862, 0.18893134593963623, -0.029838327318429947, 0.230782151222229, 0.5577480792999268, 0.2716350555419922, 0.4823344349861145, 0.3251173496246338, 0.03462892398238182, 0.3325004577636719, -0.01307413075119257, 0.5323015451431274, -0.09322808682918549, -0.37626591324806213, -0.11635549366474152, -0.19272111356258392, 0.21393540501594543, -0.06824751198291779, -0.16556712985038757, -0.24229571223258972, -0.32025253772735596, 0.11128859221935272, -0.01421450823545456, -0.047974590212106705, -0.05797389894723892, -0.17315971851348877, -0.16326087713241577, -0.09523920714855194, 0.08179876208305359, -0.11428219079971313, -0.004128430038690567, 0.18721705675125122, 0.09571793675422668, 0.05238765850663185, -0.20435960590839386, 0.026036858558654785, 0.09088018536567688, -0.4770166873931885, 0.22988170385360718, -0.08798789232969284, 0.40374985337257385, 0.008848771452903748, -0.09179998189210892, -0.10134199261665344, -0.06527892500162125, 0.8326757550239563, -0.1777614951133728, -0.2513453960418701, 0.09149321913719177, -0.14012286067008972, -0.45724084973335266, -0.06907719373703003, -0.0871802419424057, 0.22630198299884796, 0.2574287950992584, 0.326099693775177, -0.11774961650371552, -0.2304399609565735, 0.516793966293335, 0.020787876099348068, -0.11657112836837769, -0.391312837600708, -0.19904550909996033, -0.08247703313827515, -0.05140874534845352, 0.07790452241897583, 0.060331135988235474, 0.1722698211669922, -0.3548564910888672, -0.24262896180152893, -0.25734207034111023, -0.19012713432312012, 0.1731458157300949, 0.21972253918647766, -0.017877064645290375, -0.042468443512916565, 0.2505248486995697, 0.09044565260410309, 0.07222425937652588, 0.12469995766878128, 0.5465340614318848, -0.06426028907299042, -0.5392573475837708, -0.015767328441143036, -0.05423343926668167, 0.18202245235443115, 0.21745143830776215, -0.21353191137313843, 0.20469363033771515, -0.043062083423137665, -0.03773427754640579, -0.29838258028030396, -0.41731512546539307, 0.5909693241119385, 0.1639893651008606, -0.2574625611305237, -0.3117193877696991, 0.4282384514808655, 0.24333614110946655, 0.06270243227481842, 0.31240901350975037, 0.07310768961906433, -0.15767017006874084, 0.3702786862850189, -0.09519922733306885, 0.8426611423492432, -0.12313392758369446, 0.1363152414560318, 0.36664217710494995, 0.001015789806842804, 0.5540280342102051, 0.09339296817779541, -0.12416844815015793, -0.41282758116722107, -0.22567899525165558, -0.10765211284160614, 0.10350869596004486, 0.5243991613388062, -0.13279125094413757, -0.510873556137085, 0.4114707410335541, -0.38569876551628113, 0.38190406560897827, -0.0864599347114563, 0.0002399235963821411, -0.10935694724321365, -0.2515164017677307, -0.28585973381996155, 0.19166266918182373, 0.1385417878627777, -0.1392613649368286, 0.020588554441928864, 0.10104024410247803, 0.3431505560874939, -0.18823759257793427, -0.521875262260437, -0.07896217703819275, -0.061369724571704865, 0.12061906605958939, 0.007592028938233852, -0.22672683000564575, 0.16954410076141357, 0.22840844094753265, 0.40672698616981506, -0.020061343908309937, -0.03968683257699013, 0.0501224584877491, 0.08024349063634872, -0.020706934854388237, -0.1718103587627411, 0.06905197352170944, 0.20873011648654938, -0.014139465987682343, -0.1631433069705963, 0.40070614218711853, -0.07214284688234329, -0.1214764416217804, 0.008943155407905579, 0.22013641893863678, -0.3834051787853241, -0.5237497091293335, -0.21742664277553558, -0.1313728392124176, 0.24526172876358032, -0.33518117666244507, 0.17669063806533813, 0.0973999947309494, -0.19412043690681458, -0.0368451252579689, 0.03570334240794182, -0.2173139750957489, -0.0736481249332428, 0.5133903622627258, -0.03264530375599861, 0.17061355710029602, 0.31900376081466675, 0.2292613685131073, -0.09160290658473969, -0.15740936994552612, -0.03327932953834534, 0.09787295758724213, -0.35305002331733704, 0.2067589908838272, 0.010703794658184052, -0.08775274455547333, 0.25320306420326233, 0.16418366134166718, 0.28058871626853943, 0.31767550110816956, -0.16930221021175385, -0.25835371017456055, -0.2013891637325287, -0.043805692344903946, 0.2322646975517273, 0.061646461486816406, 0.16884268820285797, -0.131389781832695, -0.1968981921672821, 0.16514836251735687, -0.38938966393470764, 0.14579850435256958, -0.24417804181575775, -0.0706644058227539, 0.09881354868412018, 0.008216622285544872, 0.16683347523212433, -0.04867498576641083, 0.1876145303249359, 0.06993671506643295, 0.00023891404271125793, -0.18440014123916626, -0.32868093252182007, 0.050098665058612823, -0.12586155533790588, 0.14074143767356873, -0.0544852651655674, -0.14773717522621155, -0.2976979613304138, -0.0930865928530693, 0.25224363803863525, 0.40813371539115906, -0.07002503424882889, 0.19229713082313538, -0.03726702928543091, 0.020009910687804222, 0.005157157778739929, 0.3488346338272095, -0.22781535983085632, 0.20885691046714783, 0.15634793043136597, 0.2157648801803589, 0.007112525403499603, 0.0004948154091835022, 0.019178669899702072, 0.1817137748003006, -0.2392277717590332, -0.0948602557182312, 0.22934436798095703, -0.416802316904068, 0.009571455419063568, 0.3002502918243408, 0.3087231516838074, 0.32971686124801636, -0.26024407148361206, 0.03948742151260376, 0.31533846259117126, 0.22743982076644897, -0.11143827438354492, -0.17204155027866364, 0.19249320030212402, 0.0818309634923935, 0.049123674631118774, 0.3925597667694092, 0.1305285394191742, -0.14641840755939484, 0.2658699154853821, 0.059593308717012405, 0.28904688358306885, -0.16389159858226776, 0.3660401701927185, 0.3184346556663513, 0.08657686412334442, -0.07768690586090088, 0.18235865235328674, 0.1337062120437622, 0.2603152096271515, 0.22732838988304138, -0.02468821033835411, -0.037796102464199066, 0.012905620038509369, 0.4827500581741333, -0.2908337116241455, -0.575610339641571, 0.39519625902175903, 0.43012362718582153, -0.5453584790229797, 0.0924302265048027, 0.05335979536175728, 0.4443000853061676, -0.4350619614124298, -0.23141774535179138, -0.4784400463104248, 0.24961578845977783, -0.21876268088817596, -0.07880795001983643, 0.16699860990047455, -0.12197451293468475, -0.14278163015842438, 0.1040482446551323, 0.010384766384959221, -0.22617970407009125, 0.27274394035339355, -0.15854749083518982, -0.011378977447748184, -0.42139115929603577, -0.15594832599163055, 0.08980433642864227, 0.26630663871765137, -0.07975117117166519, 0.1755497306585312, 0.05317079648375511, -0.12254885584115982, 0.160321444272995, 0.24831323325634003, 0.6628327369689941, 0.3926244080066681, -0.06274547427892685, -0.04671241343021393, 0.05658388510346413, -0.21393218636512756, 0.23935635387897491, 0.18614508211612701, -0.08181511610746384, 0.20211300253868103, 0.3169378936290741, 0.15356358885765076, -0.11594058573246002, 0.017083166167140007, 0.05528537184000015, 0.25478431582450867, -0.6872365474700928, 0.3220146596431732, -0.16065248847007751, 0.015010632574558258, -0.25389939546585083, 0.13390514254570007, -0.3999101221561432, -0.25065311789512634, 0.42908236384391785, -0.027978967875242233, 0.13614210486412048, 0.06880095601081848, 0.14337626099586487, 0.3475494086742401, 0.2292095571756363, 0.3777463436126709, 0.08940806239843369, -0.15637564659118652, -0.027745045721530914, -0.6474083065986633, 0.17937913537025452, -0.08761335909366608, 0.18243896961212158, 0.17677664756774902, 0.02903296798467636, -0.03821161389350891, 0.02901322767138481, -0.13636374473571777, 0.06094717979431152, 0.3043297231197357, 0.14941337704658508, -0.40315476059913635, -0.17334197461605072, -0.01531551405787468, -0.21468859910964966, -0.17168214917182922, -0.16746601462364197, 0.13220620155334473, 0.1864420473575592, -0.0012288987636566162, 0.018281828612089157, 0.23621678352355957, -0.27200955152511597, -0.19131913781166077, 0.3838607370853424, -0.020226173102855682, 0.17931756377220154, 0.1774672567844391, -0.1224047839641571, -0.17645463347434998, -0.3188987076282501, -0.27042117714881897, 0.1536019891500473, 0.03510059788823128, 0.06443022191524506, -0.3518833518028259, -0.21064643561840057, -0.10556265711784363, 0.4383656084537506, 0.016507714986801147, -0.10957007110118866, -0.29304587841033936, 0.3271864354610443, 0.01914428174495697, 0.06792359054088593, 0.09324800968170166, 0.08290871977806091, -0.10201186686754227, 0.17360571026802063, 0.1112011969089508, -0.03348817676305771, 0.4511297941207886, -0.11787845939397812, -0.14567720890045166, -0.1546592116355896, 0.03903275355696678, -0.09912972152233124, -0.27610254287719727, -0.46565377712249756, 0.007071956992149353, 0.2258937656879425, 0.0004967339336872101, -0.12487012147903442, 0.4195837676525116, -0.21768589317798615, 0.04423481225967407, -0.061443571001291275, -0.17342418432235718, 0.1405928134918213, -0.2263418585062027, 0.41300201416015625, -0.13565737009048462 ]
https://github.com/huggingface/datasets/issues/5743
We no longer depend on `dataclasses` (for almost a year), so I don't think our package is the problematic one. I think it makes more sense to raise this issue in the `dataclasses` repo: https://github.com/ericvsmith/dataclasses.
dataclass.py in virtual environment is overriding the stdlib module "dataclasses"
### Describe the bug "e:\Krish_naik\FSDSRegression\venv\Lib\dataclasses.py" is overriding the stdlib module "dataclasses" ### Steps to reproduce the bug module issue ### Expected behavior overriding the stdlib module "dataclasses" ### Environment info VS code
35
dataclass.py in virtual environment is overriding the stdlib module "dataclasses" ### Describe the bug "e:\Krish_naik\FSDSRegression\venv\Lib\dataclasses.py" is overriding the stdlib module "dataclasses" ### Steps to reproduce the bug module issue ### Expected behavior overriding the stdlib module "dataclasses" ### Environment info VS code We no longer depend on `dataclasses` (for almost a year), so I don't think our package is the problematic one. I think it makes more sense to raise this issue in the `dataclasses` repo: https://github.com/ericvsmith/dataclasses.
[ 0.015579409897327423, -0.22331739962100983, -0.0798734799027443, 0.20997966825962067, 0.5270578265190125, -0.17621904611587524, 0.31583866477012634, 0.07913129031658173, -0.3309014141559601, 0.25833940505981445, 0.40296804904937744, 0.2730787396430969, -0.17049920558929443, -0.048444394022226334, 0.3637487292289734, 0.08845606446266174, 0.228268101811409, -0.1354999840259552, -0.47527384757995605, -0.06719796359539032, -0.13259775936603546, 0.16254718601703644, -0.13013993203639984, 0.05483968183398247, 0.05267946794629097, 0.1955523043870926, 0.07028365880250931, 0.299348920583725, 0.07811755686998367, -0.21992656588554382, 0.5368739366531372, 0.05140424892306328, 0.27263590693473816, 0.18470647931098938, -0.00010083301458507776, 0.009114012122154236, 0.0351792611181736, 0.06654325127601624, -0.033363327383995056, 0.343781054019928, 0.09725497663021088, -0.2518806457519531, -0.05784812942147255, -0.11774340271949768, -0.15929624438285828, -0.44964170455932617, -0.39090433716773987, -0.1635923683643341, 0.2507524788379669, 0.017922338098287582, 0.31909722089767456, -0.010287493467330933, -0.04832076653838158, 0.17164593935012817, 0.1683465838432312, 0.03943571075797081, -0.06428073346614838, 0.3296460509300232, 0.328264445066452, -0.024333642795681953, 0.01661616563796997, 0.23724880814552307, -0.18567001819610596, -0.11216381192207336, 0.5107561945915222, 0.022648930549621582, -0.07951429486274719, 0.10625039041042328, 0.0099496990442276, -0.08004838228225708, 0.42265915870666504, -0.2974430322647095, -0.02952379174530506, 0.15416419506072998, 0.24172678589820862, -0.462720662355423, 0.27482154965400696, -0.17143172025680542, 0.19165213406085968, 0.30649325251579285, 0.18346664309501648, 0.122372105717659, -0.11181271076202393, 0.11282359063625336, 0.06962460279464722, -0.082061268389225, -0.13365837931632996, 0.058859966695308685, -0.11460274457931519, -0.17297549545764923, 0.05054266005754471, 0.3403269052505493, -0.17311261594295502, -0.018709788098931313, -0.18774211406707764, -0.12365670502185822, 0.042215608060359955, -0.2849240005016327, 0.34735140204429626, 0.2928214371204376, -0.09509842097759247, 0.19521719217300415, 0.013194791972637177, -0.1866484135389328, 0.04982996731996536, 0.3625023066997528, -0.0884510725736618, 0.3311871588230133, 0.44774922728538513, -0.06177961826324463, -0.13259924948215485, 0.25000184774398804, 0.01686250790953636, -0.1924845278263092, 0.2874130308628082, 0.0016984660178422928, 0.1499023586511612, -0.12359379976987839, -0.17387299239635468, 0.5184984803199768, -0.3284244239330292, 0.2964567542076111, 0.26897600293159485, 0.3079136610031128, 0.16192792356014252, 0.1524699330329895, 0.3416818082332611, 0.011771893128752708, -0.18944932520389557, 0.040355537086725235, -0.23426824808120728, 0.010259177535772324, -0.06611238420009613, -0.2849109172821045, 0.06942715495824814, 0.04077744856476784, -0.07778067886829376, 0.26708707213401794, 0.12628597021102905, -0.23778486251831055, 0.021230779588222504, 0.21383552253246307, 0.01028585433959961, 0.0958663672208786, -0.4864421486854553, 0.03610234707593918, 0.18020275235176086, 0.2493932545185089, 0.011675700545310974, 0.15586401522159576, -0.27275756001472473, -0.22094368934631348, 0.09758207947015762, 0.36850669980049133, -0.09457890689373016, 0.08206063508987427, 0.327841192483902, -0.025587383657693863, -0.13536912202835083, -0.2398354709148407, 0.1939443200826645, -0.15165568888187408, 0.19981881976127625, -0.18262076377868652, 0.28694456815719604, 0.15104557573795319, -0.2871928811073303, 0.07692784070968628, 0.062021464109420776, -0.0855146050453186, 0.24972444772720337, -0.02957969158887863, -0.42758506536483765, -0.026255648583173752, -0.12456753104925156, -0.6045264005661011, 0.14099299907684326, -0.1715250015258789, -0.6888602375984192, -0.0022878646850585938, -0.23882317543029785, -0.046686213463544846, 0.05969250202178955, 0.33594202995300293, -0.12282694876194, -0.00946851447224617, 0.044789187610149384, 0.3589334487915039, 0.19455571472644806, 0.02235174924135208, -0.497618168592453, -0.2234996110200882, 0.14396785199642181, 0.17855243384838104, 0.0785364881157875, -0.05157265439629555, -0.03557705506682396, 0.4008544087409973, 0.06324057281017303, -0.02848200872540474, -0.11766374856233597, 0.3152987062931061, 0.19550368189811707, 0.17720124125480652, 0.13811741769313812, -0.44575634598731995, -0.048808105289936066, -0.010885648429393768, -0.24316154420375824, 0.04934115335345268, 0.19757670164108276, -0.14395278692245483, 0.1695409119129181, -0.08662522584199905, -0.22227545082569122, -0.36241212487220764, 0.2703081965446472, -0.030032429844141006, -0.002935260534286499, -0.2291651964187622, -0.2895289361476898, 0.12940607964992523, -0.21547871828079224, 0.15465223789215088, 0.1711420863866806, 0.19271335005760193, -0.2243204265832901, -0.02801341377198696, -0.24726155400276184, 0.3084905743598938, -0.007166655734181404, -0.3033343553543091, -0.2820262312889099, 0.2713739275932312, 0.1567091941833496, -0.30574655532836914, 0.10451257228851318, 0.08762483298778534, 0.1032799780368805, -0.24999481439590454, 0.18002460896968842, 0.4128580689430237, -0.06499499827623367, 0.0718674287199974, 0.2003019005060196, 0.16441389918327332, 0.040727660059928894, 0.11764983832836151, -0.043718550354242325, 0.10323276370763779, 0.3051743507385254, -0.04429643973708153, -0.15701234340667725, -0.1895417869091034, 0.23889562487602234, 0.3309461772441864, 0.48973536491394043, 0.07170478254556656, -0.2502371370792389, -0.013706106692552567, 0.0631004199385643, -0.1264628767967224, 0.07934427261352539, 0.05590682104229927, -0.2647382915019989, 0.11173848807811737, -0.02401566691696644, 0.17215776443481445, 0.26474225521087646, 0.2406509965658188, -0.08687618374824524, 0.038313575088977814, -0.06463779509067535, -0.023391414433717728, 0.09554172307252884, 0.010286854580044746, -0.10634990781545639, -0.0529957041144371, 0.06986864656209946, 0.2064288854598999, -0.25602298974990845, 0.09072111546993256, -0.15755696594715118, 0.17269308865070343, -0.1779198795557022, 0.3140549659729004, -0.6057782173156738, -0.21716129779815674, -0.3867373466491699, -0.1922871470451355, -0.3685815930366516, 0.02541416883468628, 0.17771871387958527, -0.37664878368377686, -0.33096587657928467, 0.19748292863368988, 0.2581692337989807, 0.19298160076141357, -0.13325288891792297, -0.2714257538318634, 0.25368833541870117, 0.15489764511585236, -0.5509704947471619, 0.1387161910533905, 0.20816421508789062, 0.17742428183555603, 0.48374155163764954, 0.16122108697891235, -0.19178004562854767, -0.30678877234458923, -0.4932284355163574, -0.03023381531238556, 0.005027917213737965, 0.5711092352867126, 0.2707335650920868, 0.0028746649622917175, 0.18632648885250092, -0.05386393889784813, 0.15970611572265625, -0.16607241332530975, -0.014773830771446228, 0.029190994799137115, 0.011726927012205124, 0.07747270166873932, -0.3585939109325409, -0.36009761691093445, -0.10736394673585892, -0.3805284798145294, -0.30001339316368103, -0.098942331969738, -0.0033142734318971634, 0.181422159075737, -0.01583528146147728, 0.18660202622413635, 0.17249882221221924, 0.14783704280853271, -0.2885730564594269, -0.08383780717849731, -0.07599502801895142, -0.10460928082466125, -0.4070209264755249, -0.13881559669971466, 0.029992789030075073, 0.09097102284431458, -0.04991939663887024, -0.22290228307247162, -0.3210954964160919, -0.10913429409265518, 0.1021549180150032, -0.2069617062807083, 0.0868622288107872, 0.34855470061302185, 0.06413625180721283, -0.12143737077713013, -0.056716881692409515, -0.23308035731315613, 0.15019777417182922, -0.10311076045036316, 0.2222154438495636, -0.06523442268371582, 0.15890373289585114, -0.06380156427621841, 0.021573081612586975, 0.19023987650871277, -0.1894652545452118, 0.19967402517795563, 0.03567197173833847, 0.43346190452575684, -0.1553293764591217, -0.2459859549999237, -0.07021699845790863, 0.045761264860630035, -0.20062477886676788, 0.1516733467578888, 0.005105499178171158, 0.19974298775196075, 0.02933529019355774, -0.2947971522808075, 0.120773084461689, -0.2589879631996155, 0.12141064554452896, -0.3054051995277405, 0.18905480206012726, -0.06173258274793625, 0.12082728743553162, -0.059661686420440674, 0.06285426020622253, 0.04672761633992195, 0.5416268706321716, -0.21550875902175903, 0.22746144235134125, -0.5703558921813965, -0.1310230791568756, 0.14929507672786713, 0.2127263844013214, -0.12655940651893616, 0.1746121346950531, -0.143439382314682, -0.1316969096660614, 0.07338067889213562, -0.34243109822273254, 0.4187523126602173, 0.13511301577091217, 0.144436776638031, -0.017667286098003387, 0.09588360786437988, 0.1503286063671112, -0.22836583852767944, 0.014339491724967957, -0.18713301420211792, 0.05463794246315956, -0.23158034682273865, -0.011389277875423431, -0.2638159692287445, 0.5745932459831238, 0.18174859881401062, -0.10100940614938736, -0.19376415014266968, -0.2554255425930023, -0.35663139820098877, -0.13827058672904968, -0.032554708421230316, -0.04623609781265259, -0.04275169596076012, -0.1975245326757431, -0.2618042826652527, 0.1453426033258438, -0.22977125644683838, 0.0011843256652355194, -0.11080459505319595, 0.43296167254447937, -0.2618078887462616, 0.1988687515258789, -0.1692870855331421, 0.18437035381793976, 0.2125336080789566, 0.3941059410572052, 0.010511824861168861, -0.2506521940231323, -0.0739661380648613, -0.008559312671422958, 0.24088050425052643, 0.3152894377708435, -0.3965451121330261, 0.17125770449638367, -0.1017652153968811, -0.14534780383110046, -0.20176005363464355, -0.008919734507799149, 0.3677106201648712, 0.16948458552360535, 0.14936746656894684, -0.46922197937965393, 0.07846866548061371, -0.07829079031944275, -0.012787863612174988, 0.25529199838638306, -0.009998463094234467, -0.37818652391433716, 0.3524284064769745, 0.15893316268920898, 0.8436528444290161, 0.4830697774887085, 0.278054416179657, 0.05967603996396065, 0.11177176237106323, 0.2825504541397095, 0.11883940547704697, 0.06927268952131271, -0.18075498938560486, -0.1941494643688202, 0.08175797015428543, -0.1202208548784256, 0.39080682396888733, -0.2096458077430725, -0.038326893001794815, 0.08232446014881134, -0.1642514169216156, 0.26957955956459045, -0.1352023184299469, 0.021775707602500916, 0.011834772303700447, -0.04091546684503555, -0.2275710105895996, 0.29420268535614014, -0.05121447145938873, -0.06426282972097397, -0.14183731377124786, -0.04777936637401581, -0.15172186493873596, -0.4150227904319763, -0.2571372985839844, 0.051101259887218475, 0.09990579634904861, 0.23279690742492676, -0.02203965373337269, -0.21996378898620605, -0.035810694098472595, 0.08272332698106766, 0.22836336493492126, 0.3201112449169159, -0.1305077075958252, 0.13919144868850708, 0.010234624147415161, 0.33084869384765625, 0.17549172043800354, 0.22473444044589996, 0.5156168937683105, -0.1841626614332199, -0.23739489912986755, -0.13124826550483704, 0.07238994538784027, -0.128189355134964, -0.11467298120260239, -0.13685725629329681, 0.026651034131646156, -0.09365306049585342, 0.22319108247756958, 0.26935577392578125, -0.16387496888637543, -0.3119499087333679, 0.298175573348999, 0.1662849634885788, -0.0691838338971138, 0.2548142671585083, -0.14760735630989075, -0.11263469606637955, -0.18382874131202698, 0.23867864906787872, 0.27627748250961304, -0.06442975997924805, 0.35827746987342834, 0.04662414640188217, -0.033329423516988754, -0.3033190071582794, 0.25981947779655457, 0.0909198746085167, -0.08647559583187103, 0.028055809438228607, 0.04297281801700592, -0.23158687353134155, 0.34704849123954773, 0.21063102781772614, 0.13758721947669983, -0.16039982438087463, -0.43766874074935913, -0.07635784149169922, -0.3863026797771454, 0.132365882396698, -0.18045416474342346, 0.144068643450737, -0.18103870749473572, 0.5252792239189148, -0.09076664596796036, -0.14360912144184113, -0.45155811309814453, -0.1613885760307312, -0.08252353966236115, -0.13489758968353271, -0.19915316998958588, -0.031009994447231293, 0.2063477486371994, 0.16160225868225098, 0.21262972056865692, 0.046609532088041306, -0.2031652331352234, -0.2885909080505371, -0.3580489158630371, 0.03289408981800079, -0.19732169806957245, 0.07232792675495148, 0.02444734051823616, -0.4000748097896576, 0.009328478947281837, 0.07527951896190643, 0.2464996576309204, -0.08922679722309113, 0.02015291154384613, 0.3858564794063568, -0.16417203843593597, 0.3578442335128784, 0.2658473253250122, -0.06194205582141876, -0.13225701451301575, 0.06570534408092499, 0.030389901250600815, -0.11030155420303345, 0.010583411902189255, -0.0851697102189064, -0.30758413672447205, 0.08029668033123016, -0.06636163592338562, 0.014441661536693573, 0.2312038093805313, -0.16459286212921143, 0.015530489385128021, 0.2893039882183075, 0.1739031970500946, 0.43662309646606445, -0.3451841473579407, 0.04557998478412628, 0.20651286840438843, 0.33000633120536804, -0.2227904200553894, -0.2184481918811798, -0.43681374192237854, -0.19072428345680237, -0.07697185128927231, 0.13861142098903656, 0.22086727619171143, 0.13692548871040344, 0.34565088152885437, -0.021429114043712616, 0.48417845368385315, -0.36374786496162415, 0.24985605478286743, 0.28508466482162476, -0.1465156525373459, -0.060623280704021454, 0.09448373317718506, 0.1040211170911789, 0.1265445053577423, 0.4684743881225586, 0.003074467182159424, 0.006249621510505676, -0.26296931505203247, 0.12265662848949432, 0.14934352040290833, -0.13258884847164154, 0.11549978703260422, 0.18133217096328735, 0.16994567215442657, 0.14967571198940277, -0.062366291880607605, 0.17655684053897858, -0.5713229179382324, -0.14937587082386017, -0.15386925637722015, -0.04143085330724716, -0.2660592794418335, 0.20295904576778412, 0.02537720650434494, 0.05620121955871582, -0.014776475727558136, -0.13040880858898163, -0.25455233454704285, -0.0893455296754837, -0.015170656144618988, -0.05537489429116249, -0.34505245089530945, -0.3929828703403473, -0.11916995048522949, -0.04229369014501572, -0.11333370208740234, -0.09598888456821442, 0.28419408202171326, 0.11849360167980194, 0.0659574419260025, 0.15271252393722534, 0.011634200811386108, 0.10946288704872131, 0.4755215644836426, 0.01935294270515442, -0.3086557388305664, -0.05855420231819153, 0.04447455704212189, -0.41887158155441284, 0.08223181962966919, -0.0992991179227829, 0.3971443176269531, 0.10351969301700592, 0.1787872016429901, -0.2687678635120392, -0.05375304073095322, 0.13196337223052979, 0.33677005767822266, -0.23309403657913208, 0.5463001132011414, 0.056896407157182693, -0.011296339333057404, -0.27983975410461426, 0.07217080891132355, -0.4936339855194092, -0.09211188554763794, 0.26766854524612427, 0.4112340807914734, 0.022154107689857483, -0.14201468229293823, 0.1614098995923996, 0.12743444740772247, 0.6561083793640137, -0.006614625453948975, -0.1411525011062622, -0.09972143173217773, -0.09878155589103699, -0.4837658405303955, 0.44326794147491455, -0.06460124254226685, -0.08618984371423721, 0.029224775731563568, -0.2502777576446533, 0.2090998888015747, -0.08262921869754791, 0.15078508853912354, -0.25395700335502625, 0.07869894802570343, -0.2895733416080475, -0.3977696895599365, -0.13717021048069, 0.08000925183296204, 0.11805137991905212, 0.0681162178516388, -0.17094022035598755, 0.16071590781211853, 0.07572434097528458, 0.0693478211760521, -0.059466224163770676, -0.005441941320896149, 0.0741838663816452, 0.08486293256282806, 0.38985881209373474, 0.1630057841539383, 0.17365650832653046, -0.09446895867586136, -0.1961010992527008, -0.37628641724586487, -0.29868340492248535, -0.413682758808136, 0.07510904967784882, -0.05975610017776489, 0.11600548028945923, -0.004465550184249878, -0.356598824262619, -0.37150031328201294, -0.1104368343949318, 0.16592416167259216, 0.020022157579660416, -0.4523799419403076, 0.34008461236953735, 0.09841762483119965, 0.006053216755390167, 0.0937306135892868, 0.41662928462028503, 0.010921181179583073, -0.000561494380235672, -0.4060855507850647, -0.21553438901901245, 0.2542705237865448, -0.11550061404705048, -0.09687364846467972, 0.14723330736160278, 0.3456364870071411, -0.14687496423721313, -0.3101612627506256, -0.22152099013328552, -0.027347080409526825, 0.12819427251815796, 0.17583590745925903, -0.127118319272995, 0.459290474653244, -0.06032872200012207, 0.0835304707288742, 0.007076159119606018, 0.1744174063205719, 0.14392349123954773, -0.026522263884544373, 0.4234231114387512, -0.13695654273033142 ]
https://github.com/huggingface/datasets/issues/5739
hi! I think you can run python from `/data/train/raw/` directory and load dataset as `load_dataset("code_contests")` to mitigate this issue as a workaround. @ericxsun Do you want to open a PR to fix the regex? As you already found the solution :)
weird result during dataset split when data path starts with `/data`
### Describe the bug The regex defined here https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158 will cause a weird result during dataset split when data path starts with `/data` ### Steps to reproduce the bug 1. clone dataset into local path ``` cd /data/train/raw/ git lfs clone https://huggingface.co/datasets/deepmind/code_contests.git ls /data/train/raw/code_contests # README.md data dataset_infos.json ls /data/train/raw/code_contests/data # test-00000-of-00001-9c49eeff30aacaa8.parquet # train-[0-9]+-of-[0-9]+-xx.parquet # valid-00000-of-00001-5e672c5751f060d3.parquet ``` 2. loading data from local ``` from datasets import load_dataset dataset = load_dataset('/data/train/raw/code_contests') FileNotFoundError: Unable to resolve any data file that matches '['data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*']' at /data/train/raw/code_contests with any supported extension ``` weird path `data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*` While dive deep into `LocalDatasetModuleFactoryWithoutScript` defined in [load.py](https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/load.py#L627) and _get_data_files_patterns https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/data_files.py#L228. I found the weird behavior caused by `string_to_dict` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` go deep into string_to_dict https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158. 4. test the regex: <img width="680" alt="image" src="https://user-images.githubusercontent.com/1772912/231351129-75179f01-fb9f-4f12-8fa9-0dfcc3d5f3bd.png"> <img width="679" alt="image" src="https://user-images.githubusercontent.com/1772912/231351025-009f3d83-2cf3-4e15-9ed4-6b9663dcb2ee.png"> ### Expected behavior statement in `steps to reproduce the bug` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` ### Environment info - linux(debian) - python 3.7 - datasets 2.8.0
41
weird result during dataset split when data path starts with `/data` ### Describe the bug The regex defined here https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158 will cause a weird result during dataset split when data path starts with `/data` ### Steps to reproduce the bug 1. clone dataset into local path ``` cd /data/train/raw/ git lfs clone https://huggingface.co/datasets/deepmind/code_contests.git ls /data/train/raw/code_contests # README.md data dataset_infos.json ls /data/train/raw/code_contests/data # test-00000-of-00001-9c49eeff30aacaa8.parquet # train-[0-9]+-of-[0-9]+-xx.parquet # valid-00000-of-00001-5e672c5751f060d3.parquet ``` 2. loading data from local ``` from datasets import load_dataset dataset = load_dataset('/data/train/raw/code_contests') FileNotFoundError: Unable to resolve any data file that matches '['data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*']' at /data/train/raw/code_contests with any supported extension ``` weird path `data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*` While dive deep into `LocalDatasetModuleFactoryWithoutScript` defined in [load.py](https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/load.py#L627) and _get_data_files_patterns https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/data_files.py#L228. I found the weird behavior caused by `string_to_dict` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` go deep into string_to_dict https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158. 4. test the regex: <img width="680" alt="image" src="https://user-images.githubusercontent.com/1772912/231351129-75179f01-fb9f-4f12-8fa9-0dfcc3d5f3bd.png"> <img width="679" alt="image" src="https://user-images.githubusercontent.com/1772912/231351025-009f3d83-2cf3-4e15-9ed4-6b9663dcb2ee.png"> ### Expected behavior statement in `steps to reproduce the bug` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` ### Environment info - linux(debian) - python 3.7 - datasets 2.8.0 hi! I think you can run python from `/data/train/raw/` directory and load dataset as `load_dataset("code_contests")` to mitigate this issue as a workaround. @ericxsun Do you want to open a PR to fix the regex? As you already found the solution :)
[ -0.1913374364376068, -0.035746872425079346, -0.03948085755109787, 0.2577301859855652, 0.3165464997291565, -0.1170235350728035, 0.26577746868133545, 0.36108270287513733, -0.08732005208730698, 0.006909780204296112, -0.10704927146434784, 0.25627070665359497, -0.01029534824192524, 0.011353425681591034, -0.015172140672802925, 0.1639934927225113, 0.030738823115825653, 0.08910343050956726, -0.1760586053133011, -0.26048749685287476, -0.3691582679748535, 0.23660866916179657, -0.11968694627285004, 0.22855329513549805, -0.2589901387691498, 0.18518276512622833, 0.07644136995077133, 0.5329985618591309, -0.03166898339986801, 0.027457989752292633, 0.0976848155260086, -0.3198455572128296, -0.13738790154457092, 0.5350474715232849, -0.00011439962690928951, 0.08675239235162735, 0.27068471908569336, 0.06516797095537186, -0.29020822048187256, -0.47536540031433105, -0.42624813318252563, 0.37470972537994385, 0.04214930534362793, -0.06157831847667694, -0.05016568303108215, -0.03479679673910141, -0.12138758599758148, -0.40154093503952026, 0.27321380376815796, 0.32430726289749146, 0.16498622298240662, 0.1786404848098755, -0.46397826075553894, 0.0435059517621994, 0.4622340202331543, 0.4378010332584381, 0.07753197103738785, -0.017365846782922745, 0.10358689725399017, -0.055302057415246964, 0.039680082350969315, 0.17182929813861847, -0.0582994781434536, -0.03478812426328659, -0.04213212430477142, 0.3503524661064148, -0.1249472126364708, -0.17644184827804565, 0.09751881659030914, 0.5037024021148682, -0.14024831354618073, -0.10833483934402466, -0.19899483025074005, -0.17655500769615173, -0.26452574133872986, -0.3798922896385193, 0.1979377120733261, 0.41069555282592773, 0.06987311691045761, 0.32269132137298584, -0.18419969081878662, 0.11257919669151306, -0.02078905701637268, -0.041549716144800186, -0.21156048774719238, 0.400379478931427, -0.03976423293352127, 0.09122495353221893, 0.02823938988149166, -0.12600640952587128, -0.4376716911792755, -0.32614558935165405, -0.13181540369987488, 0.13519872725009918, -0.09101070463657379, 0.0003933906555175781, -0.1696016937494278, -0.19884200394153595, 0.2693644165992737, 0.3297837972640991, -0.11440257728099823, -0.016840171068906784, -0.14164510369300842, 0.014991676434874535, 0.07829354703426361, 0.06632477045059204, -0.21946772933006287, 0.42080700397491455, 0.29672372341156006, 0.13570190966129303, -0.21228718757629395, -0.01654314622282982, 0.1496005654335022, -0.20231632888317108, -0.41205793619155884, 0.018675632774829865, 0.3208954334259033, -0.2107698619365692, -0.40576231479644775, 0.2137128710746765, -0.10364878922700882, -0.03563951700925827, 0.1428370326757431, 0.3533203601837158, -0.03734529763460159, -0.029761111363768578, -0.145143061876297, 0.30469661951065063, -0.06147301569581032, -0.10265523195266724, -0.2839507460594177, -0.21401208639144897, -0.27813562750816345, -0.27860674262046814, -0.033060308545827866, 0.09535530209541321, 0.23507186770439148, 0.21034802496433258, -0.19049084186553955, -0.24786600470542908, 0.03360883891582489, -0.19714440405368805, 0.36552974581718445, 0.2693811058998108, -0.14414356648921967, 0.09999874979257584, 0.1983843296766281, -0.24193699657917023, -0.004697427153587341, 0.17305804789066315, -0.2099585384130478, -0.26903659105300903, -0.23903146386146545, 0.20719444751739502, -0.16939285397529602, 0.06816991418600082, -0.346448689699173, 0.017746100202202797, -0.020856808871030807, 0.30103111267089844, 0.18367816507816315, 0.06010057032108307, -0.08679457008838654, -0.026935670524835587, 0.3956659138202667, 0.2504304051399231, -0.21155069768428802, -0.05313745513558388, -0.2581983208656311, -0.05232904478907585, 0.3672941029071808, 0.41017547249794006, -0.0450187586247921, 0.03490288555622101, -0.4088059067726135, 0.5724536776542664, 0.5669054388999939, -0.18675494194030762, -0.11068839579820633, 0.7089051008224487, -0.35818541049957275, 0.04051407426595688, 0.2320634126663208, -0.3309156894683838, 0.08931216597557068, -0.05251258611679077, -0.2092239409685135, 0.6658726334571838, 0.07676123082637787, 0.024428844451904297, -0.34259945154190063, -0.484443336725235, 0.058116279542446136, 0.09515820443630219, 0.02940261736512184, -0.2400704026222229, 0.2237246334552765, 0.02023041993379593, 0.4630572497844696, -0.1899416595697403, 0.07746770232915878, 0.1500428318977356, 0.3800291121006012, 0.21162523329257965, 0.16630110144615173, -0.35480940341949463, -0.2592182159423828, 0.09460322558879852, -0.4164919853210449, -0.21644409000873566, -0.3053285777568817, -0.1528347283601761, -0.3288613259792328, 0.004755452275276184, -0.35306882858276367, -0.16711975634098053, 0.1104031354188919, 0.020534947514533997, -0.08229443430900574, 0.247612863779068, 0.03451622277498245, -0.10065672546625137, 0.15834671258926392, 0.40665698051452637, -0.26446616649627686, 0.5946356058120728, 0.022319776937365532, -0.051515281200408936, -0.10480348765850067, 0.3280791938304901, 0.17930874228477478, -0.3470546305179596, 0.017545517534017563, 0.514944851398468, 0.3273453116416931, 0.35623565316200256, 0.12279191613197327, 0.06053696572780609, 0.1653798669576645, -0.13111716508865356, 0.01150195486843586, 0.3326983153820038, 0.017443597316741943, -0.07242266833782196, -0.07034482806921005, 0.2881197929382324, -0.1339658498764038, 0.5109726786613464, 0.10860216617584229, -0.11812804639339447, 0.2563479244709015, -0.36129218339920044, 0.12127697467803955, -0.3313255310058594, 0.30165839195251465, 0.3475097119808197, 0.5085479021072388, 0.11844953894615173, -0.2373259961605072, 0.03275627642869949, 0.3629264235496521, -0.235341876745224, 0.06111766770482063, 0.14075817167758942, -0.12294203042984009, -0.046274587512016296, -0.2336551696062088, 0.2523682713508606, 0.25574976205825806, 0.14942632615566254, 0.12633280456066132, 0.10175565630197525, 0.10665775090456009, -0.33275604248046875, 0.44229304790496826, 0.15170946717262268, -0.05014194920659065, 0.3374115526676178, 0.05025160685181618, 0.022377807646989822, -0.3151129186153412, -0.30838847160339355, 0.15329918265342712, -0.0008457973599433899, -0.18917307257652283, 0.2529986500740051, -0.5399752259254456, -0.2262904942035675, -0.6288320422172546, -0.21306896209716797, -0.3012910485267639, -0.19996142387390137, -0.0862276554107666, 0.057193323969841, -0.35401540994644165, 0.10760476440191269, 0.12595784664154053, -0.026654034852981567, -0.0800265446305275, -0.16597138345241547, -0.2153647392988205, 0.06763555109500885, -0.2568683922290802, 0.059615131467580795, 0.3095718026161194, 0.1862049102783203, -0.17637090384960175, 0.06889238208532333, -0.11855470389127731, -0.2803344130516052, -0.4971359372138977, 0.17544305324554443, 0.024069391191005707, 0.36546382308006287, 0.37683817744255066, -0.09638099372386932, 0.4214708209037781, -0.3163754343986511, 0.1860705018043518, 0.2783496379852295, -0.06053420156240463, 0.15935653448104858, -0.008564498275518417, 0.14973115921020508, -0.2282046526670456, -0.29615163803100586, 0.005485257133841515, -0.13954374194145203, 0.2234801948070526, -0.1816919445991516, 0.16703642904758453, 0.3474162518978119, -0.26437273621559143, 0.17121611535549164, -0.18841594457626343, -0.40172916650772095, -0.2429552972316742, -0.012895844876766205, 0.11168597638607025, -0.16909582912921906, -0.1506396234035492, -0.09165845066308975, -0.12154186517000198, 0.06570819765329361, -0.05557418242096901, -0.498491108417511, 0.12216269224882126, -0.277921587228775, 0.1375238299369812, -0.018112098798155785, -0.04438626393675804, 0.025304611772298813, -0.1781044751405716, -0.03316919878125191, -0.24841660261154175, 0.22103089094161987, 0.28329116106033325, 0.0029253140091896057, 0.13691164553165436, 0.03838734328746796, 0.4990198612213135, 0.18483085930347443, 0.5098304748535156, 0.06729497760534286, 0.2420455813407898, 0.16488893330097198, -0.0996415987610817, 0.11941090226173401, -0.3789173662662506, 0.027545586228370667, 0.12300426512956619, 0.1726408451795578, -0.25293102860450745, 0.346853643655777, 0.1372552365064621, 0.13221649825572968, 0.24268317222595215, -0.20924150943756104, -0.012937277555465698, -0.34762826561927795, 0.07535959035158157, -0.07339569181203842, -0.2891410291194916, 0.1171925887465477, -0.12273020297288895, 0.17022469639778137, -0.015174847096204758, -0.14892031252384186, 0.30062606930732727, 0.2262497991323471, -0.08433400094509125, -0.17547687888145447, -0.15060092508792877, -0.01069854199886322, 0.11900470405817032, -0.007394004613161087, 0.11397688835859299, -0.18332074582576752, -0.12429652363061905, 0.001100197434425354, 0.03905637562274933, 0.7251129150390625, 0.03352028876543045, 0.6054189205169678, -0.11554452776908875, -0.11682642996311188, -0.4465649127960205, -0.042458705604076385, -0.08523648232221603, -0.15137609839439392, 0.280232697725296, 0.7456430196762085, -0.27253952622413635, -0.04293331503868103, 0.43477073311805725, 0.15390154719352722, -0.04634235054254532, 0.20915228128433228, -0.20995979011058807, -0.2235317826271057, 0.06884920597076416, 0.026107296347618103, 0.18781694769859314, 0.11054442822933197, -0.1295248419046402, -0.1473482847213745, -0.08768757432699203, -0.43217068910598755, -0.04864794760942459, -0.07704277336597443, 0.28915935754776, -0.24636711180210114, 0.2466321587562561, 0.0696738213300705, 0.1542130410671234, 0.0954667255282402, 0.5130859613418579, -0.17716075479984283, -0.4283727705478668, 0.03884991258382797, -0.40937983989715576, 0.28134357929229736, 0.38788190484046936, -0.13751555979251862, 0.10955595970153809, 0.19206847250461578, 0.16586418449878693, -0.3126773536205292, 0.27064916491508484, 0.30229437351226807, 0.03723805770277977, -0.21155676245689392, -0.16017907857894897, 0.4905760884284973, -0.020531021058559418, -0.2021138072013855, 0.19487960636615753, 0.08778883516788483, -0.6076966524124146, 0.4132387042045593, -0.260429322719574, 0.8223168849945068, 0.23605388402938843, 0.1619713306427002, 0.30170899629592896, -0.5073950886726379, 0.03635372593998909, 0.1264362782239914, -0.22633299231529236, -0.28105318546295166, -0.2824361324310303, 0.004148043692111969, -0.10965903103351593, 0.18518634140491486, 0.4546397626399994, -0.10798192769289017, 0.15307603776454926, -0.34856516122817993, 0.27788490056991577, 0.11107134819030762, 0.3132550120353699, 0.12090232223272324, 0.046832386404275894, -0.2819731831550598, 0.0729513019323349, 0.006731041707098484, 0.00008766725659370422, 0.09949766099452972, -0.23376882076263428, -0.29625391960144043, -0.33027344942092896, -0.11774963140487671, 0.280384361743927, -0.17300911247730255, 0.18695837259292603, 0.12798188626766205, -0.45593562722206116, -0.21800774335861206, -0.07036323100328445, 0.1439591497182846, 0.24716687202453613, -0.08183243125677109, 0.19903436303138733, -0.112984299659729, 0.2507738173007965, 0.18212871253490448, -0.13330726325511932, 0.18658727407455444, -0.09942138940095901, -0.18841561675071716, -0.46984076499938965, -0.10444469749927521, -0.118354432284832, 0.013324111700057983, -0.052430033683776855, 0.004693040158599615, -0.2937682271003723, -0.12814731895923615, -0.04467028006911278, -0.04019460082054138, -0.15769678354263306, 0.10687611252069473, -0.1477118581533432, -0.13296085596084595, -0.012937404215335846, -0.09212739020586014, -0.39022427797317505, -0.40109241008758545, 0.10229749977588654, -0.04702998697757721, 0.27375170588493347, 0.5288305282592773, 0.02716539055109024, -0.06108492612838745, -0.27943405508995056, 0.3782038390636444, 0.6807368993759155, -0.5839011669158936, 0.1601133793592453, -0.3928098976612091, -0.06292717158794403, 0.06424660980701447, 0.22851525247097015, -0.1133526861667633, 0.03657500073313713, -0.28139787912368774, -0.5276594758033752, 0.13303536176681519, 0.07007920742034912, -0.25339415669441223, -0.03748956322669983, 0.020098000764846802, 0.40932878851890564, -0.037180520594120026, -0.20701633393764496, -0.2472570538520813, 0.3847101926803589, -0.02390795573592186, 0.23722758889198303, -0.022014979273080826, -0.31211960315704346, 0.48265519738197327, 0.013913054019212723, 0.11963340640068054, -0.04167592152953148, 0.003320641815662384, -0.22361671924591064, -0.3957866132259369, 0.08166343718767166, 0.01691408082842827, -0.2281206250190735, -0.14580971002578735, 0.15009742975234985, -0.1380239725112915, -0.06306596100330353, 0.21499958634376526, 0.11678983271121979, 0.12836815416812897, 0.10834129899740219, 0.39505258202552795, -0.1875549852848053, -0.19373229146003723, -0.01133075263351202, -0.3254848122596741, 0.4605913758277893, 0.053853850811719894, 0.18786779046058655, -0.204812154173851, -0.018840745091438293, -0.36021527647972107, -0.19644564390182495, 0.14915378391742706, 0.2669389545917511, 0.4120807945728302, -0.28760024905204773, -0.19479700922966003, 0.19580677151679993, 0.47541892528533936, 0.24677391350269318, -0.17528869211673737, -0.29973500967025757, 0.18603087961673737, 0.22881059348583221, -0.054911866784095764, -0.18773534893989563, 0.21164917945861816, -0.06093582510948181, 0.03960321843624115, 0.257167786359787, 0.1474369466304779, 0.07627105712890625, -0.07253125309944153, 0.07171749323606491, 0.9361788034439087, 0.08468572795391083, 0.4467211365699768, 0.2668941915035248, -0.28810638189315796, 0.10958351194858551, 0.05911433696746826, 0.030612356960773468, 0.1297227442264557, 0.4089776873588562, -0.03504718095064163, 0.18479743599891663, 0.15209347009658813, 0.07399573922157288, 0.35887277126312256, -0.24526458978652954, -0.0896168202161789, 0.3647305369377136, -0.29188182950019836, 0.151602640748024, -0.05005413666367531, 0.34700557589530945, -0.18898053467273712, 0.013867050409317017, 0.037281133234500885, 0.13599978387355804, -0.10968760401010513, -0.14357244968414307, 0.04264681041240692, -0.0738014429807663, -0.16956010460853577, -0.10125349462032318, -0.05147385224699974, -0.06500900536775589, 0.012541409581899643, 0.19076961278915405, 0.008231163024902344, 0.10290813446044922, -0.00445652985945344, 0.16213732957839966, 0.027774378657341003, -0.33458641171455383, 0.41933339834213257, 0.20904265344142914, -0.19834399223327637, 0.5612190961837769, 0.15031535923480988, 0.285547137260437, 0.2058291733264923, -0.03251985087990761, -0.23784874379634857, -0.0650046095252037, -0.09900316596031189, -0.04603291675448418, 0.2359658181667328, -0.16262570023536682, 0.13502047955989838, 0.3966066837310791, 0.18635110557079315, -0.15431378781795502, 0.023805269971489906, 0.360373854637146, 0.27112942934036255, -0.3381553888320923, 0.33928197622299194, -0.10396771132946014, -0.03841201961040497, -0.2240408957004547, -0.22027674317359924, -0.4655924439430237, 0.05200936272740364, 0.1745590716600418, -0.11873316019773483, 0.20336374640464783, 0.21485425531864166, 0.06369531154632568, 0.14641433954238892, 0.3552705645561218, 0.15403899550437927, -0.20951932668685913, -0.16156291961669922, -0.2024010866880417, -0.23867419362068176, 0.0053115785121917725, -0.002273896709084511, -0.09907019138336182, 0.12634950876235962, 0.15503907203674316, -0.3125184178352356, -0.027680696919560432, 0.12113406509160995, 0.1672496199607849, -0.3177774250507355, -0.006629126146435738, -0.11576501280069351, -0.044952329248189926, -0.1375250518321991, 0.07380358129739761, -0.09882422536611557, -0.3650725781917572, 0.45236122608184814, 0.26502469182014465, -0.0410328134894371, 0.003638727590441704, -0.014472968876361847, -0.02462327852845192, -0.056167688220739365, -0.07701565325260162, 0.3908972144126892, -0.048489462584257126, -0.08129961788654327, -0.17888210713863373, -0.3544842302799225, -0.33423635363578796, -0.21159440279006958, 0.3393433392047882, 0.056778017431497574, 0.3355206847190857, -0.10847708582878113, -0.17410798370838165, -0.3808729648590088, 0.09944559633731842, -0.028097037225961685, -0.25479045510292053, -0.29502537846565247, 0.08206132054328918, -0.1556818187236786, 0.08518578857183456, -0.027846012264490128, 0.359727680683136, -0.029485855251550674, 0.06789570301771164, 0.14645613729953766, -0.5621553063392639, 0.3370262682437897, -0.23474442958831787, -0.3688754141330719, -0.07449321448802948, 0.37405136227607727, -0.08781780302524567, 0.022567572072148323, -0.43688657879829407, -0.05787619203329086, 0.4364609718322754, -0.013162769377231598, -0.07291062921285629, -0.0700014978647232, 0.2128758728504181, -0.17210835218429565, 0.0008606389164924622, -0.12305504083633423, 0.4333241581916809, -0.38045734167099, 0.4795485734939575, -0.13048553466796875 ]
https://github.com/huggingface/datasets/issues/5739
> hi! I think you can run python from `/data/train/raw/` directory and load dataset as `load_dataset("code_contests")` to mitigate this issue as a workaround. @ericxsun Do you want to open a PR to fix the regex? As you already found the solution :) Sure, please see https://github.com/huggingface/datasets/pull/5748 @polinaeterna
weird result during dataset split when data path starts with `/data`
### Describe the bug The regex defined here https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158 will cause a weird result during dataset split when data path starts with `/data` ### Steps to reproduce the bug 1. clone dataset into local path ``` cd /data/train/raw/ git lfs clone https://huggingface.co/datasets/deepmind/code_contests.git ls /data/train/raw/code_contests # README.md data dataset_infos.json ls /data/train/raw/code_contests/data # test-00000-of-00001-9c49eeff30aacaa8.parquet # train-[0-9]+-of-[0-9]+-xx.parquet # valid-00000-of-00001-5e672c5751f060d3.parquet ``` 2. loading data from local ``` from datasets import load_dataset dataset = load_dataset('/data/train/raw/code_contests') FileNotFoundError: Unable to resolve any data file that matches '['data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*']' at /data/train/raw/code_contests with any supported extension ``` weird path `data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*` While dive deep into `LocalDatasetModuleFactoryWithoutScript` defined in [load.py](https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/load.py#L627) and _get_data_files_patterns https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/data_files.py#L228. I found the weird behavior caused by `string_to_dict` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` go deep into string_to_dict https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158. 4. test the regex: <img width="680" alt="image" src="https://user-images.githubusercontent.com/1772912/231351129-75179f01-fb9f-4f12-8fa9-0dfcc3d5f3bd.png"> <img width="679" alt="image" src="https://user-images.githubusercontent.com/1772912/231351025-009f3d83-2cf3-4e15-9ed4-6b9663dcb2ee.png"> ### Expected behavior statement in `steps to reproduce the bug` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` ### Environment info - linux(debian) - python 3.7 - datasets 2.8.0
47
weird result during dataset split when data path starts with `/data` ### Describe the bug The regex defined here https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158 will cause a weird result during dataset split when data path starts with `/data` ### Steps to reproduce the bug 1. clone dataset into local path ``` cd /data/train/raw/ git lfs clone https://huggingface.co/datasets/deepmind/code_contests.git ls /data/train/raw/code_contests # README.md data dataset_infos.json ls /data/train/raw/code_contests/data # test-00000-of-00001-9c49eeff30aacaa8.parquet # train-[0-9]+-of-[0-9]+-xx.parquet # valid-00000-of-00001-5e672c5751f060d3.parquet ``` 2. loading data from local ``` from datasets import load_dataset dataset = load_dataset('/data/train/raw/code_contests') FileNotFoundError: Unable to resolve any data file that matches '['data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*']' at /data/train/raw/code_contests with any supported extension ``` weird path `data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*` While dive deep into `LocalDatasetModuleFactoryWithoutScript` defined in [load.py](https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/load.py#L627) and _get_data_files_patterns https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/data_files.py#L228. I found the weird behavior caused by `string_to_dict` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` go deep into string_to_dict https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158. 4. test the regex: <img width="680" alt="image" src="https://user-images.githubusercontent.com/1772912/231351129-75179f01-fb9f-4f12-8fa9-0dfcc3d5f3bd.png"> <img width="679" alt="image" src="https://user-images.githubusercontent.com/1772912/231351025-009f3d83-2cf3-4e15-9ed4-6b9663dcb2ee.png"> ### Expected behavior statement in `steps to reproduce the bug` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` ### Environment info - linux(debian) - python 3.7 - datasets 2.8.0 > hi! I think you can run python from `/data/train/raw/` directory and load dataset as `load_dataset("code_contests")` to mitigate this issue as a workaround. @ericxsun Do you want to open a PR to fix the regex? As you already found the solution :) Sure, please see https://github.com/huggingface/datasets/pull/5748 @polinaeterna
[ -0.1913374364376068, -0.035746872425079346, -0.03948085755109787, 0.2577301859855652, 0.3165464997291565, -0.1170235350728035, 0.26577746868133545, 0.36108270287513733, -0.08732005208730698, 0.006909780204296112, -0.10704927146434784, 0.25627070665359497, -0.01029534824192524, 0.011353425681591034, -0.015172140672802925, 0.1639934927225113, 0.030738823115825653, 0.08910343050956726, -0.1760586053133011, -0.26048749685287476, -0.3691582679748535, 0.23660866916179657, -0.11968694627285004, 0.22855329513549805, -0.2589901387691498, 0.18518276512622833, 0.07644136995077133, 0.5329985618591309, -0.03166898339986801, 0.027457989752292633, 0.0976848155260086, -0.3198455572128296, -0.13738790154457092, 0.5350474715232849, -0.00011439962690928951, 0.08675239235162735, 0.27068471908569336, 0.06516797095537186, -0.29020822048187256, -0.47536540031433105, -0.42624813318252563, 0.37470972537994385, 0.04214930534362793, -0.06157831847667694, -0.05016568303108215, -0.03479679673910141, -0.12138758599758148, -0.40154093503952026, 0.27321380376815796, 0.32430726289749146, 0.16498622298240662, 0.1786404848098755, -0.46397826075553894, 0.0435059517621994, 0.4622340202331543, 0.4378010332584381, 0.07753197103738785, -0.017365846782922745, 0.10358689725399017, -0.055302057415246964, 0.039680082350969315, 0.17182929813861847, -0.0582994781434536, -0.03478812426328659, -0.04213212430477142, 0.3503524661064148, -0.1249472126364708, -0.17644184827804565, 0.09751881659030914, 0.5037024021148682, -0.14024831354618073, -0.10833483934402466, -0.19899483025074005, -0.17655500769615173, -0.26452574133872986, -0.3798922896385193, 0.1979377120733261, 0.41069555282592773, 0.06987311691045761, 0.32269132137298584, -0.18419969081878662, 0.11257919669151306, -0.02078905701637268, -0.041549716144800186, -0.21156048774719238, 0.400379478931427, -0.03976423293352127, 0.09122495353221893, 0.02823938988149166, -0.12600640952587128, -0.4376716911792755, -0.32614558935165405, -0.13181540369987488, 0.13519872725009918, -0.09101070463657379, 0.0003933906555175781, -0.1696016937494278, -0.19884200394153595, 0.2693644165992737, 0.3297837972640991, -0.11440257728099823, -0.016840171068906784, -0.14164510369300842, 0.014991676434874535, 0.07829354703426361, 0.06632477045059204, -0.21946772933006287, 0.42080700397491455, 0.29672372341156006, 0.13570190966129303, -0.21228718757629395, -0.01654314622282982, 0.1496005654335022, -0.20231632888317108, -0.41205793619155884, 0.018675632774829865, 0.3208954334259033, -0.2107698619365692, -0.40576231479644775, 0.2137128710746765, -0.10364878922700882, -0.03563951700925827, 0.1428370326757431, 0.3533203601837158, -0.03734529763460159, -0.029761111363768578, -0.145143061876297, 0.30469661951065063, -0.06147301569581032, -0.10265523195266724, -0.2839507460594177, -0.21401208639144897, -0.27813562750816345, -0.27860674262046814, -0.033060308545827866, 0.09535530209541321, 0.23507186770439148, 0.21034802496433258, -0.19049084186553955, -0.24786600470542908, 0.03360883891582489, -0.19714440405368805, 0.36552974581718445, 0.2693811058998108, -0.14414356648921967, 0.09999874979257584, 0.1983843296766281, -0.24193699657917023, -0.004697427153587341, 0.17305804789066315, -0.2099585384130478, -0.26903659105300903, -0.23903146386146545, 0.20719444751739502, -0.16939285397529602, 0.06816991418600082, -0.346448689699173, 0.017746100202202797, -0.020856808871030807, 0.30103111267089844, 0.18367816507816315, 0.06010057032108307, -0.08679457008838654, -0.026935670524835587, 0.3956659138202667, 0.2504304051399231, -0.21155069768428802, -0.05313745513558388, -0.2581983208656311, -0.05232904478907585, 0.3672941029071808, 0.41017547249794006, -0.0450187586247921, 0.03490288555622101, -0.4088059067726135, 0.5724536776542664, 0.5669054388999939, -0.18675494194030762, -0.11068839579820633, 0.7089051008224487, -0.35818541049957275, 0.04051407426595688, 0.2320634126663208, -0.3309156894683838, 0.08931216597557068, -0.05251258611679077, -0.2092239409685135, 0.6658726334571838, 0.07676123082637787, 0.024428844451904297, -0.34259945154190063, -0.484443336725235, 0.058116279542446136, 0.09515820443630219, 0.02940261736512184, -0.2400704026222229, 0.2237246334552765, 0.02023041993379593, 0.4630572497844696, -0.1899416595697403, 0.07746770232915878, 0.1500428318977356, 0.3800291121006012, 0.21162523329257965, 0.16630110144615173, -0.35480940341949463, -0.2592182159423828, 0.09460322558879852, -0.4164919853210449, -0.21644409000873566, -0.3053285777568817, -0.1528347283601761, -0.3288613259792328, 0.004755452275276184, -0.35306882858276367, -0.16711975634098053, 0.1104031354188919, 0.020534947514533997, -0.08229443430900574, 0.247612863779068, 0.03451622277498245, -0.10065672546625137, 0.15834671258926392, 0.40665698051452637, -0.26446616649627686, 0.5946356058120728, 0.022319776937365532, -0.051515281200408936, -0.10480348765850067, 0.3280791938304901, 0.17930874228477478, -0.3470546305179596, 0.017545517534017563, 0.514944851398468, 0.3273453116416931, 0.35623565316200256, 0.12279191613197327, 0.06053696572780609, 0.1653798669576645, -0.13111716508865356, 0.01150195486843586, 0.3326983153820038, 0.017443597316741943, -0.07242266833782196, -0.07034482806921005, 0.2881197929382324, -0.1339658498764038, 0.5109726786613464, 0.10860216617584229, -0.11812804639339447, 0.2563479244709015, -0.36129218339920044, 0.12127697467803955, -0.3313255310058594, 0.30165839195251465, 0.3475097119808197, 0.5085479021072388, 0.11844953894615173, -0.2373259961605072, 0.03275627642869949, 0.3629264235496521, -0.235341876745224, 0.06111766770482063, 0.14075817167758942, -0.12294203042984009, -0.046274587512016296, -0.2336551696062088, 0.2523682713508606, 0.25574976205825806, 0.14942632615566254, 0.12633280456066132, 0.10175565630197525, 0.10665775090456009, -0.33275604248046875, 0.44229304790496826, 0.15170946717262268, -0.05014194920659065, 0.3374115526676178, 0.05025160685181618, 0.022377807646989822, -0.3151129186153412, -0.30838847160339355, 0.15329918265342712, -0.0008457973599433899, -0.18917307257652283, 0.2529986500740051, -0.5399752259254456, -0.2262904942035675, -0.6288320422172546, -0.21306896209716797, -0.3012910485267639, -0.19996142387390137, -0.0862276554107666, 0.057193323969841, -0.35401540994644165, 0.10760476440191269, 0.12595784664154053, -0.026654034852981567, -0.0800265446305275, -0.16597138345241547, -0.2153647392988205, 0.06763555109500885, -0.2568683922290802, 0.059615131467580795, 0.3095718026161194, 0.1862049102783203, -0.17637090384960175, 0.06889238208532333, -0.11855470389127731, -0.2803344130516052, -0.4971359372138977, 0.17544305324554443, 0.024069391191005707, 0.36546382308006287, 0.37683817744255066, -0.09638099372386932, 0.4214708209037781, -0.3163754343986511, 0.1860705018043518, 0.2783496379852295, -0.06053420156240463, 0.15935653448104858, -0.008564498275518417, 0.14973115921020508, -0.2282046526670456, -0.29615163803100586, 0.005485257133841515, -0.13954374194145203, 0.2234801948070526, -0.1816919445991516, 0.16703642904758453, 0.3474162518978119, -0.26437273621559143, 0.17121611535549164, -0.18841594457626343, -0.40172916650772095, -0.2429552972316742, -0.012895844876766205, 0.11168597638607025, -0.16909582912921906, -0.1506396234035492, -0.09165845066308975, -0.12154186517000198, 0.06570819765329361, -0.05557418242096901, -0.498491108417511, 0.12216269224882126, -0.277921587228775, 0.1375238299369812, -0.018112098798155785, -0.04438626393675804, 0.025304611772298813, -0.1781044751405716, -0.03316919878125191, -0.24841660261154175, 0.22103089094161987, 0.28329116106033325, 0.0029253140091896057, 0.13691164553165436, 0.03838734328746796, 0.4990198612213135, 0.18483085930347443, 0.5098304748535156, 0.06729497760534286, 0.2420455813407898, 0.16488893330097198, -0.0996415987610817, 0.11941090226173401, -0.3789173662662506, 0.027545586228370667, 0.12300426512956619, 0.1726408451795578, -0.25293102860450745, 0.346853643655777, 0.1372552365064621, 0.13221649825572968, 0.24268317222595215, -0.20924150943756104, -0.012937277555465698, -0.34762826561927795, 0.07535959035158157, -0.07339569181203842, -0.2891410291194916, 0.1171925887465477, -0.12273020297288895, 0.17022469639778137, -0.015174847096204758, -0.14892031252384186, 0.30062606930732727, 0.2262497991323471, -0.08433400094509125, -0.17547687888145447, -0.15060092508792877, -0.01069854199886322, 0.11900470405817032, -0.007394004613161087, 0.11397688835859299, -0.18332074582576752, -0.12429652363061905, 0.001100197434425354, 0.03905637562274933, 0.7251129150390625, 0.03352028876543045, 0.6054189205169678, -0.11554452776908875, -0.11682642996311188, -0.4465649127960205, -0.042458705604076385, -0.08523648232221603, -0.15137609839439392, 0.280232697725296, 0.7456430196762085, -0.27253952622413635, -0.04293331503868103, 0.43477073311805725, 0.15390154719352722, -0.04634235054254532, 0.20915228128433228, -0.20995979011058807, -0.2235317826271057, 0.06884920597076416, 0.026107296347618103, 0.18781694769859314, 0.11054442822933197, -0.1295248419046402, -0.1473482847213745, -0.08768757432699203, -0.43217068910598755, -0.04864794760942459, -0.07704277336597443, 0.28915935754776, -0.24636711180210114, 0.2466321587562561, 0.0696738213300705, 0.1542130410671234, 0.0954667255282402, 0.5130859613418579, -0.17716075479984283, -0.4283727705478668, 0.03884991258382797, -0.40937983989715576, 0.28134357929229736, 0.38788190484046936, -0.13751555979251862, 0.10955595970153809, 0.19206847250461578, 0.16586418449878693, -0.3126773536205292, 0.27064916491508484, 0.30229437351226807, 0.03723805770277977, -0.21155676245689392, -0.16017907857894897, 0.4905760884284973, -0.020531021058559418, -0.2021138072013855, 0.19487960636615753, 0.08778883516788483, -0.6076966524124146, 0.4132387042045593, -0.260429322719574, 0.8223168849945068, 0.23605388402938843, 0.1619713306427002, 0.30170899629592896, -0.5073950886726379, 0.03635372593998909, 0.1264362782239914, -0.22633299231529236, -0.28105318546295166, -0.2824361324310303, 0.004148043692111969, -0.10965903103351593, 0.18518634140491486, 0.4546397626399994, -0.10798192769289017, 0.15307603776454926, -0.34856516122817993, 0.27788490056991577, 0.11107134819030762, 0.3132550120353699, 0.12090232223272324, 0.046832386404275894, -0.2819731831550598, 0.0729513019323349, 0.006731041707098484, 0.00008766725659370422, 0.09949766099452972, -0.23376882076263428, -0.29625391960144043, -0.33027344942092896, -0.11774963140487671, 0.280384361743927, -0.17300911247730255, 0.18695837259292603, 0.12798188626766205, -0.45593562722206116, -0.21800774335861206, -0.07036323100328445, 0.1439591497182846, 0.24716687202453613, -0.08183243125677109, 0.19903436303138733, -0.112984299659729, 0.2507738173007965, 0.18212871253490448, -0.13330726325511932, 0.18658727407455444, -0.09942138940095901, -0.18841561675071716, -0.46984076499938965, -0.10444469749927521, -0.118354432284832, 0.013324111700057983, -0.052430033683776855, 0.004693040158599615, -0.2937682271003723, -0.12814731895923615, -0.04467028006911278, -0.04019460082054138, -0.15769678354263306, 0.10687611252069473, -0.1477118581533432, -0.13296085596084595, -0.012937404215335846, -0.09212739020586014, -0.39022427797317505, -0.40109241008758545, 0.10229749977588654, -0.04702998697757721, 0.27375170588493347, 0.5288305282592773, 0.02716539055109024, -0.06108492612838745, -0.27943405508995056, 0.3782038390636444, 0.6807368993759155, -0.5839011669158936, 0.1601133793592453, -0.3928098976612091, -0.06292717158794403, 0.06424660980701447, 0.22851525247097015, -0.1133526861667633, 0.03657500073313713, -0.28139787912368774, -0.5276594758033752, 0.13303536176681519, 0.07007920742034912, -0.25339415669441223, -0.03748956322669983, 0.020098000764846802, 0.40932878851890564, -0.037180520594120026, -0.20701633393764496, -0.2472570538520813, 0.3847101926803589, -0.02390795573592186, 0.23722758889198303, -0.022014979273080826, -0.31211960315704346, 0.48265519738197327, 0.013913054019212723, 0.11963340640068054, -0.04167592152953148, 0.003320641815662384, -0.22361671924591064, -0.3957866132259369, 0.08166343718767166, 0.01691408082842827, -0.2281206250190735, -0.14580971002578735, 0.15009742975234985, -0.1380239725112915, -0.06306596100330353, 0.21499958634376526, 0.11678983271121979, 0.12836815416812897, 0.10834129899740219, 0.39505258202552795, -0.1875549852848053, -0.19373229146003723, -0.01133075263351202, -0.3254848122596741, 0.4605913758277893, 0.053853850811719894, 0.18786779046058655, -0.204812154173851, -0.018840745091438293, -0.36021527647972107, -0.19644564390182495, 0.14915378391742706, 0.2669389545917511, 0.4120807945728302, -0.28760024905204773, -0.19479700922966003, 0.19580677151679993, 0.47541892528533936, 0.24677391350269318, -0.17528869211673737, -0.29973500967025757, 0.18603087961673737, 0.22881059348583221, -0.054911866784095764, -0.18773534893989563, 0.21164917945861816, -0.06093582510948181, 0.03960321843624115, 0.257167786359787, 0.1474369466304779, 0.07627105712890625, -0.07253125309944153, 0.07171749323606491, 0.9361788034439087, 0.08468572795391083, 0.4467211365699768, 0.2668941915035248, -0.28810638189315796, 0.10958351194858551, 0.05911433696746826, 0.030612356960773468, 0.1297227442264557, 0.4089776873588562, -0.03504718095064163, 0.18479743599891663, 0.15209347009658813, 0.07399573922157288, 0.35887277126312256, -0.24526458978652954, -0.0896168202161789, 0.3647305369377136, -0.29188182950019836, 0.151602640748024, -0.05005413666367531, 0.34700557589530945, -0.18898053467273712, 0.013867050409317017, 0.037281133234500885, 0.13599978387355804, -0.10968760401010513, -0.14357244968414307, 0.04264681041240692, -0.0738014429807663, -0.16956010460853577, -0.10125349462032318, -0.05147385224699974, -0.06500900536775589, 0.012541409581899643, 0.19076961278915405, 0.008231163024902344, 0.10290813446044922, -0.00445652985945344, 0.16213732957839966, 0.027774378657341003, -0.33458641171455383, 0.41933339834213257, 0.20904265344142914, -0.19834399223327637, 0.5612190961837769, 0.15031535923480988, 0.285547137260437, 0.2058291733264923, -0.03251985087990761, -0.23784874379634857, -0.0650046095252037, -0.09900316596031189, -0.04603291675448418, 0.2359658181667328, -0.16262570023536682, 0.13502047955989838, 0.3966066837310791, 0.18635110557079315, -0.15431378781795502, 0.023805269971489906, 0.360373854637146, 0.27112942934036255, -0.3381553888320923, 0.33928197622299194, -0.10396771132946014, -0.03841201961040497, -0.2240408957004547, -0.22027674317359924, -0.4655924439430237, 0.05200936272740364, 0.1745590716600418, -0.11873316019773483, 0.20336374640464783, 0.21485425531864166, 0.06369531154632568, 0.14641433954238892, 0.3552705645561218, 0.15403899550437927, -0.20951932668685913, -0.16156291961669922, -0.2024010866880417, -0.23867419362068176, 0.0053115785121917725, -0.002273896709084511, -0.09907019138336182, 0.12634950876235962, 0.15503907203674316, -0.3125184178352356, -0.027680696919560432, 0.12113406509160995, 0.1672496199607849, -0.3177774250507355, -0.006629126146435738, -0.11576501280069351, -0.044952329248189926, -0.1375250518321991, 0.07380358129739761, -0.09882422536611557, -0.3650725781917572, 0.45236122608184814, 0.26502469182014465, -0.0410328134894371, 0.003638727590441704, -0.014472968876361847, -0.02462327852845192, -0.056167688220739365, -0.07701565325260162, 0.3908972144126892, -0.048489462584257126, -0.08129961788654327, -0.17888210713863373, -0.3544842302799225, -0.33423635363578796, -0.21159440279006958, 0.3393433392047882, 0.056778017431497574, 0.3355206847190857, -0.10847708582878113, -0.17410798370838165, -0.3808729648590088, 0.09944559633731842, -0.028097037225961685, -0.25479045510292053, -0.29502537846565247, 0.08206132054328918, -0.1556818187236786, 0.08518578857183456, -0.027846012264490128, 0.359727680683136, -0.029485855251550674, 0.06789570301771164, 0.14645613729953766, -0.5621553063392639, 0.3370262682437897, -0.23474442958831787, -0.3688754141330719, -0.07449321448802948, 0.37405136227607727, -0.08781780302524567, 0.022567572072148323, -0.43688657879829407, -0.05787619203329086, 0.4364609718322754, -0.013162769377231598, -0.07291062921285629, -0.0700014978647232, 0.2128758728504181, -0.17210835218429565, 0.0008606389164924622, -0.12305504083633423, 0.4333241581916809, -0.38045734167099, 0.4795485734939575, -0.13048553466796875 ]
https://github.com/huggingface/datasets/issues/5739
I think `string_to_dict` is ok, and that the issue is that it gets `'/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet'` as input instead of `'data/test-00000-of-00001-9c49eeff30aacaa8.parquet'`. The path should be relative to the directory being loaded by `load_dataset`
weird result during dataset split when data path starts with `/data`
### Describe the bug The regex defined here https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158 will cause a weird result during dataset split when data path starts with `/data` ### Steps to reproduce the bug 1. clone dataset into local path ``` cd /data/train/raw/ git lfs clone https://huggingface.co/datasets/deepmind/code_contests.git ls /data/train/raw/code_contests # README.md data dataset_infos.json ls /data/train/raw/code_contests/data # test-00000-of-00001-9c49eeff30aacaa8.parquet # train-[0-9]+-of-[0-9]+-xx.parquet # valid-00000-of-00001-5e672c5751f060d3.parquet ``` 2. loading data from local ``` from datasets import load_dataset dataset = load_dataset('/data/train/raw/code_contests') FileNotFoundError: Unable to resolve any data file that matches '['data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*']' at /data/train/raw/code_contests with any supported extension ``` weird path `data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*` While dive deep into `LocalDatasetModuleFactoryWithoutScript` defined in [load.py](https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/load.py#L627) and _get_data_files_patterns https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/data_files.py#L228. I found the weird behavior caused by `string_to_dict` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` go deep into string_to_dict https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158. 4. test the regex: <img width="680" alt="image" src="https://user-images.githubusercontent.com/1772912/231351129-75179f01-fb9f-4f12-8fa9-0dfcc3d5f3bd.png"> <img width="679" alt="image" src="https://user-images.githubusercontent.com/1772912/231351025-009f3d83-2cf3-4e15-9ed4-6b9663dcb2ee.png"> ### Expected behavior statement in `steps to reproduce the bug` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` ### Environment info - linux(debian) - python 3.7 - datasets 2.8.0
31
weird result during dataset split when data path starts with `/data` ### Describe the bug The regex defined here https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158 will cause a weird result during dataset split when data path starts with `/data` ### Steps to reproduce the bug 1. clone dataset into local path ``` cd /data/train/raw/ git lfs clone https://huggingface.co/datasets/deepmind/code_contests.git ls /data/train/raw/code_contests # README.md data dataset_infos.json ls /data/train/raw/code_contests/data # test-00000-of-00001-9c49eeff30aacaa8.parquet # train-[0-9]+-of-[0-9]+-xx.parquet # valid-00000-of-00001-5e672c5751f060d3.parquet ``` 2. loading data from local ``` from datasets import load_dataset dataset = load_dataset('/data/train/raw/code_contests') FileNotFoundError: Unable to resolve any data file that matches '['data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*']' at /data/train/raw/code_contests with any supported extension ``` weird path `data/train/raw/code_contests/data/train-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*` While dive deep into `LocalDatasetModuleFactoryWithoutScript` defined in [load.py](https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/load.py#L627) and _get_data_files_patterns https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/data_files.py#L228. I found the weird behavior caused by `string_to_dict` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` go deep into string_to_dict https://github.com/huggingface/datasets/blob/f2607935c4e45c70c44fcb698db0363ca7ba83d4/src/datasets/utils/py_utils.py#L158. 4. test the regex: <img width="680" alt="image" src="https://user-images.githubusercontent.com/1772912/231351129-75179f01-fb9f-4f12-8fa9-0dfcc3d5f3bd.png"> <img width="679" alt="image" src="https://user-images.githubusercontent.com/1772912/231351025-009f3d83-2cf3-4e15-9ed4-6b9663dcb2ee.png"> ### Expected behavior statement in `steps to reproduce the bug` 3. check `string_to_dict` ``` p = '/data/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' split_pattern = 'data/{split}-[0-9][0-9][0-9][0-9][0-9]-of-[0-9][0-9][0-9][0-9][0-9]*.*' string_to_dict(p, split_pattern) # {'split': 'train/raw/code_contests/data/test'} p = '/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet' string_to_dict(p, split_pattern) {'split': 'test'} ``` ### Environment info - linux(debian) - python 3.7 - datasets 2.8.0 I think `string_to_dict` is ok, and that the issue is that it gets `'/data2/train/raw/code_contests/data/test-00000-of-00001-9c49eeff30aacaa8.parquet'` as input instead of `'data/test-00000-of-00001-9c49eeff30aacaa8.parquet'`. The path should be relative to the directory being loaded by `load_dataset`
[ -0.1913374364376068, -0.035746872425079346, -0.03948085755109787, 0.2577301859855652, 0.3165464997291565, -0.1170235350728035, 0.26577746868133545, 0.36108270287513733, -0.08732005208730698, 0.006909780204296112, -0.10704927146434784, 0.25627070665359497, -0.01029534824192524, 0.011353425681591034, -0.015172140672802925, 0.1639934927225113, 0.030738823115825653, 0.08910343050956726, -0.1760586053133011, -0.26048749685287476, -0.3691582679748535, 0.23660866916179657, -0.11968694627285004, 0.22855329513549805, -0.2589901387691498, 0.18518276512622833, 0.07644136995077133, 0.5329985618591309, -0.03166898339986801, 0.027457989752292633, 0.0976848155260086, -0.3198455572128296, -0.13738790154457092, 0.5350474715232849, -0.00011439962690928951, 0.08675239235162735, 0.27068471908569336, 0.06516797095537186, -0.29020822048187256, -0.47536540031433105, -0.42624813318252563, 0.37470972537994385, 0.04214930534362793, -0.06157831847667694, -0.05016568303108215, -0.03479679673910141, -0.12138758599758148, -0.40154093503952026, 0.27321380376815796, 0.32430726289749146, 0.16498622298240662, 0.1786404848098755, -0.46397826075553894, 0.0435059517621994, 0.4622340202331543, 0.4378010332584381, 0.07753197103738785, -0.017365846782922745, 0.10358689725399017, -0.055302057415246964, 0.039680082350969315, 0.17182929813861847, -0.0582994781434536, -0.03478812426328659, -0.04213212430477142, 0.3503524661064148, -0.1249472126364708, -0.17644184827804565, 0.09751881659030914, 0.5037024021148682, -0.14024831354618073, -0.10833483934402466, -0.19899483025074005, -0.17655500769615173, -0.26452574133872986, -0.3798922896385193, 0.1979377120733261, 0.41069555282592773, 0.06987311691045761, 0.32269132137298584, -0.18419969081878662, 0.11257919669151306, -0.02078905701637268, -0.041549716144800186, -0.21156048774719238, 0.400379478931427, -0.03976423293352127, 0.09122495353221893, 0.02823938988149166, -0.12600640952587128, -0.4376716911792755, -0.32614558935165405, -0.13181540369987488, 0.13519872725009918, -0.09101070463657379, 0.0003933906555175781, -0.1696016937494278, -0.19884200394153595, 0.2693644165992737, 0.3297837972640991, -0.11440257728099823, -0.016840171068906784, -0.14164510369300842, 0.014991676434874535, 0.07829354703426361, 0.06632477045059204, -0.21946772933006287, 0.42080700397491455, 0.29672372341156006, 0.13570190966129303, -0.21228718757629395, -0.01654314622282982, 0.1496005654335022, -0.20231632888317108, -0.41205793619155884, 0.018675632774829865, 0.3208954334259033, -0.2107698619365692, -0.40576231479644775, 0.2137128710746765, -0.10364878922700882, -0.03563951700925827, 0.1428370326757431, 0.3533203601837158, -0.03734529763460159, -0.029761111363768578, -0.145143061876297, 0.30469661951065063, -0.06147301569581032, -0.10265523195266724, -0.2839507460594177, -0.21401208639144897, -0.27813562750816345, -0.27860674262046814, -0.033060308545827866, 0.09535530209541321, 0.23507186770439148, 0.21034802496433258, -0.19049084186553955, -0.24786600470542908, 0.03360883891582489, -0.19714440405368805, 0.36552974581718445, 0.2693811058998108, -0.14414356648921967, 0.09999874979257584, 0.1983843296766281, -0.24193699657917023, -0.004697427153587341, 0.17305804789066315, -0.2099585384130478, -0.26903659105300903, -0.23903146386146545, 0.20719444751739502, -0.16939285397529602, 0.06816991418600082, -0.346448689699173, 0.017746100202202797, -0.020856808871030807, 0.30103111267089844, 0.18367816507816315, 0.06010057032108307, -0.08679457008838654, -0.026935670524835587, 0.3956659138202667, 0.2504304051399231, -0.21155069768428802, -0.05313745513558388, -0.2581983208656311, -0.05232904478907585, 0.3672941029071808, 0.41017547249794006, -0.0450187586247921, 0.03490288555622101, -0.4088059067726135, 0.5724536776542664, 0.5669054388999939, -0.18675494194030762, -0.11068839579820633, 0.7089051008224487, -0.35818541049957275, 0.04051407426595688, 0.2320634126663208, -0.3309156894683838, 0.08931216597557068, -0.05251258611679077, -0.2092239409685135, 0.6658726334571838, 0.07676123082637787, 0.024428844451904297, -0.34259945154190063, -0.484443336725235, 0.058116279542446136, 0.09515820443630219, 0.02940261736512184, -0.2400704026222229, 0.2237246334552765, 0.02023041993379593, 0.4630572497844696, -0.1899416595697403, 0.07746770232915878, 0.1500428318977356, 0.3800291121006012, 0.21162523329257965, 0.16630110144615173, -0.35480940341949463, -0.2592182159423828, 0.09460322558879852, -0.4164919853210449, -0.21644409000873566, -0.3053285777568817, -0.1528347283601761, -0.3288613259792328, 0.004755452275276184, -0.35306882858276367, -0.16711975634098053, 0.1104031354188919, 0.020534947514533997, -0.08229443430900574, 0.247612863779068, 0.03451622277498245, -0.10065672546625137, 0.15834671258926392, 0.40665698051452637, -0.26446616649627686, 0.5946356058120728, 0.022319776937365532, -0.051515281200408936, -0.10480348765850067, 0.3280791938304901, 0.17930874228477478, -0.3470546305179596, 0.017545517534017563, 0.514944851398468, 0.3273453116416931, 0.35623565316200256, 0.12279191613197327, 0.06053696572780609, 0.1653798669576645, -0.13111716508865356, 0.01150195486843586, 0.3326983153820038, 0.017443597316741943, -0.07242266833782196, -0.07034482806921005, 0.2881197929382324, -0.1339658498764038, 0.5109726786613464, 0.10860216617584229, -0.11812804639339447, 0.2563479244709015, -0.36129218339920044, 0.12127697467803955, -0.3313255310058594, 0.30165839195251465, 0.3475097119808197, 0.5085479021072388, 0.11844953894615173, -0.2373259961605072, 0.03275627642869949, 0.3629264235496521, -0.235341876745224, 0.06111766770482063, 0.14075817167758942, -0.12294203042984009, -0.046274587512016296, -0.2336551696062088, 0.2523682713508606, 0.25574976205825806, 0.14942632615566254, 0.12633280456066132, 0.10175565630197525, 0.10665775090456009, -0.33275604248046875, 0.44229304790496826, 0.15170946717262268, -0.05014194920659065, 0.3374115526676178, 0.05025160685181618, 0.022377807646989822, -0.3151129186153412, -0.30838847160339355, 0.15329918265342712, -0.0008457973599433899, -0.18917307257652283, 0.2529986500740051, -0.5399752259254456, -0.2262904942035675, -0.6288320422172546, -0.21306896209716797, -0.3012910485267639, -0.19996142387390137, -0.0862276554107666, 0.057193323969841, -0.35401540994644165, 0.10760476440191269, 0.12595784664154053, -0.026654034852981567, -0.0800265446305275, -0.16597138345241547, -0.2153647392988205, 0.06763555109500885, -0.2568683922290802, 0.059615131467580795, 0.3095718026161194, 0.1862049102783203, -0.17637090384960175, 0.06889238208532333, -0.11855470389127731, -0.2803344130516052, -0.4971359372138977, 0.17544305324554443, 0.024069391191005707, 0.36546382308006287, 0.37683817744255066, -0.09638099372386932, 0.4214708209037781, -0.3163754343986511, 0.1860705018043518, 0.2783496379852295, -0.06053420156240463, 0.15935653448104858, -0.008564498275518417, 0.14973115921020508, -0.2282046526670456, -0.29615163803100586, 0.005485257133841515, -0.13954374194145203, 0.2234801948070526, -0.1816919445991516, 0.16703642904758453, 0.3474162518978119, -0.26437273621559143, 0.17121611535549164, -0.18841594457626343, -0.40172916650772095, -0.2429552972316742, -0.012895844876766205, 0.11168597638607025, -0.16909582912921906, -0.1506396234035492, -0.09165845066308975, -0.12154186517000198, 0.06570819765329361, -0.05557418242096901, -0.498491108417511, 0.12216269224882126, -0.277921587228775, 0.1375238299369812, -0.018112098798155785, -0.04438626393675804, 0.025304611772298813, -0.1781044751405716, -0.03316919878125191, -0.24841660261154175, 0.22103089094161987, 0.28329116106033325, 0.0029253140091896057, 0.13691164553165436, 0.03838734328746796, 0.4990198612213135, 0.18483085930347443, 0.5098304748535156, 0.06729497760534286, 0.2420455813407898, 0.16488893330097198, -0.0996415987610817, 0.11941090226173401, -0.3789173662662506, 0.027545586228370667, 0.12300426512956619, 0.1726408451795578, -0.25293102860450745, 0.346853643655777, 0.1372552365064621, 0.13221649825572968, 0.24268317222595215, -0.20924150943756104, -0.012937277555465698, -0.34762826561927795, 0.07535959035158157, -0.07339569181203842, -0.2891410291194916, 0.1171925887465477, -0.12273020297288895, 0.17022469639778137, -0.015174847096204758, -0.14892031252384186, 0.30062606930732727, 0.2262497991323471, -0.08433400094509125, -0.17547687888145447, -0.15060092508792877, -0.01069854199886322, 0.11900470405817032, -0.007394004613161087, 0.11397688835859299, -0.18332074582576752, -0.12429652363061905, 0.001100197434425354, 0.03905637562274933, 0.7251129150390625, 0.03352028876543045, 0.6054189205169678, -0.11554452776908875, -0.11682642996311188, -0.4465649127960205, -0.042458705604076385, -0.08523648232221603, -0.15137609839439392, 0.280232697725296, 0.7456430196762085, -0.27253952622413635, -0.04293331503868103, 0.43477073311805725, 0.15390154719352722, -0.04634235054254532, 0.20915228128433228, -0.20995979011058807, -0.2235317826271057, 0.06884920597076416, 0.026107296347618103, 0.18781694769859314, 0.11054442822933197, -0.1295248419046402, -0.1473482847213745, -0.08768757432699203, -0.43217068910598755, -0.04864794760942459, -0.07704277336597443, 0.28915935754776, -0.24636711180210114, 0.2466321587562561, 0.0696738213300705, 0.1542130410671234, 0.0954667255282402, 0.5130859613418579, -0.17716075479984283, -0.4283727705478668, 0.03884991258382797, -0.40937983989715576, 0.28134357929229736, 0.38788190484046936, -0.13751555979251862, 0.10955595970153809, 0.19206847250461578, 0.16586418449878693, -0.3126773536205292, 0.27064916491508484, 0.30229437351226807, 0.03723805770277977, -0.21155676245689392, -0.16017907857894897, 0.4905760884284973, -0.020531021058559418, -0.2021138072013855, 0.19487960636615753, 0.08778883516788483, -0.6076966524124146, 0.4132387042045593, -0.260429322719574, 0.8223168849945068, 0.23605388402938843, 0.1619713306427002, 0.30170899629592896, -0.5073950886726379, 0.03635372593998909, 0.1264362782239914, -0.22633299231529236, -0.28105318546295166, -0.2824361324310303, 0.004148043692111969, -0.10965903103351593, 0.18518634140491486, 0.4546397626399994, -0.10798192769289017, 0.15307603776454926, -0.34856516122817993, 0.27788490056991577, 0.11107134819030762, 0.3132550120353699, 0.12090232223272324, 0.046832386404275894, -0.2819731831550598, 0.0729513019323349, 0.006731041707098484, 0.00008766725659370422, 0.09949766099452972, -0.23376882076263428, -0.29625391960144043, -0.33027344942092896, -0.11774963140487671, 0.280384361743927, -0.17300911247730255, 0.18695837259292603, 0.12798188626766205, -0.45593562722206116, -0.21800774335861206, -0.07036323100328445, 0.1439591497182846, 0.24716687202453613, -0.08183243125677109, 0.19903436303138733, -0.112984299659729, 0.2507738173007965, 0.18212871253490448, -0.13330726325511932, 0.18658727407455444, -0.09942138940095901, -0.18841561675071716, -0.46984076499938965, -0.10444469749927521, -0.118354432284832, 0.013324111700057983, -0.052430033683776855, 0.004693040158599615, -0.2937682271003723, -0.12814731895923615, -0.04467028006911278, -0.04019460082054138, -0.15769678354263306, 0.10687611252069473, -0.1477118581533432, -0.13296085596084595, -0.012937404215335846, -0.09212739020586014, -0.39022427797317505, -0.40109241008758545, 0.10229749977588654, -0.04702998697757721, 0.27375170588493347, 0.5288305282592773, 0.02716539055109024, -0.06108492612838745, -0.27943405508995056, 0.3782038390636444, 0.6807368993759155, -0.5839011669158936, 0.1601133793592453, -0.3928098976612091, -0.06292717158794403, 0.06424660980701447, 0.22851525247097015, -0.1133526861667633, 0.03657500073313713, -0.28139787912368774, -0.5276594758033752, 0.13303536176681519, 0.07007920742034912, -0.25339415669441223, -0.03748956322669983, 0.020098000764846802, 0.40932878851890564, -0.037180520594120026, -0.20701633393764496, -0.2472570538520813, 0.3847101926803589, -0.02390795573592186, 0.23722758889198303, -0.022014979273080826, -0.31211960315704346, 0.48265519738197327, 0.013913054019212723, 0.11963340640068054, -0.04167592152953148, 0.003320641815662384, -0.22361671924591064, -0.3957866132259369, 0.08166343718767166, 0.01691408082842827, -0.2281206250190735, -0.14580971002578735, 0.15009742975234985, -0.1380239725112915, -0.06306596100330353, 0.21499958634376526, 0.11678983271121979, 0.12836815416812897, 0.10834129899740219, 0.39505258202552795, -0.1875549852848053, -0.19373229146003723, -0.01133075263351202, -0.3254848122596741, 0.4605913758277893, 0.053853850811719894, 0.18786779046058655, -0.204812154173851, -0.018840745091438293, -0.36021527647972107, -0.19644564390182495, 0.14915378391742706, 0.2669389545917511, 0.4120807945728302, -0.28760024905204773, -0.19479700922966003, 0.19580677151679993, 0.47541892528533936, 0.24677391350269318, -0.17528869211673737, -0.29973500967025757, 0.18603087961673737, 0.22881059348583221, -0.054911866784095764, -0.18773534893989563, 0.21164917945861816, -0.06093582510948181, 0.03960321843624115, 0.257167786359787, 0.1474369466304779, 0.07627105712890625, -0.07253125309944153, 0.07171749323606491, 0.9361788034439087, 0.08468572795391083, 0.4467211365699768, 0.2668941915035248, -0.28810638189315796, 0.10958351194858551, 0.05911433696746826, 0.030612356960773468, 0.1297227442264557, 0.4089776873588562, -0.03504718095064163, 0.18479743599891663, 0.15209347009658813, 0.07399573922157288, 0.35887277126312256, -0.24526458978652954, -0.0896168202161789, 0.3647305369377136, -0.29188182950019836, 0.151602640748024, -0.05005413666367531, 0.34700557589530945, -0.18898053467273712, 0.013867050409317017, 0.037281133234500885, 0.13599978387355804, -0.10968760401010513, -0.14357244968414307, 0.04264681041240692, -0.0738014429807663, -0.16956010460853577, -0.10125349462032318, -0.05147385224699974, -0.06500900536775589, 0.012541409581899643, 0.19076961278915405, 0.008231163024902344, 0.10290813446044922, -0.00445652985945344, 0.16213732957839966, 0.027774378657341003, -0.33458641171455383, 0.41933339834213257, 0.20904265344142914, -0.19834399223327637, 0.5612190961837769, 0.15031535923480988, 0.285547137260437, 0.2058291733264923, -0.03251985087990761, -0.23784874379634857, -0.0650046095252037, -0.09900316596031189, -0.04603291675448418, 0.2359658181667328, -0.16262570023536682, 0.13502047955989838, 0.3966066837310791, 0.18635110557079315, -0.15431378781795502, 0.023805269971489906, 0.360373854637146, 0.27112942934036255, -0.3381553888320923, 0.33928197622299194, -0.10396771132946014, -0.03841201961040497, -0.2240408957004547, -0.22027674317359924, -0.4655924439430237, 0.05200936272740364, 0.1745590716600418, -0.11873316019773483, 0.20336374640464783, 0.21485425531864166, 0.06369531154632568, 0.14641433954238892, 0.3552705645561218, 0.15403899550437927, -0.20951932668685913, -0.16156291961669922, -0.2024010866880417, -0.23867419362068176, 0.0053115785121917725, -0.002273896709084511, -0.09907019138336182, 0.12634950876235962, 0.15503907203674316, -0.3125184178352356, -0.027680696919560432, 0.12113406509160995, 0.1672496199607849, -0.3177774250507355, -0.006629126146435738, -0.11576501280069351, -0.044952329248189926, -0.1375250518321991, 0.07380358129739761, -0.09882422536611557, -0.3650725781917572, 0.45236122608184814, 0.26502469182014465, -0.0410328134894371, 0.003638727590441704, -0.014472968876361847, -0.02462327852845192, -0.056167688220739365, -0.07701565325260162, 0.3908972144126892, -0.048489462584257126, -0.08129961788654327, -0.17888210713863373, -0.3544842302799225, -0.33423635363578796, -0.21159440279006958, 0.3393433392047882, 0.056778017431497574, 0.3355206847190857, -0.10847708582878113, -0.17410798370838165, -0.3808729648590088, 0.09944559633731842, -0.028097037225961685, -0.25479045510292053, -0.29502537846565247, 0.08206132054328918, -0.1556818187236786, 0.08518578857183456, -0.027846012264490128, 0.359727680683136, -0.029485855251550674, 0.06789570301771164, 0.14645613729953766, -0.5621553063392639, 0.3370262682437897, -0.23474442958831787, -0.3688754141330719, -0.07449321448802948, 0.37405136227607727, -0.08781780302524567, 0.022567572072148323, -0.43688657879829407, -0.05787619203329086, 0.4364609718322754, -0.013162769377231598, -0.07291062921285629, -0.0700014978647232, 0.2128758728504181, -0.17210835218429565, 0.0008606389164924622, -0.12305504083633423, 0.4333241581916809, -0.38045734167099, 0.4795485734939575, -0.13048553466796875 ]
https://github.com/huggingface/datasets/issues/5738
You need to provide a text file as `data_files`, not as a configuration: ```python my_dataset = load_dataset("text", data_files="TextFile.txt") ``` Otherwise, since `data_files` is `None`, it picks up Colab's sample datasets from the `content` dir.
load_dataset("text","dataset.txt") loads the wrong dataset!
### Describe the bug I am trying to load my own custom text dataset using the load_dataset function. My dataset is a bunch of ordered text, think along the lines of shakespeare plays. However, after I load the dataset and I inspect it, the dataset is a table with a bunch of latitude and longitude values! What in the world?? ### Steps to reproduce the bug my_dataset = load_dataset("text","TextFile.txt") my_dataset ### Expected behavior I expected the dataset to contain the actual data from the text document that I used. ### Environment info Google Colab
34
load_dataset("text","dataset.txt") loads the wrong dataset! ### Describe the bug I am trying to load my own custom text dataset using the load_dataset function. My dataset is a bunch of ordered text, think along the lines of shakespeare plays. However, after I load the dataset and I inspect it, the dataset is a table with a bunch of latitude and longitude values! What in the world?? ### Steps to reproduce the bug my_dataset = load_dataset("text","TextFile.txt") my_dataset ### Expected behavior I expected the dataset to contain the actual data from the text document that I used. ### Environment info Google Colab You need to provide a text file as `data_files`, not as a configuration: ```python my_dataset = load_dataset("text", data_files="TextFile.txt") ``` Otherwise, since `data_files` is `None`, it picks up Colab's sample datasets from the `content` dir.
[ -0.11925823241472244, -0.08624438941478729, 0.04695247858762741, 0.664303183555603, -0.12008482217788696, 0.07227018475532532, 0.45189183950424194, -0.05691973865032196, 0.17160525918006897, 0.03284319490194321, -0.08789326250553131, 0.42411190271377563, -0.0665053203701973, 0.2307313084602356, 0.10615971684455872, 0.2533758878707886, 0.006099555641412735, 0.1718670129776001, 0.054329514503479004, -0.18410032987594604, -0.3532773554325104, 0.31254857778549194, -0.3466792106628418, -0.007166016846895218, -0.34589746594429016, 0.1325760930776596, -0.006039850413799286, 0.34897172451019287, -0.1476440727710724, 0.04383907467126846, 0.5755628347396851, 0.15044820308685303, 0.2378547489643097, 0.5545157194137573, -0.00012332489131949842, -0.07308674603700638, 0.14005032181739807, -0.1641414910554886, -0.34685981273651123, -0.3399614989757538, -0.31009751558303833, 0.005243055522441864, 0.4303401708602905, -0.12058062851428986, -0.17960643768310547, 0.20361140370368958, -0.0005009640008211136, -0.15744107961654663, 0.1233973354101181, 0.4767482578754425, 0.14865800738334656, -0.29701727628707886, -0.40593451261520386, 0.09612537920475006, 0.3387765884399414, 0.21390771865844727, -0.0903732180595398, 0.388713002204895, 0.2592935860157013, 0.0271865576505661, 0.19938334822654724, 0.03550805151462555, -0.4062695801258087, 0.24353960156440735, 0.392971396446228, 0.3975416421890259, -0.3430006504058838, -0.07092687487602234, 0.19502294063568115, 0.22690242528915405, 0.7017293572425842, -0.4327510893344879, 0.041559360921382904, -0.2768154740333557, 0.01759381592273712, -0.41360288858413696, 0.36893871426582336, 0.24500992894172668, -0.16220295429229736, 0.2346976101398468, -0.1342374086380005, -0.0013184808194637299, -0.06424322724342346, 0.26247283816337585, -0.29171785712242126, 0.3138962984085083, -0.348667174577713, 0.15331627428531647, -0.08917395770549774, 0.24001874029636383, 0.574494481086731, -0.25384294986724854, -0.04654517397284508, 0.11963119357824326, -0.1234215646982193, 0.20335832238197327, -0.20403489470481873, 0.23201251029968262, 0.05018283426761627, -0.055388305336236954, 0.17678284645080566, 0.07975868880748749, -0.36092132329940796, 0.14843778312206268, 0.340649276971817, 0.09465809166431427, 0.12326037883758545, 0.1532861292362213, -0.027467530220746994, 0.053373031318187714, -0.21431905031204224, 0.02196020819246769, -0.15280894935131073, 0.027145907282829285, -0.029026392847299576, 0.011963441967964172, 0.3160012662410736, -0.4351627826690674, -0.38374343514442444, -0.03990617021918297, -0.2205069363117218, 0.13433481752872467, 0.07982523739337921, 0.2963488698005676, -0.2197260856628418, -0.17546619474887848, 0.10340872406959534, 0.11744384467601776, -0.16598641872406006, -0.05387602373957634, -0.12624211609363556, -0.20744556188583374, 0.010770745575428009, 0.2092525064945221, 0.24584901332855225, -0.18022669851779938, 0.26775556802749634, 0.23033688962459564, 0.06743153929710388, -0.17358054220676422, -0.26478540897369385, -0.23701906204223633, 0.003964807838201523, 0.1571742743253708, 0.12830480933189392, 0.21263644099235535, 0.22001077234745026, -0.4915120005607605, -0.21747083961963654, 0.48207902908325195, -0.6597452163696289, -0.24841997027397156, -0.026741765439510345, 0.0718235969543457, -0.2466285228729248, -0.0862894356250763, -0.5975913405418396, 0.39080381393432617, 0.26913246512413025, -0.18222260475158691, 0.001231260597705841, -0.2736411690711975, -0.5306772589683533, -0.2147444635629654, 0.019128799438476562, 0.5205603837966919, -0.6412433981895447, 0.09615184366703033, -0.29066458344459534, 0.178630068898201, 0.1514340043067932, -0.016100354492664337, -0.21951542794704437, 0.4111180901527405, -0.25452888011932373, -0.11617793142795563, 0.09958115220069885, 0.05868417024612427, -0.4674243628978729, 0.085487499833107, 0.03229552507400513, 0.27141669392585754, -0.24788160622119904, 0.2014165222644806, 0.10747100412845612, 0.008379679173231125, 0.46328750252723694, 0.2971835732460022, 0.17184169590473175, 0.055042654275894165, -0.15692706406116486, -0.09182777255773544, 0.031772103160619736, 0.25628215074539185, -0.09678756445646286, 0.29294875264167786, 0.16651999950408936, -0.2584518790245056, 0.17139777541160583, 0.03607087954878807, -0.29629039764404297, 0.25763624906539917, 0.01649578846991062, 0.23481351137161255, 0.0547378771007061, 0.08335455507040024, -0.3778260052204132, 0.11145778000354767, 0.36436954140663147, 0.03570912778377533, -0.021586615592241287, -0.025088712573051453, -0.4039149582386017, 0.008681930601596832, -0.24345435202121735, 0.02986784651875496, 0.0016445554792881012, 0.2570956349372864, -0.19807133078575134, 0.09606587886810303, -0.09918618202209473, 0.5633742809295654, -0.4205966591835022, 0.051757875829935074, -0.3719402253627777, 0.08201872557401657, 0.3331240713596344, -0.02291354537010193, -0.09772801399230957, -0.08826643228530884, 0.038244981318712234, 0.07896866649389267, -0.1494320183992386, 0.31038713455200195, 0.19697226583957672, -0.017968520522117615, -0.3039698600769043, -0.003569856286048889, 0.11371906846761703, -0.18575319647789001, 0.06888076663017273, 0.12601517140865326, 0.26012086868286133, -0.144318088889122, -0.10234549641609192, 0.22813022136688232, -0.27813011407852173, 0.03596145287156105, -0.31354424357414246, -0.28485241532325745, 0.10582084208726883, -0.03211807459592819, 0.041589826345443726, -0.0946652889251709, 0.17243660986423492, 0.2708660364151001, 0.24905849993228912, 0.3051454722881317, -0.135650172829628, 0.27391040325164795, 0.39318662881851196, 0.06712857633829117, 0.1802695244550705, 0.23676840960979462, -0.3836919963359833, -0.0601031556725502, -0.04234675318002701, 0.2938345670700073, 0.4806988537311554, 0.05306077003479004, -0.21077850461006165, 0.266458660364151, -0.031344205141067505, -0.2181609869003296, 0.1005575954914093, -0.03568127378821373, 0.21995624899864197, -0.012722009792923927, -0.00047088414430618286, -0.05962785333395004, -0.17446303367614746, 0.16615283489227295, -0.16060882806777954, 0.3505830466747284, -0.4781004786491394, 0.3563348352909088, -0.2916921377182007, -0.1828521192073822, -0.3504713773727417, -0.16968876123428345, -0.05577278509736061, -0.05109339952468872, -0.1479731798171997, 0.20331434905529022, 0.2632003426551819, -0.27500301599502563, 0.12219451367855072, 0.26383599638938904, 0.005723871290683746, -0.6170626878738403, 0.026240244507789612, -0.1340697556734085, -0.4795750379562378, -0.027961917221546173, 0.11761940270662308, 0.356698215007782, 0.02546328864991665, -0.45762160420417786, -0.05259939283132553, 0.12466058135032654, 0.021350637078285217, 0.19370311498641968, -0.13653108477592468, 0.5028973817825317, 0.029992055147886276, 0.11031702160835266, -0.4101775586605072, -0.05793553218245506, 0.04095759987831116, 0.03786271810531616, 0.015434667468070984, 0.03300796449184418, 0.027730338275432587, -0.03927767276763916, -0.04504264518618584, -0.3507199287414551, -0.18391388654708862, -0.02176601067185402, 0.0383746474981308, 0.3574375510215759, 0.20995917916297913, 0.24690604209899902, 0.20275279879570007, 0.09619598835706711, 0.28152093291282654, 0.036099568009376526, -0.3049478828907013, -0.4562951326370239, 0.3090742826461792, -0.0857507586479187, -0.2570853531360626, -0.042323969304561615, -0.05737141892313957, -0.21384014189243317, 0.1385718733072281, -0.6808048486709595, 0.015457555651664734, -0.04994338005781174, -0.12949903309345245, -0.008113292045891285, -0.1571734994649887, 0.25911304354667664, -0.10764867067337036, 0.2327137440443039, -0.22647692263126373, -0.45508190989494324, -0.042133230715990067, 0.22095943987369537, 0.23943085968494415, 0.2699842154979706, 0.1527327299118042, -0.37789130210876465, 0.3653544783592224, 0.029914237558841705, -0.15438415110111237, 0.252454549074173, -0.2663993835449219, 0.36295294761657715, -0.2601328194141388, -0.42744946479797363, -0.13439109921455383, -0.07683761417865753, -0.3993135690689087, 0.6613350510597229, 0.11976714432239532, -0.02343035116791725, -0.2621603012084961, 0.12076802551746368, -0.35579654574394226, -0.14419519901275635, 0.15039338171482086, 0.15187010169029236, -0.10708016157150269, 0.07260511815547943, 0.22470726072788239, -0.13745224475860596, -0.3935277760028839, -0.24406497180461884, 0.24555931985378265, -0.1164698600769043, 0.056176960468292236, 0.13677723705768585, 0.08034594357013702, -0.26465845108032227, 0.2237839698791504, 0.16392096877098083, -0.04609588161110878, 0.03081737458705902, 0.09467269480228424, 0.18762165307998657, 0.17835381627082825, 0.2528754472732544, -0.040429167449474335, -0.054193101823329926, 0.17107868194580078, 0.060349538922309875, -0.4128306806087494, -0.02650119736790657, -0.2753908634185791, 0.4672079086303711, -0.15251758694648743, 0.29729270935058594, 0.0158681720495224, 0.12358225882053375, 0.12430647760629654, 0.3397291898727417, -0.2670387923717499, -0.2102021425962448, -0.42211854457855225, -0.41418272256851196, -0.00043126195669174194, -0.26052993535995483, -0.03505604714155197, 0.12530478835105896, -0.19147628545761108, 0.05749591439962387, 0.10546699911355972, 0.11647433787584305, 0.21663039922714233, 0.12634402513504028, 0.38081955909729004, 0.20525121688842773, -0.06206689029932022, 0.1082540899515152, 0.044148579239845276, 0.1772700697183609, 1.0537172555923462, 0.13452646136283875, -0.3131546378135681, -0.05178673192858696, -0.2270190715789795, 0.09481263160705566, 0.09047196805477142, -0.16682878136634827, -0.03354811295866966, -0.1260589361190796, -0.24161383509635925, -0.03715256601572037, 0.31651464104652405, 0.027028996497392654, -0.06894221901893616, -0.4015040993690491, -0.7789911031723022, 0.5673465728759766, -0.047054722905159, -0.0925469845533371, 0.45594069361686707, -0.2011827677488327, -0.4269198179244995, 0.3343989849090576, 0.07511977851390839, 0.754009485244751, -0.14672450721263885, 0.13401317596435547, 0.26484110951423645, 0.19265848398208618, 0.3463934063911438, -0.21502529084682465, 0.13627219200134277, -0.4328456521034241, -0.3607441186904907, -0.1088576689362526, -0.10335186868906021, -0.1237696185708046, 0.18023242056369781, -0.16369596123695374, 0.15350165963172913, -0.02848905324935913, 0.14834249019622803, 0.17521736025810242, -0.1508956253528595, 0.029623182490468025, -0.15304327011108398, -0.2631261348724365, 0.05476457625627518, -0.2225123792886734, 0.24405652284622192, -0.17191192507743835, 0.1992821842432022, -0.30482304096221924, -0.17365127801895142, -0.30548954010009766, 0.06590966880321503, -0.38683798909187317, -0.18974722921848297, -0.20194225013256073, -0.35660630464553833, -0.01095743477344513, 0.46128618717193604, 0.25685811042785645, 0.16002878546714783, -0.22931848466396332, -0.000051798298954963684, 0.014707522466778755, 0.10056474804878235, -0.04460640624165535, -0.2333165854215622, 0.10543876886367798, 0.24803389608860016, -0.13733913004398346, -0.0872652679681778, 0.10573063790798187, -0.5321338176727295, -0.12401650100946426, 0.2818627655506134, -0.04208505153656006, -0.3362518846988678, -0.28871670365333557, 0.02639865316450596, 0.33962953090667725, -0.04421740770339966, 0.04559481143951416, 0.014982342720031738, 0.22379380464553833, 0.2683631479740143, 0.017840521410107613, -0.6673942804336548, -0.16271093487739563, 0.40057244896888733, 0.16847050189971924, 0.09513689577579498, 0.3744198679924011, 0.3098018169403076, 0.08115692436695099, -0.09508119523525238, 0.318554162979126, -0.05275591462850571, -0.298407644033432, 0.14646320044994354, -0.2124636322259903, 0.27721863985061646, 0.10849693417549133, 0.5282336473464966, 0.05427541956305504, -0.15883557498455048, -0.0758473351597786, -0.5069354772567749, -0.052453793585300446, -0.0662231296300888, 0.17196610569953918, 0.10754624754190445, 0.3306198716163635, -0.13335250318050385, 0.07757920026779175, -0.23495358228683472, -0.16776466369628906, 0.17633110284805298, 0.06533826142549515, 0.0357915498316288, 0.18403904139995575, 0.38259822130203247, 0.13642433285713196, -0.04392721503973007, 0.006626497954130173, 0.06421279907226562, 0.13383956253528595, -0.2034112811088562, -0.18276450037956238, 0.20969560742378235, -0.03792048245668411, -0.08774004131555557, -0.3661442995071411, -0.30952563881874084, -0.1782032549381256, -0.31531426310539246, 0.2851206362247467, 0.41653361916542053, 0.023952703922986984, 0.10389842092990875, -0.0003859810531139374, 0.17448560893535614, -0.2974278926849365, 0.06586527824401855, -0.22604817152023315, 0.26362743973731995, 0.11544835567474365, -0.05608401075005531, 0.153763547539711, 0.1065167635679245, 0.17390033602714539, 0.15773941576480865, 0.09140998125076294, 0.07314340025186539, 0.09651301801204681, -0.44618234038352966, 0.4199128746986389, -0.06365966796875, 0.15338462591171265, 0.486801415681839, -0.2705371379852295, -0.12200725078582764, 0.19959034025669098, 0.023784784600138664, -0.09995383769273758, -0.04848438501358032, 0.3602675795555115, 0.1269790679216385, -0.10615060478448868, 0.45540696382522583, 0.009634099900722504, -0.0009547621011734009, -0.19489605724811554, -0.0975944772362709, 0.4201778769493103, 0.17241138219833374, 0.08894996345043182, 0.3637528717517853, -0.24749498069286346, 0.20862889289855957, 0.04985647648572922, 0.19647200405597687, 0.02705743908882141, 0.6839423775672913, 0.1718115657567978, 0.1271677017211914, -0.05399910733103752, 0.003787025809288025, 0.11599037051200867, -0.5857009291648865, 0.40240544080734253, 0.12614402174949646, -0.2929295301437378, 0.13589541614055634, 0.19316424429416656, 0.1232604831457138, -0.41665929555892944, 0.09809892624616623, -0.4668814539909363, -0.26659607887268066, -0.1469549834728241, 0.07658214867115021, -0.025515224784612656, -0.1780981570482254, 0.07494665682315826, 0.15312296152114868, -0.17496636509895325, -0.15947005152702332, 0.015151143074035645, -0.040565427392721176, -0.3721974790096283, -0.2597246468067169, 0.07244690507650375, 0.09133517742156982, -0.1536744236946106, -0.025367669761180878, 0.3075186312198639, -0.33144301176071167, 0.1528569459915161, 0.31086045503616333, 0.10832617431879044, 0.01056530512869358, 0.5467174649238586, -0.004707539454102516, -0.2215377688407898, -0.009081026539206505, -0.011799372732639313, -0.07963721454143524, 0.17991337180137634, 0.0483940988779068, 0.2057209610939026, 0.2505090534687042, 0.09390542656183243, -0.01980394683778286, 0.39307570457458496, 0.23261931538581848, 0.2734204828739166, -0.3508666753768921, -0.0982174277305603, -0.05863877013325691, 0.10221787542104721, -0.09224361181259155, 0.11147414147853851, -0.28150469064712524, -0.012248717248439789, 0.4496264159679413, 0.09248258173465729, 0.33270272612571716, 0.15189145505428314, 0.008759304881095886, 0.15553152561187744, 0.48728853464126587, 0.3346524238586426, 0.23628966510295868, -0.15695905685424805, -0.07176464796066284, -0.6442990303039551, 0.2844945192337036, -0.07569592446088791, -0.020182207226753235, 0.03430303931236267, -0.026391979306936264, 0.24728761613368988, 0.44003668427467346, -0.11742722988128662, 0.011427100747823715, 0.03979063779115677, -0.038197148591279984, -0.11178327351808548, -0.6513152718544006, -0.18298813700675964, 0.07237304747104645, -0.16084732115268707, -0.44201239943504333, -0.025568131357431412, -0.15834683179855347, -0.0036639422178268433, -0.2472187727689743, -0.12700216472148895, 0.0672350749373436, -0.038083627820014954, 0.4443874955177307, 0.024110639467835426, 0.38171815872192383, -0.08133279532194138, 0.22536155581474304, -0.17826947569847107, -0.16861629486083984, -0.22159156203269958, 0.46448153257369995, -0.006998829077929258, 0.1197386234998703, -0.14346548914909363, 0.038565922528505325, -0.15002678334712982, 0.12879613041877747, 0.35772690176963806, 0.2543835937976837, -0.2707812786102295, -0.06289242953062057, -0.31914085149765015, 0.02034454420208931, -0.07599247246980667, 0.3185840845108032, -0.08181740343570709, 0.17795507609844208, 0.187318354845047, -0.02573974058032036, 0.43932509422302246, -0.31364938616752625, -0.19988588988780975, 0.02744808793067932, 0.017534293234348297, 0.20887602865695953, -0.14514432847499847, -0.4803582429885864, 0.09133441746234894, 0.4257287383079529, -0.2747972011566162, -0.11420776695013046, 0.2040596604347229, -0.1608853042125702, 0.1286865919828415, -0.1123647540807724, 0.49064794182777405, 0.14815975725650787, -0.2148764729499817, -0.07484305649995804, -0.3557455539703369 ]
https://github.com/huggingface/datasets/issues/5737
Hi, you can use the `cast_column` function to change the feature type from a `Value(int64)` to `ClassLabel`: ```py dataset = dataset.cast_column("label", ClassLabel(names=["label_1", "label_2", "label_3"])) print(dataset.features) {'text': Value(dtype='string', id=None), 'label': ClassLabel(names=['label_1', 'label_2', 'label_3'], id=None)} ```
ClassLabel Error
### Describe the bug I still getting the error "call() takes 1 positional argument but 2 were given" even after ensuring that the value being passed to the label object is a single value and that the ClassLabel object has been created with the correct number of label classes ### Steps to reproduce the bug from datasets import ClassLabel, Dataset 1. Create the ClassLabel object with 3 label values and their corresponding names label_test = ClassLabel(num_classes=3, names=["label_1", "label_2", "label_3"]) 2. Define a dictionary with text and label fields data = { 'text': ['text_1', 'text_2', 'text_3'], 'label': [1, 2, 3], } 3. Create a Hugging Face dataset from the dictionary dataset = Dataset.from_dict(data) print(dataset.features) 4. Map the label values to their corresponding label names using the label object dataset = dataset.map(lambda example: {'text': example['text'], 'label': label_test(example['label'])}) 5. Print the resulting dataset print(dataset) ### Expected behavior I hope my label type is class label instead int. ### Environment info python 3.9 google colab
34
ClassLabel Error ### Describe the bug I still getting the error "call() takes 1 positional argument but 2 were given" even after ensuring that the value being passed to the label object is a single value and that the ClassLabel object has been created with the correct number of label classes ### Steps to reproduce the bug from datasets import ClassLabel, Dataset 1. Create the ClassLabel object with 3 label values and their corresponding names label_test = ClassLabel(num_classes=3, names=["label_1", "label_2", "label_3"]) 2. Define a dictionary with text and label fields data = { 'text': ['text_1', 'text_2', 'text_3'], 'label': [1, 2, 3], } 3. Create a Hugging Face dataset from the dictionary dataset = Dataset.from_dict(data) print(dataset.features) 4. Map the label values to their corresponding label names using the label object dataset = dataset.map(lambda example: {'text': example['text'], 'label': label_test(example['label'])}) 5. Print the resulting dataset print(dataset) ### Expected behavior I hope my label type is class label instead int. ### Environment info python 3.9 google colab Hi, you can use the `cast_column` function to change the feature type from a `Value(int64)` to `ClassLabel`: ```py dataset = dataset.cast_column("label", ClassLabel(names=["label_1", "label_2", "label_3"])) print(dataset.features) {'text': Value(dtype='string', id=None), 'label': ClassLabel(names=['label_1', 'label_2', 'label_3'], id=None)} ```
[ 0.29180172085762024, -0.3111719787120819, 0.09513795375823975, 0.48123082518577576, 0.46933385729789734, -0.08403494954109192, 0.5703068971633911, 0.008758366107940674, -0.2298090010881424, 0.17299167811870575, 0.12227422744035721, 0.49433261156082153, -0.09853906184434891, 0.0449659526348114, 0.007047098129987717, -0.3118751645088196, 0.05605544522404671, -0.07836751639842987, 0.30261096358299255, -0.1698744297027588, -0.4623667597770691, 0.20658031105995178, -0.2392050176858902, 0.24204063415527344, -0.2160148322582245, -0.11202605813741684, -0.3905807435512543, -0.09044194221496582, -0.011893928050994873, -0.5178016424179077, 0.4468068778514862, -0.05146513506770134, -0.15396708250045776, 0.5976676940917969, -0.00011858156358357519, -0.30387526750564575, 0.11837853491306305, 0.010235652327537537, -0.1374896764755249, -0.06221183389425278, -0.15371139347553253, 0.09100127220153809, 0.2912300229072571, -0.44459500908851624, -0.22690026462078094, 0.032957613468170166, -0.30866023898124695, -0.0462104007601738, 0.36327555775642395, 0.35377436876296997, 0.16985467076301575, -0.26786887645721436, -0.05151757597923279, -0.09471610933542252, 0.35862141847610474, 0.09571777284145355, 0.08984866738319397, 0.28417542576789856, 0.12367507815361023, 0.24242578446865082, 0.3527141809463501, 0.44477012753486633, -0.2428058385848999, -0.22881725430488586, 0.26074162125587463, 0.14358724653720856, -0.0871577337384224, -0.33091217279434204, 0.0498497448861599, 0.006216776557266712, 0.19528518617153168, -0.25962749123573303, -0.28904008865356445, -0.20877163112163544, 0.3093571960926056, -0.40604621171951294, -0.06027822196483612, 0.0710909515619278, -0.2166333645582199, -0.266654372215271, -0.11016727983951569, 0.13217797875404358, -0.18886534869670868, 0.17492526769638062, 0.21196337044239044, 0.2642156481742859, -0.1917729526758194, 0.36060819029808044, 0.11089024692773819, -0.09579059481620789, -0.07972001284360886, 0.08446286618709564, 0.05264435335993767, 0.18596860766410828, -0.19988955557346344, 0.025035515427589417, 0.17098934948444366, 0.1798516809940338, 0.05072878301143646, -0.3865136504173279, -0.21737191081047058, -0.1649685800075531, -0.13148044049739838, 0.07571801543235779, 0.36910781264305115, 0.2853376865386963, 0.4551456570625305, 0.3461378216743469, -0.02911635860800743, 0.047765716910362244, -0.03253663331270218, 0.030435137450695038, -0.08886105567216873, -0.09930245578289032, 0.41422057151794434, 0.3278670310974121, 0.2920002341270447, -0.17599548399448395, -0.13177059590816498, -0.11856099963188171, -0.2568109929561615, 0.4370536208152771, 0.2526532709598541, 0.2699810266494751, 0.24541252851486206, 0.18928661942481995, 0.47234228253364563, 0.1777305155992508, 0.06931387633085251, -0.30438241362571716, -0.10604918003082275, 0.25023332238197327, -0.06308339536190033, -0.18895196914672852, 0.07149197161197662, -0.01173056848347187, 0.05953110009431839, 0.2821803689002991, 0.11714307963848114, -0.37214264273643494, -0.29838988184928894, -0.1569332629442215, -0.11219844222068787, 0.03619677200913429, -0.23092463612556458, 0.2584347128868103, 0.40222999453544617, -0.25742194056510925, -0.0690629631280899, 0.08827315270900726, -0.4511934816837311, -0.014425016939640045, 0.10223501175642014, 0.14473313093185425, 0.5512818694114685, 0.04234033823013306, -0.10047967731952667, 0.062362365424633026, 0.43994712829589844, -0.15124842524528503, 0.11658474802970886, -0.42429226636886597, -0.307706356048584, -0.2053723931312561, -0.06618202477693558, 0.3362402617931366, -0.20559166371822357, -0.17694658041000366, 0.11062349379062653, 0.41908231377601624, 0.09427331387996674, 0.028589759021997452, -0.21673300862312317, 0.00997680239379406, -0.1846483051776886, -0.14199760556221008, 0.1440403014421463, -0.6616122722625732, -0.22615483403205872, -0.020620618015527725, -0.13464179635047913, -0.40108317136764526, 0.03798263520002365, 0.17051942646503448, -0.11545339971780777, -0.054557669907808304, 0.3585559129714966, -0.05199478194117546, -0.1212833896279335, 0.24928876757621765, -0.12709319591522217, 0.05674644559621811, -0.18424853682518005, 0.09137960523366928, -0.24111801385879517, -0.06860756874084473, -0.19850896298885345, -0.0034306198358535767, 0.14937642216682434, -0.3009985685348511, 0.012183256447315216, 0.13462893664836884, 0.5749303698539734, -0.0006813742220401764, 0.051810674369335175, -0.1457391381263733, -0.30897948145866394, 0.1969330906867981, 0.1861526370048523, 0.30290234088897705, -0.08598478138446808, -0.25997602939605713, -0.14678406715393066, 0.12606504559516907, -0.12095780670642853, -0.1425081044435501, 0.10027837008237839, 0.19576600193977356, -0.15111267566680908, -0.05014998838305473, 0.009775280952453613, 0.056559450924396515, -0.08438222110271454, 0.2870195508003235, 0.1269339770078659, -0.08782825618982315, -0.043878547847270966, -0.20943699777126312, -0.04462305083870888, -0.09627597779035568, 0.6483667492866516, 0.017113111913204193, -0.10125833749771118, 0.25875240564346313, 0.42291271686553955, -0.40424010157585144, -0.38717520236968994, -0.08082998543977737, 0.24940162897109985, -0.09245529770851135, -0.21524649858474731, 0.004600634798407555, 0.40983885526657104, -0.2738301753997803, -0.19376055896282196, 0.43706709146499634, -0.08673153817653656, 0.16858342289924622, -0.1210046261548996, 0.21823027729988098, 0.0464807003736496, 0.018587730824947357, -0.03575735539197922, -0.04694522172212601, 0.014770292676985264, -0.1435716599225998, 0.11689133942127228, 0.04411875456571579, -0.3158646821975708, 0.24006029963493347, 0.34562790393829346, 0.28334054350852966, 0.24728482961654663, 0.10689516365528107, 0.0012966282665729523, 0.1675942987203598, 0.19857022166252136, 0.21040765941143036, 0.21567733585834503, 0.12309198081493378, -0.485627144575119, 0.03463607281446457, -0.20783424377441406, 0.07253338396549225, 0.14644141495227814, -0.1249832957983017, 0.10969731211662292, -0.23505650460720062, 0.17540980875492096, 0.09901902079582214, -0.13331544399261475, -0.31841328740119934, 0.07541254162788391, -0.04012763872742653, -0.32245898246765137, 0.2820079028606415, 0.1652376651763916, -0.22356535494327545, -0.34631311893463135, -0.25371018052101135, 0.07642639428377151, -0.1864338219165802, -0.19398802518844604, -0.02510901354253292, 0.03244364261627197, 0.18435083329677582, 0.06649945676326752, 0.3471580743789673, 0.23404023051261902, -0.1457941085100174, 0.11258085817098618, -0.009545449167490005, -0.41357743740081787, -0.10523580014705658, -0.1643553376197815, -0.15157611668109894, 0.316302627325058, -0.1264953911304474, -0.1100822389125824, -0.07187624275684357, -0.4160770773887634, 0.057574350386857986, -0.1384851336479187, 0.17491300404071808, 0.33402109146118164, -0.13880237936973572, -0.33719372749328613, -0.027204876765608788, 0.30630984902381897, -0.013268716633319855, 0.0164894238114357, 0.10274918377399445, 0.02517007663846016, -0.165500670671463, -0.3897649049758911, -0.06056888401508331, 0.028289945796132088, -0.06416386365890503, 0.20285934209823608, 0.03523586690425873, 0.19845277070999146, 0.20038700103759766, -0.09815764427185059, 0.3552338480949402, 0.10883153229951859, 0.2903740108013153, -0.16638657450675964, -0.11778977513313293, -0.2440418004989624, -0.019155874848365784, -0.1632661521434784, -0.12321832776069641, 0.13013030588626862, 0.059233374893665314, -0.23086129128932953, -0.21594807505607605, -0.7552233338356018, -0.018214819952845573, 0.2840365171432495, -0.17486198246479034, 0.13251420855522156, 0.1990458369255066, 0.19968433678150177, 0.08571545034646988, -0.13737395405769348, -0.30416548252105713, 0.319052129983902, 0.2143414467573166, -0.06876412034034729, 0.006623558700084686, 0.34215325117111206, 0.017176270484924316, 0.17901532351970673, 0.3423171043395996, -0.21184255182743073, 0.3088015019893646, -0.10258139669895172, 0.034166090190410614, -0.06207088753581047, -0.6184454560279846, -0.055693499743938446, -0.15645641088485718, -0.19057759642601013, 0.1288318932056427, -0.10018700361251831, -0.012427397072315216, -0.19867166876792908, 0.2092439979314804, -0.32166194915771484, -0.3148569166660309, -0.18005770444869995, 0.16564834117889404, 0.026543650776147842, -0.26688891649246216, 0.17403537034988403, -0.3002850413322449, 0.12000872939825058, -0.13393887877464294, -0.30379900336265564, -0.11712227016687393, -0.080990269780159, -0.30760324001312256, -0.20362769067287445, -0.07760994136333466, 0.21418100595474243, 0.18642675876617432, 0.2670857906341553, -0.09701712429523468, 0.47647762298583984, 0.13319778442382812, 0.17965710163116455, 0.7479483485221863, 0.05794912576675415, 0.3065796494483948, 0.3073332905769348, -0.07930134236812592, -0.3031800389289856, 0.014452531933784485, -0.29777151346206665, 0.00102316215634346, 0.2213449776172638, 0.335825115442276, -0.42281574010849, 0.12167801707983017, 0.26164427399635315, -0.008262436836957932, -0.07622246444225311, 0.11042305827140808, -0.05570320785045624, -0.4433712065219879, 0.05185095965862274, 0.16477906703948975, 0.36567381024360657, 0.20577524602413177, 0.060786135494709015, 0.17447933554649353, 0.01467556320130825, -0.21899332106113434, 0.0438586100935936, -0.22494935989379883, 0.1439163088798523, 0.01915765553712845, 0.04955010116100311, -0.023803364485502243, -0.029712826013565063, -0.08429346233606339, 0.6643100380897522, -0.09626414626836777, -0.7663856148719788, -0.22242829203605652, -0.0021977536380290985, 0.21537595987319946, 0.2830560803413391, -0.03859632834792137, -0.18639075756072998, -0.3104102909564972, 0.271837055683136, 0.052634842693805695, 0.02586299180984497, 0.4745154082775116, 0.13266143202781677, -0.20245516300201416, -0.3401622772216797, 0.5196664333343506, -0.10565049946308136, -0.18709775805473328, 0.23201720416545868, 0.4221475422382355, -0.6238664388656616, 0.4449356496334076, 0.25126540660858154, 0.9264790415763855, 0.270731121301651, 0.140310138463974, 0.3612479865550995, -0.2571229636669159, 0.8691481947898865, 0.5170044302940369, 0.17745360732078552, -0.4842842221260071, -0.09947887808084488, 0.07989673316478729, -0.09068674594163895, -0.14305183291435242, 0.07300788164138794, -0.4152601957321167, 0.11322757601737976, -0.5870518684387207, -0.13508301973342896, 0.08665291965007782, -0.062482066452503204, 0.35238316655158997, -0.2532285153865814, -0.24712751805782318, 0.12476815283298492, -0.14990054070949554, -0.027328411117196083, -0.16836097836494446, 0.0972268208861351, -0.13295896351337433, -0.3666303753852844, -0.28214311599731445, 0.14562278985977173, -0.2861868143081665, 0.2825886309146881, -0.11586816608905792, 0.07124394178390503, 0.09858221560716629, 0.530203640460968, 0.4637882113456726, 0.06641057133674622, -0.18266916275024414, 0.06356211751699448, 0.17415392398834229, 0.3601204454898834, -0.04868067428469658, -0.09932740777730942, 0.36550021171569824, 0.1506035327911377, -0.03992155194282532, 0.06445908546447754, 0.031669218093156815, -0.04903269559144974, -0.2425335794687271, 0.11194092780351639, -0.33803582191467285, -0.4330073297023773, -0.3238929212093353, -0.08434796333312988, 0.3070756196975708, -0.3714655339717865, 0.08053156733512878, 0.09550340473651886, -0.2526485323905945, -0.04903199151158333, -0.01309970859438181, -0.2100449502468109, 0.12020126730203629, 0.33882904052734375, 0.09254223108291626, 0.27636003494262695, 0.29240840673446655, 0.26645326614379883, 0.06586426496505737, -0.02474772185087204, 0.14887265861034393, 0.2459760159254074, -0.5774558782577515, 0.3629322052001953, 0.053556423634290695, -0.07126516103744507, 0.017965354025363922, 0.29999515414237976, 0.023271091282367706, 0.14904940128326416, 0.12225370109081268, -0.031190678477287292, -0.02184562012553215, 0.11250168830156326, 0.14951516687870026, 0.09641846269369125, 0.02326861023902893, 0.2626020908355713, 0.19280622899532318, 0.018743371590971947, -0.25068020820617676, -0.043895140290260315, -0.3056521415710449, 0.15964141488075256, 0.36976712942123413, 0.01722363941371441, -0.15383854508399963, 0.3357934355735779, 0.13587336242198944, 0.1568315327167511, 0.22900795936584473, -0.11691003292798996, -0.2938011884689331, 0.11722823977470398, 0.19261591136455536, 0.19407781958580017, -0.024404212832450867, -0.3622794449329376, -0.1429247409105301, -0.08681638538837433, 0.04930877685546875, 0.1842546910047531, -0.14230209589004517, 0.34719598293304443, -0.09191484749317169, 0.17856177687644958, 0.17815877497196198, 0.2537313401699066, -0.10226096957921982, -0.2969895899295807, 0.033851176500320435, 0.17666181921958923, 0.04402455314993858, -0.09787555038928986, -0.07519783079624176, 0.03642754256725311, -0.28446218371391296, -0.20043446123600006, -0.03762500733137131, -0.314265638589859, 0.2956768274307251, 0.13733257353305817, 0.27502840757369995, 0.033025871962308884, -0.2656872272491455, 0.09355364739894867, -0.03517477959394455, 0.14915712177753448, -0.2006499469280243, -0.3116457462310791, -0.02804875187575817, 0.07354998588562012, -0.0872621163725853, 0.30871352553367615, -0.4896218776702881, 0.12420633435249329, -0.2171250879764557, -0.16655439138412476, 0.44424691796302795, -0.16392624378204346, 0.21790912747383118, 0.19919772446155548, -0.3212573528289795, -0.006708972156047821, 0.41431280970573425, 0.15178978443145752, 0.21700653433799744, 0.40412068367004395, -0.0884484350681305, 0.18414083123207092, -0.04109498858451843, -0.027249019593000412, 0.43273329734802246, 0.06400828808546066, 0.16676929593086243, 0.271152526140213, -0.29043254256248474, 0.08297714591026306, -0.22308550775051117, 0.10616326332092285, -0.7467113733291626, -0.43903273344039917, -0.21491816639900208, 0.42590078711509705, -0.3242349326610565, 0.046863820403814316, -0.11711563915014267, 0.0020669400691986084, 0.042042508721351624, -0.12980806827545166, -0.28782761096954346, -0.1163901835680008, 0.37534967064857483, -0.0838228166103363, -0.11250916123390198, -0.3875519037246704, -0.706342339515686, 0.30954599380493164, 0.35924288630485535, -0.42380911111831665, 0.11128940433263779, 0.19013868272304535, -0.0905306413769722, -0.12521260976791382, 0.1945195347070694, 0.30093175172805786, 0.48863404989242554, 0.07096251845359802, -0.19603775441646576, 0.0065399110317230225, -0.0741356760263443, -0.016930487006902695, -0.34515661001205444, 0.07128174602985382, 0.32013747096061707, 0.2559443414211273, 0.09609594941139221, -0.09981594979763031, 0.17634417116641998, 0.07238993048667908, 0.545803964138031, -0.348025918006897, 0.26888614892959595, -0.4604318141937256, -0.22739307582378387, -0.15476426482200623, 0.14140674471855164, -0.0752374529838562, -0.03029020130634308, 0.15561696887016296, 0.15680798888206482, 0.20553915202617645, -0.1407017707824707, 0.06440738588571548, 0.1084120124578476, 0.025041107088327408, 0.007330483291298151, 0.001788274385035038, -0.2993014454841614, -0.03951200097799301, -0.3526971638202667, -0.01787067949771881, 0.12412917613983154, -0.360246479511261, 0.20115631818771362, -0.2662319540977478, -0.0935439020395279, -0.06549942493438721, -0.10026183724403381, -0.03951392322778702, 0.116912342607975, 0.06564342975616455, -0.3697265386581421, -0.25402379035949707, -0.0742480456829071, -0.006557593122124672, 0.2877535820007324, -0.3012825846672058, 0.14670199155807495, -0.09638447314500809, 0.05059734731912613, -0.09465919435024261, 0.09875829517841339, 0.054284632205963135, -0.026945918798446655, 0.19700050354003906, 0.2248481959104538, 0.3438808023929596, 0.1828562170267105, -0.13799399137496948, 0.2708469033241272, -0.18685995042324066, -0.18317043781280518, 0.240281343460083, -0.13135889172554016, 0.5080599784851074, -0.10888383537530899, -0.03660493716597557, -0.19064882397651672, 0.03414072096347809, 0.2576698064804077, 0.06265850365161896, -0.3087242841720581, 0.32784587144851685, -0.21451503038406372, 0.09722195565700531, 0.18319685757160187, 0.15937036275863647, -0.05457311496138573, 0.20628654956817627, -0.08763597905635834, -0.4339267909526825, 0.5656067132949829, -0.3834904432296753, -0.28445154428482056, 0.13077592849731445, 0.3919587731361389, -0.22348999977111816, -0.27044421434402466, -0.19576457142829895, -0.14236484467983246, 0.3552289605140686, 0.08510281145572662, -0.7324085235595703, 0.1509031355381012, 0.009831834584474564, -0.09972581267356873, 0.03835582733154297, 0.23019488155841827, 0.1373676359653473, 0.10492736101150513, 0.29484543204307556, -0.11625926196575165 ]
https://github.com/huggingface/datasets/issues/5736
Hi ! I couldn't reproduce your issue :/ It seems that `shutil.rmtree` failed. It is supposed to work even if the directory is not empty, but you still end up with `OSError: [Errno 39] Directory not empty:`. Can you make sure another process is not using this directory at the same time ?
FORCE_REDOWNLOAD raises "Directory not empty" exception on second run
### Describe the bug Running `load_dataset(..., download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD)` twice raises a `Directory not empty` exception on the second run. ### Steps to reproduce the bug I cannot test this on datasets v2.11.0 due to #5711, but this happens in v2.10.1. 1. Set up a script `my_dataset.py` to generate and load an offline dataset. 2. Load it with ```python ds = datasets.load_dataset(path=/path/to/my_dataset.py, name='toy', data_dir=/path/to/my_dataset.py, cache_dir=cache_dir, download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD, ) ``` It loads fine ``` Dataset my_dataset downloaded and prepared to /path/to/cache/toy-..e05e/1.0.0/...5b4c. Subsequent calls will reuse this data. ``` 3. Try to load it again with the same snippet and the splits are generated, but at the end of the loading process it raises the error ``` 2023-04-11 12:10:19,965: DEBUG: open file: /path/to/cache/toy-..e05e/1.0.0/...5b4c.incomplete/dataset_info.json Traceback (most recent call last): File "<string>", line 2, in <module> File "/path/to/conda/environment/lib/python3.10/site-packages/datasets/load.py", line 1782, in load_dataset builder_instance.download_and_prepare( File "/path/to/conda/environment/lib/python3.10/site-packages/datasets/builder.py", line 852, in download_and_prepare with incomplete_dir(self._output_dir) as tmp_output_dir: File "/path/to/conda/environment/lib/python3.10/contextlib.py", line 142, in __exit__ next(self.gen) File "/path/to/conda/environment/lib/python3.10/site-packages/datasets/builder.py", line 826, in incomplete_dir shutil.rmtree(dirname) File "/path/to/conda/environment/lib/python3.10/shutil.py", line 730, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/path/to/conda/environment/lib/python3.10/shutil.py", line 728, in rmtree os.rmdir(path) OSError: [Errno 39] Directory not empty: '/path/to/cache/toy-..e05e/1.0.0/...5b4c' ``` ### Expected behavior Regenerate the dataset from scratch and reload it. ### Environment info - `datasets` version: 2.10.1 - Platform: Linux-4.18.0-483.el8.x86_64-x86_64-with-glibc2.28 - Python version: 3.10.8 - PyArrow version: 11.0.0 - Pandas version: 1.5.2
53
FORCE_REDOWNLOAD raises "Directory not empty" exception on second run ### Describe the bug Running `load_dataset(..., download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD)` twice raises a `Directory not empty` exception on the second run. ### Steps to reproduce the bug I cannot test this on datasets v2.11.0 due to #5711, but this happens in v2.10.1. 1. Set up a script `my_dataset.py` to generate and load an offline dataset. 2. Load it with ```python ds = datasets.load_dataset(path=/path/to/my_dataset.py, name='toy', data_dir=/path/to/my_dataset.py, cache_dir=cache_dir, download_mode=datasets.DownloadMode.FORCE_REDOWNLOAD, ) ``` It loads fine ``` Dataset my_dataset downloaded and prepared to /path/to/cache/toy-..e05e/1.0.0/...5b4c. Subsequent calls will reuse this data. ``` 3. Try to load it again with the same snippet and the splits are generated, but at the end of the loading process it raises the error ``` 2023-04-11 12:10:19,965: DEBUG: open file: /path/to/cache/toy-..e05e/1.0.0/...5b4c.incomplete/dataset_info.json Traceback (most recent call last): File "<string>", line 2, in <module> File "/path/to/conda/environment/lib/python3.10/site-packages/datasets/load.py", line 1782, in load_dataset builder_instance.download_and_prepare( File "/path/to/conda/environment/lib/python3.10/site-packages/datasets/builder.py", line 852, in download_and_prepare with incomplete_dir(self._output_dir) as tmp_output_dir: File "/path/to/conda/environment/lib/python3.10/contextlib.py", line 142, in __exit__ next(self.gen) File "/path/to/conda/environment/lib/python3.10/site-packages/datasets/builder.py", line 826, in incomplete_dir shutil.rmtree(dirname) File "/path/to/conda/environment/lib/python3.10/shutil.py", line 730, in rmtree onerror(os.rmdir, path, sys.exc_info()) File "/path/to/conda/environment/lib/python3.10/shutil.py", line 728, in rmtree os.rmdir(path) OSError: [Errno 39] Directory not empty: '/path/to/cache/toy-..e05e/1.0.0/...5b4c' ``` ### Expected behavior Regenerate the dataset from scratch and reload it. ### Environment info - `datasets` version: 2.10.1 - Platform: Linux-4.18.0-483.el8.x86_64-x86_64-with-glibc2.28 - Python version: 3.10.8 - PyArrow version: 11.0.0 - Pandas version: 1.5.2 Hi ! I couldn't reproduce your issue :/ It seems that `shutil.rmtree` failed. It is supposed to work even if the directory is not empty, but you still end up with `OSError: [Errno 39] Directory not empty:`. Can you make sure another process is not using this directory at the same time ?
[ -0.16981777548789978, 0.2262328863143921, -0.030027145519852638, 0.40187662839889526, 0.1732892245054245, 0.005023099482059479, 0.4995902478694916, 0.09213702380657196, -0.06644544750452042, -0.10356898605823517, -0.008526850491762161, 0.1271989494562149, 0.12441286444664001, -0.05670633912086487, -0.2610847055912018, 0.15377582609653473, -0.15600696206092834, 0.22164463996887207, -0.20649997889995575, 0.052971601486206055, -0.041876811534166336, 0.22398868203163147, -0.3314743638038635, -0.29371050000190735, -0.40607792139053345, 0.030054805800318718, -0.16058188676834106, 0.3880568742752075, 0.11613573133945465, -0.6076491475105286, 0.3733808398246765, -0.04458373039960861, 0.03180777281522751, 0.7588515281677246, -0.00012308293662499636, 0.0686585009098053, 0.2102736234664917, -0.02101074531674385, -0.5581136345863342, -0.348268985748291, -0.27121075987815857, -0.24035316705703735, 0.06442009657621384, -0.27186012268066406, 0.18212257325649261, -0.15781539678573608, -0.029750924557447433, -0.1753549426794052, 0.39721718430519104, -0.06911910325288773, 0.11408697813749313, -0.056110039353370667, -0.13276171684265137, -0.08481460809707642, 0.1144958958029747, 0.5306220650672913, -0.05412749946117401, 0.23573751747608185, 0.018018163740634918, -0.24239644408226013, -0.10435159504413605, 0.19417956471443176, -0.06586556881666183, 0.2708990275859833, -0.013244997709989548, 0.08506857603788376, 0.0029420051723718643, -0.04534967988729477, 0.12040252238512039, 0.23907983303070068, 0.6528077721595764, -0.25123468041419983, -0.34925946593284607, -0.6552132964134216, -0.004906963557004929, -0.11473573744297028, 0.2612364590167999, 0.2437824010848999, -0.0938192754983902, 0.2815014123916626, -0.11844262480735779, -0.22322498261928558, 0.012300819158554077, -0.23187866806983948, -0.024365104734897614, -0.050823889672756195, -0.09218420088291168, 0.04764452949166298, 0.037685755640268326, 0.09850993752479553, 0.2394130527973175, -0.29371583461761475, -0.23589879274368286, -0.0070662423968315125, -0.1027555987238884, 0.14360642433166504, 0.15244323015213013, -0.13736192882061005, 0.08897913992404938, 0.22870400547981262, 0.11939352750778198, -0.2077183723449707, -0.26645737886428833, -0.010599829256534576, 0.4852890372276306, 0.3172404170036316, 0.2618664801120758, 0.20814448595046997, 0.1587432622909546, 0.13138847053050995, -0.13788829743862152, -0.06072447448968887, 0.015049513429403305, -0.01374087855219841, 0.3815756142139435, 0.12766078114509583, 0.45789635181427, -0.12984231114387512, -0.5493870377540588, 0.024552270770072937, -0.07406177371740341, -0.16426026821136475, -0.05770193040370941, -0.025546077638864517, 0.12244845181703568, 0.3117389678955078, 0.04840786010026932, 0.3165986239910126, -0.13476553559303284, -0.2670801281929016, -0.023481689393520355, -0.22502148151397705, -0.19603095948696136, 0.1369691789150238, 0.3066037595272064, -0.12253373861312866, 0.2646462321281433, 0.3749921917915344, -0.3667549192905426, -0.3573070168495178, 0.22320741415023804, -0.1541718989610672, -0.07496345788240433, 0.2688125967979431, 0.06760010123252869, 0.23684950172901154, 0.13822564482688904, 0.04620254039764404, 0.10440078377723694, 0.2979936897754669, -0.18660952150821686, -0.2922591269016266, 0.07995136827230453, 0.10975337028503418, -0.10879300534725189, 0.2914057970046997, -0.16697563230991364, 0.045230504125356674, 0.1866660714149475, -0.21480512619018555, -0.02246050164103508, 0.0658489540219307, -0.11029569059610367, -0.3513430655002594, 0.052262090146541595, 1.0752768516540527, -0.4941768944263458, 0.15297067165374756, -0.25054579973220825, -0.06586704403162003, -0.028559796512126923, -0.07707858830690384, -0.23740842938423157, 0.5087201595306396, -0.6528441905975342, -0.14417950809001923, 0.28970038890838623, -0.33244943618774414, -0.3692919909954071, 0.4593774974346161, -0.29131585359573364, 0.2616003155708313, 0.1351529359817505, 0.060646042227745056, 0.02484404295682907, -0.04169843718409538, 0.059714000672101974, 0.09952771663665771, -0.022305449470877647, 0.05714218318462372, -0.27378976345062256, -0.11516081541776657, 0.11648561805486679, -0.01610204577445984, -0.056690432131290436, 0.15046703815460205, 0.2527998685836792, 0.13426648080348969, 0.34751954674720764, -0.005154125392436981, 0.06378941237926483, 0.2254096269607544, 0.1840524673461914, 0.14292563498020172, -0.04078482463955879, 0.03289584070444107, -0.8344718813896179, 0.4819539785385132, -0.018896251916885376, -0.25395703315734863, -0.28648531436920166, -0.060192935168743134, -0.24112293124198914, -0.03692029416561127, -0.5108597874641418, -0.15536315739154816, 0.05244571715593338, 0.496354877948761, -0.07210507988929749, 0.0070152729749679565, -0.019998706877231598, 0.577529788017273, -0.15641233325004578, 0.16206413507461548, -0.14964476227760315, 0.44747117161750793, 0.10834183543920517, 0.07471763342618942, -0.3196563720703125, -0.2007484883069992, 0.3503252863883972, -0.29938986897468567, -0.21007606387138367, 0.6960667967796326, 0.2355578988790512, 0.21212391555309296, 0.09993359446525574, -0.31662124395370483, 0.19880801439285278, 0.1061462014913559, 0.19687749445438385, 0.08723708987236023, 0.2213425636291504, -0.27949267625808716, -0.2436772584915161, 0.2452777624130249, -0.17994441092014313, 0.07128702104091644, -0.17393448948860168, -0.10481134057044983, -0.061221327632665634, -0.015417806804180145, 0.05827014893293381, -0.37972813844680786, 0.06242164224386215, 0.26675716042518616, 0.010069534182548523, -0.09649507701396942, 0.21707896888256073, 0.06099367141723633, -0.039834171533584595, 0.01700907200574875, 0.09640306979417801, -0.11554316431283951, -0.08610837906599045, -0.0395648218691349, -0.06295146048069, 0.5739859342575073, 0.6045323610305786, 0.11091744899749756, 0.21626099944114685, -0.01700771227478981, -0.16954027116298676, -0.009689413011074066, 0.3194887638092041, 0.04437419772148132, 0.08454015851020813, 0.3410491347312927, 0.19937832653522491, 0.0016623958945274353, -0.415807843208313, -0.19747284054756165, 0.465034157037735, 0.09842799603939056, -0.2556552588939667, -0.11004689335823059, -0.23596757650375366, 0.11020158231258392, -0.10150711238384247, 0.0739608183503151, -0.0755663588643074, -0.10978017747402191, -0.19143646955490112, 0.3555085361003876, -0.021337956190109253, 0.07727652043104172, -0.2358035147190094, 0.17685727775096893, -0.04804736375808716, -0.2805478572845459, 0.0999600738286972, -0.016689764335751534, -0.30043333768844604, -0.12980929017066956, 0.3750764727592468, -0.27982813119888306, 0.3806203007698059, -0.03736916184425354, -0.0983307957649231, -0.3061319887638092, 0.015357956290245056, -0.08541835844516754, 0.1254892647266388, 0.030005956068634987, 0.17864346504211426, 0.08959697932004929, 0.3066932260990143, 0.027630019932985306, 0.2750224173069, 0.011475160717964172, -0.18520894646644592, 0.055836573243141174, 0.15726733207702637, 0.30633947253227234, -0.38132166862487793, -0.39529949426651, 0.22760358452796936, -0.2687698006629944, 0.10126090049743652, -0.17156058549880981, -0.033665210008621216, 0.40215548872947693, 0.0713350772857666, 0.1078270897269249, 0.034286241978406906, -0.0820140391588211, -0.21371962130069733, -0.276076078414917, -0.0639687329530716, -0.06571067869663239, 0.01749778352677822, 0.029757440090179443, -0.039526380598545074, -0.10810913145542145, 0.27766257524490356, -0.759516716003418, -0.22680363059043884, -0.13930216431617737, 0.19515520334243774, -0.3990625739097595, 0.02775723673403263, 0.31624823808670044, 0.2085246741771698, -0.030673198401927948, -0.046257566660642624, -0.22927746176719666, 0.22675639390945435, 0.07970096170902252, 0.20806926488876343, -0.16679349541664124, 0.28948837518692017, 0.07774487882852554, 0.24309301376342773, 0.23282133042812347, 0.13777266442775726, 0.4151378870010376, 0.121754489839077, 0.5499006509780884, -0.12879186868667603, -0.2704333961009979, -0.16446031630039215, -0.15855075418949127, -0.1481572389602661, 0.11782440543174744, 0.11616494506597519, 0.10076157748699188, -0.1671862006187439, -0.08454487472772598, -0.2821972966194153, -0.17838385701179504, 0.007553523406386375, -0.3558083474636078, 0.10074860602617264, 0.0677545815706253, 0.10761953890323639, -0.20286138355731964, 0.13289520144462585, -0.17451010644435883, -0.1446773111820221, 0.315240740776062, -0.09328222274780273, -0.2184409648180008, 0.24643611907958984, 0.03278690576553345, 0.12536275386810303, 0.17320087552070618, 0.17815405130386353, 0.13999824225902557, 0.05687542259693146, 0.1349935531616211, 0.033040739595890045, 0.932514488697052, -0.30286654829978943, 0.27658218145370483, 0.23332208395004272, 0.15623313188552856, -0.3816802501678467, -0.22482962906360626, -0.07537800073623657, 0.1735842227935791, 0.23547768592834473, 0.2060055136680603, -0.2633042633533478, 0.12204937636852264, -0.040915586054325104, 0.3729400336742401, -0.15385845303535461, -0.25594428181648254, -0.0163729265332222, -0.15568044781684875, -0.2403067946434021, 0.0856604278087616, 0.051545485854148865, 0.13083559274673462, -0.05283961072564125, -0.03565257415175438, -0.10036776214838028, -0.14440008997917175, -0.12519341707229614, -0.021827295422554016, 0.4684297442436218, -0.04595426097512245, 0.3557969033718109, 0.29524388909339905, -0.02659543603658676, 0.33641916513442993, 0.719833254814148, -0.2533630132675171, 0.1570877581834793, 0.15646947920322418, 0.049914464354515076, -0.08929363638162613, 0.5061047673225403, 0.03039669618010521, -0.2658922076225281, -0.4436143934726715, 0.05150192230939865, -0.19215551018714905, -0.04160269349813461, 0.2174157202243805, -0.3565030097961426, -0.17606790363788605, -0.32722604274749756, 0.3226414918899536, -0.18126524984836578, -0.09716609865427017, 0.5552433133125305, 0.1915631890296936, -0.2492024004459381, 0.22089333832263947, -0.33487895131111145, 0.6698185205459595, 0.12612822651863098, 0.14690500497817993, 0.24589483439922333, -0.31671637296676636, 0.44809675216674805, -0.33109891414642334, 0.16805680096149445, -0.20596398413181305, -0.004607874900102615, 0.09350229054689407, -0.12141519039869308, -0.013963308185338974, 0.303309828042984, -0.013147473335266113, 0.28649526834487915, -0.2267507165670395, 0.32676374912261963, -0.0653952956199646, -0.04376189038157463, -0.2805292308330536, -0.06630787253379822, 0.023942645639181137, 0.038257356733083725, 0.2711818814277649, 0.1616363227367401, -0.19350260496139526, -0.00608195923268795, 0.3369937241077423, -0.13903726637363434, -0.3615756630897522, 0.25011783838272095, -0.26350149512290955, 0.3764263093471527, -0.3961867094039917, -0.22902314364910126, -0.022733084857463837, 0.3892998993396759, 0.17968925833702087, 0.00883143674582243, -0.005063342861831188, 0.10707240551710129, -0.017881840467453003, 0.37451982498168945, -0.16796675324440002, 0.016903959214687347, 0.22121132910251617, 0.13147497177124023, -0.2704541087150574, -0.11295288801193237, -0.39208316802978516, 0.06259135901927948, -0.09332862496376038, 0.2703615725040436, 0.06984776258468628, -0.37467068433761597, 0.001704968512058258, 0.225437730550766, 0.1898992508649826, -0.22576063871383667, -0.023752177134156227, 0.11561781167984009, -0.07107827067375183, -0.0564013235270977, -0.39885640144348145, -0.45240065455436707, -0.038479674607515335, 0.39461520314216614, 0.07513986527919769, -0.08066244423389435, 0.49479562044143677, -0.14504851400852203, 0.09697924554347992, -0.23396436870098114, 0.27756965160369873, -0.17705029249191284, -0.4989897906780243, 0.40061408281326294, -0.17883655428886414, 0.19759532809257507, 0.30278730392456055, -0.10106492042541504, 0.11719189584255219, 0.19905424118041992, 0.02950429916381836, -0.18611593544483185, -0.055080629885196686, -0.17743943631649017, 0.0004225960001349449, 0.24104514718055725, 0.05029518902301788, -0.041609399020671844, 0.2199353575706482, -0.07510849088430405, -0.20019268989562988, 0.37766051292419434, 0.13548710942268372, 0.1837790459394455, -0.1287296861410141, -0.11592958867549896, 0.2123565971851349, -0.052969299256801605, 0.02905973047018051, 0.18650750815868378, -0.17812128365039825, -0.040124956518411636, -0.18874669075012207, 0.18336041271686554, -0.028025038540363312, 0.023358091711997986, -0.1279880702495575, -0.36718684434890747, 0.047130562365055084, -0.20712895691394806, 0.24840888381004333, 0.23982098698616028, 0.002573413774371147, -0.011407699435949326, 0.36438652873039246, 0.3286312222480774, -0.24823862314224243, 0.11833608150482178, -0.17078272998332977, -0.007051527500152588, 0.29357579350471497, 0.3933503329753876, -0.2228296399116516, 0.01895364373922348, -0.5371643900871277, 0.015159755945205688, 0.026046359911561012, 0.004774477332830429, 0.04003450274467468, -0.38222718238830566, -0.018982090055942535, -0.13205434381961823, 0.46280816197395325, 0.37548312544822693, -0.13207079470157623, -0.0961894765496254, 0.038353968411684036, 0.1412787288427353, -0.2513989806175232, -0.10257086902856827, 0.055887121707201004, 0.1760641187429428, -0.09191932529211044, 0.32768622040748596, 0.08601856976747513, -0.42650532722473145, -0.03326335549354553, 0.04363001137971878, 0.5222470164299011, -0.046315159648656845, 0.36054572463035583, 0.5814781188964844, 0.00702851265668869, -0.07523524761199951, 0.10092276334762573, 0.009826846420764923, 0.198237806558609, 0.4825311303138733, -0.0657275915145874, 0.3097279667854309, -0.12462270259857178, 0.035860344767570496, -0.25723910331726074, -0.6244565844535828, 0.0467757023870945, 0.3328482508659363, -0.13216516375541687, 0.13435520231723785, -0.1322837918996811, 0.09876605123281479, -0.5408956408500671, -0.0938350260257721, -0.4426708519458771, -0.0023513808846473694, -0.2343507707118988, -0.18807050585746765, 0.2209964394569397, -0.3123818635940552, 0.03897538781166077, 0.06434549391269684, -0.041071776300668716, -0.08629848062992096, 0.057130053639411926, -0.013771932572126389, -0.2858462929725647, -0.5977623462677002, 0.06376968324184418, 0.33610260486602783, 0.13359224796295166, -0.38323870301246643, 0.2790486216545105, 0.49478083848953247, -0.22635385394096375, 0.08309845626354218, 0.2910647988319397, 0.49213364720344543, 0.20704598724842072, -0.010153166949748993, -0.015725882723927498, -0.04757874459028244, 0.17457392811775208, -0.1227896511554718, 0.13970932364463806, -0.2929393947124481, 0.0520806722342968, 0.2610476016998291, 0.06228660047054291, -0.07338012009859085, 0.17803776264190674, 0.19919148087501526, 0.037206534296274185, -0.3617210388183594, 0.40540462732315063, -0.08835063874721527, -0.0036051124334335327, -0.10307684540748596, 0.1445533037185669, -0.21863022446632385, -0.28336605429649353, 0.3511616289615631, -0.01890103705227375, 0.06970103830099106, 0.004822820425033569, 0.046592969447374344, -0.24805104732513428, -0.01769353449344635, 0.3882365822792053, -0.41732335090637207, -0.26088497042655945, -0.1944514811038971, -0.7996929883956909, 0.026431072503328323, -0.28429076075553894, 0.14435535669326782, -0.022041670978069305, 0.3121194541454315, -0.11716072261333466, -0.051715701818466187, 0.18554304540157318, 0.3910749852657318, -0.008485168218612671, 0.09955938160419464, -0.38520094752311707, -0.14689627289772034, -0.033891331404447556, -0.0882093608379364, -0.026707813143730164, -0.49911850690841675, -0.0422043576836586, -0.12367507070302963, 0.005147375166416168, 0.2463541030883789, 0.1037193238735199, 0.13641877472400665, -0.020882492884993553, 0.5401604175567627, 0.036879152059555054, 0.040980275720357895, 0.31942522525787354, -0.3313061594963074, -0.5545592308044434, -0.10423092544078827, 0.09273280203342438, -0.07520365715026855, 0.37058401107788086, 0.36669862270355225, -0.6086663007736206, 0.13062316179275513, -0.18608108162879944, 0.11199008673429489, 0.1502864807844162, 0.32827028632164, -0.15884363651275635, 0.013665802776813507, -0.1996862292289734, 0.30088651180267334, 0.08944138884544373, 0.1673526167869568, -0.08295045047998428, 0.41004493832588196, -0.24492627382278442, -0.37495946884155273, 0.2507459223270416, -0.20436900854110718, -0.21440432965755463, -0.013753030449151993, 0.5022170543670654, -0.004032310098409653, 0.020927300676703453, -0.48432594537734985, 0.055958569049835205, 0.44502127170562744, -0.07282174378633499, -0.2519490718841553, 0.004103414714336395, -0.19904039800167084, -0.12934599816799164, 0.11031126976013184, 0.14681534469127655, 0.03638138994574547, -0.27182915806770325, 0.42134952545166016, -0.0798865556716919 ]
https://github.com/huggingface/datasets/issues/5732
The Enwik8 pipeline is not present in this codebase, and is hosted elsewhere. I have opened a PR [there](https://huggingface.co/datasets/enwik8/discussions/4) instead.
Enwik8 should support the standard split
### Feature request The HuggingFace Datasets library currently supports two BuilderConfigs for Enwik8. One config yields individual lines as examples, while the other config yields the entire dataset as a single example. Both support only a monolithic split: it is all grouped as "train". The HuggingFace Datasets library should include a BuilderConfig for Enwik8 with train, validation, and test sets derived from the first 90 million bytes, next 5 million bytes, and last 5 million bytes, respectively. This Enwik8 split is standard practice in LM papers, as elaborated and motivated below. ### Motivation Enwik8 is commonly split into 90M, 5M, 5M consecutive bytes. This is done in the Transformer-XL [codebase](https://github.com/kimiyoung/transformer-xl/blob/44781ed21dbaec88b280f74d9ae2877f52b492a5/getdata.sh#L34), and is additionally mentioned in the Sparse Transformers [paper](https://arxiv.org/abs/1904.10509) and the Compressive Transformers [paper](https://arxiv.org/abs/1911.05507). This split is pretty much universal among language modeling papers. One may obtain the splits by manual wrangling, using the data yielded by the ```enwik8-raw``` BuilderConfig. However, this undermines the seamless functionality of the library: one must slice the single raw example, extract it into three tensors, and wrap each in a separate dataset. This becomes even more of a nuisance if using the current Enwik8 HuggingFace dataset as a TfdsDataSource with [SeqIO](https://github.com/google/seqio), where a pipeline of preprocessors is typically included in a SeqIO Task definition, to be applied immediately after loading the data with TFDS. ### Your contribution Supporting this functionality in HuggingFace Datasets will only require an additional BuilderConfig for Enwik8 and a few additional lines of code. I will submit a PR.
20
Enwik8 should support the standard split ### Feature request The HuggingFace Datasets library currently supports two BuilderConfigs for Enwik8. One config yields individual lines as examples, while the other config yields the entire dataset as a single example. Both support only a monolithic split: it is all grouped as "train". The HuggingFace Datasets library should include a BuilderConfig for Enwik8 with train, validation, and test sets derived from the first 90 million bytes, next 5 million bytes, and last 5 million bytes, respectively. This Enwik8 split is standard practice in LM papers, as elaborated and motivated below. ### Motivation Enwik8 is commonly split into 90M, 5M, 5M consecutive bytes. This is done in the Transformer-XL [codebase](https://github.com/kimiyoung/transformer-xl/blob/44781ed21dbaec88b280f74d9ae2877f52b492a5/getdata.sh#L34), and is additionally mentioned in the Sparse Transformers [paper](https://arxiv.org/abs/1904.10509) and the Compressive Transformers [paper](https://arxiv.org/abs/1911.05507). This split is pretty much universal among language modeling papers. One may obtain the splits by manual wrangling, using the data yielded by the ```enwik8-raw``` BuilderConfig. However, this undermines the seamless functionality of the library: one must slice the single raw example, extract it into three tensors, and wrap each in a separate dataset. This becomes even more of a nuisance if using the current Enwik8 HuggingFace dataset as a TfdsDataSource with [SeqIO](https://github.com/google/seqio), where a pipeline of preprocessors is typically included in a SeqIO Task definition, to be applied immediately after loading the data with TFDS. ### Your contribution Supporting this functionality in HuggingFace Datasets will only require an additional BuilderConfig for Enwik8 and a few additional lines of code. I will submit a PR. The Enwik8 pipeline is not present in this codebase, and is hosted elsewhere. I have opened a PR [there](https://huggingface.co/datasets/enwik8/discussions/4) instead.
[ -0.3313150405883789, -0.14449968934059143, -0.0036493614315986633, 0.16411694884300232, 0.024416301399469376, -0.0013117045164108276, 0.5215281248092651, 0.46325474977493286, 0.15831592679023743, 0.22229424118995667, -0.147029846906662, -0.14948967099189758, -0.3204789161682129, 0.32197514176368713, 0.15510860085487366, -0.358125239610672, -0.11007119715213776, 0.3906594514846802, 0.05330299586057663, 0.27803367376327515, 0.031563639640808105, 0.2506279945373535, -0.11442901939153671, -0.040763840079307556, -0.4354671537876129, 0.014475705102086067, -0.2472836822271347, 0.004976559430360794, -0.10563712567090988, 0.02536167949438095, 0.4234028160572052, 0.060541290789842606, 0.047865211963653564, 0.10047933459281921, -0.00010443691280670464, 0.092573381960392, 0.0311871487647295, -0.09537407010793686, -0.1092817485332489, 0.22629442811012268, -0.08579706400632858, 0.06088900566101074, -0.021233463659882545, -0.36757421493530273, -0.009829245507717133, 0.22225679457187653, -0.16451571881771088, -0.0032844245433807373, 0.7705592513084412, 0.1071939766407013, 0.20854982733726501, 0.31347644329071045, -0.04674240201711655, 0.0346316434442997, 0.005526518449187279, 0.2799966037273407, -0.1419341117143631, -0.21864676475524902, -0.07329511642456055, 0.21275636553764343, -0.1890023797750473, 0.242155060172081, 0.04838746786117554, -0.045295510441064835, 0.18279415369033813, -0.010720891878008842, -0.013048730790615082, -0.08479073643684387, -0.14962945878505707, 0.7852489352226257, -0.20752201974391937, -0.1414044052362442, -0.39402154088020325, -0.5332096219062805, -0.20247626304626465, -0.33763134479522705, -0.012250028550624847, 0.2180003821849823, -0.19272109866142273, 0.22248327732086182, -0.18629729747772217, -0.15062864124774933, -0.09947414696216583, 0.008034974336624146, -0.48701608180999756, 0.40017521381378174, 0.032985199242830276, -0.11644180119037628, 0.25362759828567505, 0.09068204462528229, -0.15938374400138855, -0.03546186909079552, 0.0197769682854414, 0.04694056883454323, -0.04982142150402069, -0.34215855598449707, -0.07873652875423431, -0.02011481672525406, 0.4077454209327698, 0.04407418519258499, -0.32543662190437317, 0.1245984137058258, 0.21877610683441162, 0.05073534697294235, 0.3388217091560364, 0.2273615002632141, 0.03797232732176781, -0.06984017044305801, 0.12148091197013855, 0.2515449821949005, 0.12411930412054062, -0.0726495087146759, 0.009277377277612686, -0.10354846715927124, -0.38844794034957886, -0.21900932490825653, -0.3312409520149231, 0.1353585571050644, -0.023166652768850327, -0.20792913436889648, 0.2990320324897766, -0.05326084792613983, 0.24342846870422363, 0.14360594749450684, -0.057986900210380554, 0.15412598848342896, 0.012274481356143951, 0.0889277458190918, -0.28063803911209106, -0.02437484636902809, -0.17718052864074707, -0.0964784026145935, -0.1550183892250061, 0.07143597304821014, 0.09976658225059509, -0.3901905417442322, 0.3244619071483612, 0.008136074990034103, 0.50724858045578, -0.12527059018611908, -0.20281149446964264, 0.2788187861442566, 0.08387307077646255, 0.06146695092320442, -0.22364425659179688, -0.08148078620433807, -0.08143311738967896, -0.15534166991710663, -0.31110331416130066, -0.18896283209323883, -0.19976511597633362, -0.5171765685081482, -0.32324230670928955, 0.13505566120147705, -0.047150373458862305, 0.24399642646312714, 0.3751709461212158, 0.31998389959335327, 0.13338972628116608, 0.01707315444946289, 0.06322816759347916, 0.17519733309745789, -0.12093386799097061, 0.037988923490047455, 0.5693280696868896, 0.07332517951726913, 0.04861503839492798, -0.4879921078681946, 0.12100765109062195, -0.17860625684261322, -0.10301615297794342, 0.374230295419693, -0.30169129371643066, -0.13127870857715607, -0.18567711114883423, 0.31933778524398804, 0.3176969587802887, -0.11482449620962143, -0.09987436980009079, 0.5678658485412598, 0.11862143874168396, -0.029763981699943542, 0.06628590077161789, -0.13066387176513672, 0.41806793212890625, -0.07006526738405228, 0.026780031621456146, 0.5252038240432739, -0.2633053958415985, 0.2684239149093628, -0.03656122460961342, -0.540762186050415, 0.0326349213719368, 0.14305391907691956, 0.09987819194793701, -0.24151365458965302, -0.3280401825904846, 0.5749366283416748, 0.6058024764060974, -0.26427051424980164, 0.13764715194702148, -0.1261751353740692, -0.061003364622592926, -0.12060809135437012, -0.058139052242040634, -0.20989945530891418, -0.42474740743637085, 0.1421053409576416, -0.20783042907714844, 0.04420388489961624, 0.25927793979644775, -0.3572016954421997, 0.05918126925826073, -0.092030830681324, -0.21213175356388092, -0.4150933623313904, 0.11817671358585358, -0.37484011054039, 0.13278883695602417, -0.07289645075798035, -0.29449135065078735, -0.05983590707182884, 0.0007252618670463562, 0.32821124792099, -0.1676129400730133, 0.18331198394298553, -0.06764836609363556, 0.1212039440870285, -0.10097522288560867, 0.5021152496337891, -0.35413020849227905, -0.08187524974346161, 0.0820230096578598, 0.2536407709121704, 0.1092904806137085, 0.07501393556594849, -0.43720629811286926, 0.288086473941803, 0.5075246095657349, 0.05134531855583191, 0.012242261320352554, -0.10231947153806686, -0.26222720742225647, -0.1612597554922104, -0.36157602071762085, 0.6674636602401733, 0.09125830233097076, 0.409807413816452, 0.1157451719045639, 0.09729774296283722, -0.20342792570590973, -0.4018091857433319, -0.35163718461990356, -0.39123663306236267, 0.042668648064136505, -0.26400887966156006, 0.31411367654800415, -0.03249269351363182, -0.1374121904373169, -0.06268500536680222, 0.6238453388214111, 0.22284486889839172, -0.0030397046357393265, 0.12990164756774902, -0.1978188008069992, -0.0741950273513794, -0.011375314556062222, 0.06697314977645874, -0.08998553454875946, 0.08170302212238312, 0.29273679852485657, 0.19434277713298798, -0.11281542479991913, -0.09863966703414917, 0.29259729385375977, 0.1703161895275116, 0.16185718774795532, 0.18944327533245087, -0.2757946252822876, -0.010268621146678925, -0.16291344165802002, 0.056556567549705505, -0.2236647605895996, -0.19847095012664795, -0.04404807463288307, 0.10690131783485413, -0.15041333436965942, -0.21415945887565613, -0.4439391493797302, -0.3708873391151428, -0.3502168357372284, -0.3187887370586395, 0.10233605653047562, -0.3133852481842041, -0.22428740561008453, 0.13595697283744812, 0.028731532394886017, 0.3763125538825989, 0.04936801642179489, 0.14376388490200043, -0.1809588521718979, -0.11108788102865219, -0.07027900218963623, 0.12355246394872665, 0.2086823582649231, -0.02524794451892376, 0.11203841120004654, -0.025108542293310165, -0.045144326984882355, 0.3059244751930237, -0.6150723099708557, 0.3666539490222931, 0.014201261103153229, 0.05670631676912308, 0.3968200385570526, 0.1370575726032257, 0.0806603729724884, -0.5303885340690613, 0.0925053283572197, -0.10969986021518707, -0.036234479397535324, 0.09317132830619812, 0.05666758865118027, 0.22261717915534973, -0.35056760907173157, -0.17924082279205322, -0.11989100277423859, -0.374165415763855, 0.30827248096466064, -0.15285640954971313, 0.19494329392910004, 0.1515299379825592, 0.057442888617515564, 0.07292838394641876, -0.20253384113311768, -0.09783758223056793, 0.08876504004001617, -0.23196947574615479, 0.143289253115654, -0.40865567326545715, -0.03699802607297897, -0.24125510454177856, -0.20945458114147186, 0.35971295833587646, -0.03930755704641342, -0.280227392911911, 0.0851563960313797, -0.1163078173995018, 0.2370617389678955, -0.06359942257404327, -0.02646472118794918, 0.16611221432685852, 0.041543148458004, 0.030584868043661118, -0.08146359771490097, 0.1906043142080307, 0.15636487305164337, -0.17533186078071594, -0.04090750962495804, -0.2047901600599289, 0.39006638526916504, 0.44697120785713196, 0.4961007833480835, 0.537664532661438, -0.08008012175559998, -0.15853773057460785, 0.07960905879735947, 0.022899191826581955, -0.17472797632217407, -0.03647909685969353, 0.49286603927612305, -0.050351910293102264, 0.14832803606987, 0.47172537446022034, 0.18430805206298828, -0.007071796804666519, -0.1880180537700653, 0.1262088268995285, 0.17665426433086395, -0.6522169709205627, 0.1393464058637619, -0.0433412566781044, 0.35811564326286316, -0.23025403916835785, -0.02391861379146576, 0.11280706524848938, 0.08909223973751068, 0.08546416461467743, 0.24906334280967712, 0.05479249358177185, -0.01741812564432621, 0.04349042475223541, 0.12741515040397644, -0.4675637483596802, -0.14774371683597565, 0.2583547830581665, -0.11554382741451263, 0.2818145751953125, -0.09654831141233444, -0.2262389361858368, -0.050790492445230484, 0.601385235786438, 0.24766838550567627, -0.2328111082315445, -0.19114574790000916, 0.07719820737838745, -0.5204428434371948, 0.018176481127738953, 0.01158265769481659, 0.058356061577796936, 0.3466736376285553, 0.2350022792816162, -0.5814955234527588, -0.27196401357650757, 0.45391032099723816, 0.23233574628829956, -0.25405287742614746, -0.18370023369789124, 0.06766948848962784, 0.1391071081161499, -0.20995166897773743, 0.18242840468883514, 0.110606350004673, -0.003103066235780716, 0.0002767518162727356, -0.13351689279079437, 0.0439542755484581, -0.16192570328712463, -0.010637063533067703, -0.04683133587241173, 0.10733936727046967, -0.15009653568267822, -0.005733326077461243, 0.1279657632112503, 0.0012651262804865837, -0.37196919322013855, 0.15599989891052246, -0.07347309589385986, -0.16979829967021942, -0.1621592938899994, -0.07510168850421906, 0.21644805371761322, 0.26278990507125854, 0.06959874927997589, 0.000009782612323760986, 0.3172699809074402, 0.2757936120033264, -0.35648927092552185, 0.08492575585842133, 0.2598453462123871, -0.175534188747406, -0.17732802033424377, -0.18890124559402466, 0.3080539107322693, -0.03439880907535553, 0.21192492544651031, 0.08169505000114441, 0.15648694336414337, -0.3838796615600586, 0.18378715217113495, 0.22560031712055206, 0.6852962970733643, 0.1917460560798645, 0.2700248956680298, 0.2841952443122864, -0.0355076789855957, 0.44387727975845337, -0.20122750103473663, 0.002780783921480179, -0.2744935154914856, 0.09371615946292877, 0.027909614145755768, 0.05266939103603363, -0.02096271887421608, 0.1844734400510788, -0.3599650263786316, -0.09471648186445236, 0.07592460513114929, -0.04533187299966812, -0.1355971097946167, 0.25802552700042725, -0.2551795244216919, -0.43687283992767334, -0.13522258400917053, 0.05756423622369766, -0.045482851564884186, 0.04758306220173836, -0.09858646988868713, -0.18893717229366302, 0.34859156608581543, -0.10748828947544098, -0.2586475908756256, -0.028420239686965942, -0.19145144522190094, 0.2384723424911499, 0.14046217501163483, -0.1831706464290619, 0.18596124649047852, -0.05929744988679886, 0.2283971905708313, 0.2689477503299713, -0.1965201199054718, 0.24054381251335144, -0.4103075861930847, -0.08967308700084686, -0.20495957136154175, -0.11486570537090302, 0.42465221881866455, -0.10319018363952637, -0.06862841546535492, -0.36728301644325256, -0.11436071991920471, -0.10728883743286133, 0.19523119926452637, -0.0044814832508563995, 0.10029713064432144, -0.3329508304595947, 0.25174418091773987, 0.30131781101226807, 0.12229679524898529, -0.29718729853630066, 0.10860298573970795, 0.006605859845876694, -0.29704198241233826, 0.19667023420333862, 0.014039344154298306, 0.0861407071352005, -0.1403605341911316, 0.12720975279808044, 0.0037509743124246597, -0.08728043735027313, 0.16477173566818237, 0.29649457335472107, -0.08603347837924957, -0.22921404242515564, -0.06760948896408081, 0.23650023341178894, -0.448699414730072, 0.15273520350456238, -0.10072095692157745, -0.07884230464696884, 0.04650958254933357, 0.20091551542282104, 0.002872710581868887, 0.008421547710895538, -0.06508678197860718, 0.05037630349397659, -0.15668484568595886, 0.21868547797203064, -0.0855601355433464, 0.4913586974143982, -0.10964502394199371, 0.6701589226722717, -0.0854063630104065, 0.43129080533981323, -0.35425350069999695, 0.17112919688224792, 0.0910409614443779, -0.07896094024181366, 0.08587680757045746, -0.28320300579071045, 0.11197074502706528, 0.23641423881053925, -0.001192823052406311, 0.2178364247083664, -0.2764469385147095, -0.20053909718990326, -0.4061892628669739, 0.09272416681051254, 0.1172010600566864, 0.00019699335098266602, 0.4887121319770813, 0.3636471927165985, -0.2200007438659668, -0.28539299964904785, 0.5656929016113281, -0.30747872591018677, 0.052657391875982285, 0.28827643394470215, 0.16522634029388428, 0.19208009541034698, -0.2592185139656067, 0.049697570502758026, 0.1480516493320465, 0.36876851320266724, 0.17607340216636658, 0.30125659704208374, -0.16571791470050812, -0.06815728545188904, 0.09124058485031128, 0.3284737467765808, 0.1927207112312317, -0.057548828423023224, 0.18172532320022583, 0.08208984136581421, -0.2600926160812378, 0.17610417306423187, 0.25217193365097046, 0.28187668323516846, -0.023720785975456238, 0.18066495656967163, 0.0831088125705719, 0.26419585943222046, -0.030079059302806854, 0.18947699666023254, 0.12557220458984375, -0.11270911246538162, 0.30896127223968506, 0.30014756321907043, 0.3544762432575226, 0.043926045298576355, 0.1617000848054886, -0.15032005310058594, 0.08327528089284897, -0.1600237935781479, 0.4694405496120453, 0.5688555240631104, -0.12445497512817383, -0.08042347431182861, 0.022242074832320213, -0.21791240572929382, 0.6705055236816406, -0.012593146413564682, -0.3532145023345947, 0.3306172788143158, -0.3009057343006134, 0.08484721183776855, 0.3850342929363251, -0.19079607725143433, -0.15949325263500214, -0.049409978091716766, -0.02972845360636711, 0.14066609740257263, -0.16749626398086548, 0.6166965961456299, -0.18426863849163055, -0.04893484339118004, -0.36005207896232605, 0.5228825211524963, -0.056584715843200684, -0.2300342321395874, 0.10695768892765045, -0.22968699038028717, -0.18282540142536163, 0.0831875205039978, 0.07582305371761322, -0.10727100074291229, 0.0935506597161293, 0.06057003140449524, 0.15888476371765137, -0.052206508815288544, 0.009843884035944939, -0.0013530449941754341, 0.30538490414619446, -0.1986580193042755, 0.008067715913057327, 0.5014104247093201, -0.12352058291435242, -0.08377495408058167, 0.3898490071296692, -0.007683262228965759, -0.2417394071817398, -0.013393338769674301, 0.00908227264881134, -0.042986828833818436, 0.0535634383559227, -0.18241219222545624, -0.15622201561927795, -0.001940213143825531, 0.041187964379787445, 0.48905664682388306, 0.11053318530321121, -0.2132876068353653, -0.260094553232193, -0.2828010618686676, -0.1325809210538864, -0.41874170303344727, 0.08379664272069931, 0.17112915217876434, 0.056994885206222534, -0.17047257721424103, -0.0389898456633091, -0.2813184857368469, 0.05679595470428467, 0.007011473178863525, -0.4049695134162903, -0.12332892417907715, -0.03499040752649307, 0.10769456624984741, 0.12597930431365967, 0.5212529301643372, 0.06985186040401459, 0.28714925050735474, 0.02887703850865364, -0.50262451171875, -0.11743171513080597, 0.02940787747502327, 0.07926978170871735, 0.2487429678440094, 0.1714038997888565, 0.18906015157699585, -0.16859862208366394, 0.1264587640762329, -0.20933952927589417, -0.09395259618759155, 0.15388643741607666, -0.1954830437898636, -0.2032279074192047, 0.10612963885068893, 0.23422124981880188, -0.07279887050390244, 0.0825275182723999, -0.06372901052236557, 0.06658612936735153, 0.1193365603685379, -0.04342518001794815, -0.16076040267944336, 0.3518468737602234, 0.11419772356748581, -0.10313884168863297, 0.12274304777383804, 0.4124833047389984, -0.09894521534442902, -0.03855717554688454, -0.32750403881073, -0.1353280395269394, 0.12309243530035019, -0.3516845405101776, -0.038837533444166183, 0.013266012072563171, 0.3996032774448395, -0.2151365876197815, -0.4692266881465912, -0.26737260818481445, 0.06308457255363464, 0.3035713732242584, -0.007995761930942535, -0.16850200295448303, 0.08972864598035812, -0.19906869530677795, 0.09104911983013153, 0.5451669692993164, 0.6906838417053223, -0.152766615152359, -0.18015654385089874, 0.06858013570308685, -0.4848187565803528, 0.0837535411119461, -0.00633012130856514, -0.04305063188076019, -0.11406342685222626, 0.021174665540456772, 0.03544825688004494, -0.03910398483276367, -0.591792643070221, -0.03964749723672867, 0.13873766362667084, -0.11181437969207764, -0.1199861466884613, 0.29205337166786194, 0.408458948135376, -0.24066296219825745, -0.17853358387947083, 0.29427459836006165, 0.32077690958976746, -0.3739534616470337, -0.03919069841504097, -0.3570832312107086 ]
https://github.com/huggingface/datasets/issues/5727
Hi! Can you please paste the entire error stack trace, not only the last few lines?
load_dataset fails with FileNotFound error on Windows
### Describe the bug Although I can import and run the datasets library in a Colab environment, I cannot successfully load any data on my own machine (Windows 10) despite following the install steps: (1) create conda environment (2) activate environment (3) install with: ``conda` install -c huggingface -c conda-forge datasets` Then ``` from datasets import load_dataset # this or any other example from the website fails with the FileNotFoundError glue = load_dataset("glue", "ax") ``` **Below I have pasted the error omitting the full path**: ``` raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at C:\Users\...\glue\glue.py or any data file in the same directory. Couldn't find 'glue' on the Hugging Face Hub either: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` ### Steps to reproduce the bug On Windows 10 1) create a minimal conda environment (with just Python) (2) activate environment (3) install datasets with: ``conda` install -c huggingface -c conda-forge datasets` (4) import load_dataset and follow example usage from any dataset card. ### Expected behavior The expected behavior is to load the file into the Python session running on my machine without error. ### Environment info ``` # Name Version Build Channel aiohttp 3.8.4 py311ha68e1ae_0 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 h57928b3_13_cpu conda-forge async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h1262f0c_1 conda-forge aws-c-cal 0.5.21 h7cda486_2 conda-forge aws-c-common 0.8.14 hcfcfb64_0 conda-forge aws-c-compression 0.2.16 h8a79959_5 conda-forge aws-c-event-stream 0.2.20 h5f78564_4 conda-forge aws-c-http 0.7.6 h2545be9_0 conda-forge aws-c-io 0.13.19 h0d2781e_3 conda-forge aws-c-mqtt 0.8.6 hd211e0c_12 conda-forge aws-c-s3 0.2.7 h8113e7b_1 conda-forge aws-c-sdkutils 0.1.8 h8a79959_0 conda-forge aws-checksums 0.1.14 h8a79959_5 conda-forge aws-crt-cpp 0.19.8 he6d3b81_12 conda-forge aws-sdk-cpp 1.10.57 h64004b3_8 conda-forge brotlipy 0.7.0 py311ha68e1ae_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.0 h2bbff1b_0 ca-certificates 2023.01.10 haa95532_0 certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py311h7d9ee11_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge cryptography 40.0.1 py311h28e9c30_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge datasets 2.11.0 py_0 huggingface dill 0.3.6 pyhd8ed1ab_1 conda-forge filelock 3.11.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 py311ha68e1ae_0 conda-forge fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gflags 2.2.2 ha925a31_1004 conda-forge glog 0.6.0 h4797de2_0 conda-forge huggingface_hub 0.13.4 py_0 huggingface idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.3.0 pyha770c72_0 conda-forge importlib_metadata 6.3.0 hd8ed1ab_0 conda-forge intel-openmp 2023.0.0 h57928b3_25922 conda-forge krb5 1.20.1 heb0366b_0 conda-forge libabseil 20230125.0 cxx17_h63175ca_1 conda-forge libarrow 11.0.0 h04c43f8_13_cpu conda-forge libblas 3.9.0 16_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 7.88.1 h68f0423_1 conda-forge libexpat 2.5.0 h63175ca_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgoogle-cloud 2.8.0 hf2ff781_1 conda-forge libgrpc 1.52.1 h32da247_1 conda-forge libhwloc 2.9.0 h51c2c0f_0 conda-forge libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libprotobuf 3.21.12 h12be248_0 conda-forge libsqlite 3.40.0 hcfcfb64_0 conda-forge libssh2 1.10.0 h9a1e1f7_3 conda-forge libthrift 0.18.1 h9ce19ad_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libxml2 2.10.3 hc3477c8_6 conda-forge libzlib 1.2.13 hcfcfb64_4 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge multidict 6.0.4 py311ha68e1ae_0 conda-forge multiprocess 0.70.14 py311ha68e1ae_3 conda-forge numpy 1.24.2 py311h0b4df5a_0 conda-forge openssl 3.1.0 hcfcfb64_0 conda-forge orc 1.8.3 hada7b9e_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 2.0.0 py311hf63dbb6_0 conda-forge parquet-cpp 1.5.1 2 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pyarrow 11.0.0 py311h6a6099b_13_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.11.3 h2628c8c_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python-xxhash 3.2.0 py311ha68e1ae_0 conda-forge python_abi 3.11 3_cp311 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py311ha68e1ae_5 conda-forge re2 2023.02.02 h63175ca_0 conda-forge requests 2.28.2 pyhd8ed1ab_1 conda-forge setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge tbb 2021.8.0 h91493d7_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vc 14.3 hb6edc58_10 conda-forge vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xxhash 0.8.1 hcfcfb64_0 conda-forge xz 5.2.10 h8cc25b3_1 yaml 0.2.5 h8ffe710_2 conda-forge yarl 1.8.2 py311ha68e1ae_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hcfcfb64_4 conda-forge zstd 1.5.4 hd43e919_0 ```
16
load_dataset fails with FileNotFound error on Windows ### Describe the bug Although I can import and run the datasets library in a Colab environment, I cannot successfully load any data on my own machine (Windows 10) despite following the install steps: (1) create conda environment (2) activate environment (3) install with: ``conda` install -c huggingface -c conda-forge datasets` Then ``` from datasets import load_dataset # this or any other example from the website fails with the FileNotFoundError glue = load_dataset("glue", "ax") ``` **Below I have pasted the error omitting the full path**: ``` raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at C:\Users\...\glue\glue.py or any data file in the same directory. Couldn't find 'glue' on the Hugging Face Hub either: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` ### Steps to reproduce the bug On Windows 10 1) create a minimal conda environment (with just Python) (2) activate environment (3) install datasets with: ``conda` install -c huggingface -c conda-forge datasets` (4) import load_dataset and follow example usage from any dataset card. ### Expected behavior The expected behavior is to load the file into the Python session running on my machine without error. ### Environment info ``` # Name Version Build Channel aiohttp 3.8.4 py311ha68e1ae_0 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 h57928b3_13_cpu conda-forge async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h1262f0c_1 conda-forge aws-c-cal 0.5.21 h7cda486_2 conda-forge aws-c-common 0.8.14 hcfcfb64_0 conda-forge aws-c-compression 0.2.16 h8a79959_5 conda-forge aws-c-event-stream 0.2.20 h5f78564_4 conda-forge aws-c-http 0.7.6 h2545be9_0 conda-forge aws-c-io 0.13.19 h0d2781e_3 conda-forge aws-c-mqtt 0.8.6 hd211e0c_12 conda-forge aws-c-s3 0.2.7 h8113e7b_1 conda-forge aws-c-sdkutils 0.1.8 h8a79959_0 conda-forge aws-checksums 0.1.14 h8a79959_5 conda-forge aws-crt-cpp 0.19.8 he6d3b81_12 conda-forge aws-sdk-cpp 1.10.57 h64004b3_8 conda-forge brotlipy 0.7.0 py311ha68e1ae_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.0 h2bbff1b_0 ca-certificates 2023.01.10 haa95532_0 certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py311h7d9ee11_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge cryptography 40.0.1 py311h28e9c30_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge datasets 2.11.0 py_0 huggingface dill 0.3.6 pyhd8ed1ab_1 conda-forge filelock 3.11.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 py311ha68e1ae_0 conda-forge fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gflags 2.2.2 ha925a31_1004 conda-forge glog 0.6.0 h4797de2_0 conda-forge huggingface_hub 0.13.4 py_0 huggingface idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.3.0 pyha770c72_0 conda-forge importlib_metadata 6.3.0 hd8ed1ab_0 conda-forge intel-openmp 2023.0.0 h57928b3_25922 conda-forge krb5 1.20.1 heb0366b_0 conda-forge libabseil 20230125.0 cxx17_h63175ca_1 conda-forge libarrow 11.0.0 h04c43f8_13_cpu conda-forge libblas 3.9.0 16_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 7.88.1 h68f0423_1 conda-forge libexpat 2.5.0 h63175ca_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgoogle-cloud 2.8.0 hf2ff781_1 conda-forge libgrpc 1.52.1 h32da247_1 conda-forge libhwloc 2.9.0 h51c2c0f_0 conda-forge libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libprotobuf 3.21.12 h12be248_0 conda-forge libsqlite 3.40.0 hcfcfb64_0 conda-forge libssh2 1.10.0 h9a1e1f7_3 conda-forge libthrift 0.18.1 h9ce19ad_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libxml2 2.10.3 hc3477c8_6 conda-forge libzlib 1.2.13 hcfcfb64_4 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge multidict 6.0.4 py311ha68e1ae_0 conda-forge multiprocess 0.70.14 py311ha68e1ae_3 conda-forge numpy 1.24.2 py311h0b4df5a_0 conda-forge openssl 3.1.0 hcfcfb64_0 conda-forge orc 1.8.3 hada7b9e_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 2.0.0 py311hf63dbb6_0 conda-forge parquet-cpp 1.5.1 2 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pyarrow 11.0.0 py311h6a6099b_13_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.11.3 h2628c8c_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python-xxhash 3.2.0 py311ha68e1ae_0 conda-forge python_abi 3.11 3_cp311 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py311ha68e1ae_5 conda-forge re2 2023.02.02 h63175ca_0 conda-forge requests 2.28.2 pyhd8ed1ab_1 conda-forge setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge tbb 2021.8.0 h91493d7_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vc 14.3 hb6edc58_10 conda-forge vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xxhash 0.8.1 hcfcfb64_0 conda-forge xz 5.2.10 h8cc25b3_1 yaml 0.2.5 h8ffe710_2 conda-forge yarl 1.8.2 py311ha68e1ae_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hcfcfb64_4 conda-forge zstd 1.5.4 hd43e919_0 ``` Hi! Can you please paste the entire error stack trace, not only the last few lines?
[ -0.3879677355289459, 0.18758141994476318, 0.05123184621334076, 0.42170268297195435, 0.19768838584423065, -0.07411590218544006, 0.5527178049087524, -0.004699838347733021, 0.19371165335178375, 0.09788034856319427, -0.30041980743408203, 0.22086188197135925, 0.14651095867156982, 0.14062747359275818, 0.03509782254695892, 0.30380600690841675, 0.15988682210445404, 0.21777169406414032, -0.3586679995059967, 0.11120344698429108, -0.21535220742225647, 0.32706063985824585, -0.23583969473838806, -0.1202637180685997, -0.3825327754020691, -0.0767209380865097, -0.28155335783958435, 0.4898375868797302, 0.1363457441329956, -0.08442122489213943, 0.46854355931282043, -0.2006296068429947, 0.33095598220825195, 0.6874110102653503, -0.0001254488161066547, 0.2031727135181427, 0.15570518374443054, -0.1081341952085495, -0.14925870299339294, -0.3570093810558319, -0.3685101866722107, -0.04166372865438461, 0.009343694895505905, -0.02673400193452835, -0.09355383366346359, 0.23825427889823914, -0.024698223918676376, -0.26375702023506165, 0.30661720037460327, 0.37968340516090393, 0.07814016938209534, 0.388899564743042, 0.025482982397079468, -0.12291114032268524, -0.11561558395624161, 0.2748335003852844, -0.14287632703781128, 0.4854786992073059, 0.006878199055790901, -0.4584047794342041, 0.14315193891525269, 0.12298545241355896, -0.2567823827266693, -0.02708842046558857, 0.24705959856510162, 0.11006786674261093, -0.12477125227451324, -0.4088101387023926, 0.20822614431381226, 0.24473822116851807, 0.3895775079727173, -0.33145108819007874, -0.4548035264015198, -0.2526886761188507, 0.015370063483715057, 0.062361106276512146, 0.3428559899330139, 0.09167592972517014, -0.029859308153390884, 0.26692143082618713, 0.05909949168562889, 0.023670636117458344, -0.16981090605258942, 0.06861638277769089, 0.012545086443424225, 0.10885100066661835, -0.17828083038330078, -0.0416208878159523, 0.04481600224971771, 0.023354802280664444, -0.12334100902080536, -0.08988436311483383, -0.17981871962547302, 0.21414020657539368, -0.3870077431201935, 0.19284828007221222, -0.04536683112382889, 0.36705482006073, 0.08951197564601898, 0.14513801038265228, 0.11351579427719116, -0.15492050349712372, 0.053442712873220444, 0.17245420813560486, 0.04168998450040817, 0.30133891105651855, 0.20583069324493408, -0.050293684005737305, 0.36916232109069824, 0.14758038520812988, -0.01586288958787918, -0.08924759924411774, -0.42458322644233704, -0.4093393385410309, -0.3099672198295593, -0.09935857355594635, 0.32880067825317383, -0.30570605397224426, -0.6840298771858215, -0.09978872537612915, -0.02741975337266922, 0.1548779010772705, 0.18282450735569, 0.45229053497314453, -0.09441721439361572, -0.0959889218211174, 0.030866965651512146, 0.18681974709033966, -0.10251620411872864, 0.06258086860179901, -0.06447713077068329, 0.039365798234939575, -0.31831642985343933, 0.13559961318969727, 0.39468318223953247, -0.5393505692481995, 0.4305758774280548, -0.10967184603214264, 0.12411131709814072, -0.006534278392791748, -0.17457614839076996, -0.07104457914829254, -0.05967140942811966, 0.4126858711242676, 0.09736816585063934, 0.10581792891025543, 0.17486408352851868, -0.3779394030570984, -0.10551275312900543, 0.16178789734840393, -0.23339197039604187, -0.18633100390434265, -0.22412358224391937, -0.053163882344961166, -0.5089563727378845, 0.05033690854907036, -0.08228111267089844, -0.12103690207004547, -0.02406645566225052, -0.15495729446411133, 0.023831874132156372, 0.06771104782819748, -0.25709038972854614, -0.2063068151473999, 0.543027937412262, 0.9723425507545471, -0.5055948495864868, -0.10888035595417023, 0.015244320034980774, -0.30690667033195496, -0.17362970113754272, 0.16560527682304382, 0.09897378087043762, 0.15638037025928497, -0.4427308142185211, 0.03821103274822235, 0.11990556120872498, -0.5231414437294006, -0.49766889214515686, 0.1924286037683487, -0.10411068797111511, 0.36267638206481934, 0.17425337433815002, -0.09047771990299225, 0.13850638270378113, 0.0006503313779830933, 0.42845141887664795, 0.04665564373135567, 0.13186483085155487, -0.1433938443660736, -0.22751986980438232, -0.3045596480369568, 0.26548051834106445, 0.229593887925148, -0.05539478361606598, 0.07499675452709198, 0.3964642286300659, -0.22716006636619568, 0.12638255953788757, 0.012139868922531605, -0.13301058113574982, 0.3201207220554352, 0.37740278244018555, -0.047425441443920135, 0.03601593151688576, -0.029874302446842194, -0.4675552546977997, 0.34963488578796387, 0.09137876331806183, 0.15816658735275269, -0.012686211615800858, -0.0001310408115386963, -0.07535111159086227, 0.09149327129125595, -0.33840465545654297, -0.38328680396080017, -0.027112606912851334, -0.0544758215546608, 0.19378447532653809, 0.11014771461486816, -0.18817101418972015, 1.1329448223114014, -0.06986448913812637, 0.14777261018753052, -0.2528728246688843, 0.12899503111839294, -0.010056581348180771, -0.20101627707481384, -0.0276603102684021, 0.2839164435863495, 0.12412412464618683, -0.22039246559143066, 0.05383545160293579, 0.3130943775177002, 0.02695309743285179, 0.012325868010520935, -0.14554914832115173, -0.10257658362388611, 0.23414276540279388, -0.013305321335792542, 0.04829418659210205, -0.052109941840171814, 0.13255076110363007, 0.03106251358985901, 0.058873288333415985, 0.1516564041376114, -0.30760958790779114, 0.34042301774024963, -0.02095450460910797, 0.05591844022274017, 0.2166593074798584, -0.0562162809073925, -0.19511669874191284, -0.15355558693408966, 0.3848344385623932, 0.1257886439561844, 0.5380015969276428, 0.14553995430469513, -0.08120851218700409, -0.05169176682829857, -0.09109977632761002, 0.021122246980667114, -0.0039281342178583145, 0.06437341868877411, -0.4012717306613922, 0.20902055501937866, 0.37838566303253174, 0.1954185664653778, 0.7172749042510986, 0.1042991504073143, -0.19463807344436646, 0.1601322889328003, -0.1884366124868393, -0.03767590597271919, 0.12602588534355164, 0.061949096620082855, 0.32128816843032837, 0.28619104623794556, -0.15108884871006012, 0.2813449501991272, -0.16339467465877533, -0.42021310329437256, -0.13706707954406738, 0.023833276703953743, -0.5764752626419067, 0.06704980134963989, -0.22694921493530273, -0.24448162317276, -0.1390063464641571, -0.2018553465604782, -0.16523399949073792, 0.12370195984840393, -0.3439350724220276, 0.27794164419174194, 0.13144348561763763, 0.08747002482414246, -0.22930023074150085, 0.23028117418289185, -0.2618771493434906, -0.47284674644470215, -0.30413323640823364, 0.10117234289646149, -0.19719475507736206, -0.08577315509319305, 0.45230796933174133, 0.10378759354352951, 0.0965571254491806, -0.3601776957511902, 0.26134249567985535, -0.004114851355552673, -0.27946552634239197, 0.07155323773622513, -0.058361947536468506, 0.7041265368461609, 0.09103987365961075, 0.08488371968269348, -0.06839126348495483, -0.3301519453525543, 0.24169766902923584, 0.0853327214717865, -0.15536116063594818, -0.027290649712085724, -0.020327646285295486, -0.35331234335899353, -0.1691187620162964, -0.10118768364191055, -0.29052016139030457, -0.26927104592323303, 0.1887524425983429, -0.03608326241374016, 0.03977344185113907, 0.2660325765609741, 0.16826315224170685, 0.28803551197052, -0.046422380954027176, 0.10368769615888596, 0.10415956377983093, -0.32975253462791443, 0.44341346621513367, -0.22681406140327454, -0.2616613805294037, 0.3359682559967041, 0.06661640107631683, 0.19632674753665924, 0.0815836489200592, -0.31320732831954956, -0.13808000087738037, -0.020563503727316856, 0.14182648062705994, 0.0728520005941391, 0.08388325572013855, 0.3294954001903534, 0.05455174669623375, 0.1796826273202896, -0.12252756208181381, -0.3921624422073364, 0.10320517420768738, -0.03426164388656616, 0.13293524086475372, -0.013179918751120567, 0.23442398011684418, -0.10966147482395172, 0.22002390027046204, 0.3693098723888397, -0.02536698617041111, 0.33701175451278687, -0.004081416875123978, 0.6679177284240723, -0.058820758014917374, -0.4264782667160034, 0.03997867926955223, -0.0014597252011299133, -0.04317626729607582, 0.15493245422840118, 0.15827777981758118, 0.11656985431909561, -0.4776495397090912, -0.36069542169570923, -0.3274945020675659, -0.13109666109085083, -0.14430606365203857, -0.1041240394115448, 0.030815213918685913, 0.1273556798696518, 0.13528552651405334, 0.1022256463766098, -0.049522943794727325, 0.17239892482757568, 0.6753770112991333, 0.01269933208823204, 0.13271266222000122, -0.04389367252588272, -0.298112154006958, -0.476252019405365, 0.1508491039276123, -0.006991304457187653, 0.37924182415008545, -0.19209842383861542, -0.07002837210893631, -0.1376647651195526, -0.13387927412986755, 0.8707390427589417, 0.033620648086071014, -0.1969289779663086, 0.07875081896781921, 0.06171782314777374, -0.368963360786438, -0.1437632143497467, 0.08531558513641357, -0.0045775435864925385, 0.1745966225862503, 0.5065863132476807, 0.05283781886100769, -0.1857362985610962, 0.020823080092668533, 0.2965545654296875, -0.04944034665822983, -0.03282364830374718, -0.4722517132759094, -0.39811813831329346, -0.23699072003364563, -0.12170848250389099, -0.0970756784081459, 0.16192671656608582, 0.10071302205324173, 0.08230344951152802, -0.32545262575149536, -0.10032771527767181, 0.2449624240398407, 0.3604978322982788, 0.4184076189994812, -0.16995760798454285, 0.44625145196914673, 0.23593972623348236, 0.40666234493255615, 0.08763359487056732, 0.6137474775314331, -0.11499954760074615, -0.47524791955947876, -0.04034353047609329, -0.168064147233963, 0.25027668476104736, 0.20802079141139984, -0.19807875156402588, -0.30305901169776917, -0.16699445247650146, -0.06277896463871002, -0.18549975752830505, 0.11973837018013, 0.01361776888370514, 0.13804396986961365, -0.3530270755290985, -0.01799948886036873, 0.2357826679944992, -0.026605665683746338, -0.05624628812074661, 0.5670340657234192, 0.3549930155277252, -0.22548845410346985, 0.22741058468818665, -0.08783484995365143, 0.8264728784561157, 0.02232908084988594, 0.17566540837287903, 0.2525716722011566, -0.16025418043136597, 0.38260728120803833, 0.06566714495420456, 0.04016222804784775, -0.24515673518180847, -0.39916545152664185, -0.046516209840774536, -0.12346421927213669, 0.39480680227279663, 0.07595705986022949, -0.04768030345439911, 0.30056020617485046, 0.324509859085083, 0.059398308396339417, 0.18191400170326233, -0.030049502849578857, -0.01712575927376747, -0.3353268802165985, -0.1622340828180313, -0.000046562403440475464, 0.16598938405513763, 0.5182424187660217, -0.1803646683692932, 0.08342887461185455, -0.30731305480003357, -0.12873190641403198, -0.3514671325683594, 0.32329514622688293, -0.6555185914039612, -0.044800806790590286, 0.16223448514938354, -0.3461204767227173, 0.181907057762146, 0.5296038389205933, 0.35516923666000366, 0.057707782834768295, -0.321941614151001, 0.05352967977523804, -0.06211652606725693, -0.049542877823114395, 0.21228104829788208, -0.15655207633972168, 0.13531215488910675, -0.059218257665634155, -0.2665109634399414, -0.2743687331676483, -0.2685554325580597, -0.113674096763134, 0.18372146785259247, 0.18398791551589966, -0.12391318380832672, 0.005219645798206329, -0.21984922885894775, 0.18367822468280792, 0.33515864610671997, -0.05452911555767059, 0.02914878912270069, 0.04351969435811043, 0.14614436030387878, 0.35663506388664246, -0.28712019324302673, -0.3939468264579773, -0.1502240151166916, 0.4942437410354614, -0.6599584817886353, -0.11975759267807007, 0.2806941270828247, 0.02293097972869873, -0.20103782415390015, -0.1017734557390213, 0.10952604562044144, -0.15014952421188354, -0.2743409276008606, -0.29886025190353394, 0.2024552971124649, 0.08271367847919464, -0.03134842589497566, 0.15653909742832184, 0.19207078218460083, -0.31917697191238403, 0.11975343525409698, -0.5545750260353088, -0.11344528198242188, 0.23260259628295898, 0.0460125207901001, 0.06191117316484451, 0.2509980797767639, 0.014893509447574615, 0.16338026523590088, -0.2886626720428467, -0.13063688576221466, 0.029717281460762024, 0.06773500889539719, -0.14801527559757233, 0.3591747581958771, 0.25342172384262085, 0.4432922601699829, -0.1456443816423416, -0.012194540351629257, 0.11793197691440582, 0.140736386179924, -0.08516401797533035, -0.20259732007980347, 0.16877761483192444, 0.07509200274944305, -0.12174087762832642, 0.04260597005486488, -0.206929013133049, -0.10882501304149628, -0.19286642968654633, 0.365196168422699, 0.3526642322540283, -0.06465117633342743, -0.024346351623535156, -0.2783128619194031, 0.34845834970474243, -0.3299928307533264, 0.3057105839252472, -0.05514901131391525, 0.123806893825531, 0.09819702059030533, 0.03979629650712013, -0.091703400015831, 0.11196683347225189, 0.09827086329460144, 0.03510905057191849, -0.18514981865882874, 0.10713327676057816, 0.0666813999414444, -0.32118991017341614, 0.09153195470571518, -0.0772300660610199, 0.040182389318943024, 0.33566367626190186, -0.10149998962879181, 0.2026440054178238, 0.5041483640670776, 0.04149576649069786, -0.29953911900520325, -0.029944393783807755, 0.09668873250484467, -0.08678139746189117, 0.06653494387865067, 0.28507527709007263, -0.0472281277179718, -0.16564184427261353, 0.24516208469867706, -0.0013151243329048157, 0.5144760012626648, 0.1382121592760086, 0.06468262523412704, 0.39389410614967346, 0.08161251246929169, 0.36484822630882263, 0.06475600600242615, 0.19093173742294312, 0.1447916477918625, 0.49049320816993713, -0.30001717805862427, 0.08132913708686829, -0.29199978709220886, 0.3566189110279083, -0.1798589825630188, -0.5375994443893433, 0.006189723499119282, -0.061403773725032806, 0.05437001958489418, -0.10131008923053741, -0.27779266238212585, 0.58739173412323, -0.5672663450241089, -0.005808480083942413, -0.17487667500972748, -0.16757725179195404, -0.10241255909204483, 0.05681254714727402, -0.06380244344472885, -0.1142343059182167, 0.1847100853919983, 0.030116446316242218, 0.11489811539649963, -0.3186764121055603, 0.144863560795784, 0.06029787287116051, -0.24604469537734985, -0.10862825065851212, -0.03801930695772171, 0.36461347341537476, -0.20223860442638397, 0.02725289762020111, 0.2926296293735504, 0.07568103820085526, 0.05395149067044258, -0.01140656415373087, 0.2525708079338074, 0.5550550222396851, 0.4139595031738281, 0.06872428953647614, -0.07714109122753143, -0.019781915470957756, -0.01805959641933441, -0.12490090727806091, 0.2800410985946655, -0.17293690145015717, 0.010233508422970772, 0.1875845193862915, 0.07390419393777847, -0.05682346224784851, 0.06131540611386299, 0.08717446774244308, 0.031871601939201355, -0.12019246816635132, 0.3171650767326355, -0.41485583782196045, -0.1140800416469574, 0.0005650678649544716, 0.05260971933603287, -0.16590623557567596, 0.1885589063167572, 0.30004042387008667, -0.14612694084644318, 0.03576107323169708, 0.03979383409023285, -0.006127204746007919, 0.09155647456645966, 0.20618174970149994, 0.34974244236946106, 0.28717610239982605, -0.29129138588905334, -0.18771034479141235, -0.8037235140800476, 0.10124244540929794, 0.11516004055738449, 0.01933145523071289, -0.26517340540885925, -0.012371990829706192, -0.20945604145526886, 0.027437712997198105, 0.14871878921985626, 0.09313614666461945, 0.2298571765422821, -0.03323317691683769, -0.26606667041778564, 0.017602737993001938, -0.3478926420211792, 0.09561890363693237, -0.04375382140278816, -0.5232312679290771, 0.05444954335689545, -0.0766494870185852, -0.13166283071041107, -0.03335130587220192, 0.04434632509946823, -0.09965871274471283, -0.23502524197101593, 0.5389212369918823, -0.18840686976909637, 0.31156307458877563, 0.0738106369972229, 0.042947329580783844, -0.32460278272628784, -0.07947160303592682, -0.05447733774781227, 0.1909618377685547, 0.08161667734384537, -0.006169430911540985, -0.27252769470214844, -0.12208868563175201, -0.13689610362052917, 0.0858042985200882, 0.2753128111362457, 0.3507288992404938, -0.22281381487846375, 0.1735409051179886, -0.05445288121700287, 0.07944051176309586, 0.1187952309846878, 0.08746273815631866, -0.22257071733474731, 0.10859274119138718, -0.27581506967544556, -0.006187267601490021, 0.23820792138576508, -0.6456096768379211, -0.009315073490142822, -0.012132450938224792, 0.28547266125679016, -0.10395637154579163, -0.2440807819366455, -0.41580334305763245, 0.051099926233291626, 0.2085702121257782, 0.061840545386075974, -0.34478121995925903, 0.15918904542922974, -0.16795852780342102, -0.012362353503704071, -0.06711175292730331, 0.19907328486442566, -0.07120916247367859, -0.1283745914697647, 0.18157324194908142, -0.11862105131149292 ]
https://github.com/huggingface/datasets/issues/5727
`----> 1 dataset = datasets.load_dataset("glue", "ax") File ~\anaconda3\envs\huggingface\Lib\site-packages\datasets\load.py:1767, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1762 verification_mode = VerificationMode( 1763 (verification_mode or VerificationMode.BASIC_CHECKS) if not save_infos else VerificationMode.ALL_CHECKS 1764 ) 1766 # Create a dataset builder -> 1767 builder_instance = load_dataset_builder( 1768 path=path, 1769 name=name, 1770 data_dir=data_dir, 1771 data_files=data_files, 1772 cache_dir=cache_dir, 1773 features=features, 1774 download_config=download_config, 1775 download_mode=download_mode, 1776 revision=revision, 1777 use_auth_token=use_auth_token, 1778 storage_options=storage_options, 1779 **config_kwargs, 1780 ) 1782 # Return iterable dataset in case of streaming 1783 if streaming: File ~\anaconda3\envs\huggingface\Lib\site-packages\datasets\load.py:1498, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, storage_options, **config_kwargs) 1496 download_config = download_config.copy() if download_config else DownloadConfig() 1497 download_config.use_auth_token = use_auth_token -> 1498 dataset_module = dataset_module_factory( 1499 path, 1500 revision=revision, 1501 download_config=download_config, 1502 download_mode=download_mode, 1503 data_dir=data_dir, 1504 data_files=data_files, 1505 ) 1507 # Get dataset builder class from the processing script 1508 builder_cls = import_main_class(dataset_module.module_path) File ~\anaconda3\envs\huggingface\Lib\site-packages\datasets\load.py:1211, in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1209 raise e1 from None 1210 if isinstance(e1, FileNotFoundError): -> 1211 raise FileNotFoundError( 1212 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1213 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1214 ) from None 1215 raise e1 from None 1216 else:`
load_dataset fails with FileNotFound error on Windows
### Describe the bug Although I can import and run the datasets library in a Colab environment, I cannot successfully load any data on my own machine (Windows 10) despite following the install steps: (1) create conda environment (2) activate environment (3) install with: ``conda` install -c huggingface -c conda-forge datasets` Then ``` from datasets import load_dataset # this or any other example from the website fails with the FileNotFoundError glue = load_dataset("glue", "ax") ``` **Below I have pasted the error omitting the full path**: ``` raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at C:\Users\...\glue\glue.py or any data file in the same directory. Couldn't find 'glue' on the Hugging Face Hub either: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` ### Steps to reproduce the bug On Windows 10 1) create a minimal conda environment (with just Python) (2) activate environment (3) install datasets with: ``conda` install -c huggingface -c conda-forge datasets` (4) import load_dataset and follow example usage from any dataset card. ### Expected behavior The expected behavior is to load the file into the Python session running on my machine without error. ### Environment info ``` # Name Version Build Channel aiohttp 3.8.4 py311ha68e1ae_0 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 h57928b3_13_cpu conda-forge async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h1262f0c_1 conda-forge aws-c-cal 0.5.21 h7cda486_2 conda-forge aws-c-common 0.8.14 hcfcfb64_0 conda-forge aws-c-compression 0.2.16 h8a79959_5 conda-forge aws-c-event-stream 0.2.20 h5f78564_4 conda-forge aws-c-http 0.7.6 h2545be9_0 conda-forge aws-c-io 0.13.19 h0d2781e_3 conda-forge aws-c-mqtt 0.8.6 hd211e0c_12 conda-forge aws-c-s3 0.2.7 h8113e7b_1 conda-forge aws-c-sdkutils 0.1.8 h8a79959_0 conda-forge aws-checksums 0.1.14 h8a79959_5 conda-forge aws-crt-cpp 0.19.8 he6d3b81_12 conda-forge aws-sdk-cpp 1.10.57 h64004b3_8 conda-forge brotlipy 0.7.0 py311ha68e1ae_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.0 h2bbff1b_0 ca-certificates 2023.01.10 haa95532_0 certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py311h7d9ee11_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge cryptography 40.0.1 py311h28e9c30_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge datasets 2.11.0 py_0 huggingface dill 0.3.6 pyhd8ed1ab_1 conda-forge filelock 3.11.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 py311ha68e1ae_0 conda-forge fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gflags 2.2.2 ha925a31_1004 conda-forge glog 0.6.0 h4797de2_0 conda-forge huggingface_hub 0.13.4 py_0 huggingface idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.3.0 pyha770c72_0 conda-forge importlib_metadata 6.3.0 hd8ed1ab_0 conda-forge intel-openmp 2023.0.0 h57928b3_25922 conda-forge krb5 1.20.1 heb0366b_0 conda-forge libabseil 20230125.0 cxx17_h63175ca_1 conda-forge libarrow 11.0.0 h04c43f8_13_cpu conda-forge libblas 3.9.0 16_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 7.88.1 h68f0423_1 conda-forge libexpat 2.5.0 h63175ca_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgoogle-cloud 2.8.0 hf2ff781_1 conda-forge libgrpc 1.52.1 h32da247_1 conda-forge libhwloc 2.9.0 h51c2c0f_0 conda-forge libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libprotobuf 3.21.12 h12be248_0 conda-forge libsqlite 3.40.0 hcfcfb64_0 conda-forge libssh2 1.10.0 h9a1e1f7_3 conda-forge libthrift 0.18.1 h9ce19ad_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libxml2 2.10.3 hc3477c8_6 conda-forge libzlib 1.2.13 hcfcfb64_4 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge multidict 6.0.4 py311ha68e1ae_0 conda-forge multiprocess 0.70.14 py311ha68e1ae_3 conda-forge numpy 1.24.2 py311h0b4df5a_0 conda-forge openssl 3.1.0 hcfcfb64_0 conda-forge orc 1.8.3 hada7b9e_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 2.0.0 py311hf63dbb6_0 conda-forge parquet-cpp 1.5.1 2 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pyarrow 11.0.0 py311h6a6099b_13_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.11.3 h2628c8c_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python-xxhash 3.2.0 py311ha68e1ae_0 conda-forge python_abi 3.11 3_cp311 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py311ha68e1ae_5 conda-forge re2 2023.02.02 h63175ca_0 conda-forge requests 2.28.2 pyhd8ed1ab_1 conda-forge setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge tbb 2021.8.0 h91493d7_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vc 14.3 hb6edc58_10 conda-forge vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xxhash 0.8.1 hcfcfb64_0 conda-forge xz 5.2.10 h8cc25b3_1 yaml 0.2.5 h8ffe710_2 conda-forge yarl 1.8.2 py311ha68e1ae_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hcfcfb64_4 conda-forge zstd 1.5.4 hd43e919_0 ```
217
load_dataset fails with FileNotFound error on Windows ### Describe the bug Although I can import and run the datasets library in a Colab environment, I cannot successfully load any data on my own machine (Windows 10) despite following the install steps: (1) create conda environment (2) activate environment (3) install with: ``conda` install -c huggingface -c conda-forge datasets` Then ``` from datasets import load_dataset # this or any other example from the website fails with the FileNotFoundError glue = load_dataset("glue", "ax") ``` **Below I have pasted the error omitting the full path**: ``` raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at C:\Users\...\glue\glue.py or any data file in the same directory. Couldn't find 'glue' on the Hugging Face Hub either: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` ### Steps to reproduce the bug On Windows 10 1) create a minimal conda environment (with just Python) (2) activate environment (3) install datasets with: ``conda` install -c huggingface -c conda-forge datasets` (4) import load_dataset and follow example usage from any dataset card. ### Expected behavior The expected behavior is to load the file into the Python session running on my machine without error. ### Environment info ``` # Name Version Build Channel aiohttp 3.8.4 py311ha68e1ae_0 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 h57928b3_13_cpu conda-forge async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h1262f0c_1 conda-forge aws-c-cal 0.5.21 h7cda486_2 conda-forge aws-c-common 0.8.14 hcfcfb64_0 conda-forge aws-c-compression 0.2.16 h8a79959_5 conda-forge aws-c-event-stream 0.2.20 h5f78564_4 conda-forge aws-c-http 0.7.6 h2545be9_0 conda-forge aws-c-io 0.13.19 h0d2781e_3 conda-forge aws-c-mqtt 0.8.6 hd211e0c_12 conda-forge aws-c-s3 0.2.7 h8113e7b_1 conda-forge aws-c-sdkutils 0.1.8 h8a79959_0 conda-forge aws-checksums 0.1.14 h8a79959_5 conda-forge aws-crt-cpp 0.19.8 he6d3b81_12 conda-forge aws-sdk-cpp 1.10.57 h64004b3_8 conda-forge brotlipy 0.7.0 py311ha68e1ae_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.0 h2bbff1b_0 ca-certificates 2023.01.10 haa95532_0 certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py311h7d9ee11_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge cryptography 40.0.1 py311h28e9c30_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge datasets 2.11.0 py_0 huggingface dill 0.3.6 pyhd8ed1ab_1 conda-forge filelock 3.11.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 py311ha68e1ae_0 conda-forge fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gflags 2.2.2 ha925a31_1004 conda-forge glog 0.6.0 h4797de2_0 conda-forge huggingface_hub 0.13.4 py_0 huggingface idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.3.0 pyha770c72_0 conda-forge importlib_metadata 6.3.0 hd8ed1ab_0 conda-forge intel-openmp 2023.0.0 h57928b3_25922 conda-forge krb5 1.20.1 heb0366b_0 conda-forge libabseil 20230125.0 cxx17_h63175ca_1 conda-forge libarrow 11.0.0 h04c43f8_13_cpu conda-forge libblas 3.9.0 16_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 7.88.1 h68f0423_1 conda-forge libexpat 2.5.0 h63175ca_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgoogle-cloud 2.8.0 hf2ff781_1 conda-forge libgrpc 1.52.1 h32da247_1 conda-forge libhwloc 2.9.0 h51c2c0f_0 conda-forge libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libprotobuf 3.21.12 h12be248_0 conda-forge libsqlite 3.40.0 hcfcfb64_0 conda-forge libssh2 1.10.0 h9a1e1f7_3 conda-forge libthrift 0.18.1 h9ce19ad_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libxml2 2.10.3 hc3477c8_6 conda-forge libzlib 1.2.13 hcfcfb64_4 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge multidict 6.0.4 py311ha68e1ae_0 conda-forge multiprocess 0.70.14 py311ha68e1ae_3 conda-forge numpy 1.24.2 py311h0b4df5a_0 conda-forge openssl 3.1.0 hcfcfb64_0 conda-forge orc 1.8.3 hada7b9e_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 2.0.0 py311hf63dbb6_0 conda-forge parquet-cpp 1.5.1 2 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pyarrow 11.0.0 py311h6a6099b_13_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.11.3 h2628c8c_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python-xxhash 3.2.0 py311ha68e1ae_0 conda-forge python_abi 3.11 3_cp311 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py311ha68e1ae_5 conda-forge re2 2023.02.02 h63175ca_0 conda-forge requests 2.28.2 pyhd8ed1ab_1 conda-forge setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge tbb 2021.8.0 h91493d7_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vc 14.3 hb6edc58_10 conda-forge vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xxhash 0.8.1 hcfcfb64_0 conda-forge xz 5.2.10 h8cc25b3_1 yaml 0.2.5 h8ffe710_2 conda-forge yarl 1.8.2 py311ha68e1ae_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hcfcfb64_4 conda-forge zstd 1.5.4 hd43e919_0 ``` `----> 1 dataset = datasets.load_dataset("glue", "ax") File ~\anaconda3\envs\huggingface\Lib\site-packages\datasets\load.py:1767, in load_dataset(path, name, data_dir, data_files, split, cache_dir, features, download_config, download_mode, verification_mode, ignore_verifications, keep_in_memory, save_infos, revision, use_auth_token, task, streaming, num_proc, storage_options, **config_kwargs) 1762 verification_mode = VerificationMode( 1763 (verification_mode or VerificationMode.BASIC_CHECKS) if not save_infos else VerificationMode.ALL_CHECKS 1764 ) 1766 # Create a dataset builder -> 1767 builder_instance = load_dataset_builder( 1768 path=path, 1769 name=name, 1770 data_dir=data_dir, 1771 data_files=data_files, 1772 cache_dir=cache_dir, 1773 features=features, 1774 download_config=download_config, 1775 download_mode=download_mode, 1776 revision=revision, 1777 use_auth_token=use_auth_token, 1778 storage_options=storage_options, 1779 **config_kwargs, 1780 ) 1782 # Return iterable dataset in case of streaming 1783 if streaming: File ~\anaconda3\envs\huggingface\Lib\site-packages\datasets\load.py:1498, in load_dataset_builder(path, name, data_dir, data_files, cache_dir, features, download_config, download_mode, revision, use_auth_token, storage_options, **config_kwargs) 1496 download_config = download_config.copy() if download_config else DownloadConfig() 1497 download_config.use_auth_token = use_auth_token -> 1498 dataset_module = dataset_module_factory( 1499 path, 1500 revision=revision, 1501 download_config=download_config, 1502 download_mode=download_mode, 1503 data_dir=data_dir, 1504 data_files=data_files, 1505 ) 1507 # Get dataset builder class from the processing script 1508 builder_cls = import_main_class(dataset_module.module_path) File ~\anaconda3\envs\huggingface\Lib\site-packages\datasets\load.py:1211, in dataset_module_factory(path, revision, download_config, download_mode, dynamic_modules_path, data_dir, data_files, **download_kwargs) 1209 raise e1 from None 1210 if isinstance(e1, FileNotFoundError): -> 1211 raise FileNotFoundError( 1212 f"Couldn't find a dataset script at {relative_to_absolute_path(combined_path)} or any data file in the same directory. " 1213 f"Couldn't find '{path}' on the Hugging Face Hub either: {type(e1).__name__}: {e1}" 1214 ) from None 1215 raise e1 from None 1216 else:`
[ -0.3879677355289459, 0.18758141994476318, 0.05123184621334076, 0.42170268297195435, 0.19768838584423065, -0.07411590218544006, 0.5527178049087524, -0.004699838347733021, 0.19371165335178375, 0.09788034856319427, -0.30041980743408203, 0.22086188197135925, 0.14651095867156982, 0.14062747359275818, 0.03509782254695892, 0.30380600690841675, 0.15988682210445404, 0.21777169406414032, -0.3586679995059967, 0.11120344698429108, -0.21535220742225647, 0.32706063985824585, -0.23583969473838806, -0.1202637180685997, -0.3825327754020691, -0.0767209380865097, -0.28155335783958435, 0.4898375868797302, 0.1363457441329956, -0.08442122489213943, 0.46854355931282043, -0.2006296068429947, 0.33095598220825195, 0.6874110102653503, -0.0001254488161066547, 0.2031727135181427, 0.15570518374443054, -0.1081341952085495, -0.14925870299339294, -0.3570093810558319, -0.3685101866722107, -0.04166372865438461, 0.009343694895505905, -0.02673400193452835, -0.09355383366346359, 0.23825427889823914, -0.024698223918676376, -0.26375702023506165, 0.30661720037460327, 0.37968340516090393, 0.07814016938209534, 0.388899564743042, 0.025482982397079468, -0.12291114032268524, -0.11561558395624161, 0.2748335003852844, -0.14287632703781128, 0.4854786992073059, 0.006878199055790901, -0.4584047794342041, 0.14315193891525269, 0.12298545241355896, -0.2567823827266693, -0.02708842046558857, 0.24705959856510162, 0.11006786674261093, -0.12477125227451324, -0.4088101387023926, 0.20822614431381226, 0.24473822116851807, 0.3895775079727173, -0.33145108819007874, -0.4548035264015198, -0.2526886761188507, 0.015370063483715057, 0.062361106276512146, 0.3428559899330139, 0.09167592972517014, -0.029859308153390884, 0.26692143082618713, 0.05909949168562889, 0.023670636117458344, -0.16981090605258942, 0.06861638277769089, 0.012545086443424225, 0.10885100066661835, -0.17828083038330078, -0.0416208878159523, 0.04481600224971771, 0.023354802280664444, -0.12334100902080536, -0.08988436311483383, -0.17981871962547302, 0.21414020657539368, -0.3870077431201935, 0.19284828007221222, -0.04536683112382889, 0.36705482006073, 0.08951197564601898, 0.14513801038265228, 0.11351579427719116, -0.15492050349712372, 0.053442712873220444, 0.17245420813560486, 0.04168998450040817, 0.30133891105651855, 0.20583069324493408, -0.050293684005737305, 0.36916232109069824, 0.14758038520812988, -0.01586288958787918, -0.08924759924411774, -0.42458322644233704, -0.4093393385410309, -0.3099672198295593, -0.09935857355594635, 0.32880067825317383, -0.30570605397224426, -0.6840298771858215, -0.09978872537612915, -0.02741975337266922, 0.1548779010772705, 0.18282450735569, 0.45229053497314453, -0.09441721439361572, -0.0959889218211174, 0.030866965651512146, 0.18681974709033966, -0.10251620411872864, 0.06258086860179901, -0.06447713077068329, 0.039365798234939575, -0.31831642985343933, 0.13559961318969727, 0.39468318223953247, -0.5393505692481995, 0.4305758774280548, -0.10967184603214264, 0.12411131709814072, -0.006534278392791748, -0.17457614839076996, -0.07104457914829254, -0.05967140942811966, 0.4126858711242676, 0.09736816585063934, 0.10581792891025543, 0.17486408352851868, -0.3779394030570984, -0.10551275312900543, 0.16178789734840393, -0.23339197039604187, -0.18633100390434265, -0.22412358224391937, -0.053163882344961166, -0.5089563727378845, 0.05033690854907036, -0.08228111267089844, -0.12103690207004547, -0.02406645566225052, -0.15495729446411133, 0.023831874132156372, 0.06771104782819748, -0.25709038972854614, -0.2063068151473999, 0.543027937412262, 0.9723425507545471, -0.5055948495864868, -0.10888035595417023, 0.015244320034980774, -0.30690667033195496, -0.17362970113754272, 0.16560527682304382, 0.09897378087043762, 0.15638037025928497, -0.4427308142185211, 0.03821103274822235, 0.11990556120872498, -0.5231414437294006, -0.49766889214515686, 0.1924286037683487, -0.10411068797111511, 0.36267638206481934, 0.17425337433815002, -0.09047771990299225, 0.13850638270378113, 0.0006503313779830933, 0.42845141887664795, 0.04665564373135567, 0.13186483085155487, -0.1433938443660736, -0.22751986980438232, -0.3045596480369568, 0.26548051834106445, 0.229593887925148, -0.05539478361606598, 0.07499675452709198, 0.3964642286300659, -0.22716006636619568, 0.12638255953788757, 0.012139868922531605, -0.13301058113574982, 0.3201207220554352, 0.37740278244018555, -0.047425441443920135, 0.03601593151688576, -0.029874302446842194, -0.4675552546977997, 0.34963488578796387, 0.09137876331806183, 0.15816658735275269, -0.012686211615800858, -0.0001310408115386963, -0.07535111159086227, 0.09149327129125595, -0.33840465545654297, -0.38328680396080017, -0.027112606912851334, -0.0544758215546608, 0.19378447532653809, 0.11014771461486816, -0.18817101418972015, 1.1329448223114014, -0.06986448913812637, 0.14777261018753052, -0.2528728246688843, 0.12899503111839294, -0.010056581348180771, -0.20101627707481384, -0.0276603102684021, 0.2839164435863495, 0.12412412464618683, -0.22039246559143066, 0.05383545160293579, 0.3130943775177002, 0.02695309743285179, 0.012325868010520935, -0.14554914832115173, -0.10257658362388611, 0.23414276540279388, -0.013305321335792542, 0.04829418659210205, -0.052109941840171814, 0.13255076110363007, 0.03106251358985901, 0.058873288333415985, 0.1516564041376114, -0.30760958790779114, 0.34042301774024963, -0.02095450460910797, 0.05591844022274017, 0.2166593074798584, -0.0562162809073925, -0.19511669874191284, -0.15355558693408966, 0.3848344385623932, 0.1257886439561844, 0.5380015969276428, 0.14553995430469513, -0.08120851218700409, -0.05169176682829857, -0.09109977632761002, 0.021122246980667114, -0.0039281342178583145, 0.06437341868877411, -0.4012717306613922, 0.20902055501937866, 0.37838566303253174, 0.1954185664653778, 0.7172749042510986, 0.1042991504073143, -0.19463807344436646, 0.1601322889328003, -0.1884366124868393, -0.03767590597271919, 0.12602588534355164, 0.061949096620082855, 0.32128816843032837, 0.28619104623794556, -0.15108884871006012, 0.2813449501991272, -0.16339467465877533, -0.42021310329437256, -0.13706707954406738, 0.023833276703953743, -0.5764752626419067, 0.06704980134963989, -0.22694921493530273, -0.24448162317276, -0.1390063464641571, -0.2018553465604782, -0.16523399949073792, 0.12370195984840393, -0.3439350724220276, 0.27794164419174194, 0.13144348561763763, 0.08747002482414246, -0.22930023074150085, 0.23028117418289185, -0.2618771493434906, -0.47284674644470215, -0.30413323640823364, 0.10117234289646149, -0.19719475507736206, -0.08577315509319305, 0.45230796933174133, 0.10378759354352951, 0.0965571254491806, -0.3601776957511902, 0.26134249567985535, -0.004114851355552673, -0.27946552634239197, 0.07155323773622513, -0.058361947536468506, 0.7041265368461609, 0.09103987365961075, 0.08488371968269348, -0.06839126348495483, -0.3301519453525543, 0.24169766902923584, 0.0853327214717865, -0.15536116063594818, -0.027290649712085724, -0.020327646285295486, -0.35331234335899353, -0.1691187620162964, -0.10118768364191055, -0.29052016139030457, -0.26927104592323303, 0.1887524425983429, -0.03608326241374016, 0.03977344185113907, 0.2660325765609741, 0.16826315224170685, 0.28803551197052, -0.046422380954027176, 0.10368769615888596, 0.10415956377983093, -0.32975253462791443, 0.44341346621513367, -0.22681406140327454, -0.2616613805294037, 0.3359682559967041, 0.06661640107631683, 0.19632674753665924, 0.0815836489200592, -0.31320732831954956, -0.13808000087738037, -0.020563503727316856, 0.14182648062705994, 0.0728520005941391, 0.08388325572013855, 0.3294954001903534, 0.05455174669623375, 0.1796826273202896, -0.12252756208181381, -0.3921624422073364, 0.10320517420768738, -0.03426164388656616, 0.13293524086475372, -0.013179918751120567, 0.23442398011684418, -0.10966147482395172, 0.22002390027046204, 0.3693098723888397, -0.02536698617041111, 0.33701175451278687, -0.004081416875123978, 0.6679177284240723, -0.058820758014917374, -0.4264782667160034, 0.03997867926955223, -0.0014597252011299133, -0.04317626729607582, 0.15493245422840118, 0.15827777981758118, 0.11656985431909561, -0.4776495397090912, -0.36069542169570923, -0.3274945020675659, -0.13109666109085083, -0.14430606365203857, -0.1041240394115448, 0.030815213918685913, 0.1273556798696518, 0.13528552651405334, 0.1022256463766098, -0.049522943794727325, 0.17239892482757568, 0.6753770112991333, 0.01269933208823204, 0.13271266222000122, -0.04389367252588272, -0.298112154006958, -0.476252019405365, 0.1508491039276123, -0.006991304457187653, 0.37924182415008545, -0.19209842383861542, -0.07002837210893631, -0.1376647651195526, -0.13387927412986755, 0.8707390427589417, 0.033620648086071014, -0.1969289779663086, 0.07875081896781921, 0.06171782314777374, -0.368963360786438, -0.1437632143497467, 0.08531558513641357, -0.0045775435864925385, 0.1745966225862503, 0.5065863132476807, 0.05283781886100769, -0.1857362985610962, 0.020823080092668533, 0.2965545654296875, -0.04944034665822983, -0.03282364830374718, -0.4722517132759094, -0.39811813831329346, -0.23699072003364563, -0.12170848250389099, -0.0970756784081459, 0.16192671656608582, 0.10071302205324173, 0.08230344951152802, -0.32545262575149536, -0.10032771527767181, 0.2449624240398407, 0.3604978322982788, 0.4184076189994812, -0.16995760798454285, 0.44625145196914673, 0.23593972623348236, 0.40666234493255615, 0.08763359487056732, 0.6137474775314331, -0.11499954760074615, -0.47524791955947876, -0.04034353047609329, -0.168064147233963, 0.25027668476104736, 0.20802079141139984, -0.19807875156402588, -0.30305901169776917, -0.16699445247650146, -0.06277896463871002, -0.18549975752830505, 0.11973837018013, 0.01361776888370514, 0.13804396986961365, -0.3530270755290985, -0.01799948886036873, 0.2357826679944992, -0.026605665683746338, -0.05624628812074661, 0.5670340657234192, 0.3549930155277252, -0.22548845410346985, 0.22741058468818665, -0.08783484995365143, 0.8264728784561157, 0.02232908084988594, 0.17566540837287903, 0.2525716722011566, -0.16025418043136597, 0.38260728120803833, 0.06566714495420456, 0.04016222804784775, -0.24515673518180847, -0.39916545152664185, -0.046516209840774536, -0.12346421927213669, 0.39480680227279663, 0.07595705986022949, -0.04768030345439911, 0.30056020617485046, 0.324509859085083, 0.059398308396339417, 0.18191400170326233, -0.030049502849578857, -0.01712575927376747, -0.3353268802165985, -0.1622340828180313, -0.000046562403440475464, 0.16598938405513763, 0.5182424187660217, -0.1803646683692932, 0.08342887461185455, -0.30731305480003357, -0.12873190641403198, -0.3514671325683594, 0.32329514622688293, -0.6555185914039612, -0.044800806790590286, 0.16223448514938354, -0.3461204767227173, 0.181907057762146, 0.5296038389205933, 0.35516923666000366, 0.057707782834768295, -0.321941614151001, 0.05352967977523804, -0.06211652606725693, -0.049542877823114395, 0.21228104829788208, -0.15655207633972168, 0.13531215488910675, -0.059218257665634155, -0.2665109634399414, -0.2743687331676483, -0.2685554325580597, -0.113674096763134, 0.18372146785259247, 0.18398791551589966, -0.12391318380832672, 0.005219645798206329, -0.21984922885894775, 0.18367822468280792, 0.33515864610671997, -0.05452911555767059, 0.02914878912270069, 0.04351969435811043, 0.14614436030387878, 0.35663506388664246, -0.28712019324302673, -0.3939468264579773, -0.1502240151166916, 0.4942437410354614, -0.6599584817886353, -0.11975759267807007, 0.2806941270828247, 0.02293097972869873, -0.20103782415390015, -0.1017734557390213, 0.10952604562044144, -0.15014952421188354, -0.2743409276008606, -0.29886025190353394, 0.2024552971124649, 0.08271367847919464, -0.03134842589497566, 0.15653909742832184, 0.19207078218460083, -0.31917697191238403, 0.11975343525409698, -0.5545750260353088, -0.11344528198242188, 0.23260259628295898, 0.0460125207901001, 0.06191117316484451, 0.2509980797767639, 0.014893509447574615, 0.16338026523590088, -0.2886626720428467, -0.13063688576221466, 0.029717281460762024, 0.06773500889539719, -0.14801527559757233, 0.3591747581958771, 0.25342172384262085, 0.4432922601699829, -0.1456443816423416, -0.012194540351629257, 0.11793197691440582, 0.140736386179924, -0.08516401797533035, -0.20259732007980347, 0.16877761483192444, 0.07509200274944305, -0.12174087762832642, 0.04260597005486488, -0.206929013133049, -0.10882501304149628, -0.19286642968654633, 0.365196168422699, 0.3526642322540283, -0.06465117633342743, -0.024346351623535156, -0.2783128619194031, 0.34845834970474243, -0.3299928307533264, 0.3057105839252472, -0.05514901131391525, 0.123806893825531, 0.09819702059030533, 0.03979629650712013, -0.091703400015831, 0.11196683347225189, 0.09827086329460144, 0.03510905057191849, -0.18514981865882874, 0.10713327676057816, 0.0666813999414444, -0.32118991017341614, 0.09153195470571518, -0.0772300660610199, 0.040182389318943024, 0.33566367626190186, -0.10149998962879181, 0.2026440054178238, 0.5041483640670776, 0.04149576649069786, -0.29953911900520325, -0.029944393783807755, 0.09668873250484467, -0.08678139746189117, 0.06653494387865067, 0.28507527709007263, -0.0472281277179718, -0.16564184427261353, 0.24516208469867706, -0.0013151243329048157, 0.5144760012626648, 0.1382121592760086, 0.06468262523412704, 0.39389410614967346, 0.08161251246929169, 0.36484822630882263, 0.06475600600242615, 0.19093173742294312, 0.1447916477918625, 0.49049320816993713, -0.30001717805862427, 0.08132913708686829, -0.29199978709220886, 0.3566189110279083, -0.1798589825630188, -0.5375994443893433, 0.006189723499119282, -0.061403773725032806, 0.05437001958489418, -0.10131008923053741, -0.27779266238212585, 0.58739173412323, -0.5672663450241089, -0.005808480083942413, -0.17487667500972748, -0.16757725179195404, -0.10241255909204483, 0.05681254714727402, -0.06380244344472885, -0.1142343059182167, 0.1847100853919983, 0.030116446316242218, 0.11489811539649963, -0.3186764121055603, 0.144863560795784, 0.06029787287116051, -0.24604469537734985, -0.10862825065851212, -0.03801930695772171, 0.36461347341537476, -0.20223860442638397, 0.02725289762020111, 0.2926296293735504, 0.07568103820085526, 0.05395149067044258, -0.01140656415373087, 0.2525708079338074, 0.5550550222396851, 0.4139595031738281, 0.06872428953647614, -0.07714109122753143, -0.019781915470957756, -0.01805959641933441, -0.12490090727806091, 0.2800410985946655, -0.17293690145015717, 0.010233508422970772, 0.1875845193862915, 0.07390419393777847, -0.05682346224784851, 0.06131540611386299, 0.08717446774244308, 0.031871601939201355, -0.12019246816635132, 0.3171650767326355, -0.41485583782196045, -0.1140800416469574, 0.0005650678649544716, 0.05260971933603287, -0.16590623557567596, 0.1885589063167572, 0.30004042387008667, -0.14612694084644318, 0.03576107323169708, 0.03979383409023285, -0.006127204746007919, 0.09155647456645966, 0.20618174970149994, 0.34974244236946106, 0.28717610239982605, -0.29129138588905334, -0.18771034479141235, -0.8037235140800476, 0.10124244540929794, 0.11516004055738449, 0.01933145523071289, -0.26517340540885925, -0.012371990829706192, -0.20945604145526886, 0.027437712997198105, 0.14871878921985626, 0.09313614666461945, 0.2298571765422821, -0.03323317691683769, -0.26606667041778564, 0.017602737993001938, -0.3478926420211792, 0.09561890363693237, -0.04375382140278816, -0.5232312679290771, 0.05444954335689545, -0.0766494870185852, -0.13166283071041107, -0.03335130587220192, 0.04434632509946823, -0.09965871274471283, -0.23502524197101593, 0.5389212369918823, -0.18840686976909637, 0.31156307458877563, 0.0738106369972229, 0.042947329580783844, -0.32460278272628784, -0.07947160303592682, -0.05447733774781227, 0.1909618377685547, 0.08161667734384537, -0.006169430911540985, -0.27252769470214844, -0.12208868563175201, -0.13689610362052917, 0.0858042985200882, 0.2753128111362457, 0.3507288992404938, -0.22281381487846375, 0.1735409051179886, -0.05445288121700287, 0.07944051176309586, 0.1187952309846878, 0.08746273815631866, -0.22257071733474731, 0.10859274119138718, -0.27581506967544556, -0.006187267601490021, 0.23820792138576508, -0.6456096768379211, -0.009315073490142822, -0.012132450938224792, 0.28547266125679016, -0.10395637154579163, -0.2440807819366455, -0.41580334305763245, 0.051099926233291626, 0.2085702121257782, 0.061840545386075974, -0.34478121995925903, 0.15918904542922974, -0.16795852780342102, -0.012362353503704071, -0.06711175292730331, 0.19907328486442566, -0.07120916247367859, -0.1283745914697647, 0.18157324194908142, -0.11862105131149292 ]
https://github.com/huggingface/datasets/issues/5727
Okay, this is the issue: ``` FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` I don't remember seeing this error before. I guess it could happen in a multi-process environment if one of the processes deletes the `datasets` cache as the other one is loading a dataset (with `load_dataset`), so make sure that's not the case. Also, you can disable the Windows max path length limit (if enabled), but this is most likely not the problem.
load_dataset fails with FileNotFound error on Windows
### Describe the bug Although I can import and run the datasets library in a Colab environment, I cannot successfully load any data on my own machine (Windows 10) despite following the install steps: (1) create conda environment (2) activate environment (3) install with: ``conda` install -c huggingface -c conda-forge datasets` Then ``` from datasets import load_dataset # this or any other example from the website fails with the FileNotFoundError glue = load_dataset("glue", "ax") ``` **Below I have pasted the error omitting the full path**: ``` raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at C:\Users\...\glue\glue.py or any data file in the same directory. Couldn't find 'glue' on the Hugging Face Hub either: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` ### Steps to reproduce the bug On Windows 10 1) create a minimal conda environment (with just Python) (2) activate environment (3) install datasets with: ``conda` install -c huggingface -c conda-forge datasets` (4) import load_dataset and follow example usage from any dataset card. ### Expected behavior The expected behavior is to load the file into the Python session running on my machine without error. ### Environment info ``` # Name Version Build Channel aiohttp 3.8.4 py311ha68e1ae_0 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 h57928b3_13_cpu conda-forge async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h1262f0c_1 conda-forge aws-c-cal 0.5.21 h7cda486_2 conda-forge aws-c-common 0.8.14 hcfcfb64_0 conda-forge aws-c-compression 0.2.16 h8a79959_5 conda-forge aws-c-event-stream 0.2.20 h5f78564_4 conda-forge aws-c-http 0.7.6 h2545be9_0 conda-forge aws-c-io 0.13.19 h0d2781e_3 conda-forge aws-c-mqtt 0.8.6 hd211e0c_12 conda-forge aws-c-s3 0.2.7 h8113e7b_1 conda-forge aws-c-sdkutils 0.1.8 h8a79959_0 conda-forge aws-checksums 0.1.14 h8a79959_5 conda-forge aws-crt-cpp 0.19.8 he6d3b81_12 conda-forge aws-sdk-cpp 1.10.57 h64004b3_8 conda-forge brotlipy 0.7.0 py311ha68e1ae_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.0 h2bbff1b_0 ca-certificates 2023.01.10 haa95532_0 certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py311h7d9ee11_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge cryptography 40.0.1 py311h28e9c30_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge datasets 2.11.0 py_0 huggingface dill 0.3.6 pyhd8ed1ab_1 conda-forge filelock 3.11.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 py311ha68e1ae_0 conda-forge fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gflags 2.2.2 ha925a31_1004 conda-forge glog 0.6.0 h4797de2_0 conda-forge huggingface_hub 0.13.4 py_0 huggingface idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.3.0 pyha770c72_0 conda-forge importlib_metadata 6.3.0 hd8ed1ab_0 conda-forge intel-openmp 2023.0.0 h57928b3_25922 conda-forge krb5 1.20.1 heb0366b_0 conda-forge libabseil 20230125.0 cxx17_h63175ca_1 conda-forge libarrow 11.0.0 h04c43f8_13_cpu conda-forge libblas 3.9.0 16_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 7.88.1 h68f0423_1 conda-forge libexpat 2.5.0 h63175ca_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgoogle-cloud 2.8.0 hf2ff781_1 conda-forge libgrpc 1.52.1 h32da247_1 conda-forge libhwloc 2.9.0 h51c2c0f_0 conda-forge libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libprotobuf 3.21.12 h12be248_0 conda-forge libsqlite 3.40.0 hcfcfb64_0 conda-forge libssh2 1.10.0 h9a1e1f7_3 conda-forge libthrift 0.18.1 h9ce19ad_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libxml2 2.10.3 hc3477c8_6 conda-forge libzlib 1.2.13 hcfcfb64_4 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge multidict 6.0.4 py311ha68e1ae_0 conda-forge multiprocess 0.70.14 py311ha68e1ae_3 conda-forge numpy 1.24.2 py311h0b4df5a_0 conda-forge openssl 3.1.0 hcfcfb64_0 conda-forge orc 1.8.3 hada7b9e_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 2.0.0 py311hf63dbb6_0 conda-forge parquet-cpp 1.5.1 2 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pyarrow 11.0.0 py311h6a6099b_13_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.11.3 h2628c8c_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python-xxhash 3.2.0 py311ha68e1ae_0 conda-forge python_abi 3.11 3_cp311 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py311ha68e1ae_5 conda-forge re2 2023.02.02 h63175ca_0 conda-forge requests 2.28.2 pyhd8ed1ab_1 conda-forge setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge tbb 2021.8.0 h91493d7_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vc 14.3 hb6edc58_10 conda-forge vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xxhash 0.8.1 hcfcfb64_0 conda-forge xz 5.2.10 h8cc25b3_1 yaml 0.2.5 h8ffe710_2 conda-forge yarl 1.8.2 py311ha68e1ae_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hcfcfb64_4 conda-forge zstd 1.5.4 hd43e919_0 ```
80
load_dataset fails with FileNotFound error on Windows ### Describe the bug Although I can import and run the datasets library in a Colab environment, I cannot successfully load any data on my own machine (Windows 10) despite following the install steps: (1) create conda environment (2) activate environment (3) install with: ``conda` install -c huggingface -c conda-forge datasets` Then ``` from datasets import load_dataset # this or any other example from the website fails with the FileNotFoundError glue = load_dataset("glue", "ax") ``` **Below I have pasted the error omitting the full path**: ``` raise FileNotFoundError( FileNotFoundError: Couldn't find a dataset script at C:\Users\...\glue\glue.py or any data file in the same directory. Couldn't find 'glue' on the Hugging Face Hub either: FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` ### Steps to reproduce the bug On Windows 10 1) create a minimal conda environment (with just Python) (2) activate environment (3) install datasets with: ``conda` install -c huggingface -c conda-forge datasets` (4) import load_dataset and follow example usage from any dataset card. ### Expected behavior The expected behavior is to load the file into the Python session running on my machine without error. ### Environment info ``` # Name Version Build Channel aiohttp 3.8.4 py311ha68e1ae_0 conda-forge aiosignal 1.3.1 pyhd8ed1ab_0 conda-forge arrow-cpp 11.0.0 h57928b3_13_cpu conda-forge async-timeout 4.0.2 pyhd8ed1ab_0 conda-forge attrs 22.2.0 pyh71513ae_0 conda-forge aws-c-auth 0.6.26 h1262f0c_1 conda-forge aws-c-cal 0.5.21 h7cda486_2 conda-forge aws-c-common 0.8.14 hcfcfb64_0 conda-forge aws-c-compression 0.2.16 h8a79959_5 conda-forge aws-c-event-stream 0.2.20 h5f78564_4 conda-forge aws-c-http 0.7.6 h2545be9_0 conda-forge aws-c-io 0.13.19 h0d2781e_3 conda-forge aws-c-mqtt 0.8.6 hd211e0c_12 conda-forge aws-c-s3 0.2.7 h8113e7b_1 conda-forge aws-c-sdkutils 0.1.8 h8a79959_0 conda-forge aws-checksums 0.1.14 h8a79959_5 conda-forge aws-crt-cpp 0.19.8 he6d3b81_12 conda-forge aws-sdk-cpp 1.10.57 h64004b3_8 conda-forge brotlipy 0.7.0 py311ha68e1ae_1005 conda-forge bzip2 1.0.8 h8ffe710_4 conda-forge c-ares 1.19.0 h2bbff1b_0 ca-certificates 2023.01.10 haa95532_0 certifi 2022.12.7 pyhd8ed1ab_0 conda-forge cffi 1.15.1 py311h7d9ee11_3 conda-forge charset-normalizer 2.1.1 pyhd8ed1ab_0 conda-forge colorama 0.4.6 pyhd8ed1ab_0 conda-forge cryptography 40.0.1 py311h28e9c30_0 conda-forge dataclasses 0.8 pyhc8e2a94_3 conda-forge datasets 2.11.0 py_0 huggingface dill 0.3.6 pyhd8ed1ab_1 conda-forge filelock 3.11.0 pyhd8ed1ab_0 conda-forge frozenlist 1.3.3 py311ha68e1ae_0 conda-forge fsspec 2023.4.0 pyh1a96a4e_0 conda-forge gflags 2.2.2 ha925a31_1004 conda-forge glog 0.6.0 h4797de2_0 conda-forge huggingface_hub 0.13.4 py_0 huggingface idna 3.4 pyhd8ed1ab_0 conda-forge importlib-metadata 6.3.0 pyha770c72_0 conda-forge importlib_metadata 6.3.0 hd8ed1ab_0 conda-forge intel-openmp 2023.0.0 h57928b3_25922 conda-forge krb5 1.20.1 heb0366b_0 conda-forge libabseil 20230125.0 cxx17_h63175ca_1 conda-forge libarrow 11.0.0 h04c43f8_13_cpu conda-forge libblas 3.9.0 16_win64_mkl conda-forge libbrotlicommon 1.0.9 hcfcfb64_8 conda-forge libbrotlidec 1.0.9 hcfcfb64_8 conda-forge libbrotlienc 1.0.9 hcfcfb64_8 conda-forge libcblas 3.9.0 16_win64_mkl conda-forge libcrc32c 1.1.2 h0e60522_0 conda-forge libcurl 7.88.1 h68f0423_1 conda-forge libexpat 2.5.0 h63175ca_1 conda-forge libffi 3.4.2 h8ffe710_5 conda-forge libgoogle-cloud 2.8.0 hf2ff781_1 conda-forge libgrpc 1.52.1 h32da247_1 conda-forge libhwloc 2.9.0 h51c2c0f_0 conda-forge libiconv 1.17 h8ffe710_0 conda-forge liblapack 3.9.0 16_win64_mkl conda-forge libprotobuf 3.21.12 h12be248_0 conda-forge libsqlite 3.40.0 hcfcfb64_0 conda-forge libssh2 1.10.0 h9a1e1f7_3 conda-forge libthrift 0.18.1 h9ce19ad_0 conda-forge libutf8proc 2.8.0 h82a8f57_0 conda-forge libxml2 2.10.3 hc3477c8_6 conda-forge libzlib 1.2.13 hcfcfb64_4 conda-forge lz4-c 1.9.4 hcfcfb64_0 conda-forge mkl 2022.1.0 h6a75c08_874 conda-forge multidict 6.0.4 py311ha68e1ae_0 conda-forge multiprocess 0.70.14 py311ha68e1ae_3 conda-forge numpy 1.24.2 py311h0b4df5a_0 conda-forge openssl 3.1.0 hcfcfb64_0 conda-forge orc 1.8.3 hada7b9e_0 conda-forge packaging 23.0 pyhd8ed1ab_0 conda-forge pandas 2.0.0 py311hf63dbb6_0 conda-forge parquet-cpp 1.5.1 2 conda-forge pip 23.0.1 pyhd8ed1ab_0 conda-forge pthreads-win32 2.9.1 hfa6e2cd_3 conda-forge pyarrow 11.0.0 py311h6a6099b_13_cpu conda-forge pycparser 2.21 pyhd8ed1ab_0 conda-forge pyopenssl 23.1.1 pyhd8ed1ab_0 conda-forge pysocks 1.7.1 pyh0701188_6 conda-forge python 3.11.3 h2628c8c_0_cpython conda-forge python-dateutil 2.8.2 pyhd8ed1ab_0 conda-forge python-tzdata 2023.3 pyhd8ed1ab_0 conda-forge python-xxhash 3.2.0 py311ha68e1ae_0 conda-forge python_abi 3.11 3_cp311 conda-forge pytz 2023.3 pyhd8ed1ab_0 conda-forge pyyaml 6.0 py311ha68e1ae_5 conda-forge re2 2023.02.02 h63175ca_0 conda-forge requests 2.28.2 pyhd8ed1ab_1 conda-forge setuptools 67.6.1 pyhd8ed1ab_0 conda-forge six 1.16.0 pyh6c4a22f_0 conda-forge snappy 1.1.10 hfb803bf_0 conda-forge tbb 2021.8.0 h91493d7_0 conda-forge tk 8.6.12 h8ffe710_0 conda-forge tqdm 4.65.0 pyhd8ed1ab_1 conda-forge typing-extensions 4.5.0 hd8ed1ab_0 conda-forge typing_extensions 4.5.0 pyha770c72_0 conda-forge tzdata 2023c h71feb2d_0 conda-forge ucrt 10.0.22621.0 h57928b3_0 conda-forge urllib3 1.26.15 pyhd8ed1ab_0 conda-forge vc 14.3 hb6edc58_10 conda-forge vs2015_runtime 14.34.31931 h4c5c07a_10 conda-forge wheel 0.40.0 pyhd8ed1ab_0 conda-forge win_inet_pton 1.1.0 pyhd8ed1ab_6 conda-forge xxhash 0.8.1 hcfcfb64_0 conda-forge xz 5.2.10 h8cc25b3_1 yaml 0.2.5 h8ffe710_2 conda-forge yarl 1.8.2 py311ha68e1ae_0 conda-forge zipp 3.15.0 pyhd8ed1ab_0 conda-forge zlib 1.2.13 hcfcfb64_4 conda-forge zstd 1.5.4 hd43e919_0 ``` Okay, this is the issue: ``` FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Users\\...\\.cache\\huggingface' ``` I don't remember seeing this error before. I guess it could happen in a multi-process environment if one of the processes deletes the `datasets` cache as the other one is loading a dataset (with `load_dataset`), so make sure that's not the case. Also, you can disable the Windows max path length limit (if enabled), but this is most likely not the problem.
[ -0.3879677355289459, 0.18758141994476318, 0.05123184621334076, 0.42170268297195435, 0.19768838584423065, -0.07411590218544006, 0.5527178049087524, -0.004699838347733021, 0.19371165335178375, 0.09788034856319427, -0.30041980743408203, 0.22086188197135925, 0.14651095867156982, 0.14062747359275818, 0.03509782254695892, 0.30380600690841675, 0.15988682210445404, 0.21777169406414032, -0.3586679995059967, 0.11120344698429108, -0.21535220742225647, 0.32706063985824585, -0.23583969473838806, -0.1202637180685997, -0.3825327754020691, -0.0767209380865097, -0.28155335783958435, 0.4898375868797302, 0.1363457441329956, -0.08442122489213943, 0.46854355931282043, -0.2006296068429947, 0.33095598220825195, 0.6874110102653503, -0.0001254488161066547, 0.2031727135181427, 0.15570518374443054, -0.1081341952085495, -0.14925870299339294, -0.3570093810558319, -0.3685101866722107, -0.04166372865438461, 0.009343694895505905, -0.02673400193452835, -0.09355383366346359, 0.23825427889823914, -0.024698223918676376, -0.26375702023506165, 0.30661720037460327, 0.37968340516090393, 0.07814016938209534, 0.388899564743042, 0.025482982397079468, -0.12291114032268524, -0.11561558395624161, 0.2748335003852844, -0.14287632703781128, 0.4854786992073059, 0.006878199055790901, -0.4584047794342041, 0.14315193891525269, 0.12298545241355896, -0.2567823827266693, -0.02708842046558857, 0.24705959856510162, 0.11006786674261093, -0.12477125227451324, -0.4088101387023926, 0.20822614431381226, 0.24473822116851807, 0.3895775079727173, -0.33145108819007874, -0.4548035264015198, -0.2526886761188507, 0.015370063483715057, 0.062361106276512146, 0.3428559899330139, 0.09167592972517014, -0.029859308153390884, 0.26692143082618713, 0.05909949168562889, 0.023670636117458344, -0.16981090605258942, 0.06861638277769089, 0.012545086443424225, 0.10885100066661835, -0.17828083038330078, -0.0416208878159523, 0.04481600224971771, 0.023354802280664444, -0.12334100902080536, -0.08988436311483383, -0.17981871962547302, 0.21414020657539368, -0.3870077431201935, 0.19284828007221222, -0.04536683112382889, 0.36705482006073, 0.08951197564601898, 0.14513801038265228, 0.11351579427719116, -0.15492050349712372, 0.053442712873220444, 0.17245420813560486, 0.04168998450040817, 0.30133891105651855, 0.20583069324493408, -0.050293684005737305, 0.36916232109069824, 0.14758038520812988, -0.01586288958787918, -0.08924759924411774, -0.42458322644233704, -0.4093393385410309, -0.3099672198295593, -0.09935857355594635, 0.32880067825317383, -0.30570605397224426, -0.6840298771858215, -0.09978872537612915, -0.02741975337266922, 0.1548779010772705, 0.18282450735569, 0.45229053497314453, -0.09441721439361572, -0.0959889218211174, 0.030866965651512146, 0.18681974709033966, -0.10251620411872864, 0.06258086860179901, -0.06447713077068329, 0.039365798234939575, -0.31831642985343933, 0.13559961318969727, 0.39468318223953247, -0.5393505692481995, 0.4305758774280548, -0.10967184603214264, 0.12411131709814072, -0.006534278392791748, -0.17457614839076996, -0.07104457914829254, -0.05967140942811966, 0.4126858711242676, 0.09736816585063934, 0.10581792891025543, 0.17486408352851868, -0.3779394030570984, -0.10551275312900543, 0.16178789734840393, -0.23339197039604187, -0.18633100390434265, -0.22412358224391937, -0.053163882344961166, -0.5089563727378845, 0.05033690854907036, -0.08228111267089844, -0.12103690207004547, -0.02406645566225052, -0.15495729446411133, 0.023831874132156372, 0.06771104782819748, -0.25709038972854614, -0.2063068151473999, 0.543027937412262, 0.9723425507545471, -0.5055948495864868, -0.10888035595417023, 0.015244320034980774, -0.30690667033195496, -0.17362970113754272, 0.16560527682304382, 0.09897378087043762, 0.15638037025928497, -0.4427308142185211, 0.03821103274822235, 0.11990556120872498, -0.5231414437294006, -0.49766889214515686, 0.1924286037683487, -0.10411068797111511, 0.36267638206481934, 0.17425337433815002, -0.09047771990299225, 0.13850638270378113, 0.0006503313779830933, 0.42845141887664795, 0.04665564373135567, 0.13186483085155487, -0.1433938443660736, -0.22751986980438232, -0.3045596480369568, 0.26548051834106445, 0.229593887925148, -0.05539478361606598, 0.07499675452709198, 0.3964642286300659, -0.22716006636619568, 0.12638255953788757, 0.012139868922531605, -0.13301058113574982, 0.3201207220554352, 0.37740278244018555, -0.047425441443920135, 0.03601593151688576, -0.029874302446842194, -0.4675552546977997, 0.34963488578796387, 0.09137876331806183, 0.15816658735275269, -0.012686211615800858, -0.0001310408115386963, -0.07535111159086227, 0.09149327129125595, -0.33840465545654297, -0.38328680396080017, -0.027112606912851334, -0.0544758215546608, 0.19378447532653809, 0.11014771461486816, -0.18817101418972015, 1.1329448223114014, -0.06986448913812637, 0.14777261018753052, -0.2528728246688843, 0.12899503111839294, -0.010056581348180771, -0.20101627707481384, -0.0276603102684021, 0.2839164435863495, 0.12412412464618683, -0.22039246559143066, 0.05383545160293579, 0.3130943775177002, 0.02695309743285179, 0.012325868010520935, -0.14554914832115173, -0.10257658362388611, 0.23414276540279388, -0.013305321335792542, 0.04829418659210205, -0.052109941840171814, 0.13255076110363007, 0.03106251358985901, 0.058873288333415985, 0.1516564041376114, -0.30760958790779114, 0.34042301774024963, -0.02095450460910797, 0.05591844022274017, 0.2166593074798584, -0.0562162809073925, -0.19511669874191284, -0.15355558693408966, 0.3848344385623932, 0.1257886439561844, 0.5380015969276428, 0.14553995430469513, -0.08120851218700409, -0.05169176682829857, -0.09109977632761002, 0.021122246980667114, -0.0039281342178583145, 0.06437341868877411, -0.4012717306613922, 0.20902055501937866, 0.37838566303253174, 0.1954185664653778, 0.7172749042510986, 0.1042991504073143, -0.19463807344436646, 0.1601322889328003, -0.1884366124868393, -0.03767590597271919, 0.12602588534355164, 0.061949096620082855, 0.32128816843032837, 0.28619104623794556, -0.15108884871006012, 0.2813449501991272, -0.16339467465877533, -0.42021310329437256, -0.13706707954406738, 0.023833276703953743, -0.5764752626419067, 0.06704980134963989, -0.22694921493530273, -0.24448162317276, -0.1390063464641571, -0.2018553465604782, -0.16523399949073792, 0.12370195984840393, -0.3439350724220276, 0.27794164419174194, 0.13144348561763763, 0.08747002482414246, -0.22930023074150085, 0.23028117418289185, -0.2618771493434906, -0.47284674644470215, -0.30413323640823364, 0.10117234289646149, -0.19719475507736206, -0.08577315509319305, 0.45230796933174133, 0.10378759354352951, 0.0965571254491806, -0.3601776957511902, 0.26134249567985535, -0.004114851355552673, -0.27946552634239197, 0.07155323773622513, -0.058361947536468506, 0.7041265368461609, 0.09103987365961075, 0.08488371968269348, -0.06839126348495483, -0.3301519453525543, 0.24169766902923584, 0.0853327214717865, -0.15536116063594818, -0.027290649712085724, -0.020327646285295486, -0.35331234335899353, -0.1691187620162964, -0.10118768364191055, -0.29052016139030457, -0.26927104592323303, 0.1887524425983429, -0.03608326241374016, 0.03977344185113907, 0.2660325765609741, 0.16826315224170685, 0.28803551197052, -0.046422380954027176, 0.10368769615888596, 0.10415956377983093, -0.32975253462791443, 0.44341346621513367, -0.22681406140327454, -0.2616613805294037, 0.3359682559967041, 0.06661640107631683, 0.19632674753665924, 0.0815836489200592, -0.31320732831954956, -0.13808000087738037, -0.020563503727316856, 0.14182648062705994, 0.0728520005941391, 0.08388325572013855, 0.3294954001903534, 0.05455174669623375, 0.1796826273202896, -0.12252756208181381, -0.3921624422073364, 0.10320517420768738, -0.03426164388656616, 0.13293524086475372, -0.013179918751120567, 0.23442398011684418, -0.10966147482395172, 0.22002390027046204, 0.3693098723888397, -0.02536698617041111, 0.33701175451278687, -0.004081416875123978, 0.6679177284240723, -0.058820758014917374, -0.4264782667160034, 0.03997867926955223, -0.0014597252011299133, -0.04317626729607582, 0.15493245422840118, 0.15827777981758118, 0.11656985431909561, -0.4776495397090912, -0.36069542169570923, -0.3274945020675659, -0.13109666109085083, -0.14430606365203857, -0.1041240394115448, 0.030815213918685913, 0.1273556798696518, 0.13528552651405334, 0.1022256463766098, -0.049522943794727325, 0.17239892482757568, 0.6753770112991333, 0.01269933208823204, 0.13271266222000122, -0.04389367252588272, -0.298112154006958, -0.476252019405365, 0.1508491039276123, -0.006991304457187653, 0.37924182415008545, -0.19209842383861542, -0.07002837210893631, -0.1376647651195526, -0.13387927412986755, 0.8707390427589417, 0.033620648086071014, -0.1969289779663086, 0.07875081896781921, 0.06171782314777374, -0.368963360786438, -0.1437632143497467, 0.08531558513641357, -0.0045775435864925385, 0.1745966225862503, 0.5065863132476807, 0.05283781886100769, -0.1857362985610962, 0.020823080092668533, 0.2965545654296875, -0.04944034665822983, -0.03282364830374718, -0.4722517132759094, -0.39811813831329346, -0.23699072003364563, -0.12170848250389099, -0.0970756784081459, 0.16192671656608582, 0.10071302205324173, 0.08230344951152802, -0.32545262575149536, -0.10032771527767181, 0.2449624240398407, 0.3604978322982788, 0.4184076189994812, -0.16995760798454285, 0.44625145196914673, 0.23593972623348236, 0.40666234493255615, 0.08763359487056732, 0.6137474775314331, -0.11499954760074615, -0.47524791955947876, -0.04034353047609329, -0.168064147233963, 0.25027668476104736, 0.20802079141139984, -0.19807875156402588, -0.30305901169776917, -0.16699445247650146, -0.06277896463871002, -0.18549975752830505, 0.11973837018013, 0.01361776888370514, 0.13804396986961365, -0.3530270755290985, -0.01799948886036873, 0.2357826679944992, -0.026605665683746338, -0.05624628812074661, 0.5670340657234192, 0.3549930155277252, -0.22548845410346985, 0.22741058468818665, -0.08783484995365143, 0.8264728784561157, 0.02232908084988594, 0.17566540837287903, 0.2525716722011566, -0.16025418043136597, 0.38260728120803833, 0.06566714495420456, 0.04016222804784775, -0.24515673518180847, -0.39916545152664185, -0.046516209840774536, -0.12346421927213669, 0.39480680227279663, 0.07595705986022949, -0.04768030345439911, 0.30056020617485046, 0.324509859085083, 0.059398308396339417, 0.18191400170326233, -0.030049502849578857, -0.01712575927376747, -0.3353268802165985, -0.1622340828180313, -0.000046562403440475464, 0.16598938405513763, 0.5182424187660217, -0.1803646683692932, 0.08342887461185455, -0.30731305480003357, -0.12873190641403198, -0.3514671325683594, 0.32329514622688293, -0.6555185914039612, -0.044800806790590286, 0.16223448514938354, -0.3461204767227173, 0.181907057762146, 0.5296038389205933, 0.35516923666000366, 0.057707782834768295, -0.321941614151001, 0.05352967977523804, -0.06211652606725693, -0.049542877823114395, 0.21228104829788208, -0.15655207633972168, 0.13531215488910675, -0.059218257665634155, -0.2665109634399414, -0.2743687331676483, -0.2685554325580597, -0.113674096763134, 0.18372146785259247, 0.18398791551589966, -0.12391318380832672, 0.005219645798206329, -0.21984922885894775, 0.18367822468280792, 0.33515864610671997, -0.05452911555767059, 0.02914878912270069, 0.04351969435811043, 0.14614436030387878, 0.35663506388664246, -0.28712019324302673, -0.3939468264579773, -0.1502240151166916, 0.4942437410354614, -0.6599584817886353, -0.11975759267807007, 0.2806941270828247, 0.02293097972869873, -0.20103782415390015, -0.1017734557390213, 0.10952604562044144, -0.15014952421188354, -0.2743409276008606, -0.29886025190353394, 0.2024552971124649, 0.08271367847919464, -0.03134842589497566, 0.15653909742832184, 0.19207078218460083, -0.31917697191238403, 0.11975343525409698, -0.5545750260353088, -0.11344528198242188, 0.23260259628295898, 0.0460125207901001, 0.06191117316484451, 0.2509980797767639, 0.014893509447574615, 0.16338026523590088, -0.2886626720428467, -0.13063688576221466, 0.029717281460762024, 0.06773500889539719, -0.14801527559757233, 0.3591747581958771, 0.25342172384262085, 0.4432922601699829, -0.1456443816423416, -0.012194540351629257, 0.11793197691440582, 0.140736386179924, -0.08516401797533035, -0.20259732007980347, 0.16877761483192444, 0.07509200274944305, -0.12174087762832642, 0.04260597005486488, -0.206929013133049, -0.10882501304149628, -0.19286642968654633, 0.365196168422699, 0.3526642322540283, -0.06465117633342743, -0.024346351623535156, -0.2783128619194031, 0.34845834970474243, -0.3299928307533264, 0.3057105839252472, -0.05514901131391525, 0.123806893825531, 0.09819702059030533, 0.03979629650712013, -0.091703400015831, 0.11196683347225189, 0.09827086329460144, 0.03510905057191849, -0.18514981865882874, 0.10713327676057816, 0.0666813999414444, -0.32118991017341614, 0.09153195470571518, -0.0772300660610199, 0.040182389318943024, 0.33566367626190186, -0.10149998962879181, 0.2026440054178238, 0.5041483640670776, 0.04149576649069786, -0.29953911900520325, -0.029944393783807755, 0.09668873250484467, -0.08678139746189117, 0.06653494387865067, 0.28507527709007263, -0.0472281277179718, -0.16564184427261353, 0.24516208469867706, -0.0013151243329048157, 0.5144760012626648, 0.1382121592760086, 0.06468262523412704, 0.39389410614967346, 0.08161251246929169, 0.36484822630882263, 0.06475600600242615, 0.19093173742294312, 0.1447916477918625, 0.49049320816993713, -0.30001717805862427, 0.08132913708686829, -0.29199978709220886, 0.3566189110279083, -0.1798589825630188, -0.5375994443893433, 0.006189723499119282, -0.061403773725032806, 0.05437001958489418, -0.10131008923053741, -0.27779266238212585, 0.58739173412323, -0.5672663450241089, -0.005808480083942413, -0.17487667500972748, -0.16757725179195404, -0.10241255909204483, 0.05681254714727402, -0.06380244344472885, -0.1142343059182167, 0.1847100853919983, 0.030116446316242218, 0.11489811539649963, -0.3186764121055603, 0.144863560795784, 0.06029787287116051, -0.24604469537734985, -0.10862825065851212, -0.03801930695772171, 0.36461347341537476, -0.20223860442638397, 0.02725289762020111, 0.2926296293735504, 0.07568103820085526, 0.05395149067044258, -0.01140656415373087, 0.2525708079338074, 0.5550550222396851, 0.4139595031738281, 0.06872428953647614, -0.07714109122753143, -0.019781915470957756, -0.01805959641933441, -0.12490090727806091, 0.2800410985946655, -0.17293690145015717, 0.010233508422970772, 0.1875845193862915, 0.07390419393777847, -0.05682346224784851, 0.06131540611386299, 0.08717446774244308, 0.031871601939201355, -0.12019246816635132, 0.3171650767326355, -0.41485583782196045, -0.1140800416469574, 0.0005650678649544716, 0.05260971933603287, -0.16590623557567596, 0.1885589063167572, 0.30004042387008667, -0.14612694084644318, 0.03576107323169708, 0.03979383409023285, -0.006127204746007919, 0.09155647456645966, 0.20618174970149994, 0.34974244236946106, 0.28717610239982605, -0.29129138588905334, -0.18771034479141235, -0.8037235140800476, 0.10124244540929794, 0.11516004055738449, 0.01933145523071289, -0.26517340540885925, -0.012371990829706192, -0.20945604145526886, 0.027437712997198105, 0.14871878921985626, 0.09313614666461945, 0.2298571765422821, -0.03323317691683769, -0.26606667041778564, 0.017602737993001938, -0.3478926420211792, 0.09561890363693237, -0.04375382140278816, -0.5232312679290771, 0.05444954335689545, -0.0766494870185852, -0.13166283071041107, -0.03335130587220192, 0.04434632509946823, -0.09965871274471283, -0.23502524197101593, 0.5389212369918823, -0.18840686976909637, 0.31156307458877563, 0.0738106369972229, 0.042947329580783844, -0.32460278272628784, -0.07947160303592682, -0.05447733774781227, 0.1909618377685547, 0.08161667734384537, -0.006169430911540985, -0.27252769470214844, -0.12208868563175201, -0.13689610362052917, 0.0858042985200882, 0.2753128111362457, 0.3507288992404938, -0.22281381487846375, 0.1735409051179886, -0.05445288121700287, 0.07944051176309586, 0.1187952309846878, 0.08746273815631866, -0.22257071733474731, 0.10859274119138718, -0.27581506967544556, -0.006187267601490021, 0.23820792138576508, -0.6456096768379211, -0.009315073490142822, -0.012132450938224792, 0.28547266125679016, -0.10395637154579163, -0.2440807819366455, -0.41580334305763245, 0.051099926233291626, 0.2085702121257782, 0.061840545386075974, -0.34478121995925903, 0.15918904542922974, -0.16795852780342102, -0.012362353503704071, -0.06711175292730331, 0.19907328486442566, -0.07120916247367859, -0.1283745914697647, 0.18157324194908142, -0.11862105131149292 ]
https://github.com/huggingface/datasets/issues/5725
Hi! You can use the `nrows` parameter for this: ```python data = load_dataset("json", data_files=data_path, nrows=10) ```
How to limit the number of examples in dataset, for testing?
### Describe the bug I am using this command: `data = load_dataset("json", data_files=data_path)` However, I want to add a parameter, to limit the number of loaded examples to be 10, for development purposes, but can't find this simple parameter. ### Steps to reproduce the bug In the description. ### Expected behavior To be able to limit the number of examples ### Environment info Nothing special
16
How to limit the number of examples in dataset, for testing? ### Describe the bug I am using this command: `data = load_dataset("json", data_files=data_path)` However, I want to add a parameter, to limit the number of loaded examples to be 10, for development purposes, but can't find this simple parameter. ### Steps to reproduce the bug In the description. ### Expected behavior To be able to limit the number of examples ### Environment info Nothing special Hi! You can use the `nrows` parameter for this: ```python data = load_dataset("json", data_files=data_path, nrows=10) ```
[ -0.09696656465530396, -0.15027594566345215, -0.1526530683040619, -0.13312135636806488, 0.14189982414245605, 0.058887213468551636, 0.4467536211013794, 0.45203396677970886, 0.004926532506942749, 0.3013802766799927, 0.5844478607177734, 0.23657768964767456, -0.15774200856685638, 0.03465995937585831, 0.3205595314502716, -0.321117639541626, -0.009376708418130875, -0.048331331461668015, 0.026498261839151382, 0.31694296002388, -0.1270240992307663, 0.039095282554626465, -0.10079213976860046, -0.08365342020988464, 0.21656015515327454, 0.005629612132906914, 0.08419757336378098, 0.008933852426707745, 0.023888755589723587, -0.5030121803283691, 0.12138328701257706, 0.05152842774987221, 0.2126898169517517, 0.06654677540063858, -0.00012937907013110816, -0.15930816531181335, 0.42924612760543823, -0.07549470663070679, -0.44856250286102295, -0.22241556644439697, -0.1646830439567566, -0.222843736410141, 0.42694100737571716, -0.19736593961715698, 0.07272720336914062, -0.19056183099746704, -0.24971948564052582, -0.3796449899673462, 0.16152797639369965, 0.3385654091835022, 0.06039354205131531, 0.24419304728507996, -0.11290737241506577, 0.006469298154115677, 0.20045925676822662, 0.4342218339443207, -0.08645084500312805, 0.23311251401901245, 0.5960286855697632, 0.07741034775972366, 0.3841714859008789, -0.01004965603351593, 0.1246141642332077, 0.29122740030288696, -0.12017752230167389, -0.004038993269205093, 0.12100443243980408, -0.2034006416797638, 0.09957479685544968, 0.37393683195114136, 0.7646908760070801, -0.1374405026435852, -0.1834707111120224, -0.406832754611969, 0.14959995448589325, -0.14232540130615234, -0.28410887718200684, 0.18978901207447052, -0.503640353679657, -0.11703641712665558, -0.32672420144081116, -0.05777300149202347, -0.2997373342514038, 0.3297191560268402, 0.4195053279399872, -0.06313817203044891, 0.04826674237847328, 0.21925821900367737, 0.2063370645046234, -0.24291662871837616, 0.15164737403392792, -0.0716802179813385, -0.17984628677368164, 0.22312234342098236, -0.06797462701797485, -0.19755107164382935, -0.02743053436279297, -0.20179696381092072, 0.7433120012283325, 0.219735786318779, 0.2124488353729248, -0.12615862488746643, 0.17999394237995148, 0.03084236942231655, 0.3524661660194397, -0.03671523183584213, 0.3313150703907013, 0.2731846868991852, 0.2659909427165985, 0.24266299605369568, 0.18408282101154327, 0.18446356058120728, 0.015496775507926941, -0.4565017521381378, 0.40845122933387756, -0.16267818212509155, 0.3213714361190796, -0.10780622065067291, 0.054963983595371246, -0.19099198281764984, -0.3907642662525177, -0.21788541972637177, 0.14057669043540955, 0.40599551796913147, 0.09290864318609238, -0.36839139461517334, 0.08901531994342804, 0.2442796230316162, -0.10289414972066879, -0.30478379130363464, -0.09602515399456024, 0.14377906918525696, -0.14760194718837738, -0.1755739152431488, 0.3292575776576996, -0.10096178948879242, 0.4434828758239746, -0.00867026299238205, -0.09751369059085846, -0.5163998603820801, 0.5466931462287903, 0.2078993022441864, -0.07062208652496338, 0.28884202241897583, -0.21137464046478271, 0.07291741669178009, 0.012686431407928467, -0.08224262297153473, -0.3992435932159424, 0.37225842475891113, -0.24874663352966309, -0.448527991771698, -0.12339361011981964, 0.06107218563556671, -0.2196456491947174, 0.18184612691402435, -0.40946972370147705, 0.1963617205619812, -0.11628010869026184, -0.07314272224903107, 0.18390730023384094, -0.05031757801771164, -0.06532635539770126, -0.13954880833625793, 0.3156958818435669, 0.6305654048919678, -0.29530343413352966, -0.1971646100282669, -0.3563021719455719, 0.03865022212266922, -0.08436106890439987, -0.14763514697551727, -0.6207301020622253, 0.4159362316131592, -0.34723979234695435, 0.010840147733688354, 0.6132849454879761, -0.09829889237880707, -0.12488742917776108, 0.27535000443458557, -0.055360980331897736, -0.22383412718772888, 0.08652454614639282, 0.06505359709262848, 0.2429935485124588, 0.029355205595493317, 0.0718836784362793, 0.3237541913986206, -0.034285664558410645, -0.0694270133972168, 0.17620337009429932, 0.012308195233345032, 0.4577884078025818, -0.04486037790775299, -0.2998901605606079, 0.020584944635629654, 0.21666264533996582, 0.016044393181800842, 0.12190685421228409, -0.2041800618171692, 0.07359689474105835, 0.29625651240348816, 0.24718351662158966, -0.17784713208675385, 0.10596204549074173, -0.10891968011856079, -0.44453468918800354, -0.04646721109747887, 0.1341012567281723, -0.25219446420669556, 0.17942005395889282, 0.024371691048145294, -0.41558724641799927, 0.2360227108001709, 0.17650656402111053, -0.2000339925289154, -0.11748368293046951, -0.23546962440013885, 0.016241639852523804, -0.28107747435569763, -0.07637277245521545, 0.23488877713680267, -0.2952539324760437, 0.07811684906482697, -0.39990222454071045, 0.046385616064071655, 0.11027278751134872, -0.2835744023323059, 0.02581358700990677, -0.27738749980926514, 0.10295988619327545, -0.11071741580963135, -0.07899343967437744, 0.4689674377441406, 0.6252559423446655, -0.01814443990588188, 0.19041800498962402, -0.06585480272769928, 0.08922526985406876, 0.12899518013000488, 0.0728270560503006, 0.4281199276447296, -0.05170971900224686, 0.17280280590057373, -0.555370569229126, 0.2453422248363495, 0.14264637231826782, 0.07310985028743744, 0.11680440604686737, 0.04486634582281113, 0.39210930466651917, 0.016924701631069183, -0.4240543246269226, -0.11288363486528397, 0.24327930808067322, 0.27703437209129333, 0.19893838465213776, 0.06429287046194077, -0.3553580045700073, -0.19448821246623993, -0.32471683621406555, -0.3545386791229248, 0.24283412098884583, 0.4255388379096985, 0.12883444130420685, -0.17924410104751587, 0.2710040211677551, 0.2768752872943878, 0.8567626476287842, 0.19948139786720276, 0.19756758213043213, -0.1613268107175827, 0.007486976683139801, -0.06335707753896713, 0.11412039399147034, 0.10996317863464355, -0.05134255066514015, -0.07259328663349152, 0.20056335628032684, -0.30068111419677734, -0.05468916893005371, -0.4765606224536896, 0.0885341688990593, 0.1331094354391098, -0.477870911359787, 0.19786076247692108, -0.2821580171585083, 0.12933586537837982, 0.02877390757203102, -0.14520683884620667, -0.13992354273796082, 0.17858698964118958, 0.09128695726394653, 0.001760218758136034, -0.20847198367118835, 0.05384550243616104, -0.2631685733795166, 0.19530251622200012, 0.14330258965492249, -0.09757093340158463, 0.08871333301067352, 0.22092217206954956, -0.226974755525589, -0.11228064447641373, -0.04340098053216934, 0.15936192870140076, 0.3696538507938385, 0.13984671235084534, -0.39791250228881836, -0.3078717589378357, -0.30566322803497314, 0.010063416324555874, 0.2568429708480835, 0.7184288501739502, 0.4889504015445709, 0.3815574645996094, -0.03417138382792473, 0.0338871143758297, -0.242087259888649, 0.05537290871143341, -0.09174098074436188, 0.0011090710759162903, -0.047781411558389664, 0.3260762095451355, 0.019233494997024536, -0.3948492407798767, -0.19081233441829681, -0.1966518759727478, 0.09286504238843918, 0.16344507038593292, 0.14808283746242523, 0.28631582856178284, 0.4725346565246582, -0.13622692227363586, 0.20642226934432983, -0.021911729127168655, 0.08663579076528549, -0.1903826892375946, 0.2791585326194763, -0.43242818117141724, -0.15232014656066895, -0.046994324773550034, -0.16288095712661743, -0.10409624874591827, 0.3032993674278259, -0.18369391560554504, -0.23482166230678558, 0.05546548217535019, 0.10110341012477875, -0.47788751125335693, 0.12810324132442474, 0.46452903747558594, -0.0722460076212883, 0.05567249283194542, -0.28971657156944275, -0.3383283019065857, 0.28499501943588257, 0.12839114665985107, 0.22239433228969574, 0.213766410946846, 0.4924541413784027, -0.1967349648475647, 0.3236045837402344, 0.30687546730041504, -0.06932477653026581, 0.21820421516895294, -0.2515186071395874, 0.14797300100326538, 0.13372881710529327, 0.26549625396728516, -0.17278920114040375, 0.25244009494781494, -0.2357831746339798, 0.03621971607208252, 0.13631248474121094, 0.13219179213047028, 0.2787794768810272, -0.4685211181640625, -0.27498042583465576, -0.14218799769878387, 0.3175591826438904, -0.2528335154056549, 0.3586718738079071, -0.15002480149269104, -0.12479778379201889, -0.4328160285949707, 0.06744563579559326, -0.1880313605070114, 0.08368246257305145, 0.04447973519563675, 0.057767920196056366, -0.4358307123184204, 0.05609414353966713, -0.06760536134243011, 0.08094531297683716, 0.08775657415390015, 0.4474186897277832, -0.0378861129283905, 0.06879495084285736, 0.2054377645254135, 0.21593046188354492, 0.9349051713943481, -0.2815306782722473, 0.2783561646938324, -0.10557147115468979, 0.020331524312496185, -0.5706424117088318, -0.10434842109680176, -0.03794588893651962, 0.2567656636238098, 0.043232813477516174, 0.24357157945632935, -0.09474554657936096, -0.123609758913517, 0.24327073991298676, 0.4323328733444214, 0.021322883665561676, -0.1705111265182495, 0.05316081643104553, -0.38936668634414673, -0.3679036498069763, 0.0568905845284462, 0.12713712453842163, 0.11462585628032684, 0.07165666669607162, -0.3179980516433716, -0.06792285293340683, -0.2692801356315613, -0.05968131497502327, 0.1999877691268921, 0.45052701234817505, 0.1621181219816208, 0.29721754789352417, -0.12679526209831238, -0.2543330490589142, 0.17250995337963104, 0.15587346255779266, 0.12288995087146759, -0.0820116251707077, -0.03139737993478775, 0.08523032069206238, 0.286532998085022, 0.10504085570573807, -0.24667680263519287, 0.29489415884017944, -0.07894934713840485, 0.2446824312210083, 0.14196519553661346, 0.03764509782195091, 0.2669670581817627, -0.08071596175432205, -0.0883067175745964, -0.42564287781715393, 0.2810644805431366, -0.07022158801555634, -0.11147058010101318, 0.6309782266616821, -0.41796261072158813, -0.277151882648468, 0.01701531559228897, 0.27815568447113037, 0.6599781513214111, 0.06745754182338715, 0.06569869816303253, -0.12242195755243301, -0.2170252799987793, 0.3079580068588257, 0.011803731322288513, -0.02200227975845337, -0.02100728452205658, -0.034895654767751694, 0.15525324642658234, -0.36295831203460693, 0.1573706567287445, 0.12834382057189941, -0.15290912985801697, 0.024145957082509995, -0.44319596886634827, -0.13038262724876404, -0.005021283403038979, 0.24171634018421173, -0.09630953520536423, -0.23273316025733948, -0.505935788154602, 0.00007977336645126343, -0.2533295452594757, -0.0633687973022461, 0.05508028715848923, -0.022456254810094833, -0.007209248840808868, -0.4889027178287506, -0.22684216499328613, -0.1310422569513321, -0.16305790841579437, -0.010412491858005524, 0.3639259934425354, -0.35478654503822327, 0.15323275327682495, 0.5026142597198486, -0.04589379206299782, 0.2756890058517456, -0.11581549793481827, 0.17873038351535797, -0.39890947937965393, -0.08312971889972687, -0.3097883462905884, 0.1685784012079239, 0.19230173528194427, -0.0307701975107193, -0.17525288462638855, 0.3044400215148926, 0.007487140595912933, -0.25903576612472534, -0.0824749544262886, 0.035529252141714096, -0.04297810420393944, -0.41599586606025696, -0.09584814310073853, -0.16034331917762756, 0.08532506972551346, -0.1362054944038391, 0.01228099875152111, 0.35230177640914917, -0.3959236145019531, 0.11608192324638367, -0.10503475368022919, -0.0957278311252594, -0.014922068454325199, 0.1930432915687561, 0.008932555094361305, 0.010698094964027405, 0.47543805837631226, 0.23122328519821167, 0.27955836057662964, -0.13044750690460205, 0.30337345600128174, 0.3510533273220062, -0.13164444267749786, 0.48070940375328064, -0.029823502525687218, 0.25090649724006653, -0.15811476111412048, 0.15019886195659637, -0.02986633963882923, 0.33158156275749207, -0.0714917853474617, -0.4040175974369049, -0.44266277551651, -0.001996174454689026, -0.2617237865924835, 0.345263808965683, -0.1992083489894867, -0.3427601456642151, 0.03398384898900986, 0.08759487420320511, -0.09608354419469833, -0.057956013828516006, -0.1109258234500885, 0.19807934761047363, 0.20055243372917175, 0.4234637916088104, -0.058989327400922775, -0.003208804875612259, -0.055174630135297775, -0.153104767203331, -0.12913668155670166, -0.12379565089941025, -0.3159456253051758, 0.18134011328220367, -0.2250494807958603, -0.02022423967719078, 0.033419862389564514, -0.2975313067436218, 0.012430232018232346, -0.11326619982719421, 0.20960566401481628, -0.06931465119123459, -0.04209865629673004, 0.07531212270259857, 0.13691189885139465, -0.23034673929214478, -0.04854307323694229, 0.13306975364685059, -0.06263279169797897, 0.25430625677108765, 0.22647050023078918, 0.21816185116767883, 0.32911163568496704, 0.027848824858665466, -0.5317743420600891, 0.18601946532726288, -0.11951590329408646, -0.014306982979178429, -0.32691511511802673, 0.024751249700784683, -0.07998289912939072, -0.0763704925775528, 0.1362639218568802, 0.338026762008667, -0.513062596321106, 0.5558319091796875, 0.2103285789489746, 0.04482139274477959, -0.049099475145339966, -0.42640095949172974, 0.1270117312669754, -0.061682719737291336, -0.01989075541496277, 0.2852846682071686, -0.11586478352546692, -0.12161999940872192, 0.0011372752487659454, -0.020396046340465546, 0.09600183367729187, 0.04899362474679947, 0.17879076302051544, 0.7629024982452393, -0.22778062522411346, -0.17557890713214874, -0.19385941326618195, 0.2259431779384613, 0.4015921950340271, -0.040426675230264664, 0.01398473046720028, 0.4050150215625763, 0.16020776331424713, 0.04526575654745102, -0.045534733682870865, -0.1817735731601715, 0.18475310504436493, 0.1750100702047348, -0.050655946135520935, -0.003874102607369423, 0.11772133409976959, 0.17592255771160126, 0.17684343457221985, 0.14602994918823242, -0.1030774712562561, -0.16118228435516357, 0.14512865245342255, -0.2738628089427948, -0.2389446496963501, 0.057691559195518494, -0.2577154040336609, 0.05222455412149429, 0.18219542503356934, -0.3617613911628723, 0.07205309718847275, -0.00986030325293541, -0.20302213728427887, -0.219204381108284, 0.32935261726379395, 0.26434454321861267, -0.2744811773300171, -0.3178740441799164, 0.008036106824874878, -0.19309726357460022, -0.11882239580154419, 0.1502685248851776, 0.028992706909775734, 0.31597310304641724, 0.07194344699382782, 0.19248206913471222, 0.12692274153232574, 0.22275739908218384, -0.07390079647302628, -0.045647550374269485, 0.07905732095241547, 0.16307038068771362, 0.04107419028878212, -0.049916110932826996, 0.031660374253988266, 0.07058338820934296, 0.2976008355617523, 0.3065173923969269, -0.33739393949508667, -0.6164474487304688, 0.10872761905193329, 0.011603740975260735, -0.1899758279323578, -0.15698909759521484, -0.05446480214595795, -0.1891387552022934, -0.04620704799890518, 0.3744753897190094, -0.10250694304704666, -0.10389979183673859, 0.11158523708581924, 0.011689644306898117, -0.3623082637786865, 0.19518360495567322, -0.31625455617904663, 0.4094288945198059, -0.17759856581687927, -0.262434184551239, -0.21017909049987793, -0.11586125195026398, -0.3612093925476074, -0.39097699522972107, 0.40453481674194336, -0.11123229563236237, -0.17445994913578033, 0.0703214704990387, 0.174790620803833, -0.04555989429354668, -0.16723646223545074, 0.48998352885246277, -0.038238588720560074, -0.5808799862861633, 0.10569609701633453, 0.48536574840545654, 0.01686456799507141, -0.10646776109933853, -0.019497733563184738, -0.49358680844306946, -0.1981508880853653, -0.20816534757614136, 0.06588871777057648, 0.3021000027656555, 0.15048187971115112, 0.34846681356430054, -0.0045398809015750885, 0.35569334030151367, 0.09715732932090759, 0.23507356643676758, -0.2869222164154053, -0.03232990577816963, -0.0004696585237979889, 0.16483791172504425, 0.13225986063480377, -0.03242543339729309, -0.315344899892807, -0.09675410389900208, -0.17572996020317078, 0.028487559407949448, 0.04384234547615051, 0.03356098011136055, 0.06829941272735596, -0.023496095091104507, -0.07689172029495239, 0.15225060284137726, 0.15292474627494812, -0.08107665926218033, -0.24457165598869324, 0.030916646122932434, -0.014580249786376953, 0.021617725491523743, 0.29432228207588196, -0.3573528528213501, -0.3290812373161316, -0.1949511170387268, 0.46093490719795227, -0.34235358238220215, -0.3268572688102722, -0.254575252532959, 0.15423718094825745, 0.5532031655311584, -0.08005402982234955, -0.27504727244377136, 0.5548765063285828, 0.03938595578074455, 0.002581074833869934, 0.13921236991882324, 0.3167569637298584, 0.1451851725578308, 0.2637200355529785, -0.0784553810954094, -0.42517995834350586 ]
https://github.com/huggingface/datasets/issues/5725
I misread the format in which the dataset is stored - the `nrows` parameter works for CSV, but not JSON. This means the only option is first to create a DataFrame and then convert it to a Dataset object: ```python import pandas as pd from datasets import Dataset df = pd.read_json(data_path, lines=True, nrows=10) ds = Dataset.from_pandas(df) ```
How to limit the number of examples in dataset, for testing?
### Describe the bug I am using this command: `data = load_dataset("json", data_files=data_path)` However, I want to add a parameter, to limit the number of loaded examples to be 10, for development purposes, but can't find this simple parameter. ### Steps to reproduce the bug In the description. ### Expected behavior To be able to limit the number of examples ### Environment info Nothing special
57
How to limit the number of examples in dataset, for testing? ### Describe the bug I am using this command: `data = load_dataset("json", data_files=data_path)` However, I want to add a parameter, to limit the number of loaded examples to be 10, for development purposes, but can't find this simple parameter. ### Steps to reproduce the bug In the description. ### Expected behavior To be able to limit the number of examples ### Environment info Nothing special I misread the format in which the dataset is stored - the `nrows` parameter works for CSV, but not JSON. This means the only option is first to create a DataFrame and then convert it to a Dataset object: ```python import pandas as pd from datasets import Dataset df = pd.read_json(data_path, lines=True, nrows=10) ds = Dataset.from_pandas(df) ```
[ -0.018296048045158386, -0.027276843786239624, -0.11304336786270142, -0.11859424412250519, 0.17070409655570984, 0.07331310212612152, 0.5478610992431641, 0.4776518642902374, 0.08311136811971664, 0.2449631690979004, 0.5989920496940613, 0.3104449212551117, -0.05715470761060715, 0.023122556507587433, 0.2647761404514313, -0.32568734884262085, 0.05583535507321358, 0.0553065724670887, -0.08199448883533478, 0.3723914921283722, -0.15164685249328613, -0.0012159217149019241, -0.09057179093360901, -0.03781377896666527, 0.11977584660053253, -0.14119401574134827, 0.01661171019077301, -0.046350255608558655, -0.03310956060886383, -0.4419141113758087, 0.10774210095405579, 0.034773942083120346, 0.30080676078796387, 0.12266978621482849, -0.0001254399394383654, -0.14829225838184357, 0.35563209652900696, -0.07920624315738678, -0.4039537012577057, -0.21930840611457825, -0.28459596633911133, -0.2112429141998291, 0.47394877672195435, -0.2302190065383911, 0.11974000930786133, -0.24999986588954926, -0.2962946891784668, -0.39187681674957275, 0.2862187325954437, 0.3978762924671173, 0.07251154631376266, 0.1412551999092102, -0.13498833775520325, -0.03869073837995529, 0.04122808948159218, 0.48431357741355896, -0.09932473301887512, 0.225853830575943, 0.4956790506839752, 0.02487163245677948, 0.28804874420166016, -0.06619159877300262, 0.10953962802886963, 0.30557042360305786, -0.04663004353642464, 0.04373753070831299, 0.06314888596534729, -0.15501385927200317, 0.06655920296907425, 0.4291420876979828, 0.7526010274887085, -0.13102304935455322, -0.2490009069442749, -0.45246148109436035, 0.17454040050506592, -0.08148657530546188, -0.2427971065044403, 0.11097057908773422, -0.4469160735607147, -0.047955647110939026, -0.27853843569755554, 0.029398880898952484, -0.2576921880245209, 0.2814691662788391, 0.3924873471260071, -0.19167406857013702, -0.02139199525117874, 0.1671924591064453, 0.19325031340122223, -0.30965593457221985, 0.15211814641952515, -0.1599285900592804, -0.1441938579082489, 0.21786904335021973, -0.03342565521597862, -0.23082613945007324, 0.07764505594968796, -0.3538423180580139, 0.6696915030479431, 0.14245350658893585, 0.2333173155784607, -0.14578384160995483, 0.09985117614269257, 0.07911670207977295, 0.38960546255111694, 0.06611829996109009, 0.26542752981185913, 0.23750030994415283, 0.2252817302942276, 0.3318825364112854, 0.16103927791118622, 0.1671888530254364, -0.06652558594942093, -0.3713436424732208, 0.3061205744743347, -0.18199189007282257, 0.2523796856403351, -0.12711986899375916, -0.008958384394645691, -0.1402481347322464, -0.4405941367149353, -0.20617671310901642, 0.13019444048404694, 0.34997302293777466, 0.06480200588703156, -0.2857009470462799, 0.09418907761573792, 0.31922590732574463, -0.03759331256151199, -0.23343265056610107, -0.09303702414035797, 0.18951061367988586, -0.11643891781568527, -0.20442737638950348, 0.3286340534687042, -0.0631709024310112, 0.3758121132850647, 0.02561322972178459, -0.11888985335826874, -0.5087630152702332, 0.4685606062412262, 0.15397590398788452, -0.06488034874200821, 0.2793195843696594, -0.11763492226600647, 0.05138454586267471, 0.1282423883676529, -0.23894426226615906, -0.40182238817214966, 0.3124614953994751, -0.11377504467964172, -0.34346210956573486, -0.11790220439434052, 0.06968872249126434, -0.23083117604255676, 0.1649962067604065, -0.5134676098823547, 0.3172644078731537, -0.15583571791648865, -0.007158420979976654, 0.19838908314704895, 0.052508413791656494, 0.016972504556179047, -0.1357390433549881, 0.324823796749115, 0.6602092385292053, -0.4402143359184265, -0.13490600883960724, -0.2816395163536072, 0.09373144805431366, -0.10656556487083435, -0.07588790357112885, -0.6155893206596375, 0.39655226469039917, -0.3423711061477661, 0.02634049952030182, 0.5156226754188538, 0.02135004848241806, -0.058804504573345184, 0.3099675476551056, -0.043904148042201996, -0.10276452451944351, 0.05307473987340927, -0.06136467307806015, 0.27577096223831177, 0.010114144533872604, 0.08470246195793152, 0.2880440354347229, -0.09131663292646408, -0.05771523341536522, 0.24215085804462433, -0.10067448765039444, 0.4470912516117096, -0.11391040682792664, -0.28244930505752563, 0.11610373854637146, 0.19903242588043213, 0.06466169655323029, 0.04928617924451828, -0.2567257881164551, 0.07566274702548981, 0.284402459859848, 0.19800716638565063, -0.18156379461288452, 0.030897684395313263, -0.056668467819690704, -0.39986422657966614, -0.0878998264670372, 0.2620006799697876, -0.23946750164031982, 0.16995711624622345, -0.030615907162427902, -0.3805883526802063, 0.20345231890678406, 0.23953576385974884, -0.17754775285720825, -0.08121120929718018, -0.22315800189971924, 0.03374867886304855, -0.22953778505325317, -0.05852581188082695, 0.3211343288421631, -0.3688659369945526, 0.06270691752433777, -0.4198136031627655, 0.062217921018600464, 0.10713131725788116, -0.2627652585506439, 0.15611380338668823, -0.260887086391449, 0.12337706238031387, -0.1320326179265976, -0.10344598442316055, 0.3966411352157593, 0.5294779539108276, 0.0033891983330249786, 0.20446959137916565, -0.013889074325561523, 0.08334162086248398, 0.19020262360572815, 0.019876061007380486, 0.39249101281166077, 0.007157064974308014, 0.1732836812734604, -0.7456400394439697, 0.37001273036003113, 0.11556721478700638, 0.09057019650936127, 0.1314634084701538, 0.06175176054239273, 0.484106183052063, 0.10142795741558075, -0.44013282656669617, -0.19990088045597076, 0.11286154389381409, 0.32751116156578064, 0.10008299350738525, 0.09118480980396271, -0.4386371374130249, -0.14872068166732788, -0.27494657039642334, -0.3684227764606476, 0.292359858751297, 0.4243645668029785, 0.15836450457572937, -0.2343013882637024, 0.3227711319923401, 0.2957632541656494, 0.8113273978233337, 0.20007529854774475, 0.17786437273025513, -0.26013392210006714, -0.06313115358352661, -0.08035767078399658, 0.09032581001520157, 0.09503538906574249, 0.039552923291921616, -0.14428181946277618, 0.14298105239868164, -0.28164538741111755, -0.06716187298297882, -0.43673378229141235, 0.13230255246162415, 0.21283625066280365, -0.4686039388179779, 0.2154775708913803, -0.3254088759422302, 0.09101594984531403, 0.114372618496418, -0.09135861694812775, -0.03801088035106659, 0.2281191200017929, 0.03777776286005974, 0.07215234637260437, -0.18694978952407837, 0.0667470172047615, -0.3063148856163025, 0.31243234872817993, 0.16791531443595886, -0.016879785805940628, 0.04660901427268982, 0.21145328879356384, -0.24789564311504364, -0.08045978844165802, 0.021428421139717102, 0.2204701006412506, 0.34999972581863403, 0.18801406025886536, -0.30543267726898193, -0.2945483326911926, -0.22154176235198975, -0.006479059346020222, 0.15715338289737701, 0.7015658617019653, 0.44003188610076904, 0.4335732161998749, -0.1935315579175949, -0.001938454806804657, -0.2734474837779999, 0.04715663939714432, -0.04827127605676651, -0.006990514695644379, -0.11621949076652527, 0.27119866013526917, 0.053506240248680115, -0.37354615330696106, -0.13277550041675568, -0.19815915822982788, 0.19557486474514008, 0.1665613055229187, 0.11276213079690933, 0.2478846162557602, 0.5506395697593689, -0.028806444257497787, 0.30881422758102417, -0.023728111758828163, 0.047090351581573486, -0.2587839663028717, 0.36809393763542175, -0.37640106678009033, -0.19975146651268005, -0.035979680716991425, -0.2560935616493225, -0.14190034568309784, 0.17657992243766785, -0.16762672364711761, -0.2742386758327484, 0.04602512717247009, 0.09713367372751236, -0.3200528919696808, 0.03491266071796417, 0.49505138397216797, -0.11830651015043259, -0.005441691726446152, -0.22938713431358337, -0.4139132499694824, 0.2927325963973999, 0.17441332340240479, 0.16849583387374878, 0.2186592072248459, 0.6507177352905273, -0.13915768265724182, 0.270799458026886, 0.3310401737689972, -0.14155998826026917, 0.24150320887565613, -0.2326861172914505, 0.19894930720329285, 0.09888060390949249, 0.23784515261650085, -0.17005261778831482, 0.16223327815532684, -0.21052855253219604, 0.03637288510799408, 0.11687366664409637, 0.050383955240249634, 0.2736372947692871, -0.31145092844963074, -0.38795939087867737, -0.1492537260055542, 0.30009040236473083, -0.29605886340141296, 0.2704322338104248, -0.10576090216636658, -0.09061500430107117, -0.4775370657444, 0.11395909637212753, -0.21928414702415466, 0.09822195023298264, 0.09107041358947754, 0.04299712926149368, -0.42313334345817566, 0.048047985881567, -0.11528122425079346, 0.0332040973007679, 0.08573432266712189, 0.5595670342445374, -0.0589231513440609, 0.0999782532453537, 0.20428407192230225, 0.14881154894828796, 0.9818503260612488, -0.3207607865333557, 0.18129375576972961, -0.051822394132614136, 0.02207837998867035, -0.5749592185020447, -0.015601903200149536, -0.02374763786792755, 0.24097488820552826, 0.07267101109027863, 0.267131507396698, -0.08771516382694244, -0.19669072329998016, 0.22751396894454956, 0.3385205864906311, 0.029631316661834717, -0.2005060911178589, 0.09222349524497986, -0.38290083408355713, -0.43025943636894226, 0.10148945450782776, 0.1956600397825241, 0.12540458142757416, 0.07504579424858093, -0.3260384202003479, -0.16019633412361145, -0.2694852948188782, 0.0009025074541568756, 0.27622658014297485, 0.3601815104484558, 0.30693796277046204, 0.2794087529182434, -0.07017229497432709, -0.21022634208202362, 0.23122920095920563, 0.11331623792648315, 0.18698379397392273, -0.10720577090978622, 0.016652289777994156, 0.05383748933672905, 0.16348981857299805, 0.16503655910491943, -0.25229471921920776, 0.2115774005651474, -0.0829295963048935, 0.19478605687618256, 0.15100373327732086, 0.020362339913845062, 0.29224294424057007, -0.08029797673225403, -0.09898632764816284, -0.43996912240982056, 0.32770222425460815, -0.04135739058256149, -0.09346878528594971, 0.5242297053337097, -0.315664142370224, -0.26982593536376953, 0.05121738836169243, 0.3413292169570923, 0.634161114692688, -0.029093865305185318, 0.07422743737697601, -0.0041702426970005035, -0.3330937325954437, 0.4453313648700714, -0.05362513288855553, -0.047296639531850815, 0.011550486087799072, -0.09491999447345734, 0.13591793179512024, -0.3150036334991455, 0.2556842565536499, 0.17863887548446655, -0.15712183713912964, -0.01716054230928421, -0.40315085649490356, -0.11332911252975464, 0.09369517862796783, 0.2813906967639923, -0.13104814291000366, -0.34659427404403687, -0.6330784559249878, 0.03580894321203232, -0.17349936068058014, -0.16675332188606262, 0.1024027019739151, -0.023420535027980804, -0.061264730989933014, -0.42555493116378784, -0.2491566240787506, -0.11044825613498688, -0.05611168220639229, -0.03345472738146782, 0.4136117994785309, -0.2759796977043152, 0.1745326817035675, 0.4596197009086609, 0.04452555626630783, 0.17859765887260437, -0.11953600496053696, 0.17473958432674408, -0.4046790301799774, -0.08875875920057297, -0.32588765025138855, 0.07421854138374329, 0.3026164174079895, 0.06398878991603851, -0.09547197073698044, 0.33084338903427124, -0.013536162674427032, -0.26041269302368164, -0.0903741642832756, 0.027531523257493973, -0.06457588821649551, -0.43607500195503235, -0.19978097081184387, -0.20096436142921448, 0.060629092156887054, -0.19831453263759613, 0.03053734079003334, 0.3192635774612427, -0.3456944227218628, 0.1145714744925499, -0.145542711019516, -0.04191609472036362, -0.027454394847154617, 0.22593989968299866, -0.03975865617394447, 0.03267394006252289, 0.4414371848106384, 0.29500627517700195, 0.1905703991651535, -0.16760370135307312, 0.33211755752563477, 0.4602632522583008, -0.08031222224235535, 0.4682047367095947, -0.10838538408279419, 0.14564980566501617, -0.150019109249115, 0.13575387001037598, 0.06980890035629272, 0.3079747259616852, 0.050432801246643066, -0.4424161911010742, -0.5563502907752991, 0.008469417691230774, -0.17211228609085083, 0.3595743775367737, -0.10608292371034622, -0.34842389822006226, 0.04560244083404541, 0.09252946823835373, -0.10444887727499008, -0.08274132013320923, -0.17065152525901794, 0.1939326822757721, 0.22458022832870483, 0.3701461851596832, -0.020150259137153625, -0.053293753415346146, -0.0337434783577919, -0.10958314687013626, -0.08980832993984222, -0.1520857959985733, -0.3364766240119934, 0.13489946722984314, -0.1263611763715744, -0.10262472927570343, 0.01153099536895752, -0.3348238468170166, -0.06092508137226105, -0.1692524254322052, 0.1592855155467987, -0.05493195727467537, -0.0685567632317543, 0.046596426516771317, 0.09282071888446808, -0.2541584074497223, -0.031559161841869354, -0.007584397215396166, -0.08479824662208557, 0.26596570014953613, 0.22438964247703552, 0.16057804226875305, 0.3150195777416229, 0.0428687185049057, -0.5326340198516846, 0.2883267402648926, -0.16691456735134125, 0.0066840760409832, -0.24567486345767975, -0.06230024993419647, 0.004066653549671173, 0.01800835132598877, 0.1060667484998703, 0.3264889717102051, -0.47390538454055786, 0.5189520716667175, 0.29334452748298645, 0.05184851586818695, -0.06277245283126831, -0.39756807684898376, 0.12646420300006866, -0.04968409612774849, 0.019535891711711884, 0.33749136328697205, -0.17761576175689697, -0.12882667779922485, -0.03276590257883072, -0.046970173716545105, 0.11902996897697449, 0.041908517479896545, 0.16732889413833618, 0.7793412804603577, -0.24271532893180847, -0.19376744329929352, -0.1370309740304947, 0.3108167350292206, 0.38527846336364746, -0.029403842985630035, 0.012937968596816063, 0.26881134510040283, 0.12998071312904358, 0.1620303988456726, -0.08446159213781357, -0.2366483509540558, 0.1928836554288864, 0.19000642001628876, -0.07029058039188385, 0.03117513284087181, 0.14496305584907532, 0.1653379201889038, 0.10059811174869537, 0.16091856360435486, -0.15675142407417297, -0.21577908098697662, 0.07071110606193542, -0.2550761103630066, -0.2785690724849701, 0.04685792326927185, -0.25140947103500366, 0.0723215788602829, 0.14720328152179718, -0.38964611291885376, 0.014731578528881073, -0.043005380779504776, -0.20869863033294678, -0.3218163549900055, 0.33339452743530273, 0.1673537939786911, -0.22515547275543213, -0.31079936027526855, -0.01943248324096203, -0.25637727975845337, -0.14809831976890564, 0.12205865979194641, 0.027503004297614098, 0.3130829930305481, 0.08493848145008087, 0.2188277244567871, 0.11909491568803787, 0.21740815043449402, -0.1640375554561615, 0.011290967464447021, 0.12483123689889908, 0.15809498727321625, 0.013222239911556244, -0.03820008039474487, 0.04595685750246048, 0.05294417962431908, 0.35820990800857544, 0.2600898742675781, -0.27921223640441895, -0.5821537971496582, 0.07660622894763947, 0.00931544043123722, -0.11157391965389252, -0.0714966431260109, -0.07387353479862213, -0.15362036228179932, -0.06956369429826736, 0.3509690761566162, -0.15443558990955353, -0.012686945497989655, 0.07840297371149063, 0.02054174616932869, -0.3485049307346344, 0.12032359838485718, -0.3175825774669647, 0.3294698894023895, -0.15186122059822083, -0.16745026409626007, -0.21659719944000244, -0.19091297686100006, -0.339885413646698, -0.3616296648979187, 0.4096244275569916, -0.03519200533628464, -0.1739424169063568, 0.03469757363200188, 0.0718499943614006, 0.02832835167646408, -0.21507766842842102, 0.5182698965072632, 0.002340361475944519, -0.5703690052032471, 0.024383731186389923, 0.5496191382408142, -0.020218785852193832, -0.10096368193626404, 0.038766033947467804, -0.37693583965301514, -0.15924644470214844, -0.18816187977790833, 0.0791248232126236, 0.16392004489898682, 0.1426226943731308, 0.3391796946525574, 0.03338484466075897, 0.29342392086982727, 0.08365992456674576, 0.2789493799209595, -0.3054356575012207, 0.035260725766420364, -0.052756235003471375, 0.295665442943573, 0.09118258953094482, 0.07325446605682373, -0.3517020642757416, -0.03857769817113876, -0.18439628183841705, -0.0543828122317791, 0.03698646277189255, -0.030070291832089424, -0.06959880888462067, 0.06742973625659943, -0.1604570895433426, 0.20180866122245789, 0.19765609502792358, -0.03652353957295418, -0.22390274703502655, 0.08594956994056702, 0.007863521575927734, 0.0668317899107933, 0.2433733344078064, -0.4632966220378876, -0.3660762310028076, -0.11590040475130081, 0.3754626512527466, -0.2754381000995636, -0.4218970239162445, -0.1695420891046524, 0.13730686902999878, 0.5002285242080688, -0.1569928526878357, -0.29321759939193726, 0.4224153757095337, -0.0038182511925697327, 0.042185768485069275, 0.028644472360610962, 0.2769210636615753, 0.16330939531326294, 0.25437259674072266, -0.032356441020965576, -0.41103416681289673 ]
https://github.com/huggingface/datasets/issues/5724
Moving `"en"` to the end of the path instead of passing it as a config name should fix the error: ```python import datasets dataset = datasets.load_dataset('/path/to/your/data/dir/en', streaming=True, split='train') dataset = dataset.shuffle(buffer_size=10_000, seed=42) next(iter(dataset)) ``` PS: https://github.com/huggingface/datasets/pull/5331, once merged, will allow us to define C4's configs in its README, making downloading it much more user-friendly.
Error after shuffling streaming IterableDatasets with downloaded dataset
### Describe the bug I downloaded the C4 dataset, and used streaming IterableDatasets to read it. Everything went normal until I used `dataset = dataset.shuffle(seed=42, buffer_size=10_000)` to shuffle the dataset. Shuffled dataset will throw the following error when it is used by `next(iter(dataset))`: ``` File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 937, in __iter__ for key, example in ex_iterable: File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 627, in __iter__ for x in self.ex_iterable: File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 138, in __iter__ yield from self.generate_examples_fn(**kwargs_with_shuffled_shards) File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 763, in wrapper for key, table in generate_tables_fn(**kwargs): File "/data/miniconda3/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 101, in _generate_tables batch = f.read(self.config.chunksize) File "/data/miniconda3/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 372, in read_with_retries out = read(*args, **kwargs) File "/data/miniconda3/lib/python3.9/gzip.py", line 300, in read return self._buffer.read(size) File "/data/miniconda3/lib/python3.9/_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "/data/miniconda3/lib/python3.9/gzip.py", line 487, in read if not self._read_gzip_header(): File "/data/miniconda3/lib/python3.9/gzip.py", line 435, in _read_gzip_header raise BadGzipFile('Not a gzipped file (%r)' % magic) gzip.BadGzipFile: Not a gzipped file (b've') ``` I found that there is no problem to use the dataset in this way without shuffling. Also, use `dataset = datasets.load_dataset('c4', 'en', split='train', streaming=True)`, which will download the dataset on-the-fly instead of loading from the local file, will also not have problems even after shuffle. ### Steps to reproduce the bug 1. Download C4 dataset from https://huggingface.co/datasets/allenai/c4 2. ``` import datasets dataset = datasets.load_dataset('/path/to/your/data/dir', 'en', streaming=True, split='train') dataset = dataset.shuffle(buffer_size=10_000, seed=42) next(iter(dataset)) ``` ### Expected behavior `next(iter(dataset))` should give me a sample from the dataset ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.32-1-tlinux4-0001-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3
54
Error after shuffling streaming IterableDatasets with downloaded dataset ### Describe the bug I downloaded the C4 dataset, and used streaming IterableDatasets to read it. Everything went normal until I used `dataset = dataset.shuffle(seed=42, buffer_size=10_000)` to shuffle the dataset. Shuffled dataset will throw the following error when it is used by `next(iter(dataset))`: ``` File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 937, in __iter__ for key, example in ex_iterable: File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 627, in __iter__ for x in self.ex_iterable: File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 138, in __iter__ yield from self.generate_examples_fn(**kwargs_with_shuffled_shards) File "/data/miniconda3/lib/python3.9/site-packages/datasets/iterable_dataset.py", line 763, in wrapper for key, table in generate_tables_fn(**kwargs): File "/data/miniconda3/lib/python3.9/site-packages/datasets/packaged_modules/json/json.py", line 101, in _generate_tables batch = f.read(self.config.chunksize) File "/data/miniconda3/lib/python3.9/site-packages/datasets/download/streaming_download_manager.py", line 372, in read_with_retries out = read(*args, **kwargs) File "/data/miniconda3/lib/python3.9/gzip.py", line 300, in read return self._buffer.read(size) File "/data/miniconda3/lib/python3.9/_compression.py", line 68, in readinto data = self.read(len(byte_view)) File "/data/miniconda3/lib/python3.9/gzip.py", line 487, in read if not self._read_gzip_header(): File "/data/miniconda3/lib/python3.9/gzip.py", line 435, in _read_gzip_header raise BadGzipFile('Not a gzipped file (%r)' % magic) gzip.BadGzipFile: Not a gzipped file (b've') ``` I found that there is no problem to use the dataset in this way without shuffling. Also, use `dataset = datasets.load_dataset('c4', 'en', split='train', streaming=True)`, which will download the dataset on-the-fly instead of loading from the local file, will also not have problems even after shuffle. ### Steps to reproduce the bug 1. Download C4 dataset from https://huggingface.co/datasets/allenai/c4 2. ``` import datasets dataset = datasets.load_dataset('/path/to/your/data/dir', 'en', streaming=True, split='train') dataset = dataset.shuffle(buffer_size=10_000, seed=42) next(iter(dataset)) ``` ### Expected behavior `next(iter(dataset))` should give me a sample from the dataset ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.4.32-1-tlinux4-0001-x86_64-with-glibc2.28 - Python version: 3.9.16 - Huggingface_hub version: 0.13.1 - PyArrow version: 11.0.0 - Pandas version: 1.5.3 Moving `"en"` to the end of the path instead of passing it as a config name should fix the error: ```python import datasets dataset = datasets.load_dataset('/path/to/your/data/dir/en', streaming=True, split='train') dataset = dataset.shuffle(buffer_size=10_000, seed=42) next(iter(dataset)) ``` PS: https://github.com/huggingface/datasets/pull/5331, once merged, will allow us to define C4's configs in its README, making downloading it much more user-friendly.
[ -0.20790359377861023, -0.09794382750988007, -0.018992431461811066, 0.29914191365242004, 0.2917645573616028, 0.10431277751922607, 0.16898494958877563, 0.2264639139175415, -0.27683454751968384, 0.19730517268180847, -0.1995200216770172, 0.16217230260372162, -0.39054492115974426, 0.10089597851037979, -0.10409994423389435, -0.023318849503993988, 0.0636739656329155, 0.15542766451835632, -0.15880633890628815, 0.13923147320747375, -0.15998367965221405, -0.01603182591497898, -0.420154869556427, -0.062346190214157104, 0.11291003227233887, -0.08608686178922653, -0.015448160469532013, 0.3159712851047516, -0.28399649262428284, -0.4734480082988739, 0.3431376516819, 0.24322761595249176, 0.2677362859249115, 0.5064917206764221, -0.00011082873243140057, 0.08997038006782532, 0.31282293796539307, -0.2835904359817505, -0.32652953267097473, -0.15918757021427155, -0.09032972157001495, 0.3481130301952362, -0.2619929611682892, -0.21999642252922058, -0.01094450056552887, -0.4781351685523987, -0.09685534238815308, -0.3212994337081909, 0.04855726659297943, 0.25567999482154846, 0.22406452894210815, -0.02531341463327408, -0.021270059049129486, -0.0026411041617393494, 0.16284310817718506, -0.09917367994785309, -0.0009703487157821655, 0.2453751266002655, 0.10260727256536484, 0.31661540269851685, 0.00229659304022789, 0.18297341465950012, -0.13030347228050232, 0.2604999542236328, 0.17952454090118408, -0.2634013295173645, -0.11155088245868683, -0.06608650088310242, 0.15945804119110107, 0.13477212190628052, 0.5271533727645874, -0.36838406324386597, -0.24870853126049042, -0.283951997756958, 0.13976451754570007, -0.259502112865448, 0.18478313088417053, 0.020303204655647278, 0.05624879524111748, -0.23125065863132477, -0.17274703085422516, 0.29039981961250305, -0.16676321625709534, 0.10019013285636902, 0.09823310375213623, 0.46032676100730896, -0.1642957180738449, 0.15381938219070435, 0.31919530034065247, -0.174127459526062, 0.7665525078773499, 0.009195057675242424, -0.3432014584541321, 0.20100557804107666, -0.32181286811828613, -0.11601419746875763, -0.000360613688826561, 0.3030685484409332, 0.03855492174625397, 0.006957648321986198, 0.2558979094028473, -0.05023862048983574, 0.0969928503036499, -0.14166738092899323, 0.3528856635093689, 0.10528825223445892, -0.15844020247459412, 0.28010693192481995, 0.06456650048494339, 0.43840616941452026, 0.17787663638591766, -0.2514909505844116, 0.05031868442893028, -0.025109300389885902, -0.09397187829017639, 0.17541757225990295, 0.10613358020782471, -0.16804112493991852, -0.3109477758407593, -0.19455267488956451, -0.3858559727668762, 0.07993084192276001, 0.17941518127918243, 0.39719095826148987, -0.011832848191261292, 0.19482238590717316, -0.07011763006448746, 0.12394846230745316, 0.08303310722112656, -0.09784151613712311, -0.14813676476478577, -0.12300306558609009, -0.11017785966396332, -0.0060750264674425125, 0.0807824581861496, -0.2587246894836426, 0.4132208824157715, -0.014910921454429626, 0.1954839527606964, 0.21464481949806213, -0.022787153720855713, -0.15586447715759277, 0.10138335824012756, 0.26888588070869446, 0.02076219767332077, 0.11967295408248901, 0.07693900167942047, -0.15387463569641113, -0.01761382818222046, 0.06217634677886963, -0.05385735630989075, -0.22324323654174805, -0.0020158812403678894, 0.2576565146446228, -0.23806707561016083, 0.041967835277318954, -0.37971097230911255, -0.1962122619152069, 0.2625916004180908, -0.2667754292488098, 0.11547882854938507, -0.42185673117637634, -0.07753480225801468, -0.2969699501991272, -0.010000232607126236, 0.19819366931915283, -0.15297096967697144, 0.0795070081949234, -0.3336288034915924, -0.05833178758621216, 0.5122064352035522, 0.3406563401222229, -0.1435067355632782, 0.19887903332710266, -0.3170355558395386, 0.1357116997241974, -0.020139344036579132, -0.02830006182193756, -0.5861600637435913, 0.14393290877342224, -0.0006499812006950378, 0.5607964992523193, -0.013271879404783249, -0.10203088074922562, 0.3918096423149109, -0.32051530480384827, 0.2747277021408081, 0.052000612020492554, -0.24959039688110352, 0.20455893874168396, -0.2687625288963318, 0.035563647747039795, 0.22824755311012268, 0.2090260088443756, -0.07919799536466599, 0.03037857636809349, 0.18314528465270996, 0.11024618148803711, 0.331853985786438, -0.24983343482017517, 0.09803572297096252, -0.04224216192960739, 0.23878511786460876, 0.13759982585906982, 0.1825215071439743, -0.08619724214076996, -0.4085022509098053, 0.11028696596622467, 0.15644337236881256, -0.18176616728305817, -0.11265654861927032, -0.1077536791563034, -0.09959308803081512, -0.10927127301692963, -0.48261159658432007, -0.2880587875843048, 0.18211835622787476, 0.20479686558246613, 0.13795587420463562, -0.03241659700870514, 0.07440922409296036, 0.20319607853889465, -0.4578627943992615, -0.18630890548229218, -0.07344453036785126, 0.2152014672756195, -0.09380140900611877, -0.18863478302955627, 0.1665993630886078, 0.1579139083623886, 0.18649396300315857, -0.14002470672130585, -0.07188817113637924, 0.4155159592628479, 0.007885847240686417, -0.017689909785985947, -0.08408708870410919, 0.3113316297531128, 0.3425215780735016, -0.06992974877357483, 0.039136797189712524, 0.2628151774406433, 0.2713925540447235, -0.09681899845600128, 0.3429323136806488, 0.2326880842447281, -0.42789924144744873, 0.13770663738250732, 0.11271146684885025, -0.0790725126862526, 0.383303701877594, 0.24032607674598694, 0.004590064287185669, 0.0019776076078414917, 0.33460110425949097, -0.22600892186164856, 0.027189746499061584, -0.1594451665878296, -0.36456993222236633, 0.13224834203720093, 0.37522804737091064, 0.10196206718683243, -0.35608425736427307, -0.005648122169077396, -0.13542203605175018, -0.11826916038990021, 0.14330744743347168, 0.571099579334259, 0.4575881361961365, 0.1062324121594429, -0.025806114077568054, 0.1707141250371933, 0.26231738924980164, -0.14938116073608398, 0.13487458229064941, -0.03096771240234375, 0.23305250704288483, 0.2744331359863281, -0.011945182457566261, -0.04786236584186554, -0.23497135937213898, -0.3700679838657379, -0.00989583507180214, 0.5853360891342163, -0.2726050317287445, -0.007658869028091431, -0.1803857684135437, -0.23568320274353027, -0.08373310416936874, -0.3529732823371887, -0.05650143325328827, -0.39893993735313416, -0.056506235152482986, 0.6890279054641724, -0.24836593866348267, 0.03324089199304581, -0.07440217584371567, 0.04610792547464371, 0.2583589553833008, 0.20020967721939087, -0.2953627109527588, -0.034934140741825104, -0.12354721128940582, 0.13569998741149902, 0.33226916193962097, -0.27295318245887756, 0.25745123624801636, -0.055961038917303085, -0.10577131807804108, -0.36668795347213745, -0.19803303480148315, 0.0269866194576025, -0.08249863982200623, 0.06499750167131424, 0.19915497303009033, 0.1928301751613617, 0.045456647872924805, -0.5920088291168213, 0.14742465317249298, -0.2408265918493271, 0.025213778018951416, 0.28656184673309326, -0.23226216435432434, -0.1799161583185196, -0.12804223597049713, -0.21690061688423157, -0.31631505489349365, -0.3707352876663208, 0.22330942749977112, 0.003317497670650482, 0.048274531960487366, 0.19562502205371857, -0.058782365173101425, -0.03156821429729462, 0.000520411878824234, -0.4181830883026123, -0.31238269805908203, -0.45767438411712646, 0.13026753067970276, -0.15414273738861084, -0.23596124351024628, -0.08241108804941177, 0.04828346520662308, 0.21628132462501526, 0.46238043904304504, -0.22618433833122253, 0.39550745487213135, -0.11105231195688248, 0.04702422022819519, -0.029989376664161682, -0.31005731225013733, 0.3061555325984955, -0.023425349965691566, 0.06635463237762451, -0.2328963577747345, 0.15670371055603027, 0.13278788328170776, 0.050720974802970886, 0.2895691692829132, 0.09672166407108307, 0.2757625877857208, 0.2393636554479599, 0.7376419305801392, 0.06952457129955292, -0.02733524888753891, 0.2753491997718811, 0.1615143120288849, 0.25730061531066895, -0.05822889134287834, -0.23318973183631897, 0.3410184383392334, 0.07627630978822708, -0.25756731629371643, 0.2545883059501648, -0.31401312351226807, -0.369966059923172, -0.08067874610424042, 0.18979406356811523, -0.1555509865283966, -0.04756971448659897, -0.0002994239330291748, -0.029313448816537857, 0.1305830478668213, -0.026810120791196823, 0.07997037470340729, 0.026425443589687347, -0.19975408911705017, -0.12830951809883118, 0.08000533282756805, 0.14400115609169006, 0.14057977497577667, -0.35643211007118225, -0.3913661241531372, -0.2089911252260208, 0.21906031668186188, 0.31126993894577026, 0.5816498398780823, 0.10587272047996521, -0.10111372917890549, 0.010774396359920502, 0.023200776427984238, 0.5361383557319641, -0.21091264486312866, -0.03674444183707237, 0.14729878306388855, 0.08816874027252197, -0.25070905685424805, -0.3831942081451416, -0.32948487997055054, 0.3052314221858978, 0.1689893901348114, 0.2940635085105896, -0.1653216928243637, 0.274602472782135, 0.024239305406808853, -0.11161608248949051, 0.09016313403844833, -0.08123654127120972, -0.14908495545387268, -0.40163326263427734, -0.17041900753974915, 0.08038134127855301, -0.07164274901151657, 0.12177452445030212, -0.180111825466156, 0.060764625668525696, 0.12710188329219818, 0.03036605566740036, -0.08641153573989868, 0.2603994905948639, 0.28799715638160706, 0.12721937894821167, 0.27470269799232483, 0.4245854616165161, -0.0279371477663517, 0.6582000255584717, 0.1576838195323944, 0.38830578327178955, -0.1053963229060173, -0.028544655069708824, -0.08069049566984177, -0.18657860159873962, 0.05632273107767105, -0.1454002410173416, 0.05776216834783554, 0.0701851099729538, 0.1751835197210312, -0.15060484409332275, 0.014007657766342163, 0.2764427661895752, -0.18104581534862518, -0.5546125769615173, -0.6819992661476135, 0.10359682142734528, -0.15893062949180603, 0.10915853083133698, 0.7464430928230286, -0.011129066348075867, -0.2195805311203003, 0.10963787138462067, -0.01494644582271576, 0.5414447784423828, -0.051218170672655106, -0.1368333101272583, 0.49090346693992615, 0.004672996699810028, -0.10045947134494781, -0.35583949089050293, 0.22306616604328156, -0.17891456186771393, -0.5686448216438293, 0.00032003968954086304, -0.10921452939510345, 0.15586796402931213, 0.027114475145936012, -0.32831546664237976, 0.18601731956005096, -0.026589863002300262, 0.09468893706798553, -0.0688181072473526, -0.12910300493240356, -0.45786112546920776, -0.0636100098490715, -0.127995565533638, 0.17951038479804993, -0.21576566994190216, -0.026096154004335403, -0.03708638995885849, 0.0012650489807128906, 0.05245240032672882, -0.059087883681058884, -0.3570416271686554, 0.16410094499588013, -0.33994561433792114, -0.027526434510946274, -0.3113383650779724, 0.07816645503044128, 0.2009638547897339, -0.024856846779584885, 0.10176114737987518, 0.1514642983675003, -0.112401582300663, 0.2821040153503418, 0.12405049800872803, -0.17014464735984802, 0.08533209562301636, 0.0854252427816391, 0.002697031944990158, -0.07281389832496643, -0.12306731194257736, 0.15174001455307007, 0.19107265770435333, -0.4815576672554016, -0.12852568924427032, -0.13409140706062317, -0.009013963863253593, -0.15825751423835754, -0.12453268468379974, 0.07659624516963959, -0.045220933854579926, -0.13182875514030457, 0.14445693790912628, -0.17308108508586884, -0.20614652335643768, 0.035917818546295166, -0.2232455015182495, -0.19520524144172668, -0.11933909356594086, 0.463997483253479, 0.1339332014322281, 0.21289914846420288, 0.45577794313430786, -0.05085647478699684, -0.25308841466903687, -0.15758931636810303, -0.296220064163208, -0.3693978190422058, -0.11480216681957245, 0.1965325027704239, -0.23765438795089722, 0.16018728911876678, -0.22646111249923706, 0.22072404623031616, 0.11699332296848297, 0.1563524305820465, -0.059664107859134674, -0.44696128368377686, -0.31646519899368286, 0.15166893601417542, -0.15351513028144836, 0.2245464324951172, 0.08611078560352325, 0.26317963004112244, -0.133331760764122, -0.14928755164146423, -0.33795902132987976, -0.039038319140672684, -0.10987992584705353, 0.1987438201904297, 0.07267411053180695, -0.16058215498924255, 0.19629070162773132, -0.10186795890331268, 0.18402069807052612, 0.34097719192504883, -0.08856932818889618, -0.21461084485054016, -0.06993603706359863, 0.06695128977298737, 0.2738693654537201, -0.33378320932388306, 0.0911027193069458, -0.2789458632469177, -0.27001792192459106, -0.05192483961582184, 0.28228116035461426, 0.26428407430648804, 0.07515892386436462, 0.08703404664993286, 0.5499334931373596, -0.1511785387992859, 0.07677142322063446, 0.25226524472236633, -0.15154951810836792, -0.23554082214832306, 0.07124437391757965, 0.2444467395544052, -0.19963738322257996, -0.09264711290597916, -0.03201046586036682, 0.07810701429843903, 0.007941961288452148, 0.16679388284683228, 0.5085173845291138, -0.4953170120716095, 0.24185554683208466, 0.25739020109176636, 0.2730618715286255, 0.5480741858482361, -0.200789675116539, -0.3815174698829651, 0.36454707384109497, 0.171858012676239, -0.13129693269729614, 0.0016749538481235504, -0.16621550917625427, 0.2061275690793991, -0.12656542658805847, 0.053555361926555634, -0.04546866565942764, -0.49812132120132446, 0.15608111023902893, 0.14476889371871948, 0.3773013651371002, -0.355998158454895, 0.3712880611419678, 0.26796144247055054, -0.17858654260635376, -0.13452674448490143, -0.060996927320957184, -0.12724435329437256, 0.008568651974201202, 0.5012189745903015, -0.15795345604419708, 0.25823086500167847, 0.15028125047683716, -0.18879073858261108, -0.008655071258544922, -0.6028268337249756, -0.22310851514339447, 0.37304794788360596, -0.20052692294120789, 0.4262298047542572, 0.4007124602794647, 0.04847025126218796, 0.15620820224285126, 0.040984734892845154, -0.14265090227127075, -0.0538833849132061, -0.22992472350597382, 0.1668802797794342, -0.0077050477266311646, -0.4155159592628479, -0.1822362244129181, 0.18220482766628265, -0.057618845254182816, 0.15151026844978333, 0.2528509795665741, 0.011868447065353394, -0.38324302434921265, -0.5372598171234131, 0.11359798908233643, 0.19166290760040283, 0.22828742861747742, -0.3706710636615753, 0.0319795086979866, 0.32824715971946716, 0.07712837308645248, 0.18307557702064514, 0.008400676771998405, 0.3817647397518158, 0.3686205744743347, 0.07466889917850494, 0.1814761757850647, -0.06027800589799881, -0.06242801249027252, 0.09405292570590973, 0.22558552026748657, 0.36219826340675354, 0.14421425759792328, 0.23182913661003113, 0.16883814334869385, -0.2022562175989151, -0.045121271163225174, 0.2143457978963852, 0.2830072343349457, -0.04471387341618538, -0.03555096313357353, -0.1319076120853424, 0.17068257927894592, -0.038799453526735306, 0.09842747449874878, -0.317990779876709, 0.12571319937705994, -0.0746157169342041, -0.1524883508682251, 0.2910560071468353, -0.0002523846924304962, 0.10387806594371796, 0.07513968646526337, 0.49177446961402893, 0.3258180320262909, -0.20218507945537567, -0.24925950169563293, -0.5319001078605652, -0.3329344689846039, 0.0590677373111248, -0.1334640234708786, 0.2630845606327057, 0.04503859952092171, 0.3340664505958557, 0.10233066976070404, -0.1006341502070427, 0.19577081501483917, 0.13379934430122375, -0.02519383653998375, 0.37164223194122314, -0.19600984454154968, -0.2795713543891907, -0.17779049277305603, -0.10917861014604568, 0.09943142533302307, -0.44374600052833557, -0.0017530955374240875, 0.09431396424770355, 0.15209928154945374, 0.02678593620657921, 0.0832810029387474, -0.049140505492687225, -0.3579449951648712, 0.11479678004980087, 0.07304885983467102, 0.3032742440700531, -0.043323058634996414, 0.00915072113275528, -0.4364820420742035, -0.21832384169101715, -0.2587049901485443, -0.03818172216415405, 0.1298818290233612, 0.42023134231567383, 0.1046885997056961, -0.1248437911272049, -0.4473089277744293, 0.4351649880409241, 0.05533362925052643, 0.2791658639907837, -0.40897950530052185, 0.4075402617454529, -0.22988571226596832, 0.2755209803581238, -0.13570189476013184, -0.04126695170998573, 0.05376719310879707, 0.12751281261444092, -0.21617811918258667, -0.2507387101650238, 0.7316330671310425, -0.3783407509326935, -0.14785157144069672, 0.030889999121427536, 0.011556986719369888, -0.002894233912229538, -0.13617528975009918, -0.35947635769844055, 0.28848227858543396, 0.4172465205192566, -0.23268648982048035, 0.007933378219604492, 0.12822414934635162, -0.051872044801712036, 0.02564212679862976, -0.03326968476176262, 0.43949466943740845, 0.15092682838439941, -0.4697285294532776, 0.2340676486492157, -0.1520143449306488 ]
https://github.com/huggingface/datasets/issues/5722
Hmm the error doesn't seem related to data loading. Regarding `split_dataset_by_node`: it's generally used to split an iterable dataset (e.g. when streaming) in pytorch DDP. It's not needed if you use a regular dataset since the pytorch DataLoader already assigns a subset of the dataset indices to each node.
Distributed Training Error on Customized Dataset
Hi guys, recently I tried to use `datasets` to train a dual encoder. I finish my own datasets according to the nice [tutorial](https://huggingface.co/docs/datasets/v2.11.0/en/dataset_script) Here are my code: ```python class RetrivalDataset(datasets.GeneratorBasedBuilder): """CrossEncoder dataset.""" BUILDER_CONFIGS = [RetrivalConfig(name="DuReader")] # DEFAULT_CONFIG_NAME = "DuReader" def _info(self): return datasets.DatasetInfo( features=datasets.Features( { "id": datasets.Value("string"), "question": datasets.Value("string"), "documents": Sequence(datasets.Value("string")), } ), supervised_keys=None, ) def _split_generators(self, dl_manager): """Returns SplitGenerators.""" train_file = self.config.data_dir + self.config.train_file valid_file = self.config.data_dir + self.config.valid_file logger.info(f"Training on {self.config.train_file}") logger.info(f"Evaluating on {self.config.valid_file}") return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"file_path": train_file} ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={"file_path": valid_file} ), ] def _generate_examples(self, file_path): with jsonlines.open(file_path, "r") as f: for record in f: label = record["label"] question = record["question"] # dual encoder all_documents = record["all_documents"] positive_paragraph = all_documents.pop(label) all_documents = [positive_paragraph] + all_documents u_id = "{}_#_{}".format( md5_hash(question + "".join(all_documents)), "".join(random.sample(string.ascii_letters + string.digits, 7)), ) item = { "question": question, "documents": all_documents, "id": u_id, } yield u_id, item ``` It works well on single GPU, but got errors as follows when used DDP: ```python Detected mismatch between collectives on ranks. Rank 1 is running collective: CollectiveFingerPrint(OpType=BARRIER), but Rank 0 is running collective: CollectiveFingerPrint(OpType=ALLGATHER_COALESCED) ``` Here are my train script on a two A100 mechine: ```bash export TORCH_DISTRIBUTED_DEBUG=DETAIL export TORCH_SHOW_CPP_STACKTRACES=1 export NCCL_DEBUG=INFO export NCCL_DEBUG_SUBSYS=INIT,COLL,ENV nohup torchrun --nproc_per_node 2 train.py experiments/de-big.json >logs/de-big.log 2>&1& ``` I am not sure if this error below related to my dataset code when use DDP. And I notice the PR(#5369 ), but I don't know when and where should I used the function(`split_dataset_by_node`) . @lhoestq hope you could help me?
49
Distributed Training Error on Customized Dataset Hi guys, recently I tried to use `datasets` to train a dual encoder. I finish my own datasets according to the nice [tutorial](https://huggingface.co/docs/datasets/v2.11.0/en/dataset_script) Here are my code: ```python class RetrivalDataset(datasets.GeneratorBasedBuilder): """CrossEncoder dataset.""" BUILDER_CONFIGS = [RetrivalConfig(name="DuReader")] # DEFAULT_CONFIG_NAME = "DuReader" def _info(self): return datasets.DatasetInfo( features=datasets.Features( { "id": datasets.Value("string"), "question": datasets.Value("string"), "documents": Sequence(datasets.Value("string")), } ), supervised_keys=None, ) def _split_generators(self, dl_manager): """Returns SplitGenerators.""" train_file = self.config.data_dir + self.config.train_file valid_file = self.config.data_dir + self.config.valid_file logger.info(f"Training on {self.config.train_file}") logger.info(f"Evaluating on {self.config.valid_file}") return [ datasets.SplitGenerator( name=datasets.Split.TRAIN, gen_kwargs={"file_path": train_file} ), datasets.SplitGenerator( name=datasets.Split.VALIDATION, gen_kwargs={"file_path": valid_file} ), ] def _generate_examples(self, file_path): with jsonlines.open(file_path, "r") as f: for record in f: label = record["label"] question = record["question"] # dual encoder all_documents = record["all_documents"] positive_paragraph = all_documents.pop(label) all_documents = [positive_paragraph] + all_documents u_id = "{}_#_{}".format( md5_hash(question + "".join(all_documents)), "".join(random.sample(string.ascii_letters + string.digits, 7)), ) item = { "question": question, "documents": all_documents, "id": u_id, } yield u_id, item ``` It works well on single GPU, but got errors as follows when used DDP: ```python Detected mismatch between collectives on ranks. Rank 1 is running collective: CollectiveFingerPrint(OpType=BARRIER), but Rank 0 is running collective: CollectiveFingerPrint(OpType=ALLGATHER_COALESCED) ``` Here are my train script on a two A100 mechine: ```bash export TORCH_DISTRIBUTED_DEBUG=DETAIL export TORCH_SHOW_CPP_STACKTRACES=1 export NCCL_DEBUG=INFO export NCCL_DEBUG_SUBSYS=INIT,COLL,ENV nohup torchrun --nproc_per_node 2 train.py experiments/de-big.json >logs/de-big.log 2>&1& ``` I am not sure if this error below related to my dataset code when use DDP. And I notice the PR(#5369 ), but I don't know when and where should I used the function(`split_dataset_by_node`) . @lhoestq hope you could help me? Hmm the error doesn't seem related to data loading. Regarding `split_dataset_by_node`: it's generally used to split an iterable dataset (e.g. when streaming) in pytorch DDP. It's not needed if you use a regular dataset since the pytorch DataLoader already assigns a subset of the dataset indices to each node.
[ -0.19576290249824524, -0.12930820882320404, 0.04221225529909134, 0.3095168173313141, 0.5364697575569153, -0.051189810037612915, 0.23426277935504913, 0.19125810265541077, 0.044005297124385834, 0.10703392326831818, -0.10220550000667572, 0.23422609269618988, -0.3720554709434509, 0.20775169134140015, -0.22512981295585632, -0.13405869901180267, -0.24675866961479187, 0.10811873525381088, -0.14026609063148499, -0.3047988712787628, -0.00036040693521499634, 0.2655008137226105, -0.18132707476615906, -0.0030619800090789795, -0.46258819103240967, -0.0900469571352005, 0.015006408095359802, 0.25978565216064453, -0.20671357214450836, -0.272541880607605, 0.44378793239593506, 0.03486538678407669, 0.28800857067108154, 0.4505883455276489, -0.00010472736175870523, 0.2102080136537552, 0.2118310183286667, -0.2480839043855667, -0.35052376985549927, 0.15765561163425446, -0.010531023144721985, -0.005913253873586655, -0.0395464226603508, -0.24191230535507202, -0.33968567848205566, -0.36836427450180054, -0.0032241670414805412, -0.4353574216365814, 0.4071248769760132, 0.25582754611968994, 0.32375192642211914, 0.09232982993125916, -0.06503747403621674, -0.16169053316116333, -0.2972932755947113, 0.23807740211486816, -0.11910788714885712, 0.2237626016139984, -0.015161339193582535, 0.030307307839393616, -0.2299211025238037, 0.417422354221344, 0.09745145589113235, 0.13253188133239746, 0.11871527135372162, -0.11450842767953873, -0.24903729557991028, 0.025244953110814095, -0.011295771226286888, 0.05525749921798706, 0.15180794894695282, -0.16093118488788605, -0.28724390268325806, -0.42191487550735474, -0.049404509365558624, -0.1439112275838852, 0.30197611451148987, 0.0015329532325267792, -0.03985041752457619, 0.24721458554267883, -0.4647378921508789, -0.1267865002155304, -0.1861557960510254, 0.02312406525015831, -0.15514200925827026, 0.3346490263938904, -0.20264668762683868, 0.16951125860214233, 0.07863713800907135, 0.04290251061320305, 0.076988086104393, -0.05284206569194794, -0.07213804125785828, 0.12204399704933167, -0.22456660866737366, -0.2154686003923416, -0.030193891376256943, -0.28009870648384094, 0.15744271874427795, 0.1301562637090683, 0.0319712869822979, -0.18051451444625854, -0.14128313958644867, 0.04284165799617767, 0.2452794909477234, 0.24876947700977325, -0.10644739866256714, 0.5758762359619141, -0.017406633123755455, 0.24658651649951935, -0.26757460832595825, 0.03226376324892044, -0.048356205224990845, -0.23714831471443176, 0.0695609450340271, 0.20539408922195435, 0.04790195822715759, -0.20474201440811157, -0.3915627598762512, 0.1137891560792923, -0.03389522805809975, 0.03837883844971657, 0.1659504771232605, 0.09634357690811157, -0.0752730742096901, 0.013828016817569733, -0.10641641914844513, 0.14920854568481445, -0.22465550899505615, -0.1613556146621704, -0.3470485806465149, 0.15345892310142517, -0.3008884787559509, 0.05801928788423538, 0.10319811850786209, -0.14741283655166626, 0.2720544934272766, -0.04985332116484642, 0.14731912314891815, -0.10600097477436066, -0.010628603398799896, -0.0877402126789093, 0.03540903329849243, 0.02467808872461319, -0.13944566249847412, 0.19904032349586487, 0.30218207836151123, -0.1824277937412262, -0.022419914603233337, -0.2432960420846939, -0.20816543698310852, -0.5656512379646301, -0.10180605202913284, 0.25570014119148254, -0.07841259241104126, 0.07828021794557571, -0.1677667498588562, 0.23014628887176514, 0.47545236349105835, -0.05895661562681198, 0.009861189872026443, -0.12895432114601135, -0.22350630164146423, -0.1242864578962326, 0.38205769658088684, 0.3609708845615387, -0.12320919334888458, -0.20779800415039062, -0.02896861918270588, -0.056962791830301285, 0.3340452015399933, 0.5398877263069153, -0.31770068407058716, 0.24454104900360107, -0.21317553520202637, 0.041765227913856506, 0.37875932455062866, -0.26349160075187683, -0.20994791388511658, 0.371724396944046, -0.29766273498535156, 0.1832544356584549, 0.0710725486278534, -0.27955079078674316, 0.36142659187316895, -0.0414140410721302, 0.12277133762836456, 0.1373893916606903, -0.18158897757530212, 0.17371371388435364, -0.4105871319770813, -0.1760825216770172, 0.07451388984918594, 0.25750795006752014, 0.13283100724220276, -0.08266811072826385, 0.03472619503736496, 0.1490153968334198, 0.21954026818275452, -0.2313927263021469, 0.3322932720184326, 0.4584676921367645, -0.1107211485505104, 0.12529852986335754, -0.013545356690883636, -0.018435698002576828, -0.19197580218315125, 0.27319544553756714, 0.10631395876407623, 0.19707268476486206, -0.006140749901533127, -0.11200982332229614, -0.2193896472454071, -0.2800906002521515, -0.4165900647640228, -0.553606390953064, 0.2549687325954437, 0.2425176203250885, 0.16836252808570862, 0.14013342559337616, -0.08506478369235992, 0.32635730504989624, -0.17476800084114075, -0.057694338262081146, -0.3705633878707886, 0.306668221950531, -0.03740697726607323, -0.22353550791740417, 0.010568879544734955, 0.21485310792922974, 0.1379593312740326, -0.06422068178653717, -0.23317250609397888, 0.30146324634552, -0.0634898766875267, -0.059803556650877, 0.2707348167896271, 0.016366347670555115, -0.014896241016685963, -0.4070059061050415, 0.06048904359340668, 0.3265262842178345, 0.020998477935791016, 0.14797808229923248, -0.09371700882911682, 0.2502593398094177, -0.08087175339460373, -0.06058458238840103, -0.09464724361896515, 0.17580744624137878, 0.3439876437187195, -0.021519869565963745, -0.035207971930503845, -0.2632361054420471, 0.02531561441719532, -0.3157486021518707, -0.009620234370231628, 0.09310540556907654, -0.2834019064903259, 0.028697067871689796, 0.5303164124488831, 0.27064675092697144, -0.09967371821403503, 0.027977921068668365, 0.03098956309258938, -0.023496929556131363, 0.0723535344004631, 0.5211997032165527, 0.5052649974822998, 0.015646763145923615, 0.2662304639816284, 0.22237509489059448, -0.16203582286834717, -0.04494637995958328, 0.21954965591430664, -0.24793824553489685, 0.09999537467956543, 0.28936466574668884, 0.002609413117170334, 0.11322842538356781, -0.34202516078948975, -0.23028072714805603, 0.20642662048339844, 0.3372125029563904, -0.3023774325847626, -0.027049023658037186, -0.408749520778656, -0.033088620752096176, -0.3833323121070862, -0.07283148914575577, -0.009862318634986877, -0.09925739467144012, 0.057216133922338486, 0.08166065812110901, -0.12680038809776306, 0.43734511733055115, 0.07253025472164154, 0.14357499778270721, 0.060878217220306396, -0.14444133639335632, 0.0013484805822372437, -0.11422500759363174, -0.2502445876598358, 0.09946174174547195, 0.18210960924625397, -0.10054822266101837, 0.17857791483402252, -0.055306240916252136, -0.20231562852859497, -0.4123368263244629, -0.17055001854896545, -0.065797820687294, -0.2205888032913208, 0.04107550531625748, 0.2650085389614105, -0.026954706758260727, -0.13190007209777832, -0.4091868996620178, 0.4570925235748291, -0.035491473972797394, -0.11387734115123749, 0.12841367721557617, 0.11678990721702576, -0.18382732570171356, -0.24576953053474426, -0.32864198088645935, -0.26779162883758545, -0.2734087109565735, 0.08309321105480194, -0.15146906673908234, 0.008754054084420204, 0.10469841957092285, -0.018796253949403763, -0.12074018269777298, -0.192884162068367, -0.04755696281790733, -0.2801075577735901, -0.4468304514884949, 0.21090392768383026, -0.39170849323272705, -0.2751180827617645, -0.1937926709651947, 0.07287928462028503, 0.41003844141960144, 0.12143318355083466, -0.4911700487136841, -0.043117403984069824, -0.05013369023799896, -0.0662168636918068, -0.1607789695262909, 0.10486111044883728, 0.384414404630661, 0.24859993159770966, -0.06342117488384247, -0.06482355296611786, -0.15315335988998413, 0.2373267561197281, -0.23806457221508026, 0.22275875508785248, -0.2021072804927826, 0.31742286682128906, 0.18389244377613068, 0.7119945883750916, 0.5218054056167603, -0.05476808547973633, 0.33718234300613403, -0.04847842454910278, 0.1496180295944214, 0.022615082561969757, -0.5093443393707275, 0.5384232401847839, -0.07001342624425888, -0.05557500943541527, 0.13297413289546967, -0.10401061177253723, -0.13028694689273834, -0.10814283043146133, 0.00788983702659607, -0.1538662314414978, -0.31898099184036255, -0.01073987316340208, -0.10141774266958237, 0.2857252061367035, -0.04985029995441437, 0.0037593841552734375, -0.14267699420452118, 0.09488055855035782, 0.0714857280254364, 0.21546012163162231, -0.03896782919764519, 0.05608019605278969, -0.3232279121875763, 0.1351945400238037, 0.08319572359323502, 0.12982439994812012, -0.03310815244913101, 0.1636778861284256, -0.155018612742424, 0.1277623474597931, 0.03919852524995804, 0.05003666877746582, 0.49524202942848206, -0.30586177110671997, -0.053457263857126236, -0.13675683736801147, -0.2149946689605713, -0.21480578184127808, -0.2204083800315857, -0.015504084527492523, 0.11172758787870407, 0.015793658792972565, 0.18381403386592865, -0.27943193912506104, -0.24770429730415344, 0.40169399976730347, -0.20671741664409637, -0.2306353598833084, 0.000025149434804916382, -0.15343829989433289, -0.4276112914085388, -0.2192198932170868, 0.11084172129631042, 0.16440704464912415, 0.26947829127311707, -0.09172771871089935, -0.030249595642089844, -0.17660892009735107, 0.19325412809848785, 0.03754609823226929, -0.018137257546186447, 0.12887880206108093, -0.04369433969259262, 0.3463229238986969, 0.14102545380592346, 0.18493446707725525, 0.302681565284729, 0.7005245685577393, -0.03285118192434311, -0.5396270751953125, -0.10145831108093262, 0.015479832887649536, -0.05463641136884689, 0.254518985748291, -0.1986863613128662, -0.020145989954471588, 0.11929626762866974, 0.26447421312332153, -0.2379523068666458, 0.17989635467529297, 0.39352673292160034, -0.06686699390411377, -0.34107905626296997, -0.587655246257782, 0.03855137526988983, -0.03398746997117996, -0.03034103661775589, 0.20080728828907013, 0.026420876383781433, -0.35526973009109497, -0.029830697923898697, 0.10083873569965363, 0.6395033597946167, 0.2750398516654968, 0.17121541500091553, 0.2693389654159546, -0.013878092169761658, 0.34223684668540955, -0.11482585221529007, 0.014919005334377289, -0.3749374747276306, -0.33136704564094543, -0.026833660900592804, 0.03470306843519211, 0.2426789551973343, 0.18377837538719177, -0.0930696502327919, 0.2303570955991745, 0.23634620010852814, -0.022103512659668922, -0.07086075097322464, 0.257200688123703, -0.1434761881828308, -0.18270283937454224, -0.26546740531921387, 0.17589177191257477, -0.2132168859243393, 0.011576315388083458, 0.0935564786195755, -0.24400298297405243, -0.09482810646295547, -0.38039106130599976, -0.29620182514190674, 0.05257455259561539, -0.3466246426105499, 0.18455174565315247, 0.2999168038368225, -0.2408055067062378, 0.31300783157348633, 0.37186190485954285, 0.5220730304718018, 0.13112808763980865, -0.17277419567108154, 0.08836735785007477, -0.18008269369602203, 0.02922762557864189, 0.057983413338661194, -0.14926260709762573, 0.4063049256801605, -0.047217462211847305, -0.3045240342617035, -0.05895199999213219, 0.07337123155593872, -0.036931704729795456, -0.09298251569271088, -0.11505311727523804, 0.23212237656116486, -0.39059412479400635, -0.172302708029747, -0.1920396089553833, 0.17237471044063568, -0.2399163544178009, 0.16910982131958008, 0.2167714238166809, -0.2708955705165863, 0.1448579728603363, -0.044460926204919815, -0.23022595047950745, -0.1252163052558899, 0.4453889727592468, 0.02369726076722145, 0.08973817527294159, 0.4322202205657959, -0.20303285121917725, -0.19464823603630066, -0.24649368226528168, 0.18081480264663696, 0.3867039978504181, -0.5578112006187439, 0.09290437400341034, 0.019598789513111115, -0.0816962942481041, 0.07638563215732574, 0.36064431071281433, 0.2887534499168396, 0.20975612103939056, 0.23911452293395996, -0.1276008039712906, -0.24711722135543823, -0.049409836530685425, -0.22791405022144318, 0.12788794934749603, 0.243960902094841, 0.337456077337265, -0.02690078690648079, 0.07556607574224472, -0.4111447036266327, 0.13193413615226746, -0.2113809585571289, 0.018963951617479324, 0.11813883483409882, -0.186360165476799, 0.23293229937553406, 0.13494473695755005, 0.17106544971466064, -0.0038200458511710167, -0.21027320623397827, -0.21585142612457275, -0.2328418791294098, 0.10172306001186371, 0.2144356518983841, -0.14364901185035706, -0.06711433827877045, -0.23049628734588623, -0.33121275901794434, -0.09750029444694519, 0.21694335341453552, 0.1808953434228897, 0.06801705062389374, 0.3818744122982025, 0.15397344529628754, -0.22027860581874847, -0.15420597791671753, 0.02498083934187889, -0.19412708282470703, 0.06533954292535782, 0.07362411916255951, 0.08604729920625687, -0.07617580145597458, -0.1417504847049713, -0.28915759921073914, 0.09185899049043655, 0.00022510811686515808, 0.36611923575401306, 0.28274065256118774, -0.3691817820072174, -0.03905649483203888, 0.02476859837770462, 0.5021146535873413, 0.14026658236980438, -0.4211745858192444, -0.22071613371372223, 0.4574679732322693, 0.23978814482688904, -0.07694477587938309, -0.05276482552289963, 0.3745862543582916, 0.10830514132976532, 0.14410504698753357, 0.31265339255332947, 0.031189262866973877, -0.10592789202928543, 0.03891194984316826, 0.03661282733082771, 0.5314760804176331, -0.24730773270130157, 0.14242838323116302, 0.38010987639427185, -0.12134680896997452, 0.07327231764793396, 0.0758005827665329, 0.08309894800186157, 0.17965193092823029, 0.4272864758968353, -0.18274827301502228, 0.38224491477012634, 0.11846385896205902, -0.05635262280702591, -0.16484200954437256, -0.3764917850494385, 0.15444262325763702, -0.10682713985443115, -0.12097255885601044, -0.022101301699876785, -0.28445684909820557, 0.28963348269462585, -0.30236077308654785, -0.04621617868542671, -0.09286762773990631, 0.3390357196331024, -0.17465834319591522, -0.163311168551445, -0.13488537073135376, -0.11164460331201553, -0.21615174412727356, 0.009559668600559235, -0.031448520720005035, 0.2081926017999649, 0.4829998016357422, -0.030941803008317947, -0.09309864044189453, -0.33592504262924194, 0.01723960041999817, 0.2241801768541336, 0.1754593700170517, -0.11907672137022018, 0.3357135057449341, 0.3945310711860657, -0.008851766586303711, 0.019088394939899445, 0.5173417925834656, 0.28167515993118286, 0.3688490092754364, 0.12803152203559875, -0.11274081468582153, 0.1612510085105896, 0.003263533115386963, -0.04579095169901848, 0.40285781025886536, -0.1271239072084427, -0.000036203302443027496, 0.45920443534851074, 0.19444185495376587, -0.18585720658302307, 0.047958727926015854, 0.1192307323217392, -0.03280649334192276, -0.07947123795747757, 0.34502315521240234, 0.027183812111616135, 0.2793107032775879, -0.07568621635437012, 0.10269370675086975, -0.5553320646286011, -0.23097491264343262, 0.3083452880382538, 0.09879851341247559, 0.3310582935810089, -0.257138729095459, 0.1168484091758728, 0.12356293201446533, 0.5159093141555786, 0.2416963279247284, 0.04265109449625015, -0.27942296862602234, -0.19087077677249908, -0.6349541544914246, 0.36321330070495605, -0.01873576082289219, -0.38895922899246216, -0.2722172737121582, 0.05545511096715927, 0.05940447747707367, -0.09566524624824524, -0.04122547805309296, 0.06634438037872314, 0.08139342069625854, 0.3337887227535248, -0.20883658528327942, -0.15028509497642517, -0.10968257486820221, -0.012177816592156887, 0.1910744458436966, -0.2729288935661316, 0.16202062368392944, 0.16470743715763092, 0.14088189601898193, 0.17245829105377197, 0.08563263714313507, -0.2935570776462555, -0.25802624225616455, 0.04604510962963104, 0.1500036120414734, 0.47173404693603516, -0.1848810315132141, -0.048175811767578125, -0.2675698399543762, -0.02822113409638405, -0.3097527027130127, 0.31681621074676514, 0.21762438118457794, 0.7431837916374207, -0.2769908308982849, -0.06190723180770874, -0.4371301829814911, 0.2374226301908493, 0.16494223475456238, 0.16019044816493988, -0.22714272141456604, 0.39136090874671936, 0.1943502128124237, 0.0021851174533367157, 0.3221116364002228, 0.38569176197052, 0.037576645612716675, 0.28008952736854553, -0.2573840916156769, -0.41117674112319946, 0.6818336248397827, -0.30746716260910034, -0.21023446321487427, 0.09744665026664734, 0.13757267594337463, 0.1465783417224884, -0.24724368751049042, -0.6471346616744995, 0.1210373044013977, 0.32161667943000793, -0.09538054466247559, -0.29526287317276, 0.09464964270591736, -0.0028638429939746857, -0.0899863913655281, 0.06011439859867096, 0.06218035891652107, -0.02337963692843914, -0.11283096671104431, 0.5501183271408081, -0.06344261765480042 ]
https://github.com/huggingface/datasets/issues/5720
I'm experiencing the same problem that @jlehrer1. I was able to reproduce it with a very small example: ```py from datasets import Dataset, load_dataset, load_dataset_builder from torch.utils.data import DataLoader def my_gen(): for i in range(1, 4): yield {"a": i} # Saving the dataset as a parquet file dataset = Dataset.from_generator(my_gen) train_path = "/tmp/test.parquet" dataset.to_parquet(train_path) # Creating a local dataset from the parquet file data_files = {"train": [str(train_path)]} builder = load_dataset_builder("parquet", data_files=data_files) builder.download_and_prepare("/tmp/test_ds", file_format="parquet") # Loading the dataset from the local directory as streaming dataset = load_dataset("parquet", data_dir="/tmp/test_ds", split="train", streaming=True) dataset.with_format("torch") dl = DataLoader(dataset, batch_size=2, num_workers=1) for row in dl: print(row) ``` My env info: ``` datasets 2.11.0 torch 2.0.0 torchvision 0.15.1 Python 3.9.16 ``` Note that the example above doesn't fail if the number of workers used is `0`
Streaming IterableDatasets do not work with torch DataLoaders
### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ```
129
Streaming IterableDatasets do not work with torch DataLoaders ### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ``` I'm experiencing the same problem that @jlehrer1. I was able to reproduce it with a very small example: ```py from datasets import Dataset, load_dataset, load_dataset_builder from torch.utils.data import DataLoader def my_gen(): for i in range(1, 4): yield {"a": i} # Saving the dataset as a parquet file dataset = Dataset.from_generator(my_gen) train_path = "/tmp/test.parquet" dataset.to_parquet(train_path) # Creating a local dataset from the parquet file data_files = {"train": [str(train_path)]} builder = load_dataset_builder("parquet", data_files=data_files) builder.download_and_prepare("/tmp/test_ds", file_format="parquet") # Loading the dataset from the local directory as streaming dataset = load_dataset("parquet", data_dir="/tmp/test_ds", split="train", streaming=True) dataset.with_format("torch") dl = DataLoader(dataset, batch_size=2, num_workers=1) for row in dl: print(row) ``` My env info: ``` datasets 2.11.0 torch 2.0.0 torchvision 0.15.1 Python 3.9.16 ``` Note that the example above doesn't fail if the number of workers used is `0`
[ -0.5225951075553894, -0.38292956352233887, 0.009423822164535522, 0.47212132811546326, 0.3441590964794159, 0.09382329136133194, 0.6252887845039368, 0.10292047262191772, -0.1920423060655594, 0.22818687558174133, -0.23222973942756653, 0.2899165749549866, -0.1994057297706604, -0.10757900029420853, -0.11898442357778549, -0.3624500036239624, 0.01737753301858902, -0.061575111001729965, -0.16203643381595612, 0.05500626564025879, -0.21589958667755127, 0.09493805468082428, -0.32884377241134644, -0.25713303685188293, 0.009635388851165771, -0.059689491987228394, -0.13640987873077393, 0.28710973262786865, 0.07346852868795395, -0.24837279319763184, 0.1440359354019165, -0.012905247509479523, 0.28496670722961426, 0.7305285930633545, -0.00011989229824393988, 0.0989341214299202, 0.20279714465141296, -0.187337726354599, -0.24740172922611237, -0.13179773092269897, -0.0417666882276535, 0.11642865836620331, -0.0008410587906837463, -0.1893954575061798, -0.049285128712654114, -0.07839731127023697, -0.11300640553236008, -0.3757691979408264, 0.1977761685848236, 0.16344541311264038, 0.10201427340507507, 0.44622310996055603, -0.21276524662971497, -0.07956929504871368, 0.26202237606048584, -0.03071557730436325, -0.2570575773715973, 0.2916766107082367, 0.45132091641426086, 0.2478068768978119, -0.2621922492980957, 0.3956548869609833, -0.2601097524166107, 0.22071591019630432, 0.11785946786403656, -0.22226879000663757, -0.5858621597290039, -0.31602776050567627, -0.023241937160491943, 0.17653349041938782, 0.31550076603889465, -0.24748188257217407, -0.2337014079093933, -0.3995482921600342, -0.08662458509206772, -0.5063938498497009, 0.24551212787628174, 0.15515205264091492, -0.10194505751132965, -0.1824977993965149, -0.10778959840536118, 0.13963693380355835, -0.21839554607868195, -0.017002955079078674, 0.1963242143392563, 0.2907770872116089, -0.04349776729941368, 0.2438451647758484, 0.18914423882961273, 0.07814045250415802, 0.5212911367416382, -0.10632793605327606, 0.07357998192310333, 0.09809594601392746, -0.3186013698577881, 0.041339799761772156, -0.22526781260967255, 0.032422829419374466, -0.14090442657470703, 0.23409393429756165, 0.3078678250312805, 0.10656854510307312, 0.14020834863185883, 0.15122130513191223, 0.309198796749115, -0.045830100774765015, -0.15562346577644348, 0.2805098593235016, 0.25232329964637756, 0.27945369482040405, 0.03767690062522888, -0.15309685468673706, -0.09059780836105347, -0.29787302017211914, -0.13691332936286926, 0.23895348608493805, 0.09748759120702744, -0.054957788437604904, -0.3115820288658142, -0.16337567567825317, -0.2689032256603241, -0.19393564760684967, 0.13966919481754303, 0.32429683208465576, 0.06421826779842377, 0.44342607259750366, -0.2551358640193939, 0.2059345245361328, -0.18135419487953186, -0.11222328245639801, -0.11025342345237732, -0.13309508562088013, 0.011522307991981506, 0.1262217015028, 0.20736736059188843, -0.4623427987098694, 0.33065265417099, 0.030378319323062897, 0.061630576848983765, 0.21531549096107483, 0.22680501639842987, -0.37437576055526733, 0.264085590839386, -0.017778856679797173, 0.23917976021766663, 0.24209575355052948, 0.18807335197925568, 0.3683931529521942, 0.028212621808052063, 0.24426668882369995, -0.15947820246219635, -0.40854763984680176, 0.33212438225746155, 0.13482272624969482, 0.04225742816925049, 0.04737066105008125, -0.029510971158742905, -0.0006876108236610889, 0.44024115800857544, -0.25005045533180237, 0.19947999715805054, -0.20769107341766357, -0.25996989011764526, -0.15762020647525787, 0.1476973593235016, 0.25482451915740967, -0.4742422103881836, -0.2957744002342224, 0.1491222381591797, -0.018712809309363365, 0.5408021211624146, 0.25288689136505127, -0.16295626759529114, 0.06551484763622284, -0.3190819025039673, 0.14732176065444946, 0.15817701816558838, -0.36829525232315063, -0.2226427048444748, 0.3770274817943573, 0.17792344093322754, 0.2965084910392761, 0.35372230410575867, 0.07421161234378815, 0.30635398626327515, -0.13749217987060547, 0.16905492544174194, 0.2777268588542938, -0.3632224500179291, 0.02658700942993164, -0.23797643184661865, 0.04532237350940704, 0.2927909791469574, 0.16724944114685059, 0.22602936625480652, -0.1255604475736618, -0.13876551389694214, 0.06361518800258636, 0.2860954701900482, 0.005653957836329937, 0.10075997561216354, 0.2915342450141907, 0.06993915885686874, -0.09179915487766266, 0.3083770275115967, 0.05358146131038666, -0.21314802765846252, 0.11781372129917145, 0.1648729145526886, -0.19210080802440643, 0.12533354759216309, 0.05181582272052765, -0.1987069994211197, -0.01951853558421135, -0.4524710178375244, -0.3549560308456421, 0.014963589608669281, 0.3225341737270355, 0.031500138342380524, -0.2237960696220398, -0.23069538176059723, 0.14960967004299164, -0.30650606751441956, 0.0016040951013565063, -0.36415809392929077, 0.23738884925842285, -0.10097959637641907, -0.3505174517631531, 0.07138078659772873, 0.14790071547031403, 0.2721678614616394, -0.21607686579227448, -0.18896690011024475, 0.45806384086608887, 0.10617709159851074, 0.23865142464637756, -0.12338238954544067, -0.027635037899017334, 0.4760303497314453, -0.3729514181613922, -0.04548106715083122, 0.42529410123825073, 0.15343232452869415, -0.14845788478851318, 0.04031576216220856, 0.26968663930892944, -0.4090662896633148, 0.5027818083763123, 0.1175396516919136, 0.1057751476764679, 0.17592406272888184, 0.1786171793937683, -0.008086565881967545, -0.04178321361541748, 0.10836378484964371, -0.08165949583053589, 0.2722974121570587, -0.12999361753463745, -0.4167408347129822, -0.020638998597860336, 0.26635101437568665, 0.3138432502746582, -0.24863320589065552, -0.07591451704502106, -0.25106123089790344, -0.041236259043216705, 0.5226642489433289, -0.21199464797973633, 0.5500940680503845, 0.08020490407943726, 0.29075929522514343, -0.15943551063537598, 0.1834823340177536, -0.2706812918186188, 0.22274570167064667, 0.21245892345905304, -0.08212839066982269, 0.37653523683547974, -0.10527137666940689, -0.029789289459586143, -0.2229491025209427, -0.028573360294103622, 0.005631454288959503, 0.09399886429309845, -0.14964070916175842, 0.2892394959926605, -0.1324279010295868, -0.079898402094841, -0.12486624717712402, -0.4198186695575714, -0.15910455584526062, -0.45900899171829224, 0.12112969160079956, 0.7704801559448242, -0.1568647176027298, 0.40888237953186035, -0.052828822284936905, 0.156090646982193, 0.414400577545166, -0.10589296370744705, -0.4357603192329407, -0.050118338316679, -0.1770017296075821, 0.07555882632732391, 0.2007197141647339, -0.4705236256122589, 0.3106052577495575, -0.046345703303813934, -0.2242192029953003, -0.3712427616119385, 0.09346145391464233, 0.25547412037849426, -0.09541870653629303, 0.05190040171146393, 0.22214625775814056, 0.001525774598121643, 0.14281697571277618, -0.38300418853759766, 0.11966359615325928, -0.2543981671333313, 0.013243049383163452, 0.08629418164491653, -0.0984276831150055, 0.29482823610305786, 0.011293493211269379, -0.45290684700012207, -0.10897186398506165, -0.37859484553337097, -0.06992632150650024, 0.11217018216848373, 0.03531746566295624, 0.053219206631183624, 0.13602158427238464, 0.12140089273452759, 0.4748218357563019, -0.15927258133888245, -0.1046859622001648, -0.38281646370887756, 0.33297476172447205, -0.31705376505851746, -0.22908993065357208, 0.05197061598300934, 0.04233211278915405, 0.33400315046310425, 0.31051185727119446, -0.262739896774292, -0.03736449405550957, -0.05446285009384155, 0.08956221491098404, -0.09292134642601013, 0.057873912155628204, 0.06649806350469589, 0.08443331718444824, 0.038826532661914825, -0.28554701805114746, 0.23108799755573273, 0.009538818150758743, -0.2966027557849884, 0.45695310831069946, 0.2036062330007553, 0.36425039172172546, 0.2993921637535095, 1.0282272100448608, 0.12160304188728333, -0.01682560332119465, 0.4850807785987854, -0.12384456396102905, 0.2234784960746765, -0.1241697445511818, -0.4238840937614441, 0.3847128748893738, -0.21536670625209808, -0.1298932135105133, 0.15370863676071167, -0.1445845514535904, -0.1440427303314209, -0.2248849868774414, 0.2552186846733093, 0.09366002678871155, -0.2433968484401703, 0.0952928215265274, -0.41219353675842285, 0.16690999269485474, -0.1776181012392044, 0.3302633762359619, -0.07306520640850067, -0.18438172340393066, 0.07955585420131683, -0.09275081753730774, 0.3248363137245178, -0.029537074267864227, -0.028307870030403137, 0.04433063790202141, -0.2938789129257202, 0.21962685883045197, 0.23734572529792786, 0.5560171008110046, -0.02668938785791397, -0.3964119553565979, -0.06080929562449455, -0.03855203837156296, 0.515249490737915, -0.05114728957414627, -0.09945714473724365, 0.16366370022296906, -0.07885058224201202, -0.175074502825737, -0.09596307575702667, -0.25722643733024597, 0.380420982837677, 0.17869816720485687, 0.23205719888210297, -0.13987907767295837, -0.01993102766573429, 0.12072639912366867, 0.07048624753952026, -0.04281509295105934, -0.00455104187130928, -0.24628449976444244, -0.06948623806238174, -0.38816672563552856, 0.096628338098526, 0.228700190782547, 0.18543583154678345, -0.45792651176452637, -0.14898818731307983, -0.04408428817987442, -0.22565041482448578, 0.10729625821113586, 0.025857537984848022, 0.14009040594100952, -0.17788083851337433, 0.20850586891174316, 0.28347259759902954, 0.15248006582260132, 0.3061876595020294, 0.4678601026535034, 0.043165914714336395, -0.388761430978775, 0.2867013216018677, -0.018174156546592712, 0.18008118867874146, 0.32033780217170715, -0.24386274814605713, -0.03739653155207634, -0.05225282907485962, 0.020100107416510582, -0.07011611759662628, 0.27558520436286926, 0.24362671375274658, -0.24242937564849854, -0.35848405957221985, -0.34499067068099976, -0.08126477897167206, 0.175763800740242, 0.16002227365970612, 0.7104059457778931, -0.4907808303833008, -0.12658649682998657, -0.018182218074798584, 0.12357065081596375, 0.7888496518135071, 0.14028574526309967, 0.051551807671785355, 0.29881906509399414, -0.03526199609041214, -0.1377466917037964, -0.3474712371826172, 0.17539668083190918, -0.3599192798137665, -0.24851398169994354, -0.031830571591854095, -0.10890217125415802, 0.1180039569735527, 0.05566699430346489, -0.2643822729587555, 0.26819488406181335, 0.13759255409240723, 0.5112708806991577, -0.0767722949385643, -0.27935025095939636, -0.5839853882789612, -0.2892840802669525, -0.029001478105783463, 0.008910704404115677, -0.041562873870134354, 0.1427319198846817, 0.007659837603569031, -0.1713184118270874, 0.32926663756370544, -0.26438480615615845, -0.16173629462718964, 0.1602398008108139, -0.5147598385810852, 0.03451356291770935, -0.1882278174161911, -0.689132571220398, -0.10269197821617126, 0.4235542118549347, 0.12440259754657745, -0.35279715061187744, -0.13404002785682678, 0.17331655323505402, 0.12435833364725113, 0.10684677958488464, -0.20918914675712585, 0.11340136080980301, 0.22738875448703766, -0.08079732954502106, 0.12453591823577881, 0.2899128794670105, -0.10799210518598557, -0.3156566619873047, 0.03393225371837616, 0.0599810890853405, 0.46457698941230774, -0.34480229020118713, 0.05728696659207344, -0.1494988203048706, -0.19628262519836426, -0.35355257987976074, 0.04182117432355881, -0.2496219426393509, -0.21189779043197632, 0.12546750903129578, -0.40131866931915283, 0.006846204400062561, -0.156015545129776, 0.5129434466362, -0.044351980090141296, -0.07249476760625839, 0.4913300573825836, 0.28293752670288086, -0.29032987356185913, -0.13884441554546356, 0.0928933322429657, -0.0003140680491924286, -0.3330520987510681, 0.17260998487472534, -0.06058087944984436, 0.01897493004798889, -0.20789027214050293, 0.2053745985031128, -0.0996684581041336, -0.03677753731608391, -0.3116658926010132, -0.11914350092411041, -0.43018072843551636, -0.0013418309390544891, 0.007889156229794025, 0.2916848361492157, -0.08969938009977341, -0.0975199043750763, 0.14109846949577332, -0.05487274378538132, -0.22009173035621643, -0.1761820912361145, -0.026413574814796448, 0.05627996101975441, 0.07251386344432831, -0.005669359117746353, 0.028967563062906265, 0.23670339584350586, 0.015179257839918137, 0.27491867542266846, 0.12173695117235184, -0.10878646373748779, -0.1304081678390503, 0.14089125394821167, 0.12422986328601837, -0.29688745737075806, -0.2528478801250458, -0.09537416696548462, -0.17998595535755157, -0.22811400890350342, 0.279987633228302, 0.1502162367105484, 0.009454937651753426, 0.3291289806365967, 0.3678610026836395, 0.22104324400424957, -0.16902035474777222, -0.09888917207717896, 0.013453077524900436, 0.2779969573020935, 0.06170652061700821, 0.054840825498104095, 0.023541633039712906, -0.1317143440246582, -0.0806717500090599, -0.11610095202922821, 0.5316942930221558, 0.07401809096336365, 0.26509809494018555, -0.29855185747146606, 0.05820218473672867, -0.02889283560216427, 0.38064759969711304, 0.6041972637176514, -0.12551619112491608, -0.09627706557512283, 0.1582089364528656, 0.09407556056976318, -0.14500030875205994, -0.1336018443107605, -0.17596691846847534, -0.11186594516038895, 0.030517220497131348, 0.16844531893730164, 0.21616604924201965, -0.06900186091661453, 0.16154669225215912, 0.1396290361881256, 0.17496967315673828, -0.18968483805656433, 0.34937140345573425, 0.5253764390945435, -0.12226977944374084, 0.03126560151576996, -0.07315198332071304, -0.23984113335609436, 0.28043869137763977, 0.20507650077342987, -0.24475908279418945, 0.6344394683837891, 0.1466398537158966, -0.07801471650600433, 0.16982389986515045, -0.6465381979942322, -0.5015547871589661, -0.41259080171585083, 0.014814328402280807, 0.11768478155136108, 0.07025568187236786, 0.43188750743865967, -0.1499505341053009, -0.175540491938591, -0.10185518115758896, 0.010220063850283623, -0.027190271764993668, -0.05064273253083229, -0.21551495790481567, -0.13907764852046967, -0.24302563071250916, 0.09340396523475647, 0.14139209687709808, 0.16610132157802582, 0.45904770493507385, 0.1601749062538147, -0.06504131853580475, -0.4751685857772827, 0.2645082473754883, 0.18667858839035034, 0.1351938247680664, -0.2320735603570938, 0.17134404182434082, 0.23194520175457, 0.16130630671977997, -0.010018706321716309, -0.02643410675227642, 0.3125239908695221, 0.2209039032459259, -0.08481159806251526, -0.12722620368003845, -0.010557401925325394, -0.005238201469182968, -0.11530772596597672, 0.3204529881477356, -0.24307881295681, 0.08561809360980988, 0.3911791443824768, 0.016919177025556564, -0.13043029606342316, 0.06486745178699493, 0.21312695741653442, 0.03498256579041481, -0.04087057709693909, 0.16354107856750488, -0.14090804755687714, -0.021279245615005493, -0.14333069324493408, -0.22229604423046112, -0.23106524348258972, -0.04338918253779411, 0.41052740812301636, -0.1895880401134491, 0.16433723270893097, -0.11313352733850479, 0.039107490330934525, 0.019256114959716797, 0.37871813774108887, 0.261532723903656, -0.13931940495967865, -0.4247131943702698, -0.05200490355491638, -0.2972584366798401, 0.14543716609477997, 0.21615225076675415, 0.06884744763374329, -0.08602187782526016, 0.23338744044303894, 0.06822297722101212, 0.12721186876296997, 0.08005627244710922, -0.23801782727241516, 0.44367313385009766, 0.5840612649917603, -0.426922470331192, -0.4204058051109314, -0.2557361125946045, 0.1133391410112381, 0.025140665471553802, -0.42043253779411316, 0.02634049393236637, 0.19142766296863556, 0.01263512670993805, 0.0700870007276535, -0.630852460861206, 0.17623132467269897, 0.14049512147903442, 0.22928062081336975, 0.034094057977199554, 0.15250056982040405, -0.0774247869849205, 0.23174113035202026, -0.22404420375823975, -0.3409464657306671, -0.15149739384651184, -0.0032608285546302795, 0.006915470585227013, 0.27821844816207886, -0.07147076725959778, -0.08516155183315277, -0.5791183710098267, 0.422981858253479, 0.15929755568504333, -0.15438637137413025, -0.290080189704895, 0.26404476165771484, -0.11535497009754181, 0.4027104675769806, -0.030467338860034943, 0.21172624826431274, -0.06497019529342651, 0.23117095232009888, -0.5497654676437378, -0.5589085221290588, 0.5257161259651184, -0.2894896864891052, -0.24059106409549713, -0.043862905353307724, -0.04450918734073639, 0.5395449995994568, 0.15301772952079773, -0.5534487962722778, 0.029855161905288696, 0.34851664304733276, -0.19137060642242432, 0.08860336244106293, 0.002845950424671173, 0.20203006267547607, 0.18687430024147034, -0.18505039811134338, 0.1252780556678772, 0.24285155534744263, -0.09387225657701492, 0.24918918311595917, -0.1282724291086197 ]
https://github.com/huggingface/datasets/issues/5720
I cannot reproduce this error, not even with your MRE @ivanprado (your env appears to be the same as Colab's, and your code runs there without issues).
Streaming IterableDatasets do not work with torch DataLoaders
### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ```
27
Streaming IterableDatasets do not work with torch DataLoaders ### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ``` I cannot reproduce this error, not even with your MRE @ivanprado (your env appears to be the same as Colab's, and your code runs there without issues).
[ -0.5225951075553894, -0.38292956352233887, 0.009423822164535522, 0.47212132811546326, 0.3441590964794159, 0.09382329136133194, 0.6252887845039368, 0.10292047262191772, -0.1920423060655594, 0.22818687558174133, -0.23222973942756653, 0.2899165749549866, -0.1994057297706604, -0.10757900029420853, -0.11898442357778549, -0.3624500036239624, 0.01737753301858902, -0.061575111001729965, -0.16203643381595612, 0.05500626564025879, -0.21589958667755127, 0.09493805468082428, -0.32884377241134644, -0.25713303685188293, 0.009635388851165771, -0.059689491987228394, -0.13640987873077393, 0.28710973262786865, 0.07346852868795395, -0.24837279319763184, 0.1440359354019165, -0.012905247509479523, 0.28496670722961426, 0.7305285930633545, -0.00011989229824393988, 0.0989341214299202, 0.20279714465141296, -0.187337726354599, -0.24740172922611237, -0.13179773092269897, -0.0417666882276535, 0.11642865836620331, -0.0008410587906837463, -0.1893954575061798, -0.049285128712654114, -0.07839731127023697, -0.11300640553236008, -0.3757691979408264, 0.1977761685848236, 0.16344541311264038, 0.10201427340507507, 0.44622310996055603, -0.21276524662971497, -0.07956929504871368, 0.26202237606048584, -0.03071557730436325, -0.2570575773715973, 0.2916766107082367, 0.45132091641426086, 0.2478068768978119, -0.2621922492980957, 0.3956548869609833, -0.2601097524166107, 0.22071591019630432, 0.11785946786403656, -0.22226879000663757, -0.5858621597290039, -0.31602776050567627, -0.023241937160491943, 0.17653349041938782, 0.31550076603889465, -0.24748188257217407, -0.2337014079093933, -0.3995482921600342, -0.08662458509206772, -0.5063938498497009, 0.24551212787628174, 0.15515205264091492, -0.10194505751132965, -0.1824977993965149, -0.10778959840536118, 0.13963693380355835, -0.21839554607868195, -0.017002955079078674, 0.1963242143392563, 0.2907770872116089, -0.04349776729941368, 0.2438451647758484, 0.18914423882961273, 0.07814045250415802, 0.5212911367416382, -0.10632793605327606, 0.07357998192310333, 0.09809594601392746, -0.3186013698577881, 0.041339799761772156, -0.22526781260967255, 0.032422829419374466, -0.14090442657470703, 0.23409393429756165, 0.3078678250312805, 0.10656854510307312, 0.14020834863185883, 0.15122130513191223, 0.309198796749115, -0.045830100774765015, -0.15562346577644348, 0.2805098593235016, 0.25232329964637756, 0.27945369482040405, 0.03767690062522888, -0.15309685468673706, -0.09059780836105347, -0.29787302017211914, -0.13691332936286926, 0.23895348608493805, 0.09748759120702744, -0.054957788437604904, -0.3115820288658142, -0.16337567567825317, -0.2689032256603241, -0.19393564760684967, 0.13966919481754303, 0.32429683208465576, 0.06421826779842377, 0.44342607259750366, -0.2551358640193939, 0.2059345245361328, -0.18135419487953186, -0.11222328245639801, -0.11025342345237732, -0.13309508562088013, 0.011522307991981506, 0.1262217015028, 0.20736736059188843, -0.4623427987098694, 0.33065265417099, 0.030378319323062897, 0.061630576848983765, 0.21531549096107483, 0.22680501639842987, -0.37437576055526733, 0.264085590839386, -0.017778856679797173, 0.23917976021766663, 0.24209575355052948, 0.18807335197925568, 0.3683931529521942, 0.028212621808052063, 0.24426668882369995, -0.15947820246219635, -0.40854763984680176, 0.33212438225746155, 0.13482272624969482, 0.04225742816925049, 0.04737066105008125, -0.029510971158742905, -0.0006876108236610889, 0.44024115800857544, -0.25005045533180237, 0.19947999715805054, -0.20769107341766357, -0.25996989011764526, -0.15762020647525787, 0.1476973593235016, 0.25482451915740967, -0.4742422103881836, -0.2957744002342224, 0.1491222381591797, -0.018712809309363365, 0.5408021211624146, 0.25288689136505127, -0.16295626759529114, 0.06551484763622284, -0.3190819025039673, 0.14732176065444946, 0.15817701816558838, -0.36829525232315063, -0.2226427048444748, 0.3770274817943573, 0.17792344093322754, 0.2965084910392761, 0.35372230410575867, 0.07421161234378815, 0.30635398626327515, -0.13749217987060547, 0.16905492544174194, 0.2777268588542938, -0.3632224500179291, 0.02658700942993164, -0.23797643184661865, 0.04532237350940704, 0.2927909791469574, 0.16724944114685059, 0.22602936625480652, -0.1255604475736618, -0.13876551389694214, 0.06361518800258636, 0.2860954701900482, 0.005653957836329937, 0.10075997561216354, 0.2915342450141907, 0.06993915885686874, -0.09179915487766266, 0.3083770275115967, 0.05358146131038666, -0.21314802765846252, 0.11781372129917145, 0.1648729145526886, -0.19210080802440643, 0.12533354759216309, 0.05181582272052765, -0.1987069994211197, -0.01951853558421135, -0.4524710178375244, -0.3549560308456421, 0.014963589608669281, 0.3225341737270355, 0.031500138342380524, -0.2237960696220398, -0.23069538176059723, 0.14960967004299164, -0.30650606751441956, 0.0016040951013565063, -0.36415809392929077, 0.23738884925842285, -0.10097959637641907, -0.3505174517631531, 0.07138078659772873, 0.14790071547031403, 0.2721678614616394, -0.21607686579227448, -0.18896690011024475, 0.45806384086608887, 0.10617709159851074, 0.23865142464637756, -0.12338238954544067, -0.027635037899017334, 0.4760303497314453, -0.3729514181613922, -0.04548106715083122, 0.42529410123825073, 0.15343232452869415, -0.14845788478851318, 0.04031576216220856, 0.26968663930892944, -0.4090662896633148, 0.5027818083763123, 0.1175396516919136, 0.1057751476764679, 0.17592406272888184, 0.1786171793937683, -0.008086565881967545, -0.04178321361541748, 0.10836378484964371, -0.08165949583053589, 0.2722974121570587, -0.12999361753463745, -0.4167408347129822, -0.020638998597860336, 0.26635101437568665, 0.3138432502746582, -0.24863320589065552, -0.07591451704502106, -0.25106123089790344, -0.041236259043216705, 0.5226642489433289, -0.21199464797973633, 0.5500940680503845, 0.08020490407943726, 0.29075929522514343, -0.15943551063537598, 0.1834823340177536, -0.2706812918186188, 0.22274570167064667, 0.21245892345905304, -0.08212839066982269, 0.37653523683547974, -0.10527137666940689, -0.029789289459586143, -0.2229491025209427, -0.028573360294103622, 0.005631454288959503, 0.09399886429309845, -0.14964070916175842, 0.2892394959926605, -0.1324279010295868, -0.079898402094841, -0.12486624717712402, -0.4198186695575714, -0.15910455584526062, -0.45900899171829224, 0.12112969160079956, 0.7704801559448242, -0.1568647176027298, 0.40888237953186035, -0.052828822284936905, 0.156090646982193, 0.414400577545166, -0.10589296370744705, -0.4357603192329407, -0.050118338316679, -0.1770017296075821, 0.07555882632732391, 0.2007197141647339, -0.4705236256122589, 0.3106052577495575, -0.046345703303813934, -0.2242192029953003, -0.3712427616119385, 0.09346145391464233, 0.25547412037849426, -0.09541870653629303, 0.05190040171146393, 0.22214625775814056, 0.001525774598121643, 0.14281697571277618, -0.38300418853759766, 0.11966359615325928, -0.2543981671333313, 0.013243049383163452, 0.08629418164491653, -0.0984276831150055, 0.29482823610305786, 0.011293493211269379, -0.45290684700012207, -0.10897186398506165, -0.37859484553337097, -0.06992632150650024, 0.11217018216848373, 0.03531746566295624, 0.053219206631183624, 0.13602158427238464, 0.12140089273452759, 0.4748218357563019, -0.15927258133888245, -0.1046859622001648, -0.38281646370887756, 0.33297476172447205, -0.31705376505851746, -0.22908993065357208, 0.05197061598300934, 0.04233211278915405, 0.33400315046310425, 0.31051185727119446, -0.262739896774292, -0.03736449405550957, -0.05446285009384155, 0.08956221491098404, -0.09292134642601013, 0.057873912155628204, 0.06649806350469589, 0.08443331718444824, 0.038826532661914825, -0.28554701805114746, 0.23108799755573273, 0.009538818150758743, -0.2966027557849884, 0.45695310831069946, 0.2036062330007553, 0.36425039172172546, 0.2993921637535095, 1.0282272100448608, 0.12160304188728333, -0.01682560332119465, 0.4850807785987854, -0.12384456396102905, 0.2234784960746765, -0.1241697445511818, -0.4238840937614441, 0.3847128748893738, -0.21536670625209808, -0.1298932135105133, 0.15370863676071167, -0.1445845514535904, -0.1440427303314209, -0.2248849868774414, 0.2552186846733093, 0.09366002678871155, -0.2433968484401703, 0.0952928215265274, -0.41219353675842285, 0.16690999269485474, -0.1776181012392044, 0.3302633762359619, -0.07306520640850067, -0.18438172340393066, 0.07955585420131683, -0.09275081753730774, 0.3248363137245178, -0.029537074267864227, -0.028307870030403137, 0.04433063790202141, -0.2938789129257202, 0.21962685883045197, 0.23734572529792786, 0.5560171008110046, -0.02668938785791397, -0.3964119553565979, -0.06080929562449455, -0.03855203837156296, 0.515249490737915, -0.05114728957414627, -0.09945714473724365, 0.16366370022296906, -0.07885058224201202, -0.175074502825737, -0.09596307575702667, -0.25722643733024597, 0.380420982837677, 0.17869816720485687, 0.23205719888210297, -0.13987907767295837, -0.01993102766573429, 0.12072639912366867, 0.07048624753952026, -0.04281509295105934, -0.00455104187130928, -0.24628449976444244, -0.06948623806238174, -0.38816672563552856, 0.096628338098526, 0.228700190782547, 0.18543583154678345, -0.45792651176452637, -0.14898818731307983, -0.04408428817987442, -0.22565041482448578, 0.10729625821113586, 0.025857537984848022, 0.14009040594100952, -0.17788083851337433, 0.20850586891174316, 0.28347259759902954, 0.15248006582260132, 0.3061876595020294, 0.4678601026535034, 0.043165914714336395, -0.388761430978775, 0.2867013216018677, -0.018174156546592712, 0.18008118867874146, 0.32033780217170715, -0.24386274814605713, -0.03739653155207634, -0.05225282907485962, 0.020100107416510582, -0.07011611759662628, 0.27558520436286926, 0.24362671375274658, -0.24242937564849854, -0.35848405957221985, -0.34499067068099976, -0.08126477897167206, 0.175763800740242, 0.16002227365970612, 0.7104059457778931, -0.4907808303833008, -0.12658649682998657, -0.018182218074798584, 0.12357065081596375, 0.7888496518135071, 0.14028574526309967, 0.051551807671785355, 0.29881906509399414, -0.03526199609041214, -0.1377466917037964, -0.3474712371826172, 0.17539668083190918, -0.3599192798137665, -0.24851398169994354, -0.031830571591854095, -0.10890217125415802, 0.1180039569735527, 0.05566699430346489, -0.2643822729587555, 0.26819488406181335, 0.13759255409240723, 0.5112708806991577, -0.0767722949385643, -0.27935025095939636, -0.5839853882789612, -0.2892840802669525, -0.029001478105783463, 0.008910704404115677, -0.041562873870134354, 0.1427319198846817, 0.007659837603569031, -0.1713184118270874, 0.32926663756370544, -0.26438480615615845, -0.16173629462718964, 0.1602398008108139, -0.5147598385810852, 0.03451356291770935, -0.1882278174161911, -0.689132571220398, -0.10269197821617126, 0.4235542118549347, 0.12440259754657745, -0.35279715061187744, -0.13404002785682678, 0.17331655323505402, 0.12435833364725113, 0.10684677958488464, -0.20918914675712585, 0.11340136080980301, 0.22738875448703766, -0.08079732954502106, 0.12453591823577881, 0.2899128794670105, -0.10799210518598557, -0.3156566619873047, 0.03393225371837616, 0.0599810890853405, 0.46457698941230774, -0.34480229020118713, 0.05728696659207344, -0.1494988203048706, -0.19628262519836426, -0.35355257987976074, 0.04182117432355881, -0.2496219426393509, -0.21189779043197632, 0.12546750903129578, -0.40131866931915283, 0.006846204400062561, -0.156015545129776, 0.5129434466362, -0.044351980090141296, -0.07249476760625839, 0.4913300573825836, 0.28293752670288086, -0.29032987356185913, -0.13884441554546356, 0.0928933322429657, -0.0003140680491924286, -0.3330520987510681, 0.17260998487472534, -0.06058087944984436, 0.01897493004798889, -0.20789027214050293, 0.2053745985031128, -0.0996684581041336, -0.03677753731608391, -0.3116658926010132, -0.11914350092411041, -0.43018072843551636, -0.0013418309390544891, 0.007889156229794025, 0.2916848361492157, -0.08969938009977341, -0.0975199043750763, 0.14109846949577332, -0.05487274378538132, -0.22009173035621643, -0.1761820912361145, -0.026413574814796448, 0.05627996101975441, 0.07251386344432831, -0.005669359117746353, 0.028967563062906265, 0.23670339584350586, 0.015179257839918137, 0.27491867542266846, 0.12173695117235184, -0.10878646373748779, -0.1304081678390503, 0.14089125394821167, 0.12422986328601837, -0.29688745737075806, -0.2528478801250458, -0.09537416696548462, -0.17998595535755157, -0.22811400890350342, 0.279987633228302, 0.1502162367105484, 0.009454937651753426, 0.3291289806365967, 0.3678610026836395, 0.22104324400424957, -0.16902035474777222, -0.09888917207717896, 0.013453077524900436, 0.2779969573020935, 0.06170652061700821, 0.054840825498104095, 0.023541633039712906, -0.1317143440246582, -0.0806717500090599, -0.11610095202922821, 0.5316942930221558, 0.07401809096336365, 0.26509809494018555, -0.29855185747146606, 0.05820218473672867, -0.02889283560216427, 0.38064759969711304, 0.6041972637176514, -0.12551619112491608, -0.09627706557512283, 0.1582089364528656, 0.09407556056976318, -0.14500030875205994, -0.1336018443107605, -0.17596691846847534, -0.11186594516038895, 0.030517220497131348, 0.16844531893730164, 0.21616604924201965, -0.06900186091661453, 0.16154669225215912, 0.1396290361881256, 0.17496967315673828, -0.18968483805656433, 0.34937140345573425, 0.5253764390945435, -0.12226977944374084, 0.03126560151576996, -0.07315198332071304, -0.23984113335609436, 0.28043869137763977, 0.20507650077342987, -0.24475908279418945, 0.6344394683837891, 0.1466398537158966, -0.07801471650600433, 0.16982389986515045, -0.6465381979942322, -0.5015547871589661, -0.41259080171585083, 0.014814328402280807, 0.11768478155136108, 0.07025568187236786, 0.43188750743865967, -0.1499505341053009, -0.175540491938591, -0.10185518115758896, 0.010220063850283623, -0.027190271764993668, -0.05064273253083229, -0.21551495790481567, -0.13907764852046967, -0.24302563071250916, 0.09340396523475647, 0.14139209687709808, 0.16610132157802582, 0.45904770493507385, 0.1601749062538147, -0.06504131853580475, -0.4751685857772827, 0.2645082473754883, 0.18667858839035034, 0.1351938247680664, -0.2320735603570938, 0.17134404182434082, 0.23194520175457, 0.16130630671977997, -0.010018706321716309, -0.02643410675227642, 0.3125239908695221, 0.2209039032459259, -0.08481159806251526, -0.12722620368003845, -0.010557401925325394, -0.005238201469182968, -0.11530772596597672, 0.3204529881477356, -0.24307881295681, 0.08561809360980988, 0.3911791443824768, 0.016919177025556564, -0.13043029606342316, 0.06486745178699493, 0.21312695741653442, 0.03498256579041481, -0.04087057709693909, 0.16354107856750488, -0.14090804755687714, -0.021279245615005493, -0.14333069324493408, -0.22229604423046112, -0.23106524348258972, -0.04338918253779411, 0.41052740812301636, -0.1895880401134491, 0.16433723270893097, -0.11313352733850479, 0.039107490330934525, 0.019256114959716797, 0.37871813774108887, 0.261532723903656, -0.13931940495967865, -0.4247131943702698, -0.05200490355491638, -0.2972584366798401, 0.14543716609477997, 0.21615225076675415, 0.06884744763374329, -0.08602187782526016, 0.23338744044303894, 0.06822297722101212, 0.12721186876296997, 0.08005627244710922, -0.23801782727241516, 0.44367313385009766, 0.5840612649917603, -0.426922470331192, -0.4204058051109314, -0.2557361125946045, 0.1133391410112381, 0.025140665471553802, -0.42043253779411316, 0.02634049393236637, 0.19142766296863556, 0.01263512670993805, 0.0700870007276535, -0.630852460861206, 0.17623132467269897, 0.14049512147903442, 0.22928062081336975, 0.034094057977199554, 0.15250056982040405, -0.0774247869849205, 0.23174113035202026, -0.22404420375823975, -0.3409464657306671, -0.15149739384651184, -0.0032608285546302795, 0.006915470585227013, 0.27821844816207886, -0.07147076725959778, -0.08516155183315277, -0.5791183710098267, 0.422981858253479, 0.15929755568504333, -0.15438637137413025, -0.290080189704895, 0.26404476165771484, -0.11535497009754181, 0.4027104675769806, -0.030467338860034943, 0.21172624826431274, -0.06497019529342651, 0.23117095232009888, -0.5497654676437378, -0.5589085221290588, 0.5257161259651184, -0.2894896864891052, -0.24059106409549713, -0.043862905353307724, -0.04450918734073639, 0.5395449995994568, 0.15301772952079773, -0.5534487962722778, 0.029855161905288696, 0.34851664304733276, -0.19137060642242432, 0.08860336244106293, 0.002845950424671173, 0.20203006267547607, 0.18687430024147034, -0.18505039811134338, 0.1252780556678772, 0.24285155534744263, -0.09387225657701492, 0.24918918311595917, -0.1282724291086197 ]
https://github.com/huggingface/datasets/issues/5720
@mariosasko you are right, it works on Colab. I digged deeper and found that the problem arises when the multiprocessing method is set to be `spawn`. This code reproduces the problem in Colab: ```py from datasets import Dataset, load_dataset, load_dataset_builder from torch.utils.data import DataLoader import multiprocessing as mp mp.set_start_method('spawn') def my_gen(): for i in range(1, 4): yield {"a": i} def main(): # Saving the dataset as a parquet file dataset = Dataset.from_generator(my_gen) train_path = "/tmp/test.parquet" dataset.to_parquet(train_path) # Creating a local dataset from the parquet file data_files = {"train": [str(train_path)]} builder = load_dataset_builder("parquet", data_files=data_files) builder.download_and_prepare("/tmp/test_ds", file_format="parquet") # Loading the dataset from the local directory as streaming dataset = load_dataset("parquet", data_dir="/tmp/test_ds", split="train", streaming=True) dataset.with_format("torch") dl = DataLoader(dataset, batch_size=2, num_workers=1) for row in dl: print(row) main() ```
Streaming IterableDatasets do not work with torch DataLoaders
### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ```
124
Streaming IterableDatasets do not work with torch DataLoaders ### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ``` @mariosasko you are right, it works on Colab. I digged deeper and found that the problem arises when the multiprocessing method is set to be `spawn`. This code reproduces the problem in Colab: ```py from datasets import Dataset, load_dataset, load_dataset_builder from torch.utils.data import DataLoader import multiprocessing as mp mp.set_start_method('spawn') def my_gen(): for i in range(1, 4): yield {"a": i} def main(): # Saving the dataset as a parquet file dataset = Dataset.from_generator(my_gen) train_path = "/tmp/test.parquet" dataset.to_parquet(train_path) # Creating a local dataset from the parquet file data_files = {"train": [str(train_path)]} builder = load_dataset_builder("parquet", data_files=data_files) builder.download_and_prepare("/tmp/test_ds", file_format="parquet") # Loading the dataset from the local directory as streaming dataset = load_dataset("parquet", data_dir="/tmp/test_ds", split="train", streaming=True) dataset.with_format("torch") dl = DataLoader(dataset, batch_size=2, num_workers=1) for row in dl: print(row) main() ```
[ -0.5225951075553894, -0.38292956352233887, 0.009423822164535522, 0.47212132811546326, 0.3441590964794159, 0.09382329136133194, 0.6252887845039368, 0.10292047262191772, -0.1920423060655594, 0.22818687558174133, -0.23222973942756653, 0.2899165749549866, -0.1994057297706604, -0.10757900029420853, -0.11898442357778549, -0.3624500036239624, 0.01737753301858902, -0.061575111001729965, -0.16203643381595612, 0.05500626564025879, -0.21589958667755127, 0.09493805468082428, -0.32884377241134644, -0.25713303685188293, 0.009635388851165771, -0.059689491987228394, -0.13640987873077393, 0.28710973262786865, 0.07346852868795395, -0.24837279319763184, 0.1440359354019165, -0.012905247509479523, 0.28496670722961426, 0.7305285930633545, -0.00011989229824393988, 0.0989341214299202, 0.20279714465141296, -0.187337726354599, -0.24740172922611237, -0.13179773092269897, -0.0417666882276535, 0.11642865836620331, -0.0008410587906837463, -0.1893954575061798, -0.049285128712654114, -0.07839731127023697, -0.11300640553236008, -0.3757691979408264, 0.1977761685848236, 0.16344541311264038, 0.10201427340507507, 0.44622310996055603, -0.21276524662971497, -0.07956929504871368, 0.26202237606048584, -0.03071557730436325, -0.2570575773715973, 0.2916766107082367, 0.45132091641426086, 0.2478068768978119, -0.2621922492980957, 0.3956548869609833, -0.2601097524166107, 0.22071591019630432, 0.11785946786403656, -0.22226879000663757, -0.5858621597290039, -0.31602776050567627, -0.023241937160491943, 0.17653349041938782, 0.31550076603889465, -0.24748188257217407, -0.2337014079093933, -0.3995482921600342, -0.08662458509206772, -0.5063938498497009, 0.24551212787628174, 0.15515205264091492, -0.10194505751132965, -0.1824977993965149, -0.10778959840536118, 0.13963693380355835, -0.21839554607868195, -0.017002955079078674, 0.1963242143392563, 0.2907770872116089, -0.04349776729941368, 0.2438451647758484, 0.18914423882961273, 0.07814045250415802, 0.5212911367416382, -0.10632793605327606, 0.07357998192310333, 0.09809594601392746, -0.3186013698577881, 0.041339799761772156, -0.22526781260967255, 0.032422829419374466, -0.14090442657470703, 0.23409393429756165, 0.3078678250312805, 0.10656854510307312, 0.14020834863185883, 0.15122130513191223, 0.309198796749115, -0.045830100774765015, -0.15562346577644348, 0.2805098593235016, 0.25232329964637756, 0.27945369482040405, 0.03767690062522888, -0.15309685468673706, -0.09059780836105347, -0.29787302017211914, -0.13691332936286926, 0.23895348608493805, 0.09748759120702744, -0.054957788437604904, -0.3115820288658142, -0.16337567567825317, -0.2689032256603241, -0.19393564760684967, 0.13966919481754303, 0.32429683208465576, 0.06421826779842377, 0.44342607259750366, -0.2551358640193939, 0.2059345245361328, -0.18135419487953186, -0.11222328245639801, -0.11025342345237732, -0.13309508562088013, 0.011522307991981506, 0.1262217015028, 0.20736736059188843, -0.4623427987098694, 0.33065265417099, 0.030378319323062897, 0.061630576848983765, 0.21531549096107483, 0.22680501639842987, -0.37437576055526733, 0.264085590839386, -0.017778856679797173, 0.23917976021766663, 0.24209575355052948, 0.18807335197925568, 0.3683931529521942, 0.028212621808052063, 0.24426668882369995, -0.15947820246219635, -0.40854763984680176, 0.33212438225746155, 0.13482272624969482, 0.04225742816925049, 0.04737066105008125, -0.029510971158742905, -0.0006876108236610889, 0.44024115800857544, -0.25005045533180237, 0.19947999715805054, -0.20769107341766357, -0.25996989011764526, -0.15762020647525787, 0.1476973593235016, 0.25482451915740967, -0.4742422103881836, -0.2957744002342224, 0.1491222381591797, -0.018712809309363365, 0.5408021211624146, 0.25288689136505127, -0.16295626759529114, 0.06551484763622284, -0.3190819025039673, 0.14732176065444946, 0.15817701816558838, -0.36829525232315063, -0.2226427048444748, 0.3770274817943573, 0.17792344093322754, 0.2965084910392761, 0.35372230410575867, 0.07421161234378815, 0.30635398626327515, -0.13749217987060547, 0.16905492544174194, 0.2777268588542938, -0.3632224500179291, 0.02658700942993164, -0.23797643184661865, 0.04532237350940704, 0.2927909791469574, 0.16724944114685059, 0.22602936625480652, -0.1255604475736618, -0.13876551389694214, 0.06361518800258636, 0.2860954701900482, 0.005653957836329937, 0.10075997561216354, 0.2915342450141907, 0.06993915885686874, -0.09179915487766266, 0.3083770275115967, 0.05358146131038666, -0.21314802765846252, 0.11781372129917145, 0.1648729145526886, -0.19210080802440643, 0.12533354759216309, 0.05181582272052765, -0.1987069994211197, -0.01951853558421135, -0.4524710178375244, -0.3549560308456421, 0.014963589608669281, 0.3225341737270355, 0.031500138342380524, -0.2237960696220398, -0.23069538176059723, 0.14960967004299164, -0.30650606751441956, 0.0016040951013565063, -0.36415809392929077, 0.23738884925842285, -0.10097959637641907, -0.3505174517631531, 0.07138078659772873, 0.14790071547031403, 0.2721678614616394, -0.21607686579227448, -0.18896690011024475, 0.45806384086608887, 0.10617709159851074, 0.23865142464637756, -0.12338238954544067, -0.027635037899017334, 0.4760303497314453, -0.3729514181613922, -0.04548106715083122, 0.42529410123825073, 0.15343232452869415, -0.14845788478851318, 0.04031576216220856, 0.26968663930892944, -0.4090662896633148, 0.5027818083763123, 0.1175396516919136, 0.1057751476764679, 0.17592406272888184, 0.1786171793937683, -0.008086565881967545, -0.04178321361541748, 0.10836378484964371, -0.08165949583053589, 0.2722974121570587, -0.12999361753463745, -0.4167408347129822, -0.020638998597860336, 0.26635101437568665, 0.3138432502746582, -0.24863320589065552, -0.07591451704502106, -0.25106123089790344, -0.041236259043216705, 0.5226642489433289, -0.21199464797973633, 0.5500940680503845, 0.08020490407943726, 0.29075929522514343, -0.15943551063537598, 0.1834823340177536, -0.2706812918186188, 0.22274570167064667, 0.21245892345905304, -0.08212839066982269, 0.37653523683547974, -0.10527137666940689, -0.029789289459586143, -0.2229491025209427, -0.028573360294103622, 0.005631454288959503, 0.09399886429309845, -0.14964070916175842, 0.2892394959926605, -0.1324279010295868, -0.079898402094841, -0.12486624717712402, -0.4198186695575714, -0.15910455584526062, -0.45900899171829224, 0.12112969160079956, 0.7704801559448242, -0.1568647176027298, 0.40888237953186035, -0.052828822284936905, 0.156090646982193, 0.414400577545166, -0.10589296370744705, -0.4357603192329407, -0.050118338316679, -0.1770017296075821, 0.07555882632732391, 0.2007197141647339, -0.4705236256122589, 0.3106052577495575, -0.046345703303813934, -0.2242192029953003, -0.3712427616119385, 0.09346145391464233, 0.25547412037849426, -0.09541870653629303, 0.05190040171146393, 0.22214625775814056, 0.001525774598121643, 0.14281697571277618, -0.38300418853759766, 0.11966359615325928, -0.2543981671333313, 0.013243049383163452, 0.08629418164491653, -0.0984276831150055, 0.29482823610305786, 0.011293493211269379, -0.45290684700012207, -0.10897186398506165, -0.37859484553337097, -0.06992632150650024, 0.11217018216848373, 0.03531746566295624, 0.053219206631183624, 0.13602158427238464, 0.12140089273452759, 0.4748218357563019, -0.15927258133888245, -0.1046859622001648, -0.38281646370887756, 0.33297476172447205, -0.31705376505851746, -0.22908993065357208, 0.05197061598300934, 0.04233211278915405, 0.33400315046310425, 0.31051185727119446, -0.262739896774292, -0.03736449405550957, -0.05446285009384155, 0.08956221491098404, -0.09292134642601013, 0.057873912155628204, 0.06649806350469589, 0.08443331718444824, 0.038826532661914825, -0.28554701805114746, 0.23108799755573273, 0.009538818150758743, -0.2966027557849884, 0.45695310831069946, 0.2036062330007553, 0.36425039172172546, 0.2993921637535095, 1.0282272100448608, 0.12160304188728333, -0.01682560332119465, 0.4850807785987854, -0.12384456396102905, 0.2234784960746765, -0.1241697445511818, -0.4238840937614441, 0.3847128748893738, -0.21536670625209808, -0.1298932135105133, 0.15370863676071167, -0.1445845514535904, -0.1440427303314209, -0.2248849868774414, 0.2552186846733093, 0.09366002678871155, -0.2433968484401703, 0.0952928215265274, -0.41219353675842285, 0.16690999269485474, -0.1776181012392044, 0.3302633762359619, -0.07306520640850067, -0.18438172340393066, 0.07955585420131683, -0.09275081753730774, 0.3248363137245178, -0.029537074267864227, -0.028307870030403137, 0.04433063790202141, -0.2938789129257202, 0.21962685883045197, 0.23734572529792786, 0.5560171008110046, -0.02668938785791397, -0.3964119553565979, -0.06080929562449455, -0.03855203837156296, 0.515249490737915, -0.05114728957414627, -0.09945714473724365, 0.16366370022296906, -0.07885058224201202, -0.175074502825737, -0.09596307575702667, -0.25722643733024597, 0.380420982837677, 0.17869816720485687, 0.23205719888210297, -0.13987907767295837, -0.01993102766573429, 0.12072639912366867, 0.07048624753952026, -0.04281509295105934, -0.00455104187130928, -0.24628449976444244, -0.06948623806238174, -0.38816672563552856, 0.096628338098526, 0.228700190782547, 0.18543583154678345, -0.45792651176452637, -0.14898818731307983, -0.04408428817987442, -0.22565041482448578, 0.10729625821113586, 0.025857537984848022, 0.14009040594100952, -0.17788083851337433, 0.20850586891174316, 0.28347259759902954, 0.15248006582260132, 0.3061876595020294, 0.4678601026535034, 0.043165914714336395, -0.388761430978775, 0.2867013216018677, -0.018174156546592712, 0.18008118867874146, 0.32033780217170715, -0.24386274814605713, -0.03739653155207634, -0.05225282907485962, 0.020100107416510582, -0.07011611759662628, 0.27558520436286926, 0.24362671375274658, -0.24242937564849854, -0.35848405957221985, -0.34499067068099976, -0.08126477897167206, 0.175763800740242, 0.16002227365970612, 0.7104059457778931, -0.4907808303833008, -0.12658649682998657, -0.018182218074798584, 0.12357065081596375, 0.7888496518135071, 0.14028574526309967, 0.051551807671785355, 0.29881906509399414, -0.03526199609041214, -0.1377466917037964, -0.3474712371826172, 0.17539668083190918, -0.3599192798137665, -0.24851398169994354, -0.031830571591854095, -0.10890217125415802, 0.1180039569735527, 0.05566699430346489, -0.2643822729587555, 0.26819488406181335, 0.13759255409240723, 0.5112708806991577, -0.0767722949385643, -0.27935025095939636, -0.5839853882789612, -0.2892840802669525, -0.029001478105783463, 0.008910704404115677, -0.041562873870134354, 0.1427319198846817, 0.007659837603569031, -0.1713184118270874, 0.32926663756370544, -0.26438480615615845, -0.16173629462718964, 0.1602398008108139, -0.5147598385810852, 0.03451356291770935, -0.1882278174161911, -0.689132571220398, -0.10269197821617126, 0.4235542118549347, 0.12440259754657745, -0.35279715061187744, -0.13404002785682678, 0.17331655323505402, 0.12435833364725113, 0.10684677958488464, -0.20918914675712585, 0.11340136080980301, 0.22738875448703766, -0.08079732954502106, 0.12453591823577881, 0.2899128794670105, -0.10799210518598557, -0.3156566619873047, 0.03393225371837616, 0.0599810890853405, 0.46457698941230774, -0.34480229020118713, 0.05728696659207344, -0.1494988203048706, -0.19628262519836426, -0.35355257987976074, 0.04182117432355881, -0.2496219426393509, -0.21189779043197632, 0.12546750903129578, -0.40131866931915283, 0.006846204400062561, -0.156015545129776, 0.5129434466362, -0.044351980090141296, -0.07249476760625839, 0.4913300573825836, 0.28293752670288086, -0.29032987356185913, -0.13884441554546356, 0.0928933322429657, -0.0003140680491924286, -0.3330520987510681, 0.17260998487472534, -0.06058087944984436, 0.01897493004798889, -0.20789027214050293, 0.2053745985031128, -0.0996684581041336, -0.03677753731608391, -0.3116658926010132, -0.11914350092411041, -0.43018072843551636, -0.0013418309390544891, 0.007889156229794025, 0.2916848361492157, -0.08969938009977341, -0.0975199043750763, 0.14109846949577332, -0.05487274378538132, -0.22009173035621643, -0.1761820912361145, -0.026413574814796448, 0.05627996101975441, 0.07251386344432831, -0.005669359117746353, 0.028967563062906265, 0.23670339584350586, 0.015179257839918137, 0.27491867542266846, 0.12173695117235184, -0.10878646373748779, -0.1304081678390503, 0.14089125394821167, 0.12422986328601837, -0.29688745737075806, -0.2528478801250458, -0.09537416696548462, -0.17998595535755157, -0.22811400890350342, 0.279987633228302, 0.1502162367105484, 0.009454937651753426, 0.3291289806365967, 0.3678610026836395, 0.22104324400424957, -0.16902035474777222, -0.09888917207717896, 0.013453077524900436, 0.2779969573020935, 0.06170652061700821, 0.054840825498104095, 0.023541633039712906, -0.1317143440246582, -0.0806717500090599, -0.11610095202922821, 0.5316942930221558, 0.07401809096336365, 0.26509809494018555, -0.29855185747146606, 0.05820218473672867, -0.02889283560216427, 0.38064759969711304, 0.6041972637176514, -0.12551619112491608, -0.09627706557512283, 0.1582089364528656, 0.09407556056976318, -0.14500030875205994, -0.1336018443107605, -0.17596691846847534, -0.11186594516038895, 0.030517220497131348, 0.16844531893730164, 0.21616604924201965, -0.06900186091661453, 0.16154669225215912, 0.1396290361881256, 0.17496967315673828, -0.18968483805656433, 0.34937140345573425, 0.5253764390945435, -0.12226977944374084, 0.03126560151576996, -0.07315198332071304, -0.23984113335609436, 0.28043869137763977, 0.20507650077342987, -0.24475908279418945, 0.6344394683837891, 0.1466398537158966, -0.07801471650600433, 0.16982389986515045, -0.6465381979942322, -0.5015547871589661, -0.41259080171585083, 0.014814328402280807, 0.11768478155136108, 0.07025568187236786, 0.43188750743865967, -0.1499505341053009, -0.175540491938591, -0.10185518115758896, 0.010220063850283623, -0.027190271764993668, -0.05064273253083229, -0.21551495790481567, -0.13907764852046967, -0.24302563071250916, 0.09340396523475647, 0.14139209687709808, 0.16610132157802582, 0.45904770493507385, 0.1601749062538147, -0.06504131853580475, -0.4751685857772827, 0.2645082473754883, 0.18667858839035034, 0.1351938247680664, -0.2320735603570938, 0.17134404182434082, 0.23194520175457, 0.16130630671977997, -0.010018706321716309, -0.02643410675227642, 0.3125239908695221, 0.2209039032459259, -0.08481159806251526, -0.12722620368003845, -0.010557401925325394, -0.005238201469182968, -0.11530772596597672, 0.3204529881477356, -0.24307881295681, 0.08561809360980988, 0.3911791443824768, 0.016919177025556564, -0.13043029606342316, 0.06486745178699493, 0.21312695741653442, 0.03498256579041481, -0.04087057709693909, 0.16354107856750488, -0.14090804755687714, -0.021279245615005493, -0.14333069324493408, -0.22229604423046112, -0.23106524348258972, -0.04338918253779411, 0.41052740812301636, -0.1895880401134491, 0.16433723270893097, -0.11313352733850479, 0.039107490330934525, 0.019256114959716797, 0.37871813774108887, 0.261532723903656, -0.13931940495967865, -0.4247131943702698, -0.05200490355491638, -0.2972584366798401, 0.14543716609477997, 0.21615225076675415, 0.06884744763374329, -0.08602187782526016, 0.23338744044303894, 0.06822297722101212, 0.12721186876296997, 0.08005627244710922, -0.23801782727241516, 0.44367313385009766, 0.5840612649917603, -0.426922470331192, -0.4204058051109314, -0.2557361125946045, 0.1133391410112381, 0.025140665471553802, -0.42043253779411316, 0.02634049393236637, 0.19142766296863556, 0.01263512670993805, 0.0700870007276535, -0.630852460861206, 0.17623132467269897, 0.14049512147903442, 0.22928062081336975, 0.034094057977199554, 0.15250056982040405, -0.0774247869849205, 0.23174113035202026, -0.22404420375823975, -0.3409464657306671, -0.15149739384651184, -0.0032608285546302795, 0.006915470585227013, 0.27821844816207886, -0.07147076725959778, -0.08516155183315277, -0.5791183710098267, 0.422981858253479, 0.15929755568504333, -0.15438637137413025, -0.290080189704895, 0.26404476165771484, -0.11535497009754181, 0.4027104675769806, -0.030467338860034943, 0.21172624826431274, -0.06497019529342651, 0.23117095232009888, -0.5497654676437378, -0.5589085221290588, 0.5257161259651184, -0.2894896864891052, -0.24059106409549713, -0.043862905353307724, -0.04450918734073639, 0.5395449995994568, 0.15301772952079773, -0.5534487962722778, 0.029855161905288696, 0.34851664304733276, -0.19137060642242432, 0.08860336244106293, 0.002845950424671173, 0.20203006267547607, 0.18687430024147034, -0.18505039811134338, 0.1252780556678772, 0.24285155534744263, -0.09387225657701492, 0.24918918311595917, -0.1282724291086197 ]
https://github.com/huggingface/datasets/issues/5720
So is there a way to fix this by changing the `mp` method? This is blocking any usage of the `datasets` library for me
Streaming IterableDatasets do not work with torch DataLoaders
### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ```
24
Streaming IterableDatasets do not work with torch DataLoaders ### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ``` So is there a way to fix this by changing the `mp` method? This is blocking any usage of the `datasets` library for me
[ -0.5225951075553894, -0.38292956352233887, 0.009423822164535522, 0.47212132811546326, 0.3441590964794159, 0.09382329136133194, 0.6252887845039368, 0.10292047262191772, -0.1920423060655594, 0.22818687558174133, -0.23222973942756653, 0.2899165749549866, -0.1994057297706604, -0.10757900029420853, -0.11898442357778549, -0.3624500036239624, 0.01737753301858902, -0.061575111001729965, -0.16203643381595612, 0.05500626564025879, -0.21589958667755127, 0.09493805468082428, -0.32884377241134644, -0.25713303685188293, 0.009635388851165771, -0.059689491987228394, -0.13640987873077393, 0.28710973262786865, 0.07346852868795395, -0.24837279319763184, 0.1440359354019165, -0.012905247509479523, 0.28496670722961426, 0.7305285930633545, -0.00011989229824393988, 0.0989341214299202, 0.20279714465141296, -0.187337726354599, -0.24740172922611237, -0.13179773092269897, -0.0417666882276535, 0.11642865836620331, -0.0008410587906837463, -0.1893954575061798, -0.049285128712654114, -0.07839731127023697, -0.11300640553236008, -0.3757691979408264, 0.1977761685848236, 0.16344541311264038, 0.10201427340507507, 0.44622310996055603, -0.21276524662971497, -0.07956929504871368, 0.26202237606048584, -0.03071557730436325, -0.2570575773715973, 0.2916766107082367, 0.45132091641426086, 0.2478068768978119, -0.2621922492980957, 0.3956548869609833, -0.2601097524166107, 0.22071591019630432, 0.11785946786403656, -0.22226879000663757, -0.5858621597290039, -0.31602776050567627, -0.023241937160491943, 0.17653349041938782, 0.31550076603889465, -0.24748188257217407, -0.2337014079093933, -0.3995482921600342, -0.08662458509206772, -0.5063938498497009, 0.24551212787628174, 0.15515205264091492, -0.10194505751132965, -0.1824977993965149, -0.10778959840536118, 0.13963693380355835, -0.21839554607868195, -0.017002955079078674, 0.1963242143392563, 0.2907770872116089, -0.04349776729941368, 0.2438451647758484, 0.18914423882961273, 0.07814045250415802, 0.5212911367416382, -0.10632793605327606, 0.07357998192310333, 0.09809594601392746, -0.3186013698577881, 0.041339799761772156, -0.22526781260967255, 0.032422829419374466, -0.14090442657470703, 0.23409393429756165, 0.3078678250312805, 0.10656854510307312, 0.14020834863185883, 0.15122130513191223, 0.309198796749115, -0.045830100774765015, -0.15562346577644348, 0.2805098593235016, 0.25232329964637756, 0.27945369482040405, 0.03767690062522888, -0.15309685468673706, -0.09059780836105347, -0.29787302017211914, -0.13691332936286926, 0.23895348608493805, 0.09748759120702744, -0.054957788437604904, -0.3115820288658142, -0.16337567567825317, -0.2689032256603241, -0.19393564760684967, 0.13966919481754303, 0.32429683208465576, 0.06421826779842377, 0.44342607259750366, -0.2551358640193939, 0.2059345245361328, -0.18135419487953186, -0.11222328245639801, -0.11025342345237732, -0.13309508562088013, 0.011522307991981506, 0.1262217015028, 0.20736736059188843, -0.4623427987098694, 0.33065265417099, 0.030378319323062897, 0.061630576848983765, 0.21531549096107483, 0.22680501639842987, -0.37437576055526733, 0.264085590839386, -0.017778856679797173, 0.23917976021766663, 0.24209575355052948, 0.18807335197925568, 0.3683931529521942, 0.028212621808052063, 0.24426668882369995, -0.15947820246219635, -0.40854763984680176, 0.33212438225746155, 0.13482272624969482, 0.04225742816925049, 0.04737066105008125, -0.029510971158742905, -0.0006876108236610889, 0.44024115800857544, -0.25005045533180237, 0.19947999715805054, -0.20769107341766357, -0.25996989011764526, -0.15762020647525787, 0.1476973593235016, 0.25482451915740967, -0.4742422103881836, -0.2957744002342224, 0.1491222381591797, -0.018712809309363365, 0.5408021211624146, 0.25288689136505127, -0.16295626759529114, 0.06551484763622284, -0.3190819025039673, 0.14732176065444946, 0.15817701816558838, -0.36829525232315063, -0.2226427048444748, 0.3770274817943573, 0.17792344093322754, 0.2965084910392761, 0.35372230410575867, 0.07421161234378815, 0.30635398626327515, -0.13749217987060547, 0.16905492544174194, 0.2777268588542938, -0.3632224500179291, 0.02658700942993164, -0.23797643184661865, 0.04532237350940704, 0.2927909791469574, 0.16724944114685059, 0.22602936625480652, -0.1255604475736618, -0.13876551389694214, 0.06361518800258636, 0.2860954701900482, 0.005653957836329937, 0.10075997561216354, 0.2915342450141907, 0.06993915885686874, -0.09179915487766266, 0.3083770275115967, 0.05358146131038666, -0.21314802765846252, 0.11781372129917145, 0.1648729145526886, -0.19210080802440643, 0.12533354759216309, 0.05181582272052765, -0.1987069994211197, -0.01951853558421135, -0.4524710178375244, -0.3549560308456421, 0.014963589608669281, 0.3225341737270355, 0.031500138342380524, -0.2237960696220398, -0.23069538176059723, 0.14960967004299164, -0.30650606751441956, 0.0016040951013565063, -0.36415809392929077, 0.23738884925842285, -0.10097959637641907, -0.3505174517631531, 0.07138078659772873, 0.14790071547031403, 0.2721678614616394, -0.21607686579227448, -0.18896690011024475, 0.45806384086608887, 0.10617709159851074, 0.23865142464637756, -0.12338238954544067, -0.027635037899017334, 0.4760303497314453, -0.3729514181613922, -0.04548106715083122, 0.42529410123825073, 0.15343232452869415, -0.14845788478851318, 0.04031576216220856, 0.26968663930892944, -0.4090662896633148, 0.5027818083763123, 0.1175396516919136, 0.1057751476764679, 0.17592406272888184, 0.1786171793937683, -0.008086565881967545, -0.04178321361541748, 0.10836378484964371, -0.08165949583053589, 0.2722974121570587, -0.12999361753463745, -0.4167408347129822, -0.020638998597860336, 0.26635101437568665, 0.3138432502746582, -0.24863320589065552, -0.07591451704502106, -0.25106123089790344, -0.041236259043216705, 0.5226642489433289, -0.21199464797973633, 0.5500940680503845, 0.08020490407943726, 0.29075929522514343, -0.15943551063537598, 0.1834823340177536, -0.2706812918186188, 0.22274570167064667, 0.21245892345905304, -0.08212839066982269, 0.37653523683547974, -0.10527137666940689, -0.029789289459586143, -0.2229491025209427, -0.028573360294103622, 0.005631454288959503, 0.09399886429309845, -0.14964070916175842, 0.2892394959926605, -0.1324279010295868, -0.079898402094841, -0.12486624717712402, -0.4198186695575714, -0.15910455584526062, -0.45900899171829224, 0.12112969160079956, 0.7704801559448242, -0.1568647176027298, 0.40888237953186035, -0.052828822284936905, 0.156090646982193, 0.414400577545166, -0.10589296370744705, -0.4357603192329407, -0.050118338316679, -0.1770017296075821, 0.07555882632732391, 0.2007197141647339, -0.4705236256122589, 0.3106052577495575, -0.046345703303813934, -0.2242192029953003, -0.3712427616119385, 0.09346145391464233, 0.25547412037849426, -0.09541870653629303, 0.05190040171146393, 0.22214625775814056, 0.001525774598121643, 0.14281697571277618, -0.38300418853759766, 0.11966359615325928, -0.2543981671333313, 0.013243049383163452, 0.08629418164491653, -0.0984276831150055, 0.29482823610305786, 0.011293493211269379, -0.45290684700012207, -0.10897186398506165, -0.37859484553337097, -0.06992632150650024, 0.11217018216848373, 0.03531746566295624, 0.053219206631183624, 0.13602158427238464, 0.12140089273452759, 0.4748218357563019, -0.15927258133888245, -0.1046859622001648, -0.38281646370887756, 0.33297476172447205, -0.31705376505851746, -0.22908993065357208, 0.05197061598300934, 0.04233211278915405, 0.33400315046310425, 0.31051185727119446, -0.262739896774292, -0.03736449405550957, -0.05446285009384155, 0.08956221491098404, -0.09292134642601013, 0.057873912155628204, 0.06649806350469589, 0.08443331718444824, 0.038826532661914825, -0.28554701805114746, 0.23108799755573273, 0.009538818150758743, -0.2966027557849884, 0.45695310831069946, 0.2036062330007553, 0.36425039172172546, 0.2993921637535095, 1.0282272100448608, 0.12160304188728333, -0.01682560332119465, 0.4850807785987854, -0.12384456396102905, 0.2234784960746765, -0.1241697445511818, -0.4238840937614441, 0.3847128748893738, -0.21536670625209808, -0.1298932135105133, 0.15370863676071167, -0.1445845514535904, -0.1440427303314209, -0.2248849868774414, 0.2552186846733093, 0.09366002678871155, -0.2433968484401703, 0.0952928215265274, -0.41219353675842285, 0.16690999269485474, -0.1776181012392044, 0.3302633762359619, -0.07306520640850067, -0.18438172340393066, 0.07955585420131683, -0.09275081753730774, 0.3248363137245178, -0.029537074267864227, -0.028307870030403137, 0.04433063790202141, -0.2938789129257202, 0.21962685883045197, 0.23734572529792786, 0.5560171008110046, -0.02668938785791397, -0.3964119553565979, -0.06080929562449455, -0.03855203837156296, 0.515249490737915, -0.05114728957414627, -0.09945714473724365, 0.16366370022296906, -0.07885058224201202, -0.175074502825737, -0.09596307575702667, -0.25722643733024597, 0.380420982837677, 0.17869816720485687, 0.23205719888210297, -0.13987907767295837, -0.01993102766573429, 0.12072639912366867, 0.07048624753952026, -0.04281509295105934, -0.00455104187130928, -0.24628449976444244, -0.06948623806238174, -0.38816672563552856, 0.096628338098526, 0.228700190782547, 0.18543583154678345, -0.45792651176452637, -0.14898818731307983, -0.04408428817987442, -0.22565041482448578, 0.10729625821113586, 0.025857537984848022, 0.14009040594100952, -0.17788083851337433, 0.20850586891174316, 0.28347259759902954, 0.15248006582260132, 0.3061876595020294, 0.4678601026535034, 0.043165914714336395, -0.388761430978775, 0.2867013216018677, -0.018174156546592712, 0.18008118867874146, 0.32033780217170715, -0.24386274814605713, -0.03739653155207634, -0.05225282907485962, 0.020100107416510582, -0.07011611759662628, 0.27558520436286926, 0.24362671375274658, -0.24242937564849854, -0.35848405957221985, -0.34499067068099976, -0.08126477897167206, 0.175763800740242, 0.16002227365970612, 0.7104059457778931, -0.4907808303833008, -0.12658649682998657, -0.018182218074798584, 0.12357065081596375, 0.7888496518135071, 0.14028574526309967, 0.051551807671785355, 0.29881906509399414, -0.03526199609041214, -0.1377466917037964, -0.3474712371826172, 0.17539668083190918, -0.3599192798137665, -0.24851398169994354, -0.031830571591854095, -0.10890217125415802, 0.1180039569735527, 0.05566699430346489, -0.2643822729587555, 0.26819488406181335, 0.13759255409240723, 0.5112708806991577, -0.0767722949385643, -0.27935025095939636, -0.5839853882789612, -0.2892840802669525, -0.029001478105783463, 0.008910704404115677, -0.041562873870134354, 0.1427319198846817, 0.007659837603569031, -0.1713184118270874, 0.32926663756370544, -0.26438480615615845, -0.16173629462718964, 0.1602398008108139, -0.5147598385810852, 0.03451356291770935, -0.1882278174161911, -0.689132571220398, -0.10269197821617126, 0.4235542118549347, 0.12440259754657745, -0.35279715061187744, -0.13404002785682678, 0.17331655323505402, 0.12435833364725113, 0.10684677958488464, -0.20918914675712585, 0.11340136080980301, 0.22738875448703766, -0.08079732954502106, 0.12453591823577881, 0.2899128794670105, -0.10799210518598557, -0.3156566619873047, 0.03393225371837616, 0.0599810890853405, 0.46457698941230774, -0.34480229020118713, 0.05728696659207344, -0.1494988203048706, -0.19628262519836426, -0.35355257987976074, 0.04182117432355881, -0.2496219426393509, -0.21189779043197632, 0.12546750903129578, -0.40131866931915283, 0.006846204400062561, -0.156015545129776, 0.5129434466362, -0.044351980090141296, -0.07249476760625839, 0.4913300573825836, 0.28293752670288086, -0.29032987356185913, -0.13884441554546356, 0.0928933322429657, -0.0003140680491924286, -0.3330520987510681, 0.17260998487472534, -0.06058087944984436, 0.01897493004798889, -0.20789027214050293, 0.2053745985031128, -0.0996684581041336, -0.03677753731608391, -0.3116658926010132, -0.11914350092411041, -0.43018072843551636, -0.0013418309390544891, 0.007889156229794025, 0.2916848361492157, -0.08969938009977341, -0.0975199043750763, 0.14109846949577332, -0.05487274378538132, -0.22009173035621643, -0.1761820912361145, -0.026413574814796448, 0.05627996101975441, 0.07251386344432831, -0.005669359117746353, 0.028967563062906265, 0.23670339584350586, 0.015179257839918137, 0.27491867542266846, 0.12173695117235184, -0.10878646373748779, -0.1304081678390503, 0.14089125394821167, 0.12422986328601837, -0.29688745737075806, -0.2528478801250458, -0.09537416696548462, -0.17998595535755157, -0.22811400890350342, 0.279987633228302, 0.1502162367105484, 0.009454937651753426, 0.3291289806365967, 0.3678610026836395, 0.22104324400424957, -0.16902035474777222, -0.09888917207717896, 0.013453077524900436, 0.2779969573020935, 0.06170652061700821, 0.054840825498104095, 0.023541633039712906, -0.1317143440246582, -0.0806717500090599, -0.11610095202922821, 0.5316942930221558, 0.07401809096336365, 0.26509809494018555, -0.29855185747146606, 0.05820218473672867, -0.02889283560216427, 0.38064759969711304, 0.6041972637176514, -0.12551619112491608, -0.09627706557512283, 0.1582089364528656, 0.09407556056976318, -0.14500030875205994, -0.1336018443107605, -0.17596691846847534, -0.11186594516038895, 0.030517220497131348, 0.16844531893730164, 0.21616604924201965, -0.06900186091661453, 0.16154669225215912, 0.1396290361881256, 0.17496967315673828, -0.18968483805656433, 0.34937140345573425, 0.5253764390945435, -0.12226977944374084, 0.03126560151576996, -0.07315198332071304, -0.23984113335609436, 0.28043869137763977, 0.20507650077342987, -0.24475908279418945, 0.6344394683837891, 0.1466398537158966, -0.07801471650600433, 0.16982389986515045, -0.6465381979942322, -0.5015547871589661, -0.41259080171585083, 0.014814328402280807, 0.11768478155136108, 0.07025568187236786, 0.43188750743865967, -0.1499505341053009, -0.175540491938591, -0.10185518115758896, 0.010220063850283623, -0.027190271764993668, -0.05064273253083229, -0.21551495790481567, -0.13907764852046967, -0.24302563071250916, 0.09340396523475647, 0.14139209687709808, 0.16610132157802582, 0.45904770493507385, 0.1601749062538147, -0.06504131853580475, -0.4751685857772827, 0.2645082473754883, 0.18667858839035034, 0.1351938247680664, -0.2320735603570938, 0.17134404182434082, 0.23194520175457, 0.16130630671977997, -0.010018706321716309, -0.02643410675227642, 0.3125239908695221, 0.2209039032459259, -0.08481159806251526, -0.12722620368003845, -0.010557401925325394, -0.005238201469182968, -0.11530772596597672, 0.3204529881477356, -0.24307881295681, 0.08561809360980988, 0.3911791443824768, 0.016919177025556564, -0.13043029606342316, 0.06486745178699493, 0.21312695741653442, 0.03498256579041481, -0.04087057709693909, 0.16354107856750488, -0.14090804755687714, -0.021279245615005493, -0.14333069324493408, -0.22229604423046112, -0.23106524348258972, -0.04338918253779411, 0.41052740812301636, -0.1895880401134491, 0.16433723270893097, -0.11313352733850479, 0.039107490330934525, 0.019256114959716797, 0.37871813774108887, 0.261532723903656, -0.13931940495967865, -0.4247131943702698, -0.05200490355491638, -0.2972584366798401, 0.14543716609477997, 0.21615225076675415, 0.06884744763374329, -0.08602187782526016, 0.23338744044303894, 0.06822297722101212, 0.12721186876296997, 0.08005627244710922, -0.23801782727241516, 0.44367313385009766, 0.5840612649917603, -0.426922470331192, -0.4204058051109314, -0.2557361125946045, 0.1133391410112381, 0.025140665471553802, -0.42043253779411316, 0.02634049393236637, 0.19142766296863556, 0.01263512670993805, 0.0700870007276535, -0.630852460861206, 0.17623132467269897, 0.14049512147903442, 0.22928062081336975, 0.034094057977199554, 0.15250056982040405, -0.0774247869849205, 0.23174113035202026, -0.22404420375823975, -0.3409464657306671, -0.15149739384651184, -0.0032608285546302795, 0.006915470585227013, 0.27821844816207886, -0.07147076725959778, -0.08516155183315277, -0.5791183710098267, 0.422981858253479, 0.15929755568504333, -0.15438637137413025, -0.290080189704895, 0.26404476165771484, -0.11535497009754181, 0.4027104675769806, -0.030467338860034943, 0.21172624826431274, -0.06497019529342651, 0.23117095232009888, -0.5497654676437378, -0.5589085221290588, 0.5257161259651184, -0.2894896864891052, -0.24059106409549713, -0.043862905353307724, -0.04450918734073639, 0.5395449995994568, 0.15301772952079773, -0.5534487962722778, 0.029855161905288696, 0.34851664304733276, -0.19137060642242432, 0.08860336244106293, 0.002845950424671173, 0.20203006267547607, 0.18687430024147034, -0.18505039811134338, 0.1252780556678772, 0.24285155534744263, -0.09387225657701492, 0.24918918311595917, -0.1282724291086197 ]
https://github.com/huggingface/datasets/issues/5720
@jlehrer1 can you try adding `mp.set_start_method('fork')` at the beginning of your code? Maybe this helps you. Keep us posted.
Streaming IterableDatasets do not work with torch DataLoaders
### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ```
19
Streaming IterableDatasets do not work with torch DataLoaders ### Describe the bug When using streaming datasets set up with train/val split using `.skip()` and `.take()`, the following error occurs when iterating over a torch dataloader: ``` File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 363, in __iter__ self._iterator = self._get_iterator() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 314, in _get_iterator return _MultiProcessingDataLoaderIter(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 927, in __init__ w.start() File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/process.py", line 121, in start self._popen = self._Popen(self) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 224, in _Popen return _default_context.get_context().Process._Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/context.py", line 284, in _Popen return Popen(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 32, in __init__ super().__init__(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_fork.py", line 19, in __init__ self._launch(process_obj) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/popen_spawn_posix.py", line 47, in _launch reduction.dump(process_obj, fp) File "/Users/julian/miniconda3/envs/sims/lib/python3.9/multiprocessing/reduction.py", line 60, in dump ForkingPickler(file, protocol).dump(obj) AttributeError: Can't pickle local object '_generate_examples_from_tables_wrapper.<locals>.wrapper' ``` To reproduce, run the code ``` from datasets import load_dataset data = load_dataset(args.dataset_name, split="train", streaming=True) train_len = 5000 val_len = 100 train, val = data.take(train_len), data.skip(train_len).take(val_len) traindata = IterableClipDataset(data, context_length=args.max_len, tokenizer=tokenizer, image_key="url", text_key="text") traindata = DataLoader(traindata, batch_size=args.batch_size, num_workers=args.num_workers, persistent_workers=True) ``` Where the class IterableClipDataset is a simple wrapper to cast the dataset to a torch iterabledataset, defined via ``` from torch.utils.data import Dataset, IterableDataset from torchvision.transforms import Compose, Resize, ToTensor from transformers import AutoTokenizer import requests from PIL import Image class IterableClipDataset(IterableDataset): def __init__(self, dataset, context_length: int, image_transform=None, tokenizer=None, image_key="image", text_key="text"): self.dataset = dataset self.context_length = context_length self.image_transform = Compose([Resize((224, 224)), ToTensor()]) if image_transform is None else image_transform self.tokenizer = AutoTokenizer.from_pretrained("bert-base-uncased") if tokenizer is None else tokenizer self.image_key = image_key self.text_key = text_key def read_image(self, url: str): try: # Try to read the image image = Image.open(requests.get(url, stream=True).raw) except: image = Image.new("RGB", (224, 224), (0, 0, 0)) return image def process_sample(self, image, text): if isinstance(image, str): image = self.read_image(image) if self.image_transform is not None: image = self.image_transform(image) text = self.tokenizer.encode( text, add_special_tokens=True, max_length=self.context_length, truncation=True, padding="max_length" ) text = torch.tensor(text, dtype=torch.long) return image, text def __iter__(self): for sample in self.dataset: image, text = sample[self.image_key], sample[self.text_key] yield self.process_sample(image, text) ``` ### Steps to reproduce the bug Steps to reproduce 1. Install `datasets`, `torch`, and `PIL` (if you want to reproduce exactly) 2. Run the code above ### Expected behavior Batched data is produced from the dataloader ### Environment info ``` datasets == 2.9.0 python == 3.9.12 torch == 1.11.0 ``` @jlehrer1 can you try adding `mp.set_start_method('fork')` at the beginning of your code? Maybe this helps you. Keep us posted.
[ -0.5225951075553894, -0.38292956352233887, 0.009423822164535522, 0.47212132811546326, 0.3441590964794159, 0.09382329136133194, 0.6252887845039368, 0.10292047262191772, -0.1920423060655594, 0.22818687558174133, -0.23222973942756653, 0.2899165749549866, -0.1994057297706604, -0.10757900029420853, -0.11898442357778549, -0.3624500036239624, 0.01737753301858902, -0.061575111001729965, -0.16203643381595612, 0.05500626564025879, -0.21589958667755127, 0.09493805468082428, -0.32884377241134644, -0.25713303685188293, 0.009635388851165771, -0.059689491987228394, -0.13640987873077393, 0.28710973262786865, 0.07346852868795395, -0.24837279319763184, 0.1440359354019165, -0.012905247509479523, 0.28496670722961426, 0.7305285930633545, -0.00011989229824393988, 0.0989341214299202, 0.20279714465141296, -0.187337726354599, -0.24740172922611237, -0.13179773092269897, -0.0417666882276535, 0.11642865836620331, -0.0008410587906837463, -0.1893954575061798, -0.049285128712654114, -0.07839731127023697, -0.11300640553236008, -0.3757691979408264, 0.1977761685848236, 0.16344541311264038, 0.10201427340507507, 0.44622310996055603, -0.21276524662971497, -0.07956929504871368, 0.26202237606048584, -0.03071557730436325, -0.2570575773715973, 0.2916766107082367, 0.45132091641426086, 0.2478068768978119, -0.2621922492980957, 0.3956548869609833, -0.2601097524166107, 0.22071591019630432, 0.11785946786403656, -0.22226879000663757, -0.5858621597290039, -0.31602776050567627, -0.023241937160491943, 0.17653349041938782, 0.31550076603889465, -0.24748188257217407, -0.2337014079093933, -0.3995482921600342, -0.08662458509206772, -0.5063938498497009, 0.24551212787628174, 0.15515205264091492, -0.10194505751132965, -0.1824977993965149, -0.10778959840536118, 0.13963693380355835, -0.21839554607868195, -0.017002955079078674, 0.1963242143392563, 0.2907770872116089, -0.04349776729941368, 0.2438451647758484, 0.18914423882961273, 0.07814045250415802, 0.5212911367416382, -0.10632793605327606, 0.07357998192310333, 0.09809594601392746, -0.3186013698577881, 0.041339799761772156, -0.22526781260967255, 0.032422829419374466, -0.14090442657470703, 0.23409393429756165, 0.3078678250312805, 0.10656854510307312, 0.14020834863185883, 0.15122130513191223, 0.309198796749115, -0.045830100774765015, -0.15562346577644348, 0.2805098593235016, 0.25232329964637756, 0.27945369482040405, 0.03767690062522888, -0.15309685468673706, -0.09059780836105347, -0.29787302017211914, -0.13691332936286926, 0.23895348608493805, 0.09748759120702744, -0.054957788437604904, -0.3115820288658142, -0.16337567567825317, -0.2689032256603241, -0.19393564760684967, 0.13966919481754303, 0.32429683208465576, 0.06421826779842377, 0.44342607259750366, -0.2551358640193939, 0.2059345245361328, -0.18135419487953186, -0.11222328245639801, -0.11025342345237732, -0.13309508562088013, 0.011522307991981506, 0.1262217015028, 0.20736736059188843, -0.4623427987098694, 0.33065265417099, 0.030378319323062897, 0.061630576848983765, 0.21531549096107483, 0.22680501639842987, -0.37437576055526733, 0.264085590839386, -0.017778856679797173, 0.23917976021766663, 0.24209575355052948, 0.18807335197925568, 0.3683931529521942, 0.028212621808052063, 0.24426668882369995, -0.15947820246219635, -0.40854763984680176, 0.33212438225746155, 0.13482272624969482, 0.04225742816925049, 0.04737066105008125, -0.029510971158742905, -0.0006876108236610889, 0.44024115800857544, -0.25005045533180237, 0.19947999715805054, -0.20769107341766357, -0.25996989011764526, -0.15762020647525787, 0.1476973593235016, 0.25482451915740967, -0.4742422103881836, -0.2957744002342224, 0.1491222381591797, -0.018712809309363365, 0.5408021211624146, 0.25288689136505127, -0.16295626759529114, 0.06551484763622284, -0.3190819025039673, 0.14732176065444946, 0.15817701816558838, -0.36829525232315063, -0.2226427048444748, 0.3770274817943573, 0.17792344093322754, 0.2965084910392761, 0.35372230410575867, 0.07421161234378815, 0.30635398626327515, -0.13749217987060547, 0.16905492544174194, 0.2777268588542938, -0.3632224500179291, 0.02658700942993164, -0.23797643184661865, 0.04532237350940704, 0.2927909791469574, 0.16724944114685059, 0.22602936625480652, -0.1255604475736618, -0.13876551389694214, 0.06361518800258636, 0.2860954701900482, 0.005653957836329937, 0.10075997561216354, 0.2915342450141907, 0.06993915885686874, -0.09179915487766266, 0.3083770275115967, 0.05358146131038666, -0.21314802765846252, 0.11781372129917145, 0.1648729145526886, -0.19210080802440643, 0.12533354759216309, 0.05181582272052765, -0.1987069994211197, -0.01951853558421135, -0.4524710178375244, -0.3549560308456421, 0.014963589608669281, 0.3225341737270355, 0.031500138342380524, -0.2237960696220398, -0.23069538176059723, 0.14960967004299164, -0.30650606751441956, 0.0016040951013565063, -0.36415809392929077, 0.23738884925842285, -0.10097959637641907, -0.3505174517631531, 0.07138078659772873, 0.14790071547031403, 0.2721678614616394, -0.21607686579227448, -0.18896690011024475, 0.45806384086608887, 0.10617709159851074, 0.23865142464637756, -0.12338238954544067, -0.027635037899017334, 0.4760303497314453, -0.3729514181613922, -0.04548106715083122, 0.42529410123825073, 0.15343232452869415, -0.14845788478851318, 0.04031576216220856, 0.26968663930892944, -0.4090662896633148, 0.5027818083763123, 0.1175396516919136, 0.1057751476764679, 0.17592406272888184, 0.1786171793937683, -0.008086565881967545, -0.04178321361541748, 0.10836378484964371, -0.08165949583053589, 0.2722974121570587, -0.12999361753463745, -0.4167408347129822, -0.020638998597860336, 0.26635101437568665, 0.3138432502746582, -0.24863320589065552, -0.07591451704502106, -0.25106123089790344, -0.041236259043216705, 0.5226642489433289, -0.21199464797973633, 0.5500940680503845, 0.08020490407943726, 0.29075929522514343, -0.15943551063537598, 0.1834823340177536, -0.2706812918186188, 0.22274570167064667, 0.21245892345905304, -0.08212839066982269, 0.37653523683547974, -0.10527137666940689, -0.029789289459586143, -0.2229491025209427, -0.028573360294103622, 0.005631454288959503, 0.09399886429309845, -0.14964070916175842, 0.2892394959926605, -0.1324279010295868, -0.079898402094841, -0.12486624717712402, -0.4198186695575714, -0.15910455584526062, -0.45900899171829224, 0.12112969160079956, 0.7704801559448242, -0.1568647176027298, 0.40888237953186035, -0.052828822284936905, 0.156090646982193, 0.414400577545166, -0.10589296370744705, -0.4357603192329407, -0.050118338316679, -0.1770017296075821, 0.07555882632732391, 0.2007197141647339, -0.4705236256122589, 0.3106052577495575, -0.046345703303813934, -0.2242192029953003, -0.3712427616119385, 0.09346145391464233, 0.25547412037849426, -0.09541870653629303, 0.05190040171146393, 0.22214625775814056, 0.001525774598121643, 0.14281697571277618, -0.38300418853759766, 0.11966359615325928, -0.2543981671333313, 0.013243049383163452, 0.08629418164491653, -0.0984276831150055, 0.29482823610305786, 0.011293493211269379, -0.45290684700012207, -0.10897186398506165, -0.37859484553337097, -0.06992632150650024, 0.11217018216848373, 0.03531746566295624, 0.053219206631183624, 0.13602158427238464, 0.12140089273452759, 0.4748218357563019, -0.15927258133888245, -0.1046859622001648, -0.38281646370887756, 0.33297476172447205, -0.31705376505851746, -0.22908993065357208, 0.05197061598300934, 0.04233211278915405, 0.33400315046310425, 0.31051185727119446, -0.262739896774292, -0.03736449405550957, -0.05446285009384155, 0.08956221491098404, -0.09292134642601013, 0.057873912155628204, 0.06649806350469589, 0.08443331718444824, 0.038826532661914825, -0.28554701805114746, 0.23108799755573273, 0.009538818150758743, -0.2966027557849884, 0.45695310831069946, 0.2036062330007553, 0.36425039172172546, 0.2993921637535095, 1.0282272100448608, 0.12160304188728333, -0.01682560332119465, 0.4850807785987854, -0.12384456396102905, 0.2234784960746765, -0.1241697445511818, -0.4238840937614441, 0.3847128748893738, -0.21536670625209808, -0.1298932135105133, 0.15370863676071167, -0.1445845514535904, -0.1440427303314209, -0.2248849868774414, 0.2552186846733093, 0.09366002678871155, -0.2433968484401703, 0.0952928215265274, -0.41219353675842285, 0.16690999269485474, -0.1776181012392044, 0.3302633762359619, -0.07306520640850067, -0.18438172340393066, 0.07955585420131683, -0.09275081753730774, 0.3248363137245178, -0.029537074267864227, -0.028307870030403137, 0.04433063790202141, -0.2938789129257202, 0.21962685883045197, 0.23734572529792786, 0.5560171008110046, -0.02668938785791397, -0.3964119553565979, -0.06080929562449455, -0.03855203837156296, 0.515249490737915, -0.05114728957414627, -0.09945714473724365, 0.16366370022296906, -0.07885058224201202, -0.175074502825737, -0.09596307575702667, -0.25722643733024597, 0.380420982837677, 0.17869816720485687, 0.23205719888210297, -0.13987907767295837, -0.01993102766573429, 0.12072639912366867, 0.07048624753952026, -0.04281509295105934, -0.00455104187130928, -0.24628449976444244, -0.06948623806238174, -0.38816672563552856, 0.096628338098526, 0.228700190782547, 0.18543583154678345, -0.45792651176452637, -0.14898818731307983, -0.04408428817987442, -0.22565041482448578, 0.10729625821113586, 0.025857537984848022, 0.14009040594100952, -0.17788083851337433, 0.20850586891174316, 0.28347259759902954, 0.15248006582260132, 0.3061876595020294, 0.4678601026535034, 0.043165914714336395, -0.388761430978775, 0.2867013216018677, -0.018174156546592712, 0.18008118867874146, 0.32033780217170715, -0.24386274814605713, -0.03739653155207634, -0.05225282907485962, 0.020100107416510582, -0.07011611759662628, 0.27558520436286926, 0.24362671375274658, -0.24242937564849854, -0.35848405957221985, -0.34499067068099976, -0.08126477897167206, 0.175763800740242, 0.16002227365970612, 0.7104059457778931, -0.4907808303833008, -0.12658649682998657, -0.018182218074798584, 0.12357065081596375, 0.7888496518135071, 0.14028574526309967, 0.051551807671785355, 0.29881906509399414, -0.03526199609041214, -0.1377466917037964, -0.3474712371826172, 0.17539668083190918, -0.3599192798137665, -0.24851398169994354, -0.031830571591854095, -0.10890217125415802, 0.1180039569735527, 0.05566699430346489, -0.2643822729587555, 0.26819488406181335, 0.13759255409240723, 0.5112708806991577, -0.0767722949385643, -0.27935025095939636, -0.5839853882789612, -0.2892840802669525, -0.029001478105783463, 0.008910704404115677, -0.041562873870134354, 0.1427319198846817, 0.007659837603569031, -0.1713184118270874, 0.32926663756370544, -0.26438480615615845, -0.16173629462718964, 0.1602398008108139, -0.5147598385810852, 0.03451356291770935, -0.1882278174161911, -0.689132571220398, -0.10269197821617126, 0.4235542118549347, 0.12440259754657745, -0.35279715061187744, -0.13404002785682678, 0.17331655323505402, 0.12435833364725113, 0.10684677958488464, -0.20918914675712585, 0.11340136080980301, 0.22738875448703766, -0.08079732954502106, 0.12453591823577881, 0.2899128794670105, -0.10799210518598557, -0.3156566619873047, 0.03393225371837616, 0.0599810890853405, 0.46457698941230774, -0.34480229020118713, 0.05728696659207344, -0.1494988203048706, -0.19628262519836426, -0.35355257987976074, 0.04182117432355881, -0.2496219426393509, -0.21189779043197632, 0.12546750903129578, -0.40131866931915283, 0.006846204400062561, -0.156015545129776, 0.5129434466362, -0.044351980090141296, -0.07249476760625839, 0.4913300573825836, 0.28293752670288086, -0.29032987356185913, -0.13884441554546356, 0.0928933322429657, -0.0003140680491924286, -0.3330520987510681, 0.17260998487472534, -0.06058087944984436, 0.01897493004798889, -0.20789027214050293, 0.2053745985031128, -0.0996684581041336, -0.03677753731608391, -0.3116658926010132, -0.11914350092411041, -0.43018072843551636, -0.0013418309390544891, 0.007889156229794025, 0.2916848361492157, -0.08969938009977341, -0.0975199043750763, 0.14109846949577332, -0.05487274378538132, -0.22009173035621643, -0.1761820912361145, -0.026413574814796448, 0.05627996101975441, 0.07251386344432831, -0.005669359117746353, 0.028967563062906265, 0.23670339584350586, 0.015179257839918137, 0.27491867542266846, 0.12173695117235184, -0.10878646373748779, -0.1304081678390503, 0.14089125394821167, 0.12422986328601837, -0.29688745737075806, -0.2528478801250458, -0.09537416696548462, -0.17998595535755157, -0.22811400890350342, 0.279987633228302, 0.1502162367105484, 0.009454937651753426, 0.3291289806365967, 0.3678610026836395, 0.22104324400424957, -0.16902035474777222, -0.09888917207717896, 0.013453077524900436, 0.2779969573020935, 0.06170652061700821, 0.054840825498104095, 0.023541633039712906, -0.1317143440246582, -0.0806717500090599, -0.11610095202922821, 0.5316942930221558, 0.07401809096336365, 0.26509809494018555, -0.29855185747146606, 0.05820218473672867, -0.02889283560216427, 0.38064759969711304, 0.6041972637176514, -0.12551619112491608, -0.09627706557512283, 0.1582089364528656, 0.09407556056976318, -0.14500030875205994, -0.1336018443107605, -0.17596691846847534, -0.11186594516038895, 0.030517220497131348, 0.16844531893730164, 0.21616604924201965, -0.06900186091661453, 0.16154669225215912, 0.1396290361881256, 0.17496967315673828, -0.18968483805656433, 0.34937140345573425, 0.5253764390945435, -0.12226977944374084, 0.03126560151576996, -0.07315198332071304, -0.23984113335609436, 0.28043869137763977, 0.20507650077342987, -0.24475908279418945, 0.6344394683837891, 0.1466398537158966, -0.07801471650600433, 0.16982389986515045, -0.6465381979942322, -0.5015547871589661, -0.41259080171585083, 0.014814328402280807, 0.11768478155136108, 0.07025568187236786, 0.43188750743865967, -0.1499505341053009, -0.175540491938591, -0.10185518115758896, 0.010220063850283623, -0.027190271764993668, -0.05064273253083229, -0.21551495790481567, -0.13907764852046967, -0.24302563071250916, 0.09340396523475647, 0.14139209687709808, 0.16610132157802582, 0.45904770493507385, 0.1601749062538147, -0.06504131853580475, -0.4751685857772827, 0.2645082473754883, 0.18667858839035034, 0.1351938247680664, -0.2320735603570938, 0.17134404182434082, 0.23194520175457, 0.16130630671977997, -0.010018706321716309, -0.02643410675227642, 0.3125239908695221, 0.2209039032459259, -0.08481159806251526, -0.12722620368003845, -0.010557401925325394, -0.005238201469182968, -0.11530772596597672, 0.3204529881477356, -0.24307881295681, 0.08561809360980988, 0.3911791443824768, 0.016919177025556564, -0.13043029606342316, 0.06486745178699493, 0.21312695741653442, 0.03498256579041481, -0.04087057709693909, 0.16354107856750488, -0.14090804755687714, -0.021279245615005493, -0.14333069324493408, -0.22229604423046112, -0.23106524348258972, -0.04338918253779411, 0.41052740812301636, -0.1895880401134491, 0.16433723270893097, -0.11313352733850479, 0.039107490330934525, 0.019256114959716797, 0.37871813774108887, 0.261532723903656, -0.13931940495967865, -0.4247131943702698, -0.05200490355491638, -0.2972584366798401, 0.14543716609477997, 0.21615225076675415, 0.06884744763374329, -0.08602187782526016, 0.23338744044303894, 0.06822297722101212, 0.12721186876296997, 0.08005627244710922, -0.23801782727241516, 0.44367313385009766, 0.5840612649917603, -0.426922470331192, -0.4204058051109314, -0.2557361125946045, 0.1133391410112381, 0.025140665471553802, -0.42043253779411316, 0.02634049393236637, 0.19142766296863556, 0.01263512670993805, 0.0700870007276535, -0.630852460861206, 0.17623132467269897, 0.14049512147903442, 0.22928062081336975, 0.034094057977199554, 0.15250056982040405, -0.0774247869849205, 0.23174113035202026, -0.22404420375823975, -0.3409464657306671, -0.15149739384651184, -0.0032608285546302795, 0.006915470585227013, 0.27821844816207886, -0.07147076725959778, -0.08516155183315277, -0.5791183710098267, 0.422981858253479, 0.15929755568504333, -0.15438637137413025, -0.290080189704895, 0.26404476165771484, -0.11535497009754181, 0.4027104675769806, -0.030467338860034943, 0.21172624826431274, -0.06497019529342651, 0.23117095232009888, -0.5497654676437378, -0.5589085221290588, 0.5257161259651184, -0.2894896864891052, -0.24059106409549713, -0.043862905353307724, -0.04450918734073639, 0.5395449995994568, 0.15301772952079773, -0.5534487962722778, 0.029855161905288696, 0.34851664304733276, -0.19137060642242432, 0.08860336244106293, 0.002845950424671173, 0.20203006267547607, 0.18687430024147034, -0.18505039811134338, 0.1252780556678772, 0.24285155534744263, -0.09387225657701492, 0.24918918311595917, -0.1282724291086197 ]
https://github.com/huggingface/datasets/issues/5719
Hi! You need to set the format to `np` before indexing the dataset to get NumPy arrays: ```python features = Features(dict(seq=Array2D((2,2), 'float32'))) ds = Dataset.from_dict(dict(seq=[np.random.rand(2,2)]), features=features) ds.set_format("np") a = ds[0]['seq'] ``` > I think it should not be the expected behavior especially when I feed a numpy array as input to the data creation function. Why is it converting my array into a list? The same dataset can have examples in different types (Numpy arrays, Torch tensors, Pandas series, etc.), so recovering them all would be slow and impractical. Instead, the design of our formatting API is similar to Arrow's (the lib we use internally to store data on disk/ in RAM), which allows converting a batch of data to Python/Numpy/Pandas in a single call (and uses C++ to do so to make it faster). > Also if I change the first dimension of the Array2D shape to None, it's returning array correctly. Setting the first dimension to `None` makes it variable-length (allows passing arrays with the first dimensions of differing lengths).
Array2D feature creates a list of list instead of a numpy array
### Describe the bug I'm not sure if this is expected behavior or not. When I create a 2D array using `Array2D`, the data has list type instead of numpy array. I think it should not be the expected behavior especially when I feed a numpy array as input to the data creation function. Why is it converting my array into a list? Also if I change the first dimension of the `Array2D` shape to None, it's returning array correctly. ### Steps to reproduce the bug Run this code: ```py from datasets import Dataset, Features, Array2D import numpy as np # you have to change the first dimension of the shape to None to make it return an array features = Features(dict(seq=Array2D((2,2), 'float32'))) ds = Dataset.from_dict(dict(seq=[np.random.rand(2,2)]), features=features) a = ds[0]['seq'] print(a) print(type(a)) ``` The following will be printed in stdout: ``` [[0.8127174377441406, 0.3760348856449127], [0.7510159611701965, 0.4322739541530609]] <class 'list'> ``` ### Expected behavior Each indexed item should be a list or numpy array. Currently, `Array((2,2))` yields a list but `Array((None,2))` yields an array. ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.19045-SP0 - Python version: 3.9.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.4
172
Array2D feature creates a list of list instead of a numpy array ### Describe the bug I'm not sure if this is expected behavior or not. When I create a 2D array using `Array2D`, the data has list type instead of numpy array. I think it should not be the expected behavior especially when I feed a numpy array as input to the data creation function. Why is it converting my array into a list? Also if I change the first dimension of the `Array2D` shape to None, it's returning array correctly. ### Steps to reproduce the bug Run this code: ```py from datasets import Dataset, Features, Array2D import numpy as np # you have to change the first dimension of the shape to None to make it return an array features = Features(dict(seq=Array2D((2,2), 'float32'))) ds = Dataset.from_dict(dict(seq=[np.random.rand(2,2)]), features=features) a = ds[0]['seq'] print(a) print(type(a)) ``` The following will be printed in stdout: ``` [[0.8127174377441406, 0.3760348856449127], [0.7510159611701965, 0.4322739541530609]] <class 'list'> ``` ### Expected behavior Each indexed item should be a list or numpy array. Currently, `Array((2,2))` yields a list but `Array((None,2))` yields an array. ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.19045-SP0 - Python version: 3.9.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.4 Hi! You need to set the format to `np` before indexing the dataset to get NumPy arrays: ```python features = Features(dict(seq=Array2D((2,2), 'float32'))) ds = Dataset.from_dict(dict(seq=[np.random.rand(2,2)]), features=features) ds.set_format("np") a = ds[0]['seq'] ``` > I think it should not be the expected behavior especially when I feed a numpy array as input to the data creation function. Why is it converting my array into a list? The same dataset can have examples in different types (Numpy arrays, Torch tensors, Pandas series, etc.), so recovering them all would be slow and impractical. Instead, the design of our formatting API is similar to Arrow's (the lib we use internally to store data on disk/ in RAM), which allows converting a batch of data to Python/Numpy/Pandas in a single call (and uses C++ to do so to make it faster). > Also if I change the first dimension of the Array2D shape to None, it's returning array correctly. Setting the first dimension to `None` makes it variable-length (allows passing arrays with the first dimensions of differing lengths).
[ 0.5075539946556091, -0.2641132175922394, -0.0844285637140274, 0.24246928095817566, 0.16535627841949463, 0.05181385576725006, 0.7122006416320801, 0.12073925137519836, 0.48243463039398193, -0.08385051041841507, -0.01496727392077446, 0.4592285752296448, -0.22559741139411926, 0.10164102166891098, 0.17829155921936035, -0.09338169544935226, 0.3567296862602234, 0.16048912703990936, -0.19071386754512787, -0.24601124227046967, -0.20296412706375122, 0.06088200956583023, -0.06639377772808075, 0.2857562303543091, -0.2803456783294678, 0.1976362019777298, 0.08035396039485931, 0.04990881308913231, -0.1058003157377243, -0.24981927871704102, 0.4397585988044739, -0.5315108299255371, -0.0025328509509563446, 0.04079517722129822, -0.00011586688196985051, -0.16898106038570404, 0.30333754420280457, 0.12724822759628296, 0.19236090779304504, 0.13773669302463531, 0.29205411672592163, -0.4516920745372772, 0.3967379033565521, -0.3320848345756531, 0.07197919487953186, -0.2734270393848419, -0.1411466896533966, -0.10649450123310089, 0.06506498157978058, -0.01871425285935402, 0.16186189651489258, -0.1349290907382965, 0.5399235486984253, 0.06101390719413757, -0.06574654579162598, 0.36961179971694946, -0.26301461458206177, -0.37869390845298767, 0.03711652010679245, 0.11352751404047012, 0.40703049302101135, -0.18032318353652954, -0.5696901082992554, 0.26767978072166443, 0.42420926690101624, 0.40271326899528503, -0.20330846309661865, -0.4901517331600189, -0.29411715269088745, 0.16586875915527344, 0.30145126581192017, -0.14882947504520416, 0.13048437237739563, -0.08550038933753967, -0.2695165276527405, 0.07631456851959229, 0.13902132213115692, 0.17921201884746552, -0.0387607216835022, 0.17880037426948547, -0.05404333770275116, 0.050941381603479385, -0.1474161148071289, 0.16820406913757324, -0.31801652908325195, -0.17858296632766724, -0.21675392985343933, 0.15093332529067993, -0.12660449743270874, -0.1769295036792755, 0.044357381761074066, -0.22390617430210114, 0.06093446910381317, 0.030334919691085815, -0.019655544310808182, -0.18676957488059998, 0.07617098093032837, -0.5093322396278381, 0.07493869960308075, -0.15388543903827667, 0.021443277597427368, -0.06248130276799202, -0.32978355884552, 0.10477110743522644, 0.03216075524687767, 0.06368045508861542, 0.004347531124949455, -0.19786842167377472, -0.1749052107334137, -0.3012242019176483, 0.42448121309280396, 0.07833744585514069, 0.2895246744155884, 0.4396197199821472, 0.48746374249458313, -0.33494773507118225, 0.42032378911972046, -0.1762862354516983, -0.21120455861091614, 0.20822106301784515, -0.43209972977638245, 0.18924859166145325, -0.09078830480575562, 0.04767905920743942, -0.11719183623790741, 0.037546880543231964, 0.09980568289756775, 0.30064722895622253, 0.05140664428472519, 0.15726526081562042, -0.07756420224905014, -0.2343473583459854, -0.022275619208812714, -0.15085843205451965, -0.042679596692323685, 0.5305692553520203, 0.2191341072320938, 0.2300538420677185, 0.08556923270225525, -0.11156260967254639, -0.09937739372253418, -0.044687818735837936, 0.32554131746292114, -0.02496342360973358, 0.1396414041519165, 0.32413265109062195, 0.4427552819252014, 0.04256722331047058, 0.06772597134113312, 0.25075244903564453, -0.47126418352127075, 0.20192711055278778, -0.22859066724777222, 0.0750306099653244, 0.05880838632583618, 0.21753421425819397, -0.030395809561014175, 0.0487685352563858, 0.3832079768180847, -0.08531288057565689, -0.10864385962486267, 0.012906108051538467, -0.04291096329689026, -0.4680369198322296, -0.00006499886512756348, 0.04579386115074158, -0.03589126467704773, 0.22240200638771057, 0.08854380249977112, -0.009942554868757725, 0.13748212158679962, 0.29774558544158936, -0.06456666439771652, 0.06991209089756012, -0.28524163365364075, 0.24790054559707642, -0.03675617277622223, 0.3362502455711365, 0.10715091973543167, 0.029270853847265244, 0.04322736710309982, 0.20342689752578735, -0.032717667520046234, 0.40060025453567505, -0.07836993038654327, -0.20387089252471924, 0.05042925104498863, 0.035873256623744965, -0.034186359494924545, 0.1315593421459198, -0.08008763194084167, -0.2131340056657791, 0.5211865305900574, -0.1846640706062317, -0.10429807007312775, 0.5554128885269165, -0.05915713682770729, 0.279670387506485, 0.25298646092414856, -0.15767620503902435, -0.04168393835425377, -0.027501791715621948, 0.32658931612968445, -0.0009492803364992142, 0.00048342347145080566, -0.08067232370376587, -0.09132752567529678, -0.142653226852417, -0.16658291220664978, -0.12575916945934296, 0.21673090755939484, 0.034524790942668915, -0.1598532795906067, -0.05893640220165253, -0.1604066789150238, 0.05497973784804344, 0.18051666021347046, -0.17345882952213287, -0.055376168340444565, -0.1446978747844696, 0.022726573050022125, 0.08285072445869446, -0.0647074431180954, 0.0068469420075416565, -0.5642730593681335, 0.5173390507698059, 0.20845690369606018, -0.157227024435997, -0.4952203035354614, 0.03967719525098801, 0.12605847418308258, 0.05138599872589111, -0.07342393696308136, 0.1827632188796997, 0.3190254867076874, -0.259390264749527, -0.17207437753677368, 0.40050071477890015, 0.010077109560370445, -0.33273249864578247, 0.2697240114212036, 0.5756806135177612, 0.26119354367256165, -0.35043787956237793, 0.13041630387306213, 0.16834183037281036, -0.1401551514863968, 0.18169419467449188, -0.5202504396438599, 0.2357126772403717, 0.04522227495908737, 0.1168694943189621, 0.03700224310159683, -0.024256587028503418, -0.4073697626590729, -0.027891479432582855, -0.4178805351257324, 0.16022013127803802, -0.14718987047672272, 0.32071197032928467, 0.26577454805374146, 0.09548148512840271, 0.2088581621646881, 0.04154171794652939, 0.019780006259679794, -0.19438409805297852, -0.1945042461156845, -0.24293166399002075, 0.4054529070854187, -0.014375297352671623, -0.28693705797195435, 0.07750283181667328, -0.15550684928894043, -0.03991640359163284, 0.13775674998760223, -0.07685111463069916, 0.22057722508907318, -0.12775814533233643, 0.06958343088626862, -0.1867886781692505, 0.16266684234142303, 0.37605148553848267, -0.2193957269191742, 0.04925760626792908, -0.2918398678302765, -0.11660194396972656, -0.14310720562934875, -0.0424555167555809, -0.03841158002614975, 0.023582562804222107, 0.03921644389629364, 0.12166127562522888, -0.336548388004303, 0.27581191062927246, 0.14683128893375397, -0.24288779497146606, 0.14679165184497833, -0.11502674221992493, 0.231197789311409, 0.066800057888031, 0.10689705610275269, 0.378511905670166, -0.1627052128314972, 0.11769752949476242, -0.02191847562789917, 0.12217413634061813, -0.006211758125573397, -0.03280254825949669, -0.20852802693843842, -0.2446589469909668, -0.17867594957351685, -0.13148453831672668, -0.05154384672641754, 0.2894652783870697, 0.29646211862564087, 0.20260664820671082, -0.19096025824546814, -0.03334701806306839, 0.13518106937408447, 0.16595366597175598, -0.16714227199554443, 0.3512628674507141, 0.03853452578186989, -0.20865224301815033, -0.12784428894519806, -0.21627770364284515, -0.04813068360090256, 0.06791514158248901, 0.04260571300983429, 0.18396280705928802, 0.18174158036708832, -0.1738293468952179, 0.013640038669109344, 0.04662894085049629, 0.19003164768218994, -0.041149698197841644, -0.29972970485687256, 0.2030850499868393, 0.2335989773273468, -0.051042962819337845, -0.23658989369869232, -0.22790038585662842, 0.0011385828256607056, -0.14354772865772247, -0.12021323293447495, -0.03727453947067261, -0.4178294539451599, -0.23833200335502625, 0.18917623162269592, 0.03804640844464302, -0.1098199412226677, 0.27626457810401917, 0.021135561168193817, 0.05236179381608963, -0.1277778148651123, -0.16791319847106934, 0.33731040358543396, 0.32462140917778015, 0.30884456634521484, 0.40907052159309387, 0.27129417657852173, -0.1454218178987503, 0.026864124462008476, 0.4983404576778412, 0.0022274497896432877, 0.1464506983757019, 0.053703807294368744, 0.07437609881162643, -0.4609801769256592, -0.35698994994163513, 0.11769478023052216, -0.11592310667037964, -0.4587433934211731, -0.04027104377746582, 0.03492973372340202, -0.49377086758613586, 0.03488994389772415, 0.4718755781650543, -0.4428469240665436, 0.13482721149921417, -0.11515265703201294, 0.3369407653808594, 0.09024706482887268, -0.06093136593699455, 0.1388004720211029, 0.012426353991031647, -0.22370481491088867, -0.12869323790073395, 0.045809585601091385, 0.4547222852706909, 0.07536441087722778, -0.6937741041183472, -0.5904988050460815, -0.05354386940598488, -0.029705144464969635, 0.04801175370812416, 0.31712794303894043, -0.16480879485607147, -0.2259649783372879, 0.16475477814674377, 0.23744238913059235, 0.5807530283927917, 0.3456871807575226, -0.2937507927417755, -0.057992808520793915, 0.23992133140563965, -0.050833478569984436, -0.22067192196846008, -0.02005629986524582, 0.34288638830184937, 0.11809028685092926, 0.03892014920711517, -0.2812501788139343, 0.06154955178499222, -0.054519329220056534, 0.25082847476005554, -0.17994308471679688, 0.13544002175331116, -0.171626016497612, -0.20565208792686462, 0.36909744143486023, -0.3803740441799164, -0.09501774609088898, 0.2269783616065979, -0.015044201165437698, -0.5814073085784912, -0.08436592668294907, -0.12897047400474548, 0.1183452233672142, -0.11491556465625763, 0.4290843605995178, -0.22285735607147217, -0.11716268956661224, -0.14911027252674103, -0.007332174107432365, -0.239053875207901, -0.07789060473442078, 0.3504251539707184, 0.25487878918647766, 0.03559192642569542, -0.42093199491500854, 0.09006550908088684, 0.04049277305603027, -0.2731432616710663, -0.025012191385030746, -0.3286980390548706, -0.12272964417934418, -0.18171760439872742, -0.5850343108177185, 0.6444746255874634, -0.20177730917930603, 0.07009050995111465, -0.4310609698295593, 0.23125134408473969, -0.16219809651374817, 0.019526749849319458, 0.28801804780960083, -0.30199670791625977, -0.23427248001098633, 0.26991546154022217, 0.4477201998233795, 0.5086326003074646, 0.17027799785137177, -0.03704546391963959, 0.6267076134681702, -0.05664798244833946, 0.3788870871067047, 0.08224675059318542, 0.009608171880245209, -0.49504679441452026, 0.05524797365069389, -0.20244264602661133, -0.1209922805428505, 0.07598890364170074, -0.0654919445514679, -0.15547454357147217, 0.0056075043976306915, -0.3254390358924866, 0.17533661425113678, 0.04706566780805588, -0.315729558467865, 0.3297364413738251, -0.21055294573307037, -0.2614390552043915, 0.13899603486061096, -0.26802369952201843, -0.10980594158172607, 0.02100798860192299, -0.19778470695018768, -0.12300892174243927, 0.00924748182296753, -0.13499443233013153, -0.012641414999961853, 0.10923005640506744, 0.16632425785064697, 0.3658446669578552, -0.06933818012475967, -0.17394396662712097, 0.43805551528930664, 0.35257279872894287, 0.029507219791412354, -0.07230521738529205, -0.195155531167984, 0.37758439779281616, 0.4856817424297333, 0.049205366522073746, -0.2658482789993286, 0.11908045411109924, -0.022234734147787094, -0.026427775621414185, 0.049126408994197845, -0.008149553090333939, -0.10843625664710999, -0.5232925415039062, 0.060643333941698074, 0.004158374387770891, -0.4144256114959717, -0.33651137351989746, 0.12933263182640076, 0.04401245713233948, -0.08857288956642151, 0.07435858249664307, 0.23811088502407074, -0.22636395692825317, 0.4562748074531555, 0.10153865814208984, -0.2736539840698242, 0.08238725364208221, -0.08778146654367447, 0.5862005949020386, 0.02093537151813507, 0.05700249224901199, 0.004306890070438385, 0.014920637011528015, -0.08485056459903717, 0.523027777671814, -0.08489123731851578, 0.04963202774524689, 0.2835007905960083, 0.10957503318786621, 0.10168540477752686, -0.14141570031642914, -0.1972079873085022, -0.13145600259304047, 0.3682323694229126, -0.37392809987068176, -0.20848269760608673, 0.20055657625198364, 0.09513244032859802, 0.23471024632453918, -0.16447728872299194, -0.1496344655752182, -0.05287753790616989, -0.07207655161619186, -0.4885907471179962, -0.18252649903297424, 0.04769640415906906, 0.05140411853790283, 0.17521975934505463, -0.29195478558540344, -0.0013876347802579403, -0.10432367026805878, 0.05637354776263237, 0.03347257524728775, -0.06634683161973953, -0.2259015291929245, -0.1715828776359558, 0.09526357054710388, 0.15156696736812592, -0.1172996535897255, -0.3088909387588501, -0.11965668201446533, -0.15401333570480347, -0.2315165102481842, -0.13202568888664246, -0.015174046158790588, 0.09146982431411743, 0.17687411606311798, -0.07389219850301743, 0.018854601308703423, -0.004935774952173233, 0.12220199406147003, -0.09920439124107361, -0.3641531765460968, -0.32719460129737854, 0.026592958718538284, 0.037241920828819275, 0.13443611562252045, -0.031829603016376495, -0.13178248703479767, 0.12828102707862854, -0.3622821271419525, -0.17624808847904205, 0.5282567143440247, -0.5332136154174805, -0.09525694698095322, 0.08934728801250458, 0.3747832179069519, 0.10356713831424713, -0.17578920722007751, -0.027686435729265213, 0.028523925691843033, 0.22551506757736206, 0.0662059485912323, 0.17556464672088623, 0.4495992064476013, 0.26734647154808044, -0.28151941299438477, 0.45342087745666504, 0.12306448072195053, 0.15560275316238403, 0.051249925047159195, -0.11196398735046387, 0.3387262523174286, -0.4892169237136841, 0.17912641167640686, 0.5215365290641785, 0.00192994624376297, 0.14609074592590332, 0.1256043016910553, -0.28932759165763855, -0.2211177945137024, 0.6367654800415039, 0.36645230650901794, 0.4108259081840515, 0.47733014822006226, 0.1385691612958908, 0.24160924553871155, 0.11590324342250824, -0.2692967355251312, 0.0792388916015625, -0.3324079215526581, 0.15847240388393402, 0.295730859041214, 0.3195918798446655, -0.4800989031791687, -0.5446088910102844, -0.4661482274532318, -0.057298630475997925, -0.36915549635887146, 0.19380615651607513, 0.10194802284240723, -0.25396013259887695, 0.04663786292076111, -0.334818035364151, 0.09288093447685242, -0.06890664994716644, -0.04027615487575531, -0.10701321065425873, -0.2135353982448578, -0.4170197546482086, 0.07717777788639069, 0.16819347441196442, 0.1854988932609558, 0.16907359659671783, -0.2216842770576477, 0.00991055741906166, 0.01789744757115841, -0.06590138375759125, 0.5002817511558533, 0.11712171137332916, 0.4451082646846771, 0.03754282370209694, -0.13256840407848358, -0.08001837134361267, -0.26871079206466675, 0.05089016631245613, 0.23925156891345978, 0.019462019205093384, 0.021689891815185547, -0.2025834619998932, 0.0667235478758812, 0.04123522713780403, 0.10088187456130981, -0.14640375971794128, 0.20514574646949768, -0.3634874224662781, 0.3804284334182739, -0.5237862467765808, 0.012144356966018677, -0.10928438603878021, -0.10409483313560486, -0.5303192138671875, -0.15351755917072296, 0.4186103343963623, 0.06248197332024574, 0.13455408811569214, 0.08628351986408234, 0.08445058763027191, -0.17063480615615845, -0.008590279147028923, -0.3139033615589142, 0.10345479846000671, 0.15219968557357788, 0.17090371251106262, 0.004655994474887848, 0.23385384678840637, 0.17404009401798248, 0.2507399320602417, 0.17617015540599823, 0.1825801432132721, 0.010096095502376556, 0.2028336077928543, -0.2077474147081375, -0.15963229537010193, 0.004622969776391983, 0.41922587156295776, 0.0052244216203689575, 0.04566394165158272, -0.04539250582456589, 0.22991527616977692, -0.25588923692703247, -0.09786651283502579, 0.2885781526565552, 0.07426637411117554, 0.040833331644535065, -0.01477071363478899, 0.10752974450588226, -0.22845658659934998, 0.2976178228855133, 0.1116550862789154, 0.5245681405067444, -0.04319646954536438, 0.03706318140029907, 0.05821281671524048, -0.03895591199398041, -0.28885048627853394, -0.09100141376256943, 0.3191697597503662, -0.1425275206565857, 0.5477668046951294, -0.018351521342992783, 0.18118181824684143, -0.077603779733181, 0.4617210626602173, 0.1897723376750946, -0.1854272484779358, -0.379627525806427, 0.23563462495803833, -0.39989805221557617, -0.14336282014846802, 0.14585727453231812, 0.061046767979860306, 0.10945656895637512, 0.22525380551815033, 0.15903335809707642, -0.22145310044288635, 0.35897696018218994, 0.07608659565448761, -0.10045553743839264, 0.10991974174976349, 0.130855992436409, 0.01617061346769333, -0.35358741879463196, -0.1566217690706253, -0.5647180676460266, 0.2828361392021179, -0.1572980135679245, 0.18393194675445557, 0.20379528403282166, -0.2831535041332245, -0.059422265738248825, -0.19455742835998535, -0.004265967756509781, -0.10675572603940964, -0.1315418928861618, 0.41438114643096924, -0.08444301038980484 ]
https://github.com/huggingface/datasets/issues/5719
Current behavior when indexing the dataset: - Using `Array((2,2))` returns a list of lists. - Using `Array((None,2))` returns a numpy array. Don't you think this is kind of unexpected behavior from end-user perspective? As a user, I expect that when I use `Array2D`, the behavior needs to be consistent even if I specify None or not. It should either return a list or an array. It needs to choose one. Let's say if it always return a list, then I will call `ds.set_format('np')` no problem. The consistency can be in any of these aspects: 1. preserves the type of the input data (in this case, a numpy array) 2. ensure the output type is always the same (it can be either list or array, but it needs to be one of them) Right now the API doesn't conform to any of these aspects. But I think it needs to conform to one.
Array2D feature creates a list of list instead of a numpy array
### Describe the bug I'm not sure if this is expected behavior or not. When I create a 2D array using `Array2D`, the data has list type instead of numpy array. I think it should not be the expected behavior especially when I feed a numpy array as input to the data creation function. Why is it converting my array into a list? Also if I change the first dimension of the `Array2D` shape to None, it's returning array correctly. ### Steps to reproduce the bug Run this code: ```py from datasets import Dataset, Features, Array2D import numpy as np # you have to change the first dimension of the shape to None to make it return an array features = Features(dict(seq=Array2D((2,2), 'float32'))) ds = Dataset.from_dict(dict(seq=[np.random.rand(2,2)]), features=features) a = ds[0]['seq'] print(a) print(type(a)) ``` The following will be printed in stdout: ``` [[0.8127174377441406, 0.3760348856449127], [0.7510159611701965, 0.4322739541530609]] <class 'list'> ``` ### Expected behavior Each indexed item should be a list or numpy array. Currently, `Array((2,2))` yields a list but `Array((None,2))` yields an array. ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.19045-SP0 - Python version: 3.9.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.4
152
Array2D feature creates a list of list instead of a numpy array ### Describe the bug I'm not sure if this is expected behavior or not. When I create a 2D array using `Array2D`, the data has list type instead of numpy array. I think it should not be the expected behavior especially when I feed a numpy array as input to the data creation function. Why is it converting my array into a list? Also if I change the first dimension of the `Array2D` shape to None, it's returning array correctly. ### Steps to reproduce the bug Run this code: ```py from datasets import Dataset, Features, Array2D import numpy as np # you have to change the first dimension of the shape to None to make it return an array features = Features(dict(seq=Array2D((2,2), 'float32'))) ds = Dataset.from_dict(dict(seq=[np.random.rand(2,2)]), features=features) a = ds[0]['seq'] print(a) print(type(a)) ``` The following will be printed in stdout: ``` [[0.8127174377441406, 0.3760348856449127], [0.7510159611701965, 0.4322739541530609]] <class 'list'> ``` ### Expected behavior Each indexed item should be a list or numpy array. Currently, `Array((2,2))` yields a list but `Array((None,2))` yields an array. ### Environment info - `datasets` version: 2.11.0 - Platform: Windows-10-10.0.19045-SP0 - Python version: 3.9.13 - Huggingface_hub version: 0.13.4 - PyArrow version: 11.0.0 - Pandas version: 1.4.4 Current behavior when indexing the dataset: - Using `Array((2,2))` returns a list of lists. - Using `Array((None,2))` returns a numpy array. Don't you think this is kind of unexpected behavior from end-user perspective? As a user, I expect that when I use `Array2D`, the behavior needs to be consistent even if I specify None or not. It should either return a list or an array. It needs to choose one. Let's say if it always return a list, then I will call `ds.set_format('np')` no problem. The consistency can be in any of these aspects: 1. preserves the type of the input data (in this case, a numpy array) 2. ensure the output type is always the same (it can be either list or array, but it needs to be one of them) Right now the API doesn't conform to any of these aspects. But I think it needs to conform to one.
[ 0.501378059387207, -0.2389650046825409, -0.07295355945825577, 0.2530471980571747, 0.14261548221111298, 0.06911535561084747, 0.7342240214347839, 0.12222082912921906, 0.5260216593742371, -0.07499207556247711, -0.039258770644664764, 0.47282424569129944, -0.212793231010437, 0.07334797829389572, 0.16144245862960815, -0.08029240369796753, 0.361038476228714, 0.18152165412902832, -0.2156008929014206, -0.25279954075813293, -0.20913010835647583, 0.04279780387878418, -0.06277301907539368, 0.28213030099868774, -0.2763808071613312, 0.16782885789871216, 0.07869772613048553, 0.026591360569000244, -0.10849840193986893, -0.27205729484558105, 0.47097155451774597, -0.5161402225494385, 0.004386957734823227, 0.05519542098045349, -0.00011731611448340118, -0.1462993174791336, 0.31538593769073486, 0.14033053815364838, 0.1825508326292038, 0.11023709177970886, 0.26736319065093994, -0.42400991916656494, 0.4311492145061493, -0.3314000964164734, 0.06576036661863327, -0.30418866872787476, -0.11980490386486053, -0.1187337189912796, 0.03241461515426636, -0.038403622806072235, 0.14415055513381958, -0.1282494217157364, 0.5115526914596558, 0.06628590822219849, -0.06665857881307602, 0.3616883456707001, -0.25136587023735046, -0.36332231760025024, 0.022947967052459717, 0.12477578222751617, 0.38816672563552856, -0.19881212711334229, -0.5685629844665527, 0.2781776189804077, 0.42155247926712036, 0.4187403917312622, -0.22655636072158813, -0.48957008123397827, -0.28423357009887695, 0.18395839631557465, 0.33328086137771606, -0.15576069056987762, 0.108189657330513, -0.09383177757263184, -0.2464163899421692, 0.08015860617160797, 0.14852385222911835, 0.16808128356933594, -0.012217920273542404, 0.18446967005729675, -0.05704529210925102, 0.079263836145401, -0.14680328965187073, 0.17732462286949158, -0.3600732684135437, -0.16032567620277405, -0.20778612792491913, 0.17007353901863098, -0.11490625143051147, -0.16417615115642548, 0.08343397080898285, -0.2324473112821579, 0.05337977781891823, 0.015638478100299835, -0.031425707042217255, -0.1589495837688446, 0.09603067487478256, -0.5134538412094116, 0.06742647290229797, -0.14262327551841736, 0.011619500815868378, -0.05152694508433342, -0.3279150426387787, 0.09196281433105469, 0.06992486119270325, 0.08143235743045807, 0.014534516260027885, -0.17717978358268738, -0.18801617622375488, -0.30511000752449036, 0.41967660188674927, 0.08200447261333466, 0.2822076380252838, 0.47262686491012573, 0.4771284759044647, -0.35730186104774475, 0.39362218976020813, -0.148406982421875, -0.2120828628540039, 0.19532635807991028, -0.47175469994544983, 0.16143733263015747, -0.0953240692615509, 0.036921195685863495, -0.10825912654399872, 0.04366474971175194, 0.06407863646745682, 0.30772238969802856, 0.04927556961774826, 0.1667000651359558, -0.07647395133972168, -0.2454325258731842, -0.023584909737110138, -0.15091130137443542, -0.04078110307455063, 0.48974910378456116, 0.19493421912193298, 0.26580551266670227, 0.09522716701030731, -0.09119953960180283, -0.08565310388803482, -0.07006049156188965, 0.35045135021209717, 0.0032261479645967484, 0.13546353578567505, 0.3513205051422119, 0.45100799202919006, -0.0037036091089248657, 0.0518600195646286, 0.27639564871788025, -0.47314947843551636, 0.17348933219909668, -0.20726792514324188, 0.05565576255321503, 0.07714276760816574, 0.2101876586675644, -0.028674226254224777, 0.06819607317447662, 0.35518741607666016, -0.08817047625780106, -0.13334783911705017, 0.0030612051486968994, -0.01374313235282898, -0.45584002137184143, -0.008649218827486038, 0.05558819696307182, -0.07101953029632568, 0.23836049437522888, 0.08427659422159195, 0.0011098459362983704, 0.1330169439315796, 0.3111955523490906, -0.09393694996833801, 0.07987657189369202, -0.30227622389793396, 0.27779433131217957, -0.051746055483818054, 0.32763540744781494, 0.06185828894376755, 0.03078925609588623, 0.05739302188158035, 0.22177180647850037, -0.01362645998597145, 0.41120436787605286, -0.04143066704273224, -0.1769701987504959, 0.05014600604772568, 0.02937053143978119, -0.01947021670639515, 0.11811964958906174, -0.055668313056230545, -0.1956540048122406, 0.5372544527053833, -0.19654390215873718, -0.1020214706659317, 0.5558624863624573, -0.05053674802184105, 0.2544993758201599, 0.24764341115951538, -0.1501084715127945, -0.05397067219018936, -0.03517761081457138, 0.31779730319976807, -0.011455833911895752, 0.01397780328989029, -0.08536933362483978, -0.12059935927391052, -0.13923904299736023, -0.15417718887329102, -0.12245896458625793, 0.20591290295124054, 0.023627668619155884, -0.165206640958786, -0.05491021275520325, -0.1756191998720169, 0.09010079503059387, 0.15986841917037964, -0.16978180408477783, -0.0679568350315094, -0.15584123134613037, 0.01925080269575119, 0.06475500762462616, -0.051971256732940674, -0.003004450350999832, -0.5545634031295776, 0.5233219861984253, 0.22357787191867828, -0.15214192867279053, -0.495617151260376, 0.03761277347803116, 0.1012803465127945, 0.029897067695856094, -0.05458411946892738, 0.18536092340946198, 0.31413543224334717, -0.2558633089065552, -0.1307140439748764, 0.41440367698669434, 0.019688574597239494, -0.32927751541137695, 0.253743439912796, 0.5437390804290771, 0.259647399187088, -0.33255288004875183, 0.1116086095571518, 0.19022783637046814, -0.16384661197662354, 0.21889668703079224, -0.5269228219985962, 0.20191293954849243, 0.04147768020629883, 0.1378144919872284, 0.020187728106975555, -0.04077187925577164, -0.44634225964546204, -0.015003127977252007, -0.39164435863494873, 0.16997329890727997, -0.1598556935787201, 0.3472902178764343, 0.2496843934059143, 0.08040094375610352, 0.21207711100578308, 0.04660454019904137, 0.03204701095819473, -0.20827063918113708, -0.1946093589067459, -0.22152569890022278, 0.39129436016082764, -0.0027430765330791473, -0.23635709285736084, 0.044364310801029205, -0.16286778450012207, -0.03384093940258026, 0.13677573204040527, -0.06942383199930191, 0.22179856896400452, -0.09631974995136261, 0.10015106201171875, -0.1808861345052719, 0.1453368067741394, 0.37464767694473267, -0.1996454894542694, 0.04837026447057724, -0.2777350842952728, -0.09314760565757751, -0.16068968176841736, -0.060643620789051056, -0.020564541220664978, 0.0009495429694652557, 0.034674022346735, 0.1033082827925682, -0.33398112654685974, 0.28194060921669006, 0.1474395990371704, -0.23759618401527405, 0.14811921119689941, -0.11446782946586609, 0.22547045350074768, 0.062277697026729584, 0.1105298101902008, 0.3810824751853943, -0.14469227194786072, 0.09778677672147751, -0.028188379481434822, 0.11787234246730804, -0.014971781522035599, -0.03535652160644531, -0.21304380893707275, -0.26754873991012573, -0.17862002551555634, -0.11530537903308868, -0.05207880958914757, 0.3027939796447754, 0.29664698243141174, 0.19801267981529236, -0.21848182380199432, -0.056641630828380585, 0.13154210150241852, 0.2011876106262207, -0.16139423847198486, 0.35285428166389465, 0.015290353447198868, -0.16395725309848785, -0.11110784113407135, -0.21820130944252014, -0.039024654775857925, 0.07046569883823395, 0.05717393383383751, 0.16347692906856537, 0.18739387392997742, -0.16956253349781036, -0.0028639063239097595, 0.047663360834121704, 0.15951454639434814, -0.0479126051068306, -0.2973836660385132, 0.20070277154445648, 0.2389901876449585, -0.023221023380756378, -0.22900953888893127, -0.23492154479026794, 0.006414502859115601, -0.14946791529655457, -0.10752653330564499, -0.046984851360321045, -0.4005396366119385, -0.24643872678279877, 0.18900159001350403, 0.06421038508415222, -0.08553659170866013, 0.29318657517433167, 0.03988107293844223, 0.046672750264406204, -0.12247683852910995, -0.16381573677062988, 0.34161362051963806, 0.33375588059425354, 0.2922916114330292, 0.424389511346817, 0.2799918055534363, -0.13929569721221924, 0.07038402557373047, 0.5044135451316833, -0.003968268167227507, 0.13562628626823425, 0.04354558140039444, 0.09737003594636917, -0.501885175704956, -0.35758963227272034, 0.10013410449028015, -0.11214651167392731, -0.4523826241493225, -0.02011740580201149, 0.02536666765809059, -0.5034206509590149, 0.06530588865280151, 0.4927685260772705, -0.47386711835861206, 0.11027562618255615, -0.09217331558465958, 0.32444536685943604, 0.08096171915531158, -0.04337504878640175, 0.13585799932479858, -0.001096181571483612, -0.23027050495147705, -0.15114101767539978, 0.033358387649059296, 0.4674292802810669, 0.06425730884075165, -0.6831780076026917, -0.6064091920852661, -0.07647168636322021, -0.03469137102365494, 0.05914873257279396, 0.33894893527030945, -0.15739618241786957, -0.24013391137123108, 0.1759328544139862, 0.24473047256469727, 0.6002904176712036, 0.3312077224254608, -0.3118547797203064, -0.040105268359184265, 0.22609299421310425, -0.08455294370651245, -0.21462377905845642, -0.03718459978699684, 0.36809638142585754, 0.08802949637174606, 0.05029339715838432, -0.2855943441390991, 0.04258829355239868, -0.06533035635948181, 0.255563884973526, -0.16377496719360352, 0.1390921175479889, -0.20102564990520477, -0.18718281388282776, 0.390571266412735, -0.3738073408603668, -0.11919070780277252, 0.20673729479312897, -0.01641205884516239, -0.5768346786499023, -0.1033310815691948, -0.1507224291563034, 0.10584944486618042, -0.12082279473543167, 0.4519895017147064, -0.19968196749687195, -0.12039045989513397, -0.11824842542409897, 0.002652975730597973, -0.19255885481834412, -0.0886673778295517, 0.3224807679653168, 0.2819454073905945, 0.059713639318943024, -0.4115998446941376, 0.08562595397233963, 0.03920937702059746, -0.2646608054637909, -0.01657172292470932, -0.32432419061660767, -0.12634441256523132, -0.19777816534042358, -0.6029179096221924, 0.6635509133338928, -0.21057479083538055, 0.04873865470290184, -0.4324016571044922, 0.23777897655963898, -0.16053883731365204, -0.009559810161590576, 0.30253756046295166, -0.2522062063217163, -0.23138797283172607, 0.25799623131752014, 0.4445585012435913, 0.5014355182647705, 0.1393488496541977, -0.0033716075122356415, 0.618678867816925, -0.04003986716270447, 0.36504703760147095, 0.09139566123485565, 0.040216464549303055, -0.49948757886886597, 0.01566893234848976, -0.21491946280002594, -0.12912601232528687, 0.06820088624954224, -0.046324990689754486, -0.14595432579517365, -0.012167762964963913, -0.36090344190597534, 0.16775275766849518, 0.026401638984680176, -0.3154931962490082, 0.3076423704624176, -0.20033849775791168, -0.23019026219844818, 0.12044856697320938, -0.2605889141559601, -0.1276721954345703, 0.01433691754937172, -0.17467863857746124, -0.14423969388008118, 0.021208323538303375, -0.12476135790348053, -0.033874545246362686, 0.15119707584381104, 0.18673422932624817, 0.3680219054222107, -0.0903167873620987, -0.1662950962781906, 0.4365842342376709, 0.322457879781723, 0.002271516714245081, -0.06729523837566376, -0.20665273070335388, 0.3459374010562897, 0.4959780275821686, 0.0631825178861618, -0.28770023584365845, 0.1314845085144043, 0.016561955213546753, -0.041130244731903076, 0.01377611979842186, -0.019385218620300293, -0.11378008127212524, -0.5220543146133423, 0.09745879471302032, -0.026351220905780792, -0.436502069234848, -0.3111352026462555, 0.1373426467180252, 0.061046138405799866, -0.084883913397789, 0.06353233754634857, 0.21741752326488495, -0.1984523981809616, 0.4755869507789612, 0.09732362627983093, -0.28588759899139404, 0.09648089110851288, -0.027457047253847122, 0.5957785844802856, 0.04301895201206207, 0.05642743781208992, -0.004959560930728912, -0.0006755515933036804, -0.08708931505680084, 0.5328501462936401, -0.06245478242635727, 0.06113472580909729, 0.2791737914085388, 0.07992297410964966, 0.11902323365211487, -0.12181250751018524, -0.19499117136001587, -0.13331255316734314, 0.38131529092788696, -0.4245970845222473, -0.18559370934963226, 0.2353869080543518, 0.13174119591712952, 0.23675301671028137, -0.1590135544538498, -0.1784353107213974, -0.08263377845287323, -0.055366501212120056, -0.4993947446346283, -0.1660931408405304, 0.06684494763612747, 0.037214361131191254, 0.1777595579624176, -0.3023671507835388, -0.00019802013412117958, -0.0739038959145546, 0.04476290941238403, 0.023408010601997375, -0.1008344292640686, -0.22402535378932953, -0.16144973039627075, 0.10703872889280319, 0.15979261696338654, -0.11535155773162842, -0.281374454498291, -0.09713797271251678, -0.15535739064216614, -0.2417135387659073, -0.15687543153762817, -0.004307843744754791, 0.09146081656217575, 0.18433412909507751, -0.09898054599761963, 0.049476053565740585, -0.0114767886698246, 0.12318249046802521, -0.11097206175327301, -0.36648130416870117, -0.3110092878341675, 0.016888391226530075, 0.04497494548559189, 0.11012189090251923, -0.030158504843711853, -0.1334596872329712, 0.16955578327178955, -0.34684187173843384, -0.17600658535957336, 0.5230823755264282, -0.550598680973053, -0.06996922194957733, 0.11299514770507812, 0.40705376863479614, 0.104367196559906, -0.1612088978290558, -0.05979321151971817, 0.0016676150262355804, 0.21085652709007263, 0.05983726680278778, 0.15631207823753357, 0.4646856188774109, 0.2860659956932068, -0.2841317057609558, 0.4566795825958252, 0.14669500291347504, 0.16701003909111023, 0.0286250077188015, -0.14647990465164185, 0.3602735996246338, -0.4876115918159485, 0.18271413445472717, 0.5268685817718506, 0.008259445428848267, 0.12454798072576523, 0.1570889949798584, -0.29758647084236145, -0.22567681968212128, 0.675332248210907, 0.35861995816230774, 0.4051218330860138, 0.486279159784317, 0.1370701789855957, 0.24841561913490295, 0.10536406189203262, -0.24114970862865448, 0.08417166769504547, -0.3170435130596161, 0.12226194888353348, 0.32279208302497864, 0.3530553877353668, -0.49475154280662537, -0.5293060541152954, -0.4637542963027954, -0.07080420851707458, -0.35612350702285767, 0.18554458022117615, 0.10049135982990265, -0.2608925700187683, 0.07852321863174438, -0.3566349744796753, 0.0834927186369896, -0.07886294275522232, -0.0701914131641388, -0.12030677497386932, -0.18124181032180786, -0.43761223554611206, 0.08705583959817886, 0.14895467460155487, 0.19486628472805023, 0.18149051070213318, -0.1951456367969513, 0.023189622908830643, 0.02049124613404274, -0.04353382810950279, 0.5097449421882629, 0.11641828715801239, 0.4195963740348816, 0.03919241577386856, -0.13735991716384888, -0.095575250685215, -0.2754534184932709, 0.04343258589506149, 0.2113153338432312, 0.0008643120527267456, -0.00026653334498405457, -0.21434955298900604, 0.062063392251729965, 0.05214102566242218, 0.10035966336727142, -0.1349116861820221, 0.23552736639976501, -0.3557737171649933, 0.34968388080596924, -0.5258097052574158, 0.005714915692806244, -0.06809835135936737, -0.10655982792377472, -0.5456803441047668, -0.13259175419807434, 0.4261819124221802, 0.05254751816391945, 0.12035305798053741, 0.11861488223075867, 0.07661537081003189, -0.1489311158657074, -0.007545782253146172, -0.33598819375038147, 0.12429173290729523, 0.1721683293581009, 0.16903340816497803, 0.012043632566928864, 0.21679911017417908, 0.1747339367866516, 0.27109017968177795, 0.1940578818321228, 0.21420837938785553, -0.005654234439134598, 0.1904314160346985, -0.18249163031578064, -0.16293396055698395, -0.005169641226530075, 0.41193628311157227, 0.014311082661151886, 0.05265180766582489, -0.06676731258630753, 0.21722353994846344, -0.29834553599357605, -0.08739731460809708, 0.27233076095581055, 0.08775706589221954, 0.026943907141685486, -0.0035238228738307953, 0.13985610008239746, -0.2333303689956665, 0.2943630814552307, 0.11508128046989441, 0.5360576510429382, -0.02641471102833748, 0.054346464574337006, 0.06331358850002289, -0.05047802999615669, -0.32529282569885254, -0.09101802110671997, 0.3454117178916931, -0.14122235774993896, 0.5335230827331543, -0.04434322938323021, 0.15551626682281494, -0.06615346670150757, 0.4302835166454315, 0.18529856204986572, -0.1626288890838623, -0.4127776324748993, 0.2277536243200302, -0.4331607222557068, -0.16315647959709167, 0.11984235048294067, 0.06325934082269669, 0.1482052356004715, 0.2186058759689331, 0.1757679283618927, -0.22242793440818787, 0.3233640193939209, 0.058150436729192734, -0.09495051950216293, 0.09688163548707962, 0.10189135372638702, 0.022589750587940216, -0.3457394540309906, -0.11861471831798553, -0.5736762285232544, 0.2961269021034241, -0.17983293533325195, 0.15655070543289185, 0.16881607472896576, -0.26665008068084717, -0.06304919719696045, -0.2195952832698822, -0.01972130313515663, -0.09412630647420883, -0.14857953786849976, 0.38956743478775024, -0.07471524178981781 ]
https://github.com/huggingface/datasets/issues/5717
Looks like as long as the number of shards makes a batch lower than 1000 images it works. In my training set I have 40K images. If I use `num_shards=40` (batch of 1000 images) I get the error, but if I update it to `num_shards=50` (batch of 800 images) it works. I will be happy to share my dataset privately if it can help to better debug.
Errror when saving to disk a dataset of images
### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
67
Errror when saving to disk a dataset of images ### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 Looks like as long as the number of shards makes a batch lower than 1000 images it works. In my training set I have 40K images. If I use `num_shards=40` (batch of 1000 images) I get the error, but if I update it to `num_shards=50` (batch of 800 images) it works. I will be happy to share my dataset privately if it can help to better debug.
[ -0.07521145045757294, -0.44404372572898865, -0.10260006785392761, 0.3910185396671295, 0.4102981388568878, 0.2558813691139221, 0.09858540445566177, 0.14438162744045258, -0.23703399300575256, 0.16042831540107727, 0.12004079669713974, 0.2100370079278946, -0.37237343192100525, -0.163156196475029, -0.14881615340709686, -0.06601633876562119, 0.24606919288635254, 0.03519495576620102, 0.31553390622138977, -0.019280478358268738, -0.4303226172924042, 0.19783370196819305, -0.1113562062382698, 0.09576098620891571, -0.27228742837905884, -0.2518807351589203, -0.07265754044055939, 0.03906097263097763, -0.21042500436306, -0.17154012620449066, 0.017110593616962433, -0.3008976876735687, 0.2001149207353592, 0.30391937494277954, -0.00010683824075385928, -0.06346380710601807, 0.1338302344083786, -0.2446221113204956, -0.1711452603340149, -0.18469086289405823, -0.029161572456359863, -0.23259443044662476, -0.09101284295320511, -0.4684022068977356, 0.2943912744522095, -0.39507049322128296, 0.17993436753749847, -0.2451118528842926, 0.36369597911834717, 0.16123627126216888, 0.3394441306591034, 0.011902399361133575, 0.06407707929611206, -0.04979504644870758, 0.2123362123966217, 0.24630074203014374, -0.10447150468826294, 0.2141420692205429, -0.0875370055437088, -0.18472406268119812, 0.3181774616241455, 0.24582964181900024, -0.17366400361061096, 0.021281659603118896, 0.36216437816619873, 0.12314276397228241, 0.14020870625972748, -0.39135026931762695, -0.038269393146038055, -0.24940410256385803, 0.38114824891090393, -0.20504772663116455, -0.3106054365634918, 0.1304585039615631, 0.10274402797222137, -0.17744117975234985, 0.123715341091156, 0.4535548985004425, -0.30707091093063354, -0.020448630675673485, -0.20804595947265625, -0.06651081889867783, -0.28110188245773315, 0.14265312254428864, 0.10370694845914841, -0.36077338457107544, -0.13505321741104126, 0.047490090131759644, 0.35591980814933777, -0.08992345631122589, 0.23759342730045319, -0.1558655947446823, 0.025217805057764053, -0.013141533359885216, -0.06903750449419022, 0.07333274185657501, -0.28681495785713196, 0.0021687988191843033, -0.0037605762481689453, 0.14187319576740265, 0.13929684460163116, -0.182829350233078, 0.10016985237598419, 0.5118119120597839, 0.16544079780578613, 0.07154826819896698, -0.05473723262548447, 0.25718164443969727, 0.25826579332351685, 0.17220374941825867, 0.07092982530593872, -0.23628807067871094, -0.011139418929815292, -0.08605104684829712, 0.6543039679527283, -0.1560084968805313, 0.291303813457489, -0.1396411657333374, -0.346112996339798, 0.33113956451416016, 0.17150026559829712, 0.08249978721141815, -0.21306881308555603, 0.40643012523651123, 0.18383638560771942, 0.01610761694610119, 0.2483498454093933, 0.3640080988407135, 0.09276524931192398, 0.32699909806251526, -0.19953101873397827, 0.05025489255785942, 0.06057003140449524, 0.01128462329506874, -0.0712488517165184, -0.14167657494544983, -0.032544322311878204, -0.07895251363515854, 0.002147434279322624, -0.12808194756507874, 0.05790014564990997, -0.3844551146030426, 0.12698836624622345, 0.21361513435840607, 0.10926977545022964, -0.018329795449972153, 0.18122516572475433, -0.04368593171238899, 0.06269016861915588, 0.3234748840332031, -0.24392817914485931, -0.14761410653591156, -0.5825220942497253, 0.2519259452819824, 0.20470614731311798, 0.18937428295612335, -0.41880130767822266, -0.28549641370773315, 0.532703161239624, -0.06712023913860321, 0.1645340472459793, 0.005608614534139633, -0.23900458216667175, -0.40241342782974243, 0.031858861446380615, 0.06052999943494797, -0.11074275523424149, 0.3362394869327545, -0.18630331754684448, -0.1206112876534462, 0.18576999008655548, 0.279161274433136, 0.0943707823753357, 0.022373739629983902, -0.3228868544101715, 0.20212626457214355, 0.2174447476863861, -0.1931425780057907, -0.2941567301750183, 0.02616206556558609, 0.009151071310043335, -0.22987550497055054, 0.009707003831863403, 0.3027123510837555, 0.25104236602783203, 0.03275531157851219, 0.005905028432607651, 0.12701642513275146, -0.11297629028558731, 0.134468674659729, -0.4011509120464325, 0.0364857017993927, -0.039081402122974396, 0.07814368605613708, -0.08642607927322388, -0.023362748324871063, 0.15075474977493286, -0.11259259283542633, 0.08091743290424347, -0.1435239017009735, 0.19488419592380524, 0.4261718690395355, 0.5107192993164062, -0.1333882063627243, -0.02897782064974308, -0.1044483557343483, -0.3802588880062103, -0.010527841746807098, 0.026425980031490326, -0.15207281708717346, -0.40087080001831055, 0.002535223960876465, -0.11862386763095856, 0.040294088423252106, -0.1852819323539734, 0.08772015571594238, 0.20070911943912506, 0.02182682603597641, -0.228620246052742, 0.19586914777755737, -0.13302363455295563, 0.10301966965198517, -0.06732400506734848, 0.0161990225315094, -0.1804533153772354, 0.6394294500350952, -0.36360448598861694, -0.3987492024898529, -0.09684595465660095, -0.13777363300323486, 0.07341127097606659, 0.05916937440633774, -0.22453834116458893, 0.5005024671554565, 0.09431740641593933, 0.2028811275959015, -0.21213915944099426, -0.24337849020957947, 0.09839238971471786, -0.48302143812179565, 0.02854587323963642, 0.08102963119745255, 0.35732531547546387, 0.09609165787696838, -0.14956983923912048, 0.1470751017332077, -0.07579964399337769, -0.03369344025850296, 0.03924381732940674, 0.21826258301734924, 0.024246864020824432, 0.09217220544815063, 0.19953469932079315, -0.4022337794303894, 0.1265515387058258, 0.1389187127351761, 0.03470625728368759, -0.23187388479709625, -0.14357584714889526, -0.13990244269371033, 0.19486744701862335, 0.18210984766483307, 0.2607106566429138, 0.3337177336215973, 0.12543466687202454, -0.07073107361793518, 0.019383421167731285, 0.4253004789352417, 0.5106462240219116, 0.04017811268568039, -0.3077417016029358, -0.053535424172878265, 0.024117354303598404, 0.06729038804769516, 0.30872470140457153, 0.084163136780262, 0.2868502736091614, 0.26298999786376953, 0.2588483393192291, -0.014060648158192635, -0.21609899401664734, -0.05188094452023506, -0.15916407108306885, 0.3642865717411041, -0.05564786121249199, 0.13718882203102112, -0.1274757832288742, -0.17177258431911469, -0.059790875762701035, 0.0933283269405365, -0.21778970956802368, -0.30813199281692505, -0.06042242795228958, 0.33995699882507324, -0.03990950807929039, -0.04706772044301033, -0.027463167905807495, 0.3057284355163574, 0.1097867488861084, 0.3232915699481964, -0.20846343040466309, 0.04787677526473999, -0.07905063033103943, 0.058791935443878174, 0.16147424280643463, -0.005746904760599136, 0.550287663936615, 0.06422661244869232, 0.0827576294541359, -0.4550299644470215, 0.04101371765136719, -0.040541574358940125, -0.07280591130256653, 0.10894006490707397, 0.22567924857139587, 0.24726293981075287, -0.06191921606659889, -0.36291542649269104, 0.32286959886550903, -0.008566070348024368, -0.33640557527542114, 0.28005272150039673, 0.27166590094566345, -0.14974938333034515, -0.24121031165122986, 0.18850746750831604, -0.353957861661911, -0.3645654618740082, 0.09588726609945297, 0.08514538407325745, 0.27941083908081055, -0.08018803596496582, 0.31513988971710205, -0.052724771201610565, 0.2251349687576294, -0.1396666318178177, -0.1602000892162323, -0.09011765569448471, 0.3879828155040741, -0.10942240059375763, -0.3624897599220276, 0.07067736983299255, 0.10923071205615997, -0.012263101525604725, -0.022776179015636444, -0.49136704206466675, -0.43912214040756226, -0.0586189329624176, -0.06296747922897339, -0.31498757004737854, 0.01548515073955059, 0.0672231987118721, 0.14542317390441895, -0.11607758700847626, -0.09162913262844086, -0.22736448049545288, 0.06458864361047745, 0.0768972784280777, 0.3309994041919708, -0.058574918657541275, 0.411710262298584, 0.2297690212726593, 0.019909778609871864, 0.00584014505147934, -0.13140517473220825, 0.6140477657318115, 0.11263645440340042, 0.3036918044090271, -0.1055363118648529, -0.48759526014328003, -0.05930434167385101, -0.006994426250457764, -0.3009335994720459, -0.2788499593734741, -0.1363316774368286, -0.05949841067194939, -0.09853174537420273, 0.08512476086616516, -0.02012932300567627, 0.09336985647678375, -0.18553999066352844, 0.03879851475358009, 0.05488961562514305, -0.28556662797927856, -0.09226623177528381, -0.09372429549694061, -0.04375462234020233, -0.05710690841078758, 0.2522600591182709, 0.34159982204437256, -0.1299227774143219, -0.14834710955619812, -0.016626667231321335, -0.2732453942298889, 0.4063478708267212, 0.13872011005878448, 0.3885350525379181, -0.1061183512210846, 0.022707782685756683, 0.2076321691274643, -0.1498495191335678, 0.493360698223114, -0.1999422013759613, -0.14206089079380035, 0.008977726101875305, 0.12484601885080338, -0.47099441289901733, -0.04782307893037796, 0.011989563703536987, 0.06963776051998138, -0.25989922881126404, 0.5957697033882141, -0.015774846076965332, 0.010713491588830948, 0.06415470689535141, 0.007493361830711365, -0.4021505117416382, -0.21996134519577026, -0.36466723680496216, -0.36327236890792847, -0.3501264750957489, -0.12055060267448425, 0.02136749029159546, 0.059523217380046844, 0.24893322587013245, 0.018065892159938812, 0.04143015295267105, -0.10177899897098541, -0.17392538487911224, -0.20327921211719513, 0.5465952157974243, -0.4622514843940735, 0.17136447131633759, -0.1784375160932541, 0.04953498765826225, 0.5429152250289917, 0.25256577134132385, -0.272407591342926, -0.22448107600212097, 0.2086336612701416, -0.1811966449022293, 0.09950433671474457, -0.020101159811019897, -0.2247089445590973, -0.039665453135967255, -0.10478943586349487, 0.2824459373950958, -0.20428350567817688, -0.3170278072357178, 0.360075443983078, -0.2905513048171997, -0.12862136960029602, 0.13764218986034393, 0.33205533027648926, 0.1727677285671234, 0.17940418422222137, 0.0715818852186203, -0.024893026798963547, -0.10104398429393768, 0.4275776147842407, 0.48721930384635925, 0.8410309553146362, -0.065415158867836, 0.3637359142303467, -0.03740920126438141, -0.3139168918132782, -0.007414024323225021, 0.04606068879365921, 0.06794607639312744, -0.3839375078678131, -0.44326284527778625, -0.07460722327232361, -0.1579577922821045, -0.02599669247865677, 0.0001272503286600113, -0.2726850211620331, -0.023972557857632637, -0.2626406252384186, -0.0488782562315464, -0.24869129061698914, -0.07510309666395187, -0.4291793406009674, -0.23395293951034546, -0.1827024221420288, 0.22474460303783417, -0.04153886437416077, 0.06093453988432884, -0.03594597801566124, -0.0759660005569458, -0.07736749947071075, -0.1276557892560959, -0.403288871049881, -0.06772810965776443, -0.29874956607818604, 0.40608322620391846, -0.14162467420101166, -0.33281394839286804, -0.14779189229011536, 0.3944907486438751, 0.1385461390018463, -0.04560510441660881, 0.0038916952908039093, -0.22316043078899384, 0.062314722687006, 0.06088651716709137, -0.2622636556625366, -0.09927383065223694, 0.2314627766609192, -0.17787712812423706, 0.09466791152954102, -0.05396386608481407, 0.15422281622886658, -0.19130291044712067, -0.017752304673194885, 0.3690420985221863, -0.06284864246845245, -0.044910404831171036, -0.33713841438293457, -0.3546522855758667, -0.17530888319015503, -0.28952187299728394, 0.20370271801948547, 0.2759840190410614, 0.03658343106508255, 0.3743407130241394, -0.16362470388412476, -0.10972857475280762, 0.1342109888792038, 0.544333279132843, 0.11650422215461731, -0.12895473837852478, 0.3010965585708618, -0.16983962059020996, -0.1776038408279419, -0.33406203985214233, 0.3911176025867462, -0.08485348522663116, -0.29709964990615845, 0.4522235691547394, -0.2659975290298462, 0.09892553091049194, -0.13411672413349152, 0.03527456149458885, 0.2476743757724762, 0.0539398193359375, 0.025842301547527313, -0.40739691257476807, -0.5168470144271851, 0.14435678720474243, 0.1066773533821106, 0.33252233266830444, -0.2200893610715866, -0.17351530492305756, 0.11528071016073227, -0.0547378733754158, -0.35790330171585083, 0.29164302349090576, -0.37721988558769226, 0.04004397615790367, 0.1282629370689392, 0.0003440026193857193, -0.07764223217964172, -0.07088486105203629, 0.25604796409606934, 0.3145330548286438, -0.10768771171569824, -0.21292918920516968, -0.005848489701747894, 0.11377325654029846, 0.021964184939861298, -0.27351194620132446, -0.08116640150547028, -0.2242637276649475, -0.13428042829036713, 0.1155378669500351, -0.30229926109313965, 0.18130698800086975, -0.15341731905937195, -0.08665231615304947, 0.11646325141191483, 0.0937434509396553, 0.2892701029777527, 0.004434381611645222, -0.24114647507667542, 0.2728566527366638, 0.14182651042938232, -0.018691452220082283, 0.03289370238780975, -0.16358554363250732, -0.32848435640335083, -0.0526885911822319, -0.08028893172740936, 0.11593534052371979, 0.2549547851085663, -0.26021912693977356, -0.21458546817302704, 0.031060393899679184, 0.37542736530303955, 0.17995819449424744, -0.3606399595737457, 0.06232365965843201, 0.15748725831508636, 0.3051551282405853, -0.016741402447223663, -0.3121994137763977, 0.07349468767642975, -0.17897513508796692, -0.35765331983566284, 0.13011911511421204, -0.000911712646484375, 0.07496558129787445, -0.2177334427833557, 0.0444009006023407, 0.4878174066543579, -0.3925590217113495, 0.028195124119520187, 0.12654291093349457, -0.07393982261419296, 0.12509097158908844, 0.03986778110265732, -0.061330437660217285, 0.44694897532463074, 0.21191254258155823, -0.11841198801994324, 0.29879969358444214, 0.22659197449684143, -0.15691839158535004, 0.19504456222057343, -0.32141420245170593, -0.0027479473501443863, 0.05936824157834053, 0.02565913274884224, 0.10653232038021088, 0.0645144134759903, 0.1684112250804901, -0.04923905432224274, -0.04892580956220627, -0.15365728735923767, 0.306557834148407, -0.19247806072235107, 0.1871172934770584, 0.08527738600969315, -0.1767416149377823, -0.17560148239135742, 0.04051349312067032, -0.11955174803733826, -0.13833937048912048, 0.35015302896499634, 0.3595314919948578, 0.01808731071650982, 0.10643567144870758, -0.11381229013204575, 0.2423899620771408, 0.12314894795417786, -0.33362773060798645, 0.1021973043680191, 0.3771551549434662, -0.01126139983534813, -0.1491526961326599, 0.33231714367866516, 0.6502026319503784, 0.5205176472663879, 0.10396957397460938, 0.06877332925796509, 0.020600665360689163, 0.03930658847093582, 0.027049202471971512, 0.11379742622375488, 0.10493318736553192, 0.3370399475097656, 0.20669235289096832, 0.1970016360282898, -0.12948954105377197, 0.18937011063098907, 0.2372012734413147, 0.1642962247133255, 0.1978883445262909, 0.012826714664697647, -0.15217947959899902, -0.36612313985824585, -0.15895450115203857, -0.026182323694229126, -0.21511557698249817, -0.15423409640789032, 0.1268758922815323, -0.06235358491539955, 0.17887349426746368, 0.11466719210147858, 0.11698716133832932, -0.23693980276584625, 0.38650763034820557, 0.5090125799179077, -0.1169380247592926, -0.39765363931655884, -0.22727999091148376, -0.44204574823379517, 0.1687215268611908, 0.05943717435002327, -0.005614235997200012, 0.014508165419101715, 0.22647668421268463, -0.19892486929893494, -0.06747377663850784, 0.44170236587524414, 0.16981755197048187, -0.041034117341041565, 0.6356558799743652, -0.3783237338066101, 0.0006774584762752056, 0.40569671988487244, -0.15703274309635162, 0.015336789190769196, -0.3836992383003235, 0.2202458679676056, -0.05782502144575119, 0.24727670848369598, -0.16062161326408386, 0.06627460569143295, -0.39454877376556396, 0.2967628538608551, 0.5504470467567444, 0.01685257814824581, 0.031246935948729515, -0.08765284717082977, -0.3352944254875183, 0.19998787343502045, -0.04183846712112427, -0.11275750398635864, 0.1416485607624054, 0.4372154772281647, 0.5372055172920227, -0.1324874758720398, -0.06924180686473846, -0.4107624292373657, 0.2712883949279785, -0.021383658051490784, 0.08942871540784836, -0.1774350106716156, 0.19445708394050598, 0.21437989175319672, -0.23487362265586853, 0.2792143225669861, -0.21022216975688934, 0.13424283266067505, 0.31900453567504883, -0.5583702325820923, -0.4061664044857025, 0.45400652289390564, 0.19457679986953735, -0.15187117457389832, 0.19681806862354279, 0.34316539764404297, 0.09981376677751541, 0.16339638829231262, -0.6086978912353516, -0.19865062832832336, 0.33156874775886536, -0.23096677660942078, -0.239202618598938, 0.25619399547576904, -0.027780668810009956, 0.08274531364440918, 0.07530894875526428, 0.43439164757728577, -0.10755044221878052, -0.15896573662757874, 0.19667655229568481, -0.18355324864387512 ]
https://github.com/huggingface/datasets/issues/5717
Hi! I didn't manage to reproduce this behavior, so sharing the dataset with us would help a lot. > My dataset is around 50K images, is this error might be due to a bad image? This shouldn't be the case as we save raw data to disk without decoding it.
Errror when saving to disk a dataset of images
### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
50
Errror when saving to disk a dataset of images ### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 Hi! I didn't manage to reproduce this behavior, so sharing the dataset with us would help a lot. > My dataset is around 50K images, is this error might be due to a bad image? This shouldn't be the case as we save raw data to disk without decoding it.
[ -0.07521145045757294, -0.44404372572898865, -0.10260006785392761, 0.3910185396671295, 0.4102981388568878, 0.2558813691139221, 0.09858540445566177, 0.14438162744045258, -0.23703399300575256, 0.16042831540107727, 0.12004079669713974, 0.2100370079278946, -0.37237343192100525, -0.163156196475029, -0.14881615340709686, -0.06601633876562119, 0.24606919288635254, 0.03519495576620102, 0.31553390622138977, -0.019280478358268738, -0.4303226172924042, 0.19783370196819305, -0.1113562062382698, 0.09576098620891571, -0.27228742837905884, -0.2518807351589203, -0.07265754044055939, 0.03906097263097763, -0.21042500436306, -0.17154012620449066, 0.017110593616962433, -0.3008976876735687, 0.2001149207353592, 0.30391937494277954, -0.00010683824075385928, -0.06346380710601807, 0.1338302344083786, -0.2446221113204956, -0.1711452603340149, -0.18469086289405823, -0.029161572456359863, -0.23259443044662476, -0.09101284295320511, -0.4684022068977356, 0.2943912744522095, -0.39507049322128296, 0.17993436753749847, -0.2451118528842926, 0.36369597911834717, 0.16123627126216888, 0.3394441306591034, 0.011902399361133575, 0.06407707929611206, -0.04979504644870758, 0.2123362123966217, 0.24630074203014374, -0.10447150468826294, 0.2141420692205429, -0.0875370055437088, -0.18472406268119812, 0.3181774616241455, 0.24582964181900024, -0.17366400361061096, 0.021281659603118896, 0.36216437816619873, 0.12314276397228241, 0.14020870625972748, -0.39135026931762695, -0.038269393146038055, -0.24940410256385803, 0.38114824891090393, -0.20504772663116455, -0.3106054365634918, 0.1304585039615631, 0.10274402797222137, -0.17744117975234985, 0.123715341091156, 0.4535548985004425, -0.30707091093063354, -0.020448630675673485, -0.20804595947265625, -0.06651081889867783, -0.28110188245773315, 0.14265312254428864, 0.10370694845914841, -0.36077338457107544, -0.13505321741104126, 0.047490090131759644, 0.35591980814933777, -0.08992345631122589, 0.23759342730045319, -0.1558655947446823, 0.025217805057764053, -0.013141533359885216, -0.06903750449419022, 0.07333274185657501, -0.28681495785713196, 0.0021687988191843033, -0.0037605762481689453, 0.14187319576740265, 0.13929684460163116, -0.182829350233078, 0.10016985237598419, 0.5118119120597839, 0.16544079780578613, 0.07154826819896698, -0.05473723262548447, 0.25718164443969727, 0.25826579332351685, 0.17220374941825867, 0.07092982530593872, -0.23628807067871094, -0.011139418929815292, -0.08605104684829712, 0.6543039679527283, -0.1560084968805313, 0.291303813457489, -0.1396411657333374, -0.346112996339798, 0.33113956451416016, 0.17150026559829712, 0.08249978721141815, -0.21306881308555603, 0.40643012523651123, 0.18383638560771942, 0.01610761694610119, 0.2483498454093933, 0.3640080988407135, 0.09276524931192398, 0.32699909806251526, -0.19953101873397827, 0.05025489255785942, 0.06057003140449524, 0.01128462329506874, -0.0712488517165184, -0.14167657494544983, -0.032544322311878204, -0.07895251363515854, 0.002147434279322624, -0.12808194756507874, 0.05790014564990997, -0.3844551146030426, 0.12698836624622345, 0.21361513435840607, 0.10926977545022964, -0.018329795449972153, 0.18122516572475433, -0.04368593171238899, 0.06269016861915588, 0.3234748840332031, -0.24392817914485931, -0.14761410653591156, -0.5825220942497253, 0.2519259452819824, 0.20470614731311798, 0.18937428295612335, -0.41880130767822266, -0.28549641370773315, 0.532703161239624, -0.06712023913860321, 0.1645340472459793, 0.005608614534139633, -0.23900458216667175, -0.40241342782974243, 0.031858861446380615, 0.06052999943494797, -0.11074275523424149, 0.3362394869327545, -0.18630331754684448, -0.1206112876534462, 0.18576999008655548, 0.279161274433136, 0.0943707823753357, 0.022373739629983902, -0.3228868544101715, 0.20212626457214355, 0.2174447476863861, -0.1931425780057907, -0.2941567301750183, 0.02616206556558609, 0.009151071310043335, -0.22987550497055054, 0.009707003831863403, 0.3027123510837555, 0.25104236602783203, 0.03275531157851219, 0.005905028432607651, 0.12701642513275146, -0.11297629028558731, 0.134468674659729, -0.4011509120464325, 0.0364857017993927, -0.039081402122974396, 0.07814368605613708, -0.08642607927322388, -0.023362748324871063, 0.15075474977493286, -0.11259259283542633, 0.08091743290424347, -0.1435239017009735, 0.19488419592380524, 0.4261718690395355, 0.5107192993164062, -0.1333882063627243, -0.02897782064974308, -0.1044483557343483, -0.3802588880062103, -0.010527841746807098, 0.026425980031490326, -0.15207281708717346, -0.40087080001831055, 0.002535223960876465, -0.11862386763095856, 0.040294088423252106, -0.1852819323539734, 0.08772015571594238, 0.20070911943912506, 0.02182682603597641, -0.228620246052742, 0.19586914777755737, -0.13302363455295563, 0.10301966965198517, -0.06732400506734848, 0.0161990225315094, -0.1804533153772354, 0.6394294500350952, -0.36360448598861694, -0.3987492024898529, -0.09684595465660095, -0.13777363300323486, 0.07341127097606659, 0.05916937440633774, -0.22453834116458893, 0.5005024671554565, 0.09431740641593933, 0.2028811275959015, -0.21213915944099426, -0.24337849020957947, 0.09839238971471786, -0.48302143812179565, 0.02854587323963642, 0.08102963119745255, 0.35732531547546387, 0.09609165787696838, -0.14956983923912048, 0.1470751017332077, -0.07579964399337769, -0.03369344025850296, 0.03924381732940674, 0.21826258301734924, 0.024246864020824432, 0.09217220544815063, 0.19953469932079315, -0.4022337794303894, 0.1265515387058258, 0.1389187127351761, 0.03470625728368759, -0.23187388479709625, -0.14357584714889526, -0.13990244269371033, 0.19486744701862335, 0.18210984766483307, 0.2607106566429138, 0.3337177336215973, 0.12543466687202454, -0.07073107361793518, 0.019383421167731285, 0.4253004789352417, 0.5106462240219116, 0.04017811268568039, -0.3077417016029358, -0.053535424172878265, 0.024117354303598404, 0.06729038804769516, 0.30872470140457153, 0.084163136780262, 0.2868502736091614, 0.26298999786376953, 0.2588483393192291, -0.014060648158192635, -0.21609899401664734, -0.05188094452023506, -0.15916407108306885, 0.3642865717411041, -0.05564786121249199, 0.13718882203102112, -0.1274757832288742, -0.17177258431911469, -0.059790875762701035, 0.0933283269405365, -0.21778970956802368, -0.30813199281692505, -0.06042242795228958, 0.33995699882507324, -0.03990950807929039, -0.04706772044301033, -0.027463167905807495, 0.3057284355163574, 0.1097867488861084, 0.3232915699481964, -0.20846343040466309, 0.04787677526473999, -0.07905063033103943, 0.058791935443878174, 0.16147424280643463, -0.005746904760599136, 0.550287663936615, 0.06422661244869232, 0.0827576294541359, -0.4550299644470215, 0.04101371765136719, -0.040541574358940125, -0.07280591130256653, 0.10894006490707397, 0.22567924857139587, 0.24726293981075287, -0.06191921606659889, -0.36291542649269104, 0.32286959886550903, -0.008566070348024368, -0.33640557527542114, 0.28005272150039673, 0.27166590094566345, -0.14974938333034515, -0.24121031165122986, 0.18850746750831604, -0.353957861661911, -0.3645654618740082, 0.09588726609945297, 0.08514538407325745, 0.27941083908081055, -0.08018803596496582, 0.31513988971710205, -0.052724771201610565, 0.2251349687576294, -0.1396666318178177, -0.1602000892162323, -0.09011765569448471, 0.3879828155040741, -0.10942240059375763, -0.3624897599220276, 0.07067736983299255, 0.10923071205615997, -0.012263101525604725, -0.022776179015636444, -0.49136704206466675, -0.43912214040756226, -0.0586189329624176, -0.06296747922897339, -0.31498757004737854, 0.01548515073955059, 0.0672231987118721, 0.14542317390441895, -0.11607758700847626, -0.09162913262844086, -0.22736448049545288, 0.06458864361047745, 0.0768972784280777, 0.3309994041919708, -0.058574918657541275, 0.411710262298584, 0.2297690212726593, 0.019909778609871864, 0.00584014505147934, -0.13140517473220825, 0.6140477657318115, 0.11263645440340042, 0.3036918044090271, -0.1055363118648529, -0.48759526014328003, -0.05930434167385101, -0.006994426250457764, -0.3009335994720459, -0.2788499593734741, -0.1363316774368286, -0.05949841067194939, -0.09853174537420273, 0.08512476086616516, -0.02012932300567627, 0.09336985647678375, -0.18553999066352844, 0.03879851475358009, 0.05488961562514305, -0.28556662797927856, -0.09226623177528381, -0.09372429549694061, -0.04375462234020233, -0.05710690841078758, 0.2522600591182709, 0.34159982204437256, -0.1299227774143219, -0.14834710955619812, -0.016626667231321335, -0.2732453942298889, 0.4063478708267212, 0.13872011005878448, 0.3885350525379181, -0.1061183512210846, 0.022707782685756683, 0.2076321691274643, -0.1498495191335678, 0.493360698223114, -0.1999422013759613, -0.14206089079380035, 0.008977726101875305, 0.12484601885080338, -0.47099441289901733, -0.04782307893037796, 0.011989563703536987, 0.06963776051998138, -0.25989922881126404, 0.5957697033882141, -0.015774846076965332, 0.010713491588830948, 0.06415470689535141, 0.007493361830711365, -0.4021505117416382, -0.21996134519577026, -0.36466723680496216, -0.36327236890792847, -0.3501264750957489, -0.12055060267448425, 0.02136749029159546, 0.059523217380046844, 0.24893322587013245, 0.018065892159938812, 0.04143015295267105, -0.10177899897098541, -0.17392538487911224, -0.20327921211719513, 0.5465952157974243, -0.4622514843940735, 0.17136447131633759, -0.1784375160932541, 0.04953498765826225, 0.5429152250289917, 0.25256577134132385, -0.272407591342926, -0.22448107600212097, 0.2086336612701416, -0.1811966449022293, 0.09950433671474457, -0.020101159811019897, -0.2247089445590973, -0.039665453135967255, -0.10478943586349487, 0.2824459373950958, -0.20428350567817688, -0.3170278072357178, 0.360075443983078, -0.2905513048171997, -0.12862136960029602, 0.13764218986034393, 0.33205533027648926, 0.1727677285671234, 0.17940418422222137, 0.0715818852186203, -0.024893026798963547, -0.10104398429393768, 0.4275776147842407, 0.48721930384635925, 0.8410309553146362, -0.065415158867836, 0.3637359142303467, -0.03740920126438141, -0.3139168918132782, -0.007414024323225021, 0.04606068879365921, 0.06794607639312744, -0.3839375078678131, -0.44326284527778625, -0.07460722327232361, -0.1579577922821045, -0.02599669247865677, 0.0001272503286600113, -0.2726850211620331, -0.023972557857632637, -0.2626406252384186, -0.0488782562315464, -0.24869129061698914, -0.07510309666395187, -0.4291793406009674, -0.23395293951034546, -0.1827024221420288, 0.22474460303783417, -0.04153886437416077, 0.06093453988432884, -0.03594597801566124, -0.0759660005569458, -0.07736749947071075, -0.1276557892560959, -0.403288871049881, -0.06772810965776443, -0.29874956607818604, 0.40608322620391846, -0.14162467420101166, -0.33281394839286804, -0.14779189229011536, 0.3944907486438751, 0.1385461390018463, -0.04560510441660881, 0.0038916952908039093, -0.22316043078899384, 0.062314722687006, 0.06088651716709137, -0.2622636556625366, -0.09927383065223694, 0.2314627766609192, -0.17787712812423706, 0.09466791152954102, -0.05396386608481407, 0.15422281622886658, -0.19130291044712067, -0.017752304673194885, 0.3690420985221863, -0.06284864246845245, -0.044910404831171036, -0.33713841438293457, -0.3546522855758667, -0.17530888319015503, -0.28952187299728394, 0.20370271801948547, 0.2759840190410614, 0.03658343106508255, 0.3743407130241394, -0.16362470388412476, -0.10972857475280762, 0.1342109888792038, 0.544333279132843, 0.11650422215461731, -0.12895473837852478, 0.3010965585708618, -0.16983962059020996, -0.1776038408279419, -0.33406203985214233, 0.3911176025867462, -0.08485348522663116, -0.29709964990615845, 0.4522235691547394, -0.2659975290298462, 0.09892553091049194, -0.13411672413349152, 0.03527456149458885, 0.2476743757724762, 0.0539398193359375, 0.025842301547527313, -0.40739691257476807, -0.5168470144271851, 0.14435678720474243, 0.1066773533821106, 0.33252233266830444, -0.2200893610715866, -0.17351530492305756, 0.11528071016073227, -0.0547378733754158, -0.35790330171585083, 0.29164302349090576, -0.37721988558769226, 0.04004397615790367, 0.1282629370689392, 0.0003440026193857193, -0.07764223217964172, -0.07088486105203629, 0.25604796409606934, 0.3145330548286438, -0.10768771171569824, -0.21292918920516968, -0.005848489701747894, 0.11377325654029846, 0.021964184939861298, -0.27351194620132446, -0.08116640150547028, -0.2242637276649475, -0.13428042829036713, 0.1155378669500351, -0.30229926109313965, 0.18130698800086975, -0.15341731905937195, -0.08665231615304947, 0.11646325141191483, 0.0937434509396553, 0.2892701029777527, 0.004434381611645222, -0.24114647507667542, 0.2728566527366638, 0.14182651042938232, -0.018691452220082283, 0.03289370238780975, -0.16358554363250732, -0.32848435640335083, -0.0526885911822319, -0.08028893172740936, 0.11593534052371979, 0.2549547851085663, -0.26021912693977356, -0.21458546817302704, 0.031060393899679184, 0.37542736530303955, 0.17995819449424744, -0.3606399595737457, 0.06232365965843201, 0.15748725831508636, 0.3051551282405853, -0.016741402447223663, -0.3121994137763977, 0.07349468767642975, -0.17897513508796692, -0.35765331983566284, 0.13011911511421204, -0.000911712646484375, 0.07496558129787445, -0.2177334427833557, 0.0444009006023407, 0.4878174066543579, -0.3925590217113495, 0.028195124119520187, 0.12654291093349457, -0.07393982261419296, 0.12509097158908844, 0.03986778110265732, -0.061330437660217285, 0.44694897532463074, 0.21191254258155823, -0.11841198801994324, 0.29879969358444214, 0.22659197449684143, -0.15691839158535004, 0.19504456222057343, -0.32141420245170593, -0.0027479473501443863, 0.05936824157834053, 0.02565913274884224, 0.10653232038021088, 0.0645144134759903, 0.1684112250804901, -0.04923905432224274, -0.04892580956220627, -0.15365728735923767, 0.306557834148407, -0.19247806072235107, 0.1871172934770584, 0.08527738600969315, -0.1767416149377823, -0.17560148239135742, 0.04051349312067032, -0.11955174803733826, -0.13833937048912048, 0.35015302896499634, 0.3595314919948578, 0.01808731071650982, 0.10643567144870758, -0.11381229013204575, 0.2423899620771408, 0.12314894795417786, -0.33362773060798645, 0.1021973043680191, 0.3771551549434662, -0.01126139983534813, -0.1491526961326599, 0.33231714367866516, 0.6502026319503784, 0.5205176472663879, 0.10396957397460938, 0.06877332925796509, 0.020600665360689163, 0.03930658847093582, 0.027049202471971512, 0.11379742622375488, 0.10493318736553192, 0.3370399475097656, 0.20669235289096832, 0.1970016360282898, -0.12948954105377197, 0.18937011063098907, 0.2372012734413147, 0.1642962247133255, 0.1978883445262909, 0.012826714664697647, -0.15217947959899902, -0.36612313985824585, -0.15895450115203857, -0.026182323694229126, -0.21511557698249817, -0.15423409640789032, 0.1268758922815323, -0.06235358491539955, 0.17887349426746368, 0.11466719210147858, 0.11698716133832932, -0.23693980276584625, 0.38650763034820557, 0.5090125799179077, -0.1169380247592926, -0.39765363931655884, -0.22727999091148376, -0.44204574823379517, 0.1687215268611908, 0.05943717435002327, -0.005614235997200012, 0.014508165419101715, 0.22647668421268463, -0.19892486929893494, -0.06747377663850784, 0.44170236587524414, 0.16981755197048187, -0.041034117341041565, 0.6356558799743652, -0.3783237338066101, 0.0006774584762752056, 0.40569671988487244, -0.15703274309635162, 0.015336789190769196, -0.3836992383003235, 0.2202458679676056, -0.05782502144575119, 0.24727670848369598, -0.16062161326408386, 0.06627460569143295, -0.39454877376556396, 0.2967628538608551, 0.5504470467567444, 0.01685257814824581, 0.031246935948729515, -0.08765284717082977, -0.3352944254875183, 0.19998787343502045, -0.04183846712112427, -0.11275750398635864, 0.1416485607624054, 0.4372154772281647, 0.5372055172920227, -0.1324874758720398, -0.06924180686473846, -0.4107624292373657, 0.2712883949279785, -0.021383658051490784, 0.08942871540784836, -0.1774350106716156, 0.19445708394050598, 0.21437989175319672, -0.23487362265586853, 0.2792143225669861, -0.21022216975688934, 0.13424283266067505, 0.31900453567504883, -0.5583702325820923, -0.4061664044857025, 0.45400652289390564, 0.19457679986953735, -0.15187117457389832, 0.19681806862354279, 0.34316539764404297, 0.09981376677751541, 0.16339638829231262, -0.6086978912353516, -0.19865062832832336, 0.33156874775886536, -0.23096677660942078, -0.239202618598938, 0.25619399547576904, -0.027780668810009956, 0.08274531364440918, 0.07530894875526428, 0.43439164757728577, -0.10755044221878052, -0.15896573662757874, 0.19667655229568481, -0.18355324864387512 ]
https://github.com/huggingface/datasets/issues/5717
OK, thanks! The dataset is currently hosted on a gcs bucket. How would you like to proceed for sharing the link?
Errror when saving to disk a dataset of images
### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
21
Errror when saving to disk a dataset of images ### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 OK, thanks! The dataset is currently hosted on a gcs bucket. How would you like to proceed for sharing the link?
[ -0.07521145045757294, -0.44404372572898865, -0.10260006785392761, 0.3910185396671295, 0.4102981388568878, 0.2558813691139221, 0.09858540445566177, 0.14438162744045258, -0.23703399300575256, 0.16042831540107727, 0.12004079669713974, 0.2100370079278946, -0.37237343192100525, -0.163156196475029, -0.14881615340709686, -0.06601633876562119, 0.24606919288635254, 0.03519495576620102, 0.31553390622138977, -0.019280478358268738, -0.4303226172924042, 0.19783370196819305, -0.1113562062382698, 0.09576098620891571, -0.27228742837905884, -0.2518807351589203, -0.07265754044055939, 0.03906097263097763, -0.21042500436306, -0.17154012620449066, 0.017110593616962433, -0.3008976876735687, 0.2001149207353592, 0.30391937494277954, -0.00010683824075385928, -0.06346380710601807, 0.1338302344083786, -0.2446221113204956, -0.1711452603340149, -0.18469086289405823, -0.029161572456359863, -0.23259443044662476, -0.09101284295320511, -0.4684022068977356, 0.2943912744522095, -0.39507049322128296, 0.17993436753749847, -0.2451118528842926, 0.36369597911834717, 0.16123627126216888, 0.3394441306591034, 0.011902399361133575, 0.06407707929611206, -0.04979504644870758, 0.2123362123966217, 0.24630074203014374, -0.10447150468826294, 0.2141420692205429, -0.0875370055437088, -0.18472406268119812, 0.3181774616241455, 0.24582964181900024, -0.17366400361061096, 0.021281659603118896, 0.36216437816619873, 0.12314276397228241, 0.14020870625972748, -0.39135026931762695, -0.038269393146038055, -0.24940410256385803, 0.38114824891090393, -0.20504772663116455, -0.3106054365634918, 0.1304585039615631, 0.10274402797222137, -0.17744117975234985, 0.123715341091156, 0.4535548985004425, -0.30707091093063354, -0.020448630675673485, -0.20804595947265625, -0.06651081889867783, -0.28110188245773315, 0.14265312254428864, 0.10370694845914841, -0.36077338457107544, -0.13505321741104126, 0.047490090131759644, 0.35591980814933777, -0.08992345631122589, 0.23759342730045319, -0.1558655947446823, 0.025217805057764053, -0.013141533359885216, -0.06903750449419022, 0.07333274185657501, -0.28681495785713196, 0.0021687988191843033, -0.0037605762481689453, 0.14187319576740265, 0.13929684460163116, -0.182829350233078, 0.10016985237598419, 0.5118119120597839, 0.16544079780578613, 0.07154826819896698, -0.05473723262548447, 0.25718164443969727, 0.25826579332351685, 0.17220374941825867, 0.07092982530593872, -0.23628807067871094, -0.011139418929815292, -0.08605104684829712, 0.6543039679527283, -0.1560084968805313, 0.291303813457489, -0.1396411657333374, -0.346112996339798, 0.33113956451416016, 0.17150026559829712, 0.08249978721141815, -0.21306881308555603, 0.40643012523651123, 0.18383638560771942, 0.01610761694610119, 0.2483498454093933, 0.3640080988407135, 0.09276524931192398, 0.32699909806251526, -0.19953101873397827, 0.05025489255785942, 0.06057003140449524, 0.01128462329506874, -0.0712488517165184, -0.14167657494544983, -0.032544322311878204, -0.07895251363515854, 0.002147434279322624, -0.12808194756507874, 0.05790014564990997, -0.3844551146030426, 0.12698836624622345, 0.21361513435840607, 0.10926977545022964, -0.018329795449972153, 0.18122516572475433, -0.04368593171238899, 0.06269016861915588, 0.3234748840332031, -0.24392817914485931, -0.14761410653591156, -0.5825220942497253, 0.2519259452819824, 0.20470614731311798, 0.18937428295612335, -0.41880130767822266, -0.28549641370773315, 0.532703161239624, -0.06712023913860321, 0.1645340472459793, 0.005608614534139633, -0.23900458216667175, -0.40241342782974243, 0.031858861446380615, 0.06052999943494797, -0.11074275523424149, 0.3362394869327545, -0.18630331754684448, -0.1206112876534462, 0.18576999008655548, 0.279161274433136, 0.0943707823753357, 0.022373739629983902, -0.3228868544101715, 0.20212626457214355, 0.2174447476863861, -0.1931425780057907, -0.2941567301750183, 0.02616206556558609, 0.009151071310043335, -0.22987550497055054, 0.009707003831863403, 0.3027123510837555, 0.25104236602783203, 0.03275531157851219, 0.005905028432607651, 0.12701642513275146, -0.11297629028558731, 0.134468674659729, -0.4011509120464325, 0.0364857017993927, -0.039081402122974396, 0.07814368605613708, -0.08642607927322388, -0.023362748324871063, 0.15075474977493286, -0.11259259283542633, 0.08091743290424347, -0.1435239017009735, 0.19488419592380524, 0.4261718690395355, 0.5107192993164062, -0.1333882063627243, -0.02897782064974308, -0.1044483557343483, -0.3802588880062103, -0.010527841746807098, 0.026425980031490326, -0.15207281708717346, -0.40087080001831055, 0.002535223960876465, -0.11862386763095856, 0.040294088423252106, -0.1852819323539734, 0.08772015571594238, 0.20070911943912506, 0.02182682603597641, -0.228620246052742, 0.19586914777755737, -0.13302363455295563, 0.10301966965198517, -0.06732400506734848, 0.0161990225315094, -0.1804533153772354, 0.6394294500350952, -0.36360448598861694, -0.3987492024898529, -0.09684595465660095, -0.13777363300323486, 0.07341127097606659, 0.05916937440633774, -0.22453834116458893, 0.5005024671554565, 0.09431740641593933, 0.2028811275959015, -0.21213915944099426, -0.24337849020957947, 0.09839238971471786, -0.48302143812179565, 0.02854587323963642, 0.08102963119745255, 0.35732531547546387, 0.09609165787696838, -0.14956983923912048, 0.1470751017332077, -0.07579964399337769, -0.03369344025850296, 0.03924381732940674, 0.21826258301734924, 0.024246864020824432, 0.09217220544815063, 0.19953469932079315, -0.4022337794303894, 0.1265515387058258, 0.1389187127351761, 0.03470625728368759, -0.23187388479709625, -0.14357584714889526, -0.13990244269371033, 0.19486744701862335, 0.18210984766483307, 0.2607106566429138, 0.3337177336215973, 0.12543466687202454, -0.07073107361793518, 0.019383421167731285, 0.4253004789352417, 0.5106462240219116, 0.04017811268568039, -0.3077417016029358, -0.053535424172878265, 0.024117354303598404, 0.06729038804769516, 0.30872470140457153, 0.084163136780262, 0.2868502736091614, 0.26298999786376953, 0.2588483393192291, -0.014060648158192635, -0.21609899401664734, -0.05188094452023506, -0.15916407108306885, 0.3642865717411041, -0.05564786121249199, 0.13718882203102112, -0.1274757832288742, -0.17177258431911469, -0.059790875762701035, 0.0933283269405365, -0.21778970956802368, -0.30813199281692505, -0.06042242795228958, 0.33995699882507324, -0.03990950807929039, -0.04706772044301033, -0.027463167905807495, 0.3057284355163574, 0.1097867488861084, 0.3232915699481964, -0.20846343040466309, 0.04787677526473999, -0.07905063033103943, 0.058791935443878174, 0.16147424280643463, -0.005746904760599136, 0.550287663936615, 0.06422661244869232, 0.0827576294541359, -0.4550299644470215, 0.04101371765136719, -0.040541574358940125, -0.07280591130256653, 0.10894006490707397, 0.22567924857139587, 0.24726293981075287, -0.06191921606659889, -0.36291542649269104, 0.32286959886550903, -0.008566070348024368, -0.33640557527542114, 0.28005272150039673, 0.27166590094566345, -0.14974938333034515, -0.24121031165122986, 0.18850746750831604, -0.353957861661911, -0.3645654618740082, 0.09588726609945297, 0.08514538407325745, 0.27941083908081055, -0.08018803596496582, 0.31513988971710205, -0.052724771201610565, 0.2251349687576294, -0.1396666318178177, -0.1602000892162323, -0.09011765569448471, 0.3879828155040741, -0.10942240059375763, -0.3624897599220276, 0.07067736983299255, 0.10923071205615997, -0.012263101525604725, -0.022776179015636444, -0.49136704206466675, -0.43912214040756226, -0.0586189329624176, -0.06296747922897339, -0.31498757004737854, 0.01548515073955059, 0.0672231987118721, 0.14542317390441895, -0.11607758700847626, -0.09162913262844086, -0.22736448049545288, 0.06458864361047745, 0.0768972784280777, 0.3309994041919708, -0.058574918657541275, 0.411710262298584, 0.2297690212726593, 0.019909778609871864, 0.00584014505147934, -0.13140517473220825, 0.6140477657318115, 0.11263645440340042, 0.3036918044090271, -0.1055363118648529, -0.48759526014328003, -0.05930434167385101, -0.006994426250457764, -0.3009335994720459, -0.2788499593734741, -0.1363316774368286, -0.05949841067194939, -0.09853174537420273, 0.08512476086616516, -0.02012932300567627, 0.09336985647678375, -0.18553999066352844, 0.03879851475358009, 0.05488961562514305, -0.28556662797927856, -0.09226623177528381, -0.09372429549694061, -0.04375462234020233, -0.05710690841078758, 0.2522600591182709, 0.34159982204437256, -0.1299227774143219, -0.14834710955619812, -0.016626667231321335, -0.2732453942298889, 0.4063478708267212, 0.13872011005878448, 0.3885350525379181, -0.1061183512210846, 0.022707782685756683, 0.2076321691274643, -0.1498495191335678, 0.493360698223114, -0.1999422013759613, -0.14206089079380035, 0.008977726101875305, 0.12484601885080338, -0.47099441289901733, -0.04782307893037796, 0.011989563703536987, 0.06963776051998138, -0.25989922881126404, 0.5957697033882141, -0.015774846076965332, 0.010713491588830948, 0.06415470689535141, 0.007493361830711365, -0.4021505117416382, -0.21996134519577026, -0.36466723680496216, -0.36327236890792847, -0.3501264750957489, -0.12055060267448425, 0.02136749029159546, 0.059523217380046844, 0.24893322587013245, 0.018065892159938812, 0.04143015295267105, -0.10177899897098541, -0.17392538487911224, -0.20327921211719513, 0.5465952157974243, -0.4622514843940735, 0.17136447131633759, -0.1784375160932541, 0.04953498765826225, 0.5429152250289917, 0.25256577134132385, -0.272407591342926, -0.22448107600212097, 0.2086336612701416, -0.1811966449022293, 0.09950433671474457, -0.020101159811019897, -0.2247089445590973, -0.039665453135967255, -0.10478943586349487, 0.2824459373950958, -0.20428350567817688, -0.3170278072357178, 0.360075443983078, -0.2905513048171997, -0.12862136960029602, 0.13764218986034393, 0.33205533027648926, 0.1727677285671234, 0.17940418422222137, 0.0715818852186203, -0.024893026798963547, -0.10104398429393768, 0.4275776147842407, 0.48721930384635925, 0.8410309553146362, -0.065415158867836, 0.3637359142303467, -0.03740920126438141, -0.3139168918132782, -0.007414024323225021, 0.04606068879365921, 0.06794607639312744, -0.3839375078678131, -0.44326284527778625, -0.07460722327232361, -0.1579577922821045, -0.02599669247865677, 0.0001272503286600113, -0.2726850211620331, -0.023972557857632637, -0.2626406252384186, -0.0488782562315464, -0.24869129061698914, -0.07510309666395187, -0.4291793406009674, -0.23395293951034546, -0.1827024221420288, 0.22474460303783417, -0.04153886437416077, 0.06093453988432884, -0.03594597801566124, -0.0759660005569458, -0.07736749947071075, -0.1276557892560959, -0.403288871049881, -0.06772810965776443, -0.29874956607818604, 0.40608322620391846, -0.14162467420101166, -0.33281394839286804, -0.14779189229011536, 0.3944907486438751, 0.1385461390018463, -0.04560510441660881, 0.0038916952908039093, -0.22316043078899384, 0.062314722687006, 0.06088651716709137, -0.2622636556625366, -0.09927383065223694, 0.2314627766609192, -0.17787712812423706, 0.09466791152954102, -0.05396386608481407, 0.15422281622886658, -0.19130291044712067, -0.017752304673194885, 0.3690420985221863, -0.06284864246845245, -0.044910404831171036, -0.33713841438293457, -0.3546522855758667, -0.17530888319015503, -0.28952187299728394, 0.20370271801948547, 0.2759840190410614, 0.03658343106508255, 0.3743407130241394, -0.16362470388412476, -0.10972857475280762, 0.1342109888792038, 0.544333279132843, 0.11650422215461731, -0.12895473837852478, 0.3010965585708618, -0.16983962059020996, -0.1776038408279419, -0.33406203985214233, 0.3911176025867462, -0.08485348522663116, -0.29709964990615845, 0.4522235691547394, -0.2659975290298462, 0.09892553091049194, -0.13411672413349152, 0.03527456149458885, 0.2476743757724762, 0.0539398193359375, 0.025842301547527313, -0.40739691257476807, -0.5168470144271851, 0.14435678720474243, 0.1066773533821106, 0.33252233266830444, -0.2200893610715866, -0.17351530492305756, 0.11528071016073227, -0.0547378733754158, -0.35790330171585083, 0.29164302349090576, -0.37721988558769226, 0.04004397615790367, 0.1282629370689392, 0.0003440026193857193, -0.07764223217964172, -0.07088486105203629, 0.25604796409606934, 0.3145330548286438, -0.10768771171569824, -0.21292918920516968, -0.005848489701747894, 0.11377325654029846, 0.021964184939861298, -0.27351194620132446, -0.08116640150547028, -0.2242637276649475, -0.13428042829036713, 0.1155378669500351, -0.30229926109313965, 0.18130698800086975, -0.15341731905937195, -0.08665231615304947, 0.11646325141191483, 0.0937434509396553, 0.2892701029777527, 0.004434381611645222, -0.24114647507667542, 0.2728566527366638, 0.14182651042938232, -0.018691452220082283, 0.03289370238780975, -0.16358554363250732, -0.32848435640335083, -0.0526885911822319, -0.08028893172740936, 0.11593534052371979, 0.2549547851085663, -0.26021912693977356, -0.21458546817302704, 0.031060393899679184, 0.37542736530303955, 0.17995819449424744, -0.3606399595737457, 0.06232365965843201, 0.15748725831508636, 0.3051551282405853, -0.016741402447223663, -0.3121994137763977, 0.07349468767642975, -0.17897513508796692, -0.35765331983566284, 0.13011911511421204, -0.000911712646484375, 0.07496558129787445, -0.2177334427833557, 0.0444009006023407, 0.4878174066543579, -0.3925590217113495, 0.028195124119520187, 0.12654291093349457, -0.07393982261419296, 0.12509097158908844, 0.03986778110265732, -0.061330437660217285, 0.44694897532463074, 0.21191254258155823, -0.11841198801994324, 0.29879969358444214, 0.22659197449684143, -0.15691839158535004, 0.19504456222057343, -0.32141420245170593, -0.0027479473501443863, 0.05936824157834053, 0.02565913274884224, 0.10653232038021088, 0.0645144134759903, 0.1684112250804901, -0.04923905432224274, -0.04892580956220627, -0.15365728735923767, 0.306557834148407, -0.19247806072235107, 0.1871172934770584, 0.08527738600969315, -0.1767416149377823, -0.17560148239135742, 0.04051349312067032, -0.11955174803733826, -0.13833937048912048, 0.35015302896499634, 0.3595314919948578, 0.01808731071650982, 0.10643567144870758, -0.11381229013204575, 0.2423899620771408, 0.12314894795417786, -0.33362773060798645, 0.1021973043680191, 0.3771551549434662, -0.01126139983534813, -0.1491526961326599, 0.33231714367866516, 0.6502026319503784, 0.5205176472663879, 0.10396957397460938, 0.06877332925796509, 0.020600665360689163, 0.03930658847093582, 0.027049202471971512, 0.11379742622375488, 0.10493318736553192, 0.3370399475097656, 0.20669235289096832, 0.1970016360282898, -0.12948954105377197, 0.18937011063098907, 0.2372012734413147, 0.1642962247133255, 0.1978883445262909, 0.012826714664697647, -0.15217947959899902, -0.36612313985824585, -0.15895450115203857, -0.026182323694229126, -0.21511557698249817, -0.15423409640789032, 0.1268758922815323, -0.06235358491539955, 0.17887349426746368, 0.11466719210147858, 0.11698716133832932, -0.23693980276584625, 0.38650763034820557, 0.5090125799179077, -0.1169380247592926, -0.39765363931655884, -0.22727999091148376, -0.44204574823379517, 0.1687215268611908, 0.05943717435002327, -0.005614235997200012, 0.014508165419101715, 0.22647668421268463, -0.19892486929893494, -0.06747377663850784, 0.44170236587524414, 0.16981755197048187, -0.041034117341041565, 0.6356558799743652, -0.3783237338066101, 0.0006774584762752056, 0.40569671988487244, -0.15703274309635162, 0.015336789190769196, -0.3836992383003235, 0.2202458679676056, -0.05782502144575119, 0.24727670848369598, -0.16062161326408386, 0.06627460569143295, -0.39454877376556396, 0.2967628538608551, 0.5504470467567444, 0.01685257814824581, 0.031246935948729515, -0.08765284717082977, -0.3352944254875183, 0.19998787343502045, -0.04183846712112427, -0.11275750398635864, 0.1416485607624054, 0.4372154772281647, 0.5372055172920227, -0.1324874758720398, -0.06924180686473846, -0.4107624292373657, 0.2712883949279785, -0.021383658051490784, 0.08942871540784836, -0.1774350106716156, 0.19445708394050598, 0.21437989175319672, -0.23487362265586853, 0.2792143225669861, -0.21022216975688934, 0.13424283266067505, 0.31900453567504883, -0.5583702325820923, -0.4061664044857025, 0.45400652289390564, 0.19457679986953735, -0.15187117457389832, 0.19681806862354279, 0.34316539764404297, 0.09981376677751541, 0.16339638829231262, -0.6086978912353516, -0.19865062832832336, 0.33156874775886536, -0.23096677660942078, -0.239202618598938, 0.25619399547576904, -0.027780668810009956, 0.08274531364440918, 0.07530894875526428, 0.43439164757728577, -0.10755044221878052, -0.15896573662757874, 0.19667655229568481, -0.18355324864387512 ]
https://github.com/huggingface/datasets/issues/5717
You could follow [this](https://cloud.google.com/storage/docs/collaboration#browser) procedure or upload the dataset to Google Drive (50K images is not that much unless high-res) and send me an email with the link.
Errror when saving to disk a dataset of images
### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
28
Errror when saving to disk a dataset of images ### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 You could follow [this](https://cloud.google.com/storage/docs/collaboration#browser) procedure or upload the dataset to Google Drive (50K images is not that much unless high-res) and send me an email with the link.
[ -0.07521145045757294, -0.44404372572898865, -0.10260006785392761, 0.3910185396671295, 0.4102981388568878, 0.2558813691139221, 0.09858540445566177, 0.14438162744045258, -0.23703399300575256, 0.16042831540107727, 0.12004079669713974, 0.2100370079278946, -0.37237343192100525, -0.163156196475029, -0.14881615340709686, -0.06601633876562119, 0.24606919288635254, 0.03519495576620102, 0.31553390622138977, -0.019280478358268738, -0.4303226172924042, 0.19783370196819305, -0.1113562062382698, 0.09576098620891571, -0.27228742837905884, -0.2518807351589203, -0.07265754044055939, 0.03906097263097763, -0.21042500436306, -0.17154012620449066, 0.017110593616962433, -0.3008976876735687, 0.2001149207353592, 0.30391937494277954, -0.00010683824075385928, -0.06346380710601807, 0.1338302344083786, -0.2446221113204956, -0.1711452603340149, -0.18469086289405823, -0.029161572456359863, -0.23259443044662476, -0.09101284295320511, -0.4684022068977356, 0.2943912744522095, -0.39507049322128296, 0.17993436753749847, -0.2451118528842926, 0.36369597911834717, 0.16123627126216888, 0.3394441306591034, 0.011902399361133575, 0.06407707929611206, -0.04979504644870758, 0.2123362123966217, 0.24630074203014374, -0.10447150468826294, 0.2141420692205429, -0.0875370055437088, -0.18472406268119812, 0.3181774616241455, 0.24582964181900024, -0.17366400361061096, 0.021281659603118896, 0.36216437816619873, 0.12314276397228241, 0.14020870625972748, -0.39135026931762695, -0.038269393146038055, -0.24940410256385803, 0.38114824891090393, -0.20504772663116455, -0.3106054365634918, 0.1304585039615631, 0.10274402797222137, -0.17744117975234985, 0.123715341091156, 0.4535548985004425, -0.30707091093063354, -0.020448630675673485, -0.20804595947265625, -0.06651081889867783, -0.28110188245773315, 0.14265312254428864, 0.10370694845914841, -0.36077338457107544, -0.13505321741104126, 0.047490090131759644, 0.35591980814933777, -0.08992345631122589, 0.23759342730045319, -0.1558655947446823, 0.025217805057764053, -0.013141533359885216, -0.06903750449419022, 0.07333274185657501, -0.28681495785713196, 0.0021687988191843033, -0.0037605762481689453, 0.14187319576740265, 0.13929684460163116, -0.182829350233078, 0.10016985237598419, 0.5118119120597839, 0.16544079780578613, 0.07154826819896698, -0.05473723262548447, 0.25718164443969727, 0.25826579332351685, 0.17220374941825867, 0.07092982530593872, -0.23628807067871094, -0.011139418929815292, -0.08605104684829712, 0.6543039679527283, -0.1560084968805313, 0.291303813457489, -0.1396411657333374, -0.346112996339798, 0.33113956451416016, 0.17150026559829712, 0.08249978721141815, -0.21306881308555603, 0.40643012523651123, 0.18383638560771942, 0.01610761694610119, 0.2483498454093933, 0.3640080988407135, 0.09276524931192398, 0.32699909806251526, -0.19953101873397827, 0.05025489255785942, 0.06057003140449524, 0.01128462329506874, -0.0712488517165184, -0.14167657494544983, -0.032544322311878204, -0.07895251363515854, 0.002147434279322624, -0.12808194756507874, 0.05790014564990997, -0.3844551146030426, 0.12698836624622345, 0.21361513435840607, 0.10926977545022964, -0.018329795449972153, 0.18122516572475433, -0.04368593171238899, 0.06269016861915588, 0.3234748840332031, -0.24392817914485931, -0.14761410653591156, -0.5825220942497253, 0.2519259452819824, 0.20470614731311798, 0.18937428295612335, -0.41880130767822266, -0.28549641370773315, 0.532703161239624, -0.06712023913860321, 0.1645340472459793, 0.005608614534139633, -0.23900458216667175, -0.40241342782974243, 0.031858861446380615, 0.06052999943494797, -0.11074275523424149, 0.3362394869327545, -0.18630331754684448, -0.1206112876534462, 0.18576999008655548, 0.279161274433136, 0.0943707823753357, 0.022373739629983902, -0.3228868544101715, 0.20212626457214355, 0.2174447476863861, -0.1931425780057907, -0.2941567301750183, 0.02616206556558609, 0.009151071310043335, -0.22987550497055054, 0.009707003831863403, 0.3027123510837555, 0.25104236602783203, 0.03275531157851219, 0.005905028432607651, 0.12701642513275146, -0.11297629028558731, 0.134468674659729, -0.4011509120464325, 0.0364857017993927, -0.039081402122974396, 0.07814368605613708, -0.08642607927322388, -0.023362748324871063, 0.15075474977493286, -0.11259259283542633, 0.08091743290424347, -0.1435239017009735, 0.19488419592380524, 0.4261718690395355, 0.5107192993164062, -0.1333882063627243, -0.02897782064974308, -0.1044483557343483, -0.3802588880062103, -0.010527841746807098, 0.026425980031490326, -0.15207281708717346, -0.40087080001831055, 0.002535223960876465, -0.11862386763095856, 0.040294088423252106, -0.1852819323539734, 0.08772015571594238, 0.20070911943912506, 0.02182682603597641, -0.228620246052742, 0.19586914777755737, -0.13302363455295563, 0.10301966965198517, -0.06732400506734848, 0.0161990225315094, -0.1804533153772354, 0.6394294500350952, -0.36360448598861694, -0.3987492024898529, -0.09684595465660095, -0.13777363300323486, 0.07341127097606659, 0.05916937440633774, -0.22453834116458893, 0.5005024671554565, 0.09431740641593933, 0.2028811275959015, -0.21213915944099426, -0.24337849020957947, 0.09839238971471786, -0.48302143812179565, 0.02854587323963642, 0.08102963119745255, 0.35732531547546387, 0.09609165787696838, -0.14956983923912048, 0.1470751017332077, -0.07579964399337769, -0.03369344025850296, 0.03924381732940674, 0.21826258301734924, 0.024246864020824432, 0.09217220544815063, 0.19953469932079315, -0.4022337794303894, 0.1265515387058258, 0.1389187127351761, 0.03470625728368759, -0.23187388479709625, -0.14357584714889526, -0.13990244269371033, 0.19486744701862335, 0.18210984766483307, 0.2607106566429138, 0.3337177336215973, 0.12543466687202454, -0.07073107361793518, 0.019383421167731285, 0.4253004789352417, 0.5106462240219116, 0.04017811268568039, -0.3077417016029358, -0.053535424172878265, 0.024117354303598404, 0.06729038804769516, 0.30872470140457153, 0.084163136780262, 0.2868502736091614, 0.26298999786376953, 0.2588483393192291, -0.014060648158192635, -0.21609899401664734, -0.05188094452023506, -0.15916407108306885, 0.3642865717411041, -0.05564786121249199, 0.13718882203102112, -0.1274757832288742, -0.17177258431911469, -0.059790875762701035, 0.0933283269405365, -0.21778970956802368, -0.30813199281692505, -0.06042242795228958, 0.33995699882507324, -0.03990950807929039, -0.04706772044301033, -0.027463167905807495, 0.3057284355163574, 0.1097867488861084, 0.3232915699481964, -0.20846343040466309, 0.04787677526473999, -0.07905063033103943, 0.058791935443878174, 0.16147424280643463, -0.005746904760599136, 0.550287663936615, 0.06422661244869232, 0.0827576294541359, -0.4550299644470215, 0.04101371765136719, -0.040541574358940125, -0.07280591130256653, 0.10894006490707397, 0.22567924857139587, 0.24726293981075287, -0.06191921606659889, -0.36291542649269104, 0.32286959886550903, -0.008566070348024368, -0.33640557527542114, 0.28005272150039673, 0.27166590094566345, -0.14974938333034515, -0.24121031165122986, 0.18850746750831604, -0.353957861661911, -0.3645654618740082, 0.09588726609945297, 0.08514538407325745, 0.27941083908081055, -0.08018803596496582, 0.31513988971710205, -0.052724771201610565, 0.2251349687576294, -0.1396666318178177, -0.1602000892162323, -0.09011765569448471, 0.3879828155040741, -0.10942240059375763, -0.3624897599220276, 0.07067736983299255, 0.10923071205615997, -0.012263101525604725, -0.022776179015636444, -0.49136704206466675, -0.43912214040756226, -0.0586189329624176, -0.06296747922897339, -0.31498757004737854, 0.01548515073955059, 0.0672231987118721, 0.14542317390441895, -0.11607758700847626, -0.09162913262844086, -0.22736448049545288, 0.06458864361047745, 0.0768972784280777, 0.3309994041919708, -0.058574918657541275, 0.411710262298584, 0.2297690212726593, 0.019909778609871864, 0.00584014505147934, -0.13140517473220825, 0.6140477657318115, 0.11263645440340042, 0.3036918044090271, -0.1055363118648529, -0.48759526014328003, -0.05930434167385101, -0.006994426250457764, -0.3009335994720459, -0.2788499593734741, -0.1363316774368286, -0.05949841067194939, -0.09853174537420273, 0.08512476086616516, -0.02012932300567627, 0.09336985647678375, -0.18553999066352844, 0.03879851475358009, 0.05488961562514305, -0.28556662797927856, -0.09226623177528381, -0.09372429549694061, -0.04375462234020233, -0.05710690841078758, 0.2522600591182709, 0.34159982204437256, -0.1299227774143219, -0.14834710955619812, -0.016626667231321335, -0.2732453942298889, 0.4063478708267212, 0.13872011005878448, 0.3885350525379181, -0.1061183512210846, 0.022707782685756683, 0.2076321691274643, -0.1498495191335678, 0.493360698223114, -0.1999422013759613, -0.14206089079380035, 0.008977726101875305, 0.12484601885080338, -0.47099441289901733, -0.04782307893037796, 0.011989563703536987, 0.06963776051998138, -0.25989922881126404, 0.5957697033882141, -0.015774846076965332, 0.010713491588830948, 0.06415470689535141, 0.007493361830711365, -0.4021505117416382, -0.21996134519577026, -0.36466723680496216, -0.36327236890792847, -0.3501264750957489, -0.12055060267448425, 0.02136749029159546, 0.059523217380046844, 0.24893322587013245, 0.018065892159938812, 0.04143015295267105, -0.10177899897098541, -0.17392538487911224, -0.20327921211719513, 0.5465952157974243, -0.4622514843940735, 0.17136447131633759, -0.1784375160932541, 0.04953498765826225, 0.5429152250289917, 0.25256577134132385, -0.272407591342926, -0.22448107600212097, 0.2086336612701416, -0.1811966449022293, 0.09950433671474457, -0.020101159811019897, -0.2247089445590973, -0.039665453135967255, -0.10478943586349487, 0.2824459373950958, -0.20428350567817688, -0.3170278072357178, 0.360075443983078, -0.2905513048171997, -0.12862136960029602, 0.13764218986034393, 0.33205533027648926, 0.1727677285671234, 0.17940418422222137, 0.0715818852186203, -0.024893026798963547, -0.10104398429393768, 0.4275776147842407, 0.48721930384635925, 0.8410309553146362, -0.065415158867836, 0.3637359142303467, -0.03740920126438141, -0.3139168918132782, -0.007414024323225021, 0.04606068879365921, 0.06794607639312744, -0.3839375078678131, -0.44326284527778625, -0.07460722327232361, -0.1579577922821045, -0.02599669247865677, 0.0001272503286600113, -0.2726850211620331, -0.023972557857632637, -0.2626406252384186, -0.0488782562315464, -0.24869129061698914, -0.07510309666395187, -0.4291793406009674, -0.23395293951034546, -0.1827024221420288, 0.22474460303783417, -0.04153886437416077, 0.06093453988432884, -0.03594597801566124, -0.0759660005569458, -0.07736749947071075, -0.1276557892560959, -0.403288871049881, -0.06772810965776443, -0.29874956607818604, 0.40608322620391846, -0.14162467420101166, -0.33281394839286804, -0.14779189229011536, 0.3944907486438751, 0.1385461390018463, -0.04560510441660881, 0.0038916952908039093, -0.22316043078899384, 0.062314722687006, 0.06088651716709137, -0.2622636556625366, -0.09927383065223694, 0.2314627766609192, -0.17787712812423706, 0.09466791152954102, -0.05396386608481407, 0.15422281622886658, -0.19130291044712067, -0.017752304673194885, 0.3690420985221863, -0.06284864246845245, -0.044910404831171036, -0.33713841438293457, -0.3546522855758667, -0.17530888319015503, -0.28952187299728394, 0.20370271801948547, 0.2759840190410614, 0.03658343106508255, 0.3743407130241394, -0.16362470388412476, -0.10972857475280762, 0.1342109888792038, 0.544333279132843, 0.11650422215461731, -0.12895473837852478, 0.3010965585708618, -0.16983962059020996, -0.1776038408279419, -0.33406203985214233, 0.3911176025867462, -0.08485348522663116, -0.29709964990615845, 0.4522235691547394, -0.2659975290298462, 0.09892553091049194, -0.13411672413349152, 0.03527456149458885, 0.2476743757724762, 0.0539398193359375, 0.025842301547527313, -0.40739691257476807, -0.5168470144271851, 0.14435678720474243, 0.1066773533821106, 0.33252233266830444, -0.2200893610715866, -0.17351530492305756, 0.11528071016073227, -0.0547378733754158, -0.35790330171585083, 0.29164302349090576, -0.37721988558769226, 0.04004397615790367, 0.1282629370689392, 0.0003440026193857193, -0.07764223217964172, -0.07088486105203629, 0.25604796409606934, 0.3145330548286438, -0.10768771171569824, -0.21292918920516968, -0.005848489701747894, 0.11377325654029846, 0.021964184939861298, -0.27351194620132446, -0.08116640150547028, -0.2242637276649475, -0.13428042829036713, 0.1155378669500351, -0.30229926109313965, 0.18130698800086975, -0.15341731905937195, -0.08665231615304947, 0.11646325141191483, 0.0937434509396553, 0.2892701029777527, 0.004434381611645222, -0.24114647507667542, 0.2728566527366638, 0.14182651042938232, -0.018691452220082283, 0.03289370238780975, -0.16358554363250732, -0.32848435640335083, -0.0526885911822319, -0.08028893172740936, 0.11593534052371979, 0.2549547851085663, -0.26021912693977356, -0.21458546817302704, 0.031060393899679184, 0.37542736530303955, 0.17995819449424744, -0.3606399595737457, 0.06232365965843201, 0.15748725831508636, 0.3051551282405853, -0.016741402447223663, -0.3121994137763977, 0.07349468767642975, -0.17897513508796692, -0.35765331983566284, 0.13011911511421204, -0.000911712646484375, 0.07496558129787445, -0.2177334427833557, 0.0444009006023407, 0.4878174066543579, -0.3925590217113495, 0.028195124119520187, 0.12654291093349457, -0.07393982261419296, 0.12509097158908844, 0.03986778110265732, -0.061330437660217285, 0.44694897532463074, 0.21191254258155823, -0.11841198801994324, 0.29879969358444214, 0.22659197449684143, -0.15691839158535004, 0.19504456222057343, -0.32141420245170593, -0.0027479473501443863, 0.05936824157834053, 0.02565913274884224, 0.10653232038021088, 0.0645144134759903, 0.1684112250804901, -0.04923905432224274, -0.04892580956220627, -0.15365728735923767, 0.306557834148407, -0.19247806072235107, 0.1871172934770584, 0.08527738600969315, -0.1767416149377823, -0.17560148239135742, 0.04051349312067032, -0.11955174803733826, -0.13833937048912048, 0.35015302896499634, 0.3595314919948578, 0.01808731071650982, 0.10643567144870758, -0.11381229013204575, 0.2423899620771408, 0.12314894795417786, -0.33362773060798645, 0.1021973043680191, 0.3771551549434662, -0.01126139983534813, -0.1491526961326599, 0.33231714367866516, 0.6502026319503784, 0.5205176472663879, 0.10396957397460938, 0.06877332925796509, 0.020600665360689163, 0.03930658847093582, 0.027049202471971512, 0.11379742622375488, 0.10493318736553192, 0.3370399475097656, 0.20669235289096832, 0.1970016360282898, -0.12948954105377197, 0.18937011063098907, 0.2372012734413147, 0.1642962247133255, 0.1978883445262909, 0.012826714664697647, -0.15217947959899902, -0.36612313985824585, -0.15895450115203857, -0.026182323694229126, -0.21511557698249817, -0.15423409640789032, 0.1268758922815323, -0.06235358491539955, 0.17887349426746368, 0.11466719210147858, 0.11698716133832932, -0.23693980276584625, 0.38650763034820557, 0.5090125799179077, -0.1169380247592926, -0.39765363931655884, -0.22727999091148376, -0.44204574823379517, 0.1687215268611908, 0.05943717435002327, -0.005614235997200012, 0.014508165419101715, 0.22647668421268463, -0.19892486929893494, -0.06747377663850784, 0.44170236587524414, 0.16981755197048187, -0.041034117341041565, 0.6356558799743652, -0.3783237338066101, 0.0006774584762752056, 0.40569671988487244, -0.15703274309635162, 0.015336789190769196, -0.3836992383003235, 0.2202458679676056, -0.05782502144575119, 0.24727670848369598, -0.16062161326408386, 0.06627460569143295, -0.39454877376556396, 0.2967628538608551, 0.5504470467567444, 0.01685257814824581, 0.031246935948729515, -0.08765284717082977, -0.3352944254875183, 0.19998787343502045, -0.04183846712112427, -0.11275750398635864, 0.1416485607624054, 0.4372154772281647, 0.5372055172920227, -0.1324874758720398, -0.06924180686473846, -0.4107624292373657, 0.2712883949279785, -0.021383658051490784, 0.08942871540784836, -0.1774350106716156, 0.19445708394050598, 0.21437989175319672, -0.23487362265586853, 0.2792143225669861, -0.21022216975688934, 0.13424283266067505, 0.31900453567504883, -0.5583702325820923, -0.4061664044857025, 0.45400652289390564, 0.19457679986953735, -0.15187117457389832, 0.19681806862354279, 0.34316539764404297, 0.09981376677751541, 0.16339638829231262, -0.6086978912353516, -0.19865062832832336, 0.33156874775886536, -0.23096677660942078, -0.239202618598938, 0.25619399547576904, -0.027780668810009956, 0.08274531364440918, 0.07530894875526428, 0.43439164757728577, -0.10755044221878052, -0.15896573662757874, 0.19667655229568481, -0.18355324864387512 ]
https://github.com/huggingface/datasets/issues/5717
Thanks @jplu! I managed to reproduce the `TypeError` - it stems from [this](https://github.com/huggingface/datasets/blob/e3f4f124a1b118a5bfff5bae76b25a68aedbebbc/src/datasets/features/image.py#L258-L264) line, which can return a `ChunkedArray` (its mask is also chunked then, which Arrow does not allow) when the embedded data is too big to fit in a standard `Array`. I'm working on a fix.
Errror when saving to disk a dataset of images
### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0
48
Errror when saving to disk a dataset of images ### Describe the bug Hello! I have an issue when I try to save on disk my dataset of images. The error I get is: ``` Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1442, in save_to_disk for job_id, done, content in Dataset._save_to_disk_single(**kwargs): File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_dataset.py", line 1473, in _save_to_disk_single writer.write_table(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/arrow_writer.py", line 570, in write_table pa_table = embed_table_storage(pa_table) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2268, in embed_table_storage arrays = [ File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2269, in <listcomp> embed_array_storage(table[name], feature) if require_storage_embed(feature) else table[name] File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in wrapper return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 1817, in <listcomp> return pa.chunked_array([func(chunk, *args, **kwargs) for chunk in array.chunks]) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/table.py", line 2142, in embed_array_storage return feature.embed_storage(array) File "/home/jplu/miniconda3/envs/image-xp/lib/python3.10/site-packages/datasets/features/image.py", line 269, in embed_storage storage = pa.StructArray.from_arrays([bytes_array, path_array], ["bytes", "path"], mask=bytes_array.is_null()) File "pyarrow/array.pxi", line 2766, in pyarrow.lib.StructArray.from_arrays File "pyarrow/array.pxi", line 2961, in pyarrow.lib.c_mask_inverted_from_obj TypeError: Mask must be a pyarrow.Array of type boolean ``` My dataset is around 50K images, is this error might be due to a bad image? Thanks for the help. ### Steps to reproduce the bug ```python from datasets import load_dataset dataset = load_dataset("imagefolder", data_dir="/path/to/dataset") dataset["train"].save_to_disk("./myds", num_shards=40) ``` ### Expected behavior Having my dataset properly saved to disk. ### Environment info - `datasets` version: 2.11.0 - Platform: Linux-5.15.90.1-microsoft-standard-WSL2-x86_64-with-glibc2.35 - Python version: 3.10.10 - Huggingface_hub version: 0.13.3 - PyArrow version: 11.0.0 - Pandas version: 2.0.0 Thanks @jplu! I managed to reproduce the `TypeError` - it stems from [this](https://github.com/huggingface/datasets/blob/e3f4f124a1b118a5bfff5bae76b25a68aedbebbc/src/datasets/features/image.py#L258-L264) line, which can return a `ChunkedArray` (its mask is also chunked then, which Arrow does not allow) when the embedded data is too big to fit in a standard `Array`. I'm working on a fix.
[ -0.07521145045757294, -0.44404372572898865, -0.10260006785392761, 0.3910185396671295, 0.4102981388568878, 0.2558813691139221, 0.09858540445566177, 0.14438162744045258, -0.23703399300575256, 0.16042831540107727, 0.12004079669713974, 0.2100370079278946, -0.37237343192100525, -0.163156196475029, -0.14881615340709686, -0.06601633876562119, 0.24606919288635254, 0.03519495576620102, 0.31553390622138977, -0.019280478358268738, -0.4303226172924042, 0.19783370196819305, -0.1113562062382698, 0.09576098620891571, -0.27228742837905884, -0.2518807351589203, -0.07265754044055939, 0.03906097263097763, -0.21042500436306, -0.17154012620449066, 0.017110593616962433, -0.3008976876735687, 0.2001149207353592, 0.30391937494277954, -0.00010683824075385928, -0.06346380710601807, 0.1338302344083786, -0.2446221113204956, -0.1711452603340149, -0.18469086289405823, -0.029161572456359863, -0.23259443044662476, -0.09101284295320511, -0.4684022068977356, 0.2943912744522095, -0.39507049322128296, 0.17993436753749847, -0.2451118528842926, 0.36369597911834717, 0.16123627126216888, 0.3394441306591034, 0.011902399361133575, 0.06407707929611206, -0.04979504644870758, 0.2123362123966217, 0.24630074203014374, -0.10447150468826294, 0.2141420692205429, -0.0875370055437088, -0.18472406268119812, 0.3181774616241455, 0.24582964181900024, -0.17366400361061096, 0.021281659603118896, 0.36216437816619873, 0.12314276397228241, 0.14020870625972748, -0.39135026931762695, -0.038269393146038055, -0.24940410256385803, 0.38114824891090393, -0.20504772663116455, -0.3106054365634918, 0.1304585039615631, 0.10274402797222137, -0.17744117975234985, 0.123715341091156, 0.4535548985004425, -0.30707091093063354, -0.020448630675673485, -0.20804595947265625, -0.06651081889867783, -0.28110188245773315, 0.14265312254428864, 0.10370694845914841, -0.36077338457107544, -0.13505321741104126, 0.047490090131759644, 0.35591980814933777, -0.08992345631122589, 0.23759342730045319, -0.1558655947446823, 0.025217805057764053, -0.013141533359885216, -0.06903750449419022, 0.07333274185657501, -0.28681495785713196, 0.0021687988191843033, -0.0037605762481689453, 0.14187319576740265, 0.13929684460163116, -0.182829350233078, 0.10016985237598419, 0.5118119120597839, 0.16544079780578613, 0.07154826819896698, -0.05473723262548447, 0.25718164443969727, 0.25826579332351685, 0.17220374941825867, 0.07092982530593872, -0.23628807067871094, -0.011139418929815292, -0.08605104684829712, 0.6543039679527283, -0.1560084968805313, 0.291303813457489, -0.1396411657333374, -0.346112996339798, 0.33113956451416016, 0.17150026559829712, 0.08249978721141815, -0.21306881308555603, 0.40643012523651123, 0.18383638560771942, 0.01610761694610119, 0.2483498454093933, 0.3640080988407135, 0.09276524931192398, 0.32699909806251526, -0.19953101873397827, 0.05025489255785942, 0.06057003140449524, 0.01128462329506874, -0.0712488517165184, -0.14167657494544983, -0.032544322311878204, -0.07895251363515854, 0.002147434279322624, -0.12808194756507874, 0.05790014564990997, -0.3844551146030426, 0.12698836624622345, 0.21361513435840607, 0.10926977545022964, -0.018329795449972153, 0.18122516572475433, -0.04368593171238899, 0.06269016861915588, 0.3234748840332031, -0.24392817914485931, -0.14761410653591156, -0.5825220942497253, 0.2519259452819824, 0.20470614731311798, 0.18937428295612335, -0.41880130767822266, -0.28549641370773315, 0.532703161239624, -0.06712023913860321, 0.1645340472459793, 0.005608614534139633, -0.23900458216667175, -0.40241342782974243, 0.031858861446380615, 0.06052999943494797, -0.11074275523424149, 0.3362394869327545, -0.18630331754684448, -0.1206112876534462, 0.18576999008655548, 0.279161274433136, 0.0943707823753357, 0.022373739629983902, -0.3228868544101715, 0.20212626457214355, 0.2174447476863861, -0.1931425780057907, -0.2941567301750183, 0.02616206556558609, 0.009151071310043335, -0.22987550497055054, 0.009707003831863403, 0.3027123510837555, 0.25104236602783203, 0.03275531157851219, 0.005905028432607651, 0.12701642513275146, -0.11297629028558731, 0.134468674659729, -0.4011509120464325, 0.0364857017993927, -0.039081402122974396, 0.07814368605613708, -0.08642607927322388, -0.023362748324871063, 0.15075474977493286, -0.11259259283542633, 0.08091743290424347, -0.1435239017009735, 0.19488419592380524, 0.4261718690395355, 0.5107192993164062, -0.1333882063627243, -0.02897782064974308, -0.1044483557343483, -0.3802588880062103, -0.010527841746807098, 0.026425980031490326, -0.15207281708717346, -0.40087080001831055, 0.002535223960876465, -0.11862386763095856, 0.040294088423252106, -0.1852819323539734, 0.08772015571594238, 0.20070911943912506, 0.02182682603597641, -0.228620246052742, 0.19586914777755737, -0.13302363455295563, 0.10301966965198517, -0.06732400506734848, 0.0161990225315094, -0.1804533153772354, 0.6394294500350952, -0.36360448598861694, -0.3987492024898529, -0.09684595465660095, -0.13777363300323486, 0.07341127097606659, 0.05916937440633774, -0.22453834116458893, 0.5005024671554565, 0.09431740641593933, 0.2028811275959015, -0.21213915944099426, -0.24337849020957947, 0.09839238971471786, -0.48302143812179565, 0.02854587323963642, 0.08102963119745255, 0.35732531547546387, 0.09609165787696838, -0.14956983923912048, 0.1470751017332077, -0.07579964399337769, -0.03369344025850296, 0.03924381732940674, 0.21826258301734924, 0.024246864020824432, 0.09217220544815063, 0.19953469932079315, -0.4022337794303894, 0.1265515387058258, 0.1389187127351761, 0.03470625728368759, -0.23187388479709625, -0.14357584714889526, -0.13990244269371033, 0.19486744701862335, 0.18210984766483307, 0.2607106566429138, 0.3337177336215973, 0.12543466687202454, -0.07073107361793518, 0.019383421167731285, 0.4253004789352417, 0.5106462240219116, 0.04017811268568039, -0.3077417016029358, -0.053535424172878265, 0.024117354303598404, 0.06729038804769516, 0.30872470140457153, 0.084163136780262, 0.2868502736091614, 0.26298999786376953, 0.2588483393192291, -0.014060648158192635, -0.21609899401664734, -0.05188094452023506, -0.15916407108306885, 0.3642865717411041, -0.05564786121249199, 0.13718882203102112, -0.1274757832288742, -0.17177258431911469, -0.059790875762701035, 0.0933283269405365, -0.21778970956802368, -0.30813199281692505, -0.06042242795228958, 0.33995699882507324, -0.03990950807929039, -0.04706772044301033, -0.027463167905807495, 0.3057284355163574, 0.1097867488861084, 0.3232915699481964, -0.20846343040466309, 0.04787677526473999, -0.07905063033103943, 0.058791935443878174, 0.16147424280643463, -0.005746904760599136, 0.550287663936615, 0.06422661244869232, 0.0827576294541359, -0.4550299644470215, 0.04101371765136719, -0.040541574358940125, -0.07280591130256653, 0.10894006490707397, 0.22567924857139587, 0.24726293981075287, -0.06191921606659889, -0.36291542649269104, 0.32286959886550903, -0.008566070348024368, -0.33640557527542114, 0.28005272150039673, 0.27166590094566345, -0.14974938333034515, -0.24121031165122986, 0.18850746750831604, -0.353957861661911, -0.3645654618740082, 0.09588726609945297, 0.08514538407325745, 0.27941083908081055, -0.08018803596496582, 0.31513988971710205, -0.052724771201610565, 0.2251349687576294, -0.1396666318178177, -0.1602000892162323, -0.09011765569448471, 0.3879828155040741, -0.10942240059375763, -0.3624897599220276, 0.07067736983299255, 0.10923071205615997, -0.012263101525604725, -0.022776179015636444, -0.49136704206466675, -0.43912214040756226, -0.0586189329624176, -0.06296747922897339, -0.31498757004737854, 0.01548515073955059, 0.0672231987118721, 0.14542317390441895, -0.11607758700847626, -0.09162913262844086, -0.22736448049545288, 0.06458864361047745, 0.0768972784280777, 0.3309994041919708, -0.058574918657541275, 0.411710262298584, 0.2297690212726593, 0.019909778609871864, 0.00584014505147934, -0.13140517473220825, 0.6140477657318115, 0.11263645440340042, 0.3036918044090271, -0.1055363118648529, -0.48759526014328003, -0.05930434167385101, -0.006994426250457764, -0.3009335994720459, -0.2788499593734741, -0.1363316774368286, -0.05949841067194939, -0.09853174537420273, 0.08512476086616516, -0.02012932300567627, 0.09336985647678375, -0.18553999066352844, 0.03879851475358009, 0.05488961562514305, -0.28556662797927856, -0.09226623177528381, -0.09372429549694061, -0.04375462234020233, -0.05710690841078758, 0.2522600591182709, 0.34159982204437256, -0.1299227774143219, -0.14834710955619812, -0.016626667231321335, -0.2732453942298889, 0.4063478708267212, 0.13872011005878448, 0.3885350525379181, -0.1061183512210846, 0.022707782685756683, 0.2076321691274643, -0.1498495191335678, 0.493360698223114, -0.1999422013759613, -0.14206089079380035, 0.008977726101875305, 0.12484601885080338, -0.47099441289901733, -0.04782307893037796, 0.011989563703536987, 0.06963776051998138, -0.25989922881126404, 0.5957697033882141, -0.015774846076965332, 0.010713491588830948, 0.06415470689535141, 0.007493361830711365, -0.4021505117416382, -0.21996134519577026, -0.36466723680496216, -0.36327236890792847, -0.3501264750957489, -0.12055060267448425, 0.02136749029159546, 0.059523217380046844, 0.24893322587013245, 0.018065892159938812, 0.04143015295267105, -0.10177899897098541, -0.17392538487911224, -0.20327921211719513, 0.5465952157974243, -0.4622514843940735, 0.17136447131633759, -0.1784375160932541, 0.04953498765826225, 0.5429152250289917, 0.25256577134132385, -0.272407591342926, -0.22448107600212097, 0.2086336612701416, -0.1811966449022293, 0.09950433671474457, -0.020101159811019897, -0.2247089445590973, -0.039665453135967255, -0.10478943586349487, 0.2824459373950958, -0.20428350567817688, -0.3170278072357178, 0.360075443983078, -0.2905513048171997, -0.12862136960029602, 0.13764218986034393, 0.33205533027648926, 0.1727677285671234, 0.17940418422222137, 0.0715818852186203, -0.024893026798963547, -0.10104398429393768, 0.4275776147842407, 0.48721930384635925, 0.8410309553146362, -0.065415158867836, 0.3637359142303467, -0.03740920126438141, -0.3139168918132782, -0.007414024323225021, 0.04606068879365921, 0.06794607639312744, -0.3839375078678131, -0.44326284527778625, -0.07460722327232361, -0.1579577922821045, -0.02599669247865677, 0.0001272503286600113, -0.2726850211620331, -0.023972557857632637, -0.2626406252384186, -0.0488782562315464, -0.24869129061698914, -0.07510309666395187, -0.4291793406009674, -0.23395293951034546, -0.1827024221420288, 0.22474460303783417, -0.04153886437416077, 0.06093453988432884, -0.03594597801566124, -0.0759660005569458, -0.07736749947071075, -0.1276557892560959, -0.403288871049881, -0.06772810965776443, -0.29874956607818604, 0.40608322620391846, -0.14162467420101166, -0.33281394839286804, -0.14779189229011536, 0.3944907486438751, 0.1385461390018463, -0.04560510441660881, 0.0038916952908039093, -0.22316043078899384, 0.062314722687006, 0.06088651716709137, -0.2622636556625366, -0.09927383065223694, 0.2314627766609192, -0.17787712812423706, 0.09466791152954102, -0.05396386608481407, 0.15422281622886658, -0.19130291044712067, -0.017752304673194885, 0.3690420985221863, -0.06284864246845245, -0.044910404831171036, -0.33713841438293457, -0.3546522855758667, -0.17530888319015503, -0.28952187299728394, 0.20370271801948547, 0.2759840190410614, 0.03658343106508255, 0.3743407130241394, -0.16362470388412476, -0.10972857475280762, 0.1342109888792038, 0.544333279132843, 0.11650422215461731, -0.12895473837852478, 0.3010965585708618, -0.16983962059020996, -0.1776038408279419, -0.33406203985214233, 0.3911176025867462, -0.08485348522663116, -0.29709964990615845, 0.4522235691547394, -0.2659975290298462, 0.09892553091049194, -0.13411672413349152, 0.03527456149458885, 0.2476743757724762, 0.0539398193359375, 0.025842301547527313, -0.40739691257476807, -0.5168470144271851, 0.14435678720474243, 0.1066773533821106, 0.33252233266830444, -0.2200893610715866, -0.17351530492305756, 0.11528071016073227, -0.0547378733754158, -0.35790330171585083, 0.29164302349090576, -0.37721988558769226, 0.04004397615790367, 0.1282629370689392, 0.0003440026193857193, -0.07764223217964172, -0.07088486105203629, 0.25604796409606934, 0.3145330548286438, -0.10768771171569824, -0.21292918920516968, -0.005848489701747894, 0.11377325654029846, 0.021964184939861298, -0.27351194620132446, -0.08116640150547028, -0.2242637276649475, -0.13428042829036713, 0.1155378669500351, -0.30229926109313965, 0.18130698800086975, -0.15341731905937195, -0.08665231615304947, 0.11646325141191483, 0.0937434509396553, 0.2892701029777527, 0.004434381611645222, -0.24114647507667542, 0.2728566527366638, 0.14182651042938232, -0.018691452220082283, 0.03289370238780975, -0.16358554363250732, -0.32848435640335083, -0.0526885911822319, -0.08028893172740936, 0.11593534052371979, 0.2549547851085663, -0.26021912693977356, -0.21458546817302704, 0.031060393899679184, 0.37542736530303955, 0.17995819449424744, -0.3606399595737457, 0.06232365965843201, 0.15748725831508636, 0.3051551282405853, -0.016741402447223663, -0.3121994137763977, 0.07349468767642975, -0.17897513508796692, -0.35765331983566284, 0.13011911511421204, -0.000911712646484375, 0.07496558129787445, -0.2177334427833557, 0.0444009006023407, 0.4878174066543579, -0.3925590217113495, 0.028195124119520187, 0.12654291093349457, -0.07393982261419296, 0.12509097158908844, 0.03986778110265732, -0.061330437660217285, 0.44694897532463074, 0.21191254258155823, -0.11841198801994324, 0.29879969358444214, 0.22659197449684143, -0.15691839158535004, 0.19504456222057343, -0.32141420245170593, -0.0027479473501443863, 0.05936824157834053, 0.02565913274884224, 0.10653232038021088, 0.0645144134759903, 0.1684112250804901, -0.04923905432224274, -0.04892580956220627, -0.15365728735923767, 0.306557834148407, -0.19247806072235107, 0.1871172934770584, 0.08527738600969315, -0.1767416149377823, -0.17560148239135742, 0.04051349312067032, -0.11955174803733826, -0.13833937048912048, 0.35015302896499634, 0.3595314919948578, 0.01808731071650982, 0.10643567144870758, -0.11381229013204575, 0.2423899620771408, 0.12314894795417786, -0.33362773060798645, 0.1021973043680191, 0.3771551549434662, -0.01126139983534813, -0.1491526961326599, 0.33231714367866516, 0.6502026319503784, 0.5205176472663879, 0.10396957397460938, 0.06877332925796509, 0.020600665360689163, 0.03930658847093582, 0.027049202471971512, 0.11379742622375488, 0.10493318736553192, 0.3370399475097656, 0.20669235289096832, 0.1970016360282898, -0.12948954105377197, 0.18937011063098907, 0.2372012734413147, 0.1642962247133255, 0.1978883445262909, 0.012826714664697647, -0.15217947959899902, -0.36612313985824585, -0.15895450115203857, -0.026182323694229126, -0.21511557698249817, -0.15423409640789032, 0.1268758922815323, -0.06235358491539955, 0.17887349426746368, 0.11466719210147858, 0.11698716133832932, -0.23693980276584625, 0.38650763034820557, 0.5090125799179077, -0.1169380247592926, -0.39765363931655884, -0.22727999091148376, -0.44204574823379517, 0.1687215268611908, 0.05943717435002327, -0.005614235997200012, 0.014508165419101715, 0.22647668421268463, -0.19892486929893494, -0.06747377663850784, 0.44170236587524414, 0.16981755197048187, -0.041034117341041565, 0.6356558799743652, -0.3783237338066101, 0.0006774584762752056, 0.40569671988487244, -0.15703274309635162, 0.015336789190769196, -0.3836992383003235, 0.2202458679676056, -0.05782502144575119, 0.24727670848369598, -0.16062161326408386, 0.06627460569143295, -0.39454877376556396, 0.2967628538608551, 0.5504470467567444, 0.01685257814824581, 0.031246935948729515, -0.08765284717082977, -0.3352944254875183, 0.19998787343502045, -0.04183846712112427, -0.11275750398635864, 0.1416485607624054, 0.4372154772281647, 0.5372055172920227, -0.1324874758720398, -0.06924180686473846, -0.4107624292373657, 0.2712883949279785, -0.021383658051490784, 0.08942871540784836, -0.1774350106716156, 0.19445708394050598, 0.21437989175319672, -0.23487362265586853, 0.2792143225669861, -0.21022216975688934, 0.13424283266067505, 0.31900453567504883, -0.5583702325820923, -0.4061664044857025, 0.45400652289390564, 0.19457679986953735, -0.15187117457389832, 0.19681806862354279, 0.34316539764404297, 0.09981376677751541, 0.16339638829231262, -0.6086978912353516, -0.19865062832832336, 0.33156874775886536, -0.23096677660942078, -0.239202618598938, 0.25619399547576904, -0.027780668810009956, 0.08274531364440918, 0.07530894875526428, 0.43439164757728577, -0.10755044221878052, -0.15896573662757874, 0.19667655229568481, -0.18355324864387512 ]